OpenGL 3D Game Tutorial 3: Rendering with Index Buffers
LWJGL tutorial series on how to create a 3D Java game with OpenGL!
This week we learn a more efficient way to render our quad using an index buffer.
Full code available here: https://github.com/TheThinMatrix/OpenGL-Tutorial-3
LWJGL Wiki: http://lwjgl.org/wiki/index.php?title=Main_Page
Common Problems
- Make sure that you use the new vertex positions array - it is different from last episode!
-In the loadToVao() method the last parameter of the RawModel constructor has now changed to "indices.length" instead of "positions.length/3". Make sure you've made this change!
-Creating the display must be the first thing you do in the main method. Don't try initializing the RawModel first.
If you get the " Cannot use offsets when Element Array Buffer Object is disabled" error, check the following:
-Check that you are calling the "bindIndicesVBO()" from the "loadToVao()" method.
-Don't unbind the index buffer anywhere! Each VAO has one special slot for an index buffer, and unbinding the index buffer will remove it from that slot.
Support the series on Patreon: https://www.patreon.com/thinmatrix
Facebook Page: https://www.facebook.com/thinmatrix
Tumblr: http://thinmatrix.tumblr.com/
Instagram: http://instagram.com/thin_matrix
Twitter: https://twitter.com/ThinMatrix
Check out my game on IndieDB: http://www.indiedb.com/games/equilinox
Other Videos By ThinMatrix
Other Statistics
The Elder Scrolls Online Statistics For ThinMatrix
Currently, ThinMatrix has 2,158,639 views for The Elder Scrolls Online across 29 videos. The Elder Scrolls Online has approximately 4 hours of watchable video on his channel, or 8.26% of the total watchable video on ThinMatrix's YouTube channel.