In this video we take a break from 3D and explore 2D rendering using a sprite batching technique in OpenGL. This is also a great opportunity to get introduced to Uniform Buffer Objects which is a more efficient way of loading uniforms than the method that we've been using so far, especially when you have many of them. UBOs can be used for 3D as well so even if you don't plan on doing 2D rendering you should definitely learn about them.
🔥 See the list of the books that I'm using as background information for my tutorials: [ Ссылка ]. I highly recommend them for learning more about OpenGL and Vulkan. These are affiliate links so if you use them to buy any of the books the price is the same for you and I will get a small commission (thank-you!).
The sprites that I used are from [ Ссылка ]
Free texture packing tool: [ Ссылка ]
Timecodes
0:00 Intro
0:26 Sprite Batching
1:54 Calculating sprite size in texture space
2:34 Screen space to NDC
2:47 Sprite batching solution
4:09 The vertex shader
4:54 The fragment shader
5:52 Supporting multiple sprite sheets
6:03 The QuadArray class
6:37 The SpriteBatch class
8:22 Simple animation example
8:35 Efficiency of uniform variables
9:08 Uniform Buffer Objects
13:40 Conclusion
Make sure to watch all the previous tutorials in the "OpenGL For Beginners" playlist at [ Ссылка ]
Please visit [ Ссылка ] to see more of my tutorials on modern OpenGL.
Link to source: [ Ссылка ]
OpenGL 4.6 specification: [ Ссылка ]
Feel free to comment below.
Email: ogldev1@gmail.com
Github: [ Ссылка ]
Twitter: @ogldev
One time donations (Paypal): [ Ссылка ]
Patreon: [ Ссылка ]
Enjoy,
Etay Meiri
#opengl #ogldev #opengtutorials
Ещё видео!