Skip to content

light_environment

Entity I/O / 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

CS2 build 27045800 · Steam date 2026-11-30 · platform windows-x86_64 · schema format 2.2

Inputs (19)

NameParameterFromDescription
SetParentstringChanges the entity's parent in the movement hierarchy.
SetParentAttachmentstringChange 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.
SetParentAttachmentMaintainOffsetstringChange 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.
ClearParentRemoves this entity from the the movement hierarchy, leaving it free to move independently.
KillRemoves this entity from the world.
KillHierarchyRemoves this entity and all its children from the world.
AddOutputstringAdds 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.
FireUser1Causes this entity's OnUser1 output to be fired.
FireUser2Causes this entity's OnUser2 output to be fired.
FireUser3Causes this entity's OnUser3 output to be fired.
FireUser4Causes this entity's OnUser4 output to be fired.
SetLightEnabledSets whether the light is enabled (takes parameter of 0 or 1)
TurnOnTurn the light on.
TurnOffTurn the light off.
ToggleToggle the light on/off.
SetLightColorvectorSet light color
SetLightBrightnessfloatSet light brightness
SetAppearanceintegerSet appearance 0=Normal 1=Flicker A, 2=Slow, strong pulse 3=Candle A ...
SetCustomAppearancestringSet 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)

NameParameterFromDescription
OnUser1Fired in response to FireUser1 input.
OnUser2Fired in response to FireUser2 input.
OnUser3Fired in response to FireUser3 input.
OnUser4Fired in response to FireUser4 input.
OnKilledFired 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.

KeyTypeDefaultFromDescription
enabled
Enabled
boolean1
color
Color
color255255 255 255
brightness
Brightness
float1.0
directlight
Direct Lighting Type
choices3How direct lighting should be represented
  • 0 None
  • 1 Baked
  • 3 Stationary
rendertocubemaps
Render to Cubemaps
boolean1If disabled, direct lighting will not render into cubemaps. Not that this only works when Direct Lighting Type is set to Stationary or Dynamic.
bouncescale
Indirect Light Multiplier
float1.0
castshadows
Cast Shadows
intchoices1Whether this light casts shadow
  • 1 Dynamic & Baked
  • 2 Baked
  • 0 None
angulardiameter
Shadow Softness / Sun Spread Angle
float1.0Defines the shadow softness. Higher numbers produce more diffuse/softer shadows. 1 is a good starting value.
shadowpriority
Shadow Priority
intchoices-1Priority for the lights shadowmap
  • 100 Highest
  • 10 High
  • 5 Medium
  • -5 Low
  • -1 Default
nearclipplaneremove_key
numcascadesremove_key
shadowcascadedistance0remove_key
shadowcascadedistance1remove_key
shadowcascadedistance2remove_key
shadowcascadedistance3remove_key
shadowcascaderesolution0remove_key
shadowcascaderesolution1remove_key
shadowcascaderesolution2remove_key
shadowcascaderesolution3remove_key
cascadecrossfaderemove_key
cascadedistancefaderemove_key
cascaderenderstaticobjremove_key
skycolor
Simple Sky Color
color255255 255 255Uses 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.
skyintensity
Simple Sky Intensity
float1.0Scales the intensity of the Simple Sky Color.
skytexture
IBL Sky Source
target_destinationHere 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'.
skytexturescale
IBL Sky Scale
float1.0Scale value for IBL intensity fine-tuning
skybouncescale
Sky Indirect Light Multiplier
float1.0
skyambientbounce
Sky Ground Albedo
color255alpha0 0 0This is the color of the virtual ground plane used for skybox IBL / color ambient lighting
sunlightminbrightnessremove_key
brightnessscale
Brightness Scale
float1.0Scale 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_occlusionremove_key
max_occlusion_distanceremove_key
fully_occluded_fractionremove_key
occlusion_exponentremove_key
rangeremove_key
style
Appearance
intchoices0
  • 0 Normal
  • 10 Fluorescent flicker
  • 2 Slow, strong pulse
  • 11 Slow pulse, noblack
  • 5 Gentle pulse
  • 1 Flicker A
  • 6 Flicker B
  • 3 Candle A
  • 7 Candle B
  • 8 Candle C
  • 4 Fast strobe
  • 9 Slow strobe
pattern
Custom Appearance
stringSet 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.
clientSideEntity
Create Client-Only Entity
choices1
  • 0 No
  • 1 Yes
baked_light_indexing
Stationary Light Shadows
boolean1Allows mixed dynamic cascade shadow maps with Baked shadows.
allow_sst_generation
Allow SST Generation
boolean0Allows SST generation for this (sun) light.
minroughness
Specular Softness
float0USE 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_override
Custom AO Proxies
boolean0
ambient_occlusion_proxy_position_0
Custom AO Proxy Position 0
target_destination
ambient_occlusion_proxy_position_1
Custom AO Proxy Position 1
target_destination
ambient_occlusion_proxy_position_2
Custom AO Proxy Position 2
target_destination
ambient_occlusion_proxy_position_3
Custom AO Proxy Position 3
target_destination
ambient_occlusion_proxy_cone_angle_0
Custom AO Proxy Cone Softness 0
float0.3Softness of Imaginary Shadowing Light.
ambient_occlusion_proxy_cone_angle_1
Custom AO Proxy Cone Softness 1
float0.3Softness of Imaginary Shadowing Light.
ambient_occlusion_proxy_cone_angle_2
Custom AO Proxy Cone Softness 2
float0.3Softness of Imaginary Shadowing Light.
ambient_occlusion_proxy_cone_angle_3
Custom AO Proxy Cone Softness 3
float0.3Softness of Imaginary Shadowing Light.
ambient_occlusion_proxy_strength_0
Custom AO Proxy Cone Strength 0
float0.5Relative Strength of Imaginary Shadowing Light.
ambient_occlusion_proxy_strength_1
Custom AO Proxy Cone Strength 1
float0.5Relative Strength of Imaginary Shadowing Light.
ambient_occlusion_proxy_strength_2
Custom AO Proxy Cone Strength 2
float0.5Relative Strength of Imaginary Shadowing Light.
ambient_occlusion_proxy_strength_3
Custom AO Proxy Cone Strength 3
float0.5Relative Strength of Imaginary Shadowing Light.
ambient_occlusion_proxy_ambient_strength
AO Proxy Ambient Strength
float1.0Relative Strength of Ambient/Unshadowed term. Lower values make darker shadows.
fademindistremove_key
fademaxdistremove_key