light_environment
Jump to navigation
Jump to search

Note: This feature only works if the source material and texture files for the used skybox material are present.
Note: In SteamVR Home, any changes made to the AO modifiers will apply only to the standard vertex-based light baking and not when the "Generate Lightmaps" option is enabled during compile.
light_environment is a point entity available in all
Source 2 games. It controls environmental lighting and casts sunlight from the outside of the map toward its forward direction.
In SteamVR Home, the real-time component casts sharp shadows with a maximum of three cascaded shadow maps.
Usage
Typical setup:
1. Create an env_sky entity to use as your skybox.
2. Create a light_environment entity and set Sky IBL Source to the name of the env_sky entity.
3. Right-click on your light_environment entity and select Selected environment light -> Estimate lighting from HDR skybox.
4. Adjust angle and brightness of the sunlight as you see fit.
Keyvalues
Shadows:
- Shadow Softness / Sun Spread Angle (angulardiameter) <float>
- The angular extent of the sun for casting soft shadows. Higher numbers are more diffuse. 1 is a good starting value. This only affects baked lighting.
- Cascade Count (numcascades) <integer> (not in
) - Number of shadow cascades to use.
- Cascade Distance 0 (shadowcascadedistance0) to Cascade Distance 3 (shadowcascadedistance3) <float> (not in
) - Maximum distance for each shadow map.
- Cascade Resolution 0 (shadowcascaderesolution0) to Cascade Resolution 3 (shadowcascaderesolution3) <integer> (not in
) - Resolution of each shadow map texture. If set to 0, it uses the default texture resolution.
- Specular Softness (minroughness) <float> (only in
) - USE WITH CAUTION: Artificially softens direct specular (not cubemaps) to simulate cheap, soft area lights. Note: Direct Lighting must be set to Stationary or Dynamic for this to have an effect.
- Sky Color (skycolor) <color255>
- Flat sky color. Not used if a sky IBL source is set.
- Sky Intensity (skyintensity) <float>
- Flat sky intensity. Not used if a sky IBL source is set.
- Lower Hemisphere Is Black (lower_hemisphere_is_black) <boolean> (not in
)
- IBL Sky Source / Sky IBL Source (skytexture) <string>
- Sky source for Image Based Lighting. Can be an env_sky entity, lat-long/h-cross/v-cross skybox image, or sky material.
- IBL Sky Scale / Sky IBL Scale (skytexturescale) <float>
- Scale value for IBL intensity fine-tuning.
- Sky Ground Albedo / Sky Ambient Bounce (skyambientbounce) <color255>
- This is the color of the virtual ground plane used for skybox IBL / color ambient lighting
- Sky Indirect Light (Bounce) Multiplier (skybouncescale) <float> (only in
)
- Sun Light Minimum Brightness Threshold (sunlightminbrightness) <float> (not in
) - Brightness beyond which pixels in the Sky IBL Source are considered to be coming from the sun.
- Ambient Occlusion (ambient_occlusion) <boolean>
- Ambient Occlusion Max Distance (max_occlusion_distance) <float>
- Ambient Occlusion Fully Occluded Fraction (fully_occluded_fraction) <float>
- Ambient Occlusion Exponent (occlusion_exponent) <float>
- Ambient Lighting (ambient_color) <color255> (not in
) - Adds a constant flat term to the entire map. Use with care as this can look very unrealistic.
- Render Transmissive (rendertransmissive) <choices>
-
- 0: Off
- 1: On
- Fog contribution strength (rendertransmissive) <float>
- Overrides how much the light affects the fog (if enabled)
- Volumetric Fogging (fog_lighting) <choices>
- How should light interact with volumetric fogging
- 0: "None"
- 1: "Baked"
- 2: "Dynamic"
- 3: "Baked - no shadows"
- 4: "Dynamic - no shadows"
- Baked Light Indexing (baked_light_indexing) <boolean>
- Allows direct light to be indexed if baked. Indexed lights have per-pixel quality specular lighting and normal map response
- Custom AO Proxies (ambient_occlusion) <boolean>
- Custom AO Proxy Position 0 (ambient_occlusion_proxy_position_0) to Custom AO Proxy Position 3 (ambient_occlusion_proxy_position_3) <targetname>
- Relative to origin of the light_environment.
- Custom AO Proxy Cone Softness 0 (ambient_occlusion_proxy_cone_angle_0) to Custom AO Proxy Cone Softness 3 (ambient_occlusion_proxy_cone_angle_3) <float>
- Softness of Imaginary Shadowing Light.
- Custom AO Proxy Cone Strength 0 (ambient_occlusion_proxy_strength_0) to Custom AO Proxy Cone Strength 3 (ambient_occlusion_proxy_strength_3) <float>
- Relative Strength of Imaginary Shadowing Light.
- AO Proxy Ambient Strength (ambient_occlusion_proxy_ambient_strength) <float>
- Relative Strength of Ambient/Unshadowed term. Lower values make darker shadows.
|
|
Source 2 Light:
- Enabled (enabled) <boolean>
- Sets the initial on/off state of the light.
- Color (color) <color255>
- The RGB color of the light.
- Brightness (brightness) <float>
- The brightness of the light. The value can be increased over 1.0
- Range (range) <float>
- Distance range for light. 0 : infinite.
- Cast Shadows (castshadows) <choices>
- Whether this light casts shadow.
- 0: No
- 1: Yes
- 2: Baked Only
- Shadow Near Clip Plane (nearclipplane) <float>
- Distance in game units for near clip plane for shadow map.
- Appearance (style) <choices>
- Various Custom Appearance presets.
| Literal Value | Description | Sequence | Preview |
|---|---|---|---|
| 0 | Normal | m | |
| 10 | Fluorescent flicker | mmamammmmammamamaaamammma | |
| 2 | Slow, strong pulse | abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba | |
| 11 | Slow pulse, noblack | abcdefghijklmnopqrrqponmlkjihgfedcba | |
| 5 | Gentle pulse | jklmnopqrstuvwxyzyxwvutsrqponmlkj | |
| 1 | Flicker A | mmnmmommommnonmmonqnmmo | |
| 6 | Flicker B | nmonqnmomnmomomno | |
| 3 | Candle A | mmmmmaaaaammmmmaaaaaabcdefgabcdefg | |
| 7 | Candle B | mmmaaaabcdefgmmmmaaaammmaamm | |
| 8 | Candle C | mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa | |
| 4 | Fast strobe | mamamamamama | |
| 9 | Slow strobe | aaaaaaaazzzzzzzz | |
| 12 | Underwater light mutation | mmnnmmnnnmmnn |
- Custom Appearance (pattern) <string>
- Set a custom pattern of light brightness for this light. Pattern format is a string of characters, where 'a' is total darkness, 'z' fully bright. i.e. 'aaggnnttzz' would be a steppy fade in from dark to light.
- Start Fade Dist (fademindist) <float>
- Distance at which the light starts to fade (<0 : use fademaxdist).
- End Fade Dist (fademaxdist) <float>
- Maximum distance at which the light is visible (0 : don't fade out).
- Render to Cubemaps (rendertocubemaps) <boolean>
- If true, this geometry renders into baked cube maps
- Priority (priority) <integer>
- When the number of visible lights exceeds the rendering budget, higher priority lights are chosen for rendering first.
- Indirect Light Multiplier (bouncescale) <float>
- Multiplies the brightness of light bouncing of surfaces.
- Render Diffuse (renderdiffuse) <boolean>
- Toggles baking and rendering of diffuse lighting (per-pixel, lightmaps,light probe volumes and bounced light on cubemaps).
- Render Specular (renderspecular) <choices>
- Controls rendering of direct specular highlights. This applies a bright sphere effect to reflections.
- 0: Off
- 1: On - Render in real-time.
- 2: Bake into cubemaps (Source 1 behavior)
- Direct Lighting (directlight) <choices>
- How direct lighting should be represented.
- 0: None
- 1: Baked
- 2: Per-Pixel
- 3: Mixed (removed since
)
- Indirect Lighting (indirectlight) <choices>
- How indirect lighting should be represented.
- 0: None
- 1: Baked
Source 2 Light Attenuation:
- Linear Attenuation (attenuation1) <float>
- Quadratic Attenuation (attenuation2) <float>
- Light Source Radius (enabled) <float>
- The radius of the light source in game units.
|
Inputs
Source 2 Light:
- SetLightEnabled <integer>
- Sets whether the light is enabled (takes parameter of 0 or 1)
- TurnOn
- Turn the light on.
- TurnOff
- The the light off.
- Toggle
- Toggle the light's current state.
- SetLightColor <vector>
- Set light color.
- SetLightBrightness <float>
- Set light brightness.
- SetAppearance <integer>
- Set appearance 0: Normal 1: Flicker A, 2: Slow, strong pulse 3: Candle A ...
- SetCustomAppearance <string>
- Set a custom pattern of light brightness for this light. Pattern format is a string of characters, where 'a' is total darkness, 'z' fully bright. i.e. 'aaggnnttzz' would be a steppy fade in from dark to light.
|
|
Outputs
|