I tried to see about this question on the wiki, and on google, but I didn’t find any information about this. If it was obvious, forgive me…
My interrest is about OpenGL 3 and above versions, and lighting and materials.
For doing lighting in GL, I use glEnable (GL_LIGHTING), glMaterialfv and so on to enable lighting calculations.
I actually do the same whether I use shaders or not.
However with shaders, I think it is possible to go beyond the OpenGL light number limitation, with sending uniforms, although I never did so. I hope I’m not wrong since here…
What I would like to know, is that if for GL 3 and above versions, we should still use glLight, glMaterial or if we should prefer to do it some other ways, for example, what I have in mind is the following:
. Use uniforms to enable some lights.
. Use vertex attributes to set materials.
. Use the previous in vertex/fragment shaders to do lighting calculations.
My main regard about this topic is to know if these functions (mainly lighting and material functions) are still up to date functions, if I can expect them to have a long future, or if my previous supposition (mainly about sending lights with uniforms and materials with vertex attributes) would/should become the way to manage lighting under GL.
From what I understood, nothing prevents me to send uniforms for lighting. However, I’m really unsure about this all and how to behave correctly.
What do you think about it ?