I am trying to make everything the “modern” 3.0 openGL way in my app and I have a question.
Say I want to access stuff like light properties and material properties in my shader. In GLSL there are the so-called build-int uniform variables/structs for this so I think that as far as the shader’s part is concerned I am okay.
But how can I set the light and material properties from the main openGL application? I am asking since glLight and glMaterial are deprecated. Generally, even though I know what is deprecated I have not figured out exactly how to do all the deprecated functionalities in 3.0 code. Any help would be appreciated.
EDIT: I have a general idea about how it would be done but I am not sure if it is correct. I am thinking that they should be declared and passed to the shaders as any other uniform/attribute variables. Is this assumption correct?
For example setting the LightSource 0 position would be something like this?
glUniform3fv(getUniformLocation(shaderProgram, "glLightSource.position"),3, lightPosition);