Textures in OpenGL | How to Code Minecraft Ep. 4

  Рет қаралды 94,709

GamesWithGabe

GamesWithGabe

Күн бұрын

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 KZfaq Studio Audio Library)
"The World's Fair", by Godmode (from KZfaq Studio Audio Library)
"Dolphin-esque", by Godmode (from KZfaq Studio Audio Library)
"No. 7 Alone With My Thoughts", by Esther Abrami (from KZfaq Studio Audio Library)
"Web Weaver's Dance", by Asher Fulero (from KZfaq Studio Audio Library)
"Bike Sharing to Paradise", by Dan Bodan (From KZfaq 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...

Пікірлер: 105
@MieysoFelix
@MieysoFelix Жыл бұрын
Is there going to be a Part 5?
@barj
@barj 2 жыл бұрын
I haven't done too much OpenGL but when I did, I HATED textures. Really enjoying the series so far :)
@sleep3017
@sleep3017 2 жыл бұрын
Whoa man didnt expect to see you here lmao
@CeilingPanda
@CeilingPanda 2 жыл бұрын
Random fact, texture element or “texel” is the same as picture element or “pixel” which maybe should be called picel instead for consistency.
@Zilten_
@Zilten_ 2 жыл бұрын
but then we would need to start calling voxels volels...
@GamesWithGabe
@GamesWithGabe 2 жыл бұрын
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
@nukeandbeans
@nukeandbeans 2 жыл бұрын
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)
@dovahkiin2108
@dovahkiin2108 2 жыл бұрын
yeah ok...
@miweneia
@miweneia 2 жыл бұрын
@@Zilten_ lel
@danisob3633
@danisob3633 2 жыл бұрын
this is amazing! thanks for the good work you put in this series
@SpikedSpy_
@SpikedSpy_ 2 жыл бұрын
this is exactly what I was always curious about. thank you so much for making these!
@gatligator4425
@gatligator4425 Жыл бұрын
this series is epic, best of luck making the next vid
@menaced.
@menaced. 2 жыл бұрын
You make tutorials as interesting to watch as videos from reducible or standup maths its actually amazing keep up the good work
@menaced.
@menaced. 2 жыл бұрын
I just learned so much about the settings that i use in games
@BoyceBailey
@BoyceBailey 2 жыл бұрын
this was a treat to watch. thank you.
@lixun7390
@lixun7390 2 жыл бұрын
I like how you use Minecraft as the concept because of its popularity, nice strategy for KZfaq algorithm
@Petereoooo
@Petereoooo 2 жыл бұрын
Great video! I have been waiting for it this whole month.
@GamesWithGabe
@GamesWithGabe 2 жыл бұрын
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 :)
@Petereoooo
@Petereoooo 2 жыл бұрын
@@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 :)
@ITATheshark
@ITATheshark Жыл бұрын
@@GamesWithGabe :death: what happend to the series
@FrozenSnowDropRoses
@FrozenSnowDropRoses 2 жыл бұрын
This was very interesting. Great info
@Destroyer19941995
@Destroyer19941995 Жыл бұрын
Man you really have that narrator/tutor talent with all those sounds like I am watching history channel or Discovery
@khaledx4964
@khaledx4964 2 жыл бұрын
Thank you for your brilliant content
@beaumanVienna
@beaumanVienna 2 жыл бұрын
Amazing content quality!
@nia5370
@nia5370 2 жыл бұрын
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.
@oneandonlyarajivp
@oneandonlyarajivp 8 ай бұрын
Hi this series is amazing. Will there be more or is this the end? Thanks
@Ironium265
@Ironium265 2 жыл бұрын
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!
@BusinessWolf1
@BusinessWolf1 2 жыл бұрын
Look up how minecraft did it, there's articles on it
@Ironium265
@Ironium265 2 жыл бұрын
@@BusinessWolf1 If u have any link i would be happy !
@hatkidchan_
@hatkidchan_ 2 жыл бұрын
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
@loscaballerosdebronzodia8211
@loscaballerosdebronzodia8211 7 ай бұрын
Is there going to be new videos?
@movingheadmau8128
@movingheadmau8128 2 жыл бұрын
Great video! I will have to dig into graphics programming when I have some off-time from university & work again :D
@GamesWithGabe
@GamesWithGabe 2 жыл бұрын
Thanks! Graphics programming can be a pain, but it usually yields really cool apps that you can show off :D
@iercan1234
@iercan1234 2 жыл бұрын
nice, maybe one day i will really learn opengl it looks fun
@fluffy_tail4365
@fluffy_tail4365 2 жыл бұрын
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
@_shadow_1
@_shadow_1 2 жыл бұрын
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.
@asherhaun
@asherhaun 2 жыл бұрын
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.
@janeannothanks8371
@janeannothanks8371 2 жыл бұрын
He already does this, but they're typically 1-3 hour long videos.
@NoTengoIdeaGuey
@NoTengoIdeaGuey Жыл бұрын
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.
@spandanroy8380
@spandanroy8380 Жыл бұрын
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
@benonardo
@benonardo Жыл бұрын
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.
@gdelacerda
@gdelacerda 2 жыл бұрын
Perfect! 💥👏🏻
@CeilingPanda
@CeilingPanda 2 жыл бұрын
Where is the other thumbnail /s :) good video
@mihai140
@mihai140 2 жыл бұрын
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?
@WillFordStudios
@WillFordStudios 2 жыл бұрын
I don't know how I got here, I'm not interested in minecraft coding, but I watched the whole damn video
@mohammadazad8350
@mohammadazad8350 2 жыл бұрын
Did you use manim for the text? if so I don't see a link to it in the description, for credits
@GamesWithGabe
@GamesWithGabe 2 жыл бұрын
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 :)
@utkarshmadhav4411
@utkarshmadhav4411 2 жыл бұрын
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.
@GamesWithGabe
@GamesWithGabe 2 жыл бұрын
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 :)
@utkarshmadhav4411
@utkarshmadhav4411 2 жыл бұрын
@@GamesWithGabe thank you Gabe
@nixon6216
@nixon6216 Жыл бұрын
cant wait for the next 1111111
@NotLanny
@NotLanny 2 жыл бұрын
Could you add survival mode (including fall damage and progression) and tools, as well as player models?
@GamesWithGabe
@GamesWithGabe 2 жыл бұрын
I'm working on it right now :)
@NotLanny
@NotLanny 2 жыл бұрын
@@GamesWithGabe Cool!
@ImDuck42
@ImDuck42 Жыл бұрын
Aaaahhhhhhh my brain 🤯
@TheThouZands
@TheThouZands 2 жыл бұрын
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?
@GamesWithGabe
@GamesWithGabe 2 жыл бұрын
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 :)
@spidertyler
@spidertyler 2 жыл бұрын
This came out and no one told me!?!
@openroomxyz
@openroomxyz Жыл бұрын
Will the series continue?
@TheGreatProphecy
@TheGreatProphecy 11 ай бұрын
So no more updates?
@caspianahlberg9027
@caspianahlberg9027 2 жыл бұрын
Small mistake in the video - OpenGL is only deprecated past 4.1 on MacOS
@bennyuoppd33
@bennyuoppd33 2 жыл бұрын
I've never used MacOS, but I've heard of people having issues running a few features past 3.3
@caspianahlberg9027
@caspianahlberg9027 2 жыл бұрын
@@bennyuoppd33 Yes - the Apple OpenGL drivers are a bit iffy
@turkeyleg72
@turkeyleg72 Жыл бұрын
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.
@minitr3143
@minitr3143 Жыл бұрын
What programs do you use for editing your videos
@zakzwop7251
@zakzwop7251 Жыл бұрын
kzfaq.info/get/bejne/n9-UepCWlsq1d3U.html
@finnf2462
@finnf2462 Жыл бұрын
Pls we need the cubemap video
@gutzimmumdo4910
@gutzimmumdo4910 2 жыл бұрын
"some clever game developers" ROFL, u mean some clever computer scientists mathematicians and engineers working togheter in computer graphics.
@GamesWithGabe
@GamesWithGabe 2 жыл бұрын
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 ¯\_(ツ)_/¯
@kebapich
@kebapich Жыл бұрын
WHERE.. NEW... VIDEO¿¿¿¡
@crobatgaming5661
@crobatgaming5661 2 жыл бұрын
cool
@Slender303YT
@Slender303YT 2 жыл бұрын
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...
@GamesWithGabe
@GamesWithGabe 2 жыл бұрын
Thanks for sticking with me for so long :D . And I'm just as amazed as you haha
@Abdullahmoukarrame
@Abdullahmoukarrame 10 ай бұрын
Can anyone tell me if it's possible at all to take this to android?
@devanshpatil1065
@devanshpatil1065 Жыл бұрын
Is he going to come back?
@josecarlosmoreno9731
@josecarlosmoreno9731 Жыл бұрын
I hope so, but who knows.
@asherhaun
@asherhaun Жыл бұрын
Yes, see his post in the community tab, he has had some delays but I think it will be somewhat soon.
@razvanpsp6350
@razvanpsp6350 Жыл бұрын
Hay Gabe, do you still work on the game?
@GamesWithGabe
@GamesWithGabe Жыл бұрын
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 :)
@VoylinsLife
@VoylinsLife Жыл бұрын
Is this the end to the series?
@GamesWithGabe
@GamesWithGabe Жыл бұрын
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 :/
@VoylinsLife
@VoylinsLife Жыл бұрын
@@GamesWithGabe Good luck and take it easy to recover from your burnout, those things are nasty to fully recover from (speaking out of experience).
@samochreno
@samochreno Жыл бұрын
@@GamesWithGabe good luck man
@cthutu
@cthutu Жыл бұрын
What happened to this series? Did you lose motivation, Gabe?
@ExplosiveFireBall
@ExplosiveFireBall 2 жыл бұрын
If this game is for android then this will blew up the whole internet I will also download it
@kurciqs8355
@kurciqs8355 Жыл бұрын
bEeN a WhiLe
@crazycdn8327
@crazycdn8327 Жыл бұрын
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.
@kurciqs8355
@kurciqs8355 Жыл бұрын
@@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
@ItIsYouAreNotYour
@ItIsYouAreNotYour 8 ай бұрын
Did you give up on this series? Man, it was just getting good.
@FrenchArmedForcesBrookhaven
@FrenchArmedForcesBrookhaven Жыл бұрын
u look like the successful version of yandere dev
@200iqpotato4
@200iqpotato4 2 жыл бұрын
🤓
@mcshorts7520
@mcshorts7520 8 ай бұрын
Coke back
@cybermats2004
@cybermats2004 2 жыл бұрын
I am currently learning about collection framework, your videos are a little bit more beginner stuff but thats ok for me
@blvnktek
@blvnktek 5 ай бұрын
opengl on mac is stressful
@marcussacana
@marcussacana Жыл бұрын
shit, i'm using GLES2
@youessmati3806
@youessmati3806 2 жыл бұрын
now port it to ps2 lol
@cvabds
@cvabds 2 жыл бұрын
Nerd
@emilianobustamante5013
@emilianobustamante5013 2 жыл бұрын
@@voxelrifts I laughed
@GamesWithGabe
@GamesWithGabe 2 жыл бұрын
Nerds rule the world my man ;)
@cvabds
@cvabds 2 жыл бұрын
@@GamesWithGabe it was a joke lol, of course nerds rule
@NickProkhorenko
@NickProkhorenko Жыл бұрын
Херню какую-то посмотрел. Где весь код? Что за дурацкое обьяснение. Что мне блин писать надо? Еще и с С++ переводить твои каракули...
@anonymus_the_real
@anonymus_the_real Жыл бұрын
hello what's your discord name and #?
The Tyrannical Mods of Stack Overflow
12:15
GamesWithGabe
Рет қаралды 372 М.
I Designed My Own 16-bit CPU
15:46
AstroSam
Рет қаралды 1,8 МЛН
1❤️
00:20
すしらーめん《りく》
Рет қаралды 32 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 118 #shorts
00:30
Making Minecraft from scratch in 48 hours (NO GAME ENGINE)
16:38
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,4 МЛН
Can AI Code Minecraft? Watch ChatGPT Try
8:06
BadGameDev
Рет қаралды 1,1 МЛН
I made a game with less than 100 pixels!
10:38
inDevelopment
Рет қаралды 47 М.
I Made a Working Computer with just Redstone!
15:37
mattbatwings
Рет қаралды 698 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 4,9 МЛН
I programmed Minecraft from scratch... again.
11:44
jdh
Рет қаралды 556 М.
I Coded a Video Editor (and it kind of sucks)
18:35
GamesWithGabe
Рет қаралды 231 М.
1❤️
00:20
すしらーめん《りく》
Рет қаралды 32 МЛН