Buffers in OpenGL | How to Code Minecraft Ep. 2

Sdílet
Vložit
  • čas přidán 17. 05. 2024
  • Join the Discord: / discord
    Follow me on Twitch: / gameswthgabe
    In this episode I go over the fundamentals of buffers in OpenGL. I go over vertex array buffers and element buffers in depth in the latter half of the video. I also cover some fundamental concepts (the graphics pipeline) that are required to understand the necessity of buffers.
    Challenges: github.com/codingminecraft/Mi...
    Tesselation for Terrain Generation: victorbush.com/2015/01/tessel...
    Jonathan Blow Explains Graphics: • How 3D video games do ...
    All the Buffers: www.khronos.org/registry/Open...
    Buffer Data and Usage Types: www.khronos.org/registry/Open...
    Element Buffer Docs: www.khronos.org/opengl/wiki/V...
    My Example Code
    C++ Example: github.com/codingminecraft/Mi...
    "Spring / The Promise" licensed via Music Vine: THVAJRQFYGELCUNZ
    "Artist Sunrise" licensed via Music Vine
    “Serenity Prayer” licensed via Music Vine: NLTYRLTVLNPBSID0
    “Look Up” licensed via Music Vine: OBALWSA54NKIDANG
    0:00 Intro
    0:47 What are Buffers?
    1:22 OpenGL Graphics Pipeline
    1:45 Vertex Processing Stage
    5:34 Tesselation Processing Stage
    6:22 Geometry Processing Stage
    6:45 Primitive Assembly Stage
    7:40 Rasterization Stage
    8:05 Fragment Processing Stage
    8:43 Add your Math Library
    9:14 What are buffers? Revisited
    10:53 Coding Vertex Array Buffers
    13:06 Vertex Attributes
    16:47 Vertex Array Objects
    18:18 Drawing the Vertices
    20:10 Element Buffer Objects
    23:16 Challenges 1
    23:57 Named Buffers
    25:56 Challenges 2
    26:17 Closing Thoughts
    ---------------------------------------------------------------------
    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...

