Constant-Linear-Quadratic Falloff: Difference between revisions
m (Removed warning - article is right.) |
(Updated the article to include mathematical explanations.) |
||
Line 1: | Line 1: | ||
===Introduction=== | ===Introduction=== | ||
The Constant-Linear-Quadratic system is an old system for determining the dissipation (or " | The Constant-Linear-Quadratic system is an old system for determining the dissipation (refered to as "falloff" or "attenuation") of light intensity from light sources. (It has since been superseded by the two "percent falloff distance" values, which are much easier to understand and handle.) | ||
The ratio between the three keyvalues Constant (_constant_attn), Linear (_linear_attn) and Quadratic (_quadratic_attn) will determine the way in which light is diminished from a lightsource. (The three values has gotten their names from the mathematical function used to describe the decline of its intensity.) | The ratio between the three keyvalues ''Constant'' (''_constant_attn''), ''Linear'' (''_linear_attn'') and ''Quadratic'' (''_quadratic_attn'') will determine the way in which light is diminished from a lightsource. (The three values has gotten their names from the mathematical function used to describe the decline of its intensity.) | ||
=== | ===Constant Falloff=== | ||
[[Image:ConstantLight.jpg|Constant falloff|200px|right]] | |||
The picture on the right shows a lightsource displaying the simplest of falloffs: Constant falloff. The keyvalues ''Constant'', ''Linear'' and ''Quadratic'' have here been set to "1", "0" and "0" respectively, creating a Constant-Linear-Quadratic ratio of 1:0:0, meaning that the falloff is 100% Constant, 0% Linear, and 0% Quadratic. | |||
The intensity of a 100% constant lightsource is constant, totally unaffected by distance, having no falloff at all. Its light will just continue until it hits a surface, theoretically capable of illuminating an infinite area. | |||
This type of light can be seen from the sky (sunlight, monlight and starlight), and other large and distant light sources. | |||
As a 100% constant lightsource is an extreme type of light, constant light is mostly used in combination with the other two types of falloff, to "soften" them. | |||
{{clr}} | {{clr}} | ||
Line 23: | Line 24: | ||
[[Image:LinearLight.jpg|Linear fallout|200px|right]] | [[Image:LinearLight.jpg|Linear fallout|200px|right]] | ||
This is the same light, but at a 0:1:0 ratio, making its lighting 100% linear. | This is the same light entity, but at a 0:1:0 ratio, making its lighting 100% linear instead. | ||
Mathematically, the decline of this type of light is linear, inversely proportial to the distance from the light source (I = 1/d). The further the light travels from the lightsource, the more it dissipates. To compensate for this decline, the intensity of the lightsource is boosted to 100 times of its brightness. | |||
A 100% linear lightsource is extreme, representing a soft light of ''infinite'' size, but still a 0:1:0 lightsource is believable for most entity based lightsources. | |||
{{clr}} | {{clr}} | ||
=== | ===Quadratic Falloff=== | ||
[[Image:QuadraticLight.jpg|Quadratic falloff|200px|right]] | |||
This is a normal, unmodified light source, preset to 0:0:1, making it 100% Quadratic. | |||
The decline of a 100% quadratic light is exponential (quadratic), expressed as 1/d^2, creating a very sharp drop in light. To compensate for the fast decline of quadratic lights, a quadratic light is also multiplicated to be 100^2 (10 000) times more intense than the actual intensity. | |||
An unmodified (100% quadratic) lightsource represents a pure "point light source", the effect looking like a real lightsource shining through murky water, which is far from typical real world lightsource behavior. | |||
When used with moderation, quadratic falloff can be used not only for small lightsources, but also to reflect light travelling through something more dispersing than air, like air humidity (like fog) or water. | |||
{{clr}} | {{clr}} | ||
Line 47: | Line 60: | ||
===External | ===External links=== | ||
*[http://www.editlife.net/tutorials.php?id=15 A more in-depth explanation of the system.] | *[http://www.editlife.net/tutorials.php?id=15 A more in-depth explanation of the system.] | ||
*[[wikipedia:Soft_light|The little I could find about falloff on Wikipedia.]] | |||
[[Category:Level Design]] | [[Category:Level Design]] |
Revision as of 13:02, 17 August 2007
Introduction
The Constant-Linear-Quadratic system is an old system for determining the dissipation (refered to as "falloff" or "attenuation") of light intensity from light sources. (It has since been superseded by the two "percent falloff distance" values, which are much easier to understand and handle.)
The ratio between the three keyvalues Constant (_constant_attn), Linear (_linear_attn) and Quadratic (_quadratic_attn) will determine the way in which light is diminished from a lightsource. (The three values has gotten their names from the mathematical function used to describe the decline of its intensity.)
Constant Falloff
The picture on the right shows a lightsource displaying the simplest of falloffs: Constant falloff. The keyvalues Constant, Linear and Quadratic have here been set to "1", "0" and "0" respectively, creating a Constant-Linear-Quadratic ratio of 1:0:0, meaning that the falloff is 100% Constant, 0% Linear, and 0% Quadratic.
The intensity of a 100% constant lightsource is constant, totally unaffected by distance, having no falloff at all. Its light will just continue until it hits a surface, theoretically capable of illuminating an infinite area. This type of light can be seen from the sky (sunlight, monlight and starlight), and other large and distant light sources.
As a 100% constant lightsource is an extreme type of light, constant light is mostly used in combination with the other two types of falloff, to "soften" them.
Linear Falloff
This is the same light entity, but at a 0:1:0 ratio, making its lighting 100% linear instead.
Mathematically, the decline of this type of light is linear, inversely proportial to the distance from the light source (I = 1/d). The further the light travels from the lightsource, the more it dissipates. To compensate for this decline, the intensity of the lightsource is boosted to 100 times of its brightness.
A 100% linear lightsource is extreme, representing a soft light of infinite size, but still a 0:1:0 lightsource is believable for most entity based lightsources.
Quadratic Falloff
This is a normal, unmodified light source, preset to 0:0:1, making it 100% Quadratic.
The decline of a 100% quadratic light is exponential (quadratic), expressed as 1/d^2, creating a very sharp drop in light. To compensate for the fast decline of quadratic lights, a quadratic light is also multiplicated to be 100^2 (10 000) times more intense than the actual intensity.
An unmodified (100% quadratic) lightsource represents a pure "point light source", the effect looking like a real lightsource shining through murky water, which is far from typical real world lightsource behavior.
When used with moderation, quadratic falloff can be used not only for small lightsources, but also to reflect light travelling through something more dispersing than air, like air humidity (like fog) or water.
Mixed Falloff
When blending between these three types of falloff, you set the proportions of each falloff type against the other two types. To avoid confusion, keep in mind that you can set the scale of these proportions as you wish: A proportion of 3:6:1 gives the exact same result as 6:12:2, or 30:60:10, which can easily be translated to 30%, 60% and 10%.
Foot-note - The Valve Formula
Apparently Valve is using a different formula than most lighting programs, making the light reach its true intensity after 100 units from the source instead of at the source itself. Having grown accustomed to quadratic intensity, users should not be able to note any difference.