light
From Valve Developer Community
This point entity is available in all Source games. It creates an invisible, static light source that shines in all directions.(For information on lighting in Source in general, see Lighting. For a tutorial on this entity, see Adding Light.)
Named lights
Giving a light entity a targetname makes VRAD compile a second lightmap "page" for the surfaces that its emitted light touches. This won't harm runtime performance, but will increase compile time and BSP filesize regardless of whether the light ever receives input to change its state.
However, you the system can be overloaded if it tries to handle a large number of overlapping named lights (since the number of pages needed increases exponentially). You can avoid this by giving lights that will switch on and off at the same time the same name, which prompts VRAD into merging their pages together.
To reduce the number of lightmap pages that need to be created, light from named lights entities won't bounce from surfaces, which can look very crude.
All in all: don't name lights without reason!
See also
- Lighting
- Adding Light
- Intermediate Lighting
- Advanced Lighting
- light_spot
- Tool textures (for Block light)
Keyvalues
- The name that other entities refer to this entity by.
- hammerid <integer> (New with Orange Box)
- Read-only ID used for debugging purposes in Hammer.
- Cast Shadow (New with Left 4 Dead)
- Setting this to yes will allow the entity to cast a single directional shadow via it's orientation by modifying the shadow_control angles.
- _light <color255 + int>
- The color and brightness of the light. RGB colors need to be between 0 and 255. Brightness can be higher.
- style <choices>
-
Note: Applies only to lights with a targetname. - Various pattern pre-sets (see next item).
- pattern <string>
Note: Applies only to lights with a targetname.- A string of characters, like a sequence of piano keys, that define a pattern of brightness. a is dark and z is full intensity.
- _constant_attn <float>
- Influences the light spread to be more constant, by dimming near the source and brightening at the edges. Used in equation with Linear and Quadratic. (Learn more about constant, linear and quadratic attenuation here.)
- _linear_attn <float>
- Influences the light spread to decrease at a fixed rate. Used in equation with Constant and Quadratic. (Learn more about constant, linear and quadratic attenuation here.)
- _quadratic_attn <float>
- Influences the light spread to decrease exponentially, i.e. faster as one moves away from the source. Used in equation with Constant and Linear. (Learn more about constant, linear and quadratic attenuation here.)
- _distance <integer>
- Stops the light emitted from reaching beyond this distance. Useful in cutting down compiling time by not making lights extend infinitely.
- _lightHDR <color255>
- BrightnessHDR. Defaults to
-1 -1 -1 1, which tells the compiler to inherit from_light.
Warning: The final digit in the default string is positive. Entering four negative numbers will suck the light out of your entire map!- _fifty_percent_distance <float>
- 50 percent falloff distance
- Distance at which brightness should fall off to 50%. If set, overrides the Linear, Constant and Quadratic parameters.
- _zero_percent_distance <float>
- 0% falloff distance
- Distance at which brightness should fall off to negligible (1/256)%. Must set _fifty_percent_distance to use.
Flags
- 1: Initially Off
Inputs
- TurnOn
- Turns the light on.
- TurnOff
- Turns the light off.
- Toggle
- Toggles the light on or off.
- SetPattern
- Sets the light's custom appearance to the input's parameters.
- FadeToPattern
- Fades from the light's old pattern to the new one.
- Kill
- Removes this entity from the world.
- Removes this entity and all its children from the world.
- AddOutput <string>
- Evaluates a keyvalue/output on this entity. It can be potentially very dangerous, use with care.
- Format:
<key> <value> - Format:
<output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>
- Causes this entity's OnUser1-4 outputs to be fired. See User Inputs and Outputs.
Outputs
- Fired in response to FireUser1-4 inputs. See User Inputs and Outputs.
- !activator = activator
- OnKilled (New with Left 4 Dead)
- Fired when the entity is killed and removed from the game.

