OpenGL engine thingie - not one, but *two* lights!

Channel:
Subscribers:
22
Published on ● Video Link: https://www.youtube.com/watch?v=nPe2Lnh2Sm4



Duration: 0:39
16 views
1


As always kinda loosely following the learnopengl.com tutorials, I've put the light and material data (well, not sure if correctly) into their own structs in the fragment shader. Also, I put the Phong shading calculation code into its own function in the shader, so that I can call it multiple times. The result? I can now setup more than one light! I can just compute the "lit color" of a fragment for one light, then add that color to subsequent ones!
For now, however, the lights are hardcoded in the shader and not supplied as uniforms from the C++ code or anything, but that will come in a future update.