Sign in to follow this  
Steve-B

How to control distance attenuation?

Recommended Posts

Steve-B    150
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
Kalidor    1087
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this