Jump to content
  • Advertisement


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


glLight Issues

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

If you intended to correct an error in the post then please contact us.

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
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 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

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


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


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!