Personal tools

LightAttentuation

From Odwiki

Jump to: navigation, search


Light attentuation is appearance of light "decay" over distance. This effect is simulated in CG by attentuating the light intensity either with the distance or by the square of the distance (physically correct).

The standard light in mantra, (the ASADLightSHOP) supports Linear and Physically Correct attenuation.

In actual fact, light does not decay in a normal atmosphere at such a rate; what really causes this appearance is the light source covers less of the object the further away it moves. For example, if sun retreated from us, it's area to us would decrease in the x and y axis and so would be attenuated by the square of its distance from us.

That being said, in thick atmospheres light can certainly be degraded because it gets scattered on its way to us. A laser beam will decay in power by 20-40% over 1 kilometer on a clear day. On a murky day, 80%.

You can check all this in mantra by doing a simple test: Using mantra's GlobalIllumination tools and no standard lights at all, you can create a "sun" object by giving it a constant emit white color and apply a normal phong shader like the VEXPlasticSHOP to a simple scene. You need one LightObject with a VEXGlobalIlluminationSHOP applied to it with the shader settings on "Full Irradiance". Keep the sun object nearby and render it and look at the result. You may have to have a very bright sun (with emit values of waaay over 1) to get it bright enough. You also may have to use a fairly high sampling rate. Now move the sun away from the geometry and you'll see that the geometry rapidly becomes less bright. In this example there is no attenuation of the light rays in any regular light shader; it's all a matter of how much "coverage" there is of the sun over the geometry.