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...

КОМЕНТАРІ • 106

  • @barj
    @barj 2 роки тому +58

    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

  • @MieysoFelix
    @MieysoFelix Рік тому +39

    Is there going to be a Part 5?

  • @SpikedSpy_
    @SpikedSpy_ 2 роки тому +5

    this is exactly what I was always curious about.
    thank you so much for making these!

  • @danisob3633
    @danisob3633 2 роки тому +11

    this is amazing! thanks for the good work you put in this series

  • @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

  • @gatligator4425
    @gatligator4425 Рік тому +1

    this series is epic, best of luck making the next vid

  • @BoyceBailey
    @BoyceBailey 2 роки тому +1

    this was a treat to watch. thank you.

  • @FrozenSnowDropRoses
    @FrozenSnowDropRoses 2 роки тому +1

    This was very interesting. Great info

  • @beaumanVienna
    @beaumanVienna 2 роки тому +1

    Amazing content quality!

  • @menaced.
    @menaced. 2 роки тому +1

    I just learned so much about the settings that i use in games

  • @CeilingPanda
    @CeilingPanda 2 роки тому +76

    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 роки тому +15

      but then we would need to start calling voxels volels...

    • @GamesWithGabe
      @GamesWithGabe  2 роки тому +16

      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 роки тому +4

      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

  • @khaledx4964
    @khaledx4964 2 роки тому +1

    Thank you for your brilliant content

  • @Destroyer19941995
    @Destroyer19941995 Рік тому +1

    Man you really have that narrator/tutor talent with all those sounds like I am watching history channel or Discovery

  • @lixun7390
    @lixun7390 2 роки тому +1

    I like how you use Minecraft as the concept because of its popularity, nice strategy for UA-cam algorithm

  • @Petereoooo
    @Petereoooo 2 роки тому +3

    Great video! I have been waiting for it this whole month.

    • @GamesWithGabe
      @GamesWithGabe  2 роки тому +1

      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 роки тому +1

      @@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 Рік тому +3

      @@GamesWithGabe :death: what happend to the series

  • @movingheadmau8128
    @movingheadmau8128 2 роки тому +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

  • @gdelacerda
    @gdelacerda 2 роки тому

    Perfect! 💥👏🏻

  • @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.

  • @Ironium265
    @Ironium265 2 роки тому +13

    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 !

  • @oneandonlyarajivp
    @oneandonlyarajivp 9 місяців тому +1

    Hi this series is amazing. Will there be more or is this the end? Thanks

  • @loscaballerosdebronzodia8211
    @loscaballerosdebronzodia8211 9 місяців тому +3

    Is there going to be new videos?

  • @roblayton3190
    @roblayton3190 2 дні тому

    I will pay you to continue this tutorial series 🙏 Seriously. Let me know.

  • @_shadow_1
    @_shadow_1 2 роки тому +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.

  • @hatkidchan_
    @hatkidchan_ 2 роки тому +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

  • @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

  • @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.

  • @ImDuck42
    @ImDuck42 Рік тому +1

    Aaaahhhhhhh my brain 🤯

  • @nixon6216
    @nixon6216 Рік тому

    cant wait for the next 1111111

  • @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?

  • @spandanroy8380
    @spandanroy8380 Рік тому +5

    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 Рік тому +1

      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.

  • @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.

  • @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

  • @CeilingPanda
    @CeilingPanda 2 роки тому

    Where is the other thumbnail /s :) good video

  • @NotLanny
    @NotLanny 2 роки тому +2

    Could you add survival mode (including fall damage and progression) and tools, as well as player models?

    • @GamesWithGabe
      @GamesWithGabe  2 роки тому +2

      I'm working on it right now :)

    • @NotLanny
      @NotLanny 2 роки тому

      @@GamesWithGabe Cool!

  • @Abdullahmoukarrame
    @Abdullahmoukarrame Рік тому

    Can anyone tell me if it's possible at all to take this to android?

  • @caspianahlberg9027
    @caspianahlberg9027 2 роки тому +1

    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

  • @spidertyler
    @spidertyler 2 роки тому +1

    This came out and no one told me!?!

  • @crobatgaming5661
    @crobatgaming5661 2 роки тому

    cool

  • @openroomxyz
    @openroomxyz Рік тому

    Will the series continue?

  • @mohammadazad8350
    @mohammadazad8350 2 роки тому +1

    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 роки тому +1

      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 :)

  • @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 :)

  • @utkarshmadhav4411
    @utkarshmadhav4411 2 роки тому +1

    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 роки тому +1

      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

  • @TheGreatProphecy
    @TheGreatProphecy Рік тому +2

    So no more updates?

  • @kebapich
    @kebapich Рік тому +2

    WHERE.. NEW... VIDEO¿¿¿¡

  • @finnf2462
    @finnf2462 Рік тому +1

    Pls we need the cubemap video

  • @minitr3143
    @minitr3143 Рік тому

    What programs do you use for editing your videos

    • @zakzwop7251
      @zakzwop7251 Рік тому

      ua-cam.com/video/iydG-e1dQGA/v-deo.html

  • @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

  • @VoylinsLife
    @VoylinsLife Рік тому +2

    Is this the end to the series?

    • @GamesWithGabe
      @GamesWithGabe  Рік тому +9

      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 Рік тому +1

      @@GamesWithGabe good luck man

  • @StevloYT
    @StevloYT 2 роки тому +2

    If this game is for android then this will blew up the whole internet
    I will also download it

  • @devanshpatil1065
    @devanshpatil1065 2 роки тому +2

    Is he going to come back?

    • @josecarlosmoreno9731
      @josecarlosmoreno9731 2 роки тому +1

      I hope so, but who knows.

    • @asherhaun
      @asherhaun 2 роки тому

      Yes, see his post in the community tab, he has had some delays but I think it will be somewhat soon.

  • @razvanpsp6350
    @razvanpsp6350 Рік тому +1

    Hay Gabe, do you still work on the game?

    • @GamesWithGabe
      @GamesWithGabe  Рік тому +11

      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 :)

  • @gutzimmumdo4910
    @gutzimmumdo4910 2 роки тому +2

    "some clever game developers" ROFL, u mean some clever computer scientists mathematicians and engineers working togheter in computer graphics.

    • @GamesWithGabe
      @GamesWithGabe  2 роки тому +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 ¯\_(ツ)_/¯

  • @200iqpotato4
    @200iqpotato4 2 роки тому +1

    🤓

  • @FrenchArmedForcesBrookhaven

    u look like the successful version of yandere dev

  • @kurciqs8355
    @kurciqs8355 Рік тому

    bEeN a WhiLe

    • @crazycdn8327
      @crazycdn8327 Рік тому +2

      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 Рік тому +2

      @@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

  • @cybermats2004
    @cybermats2004 2 роки тому +1

    I am currently learning about collection framework, your videos are a little bit more beginner stuff but thats ok for me

  • @blvnktek
    @blvnktek 6 місяців тому

    opengl on mac is stressful

  • @mcshorts7520
    @mcshorts7520 9 місяців тому

    Coke back

  • @marcussacana
    @marcussacana Рік тому

    shit, i'm using GLES2

  • @cthutu
    @cthutu Рік тому +2

    What happened to this series? Did you lose motivation, Gabe?

  • @youessmati3806
    @youessmati3806 2 роки тому +1

    now port it to ps2 lol

  • @cvabds
    @cvabds 2 роки тому +1

    Nerd

  • @NickProkhorenko
    @NickProkhorenko Рік тому

    Херню какую-то посмотрел. Где весь код? Что за дурацкое обьяснение. Что мне блин писать надо? Еще и с С++ переводить твои каракули...

  • @ItIsYouAreNotYour
    @ItIsYouAreNotYour 9 місяців тому

    Did you give up on this series? Man, it was just getting good.

  • @anonymus_the_real
    @anonymus_the_real Рік тому

    hello what's your discord name and #?