Env sun

From Valve Developer Community
Jump to navigation Jump to search

Template:Base point

Entity description

It places a Sun or Moon effect (glow sprite) in the skybox where it does not parallax, giving the impression that it is nearly infinitely far away. The env_sun entity does not contribute any actual lighting; it is merely a visual representation of the Sun. Use light_environment to provide actual sunlight for your map. Use shadow_control for dynamic shadows except in CSGO where Shadow Control is extraneous and may interfere with cascade lighting.

To set up the env_sun: Set the Pitch Yaw Roll. Pitch will be how far up and down the Sun will be in the sky. Yaw is how far left and right it will be. Roll is extraneous and is not necessary to set. An info_player_start can be used to visualize where the Sun will be; you can set its angles and imagine a line coming out its back pointing to the sky and that is where the Sun will be in game. Then copy and paste its pitch, yaw and roll into the env_sun (remember to delete the info_player_start after using it like this). Set Use Angles to Yes (This means it will use the Pitch Yaw Roll settings). Set Pitch as a negative number of the actual pitch (This number overrides the pitch in the Pitch Yaw Roll key value). Sun Color is the base color of the sun. Overlay Color is the color of the transition material. The overlay provides a nice transition to the full glare of the sun and smooths the popping in and out the Sun does when it comes into view. Size is the size of the sun. Set this smaller than the Overlay Size; 16 is a tiny sun and 256 is a huge sun. Set Overlay Size larger than sun.

Template:Map properties

  • 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.

Keyvalues

Viewer entity ([todo internal name (i)]) <targetname>
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.
UseAngles ([todo internal name (i)]) <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.
Pitch ([todo internal name (i)]) <integer>
This value sets the pitch position of the sun. It overrides the pitch value in the angles keyvalue, even if left at 0, so it needs to be specified. Contrary to the angles keyvalue, the rotation of this pitch is measured counter-clockwise from the horizontal, so that 90 is straight up, while -90 is straight down. (It's simply the negative of a normal pitch value.)
Sun Color (R G B) ([todo internal name (i)]) <color255>
Color of the sun.
Overlay Color (R G B) ([todo internal name (i)]) <color255>
A value of 0 0 0 will act the old way.
Todo: Explain what the old way is.
Size ([todo internal name (i)]) <integer>
Size of the sun.
Overlay Size ([todo internal name (i)]) <integer>
A value of -1 means the overlay will act the old way.
Material Name ([todo internal name (i)]) <sprite>
Material of the inner glow.
Overlay Material Name ([todo internal name (i)]) <sprite>
Material of the overlay glow.
HDR color scale. ([todo internal name (i)]) <float>
float value to multiply sprite color by when running in HDR mode.
Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Inputs

TurnOn
Enable sun rendering.
TurnOff
Disable sun rendering.
SetColor <color255RedirectInput/color32>
Change the sun's color. Format: <Red 0-255> <Green 0-255> <Blue 0-255>


Outputs