Env fog controller: Difference between revisions
Jump to navigation
Jump to search
Note:The 3D Skybox fog levels set by the sky_camera parameters should correspond to your env_fog_controller settings.
Tip:By adding fog to a level, you can hide a FarZ Clip Plane, and reduce the amount of rendered geometry, improving game performance.
m (→Keyvalues) |
m (minoro) |
||
Line 2: | Line 2: | ||
{{base_point}} | {{base_point}} | ||
==Entity | == Entity description == | ||
[[Image:Fog controller.png|left]]The '''env_fog_controller''' entity determines the density of aerial fog for the whole map. | [[Image:Fog controller.png|left]]The '''env_fog_controller''' entity determines the density of aerial fog for the whole map. | ||
{{map_properties}} Only the first instance of the env_fog_controller entity in a level will be used. It is pointless to place multiple env_fog_controller entities in a map!. | {{map_properties}} Only the first instance of the env_fog_controller entity in a level will be used. It is pointless to place multiple env_fog_controller entities in a map!. | ||
{{note|The [[3D Skybox]] fog levels set by the [[sky_camera]] parameters should correspond to your [[env_fog_controller]] settings.}} | |||
{{tip|By adding fog to a level, you can hide a '''FarZ''' Clip Plane, and reduce the amount of rendered geometry, improving game performance.}} | {{tip|By adding fog to a level, you can hide a '''FarZ''' Clip Plane, and reduce the amount of rendered geometry, improving game performance.}} | ||
Adding fog (to represent haze, mist, diffuse smoke or dust) to the atmosphere has important implications for 'realistic' [[Lighting]]. Light is scattered and absorbed as it passes through fog. The denser the fog, the greater the effect. | Adding fog (to represent haze, mist, diffuse smoke or dust) to the atmosphere has important implications for 'realistic' [[Lighting]]. Light is scattered and absorbed as it passes through fog. The denser the fog, the greater the effect. | ||
* [[Falloff]] - (or attenuation) is the rate at which light intensity decreases over distance. Falloff distance decreases as fog gets thicker. | * [[Falloff]] - (or attenuation) is the rate at which light intensity decreases over distance. Falloff distance decreases as fog gets thicker. | ||
* [[Tyndall | * [[Lighting#Tyndall effects|Tyndall effects]] - can be seen when the fog particles reflect light toward the viewer. Halos and Lightbeams become more visible as fog gets thicker. | ||
* Diffused Lighting - the boundary-line between light and shadow becomes more blurred (diffuse) as fog gets thicker. See [[Lightmap Scale]] and [[shadow_control]]'s "distance" parameter. | * Diffused Lighting - the boundary-line between light and shadow becomes more blurred (diffuse) as fog gets thicker. See [[Lightmap#Lightmap Scale|Lightmap Scale]] and [[shadow_control]]'s "distance" parameter. | ||
== Keyvalues == | |||
;* fogenable {{boolean}} | ;* fogenable {{boolean}} | ||
: Enable fog on map load. | : Enable fog on map load. | ||
Line 45: | Line 36: | ||
;* fogblend {{boolean}} | ;* fogblend {{boolean}} | ||
: This will enable blending between ''fogcolor'' and ''fogcolor2'', based on the direction the player is looking. If the player's viewpoint is equal to the ''fogdir'' vector, the fog will be drawn with ''fogcolor2'' ( | : This will enable blending between ''fogcolor'' and ''fogcolor2'', based on the direction the player is looking. If the player's viewpoint is equal to the ''fogdir'' vector, the fog will be drawn with ''fogcolor2'' (red); if facing in the opposite direction, the fog will be drawn with ''fogcolor'' (blue). If facing perpendicular to the fogblend axis, the fog will be a 50/50 blend of ''fogcolor'' and ''fogcolor2'' (purple). | ||
: This can be used to approximate the effect of light diffusing through the fog, but since the fogblend effect is applied for the entire rendered scene, it is best to keep the two colors relatively close to make the blending less obvious. | : This can be used to approximate the effect of light diffusing through the fog, but since the fogblend effect is applied for the entire rendered scene, it is best to keep the two colors relatively close to make the blending less obvious. | ||
: For example, sunlight with a Yaw of 45 degrees and a Pitch of -45 degrees could be enhanced using a ''fogdir'' of "-1 -1 1", a ''fogcolor'' of "120 110 100" and a ''fogcolor2'' of "80 70 60". | : For example, sunlight with a Yaw of 45 degrees and a Pitch of -45 degrees could be enhanced using a ''fogdir'' of "-1 -1 1", a ''fogcolor'' of "120 110 100" and a ''fogcolor2'' of "80 70 60". | ||
Line 68: | Line 59: | ||
* {{kv targetname}} | * {{kv targetname}} | ||
==Flags== | == Flags == | ||
* 1 : Master (Has priority if multiple env_fog_controllers exist) | * 1 : Master (Has priority if multiple env_fog_controllers exist) | ||
==Inputs== | == Inputs == | ||
;* SetStartDist <float> | ;* SetStartDist <float> | ||
: Set the fog start distance. | : Set the fog start distance. | ||
Line 115: | Line 104: | ||
* {{i targetname}} | * {{i targetname}} | ||
==Outputs== | == Outputs == | ||
* {{o targetname}} | * {{o targetname}} | ||
== See also == | |||
* [[Fog tutorial]] | |||
* [[Fog Basics]] | |||
* [[Dust, Fog, & Smoke]] |
Revision as of 00:48, 16 April 2008
Template:Wrongtitle Template:Base point
Entity description
The env_fog_controller entity determines the density of aerial fog for the whole map.
Template:Map properties Only the first instance of the env_fog_controller entity in a level will be used. It is pointless to place multiple env_fog_controller entities in a map!.


Adding fog (to represent haze, mist, diffuse smoke or dust) to the atmosphere has important implications for 'realistic' Lighting. Light is scattered and absorbed as it passes through fog. The denser the fog, the greater the effect.
- Falloff - (or attenuation) is the rate at which light intensity decreases over distance. Falloff distance decreases as fog gets thicker.
- Tyndall effects - can be seen when the fog particles reflect light toward the viewer. Halos and Lightbeams become more visible as fog gets thicker.
- Diffused Lighting - the boundary-line between light and shadow becomes more blurred (diffuse) as fog gets thicker. See Lightmap Scale and shadow_control's "distance" parameter.
Keyvalues
- fogenable <boolean>
- Enable fog on map load.
- fogstart <float>
- How far from the viewer the fog should start.
- fogend <float>
- How far from the viewer the scene should be completely fogged.
- fogmaxdensity <float>
- Fog Max Density [0..1]
- farz <integer>
- Far Z Clip Plane
- This setting is used for optimizing your map. Anything beyond this distance (in world units) will not be rendered. It is recommended to keep this number higher then your fogend value and ensure fogmaxdensity is set to 1.
- fogcolor ⇆#000000rgb(0,0,0)⇆
- Primary Fog Color.
- fogblend <boolean>
- This will enable blending between fogcolor and fogcolor2, based on the direction the player is looking. If the player's viewpoint is equal to the fogdir vector, the fog will be drawn with fogcolor2 (red); if facing in the opposite direction, the fog will be drawn with fogcolor (blue). If facing perpendicular to the fogblend axis, the fog will be a 50/50 blend of fogcolor and fogcolor2 (purple).
- This can be used to approximate the effect of light diffusing through the fog, but since the fogblend effect is applied for the entire rendered scene, it is best to keep the two colors relatively close to make the blending less obvious.
- For example, sunlight with a Yaw of 45 degrees and a Pitch of -45 degrees could be enhanced using a fogdir of "-1 -1 1", a fogcolor of "120 110 100" and a fogcolor2 of "80 70 60".
- fogcolor2 ⇆#000000rgb(0,0,0)⇆
- Secondary Fog Color.
- fogdir <vector>
- Primary Fog Direction
- A vector (given by three space-separated numbers X Y Z) which points from the secondary fogcolor2 towards the primary fogcolor.
- use_angles <boolean>
- Use Angles for Fog Dir
- Use angles instead of fogdir for the fogblend-axis.
- Template:Ep1 add <float>
- Interpolate time
Flags
- 1 : Master (Has priority if multiple env_fog_controllers exist)
Inputs
- SetStartDist <float>
- Set the fog start distance.
- SetEndDist <float>
- Set the fog end distance.
- TurnOn
- Turn the fog on.
- TurnOff
- Turn the fog off.
- SetColor ⇆#000000rgb(0,0,0)⇆
- Set the primary fog color.
- SetColorSecondary ⇆#000000rgb(0,0,0)⇆
- Set the secondary fog color.
- SetFarZ <integer>
- Set the far clip plane distance.
- SetAngles <angles>
- Set the angles to use for the secondary fog direction.
- Set the primary fog color.
- Set the secondary fog color.
- Set the fog start distance.
- Set the fog end distance.
- Start fog transition.