Jump to content
  • Advertisement
Sign in to follow this  
Steve-B

How to control distance attenuation?

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

Hi I'm playing with lighting at the moment and I ahve written my lighting code as part of a Cg script file. It works great but now I've added distance attenuation and I'm not getting the results I'm looking for. What I want to know is how do the following constants affect the final image? GL_CONSTANT_ATTENUATION GL_LINEAR_ATTENUATION GL_QUADRATIC_ATTENUATION What I'm trying to achieve is a similar effect to fogging. I want polygons at a certain distance to be completely blacked out. At the moment it looks pretty good but I want the distance the light extends to be much shorter. Anyone got any advice on this subject?? STeve

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Steve-B
...
What I want to know is how do the following constants affect the final image?

GL_CONSTANT_ATTENUATION
GL_LINEAR_ATTENUATION
GL_QUADRATIC_ATTENUATION
...
The Lighting Chapter of the Red Book has the equations that are used in OpenGL's standard lighting, including the attenuation factor and how it fits into the rest of the lighting calculations.

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!