Skip to main content

light_environment

light_environment icon

Point Entity

Sets the color and angle of the light from the sun and sky.

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

  • Indirect Light Multiplier (bouncescale) <Float>

  • Enabled (enabled) <Boolean>

  • Color (color) <Color255>

  • Brightness (brightness) <Float>

  • Range (range) <Float>
    Distance range for light. 0=infinite

  • Cast Shadows (castshadows) <Choices>
    Whether this light casts shadow

    • Dynamic & Baked
    • Baked
    • None
  • Shadow Priority (shadowpriority) <Choices>
    Priority for the lights shadowmap

    • Highest
    • High
    • Medium
    • Low
    • Default
  • Render to Cubemaps (rendertocubemaps) <Boolean>
    If disabled, direct lighting will not render into cubemaps. Not that this only works when Direct Lighting Type is set to Stationary or Dynamic.

  • Appearance (style) <Choices>

    • Normal
    • Fluorescent flicker
    • Slow, strong pulse
    • Slow pulse, noblack
    • Gentle pulse
    • Flicker A
    • Flicker B
    • Candle A
    • Candle B
    • Candle C
    • Fast strobe
    • Slow strobe
  • 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.

  • Simple Sky Color (skycolor) <Color255>
    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.

  • Simple Sky Intensity (skyintensity) <Float>
    Scales the intensity of the Simple Sky Color.

  • IBL Sky Source (skytexture) <TargetDestination>
    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'.

  • IBL Sky Scale (skytexturescale) <Float>
    Scale value for IBL intensity fine-tuning

  • Sky Indirect Light Multiplier (skybouncescale) <Float>

  • Sky Ground Albedo (skyambientbounce) <Color255Alpha>
    This is the color of the virtual ground plane used for skybox IBL / color ambient lighting

  • Brightness Scale (brightnessscale) <Float>
    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.

  • Shadow Softness / Sun Spread Angle (angulardiameter) <Float>
    Defines the shadow softness. Higher numbers produce more diffuse/softer shadows. 1 is a good starting value.

  • Create Client-Only Entity (clientSideEntity) <Choices>

    • No
    • Yes
  • Direct Lighting Type (directlight) <Choices>
    How direct lighting should be represented

    • None
    • Baked
    • Stationary
    • None
    • Baked
    • Dynamic
    • Stationary
  • Stationary Light Shadows (baked_light_indexing) <Boolean>
    Allows mixed dynamic cascade shadow maps with Baked shadows.

  • Allow SST Generation (allow_sst_generation) <Boolean>
    Allows SST generation for this (sun) light.

  • Specular Softness (minroughness) <Float>
    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.

  • Custom AO Proxies (ambient_occlusion_proxy_override) <Boolean>

  • Custom AO Proxy Position 0 (ambient_occlusion_proxy_position_0) <TargetDestination>
    Relative to origin of the light_environment.

  • Custom AO Proxy Position 1 (ambient_occlusion_proxy_position_1) <TargetDestination>
    Relative to origin of the light_environment.

  • Custom AO Proxy Position 2 (ambient_occlusion_proxy_position_2) <TargetDestination>
    Relative to origin of the light_environment.

  • Custom AO Proxy Position 3 (ambient_occlusion_proxy_position_3) <TargetDestination>
    Relative to origin of the light_environment.

  • Custom AO Proxy Cone Softness 0 (ambient_occlusion_proxy_cone_angle_0) <Float>
    Softness of Imaginary Shadowing Light.

  • Custom AO Proxy Cone Softness 1 (ambient_occlusion_proxy_cone_angle_1) <Float>
    Softness of Imaginary Shadowing Light.

  • Custom AO Proxy Cone Softness 2 (ambient_occlusion_proxy_cone_angle_2) <Float>
    Softness of Imaginary Shadowing Light.

  • 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) <Float>
    Relative Strength of Imaginary Shadowing Light.

  • Custom AO Proxy Cone Strength 1 (ambient_occlusion_proxy_strength_1) <Float>
    Relative Strength of Imaginary Shadowing Light.

  • Custom AO Proxy Cone Strength 2 (ambient_occlusion_proxy_strength_2) <Float>
    Relative Strength of Imaginary Shadowing Light.

  • 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.

Inputs

  • 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 <Void>
    Removes this entity from the the movement hierarchy, leaving it free to move independently.

  • Kill <Void>
    Removes this entity from the world.

  • KillHierarchy <Void>
    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 <Void>
    Causes this entity's OnUser1 output to be fired.

  • FireUser2 <Void>
    Causes this entity's OnUser2 output to be fired.

  • FireUser3 <Void>
    Causes this entity's OnUser3 output to be fired.

  • FireUser4 <Void>
    Causes this entity's OnUser4 output to be fired.

  • SetLightEnabled <Void>
    Sets whether the light is enabled (takes parameter of 0 or 1)

  • TurnOn <Void>
    Turn the light on.

  • TurnOff <Void>
    Turn the light off.

  • Toggle <Void>
    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

  • OnUser1 <Void>
    Fired in response to FireUser1 input.

  • OnUser2 <Void>
    Fired in response to FireUser2 input.

  • OnUser3 <Void>
    Fired in response to FireUser3 input.

  • OnUser4 <Void>
    Fired in response to FireUser4 input.

  • OnKilled <Void>
    Fired when the entity is killed and removed from the game.