OpenGL 3D Game Tutorial 5: Coloring using Shaders
LWJGL tutorial series on how to create a 3D Java game with OpenGL!
We put our knowledge of opengl shaders to use in this episode and create a shader program to color our quad.
Full code download (only use if you get stuck! You'd have no chance of understanding later tutorials if you skip this one!):
https://www.dropbox.com/sh/qtfhwru70y9sg8b/AAAweVar09wgu9DmmSO8yAf8a?dl=0
LWJGL Wiki: http://lwjgl.org/wiki/index.php?title=Main_Page
LWJGL Download: http://lwjgl.org/download.php
Slick-Utils Download: http://slick.ninjacave.com/slick-util/
Common Mistakes:
-If you get a large access violation error then check that you aren't trying to initialize your shader before you've created the display. Creating the display MUST happen before you do anything else OpenGL related.
-Make sure that your "out" variable in the vertex shader has the EXACT same name as the "in" variable in the fragment shader.
-If you get the following error: "'gl_Position' : undeclared identifier"
then check that you didn't load up the vertex shader code twice in the StaticShader. This error usually occurs when you load up and compile vertex shader code as a fragment shader.
-Make sure that in the MainGameLoop you render the quad AFTER starting the shader program but BEFORE stopping it. The shader program needs to be running when you render!
-In the ShaderProgram constructor make sure you're calling glAttachShader() for both the vertex shader and the fragment shader.
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.