Textures in OpenGL | How to Code Minecraft Ep. 4
Вставка
- Опубліковано 9 лип 2024
- Join the Discord: / discord
Follow me on Twitch: / gameswthgabe
In this episode I go over textures in OpenGL. There are several different ideas related to textures. Some of the concepts I go over include things like mipmapping, anisotropic filtering, texture sample filtering and more. By the end of this episode, you should be able to create a small field of cubes if you've also completed the past few episodes :)
Challenges: github.com/codingminecraft/Mi...
My code: github.com/codingminecraft/Mi...
NOTE: This is super helpful to print out any OpenGL state errors. It catches a lot of simple bugs.
OpenGL Error Callback: www.khronos.org/opengl/wiki/O...
STB Image Library: github.com/nothings/stb/blob/...
glTexParameter: www.khronos.org/registry/Open...
glTexImage2D: www.khronos.org/registry/Open...
GLSL Sampler Types: www.khronos.org/opengl/wiki/S...
GLSL texture Functions: www.khronos.org/opengl/wiki/S...
--- Bookmarks ---
0:00 Intro
1:13 The Anatomy of a Cube
2:57 UVs (Concept)
6:16 Texture Slots (Concept)
6:59 Texture Use Cases
10:26 Texture Parameters
13:08 Loading an Image with STB (Code)
14:03 Generating a Texture (Code)
14:21 Setting Texture Parameters (Code)
16:14 Uploading Pixels to the GPU (Code)
18:25 Textures in a Shader (Code)
19:46 Texture Slots (Code)
21:48 Debugging
24:35 Challenges
--- Music ---
"Night Snow", by Asher Fulero (from UA-cam Studio Audio Library)
"The World's Fair", by Godmode (from UA-cam Studio Audio Library)
"Dolphin-esque", by Godmode (from UA-cam Studio Audio Library)
"No. 7 Alone With My Thoughts", by Esther Abrami (from UA-cam Studio Audio Library)
"Web Weaver's Dance", by Asher Fulero (from UA-cam Studio Audio Library)
"Bike Sharing to Paradise", by Dan Bodan (From UA-cam Studio Audio Library)
-- Other Credits --
Image of Ed Catmull: www.prhspeakers.com/speaker/e...
Ed Catmull's Paper: ia801307.us.archive.org/2/ite...
Arrows icons created by Creative Stall Premium - Flaticon: www.flaticon.com/free-icons/a...
---------------------------------------------------------------------
Website: ambrosiogabe.github.io/
Github: github.com/ambrosiogabe
Here are some books I recommend if you want to learn about game engine development more thoroughly. I do not profit off any of these sales, these are just some books that have helped me out :)
My Recommended Game Engine Books:
Game Engine Architecture: www.gameenginebook.com/
Game Physics Cookbook (Read this before the next physics book): www.amazon.com/Game-Physics-C...
Game Physics (Ian Millington): www.amazon.com/Game-Physics-E...
Game Programming Patterns (Free): gameprogrammingpatterns.com/
My Recommended Beginning Game Programming Books:
JavaScript Game Design: www.apress.com/gp/book/978143...
My Recommended Java Books:
Data Structures/Algorithms: www.amazon.com/Data-Structure...
LWJGL (Free, but I haven't read this thoroughly): lwjglgamedev.gitbooks.io/3d-g...
I haven't done too much OpenGL but when I did, I HATED textures. Really enjoying the series so far :)
Whoa man didnt expect to see you here lmao
Is there going to be a Part 5?
this is exactly what I was always curious about.
thank you so much for making these!
this is amazing! thanks for the good work you put in this series
You make tutorials as interesting to watch as videos from reducible or standup maths its actually amazing keep up the good work
this series is epic, best of luck making the next vid
this was a treat to watch. thank you.
This was very interesting. Great info
Amazing content quality!
I just learned so much about the settings that i use in games
Random fact, texture element or “texel” is the same as picture element or “pixel” which maybe should be called picel instead for consistency.
but then we would need to start calling voxels volels...
This is the first time I've ever heard that connection. I never bothered to look up why it's called a texel, but that makes so much sense now haha
There is actually a difference here. Yes, a texel refers to a single pixel of a texture, but there is also "texel density", which refers to how many pixels of a single texture occupy any given triangle, hence why it's called a texel and not a pixel.
en.m.wikipedia.org/wiki/Texel_(graphics)
yeah ok...
@@Zilten_ lel
Thank you for your brilliant content
Man you really have that narrator/tutor talent with all those sounds like I am watching history channel or Discovery
I like how you use Minecraft as the concept because of its popularity, nice strategy for UA-cam algorithm
Great video! I have been waiting for it this whole month.
Thanks! And sorry it took so long haha. It's been a struggle balancing everything the past month, but hopefully they'll be coming a bit more regularly from here :)
@@GamesWithGabe Nothing to apologise for man, take your time! As long as the quality is as good as it has been, I think I speak for everyone when I say I don't mind waiting a couple of months :)
@@GamesWithGabe :death: what happend to the series
Great video! I will have to dig into graphics programming when I have some off-time from university & work again :D
Thanks! Graphics programming can be a pain, but it usually yields really cool apps that you can show off :D
nice, maybe one day i will really learn opengl it looks fun
Perfect! 💥👏🏻
Funny you mention that about the sized and internal format, lol.
I got so fed up with it that I took the table from the doc page, read all the rules and values and made functions an some template magic for validation and mapping between sized/internal format.. big headache but at least they're enforced via concepts at compile time now, phew.
I've already tried to make a minecraft clone few months before you started this series. I blocked on multithreading and "face discarding" between chuncks. I'm waiting for the next epsodes!
Look up how minecraft did it, there's articles on it
@@BusinessWolf1 If u have any link i would be happy !
Hi this series is amazing. Will there be more or is this the end? Thanks
Is there going to be new videos?
I will pay you to continue this tutorial series 🙏 Seriously. Let me know.
Nice series of videos here showcasing different coding things. If you ever decide to bring this to a prototype state, it would be cool to make some play test type of videos where you demonstrate certain mechanics and then explain how those things are coded, inventories, player stats, player physics, mobs movement mechanics, multiplayer servers...etc. Also maybe even try addressing/fixing some of the issues present in the Minecraft from a coder's perspective and maybe even try adding better systems or better ways to do existing system than how Minecraft implemented them.
Although this isn't exactly what you are looking for, you might enjoy Gabe's crumble series. He posts devlogs for it every so often.
He already does this, but they're typically 1-3 hour long videos.
13:56 it's in fact grayscale, grayalpha, RGB and RGBA, so it's not really a direct relation between GL_RED, GL_RG, GL_RGB and GL_RGBA; it can be used to store them though
curios fact about arbitrary txture data, the new unreal nanite tech basically transform mesh data into 2D arrays of x,y,z positions and use the innate texture sampling and filtering of GPUs to retrive different but contnous lods meshes and not pop in like discrete classical lod models
There's actually technically a 3rd dimension in UV mapping, the W dimension, which makes sense because then in order you get the coordinates UVWXYZ.
Aaaahhhhhhh my brain 🤯
cant wait for the next 1111111
Talking about the video where you made a Mario level, can you make 1 or 2 more part(s) about bossfights and level tranzitions plz?
Hello, I don't want to sound rude or anything, but I really love your channel and its been so long since you posted something. Are you alright or busy? I wish you would keep making these videos
You might have noticed already a month later, but he works on an animation program for his videos, since he struggled a lot in the previous ones.
Hey could youaubey make a .jar for geometry dash so It can be loaded in J2ME loader it would be cool I mean I have the original but I really want to play the Java version on mobile.
I don't know how I got here, I'm not interested in minecraft coding, but I watched the whole damn video
Where is the other thumbnail /s :) good video
Could you add survival mode (including fall damage and progression) and tools, as well as player models?
I'm working on it right now :)
@@GamesWithGabe Cool!
Can anyone tell me if it's possible at all to take this to android?
Small mistake in the video - OpenGL is only deprecated past 4.1 on MacOS
I've never used MacOS, but I've heard of people having issues running a few features past 3.3
@@bennyuoppd33 Yes - the Apple OpenGL drivers are a bit iffy
This came out and no one told me!?!
cool
Will the series continue?
Did you use manim for the text? if so I don't see a link to it in the description, for credits
I do use manim community edition and I don't try to hide that fact, so I didn't mean anything malicious by this haha. Manim is MIT license which only requires that you redistribute a copy of the license with any changes made. But that's besides the point, the animations are a byproduct of manim. The tool itself is OSS, which means you can use it however you want and you are not required to give credit. For example, blender is also OSS, but that doesn't mean you're forced to add credits that say created with blender every time you use it. Same deal with Da Vinci Resolve free edition, which isn't OSS. Or the Linux operating system. You don't have to credit it everytime you create something on a Linux OS haha.
Anyways, this wasn't malicious behavior on my part and I'll update the description. It just never occurred to me to do that since that's not how copyright works :)
you said you were going to use opengl because it was simpler than both directx and vulkan; however, if you had rather used one of those two instead, what would have changed, exactly of what you have done until now would be harder or easier to do in say, directx?
I think I just said OpenGL is one of the simpler APIs. I didn't mean to say it's simpler than DX, although it definitely is simpler than vulkan from what I hear haha. The main reason I use it is because DX is vendor locked to Microsoft, and Vulkan requires more boilerplate. But most of the concepts are transferable, they just use different terminology and syntax, and sometimes require more work :)
hey Gabe, I have a question, do I need to know javafx or swing before I start your course on 2d game engine or is it that I do not need to know javafx or swing to start using openGL?
thank you for your amazing videos I hope you reach new heights in your life.
This is probably a better question for the 2d game engine episodes haha. But JavaFX and swing are orthogonal to OpenGL. You don't need to know them. They're software renderers, which means they don't use the GPU for any rendering. Whereas OpenGL is a hardware accelerated rendering API, so it allows you to leverage the GPU :)
@@GamesWithGabe thank you Gabe
So no more updates?
WHERE.. NEW... VIDEO¿¿¿¡
Pls we need the cubemap video
What programs do you use for editing your videos
ua-cam.com/video/iydG-e1dQGA/v-deo.html
I subscribed to your channel when you had like 552 - 998 subscribers out there and now I see your channel and you have more than 38K subs wow...
Thanks for sticking with me for so long :D . And I'm just as amazed as you haha
Is this the end to the series?
It shouldn't be. I've just run into major burnout and don't want to make any promises on when I'll be uploading the next episode. I have the video edited halfway, but working on the animation editor has taken much longer than I expected :/
@@GamesWithGabe Good luck and take it easy to recover from your burnout, those things are nasty to fully recover from (speaking out of experience).
@@GamesWithGabe good luck man
If this game is for android then this will blew up the whole internet
I will also download it
Is he going to come back?
I hope so, but who knows.
Yes, see his post in the community tab, he has had some delays but I think it will be somewhat soon.
Hay Gabe, do you still work on the game?
Yep! It's taken me much longer than I thought it would to develop some software to help with making videos, but once I get it stable I should be releasing videos again :)
"some clever game developers" ROFL, u mean some clever computer scientists mathematicians and engineers working togheter in computer graphics.
I wasn't aware that a game developer couldn't be a computer scientist, mathematician or engineer lol. My degree is in CS and Math, but I consider myself a game dev as well ¯\_(ツ)_/¯
🤓
u look like the successful version of yandere dev
bEeN a WhiLe
People get burned out. He works full time, codes on live streams, and is now making these videos which take a lot of time to edit and make animations for etc. Let me know when your OpenGL Minecraft coding series is coming out.
@@crazycdn8327 slow down. i didn't wanna offend anyone. i totally understand. i have been following gabe's streams and stuff. it was kinda meant as a joke
I am currently learning about collection framework, your videos are a little bit more beginner stuff but thats ok for me
opengl on mac is stressful
Coke back
shit, i'm using GLES2
What happened to this series? Did you lose motivation, Gabe?
now port it to ps2 lol
Nerd
@@voxelrifts I laughed
Nerds rule the world my man ;)
@@GamesWithGabe it was a joke lol, of course nerds rule
Херню какую-то посмотрел. Где весь код? Что за дурацкое обьяснение. Что мне блин писать надо? Еще и с С++ переводить твои каракули...
Did you give up on this series? Man, it was just getting good.
hello what's your discord name and #?