light_environment Last edited 2 months ago2024-09-13 09:56:21 UTC

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.

light_environment - Point Entity

This entity makes the map's sky (specifically, User posted image sky-textured brushes) emit light. The only practical way of lighting outdoor maps.

Attributes

ZHLT/VHLT-specific keyvalues:

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

_spread(integer) : "Spread Angle" : 0 : "Spread angle for soft shadows."
_diffuse_light(color255) : "Diffuse Light" : "" : "Diffuse light color."
_fake(choices) : "Only Dynamic" : "" =
[
    "" : "No"
    1  : "Yes"
]
Balancing Brightness, Ambient Color, and Sun Spread
User posted image
Here's a very rough guide on how to balance the three values:
  • On overcast skies, the ambient light should contribute more light than sunlight.
  • The sun's shadow gets more diffused the more overcast the sky is
This all depends on the choice of skybox that you use. Most of them are set on a clear sky which rules out any pressing need to set the sun spread value.

Also worth mentioning the lightmap resolution is the hard limit on how sharp shadows can be.

Example maps

1 Comment

Commented 2 months ago2024-09-15 15:09:55 UTC Comment #106399
NOTE TO SELF: VHLT rolls pitch into the pitch component of angles. World and model lighting should just work.

You must log in to post a comment. You can login or register a new account.