light_environment
Sets the color and angle of the light from the sun and sky.<br><br>Typical setup:<br>1. Create an <b>env_sky</b> entity to use as your skybox<br>2. Create a <b>light_environment</b> entity and set <b>Sky IBL Source</b> to the name of the <b>env_sky</b> entity<br>3. Right-click on your <b>light_environment</b> entity and select 'Selected environment light -> Estimate lighting from HDR skybox'<br>4. Adjust angle and brightness of the sunlight as you see fit
- FGD
@PointClassingame/core/lights_base.fgd. - cs_script type:
BaseModelEntity, whatFindEntitiesByClass("light_environment")returns. - Native class:
CLightEnvironmentEntity(curated pairing).
CS2 build 27045800 · Steam date 2026-11-30 · platform windows-x86_64 · schema format 2.2
Inputs (19)
| Name | Parameter | From | Description |
|---|---|---|---|
SetParent | string | Changes the entity's parent in the movement hierarchy. | |
SetParentAttachment | string | Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment. | |
SetParentAttachmentMaintainOffset | string | Change this entity to attach to a specific attachment point on it's parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment. The entity will maintain it's position relative to the parent at the time it is attached. | |
ClearParent | Removes this entity from the the movement hierarchy, leaving it free to move independently. | ||
Kill | Removes this entity from the world. | ||
KillHierarchy | Removes this entity and all its children from the world. | ||
AddOutput | string | Adds an entity I/O connection to this entity. Parameter format: outputname>targetname>inputname>parameter>delay>max times to fire (-1 == infinite). Very dangerous, use with care. | |
FireUser1 | Causes this entity's OnUser1 output to be fired. | ||
FireUser2 | Causes this entity's OnUser2 output to be fired. | ||
FireUser3 | Causes this entity's OnUser3 output to be fired. | ||
FireUser4 | Causes this entity's OnUser4 output to be fired. | ||
SetLightEnabled | Sets whether the light is enabled (takes parameter of 0 or 1) | ||
TurnOn | Turn the light on. | ||
TurnOff | Turn the light off. | ||
Toggle | Toggle the light on/off. | ||
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 (5)
| Name | Parameter | From | Description |
|---|---|---|---|
OnUser1 | Fired in response to FireUser1 input. | ||
OnUser2 | Fired in response to FireUser2 input. | ||
OnUser3 | Fired in response to FireUser3 input. | ||
OnUser4 | Fired in response to FireUser4 input. | ||
OnKilled | Fired when the entity is killed and removed from the game. |
Keyvalues (57)
The names Hammer saves and the KeyValue input and AddOutput take at run time. An entity reads some keys only when it spawns, so changing one later may do nothing. Integer keys such as movetype take engine numbers, not the renumbered cs_script enum values.
| Key | Type | Default | From | Description |
|---|---|---|---|---|
enabledEnabled | boolean | 1 | ||
colorColor | color255 | 255 255 255 | ||
brightnessBrightness | float | 1.0 | ||
directlightDirect Lighting Type | choices | 3 | How direct lighting should be represented
| |
rendertocubemapsRender to Cubemaps | boolean | 1 | If disabled, direct lighting will not render into cubemaps. Not that this only works when Direct Lighting Type is set to Stationary or Dynamic. | |
bouncescaleIndirect Light Multiplier | float | 1.0 | ||
castshadowsCast Shadows | intchoices | 1 | Whether this light casts shadow
| |
angulardiameterShadow Softness / Sun Spread Angle | float | 1.0 | Defines the shadow softness. Higher numbers produce more diffuse/softer shadows. 1 is a good starting value. | |
shadowpriorityShadow Priority | intchoices | -1 | Priority for the lights shadowmap
| |
nearclipplane | remove_key | |||
numcascades | remove_key | |||
shadowcascadedistance0 | remove_key | |||
shadowcascadedistance1 | remove_key | |||
shadowcascadedistance2 | remove_key | |||
shadowcascadedistance3 | remove_key | |||
shadowcascaderesolution0 | remove_key | |||
shadowcascaderesolution1 | remove_key | |||
shadowcascaderesolution2 | remove_key | |||
shadowcascaderesolution3 | remove_key | |||
cascadecrossfade | remove_key | |||
cascadedistancefade | remove_key | |||
cascaderenderstaticobj | remove_key | |||
skycolorSimple Sky Color | color255 | 255 255 255 | Uses a flat color for the sky lighting. Can be a good starting point but you can get much higher quality lighting by using an IBL/env_sky. | |
skyintensitySimple Sky Intensity | float | 1.0 | Scales the intensity of the Simple Sky Color. | |
skytextureIBL Sky Source | target_destination | Here you can assign any env_sky entity for sky lighting. env_sky supports HDR/EXR high dynamic range lat-long/h-cross/v-cross skybox images is recommended for sky lighting for the best quality results. If you want to use a custom env_sky that is explicitly for sky lighting, you can use an env_sky with 'Start Disabled'. | ||
skytexturescaleIBL Sky Scale | float | 1.0 | Scale value for IBL intensity fine-tuning | |
skybouncescaleSky Indirect Light Multiplier | float | 1.0 | ||
skyambientbounceSky Ground Albedo | color255alpha | 0 0 0 | This is the color of the virtual ground plane used for skybox IBL / color ambient lighting | |
sunlightminbrightness | remove_key | |||
brightnessscaleBrightness Scale | float | 1.0 | Scale brightness by this amount, used for scripting direct light behaviour. NOTE: Only works on lights with Direct Lighting type set to Dynamic or Stationary. | |
ambient_occlusion | remove_key | |||
max_occlusion_distance | remove_key | |||
fully_occluded_fraction | remove_key | |||
occlusion_exponent | remove_key | |||
range | remove_key | |||
styleAppearance | intchoices | 0 |
| |
patternCustom Appearance | 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. | ||
clientSideEntityCreate Client-Only Entity | choices | 1 |
| |
baked_light_indexingStationary Light Shadows | boolean | 1 | Allows mixed dynamic cascade shadow maps with Baked shadows. | |
allow_sst_generationAllow SST Generation | boolean | 0 | Allows SST generation for this (sun) light. | |
minroughnessSpecular Softness | float | 0 | 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. | |
ambient_occlusion_proxy_overrideCustom AO Proxies | boolean | 0 | ||
ambient_occlusion_proxy_position_0Custom AO Proxy Position 0 | target_destination | |||
ambient_occlusion_proxy_position_1Custom AO Proxy Position 1 | target_destination | |||
ambient_occlusion_proxy_position_2Custom AO Proxy Position 2 | target_destination | |||
ambient_occlusion_proxy_position_3Custom AO Proxy Position 3 | target_destination | |||
ambient_occlusion_proxy_cone_angle_0Custom AO Proxy Cone Softness 0 | float | 0.3 | Softness of Imaginary Shadowing Light. | |
ambient_occlusion_proxy_cone_angle_1Custom AO Proxy Cone Softness 1 | float | 0.3 | Softness of Imaginary Shadowing Light. | |
ambient_occlusion_proxy_cone_angle_2Custom AO Proxy Cone Softness 2 | float | 0.3 | Softness of Imaginary Shadowing Light. | |
ambient_occlusion_proxy_cone_angle_3Custom AO Proxy Cone Softness 3 | float | 0.3 | Softness of Imaginary Shadowing Light. | |
ambient_occlusion_proxy_strength_0Custom AO Proxy Cone Strength 0 | float | 0.5 | Relative Strength of Imaginary Shadowing Light. | |
ambient_occlusion_proxy_strength_1Custom AO Proxy Cone Strength 1 | float | 0.5 | Relative Strength of Imaginary Shadowing Light. | |
ambient_occlusion_proxy_strength_2Custom AO Proxy Cone Strength 2 | float | 0.5 | Relative Strength of Imaginary Shadowing Light. | |
ambient_occlusion_proxy_strength_3Custom AO Proxy Cone Strength 3 | float | 0.5 | Relative Strength of Imaginary Shadowing Light. | |
ambient_occlusion_proxy_ambient_strengthAO Proxy Ambient Strength | float | 1.0 | Relative Strength of Ambient/Unshadowed term. Lower values make darker shadows. | |
fademindist | remove_key | |||
fademaxdist | remove_key |