Env sun
From Valve Developer Community
This point-based entity is available in all Source games.
| Table of contents |
[edit]
Entity description
Places a Sun or Moon effect (glow sprite) in the skybox where it does not parallax, giving the impression that it is infinitely far away. The env_sun Entity does not contribute any actual lighting.
The properties of this entity apply to the whole map. Multiple instances of this entity within a map may cause errors.Skybox Lighting enters the Map through every toolsskybox-textured Brush.- Its basic properties are controlled by three Entities used in combination: light_environment defines (a) the color and intensity of the Diffuse Skylight and (b) the direction, color and intensity of the Direct Sunlight. It also creates (buggy, unconfigurable) Dynamic Shadows which can only be overridden/controlled by the shadow_control Entity. env_sun places a glow sprite in the skybox to represent the Sun's apparent position in the sky. To make sense of it all, just make sure you have only one of each of these entities in your map, and that the Pitch and Yaw <angles> are set the same for all three of them. (Pitch is equivalent to the Sun's Angle of Elevation from the ground, and Yaw is its Compass Bearing.)
- The Sky List article suggests some settings for some of Valve's skyboxes. The worldspawn Entity defines which skybox to use. Note also that env_fog_controller settings will look wrong if they don't correspond to the particular skybox in use.
- You can also send inputs to the env_sun entity by directing them to "env_sun" instead of using a target name.
- The effect is additive with the sky: a pure yellow sun with a bright blue sky will appear white in-game; change the color to account for this.
[edit]
Keyvalues
- !FGD targetname <target_source>
- Defines the name that other entities refer to this entity by.
- hammerid [Episode Two Update]
- <integer readonly> This id is used for debugging purposes in Hammer.
- Pitch Yaw Roll (Y Z X)
- This entity's angular orientation in the world (also used for angular effect entities).
- target
- <target_destination> Name of an entity used to determine where the sun is in the skybox. The sun should be lined up on a line from this entity to the env_sun entity.
- HDRColorScale
- <float> Float value to multiply sprite color by when running in HDR mode.
- use_angles
- <boolean> The old way to orient env_sun is to point it at a target. The new way is to specify the angles. If you use the new way, set this property to YES, otherwise, set this property to NO.
- pitch
- <integer> The pitch of this entity. 90 is straight up, -90 is straight down.
Warning: Unfortunately Valve introduced a Pitch override parameter to the light_environment and env_sun entities, but not to shadow_control. Even more unfortunately, the Pitch override cannot be switched off and its rotation is measured counter-clockwise from the horizontal (so straight down is -90°) whereas the <angles> Pitch is rotation is clockwise (so straight down is +90°). The workaround for this is to make sure your Pitch override merely repeats the <angles> value; for example, if your shadow_control, light_environment and env_sun <angles> are "45 -60 0" set the Pitch override to "-45".- rendercolor
- <color255> Color of the sun.
- size
- <integer> Size of the sun.
- overlaycolor [Episode One Update]
- <color255> Overlay Color (R G B)
- A value of 0 0 0 will act the old way.
- overlaysize [Episode One Update]
- <integer> Overlay Size
- A value of -1 means the overlay will act the old way.
- material [Episode One Update]
- <material> Material Name
- Material of the inner glow. (sprites/light_glow02_add_noz)
- overlaymaterial [Episode One Update]
- <material> Overlay Material Name
- Material of the overlay glow. (sprites/light_glow02_add_noz)
[edit]
Inputs
- !FGD:
- Kill
- Removes this entity from the world.
- Removes this entity and all its children from the world.
- AddOutput <string>
- Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
- Format:
<key> <value> - Format:
<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>
- Causes this entity's OnUser1-4 outputs to be fired. See User Inputs and Outputs.
- TurnOn
- Enable sun rendering.
- TurnOff
- Disable sun rendering.
- SetColor <color255>
- Set the rendercolor.
[edit]
Outputs
- Fired in response to FireUser1-4 inputs. See User Inputs and Outputs.
- !activator = activator

