![]() |
![]() |
![]() |
The attenuation of light is its logical reduction in brightness based on various factors, like distance and angle. This is also known as falloff.
Qrad3 traditionally uses two methods of calculating a light's distance falloff. For point light entities, it uses linear falloff. This means the brightness of the light diminishes at a constant rate as the distance increases. In physics, light brightness is calculated by the inverse-square of the distance. This works out so that 2 units away the light is 1/4 as bright, 3 units away the light is 1/9 as bright, etc. This is what Qrad3 uses for surface lights. The angle the light strikes a surface also affects the brightness in Qrad3.
These formulas may not always yield the desired results. ArghRad adds several new options to better control the light falloff.
This option allows you to select the type of falloff for point lights. The default, 0, uses the traditional linear formula. A value of 2 uses inverse-square falloff like surface lights. With this type, the initial drop in brightness is very rapid, but the dimmed light is sustained for a much greater distance. This can appear too severe for some situations, so ArghRad also provides a bit of a compromise. A value of 1 uses inverse falloff: 2 units away the light is 1/2 as bright, 3 units away it's 1/3 as bright, etc. It is more realistic than linear falloff, but not as severe as inverse-square falloff. This can be a nice alternative for entities like mine-lights or torches.
Because of the more rapid brightness drop with inverse and inverse-square formulas, you will need to set much higher brightness values for lights that use them.
Example:
{ "classname" "light" "origin" "64 64 64" "light" "2000" "_falloff" "1" }
("_fade" and "_wait" are identical) These options only work on lights with linear falloff. It modifies the rate that the light fades with distance, without changing it's brightness. A value less than 1 makes the light fade slower, and a value greater than 1 makes the light fade faster. For example, a value of .5 makes the light fade out half as fast (go twice as far).
Example:
{ "classname" "light" "origin" "64 64 64" "light" "400" "_fade" "2" }
("_angfade" and "_angwait" are identical) As the angle light hitting a surface moves from perpendicular to parallel, the brightness of the light decreases. These options are used to modify the rate at which the light fades as the angle changes. A value less than 1 makes the light fade slower, and a value greater than 1 makes the light fade faster. The effect is easier to see than explain. ;)
Example:
{ "classname" "light" "origin" "64 64 64" "light" "200" "_angfade" ".5" }