light_environment
From Valve Developer Community
This is a point entity available in all Source games.
Entity Description
The light_environment entity is a light controller, that casts both diffuse and parallel directional lighting from the toolsskybox texture. This is to approximate the light cast from the Sun or Moon.
- The properties of this entity apply to the whole map. Multiple instances of this entity within a map may cause errors. A 3D Skybox does not require an extra light_environment placement. If multiple light_environment entities are placed, Vrad uses the keyvalues from the first placed light_environment to calculate the lighting.
- 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.
Keyvalues
-
Angles:
- Pitch Yaw Roll (Y Z X)
<angle> - This entity's angular orientation in the world.
- This is the angle at which the Direct Sunlight enters the map through each toolsskybox brush.
- Tip: Pitch is the Sun's Angle of Elevation from the ground, and Yaw is its Compass Bearing.
- Brightness : The RGB color followed by the Brightness of Direct Sunlight.
- Ambient : The RGB color followed by the Brightness of Diffuse Skylight.
- BrightnessHDR : This approximates Direct HDR sunlight. Can be left as default or be slightly less bright, since HDR is sometimes rendered brighter.
- _lightscaleHDR <float>
- BrightnessScaleHDR : Amount to scale the Direct light by when compiling for HDR.
- AmbientHDR : This is the Diffuse HDR light. Can be left as default or be slightly less bright.
- _AmbientScaleHDR <float>
- AmbientScaleHDR: Amount to scale the Diffuse light by when compiling for HDR.
- pitch <angle>
- Pitch : This value overrides the value of pitch in the keyvalue "angles". 90 is straight up, -90 is straight down.
- SunSpreadAngle (New with Orange Box) <float>
- SunSpreadAngle : The angular extent of the sun for casting soft shadows. Higher numbers are more diffuse. 5 is a good starting value for just nice blurriness. Remember: on cloudy days, the shadows will be blurred because the sunlight is being diffused by clouds. Try 90 for hazy days, and use 135 for cloudy days, rain and fog. If you're trying a night atmosphere, sometimes you'll need up to 180. You'll also have to turn down the shadow alpha in your shadow_control entity - try changing the Shadow Color variable to something such as 50 50 50.


