#### Archived

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

# glLight Issues

This topic is 5628 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
What exactly is wrong?
Is the model all black?
I sugges you to write some code that moves the light to where the mouse cursor is, on the scene, so that way you can move it closer/father from your object, and see what changes, etc.

Height Map Editor | Eternal lands

##### 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 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);

• 32
• 12
• 10
• 9
• 9
• ### Forum Statistics

• Total Topics
631350
• Total Posts
2999479
×