Jump to content
  • Advertisement
Sign in to follow this  
O-san

OpenGL Flickering lighting

This topic is 3893 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

Hello! I'm having problems with standard OpenGL lighting enabled with GL_SEPARATE_SPECULAR_COLOR. I've got a normal pointing let's say 0, 0, 1 and my light rays hit this polygon in a parallel way to the polygon. The lighting/surface then starts to flicker when I move the view… How can I avoid this? I think it's because the rays hit the surface at "no angle". I don't want to slightly noise my polygon normal or some other work-around like that... any ideas what could cause this problem? An image showing my polygon normal and a light ray (line with arrow):
An image showing the problem in action, to the right the view has changed slightly. Lighting on the mud has become distorted:

Share this post


Link to post
Share on other sites
Advertisement
I take it you are using hardware lightmapping?

if so make sure you don't have Z-fighting going on!

do this by adding
glPolygonOffset(1, 1);
glEnable(GL_POLYGON_OFFSET);
...
glDisable(GL_POLYGON_OFFSET);

Share this post


Link to post
Share on other sites
I'm not using any hardware lightmapping. A side of the box has four vertices. I have no backfacing polygons. Soo the boxes in the screenshots have 12 vertices each.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!