Skip to main content
GameDev.net gamedev.net
🔒 Locked

glLight Issues

Started by Galileo430 Jan 19, 2003 at 5:55 PM 2 replies 750+ views
Original Post
Galileo430
Galileo430
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...
dog4
dog4
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"
Galileo430
Galileo430
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...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.