glLight Issues

Started by
2 comments, last by Galileo430 21 years, 3 months ago
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.
------------------------------------------------------------I wrote the best video game ever, then I woke up...
Advertisement
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
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
"Don't panic"
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);  
------------------------------------------------------------I wrote the best video game ever, then I woke up...

This topic is closed to new replies.

Advertisement