View Full Version : Light in openGL

11-27-2011, 05:25 AM
Hello, dear community!
I have 3D object. At the moment i have 1 light source - because of this when i rotate coordinate system around my object i see that object`s point colors changed because of angle to my light source. All i wanna do is to make light source that will light my object same from all points - so even if i rotate coordinate system - i shouldnt see that object`s point colors are changed - they must be always the same. Thank you.

11-27-2011, 07:23 AM
With the fixed-functions pipeline, simply disable the lights.
With shaders, simply use your diffuse color (from vertex or texture) directly as output of the fragment shader.

11-27-2011, 02:38 PM
If i disable the light, my object texture become black.

For lighting i used :

position : Array [0..3] of GLFloat = (0.0, 0.0, 3.5, 1.0);
glLightfv (GL_LIGHT0, GL_SPECULAR , @position);
glEnable (GL_LIGHTING);

11-27-2011, 03:22 PM
Have you tried to set the vertex color calling glColor()? The vertex color needs to be different than the default black, becouse it will be multiplied with the texture color.