Follow the below mentioned steps to add materials to our object and observe the effects of light on it:
- If you go to main.cpp, what you want to do is actually go straight to the while loop, because everything outside of that should is fine and doesn't need any modification.
- So, in lines of code below lightingShader.Use();, we'll get rid of objectColorLoc and lightColorLoc. We want lightPosLoc, but a parameter in it needs to be changed to light.position because we've updated that in our fragment shader.
- In gluniform3f you can get rid of objectColorLoc and lightColorLoc.
- Now we need to also set the light's properties. For that, we'll add glm::vec3 lightColor; and we'll add ...