Okay, looking for information on the NEW light and material methods for OpenGL, specifically pure version 4 methods. So far everything I find is only the old method of lighting and I notice that both lights and materials in version OpenGL 4 are not in the list of functions, so if they’re changing to a new system, I would like to keep up. Please let me know if you have any links or ideas on how to migrate from the 1.1 method to the newest one.
Lighting is calculated using the programmable pipeline. Depending on the application, it’s often achieved through fragment shaders
Lighting a simple sphere
Lighting a 2D normal-mapped texture
The Illumination Model
Normal mapping tutorial
There are more advanced techniques such as deferred lighting, but first you should ensure a strong understanding of shaders and the illumination model, including the basic math behind it.
Thank you, that PDF was extremely useful. But I’m really hoping for some examples of sending uniforms to the shaders, I’m still struggling with that part, instead of using the glLight and glMaterial commands I mean. But that PDF will be VERY useful once I get that far.
glUniformXX(), they work like the normal OpenGL attribute functions (glUniform3f, glUniform1ub, etc). You can get the location of your shader program’s uniforms by using glGetUniformLocation(programID, uniformNameString).