Sign in to follow this  

How to control distance attenuation?

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