Buffers in OpenGL | How to Code Minecraft Ep. 2

Поділитися
Вставка
  • Опубліковано 10 лип 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...

КОМЕНТАРІ • 142

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

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

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

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

      1:10 Algbera

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

      How to contact you directly? Thanks

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

    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 UA-cam! Thanks, Gabe!

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

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

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

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

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

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

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

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

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

      why you roasting the cherno lmao good point tho

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

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

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

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

    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!

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

    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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • @coffee-is-power
    @coffee-is-power 2 роки тому +5

    Finally someone that is making a great opengl tutorial

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

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

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

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

  • @stpedro-ht9ng
    @stpedro-ht9ng Рік тому

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

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

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

    Best OpenGL video I have ever seen on UA-cam

  • @gaudok3281
    @gaudok3281 7 місяців тому

    One of the best videos on this topic

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

    Very great quality content, love it!

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

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

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

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

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

    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.

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

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

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

    Masterpiece of a channel

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

    This is really good. Please keep on

  • @Patrickblox
    @Patrickblox 2 роки тому +4

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

    • @Hydra-BR
      @Hydra-BR 2 роки тому

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

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

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

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

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

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

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

    Thank you so so so much for this series!

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

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

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

    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

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

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

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

    Thanks so much for this series

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

    best teacher for any graphics programming!

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

    This channel is gold.

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

    Great job explaining it!

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

    I love the 3blue1brown style editing

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

    So grateful for this

  • @Hydra-BR
    @Hydra-BR 2 роки тому

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

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

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

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

    Amazing vids!

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

    great stuff!

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

    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.

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

    Can't wait for it all to be out.

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

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

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

  • @Pedro-jj7gp
    @Pedro-jj7gp 2 роки тому

    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?

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

    Masterpiece ❤️👌👌

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

      Quaternions are no vectors.

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

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

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

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

    Wonderful!

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

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

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

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

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

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

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

    Love the 3b1b animation + music

    • @whatisuser
      @whatisuser 8 днів тому

      3b1b has released his library for his "animation". It's open source!

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

    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.

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

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

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

    Love the 3blue1brown vibes

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

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

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

    i love you gabe

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

    love it

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

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

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

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

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

    wadawow!

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

    Nice

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

    Ooh for once I'm early!

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

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

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

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

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

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

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

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

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

    and what whit the compute shader?

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

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

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

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

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

      anti code copying lol

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

      @@hirzanabqary big brain xD

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

    cool

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

    It seems like OpenGL has a lot of boilerplate

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

    this man is the 3b1b of opengl at tbh

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

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

      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.

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

    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?

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

    when wl the new vids drop for the series?

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

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

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

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

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

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

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

    How to draw two separated shapes in OpenGL?

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

      @@lengors1674 thanks for the explanation 👍

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

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

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

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

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

    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.

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

    all the visuals in the video give me heavy 3Blue1Brown vibes.
    is there like a standard that all math related UA-camrs 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 2 роки тому

      "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 2 роки тому

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

  • @everluck35
    @everluck35 2 роки тому +4

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

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

    Hi

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

    ourcraft

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

    2b2t players: