Hello,
I use a simple phong shader to compute lighting.
It works fine on nvidia cards.
But with all ATI cards I always obtain funny colors and sometimes the good transparency (alpha).
The code is like this :
for all layers in my data
init opengl + light
use shader
render display lists
unload shader
disable light
endfor
The code uses glColor and glColorMaterial to set the colors.
In the fragment shader :
- If I only assign gl_Color to the gl_FragColor I have no light but the good colors.
- If I do anything with the light the results are bad :
For example with only ambient :
gl_FragColor = gl_LightSource[0].ambient * gl_FrontMaterial.ambient;
I obtain a bad color and no transparency
With diffuse only :
gl_FragColor = gl_FrontLightProduct[0].diffuse * max(dot(N,L), 0.0);
I have bad colors but transparency.
And some layers in my data seem to have no light (black color).
Do you know what can produce such results on ATI cards ?
Thanks