Skip to main content

light_environment in older Source 2 games

This guide explains how in older Source 2 games like Half-Life: Alyx iconHalf-Life: Alyx and Steam VR iconSteam VR you can have both static and dynamic (CSM) lighting from the light_environment.

info

Although in newer versions of the Source 2 engine (since 2020) the light_environment supports both static and dynamic at the same time in a single entity, this is not retroactive for older Source 2 versions.

info

It is highly recommended to name at least your dynamic light_environment, as in interior areas of the level you can disable it (by killing it) to save resources.

Create your base light_environment entity. This first one is going to be static only (generates baked lighting). After you finish setting up the entity it should look something like this:
base light_environment

Change the Direct Lighting label to be Static (a.k.a. Baked):
Static light_environment


Once you have done this, make a copy of the static light_environment. This will be our base for the dynamic light_environment, which will add CSM to the level.
Change the Render Specular label to off, Direct Lighting to Per-Pixel, Indirect Lighting to None, and disable AO if it is enabled.
It should look something like this:
Dynamic light_environment

info

It is highly recommended that you reduce the brightness of the dynamic light_environment, as CSM not only add shadows but also brightness to the level. If not adjusted, this could result in an overbright environment.

Example

The level City-Oasis in SteamVR uses this technique. Here are a few images below:
ex1
ex2