Skip to content

light_rect

Entity I/O / light_rect

A rectangular or disk shaped light

  • FGD @PointClass in game/core/lights2.fgd, bases Targetname, Parentname, CanBeClientOnly, Light2Inputs.
  • cs_script type: BaseModelEntity, what FindEntitiesByClass("light_rect") returns.
  • Native class: CRectLight (curated pairing).

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

Inputs (33)

NameParameterFromDescription
RunScriptFilestringVScriptLoad and execute a script file
RunScriptCodestringVScriptExecute a fragment of script code
CallScriptFunctionstringVScriptCall a script function
CallPrivateScriptFunctionstringVScriptCalls a script function from this entity's private script scope.
CallGlobalScriptFunctionstringVScriptCalls a script function in the global script scope.
KillGameEntityRemoves this entity from the world.
KillHierarchyGameEntityRemoves this entity and all its children from the world.
KillConstrainedGameEntityRemoves this entity, all its children, and anything constrained to it, from the world.
AddOutputstringGameEntityAdds 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.
FireUser1GameEntityCauses this entity's OnUser1 output to be fired.
FireUser2GameEntityCauses this entity's OnUser2 output to be fired.
FireUser3GameEntityCauses this entity's OnUser3 output to be fired.
FireUser4GameEntityCauses this entity's OnUser4 output to be fired.
EnableAutoSleepingGameEntityEnable automatic sleeping on this entity's physics bodies. When enabled, physics bodies go to sleep when at rest.
DisableAutoSleepingGameEntityDisable automatic sleeping on this entity's physics bodies. Bodies remain awake until explicitly put to sleep.
SetParentapiParentname
SetParentWithOffsetapiParentname
SetParentMaintainOffsetapiParentname
SetParentAttachmentstringParentnameChange 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.
SetParentAttachmentMaintainOffsetstringParentnameChange 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.
ClearParentParentnameRemoves this entity from the the movement hierarchy, leaving it free to move independently.
FollowEntitystringParentnameBone merges this entity to a parent entity. Call again passing nothing to end the bone merge.
EnableLight2InputsTurn on the light.
DisableLight2InputsTurn off the light.
ToggleLight2InputsToggle the light.
SetColorcolor255Light2InputsSet the light's color.
SetColorTemperaturefloatLight2InputsSet the light's color temperature in Kelvin.
SetBrightnessfloatLight2InputsSet the light's brightness in EV.
SetBrightnessScalefloatLight2InputsSet the light's brightness multiplier, which defaults to 1.
SetStylestringLight2Inputs',' separated list of styles from light_styles.vdata to play in sequence. The last entry will loop. The last style can be 'on'/'off' to enable/disable the light with no light style.
SetFogStrengthfloatLight2InputsSet the fog strength.
SetFogScalefloatLight2InputsSet the fog multiplier, which defaults to 1.
SetBounceScalefloatLight2InputsSet the indirect bounce multiplier.

Outputs (9)

NameParameterFromDescription
OnUser1GameEntityFired in response to FireUser1 input.
OnUser2GameEntityFired in response to FireUser2 input.
OnUser3GameEntityFired in response to FireUser3 input.
OnUser4GameEntityFired in response to FireUser4 input.
OnKilledGameEntityFired when the entity is killed and removed from the game. Parameter is the inflictor.
OnStyleEvent0Light2InputsFired when the current light style plays an event of the type specified by Style Output Event 0.
OnStyleEvent1Light2InputsFired when the current light style plays an event of the type specified by Style Output Event 1.
OnStyleEvent2Light2InputsFired when the current light style plays an event of the type specified by Style Output Event 2.
OnStyleEvent3Light2InputsFired when the current light style plays an event of the type specified by Style Output Event 3.

Keyvalues (53)

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
vscripts
Entity Scripts
scriptlistVScriptName(s) of script files that are executed after all entities have spawned.
targetname
Name
target_sourceTargetnameThe name that other entities refer to this entity by.
parentname
Parent
target_destinationParentnameThe name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
parentAttachmentName
Parent Bone/Attachment Name
parentAttachmentParentnameThe name of the bone or attachment to attach to on the entity's parent in the movement hierarchy. Use !bonemerge to use bone-merge style attachment. NOTE: If this is specified the Hammer transform will be disregarded, even if 'Use Local Transform' is NOT specified (in that case local transform will be identity)
useLocalOffset
Use Local Transform
boolean0ParentnameWhether to respect the specified local offset when doing the initial hierarchical attachment to its parent.
local.origin
Local Origin
vectorParentnameOffset in the local space of the parent model's attachment/bone to use in hierarchy. Not used if you are not using parent attachment.
local.angles
Local Angles
angleParentnameAngular offset in the local space of the parent model's attachment/bone to use in hierarchy. Not used if you are not using parent attachment.
local.scales
Local Scale
vector1 1 1ParentnameScale in the local space of the parent model's attachment/bone to use in hierarchy. Not used if you are not using parent attachment.
clientSideEntity
Create Client-Only Entity
choices1
  • 0 No
  • 1 Yes
