Archived

This topic is now archived and is closed to further replies.

Galileo430

glLight Issues

Recommended Posts

For some reason. My model refuses to light via hardware glLights. It renders just fine via Cel Shading (software dot product) so I know the normals are correct. I set values for ambient light, diffuse light, and specular. I set the light position to what should be a acceptable value. glEnable(GL_LIGHT0); then glEnable(GL_LIGHTING); But with no effect... I''m stumped.

Share this post


Link to post
Share on other sites
I had similar troubles, which I could resolve by drawing a simple point before any matrix transformations. Then, as my code evolved, the lighting problem mysteriously vanished and now works without the point. Spooky.

- D.G

http://sourceforge.net/projects/ssframework/
Physics & Visualization Framework
v0.0.4b as of 16.01.2003

Share this post


Link to post
Share on other sites
If I set up the light on the first pass it gives me nothing but funky results. The feet of the model light correctly but the rest of the body seems to be lit by a different light. I also can''t modify these values.. no matter what I change them too. The light never changes. Maybe it has to do with my use of Vertex Arrays? Is there something special about using Normal Arrays and meshes? A need to calculate the normals differently? I use standard vertex normals.

Thanks for the help


  
// m_nLightID == GL_LIGHT0

glDisable(m_nLightID);

glLightfv(m_nLightID, GL_DIFFUSE, m_LightDiffuse);
glLightfv(m_nLightID, GL_AMBIENT, m_LightAmbient);
glPushMatrix();
glLoadIdentity();
glLightfv(m_nLightID, GL_POSITION, m_LightPosition);
glPopMatrix();

glEnable(m_nLightID);

Share this post


Link to post
Share on other sites