Komentáře • 140

  • @GamesWithGabe
    @GamesWithGabe  Před 2 lety +49

    Hey everybody, there's bound to be a few errors in the episode, so if you spot anything feel free to comment and I'll add them to this list :)
    Thanks Rems19 and dr_nyt for catching this one! "Hi, I think you swapped the offsets of position and color in the code at 18:12.
    I think anybody following should catch it but just in case some people just copy the code... :p"

    • @Rems19
      @Rems19 Před 2 lety +1

      Thank you for the videos!
      Even if I'm already familiar with OpenGL, it's a good refresher and I love the way you chose to make this series with a lot of explanations rather than a lot of code, and challenges between episodes.
      Very cool, keep it up!

    • @Apostelman
      @Apostelman Před 2 lety

      hi, i think your audio-video is not in sync. everytime i can see you speaking, it seems off by a small amount. 100-200ms or so.

    • @billowen3285
      @billowen3285 Před 2 lety +1

      At 15:25 you said 2^8 is 255 lol

    • @quatrixx
      @quatrixx Před 2 lety +3

      1:10 Algbera

    • @naturesmusic1171
      @naturesmusic1171 Před 2 lety

      How to contact you directly? Thanks

  • @lmerry213
    @lmerry213 Před 2 lety +199

    I'm only 1/4 of the way through the video, but I'm already feeling compelled to come down here and say that I'm blown away by the production value and understandability of this content. I honestly can't believe I'm watching this for free on CZcams! Thanks, Gabe!

    • @GamesWithGabe
      @GamesWithGabe  Před 2 lety +32

      I was bracing for some harsh criticism reading the first half of this comment, but was pleasantly surprised with the last half. I really appreciate the encouraging comment Luke :)

    • @silvertakana3932
      @silvertakana3932 Před 2 lety +7

      He isn’t lying, Gabe! I think this is phenomenal too!

    • @no1ofinterst
      @no1ofinterst Před 2 lety

      @@GamesWithGabe Its crazy how different this and the mario series are. What did you use to animate this?

    • @CkyreGaming
      @CkyreGaming Před 2 lety

      Indeed, can't believe I'm watching this for free. Thanks a lot !

  • @delphicdescant
    @delphicdescant Před 2 lety +47

    I really like that you don't rely on clickbait thumbnails to get people into this stuff.
    I also like that your video isn't 70% vanity shots of your own face talking like some kind of narcissist.
    Getting tired of other coding channels doing that stuff, and your straightforward narration is refreshing.

    • @RealQuarlie
      @RealQuarlie Před 2 lety +3

      I wouldn't really call it narcissism but rather lazy video editing

    • @brainloading5543
      @brainloading5543 Před 2 lety +2

      why you roasting the cherno lmao good point tho

  • @shmoich6992
    @shmoich6992 Před 2 lety +80

    Excellent overview of the graphics pipeline and slick manim animations. These videos are really really high effort. I think this series will be really valuable for people in the "engineless game dev" crowd. Please just don't burn yourself out man. You released the last one only 2 weeks ago which seems like a crazy short period of time from what I can tell goes into them. Fantastic work though.

    • @GamesWithGabe
      @GamesWithGabe  Před 2 lety +16

      Thanks for the awesome comment bad banana! And I was planning on a once a month release schedule, but I wanted to get the first few out relatively quickly. I'll probably be slowing down after a couple more episodes to try to avoid burnout :)

  • @asherhaun
    @asherhaun Před 2 lety +17

    I thought the description and explanation of the openGL graphics pipeline was quite good in the LWJGL series, this one raised the bar.
    Well done, hopefully I will be able to follow along with this series at some point when I can come up with more time.

  • @andyma3864
    @andyma3864 Před 2 lety

    Great video, love the animations! Been studying OpenGL through text and this video is the perfect complement to really get all the info into my head. Thanks!

  • @lengors1674
    @lengors1674 Před 2 lety +1

    I know we're only 2 videos in but the quality of production of this series is amazing. Keep up the good work Gabe 💪

  • @MajorTom1313
    @MajorTom1313 Před 2 lety +1

    you are the best gaberino. I have no idea how you have time to put out all your content.

  • @israelperez4862
    @israelperez4862 Před 2 lety

    this is by far one of the best tutorials on this subject, please keep uploading this series

  • @ConsumerOfCringe
    @ConsumerOfCringe Před rokem +1

    No way was this free,
    high quality looking graphics, 3 coding languages and clear, in depth, conceptual explanations?
    probably the highest quality coding tutorial I've seen for a channel of this size

  • @diiegoss
    @diiegoss Před 2 lety +1

    Just awesome! I'm loving this series! :)

  • @ThislsYusuf
    @ThislsYusuf Před 2 lety

    Manim is the gift that keeps on giving. Not to take away from the killer presentation. Subscribed.

  • @notarian6864
    @notarian6864 Před 2 lety +2

    I wish that this video exists back in days when i was struggling with OpenGL, Really well explained video, Keep it up ♥️

  • @ath.bar.7671
    @ath.bar.7671 Před 2 lety +4

    I am really glad to be watching this series while you are making new episodes, and this period happened to be the time I wanted to learn OpenGL. I like how you try to generalize the functions and make them apply to all the languages instead of making it in a single one. I personally believe that this is one of the few videos that explain OpenGL and its components so well.

  • @dr_nyt4041
    @dr_nyt4041 Před 2 lety

    Finally managed to setup the new named way of doing things. This series gives me some serious doses of serotonin, especially since I have to figure things out myself. Learning c++ on the way, its a win win. Love the series

  • @coffee-is-power
    @coffee-is-power Před 2 lety +5

    Finally someone that is making a great opengl tutorial

  • @neillunavat
    @neillunavat Před 2 lety

    I just found out about this channel... Instantly subscribed. Your quality is so good!

  • @tootersshow5936
    @tootersshow5936 Před 2 lety

    Thank you very much for this! You are very good at explaining things your editing is awesome!

  • @stalkerkk
    @stalkerkk Před 2 lety

    One of best explanation for 3d graphics along with thin matrix and coding train.

  • @kayrauckilinc
    @kayrauckilinc Před 2 lety

    A semester of teaching is taught by you in less than 27 minutes. Good job man!!

  • @gaudok3281
    @gaudok3281 Před 5 měsíci

    One of the best videos on this topic

  • @adrianh.8723
    @adrianh.8723 Před 2 lety +1

    Best OpenGL video I have ever seen on CZcams

  • @johncreativeproducts5688

    What an awesome video!!! Those animations help a lot to understand, thanks so much!

  • @animatrontv1664
    @animatrontv1664 Před 2 lety +1

    I think it’s awesome that instead of just copying some guys code for a how to, your actually teaching us what everything means and explaining in detail. Most people probably are not using this to code Minecraft and just watching it for fun, but this is still an amazing tutorial even if only directed to watching only.

  • @MrAlexbross
    @MrAlexbross Před 2 lety

    This video series kind of remaind me the 3Blue1Brown videos, interesting. Amazing video btw, I'll stay tuned for more!

  • @xicci4760
    @xicci4760 Před 2 lety

    Great episode. I like how you take the necessary time explaining the concepts before the actual topic.
    When can we expect the next video?

  • @stpedro-ht9ng
    @stpedro-ht9ng Před rokem

    These visual explanations are a godsend. Thanks for not just talking to the camera for 8 minutes, making hand gestures to try and conceptualize these topics.

  • @jamesc.mudingay5353
    @jamesc.mudingay5353 Před 2 lety +17

    Love the animations! It helps learning and understanding the concept a lot!

  • @dawidepl7807
    @dawidepl7807 Před 2 lety

    Masterpiece of a channel

  • @smellthel
    @smellthel Před 2 lety +1

    Thanks so much for this series

  • @genericname1296
    @genericname1296 Před 2 lety

    Thank you so so so much for this series!

  • @Karmush21
    @Karmush21 Před rokem

    Thank you so much for this. It was really helpful.

  • @omaralhussani476
    @omaralhussani476 Před 2 lety

    i am only 8 minutes in and this is the best explanation of the graphics pipeline i have ever seen

  • @codeunited5905
    @codeunited5905 Před rokem

    Underrated video on buffer, bruh. I watched it twice at 1.75x and was able to complete the challenge in 30 minutes. Tysm bruh. You are a life saver.

  • @ghosthookcc2050
    @ghosthookcc2050 Před 2 lety

    best teacher for any graphics programming!

  • @inversechi
    @inversechi Před 2 lety

    How do you not have more subscribers? Your presentation quality is amazing and topics are so interesting and explored in detail.

  • @unurled
    @unurled Před 2 lety

    Very great quality content, love it!

  • @vertexbyte5159
    @vertexbyte5159 Před 2 lety

    This channel is gold.

  • @natanaelrabello
    @natanaelrabello Před 2 lety

    This is really good. Please keep on

  • @bpetrikovics
    @bpetrikovics Před 2 lety

    This is a very good starting tutorial for OpenGL, I can only recommend it.

  • @jsnotlout3312
    @jsnotlout3312 Před 2 lety

    Great job explaining it!

  • @FlooferLand
    @FlooferLand Před 2 lety +3

    I honestly can't thank you enough for making this series this easy to understand.
    I've already tried learning OpenGL by watching tons of videos and series on it and it all was wayyy too hard for me to understand to the point i just felt like i wasn't smart enough to learn any of it, even a 'beginner' video from CZcamsr with millions of subs left me extremely confused and feeling dumb, and I eventually just gave up.
    But your series is really helping me learn all of this, especially since you're using such a fun example game to work up to. So essentially people learning actually have a goal, a project to finish, and that's a really good way to keep people motivated. Again, thank you a TON for making this series, it's honestly kinda mind-blowing to me how it's free-to-watch on CZcams.

    • @GamesWithGabe
      @GamesWithGabe  Před 2 lety +1

      Thank you so much for the encouraging comment 😄. I struggled a lot when I first learned OpenGL, so I was hoping that I could make some videos that addressed the issues I had when learning the API. I'm glad that it's helping out, and I'm hoping that it will still be helpful to people even with the kind of slow release schedule haha. But thanks again! It's nice to see encouraging comments like this :)

  • @Hydra-BR
    @Hydra-BR Před 2 lety

    i just dont know what to say, this video is just perfect.

  • @mistter_6851
    @mistter_6851 Před 2 lety

    Amazing video, you make it look like easy, I'm so anxious for next video =) Some months ago I tried to make a game like minecraft in c#, and I did a lot of things, but my problem was to work with the generation of the map, because it got some much lag to generate the chunks =C I'm still getting nightmares with the Perlin Noise and Perlin Worm hehe

  • @tox1cozZ
    @tox1cozZ Před 2 lety

    Огромное спасибо за качественные ролики!

  • @Mathew7245
    @Mathew7245 Před 2 lety

    I love the 3blue1brown style editing

  • @jamestennant7789
    @jamestennant7789 Před 2 lety

    So grateful for this

  • @Patrickblox
    @Patrickblox Před 2 lety +4

    Those animations remind me of 3blue1brown. Amazing work Gabe.

    • @Hydra-BR
      @Hydra-BR Před 2 lety

      i think he is using 3blue1brow python library "Manim" to make the animations. look so good.

    • @GamesWithGabe
      @GamesWithGabe  Před 2 lety

      Thanks Patrick! And I am using the community edition of manim. It's an amazing library and I'm really appreciative of grant for making the library open source :)

    • @xffeeo
      @xffeeo Před rokem

      i just watched his tutorials on matrices, bro you reading my mind

  • @UsernameXOXO
    @UsernameXOXO Před 2 lety +21

    Did you know that you can use a lot of these mathematical functions for physics? The origin of the world and the Eye are integral parts of relativity and the observer. Quaternion vectors are used to give quantum particles angular momentum and directionality, just like they spin and point rendered objects.
    Alright. Realizing what you're using for the animations, I also realize that you probably know all that. :p

    • @GamesWithGabe
      @GamesWithGabe  Před 2 lety +12

      I definitely did not know all that. That's super cool though! Physics was always a topic I struggled with in college, so I avoided it as much as my major allowed me to haha

    • @engelsteinberg593
      @engelsteinberg593 Před 2 lety

      Quaternions are no vectors.

    • @UsernameXOXO
      @UsernameXOXO Před 2 lety +3

      @@engelsteinberg593 So what are they? What is ê? Does (W, X, Y, Z) denote a fricking eigenversor instead of an eigenvector?
      Come on.

    • @engelsteinberg593
      @engelsteinberg593 Před 2 lety

      @@UsernameXOXO They are the even subalgabra of the Geometric Algebra of three dimensions. And they are no representative of three dimensions, in any way, because they represent rotations in three dimensions.

    • @UsernameXOXO
      @UsernameXOXO Před 2 lety

      @@engelsteinberg593 Are you saying vectors are NOT subalgebra? Otherwise I see no point in saying "they're just math things!"
      The intended use is mathematical after all.
      Can we settle on vertices?
      Also you can totally use the rotation to derive the 3d form, at least in illuminable scenarios. Like you would in spacetime algebra.

  • @hbgkev
    @hbgkev Před 2 lety

    I have to say two things, I am curently following your java 2d game engine thingy.. It's tad a bit fast imo (and i'm a pretty fast person overall, but concepts can be difficult conceptually, and require you to think often and alot)
    though;
    That you provide this content for free, considering your knowledge and the time required to make those videos, puts you in the absolute hall of fame of programmers giving back to the community.
    You are an absolute legend.

  • @joysaha3927
    @joysaha3927 Před 2 lety

    Masterpiece ❤️👌👌

  • @nilusnilus6365
    @nilusnilus6365 Před 2 lety +2

    Lockdown started again in the Netherlands, now I can code a lot more! Thank you for this content

  • @janosdomboroczki8456
    @janosdomboroczki8456 Před 2 lety

    great stuff!

  • @playbyan1453
    @playbyan1453 Před 2 lety

    Loved it, the opengl 4 looks like a webgl 2 I'm having issues to setup shaders working on it.

  • @robinhorneman2245
    @robinhorneman2245 Před 2 lety

    Amazing vids!

  • @Pedro-jj7gp
    @Pedro-jj7gp Před 2 lety

    I'm really enjoying this series! I'm following it along with learnopengl, so far so good. On your reply to someone else's comment you stated that you learnt from a few people. Jonathan Blow and Casey Muratori stood out to me, as I recently started following them. They seem to really know their stuff and go super low level, but I honestly find their streams to be hard to follow along. The handmade hero series is incredibly huge. How did you approach learning from them? Just watching some streams to pick up a few tricks here and there?

  • @stevehan3498
    @stevehan3498 Před rokem

    Love the 3b1b animation + music

  • @lemmy103
    @lemmy103 Před 2 lety +1

    Regarding geometry shaders. They are used in real time applications, a good example would be making nice chunky lines. You pass in line geometry, and the geometry shader can use that line data to create screen facing quads, projecting the four verts half the line width out left and right along 90 degree angles from the line direction. You'd end up turning a pixelly GL line into a potentially textured nice chunky line of the passed width.
    Another example would be engine trails for a space ship, these could just be passed as line segments into the shader and you'd end up with tapering engine trails as screen facing quads. Same principle. It's a way of quickly upgrading a primitive type to the one above it and inferring the extra verts required to make those primitives from that data, or data passed into the shader as uniforms. So a point into a line, or a line into a quad or triangle pair.
    Really handy, I recommend looking into them more :)

  • @kde9910
    @kde9910 Před 2 lety

    Can't wait for it all to be out.

  • @davidos533
    @davidos533 Před 2 lety

    Wonderful!

  • @fixeddev6889
    @fixeddev6889 Před 2 lety

    Great video. I understood some of it but I do want to ask where did you learn to code. Keep it up great series

    • @GamesWithGabe
      @GamesWithGabe  Před 2 lety +1

      Thanks Fixed Dev! I originally learned to code by reading a great book about JS and game development by a guy named rex van Der spuy. I'm mostly self taught, but I went to college for comp Sci and math. I learned graphics programming through a combination of thin matrix, cherno, casey muratori, Jonathan blow, and pretty recently the opengl superbible (I would highly recommend that)

  • @Fataha22
    @Fataha22 Před 2 lety

    Man, this guy is better than my teacher at campuss for teaching me abt this

  • @stysner4580
    @stysner4580 Před rokem

    The reason you use triangles is because it's the least/maximum amount of points that guarantee a planar surface. No matter where all 3 points are, you always have a planar surface (or if points overlap a line or void/singularity). The fact they are "easy to work with" stems from that guarantee.

  • @bongodango
    @bongodango Před 2 lety

    Love the 3blue1brown vibes

  • @silvertakana3932
    @silvertakana3932 Před 2 lety

    Gabe, this video is very helpful. Before, i just copy the code online and let it do the work without understanding what it does. But now, i have been able to write my own code with clear understanding in mind thanks to this video. I can’t wait for the next episode. When are you going to release it? Do you have a release schedule? Thank you.

    • @GamesWithGabe
      @GamesWithGabe  Před 2 lety +1

      Hey thanks for the great comment silver! I haven't started creating the next episode yet, but the absolute latest I'll be releasing it is by the end of January :)

  • @arthurmartins1511
    @arthurmartins1511 Před 2 lety

    love it

  • @rccservice
    @rccservice Před 2 lety

    i love you gabe

  • @natec.8028
    @natec.8028 Před 2 lety +1

    What math library would you recommend for C (since glm does not support c)?

  • @maticz3923
    @maticz3923 Před 2 lety

    I will be trying to make my own opengl wrapper
    Could be quite fun :P

  • @hhhharis622
    @hhhharis622 Před 2 lety

    Nice

  • @antoinefortin1386
    @antoinefortin1386 Před 2 lety

    wadawow!

  • @Chamarel
    @Chamarel Před 2 lety

    I have never used opengl before with java, is it ok if I just use the regular java libraries for this project?

  • @SuperGrimmy
    @SuperGrimmy Před 2 lety

    It's a myth that geometry shaders are slow. This was true 10 years ago. Emitting quads (triangle strip), tetahedron or cube with geo shader is for example much faster than using instancing. When drawing a lot of things it's also faster simply because the gpu access less memory from the buffer (reading a buffer has a cost). Billboarded quads as triangle strips are great for simple particles. Geo shaders are awesome when used the right way :)
    other than than.. this video is a fantastic explanation of the pipleine.

    • @GamesWithGabe
      @GamesWithGabe  Před 2 lety +1

      Thanks for the comment! I'm curious about the geometry shaders. Everything I've read or seen say that it's generally alright to use a geometry shader if you're only outputting 2-3 primitives, but beyond that it's generally a bad idea.
      Also, on the khronos website they have this at the bottom of the GS examples page "The GS unit in current generation of GPUs, such as the Geforce 8000/9000/GTX 100, 200 and 300 series, is considered too slow to be practical by some people. It is also considered too limited by some because there is a limit to how many new primitives you can emit." 😅
      It looks like it was last edited in 2018. I was wondering if you have any good resources or examples other than point sprites and billboards that geometry shaders can excel at that you could point me towards?

  • @TheThouZands
    @TheThouZands Před 2 lety

    so, i might be lost, but do these videos contain the base for how to make a game engine?

    • @GamesWithGabe
      @GamesWithGabe  Před 2 lety

      They will eventually be the base of how to code your own minecraft clone. But many of the concepts should be applicable to game engine programming also :)

  • @dergus8833
    @dergus8833 Před 2 lety

    cool

  • @Dustballable
    @Dustballable Před 2 lety

    .Net has a matrix library in the standard library that is sufficient for opengl, System.Numerics

  • @matanmigdal7108
    @matanmigdal7108 Před 2 lety

    and what whit the compute shader?

  • @du64
    @du64 Před 2 lety +1

    Ooh for once I'm early!

    • @MattPryze
      @MattPryze Před 2 lety

      I recognize your prof pic. Where have I seen you?

  • @Rems19
    @Rems19 Před 2 lety +5

    Hi, I think you swapped the offsets of position and color in the code at 18:12.
    I think anybody following should catch it but just in case some people just copy the code... :p

    • @MrAlexbross
      @MrAlexbross Před 2 lety

      I'm glad I wasn't the only one! I was getting confused

    • @hirzanabqary
      @hirzanabqary Před 2 lety

      anti code copying lol

    • @voxelrifts
      @voxelrifts Před 2 lety

      @@hirzanabqary big brain xD

  • @everluck35
    @everluck35 Před 2 lety +4

    The music is distracting/too loud imo :)
    But thanks for these high quality videos!

  • @mysticknight2084
    @mysticknight2084 Před 2 lety

    Hello, can you maybe upload like the code you only showed in this Video? i dont really get how to implement the shader, it is really confusing for me how you show the different parts of code, i dont really understand what to do with it, for example the Shader Part. I really want to get into this, its just kinda hard for me rn.

    • @GamesWithGabe
      @GamesWithGabe  Před 2 lety +1

      Hey MysticKnight! The code for this video is linked in the description. It has two files, Shader.h and Shader.cpp that you can just copy/paste for this video. I also have an example in main.cpp of how I use it. Let me know if I'm misunderstanding your comment :)

    • @mysticknight2084
      @mysticknight2084 Před 2 lety

      Well now i have alot of compiler errors, even if i use your main. "Severity Code Description Project File Line Suppression State
      Error LNK2001 unresolved external symbol glad_glEnableVertexArrayAttrib OpenGlWSeminar C:\Path" like for every glad thing in main.obj and Shader.obj. The ide doesnt show any errors.

  • @gofudgeyourselves9024
    @gofudgeyourselves9024 Před 2 lety

    Came here after freecodecamp video. Can you make some tutorials on godot game engine

  • @Destroyer19941995
    @Destroyer19941995 Před 2 lety

    Hold up you were 2k subs. Look now. Gabe you fucking legend 🤣. Gratz!!! Maken a open source game engine project but in c++ so we from discord can work on it?

  • @stevegremory3849
    @stevegremory3849 Před 2 lety

    this man is the 3b1b of opengl at tbh

  • @seirharp
    @seirharp Před 2 lety

    when wl the new vids drop for the series?

    • @GamesWithGabe
      @GamesWithGabe  Před 2 lety

      The next one will come out at the end of January or beginning of February :)

  • @proxy1035
    @proxy1035 Před 2 lety

    all the visuals in the video give me heavy 3Blue1Brown vibes.
    is there like a standard that all math related CZcamsrs use for their visual stuff?
    and like with most other Math related channels i pretty much understood nothing, i barely know how to use GLUT to draw a triangle...

    • @benonardo
      @benonardo Před 2 lety

      "I am using the community edition of manim. It's an amazing library and I'm really appreciative of grant for making the library open source :)" answered Gabe another comment

    • @SirusStarTV
      @SirusStarTV Před 2 lety

      Start with WebGL and JavaScript, it's so much easier to understand.

  • @falxie_
    @falxie_ Před 2 lety +2

    It seems like OpenGL has a lot of boilerplate

  • @diggoran
    @diggoran Před 2 lety

    This video is great, and so was the last one, but I'm starting to get a bit distracted by how you keep saying "Ohmpen GL" :P

    • @GamesWithGabe
      @GamesWithGabe  Před 2 lety

      I guess living in the south must be effecting my speech haha. Thanks for the comment though, and we'll see if I remember this and pronounce it differently in the next episode :D

    • @diggoran
      @diggoran Před 2 lety

      @@GamesWithGabe I’m originally from Virginia so I know how those sneak in, even for what I would consider a pretty metro southerner like myself. Good luck!

  • @XArticSpartanX
    @XArticSpartanX Před 2 lety

    Anyone taking bets on how many eps until series dies? I'm guessing 3-4

  • @KangJangkrik
    @KangJangkrik Před 2 lety

    How to draw two separated shapes in OpenGL?

    • @lengors1674
      @lengors1674 Před 2 lety +1

      Gabe hasnt talked about all the required subjects for you to be able to do that the "proper way" (he needs to talk about shaders in more detail, uniforms and vectors and matrices).
      However, you can emulate that by creating one vertex buffer (and optionally one element/index buffer and/or one vertex array) and instead of defining the vertices positions as if the objects are centered around the origin ((0.0, 0.0)), you offset them accordingly.
      So, for example, a square of size 1 by 1 could have the following vertices:
      (-0.5, -0.5)
      ( 0.5, -0.5)
      ( 0.5, 0.5)
      (-0.5, 0.5)
      So now, if you want to draw the same square at the coordinates (-0.5, 0.5) you just have to add the x and y componentes to the vertices of the square:
      (-1.0, 0.0)
      ( 0.0, 0.0)
      ( 0.0, 1.0)
      (-1.0, 1.0)
      So, if you want to draw multiple squares (or any other mesh for that matter), you just have to offset every vertex of that mesh by the coordinate at which you want the object to be centered at.
      After defining a vertex buffer (and the other optional stuff) for each object, you need to bind the shader, then bind the vertex buffer (or alternatively, the vertex array, if you defined it), then do the draw call. Now just repeat the process for every object (except for the shader, you just need to bind the shader once, unless you use a different shader for each object, in which case you should bind it before each draw call).
      Again, this is a way to do it with the knowledge you have so far (based on this series), but in the future, you'll learn more subjects and then there will be better ways to draw multiple objects.
      Edit: alternatively you can define multiple objects in the same buffer, which is probably easier for you. Just define the coordinates for the first object and then the ones for the other and the "upload" it to the buffer

    • @KangJangkrik
      @KangJangkrik Před 2 lety +1

      @@lengors1674 thanks for the explanation 👍

  • @douggale5962
    @douggale5962 Před 2 lety

    I love how you admit you aren't quite an expert in the tessellation and geometry shaders. Me either. Both are so avoidable, it's hard to learn much about them.

  • @bellanboyz5864
    @bellanboyz5864 Před 2 lety +1

    Hi

  • @junkokonno
    @junkokonno Před 2 lety +1

    ourcraft

  • @sagnik8760
    @sagnik8760 Před 2 lety

    2b2t players: