Limited support
This feature is only present in Momentum Mod and Portal 2: Community Edition.

Quick Setup

You can set up volumetrics in 3 different ways:

  1. By using the corresponding KeyValues in light_rt, light_rt_spot and env_projectedtexture;

  2. By using obb_fogvolume that defines volumetric rays specifically for the fog volume it produces;

  3. Through the Clustered Volumetric Inspector in the Developer UI menu.

Using KeyValues:

For light_rt and light_rt_spot

  1. Add a light_rt or light_rt_spot entity

  2. Set the Volumetric Light Scale KeyValue to some value between 0.1 and 1.0

  3. Set the Volumetric Density KeyValue to some value between 0.1 and 1.0

  4. Make sure the Shadowed flag is checked

  5. Compile the map. The volumetrics should appear.

Note:

It is not necessary to have the "Shadowed" flag enabled for the volumetrics to appear.

light_rt KV

For env_projectexture

  1. Add an env_projectexture entity

  2. Set the Enable Volumetrics KeyValue to Yes

  3. Set the Volumetric Intensity KeyValue to some value between 0.1 and 1.0

  4. Compile the map. The volumetrics should appear.

env_projectedtexture KV

Using obb_fogvolume:

  1. Add an obb_fogvolume entity

  2. Set the Emissive Color KeyValue to 1 1 1 1

  3. Set the Scattering Color KeyValue to 255 255 255 255 or a similar value.

  4. Set the Density KeyValue to something around 0.7

  5. If setting up a specific shape, toggle the Spheroid KeyValue or define a proper texture in Texture Name

  6. Add light_rt, light_rt_spot or any other light enity that works with volumetric lighting

  7. For better results, add obstacles between the light entity and the fog

  8. Compile the map. The volumetric cloud should appear and interact with volumetric lighting

obb_fogvolume interaction with lighting
obb_fogvolume KeyValues

Using Clustered Volumetric Inspector:

It is possible to set up volumetrics for light_rt and light_rt_spot in Clustered Light Inspector.

There are 4 volumetrics-related options:

  • Volumetric Light Scale,

  • Volumetric Density,

  • and two checkboxes (Dynamic Volumetrics and Volumetrics Off) that enable / disable volumetric lighting for that specific light.

Clustered Volumetric Inspector

Volumetrics for Cascade Shadow Mapping

Currently, there are no KeyValues that enables the volumetric fog for env_cascade_light entity. However, there are two ways to make them appear - through the Clustered Volumetric Inspector , or by using obb_fogvolume entity, since cascade shadows are marked as volumetrical.

Volumetric effect of the Cascade Shadow Mapping