light_spot

From Valve Developer Community

Jump to: navigation, search

This point entity is available in all Source games.

Contents

Entity Description

A cone-shaped, invisible light source. Can be turned on and off through inputs, though switchable lights may cause lightmap errors. This is a static spotlight that can be pointed at another entity.
Note.png Note: When using this entity, it is often necessary to turn the brightness value up significantly for the effects of the light to be visible. Values of 3000-4000 are sometimes necessary for light sources like streetlights.


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. The targetname value for a spotlight will point the light at the entity named. If no targetname is available, the entity will point with it's angles paramater.
Warning: Adding a targetname to this entity creates a dynamic (switchable) light source, and creates extra lightmap pages for each uniquely named light. This occurs regardless of whether the light entity receives any inputs at run time. Lights should not be named unless they will be turned on and off via inputs, and then only sparingly. Lights given the same name will be triggered together and share lightmap pages. Many dynamic lights in a level can cause performance problems and other errors. Lightmaps calculated for named lights are conspicuously simpler and cruder than unnamed lights.
Pitch Yaw Roll (Y Z X)
This entity's angular orientation in the world (also used for angular effect entities). This will control the direction the light points at, if no targetname is specified.
  • 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.
  • _inner_cone
<integer> This is the inner focus of the light, or the edge of the brightest part of the light. It will fade from here out to the edge of the light cone.
  • _cone
<integer>
_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.png Note: Applies only to lights with a targetname.
Various pattern pre-sets (see next item).
pattern <string>
Note.png 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.
Personal tools