Etienne Belanger(deleted)
|
Re: It seems as if glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ...) is interpreted incorrectly
|
Etienne Belanger(deleted)
05/04/2009 9:26 AM
post28608
|
Re: It seems as if glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ...) is interpreted incorrectly
The OpenGL 1.3 spec gives the following lighting equation (I assume this is what you were referring to...)
[...]
If c_es = SINGLE COLOR, then the equations to compute c_pri and c_sec are
c_pri = e_cm + a_cm * a_cs + sum(i=0..n-1, att_i * spot_i * [a_cm * a_cli + (n dot VP_pli) * d_cm * d_cli + f_i * exp(n
dot h_i, s_rm) * s_cm * s_cli])
csec = (0; 0; 0; 0)
[...]
I looked at the software renderer and it does implement the above equation.
What is the value of the ambient color of the material ?
What is the state of the GL_COLOR_MATERIAL cap ?
What is the state of the GL_LIGHT[0..7] caps ?
If GL_COLOR_MATERIAL is enabled,
What is the color material mode for the GL_FRONT, GL_BACK faces ?
What is the state of the GL_COLOR_ARRAY cap ?
If GL_COLOR_ARRAY is disabled, what is the current color (glColor4f) ?
If GL_COLOR_ARRAY is enabled, what are the colors stored in the array ?
Once we know what is the value of a_cm, we can determine if the results of the lighting calculation with
GL_LIGHT_MODEL_AMBIENT set to (1; 1; 1; 1) is correct or not, assuming no other lights are enabled.
|
|
|