brightness_units
Units
intchoices1Brightness Units
  • 1 Lumens
  • 4 Candelas
  • 2 Nits
  • 0 EV
  • 3 Legacy
brightness_candelas
Candelas
float80Brightness in candelas
brightness_nits
Nits
float120Brightness in nits
brightness
Brightness (EV)
float0Logarithmic Brightness
brightness_legacy
Legacy
float1Legacy brightness value
enabled
Enabled
boolean1
directlight
Direct Lighting Type
choices1How direct lighting should be represented: Static=Fully baked into lightmap (cheapest), Stationary=Dynamic direct light with baked shadows, Dynamic=Fully dynamic (Most expensive)
  • 0 None
  • 1 Static
colormode
Color Mode
choices1How to calculate the light's color
  • 0 Color
  • 1 Color Temperature
color
Color
color255255 255 255
colortemperature
Color Temperature (K)
float6600
brightness_lumens
Brightness (Lumens)
float250Brightness in lumens. (See Light Units group for alternative units of measurement).
range
Range
float256.0
skirt
Falloff
float0.1Light Falloff based on set range.
bouncelight
Indirect Light Type
intchoices-1How indirect (bounce) light should be computed
  • -1 Default
  • 0 Disabled
  • 1 Baked
bouncescale
Indirect Light Multiplier
float1.0Increases the intensity of a lights' Indirect (bounce) light
shape
Light Shape
intchoices0Shape of the light
  • 0 Rectangle
  • 1 Disk
size_params
Light Size
vector16.0 16.0 0.15Note: Larger sizes produce more diffuse light/shadows.
bakespeculartocubemaps
Bake Specular to Cubemaps
boolean0Bake specular into cubemaps. Only works when Direct Lighting Type is set to Baked.
bakespeculartocubemaps_scale
Bake Specular to Cubemaps Scale
float1.0
minroughness
Specular Softness
float0Artificially 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.
castshadows
Cast Shadows
choices2Whether this light casts shadow
  • 0 No
  • 1 Baked & Dynamic
  • 2 Baked Only
shadowmapsize
Shadow Map Resolution
intchoices-1
  • 4096 4096
  • 3584 3584
  • 3072 3072
  • 2560 2560
  • 2048 2048
  • 1536 1536
  • 1024 1024
  • 512 512
  • -1 Default
shadowpriority
Shadow Priority
intchoices-1
  • 100 Highest
  • 10 High
  • 5 Medium
  • -5 Low
  • -1 Default
pvs_modify_entity
Transmit Shadow Casters to Client
boolean0When this light is visible to a player, add its shadow casters to the player's PVS.
shadowfade_size_start
Shadow Fade Out Start Size
float.10Screen size where the shadows will begin fading out
shadowfade_size_end
Shadow Fade Out End Size
float.05Screen size where the shadows will be fully faded out
showlight
Render Light Geometry
boolean0Render the light geometry in the world
rendertocubemaps
Render Light in Cubemaps
boolean1If true, illumination from this light renders into baked cube maps.
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.
fade_size_start
Light Fade Out Start Size
float.05Screen size where the light will begin fading out
fade_size_end
Light Fade Out End Size
float.025Screen size where the light will be fully faded out
transmit_always
Always Transmit to Clients
boolean0Allows large lights to transmit to clients as a workaround for going out of PVS due to sv_pvs_max_distance being set too close.
light_style
Style
vdata_choice:scripts/light_styles.vdataLight Style
light_style_output_event0
Style Output Event 0
vdata_choice:scripts/light_style_event_types.vdataevent_0Name of the event that triggers the OnStyleEvent0 output.
light_style_output_event1
Style Output Event 1
vdata_choice:scripts/light_style_event_types.vdataevent_1Name of the event that triggers the OnStyleEvent1 output.
light_style_output_event2
Style Output Event 2
vdata_choice:scripts/light_style_event_types.vdataevent_2Name of the event that triggers the OnStyleEvent2 output.
light_style_output_event3
Style Output Event 3
vdata_choice:scripts/light_style_event_types.vdataevent_3Name of the event that triggers the OnStyleEvent3 output.
light_style_target0
Style Target 0
target_destinationSets $light_emissive for use in material expressions. The emissive geometry's surface area should be approximately equal to the area light's surface area.
light_style_target1
Style Target 1
target_destinationSets $light_emissive for use in material expressions. The emissive geometry's surface area should be approximately equal to the area light's surface area.
light_style_target2
Style Target 2
target_destinationSets $light_emissive for use in material expressions. The emissive geometry's surface area should be approximately equal to the area light's surface area.
light_style_target3
Style Target 3
target_destinationSets $light_emissive for use in material expressions. The emissive geometry's surface area should be approximately equal to the area light's surface area.
fogremove_key
fogshadowsremove_key
fogstrengthremove_key