Jump to content
  • Advertisement
Sign in to follow this  
Aken H Bosch

OpenGL Disable OpenGL 'culling' for specular lighting?

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

I've got a game I've resumed work on, and I just noticed that some of the polygons' specular lighting seems to change too drastically over short changes in camera/surface/sun angle. I am using vertex normals, and I think the problem may be that it is completely ignoring reflected rays that do not bounce onto the front side of the main triangle's normal vector. How can I make it so that it doesn't stop calculating lighting if a reflected ray is on the wrong side of its polygon? It looks really dumb this way.

Share this post


Link to post
Share on other sites
Advertisement
Specular highlights are computed with the formula

angle^shininess *specular(light)*specular(material),

where angle is the angle between the light ray relected by the surface and the vector between the surface and the viewpoint, so the higher shininess, the more non-linear the behaviour, which might explain why the highlights change so fast. To have a softer specular lighting, use lower values of shininess ; to have bright, small and "fast moving" highlights, use higher values (glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, value)). The polygon normal does not influence lighting calculations. OpenGL computes lighting at the vertices, using the vertex normals, then interpolates the lighting on the polygon.

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!