light_environment
Last edited 9 months ago2024-01-08 10:59:38 UTC
- Wiki
- View Page
-
You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date.
Click here to see the current revision of this page.
This entity makes the map's sky (specifically,
sky-textured brushes) emit light. The only practical way of lighting outdoor maps.
Attributes
- Name (targetname) - Property used to identify entities.
- Pitch, Yaw, Roll (angles) - Sets the pitch (up/down), yaw (left/right) and roll (bank) respectively.
- Pitch (pitch) - A negative number will give downward pitch (which is normally what you want).
- Brightness (_light) - The first three 3-digit numbers are the colour (RGB) and the fourth is brightness/light intensity (e.g. 248 244 237 350).
ZHLT/VHLT-specific keyvalues:
- Ambient Color (_diffuse_light) - Diffused light colour and brightness. This simulates diffuse light usually from blue sky.
- Sun Spread (_spread) - Diffuses the sunlight.
Positioning logic
Use Pitch to shift the sun (or moon) vertically (similar to daytime/hours) and Yaw to shift it horizontally (cardinal direction or obliquity)
Pitch |
Result |
0° |
Sun at the horizon (like in sunrise/sunset) - huge shadows on floor if at least a minimal amount of -pitch were given |
-45° |
Sun between horizon and top (like 9 AM or 3 PM) |
-90° |
Sun directly overhead (like 12 Noon) - only parallel shadows on floor |
Yaw |
Result |
0° |
facing RT side of the skybox |
90° |
facing BK side of the skybox |
180° |
facing LF side of the skybox |
270° |
facing FT side of the skybox |
Notes
- Sky brushes must have the "SKY" texture on all faces or they won't reliably emit light (depends on version of HLRAD used).
- The key pitch have the same function as the one in angles, although if you add a value (≠0) to pitch it will overwrite the one in angles. Roll has no effect at all.
- For modern compiler, you are not advised to use multiple light_environment in a map. However, you can still use multiple light_environment for multiple colors.
- This entity doesn't spawn a visible source of light in the sky. Therefore, the sun or moon must be part of the skybox as a picture for visual effects.
- The
angles
/angle+pitch
and brightness values of this entity is used to override lighting on models. If the entity has direct line of sight to the sky (i.e. a "SKY" face) in the reverse direction of this light_environment entity's angles
/angle+pitch
value, its lighting will be overridden with values calculated from the brightness of this light_environment entity.
- To break line of sight and have entities take lighting from ground, use a brush textured with black_HIDDEN facing down above the affected area, and SKIP on the other faces.
- To avoid this effect altogether, use
light_spot
with "Is Sky" keyvalue set.
Related pages
Example maps
1 Comment
You must log in to post a comment.
You can login or register a new account.
pitch
into the pitch component ofangles
. World and model lighting should just work.