PDA

View Full Version : cant close LIGHT0



Roberto
11-02-2014, 02:07 PM
Dear Forum

I put in my scene 2 light:
-global
-LIGHT0

I close the global:

GLfloat AmbientL[]={0,0,0,1};
glLightModelfv(GL_LIGHT_MODEL_AMBIENT ,AmbientL);

and now, i set the LIGHT0 also to 0, but enabled:

GLfloat AmbientLight0 []={0,0,0,1};
glLightfv(GL_LIGHT0,GL_AMBIENT ,AmbientLight0);
glEnable(GL_LIGHT0);


With this setting,i can see much light on my model ( a piramid)

And not only: I set material to GL_AMBIENT so:

GLfloat Material_Gray[]={1,1,1,1};
glMaterialfv(GL_FRONT ,GL_AMBIENT,Material_Gray);

so ,what I aspect is,a uniform color on all surface.
But this dont happend,and I can see the differenet faces of piramid.

Thanks very much
Roberto

carsten neumann
11-04-2014, 12:16 AM
The initial settings for GL_LIGHT0 and materials have non-zero diffuse components, so my guess would be that is where the light contribution you are seeing is coming from.