s&
About
The Project
info
About s&box
map
Roadmap
monitoring
Metrics
Engine startup and usage numbers
Updates
newspaper
Latest News
published_with_changes
Changes
Release-by-release changelog
Games
Browse Games
Discover Games
gamejams
Workshop
Playable
sports_esports
Games
Standalone games and gamemodes
Assets
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
apps
Everything
Every asset type in one list
Forum
Learn
Documentation
rocket_launch
Getting Started
docs
Documentation
api
API Reference
Resources
school
Tutorials
manage_search
Code Search
Get s&box
Sign in with Steam
Api
Components
Light
chevron_left
Components
class
Light
Constructors
lock
Light
Properties
data_object
AnimationCurve
data_object
AnimationDuration
data_object
AnimationEnabled
data_object
AnimationGradient
data_object
AnimationPattern
data_object
AnimationSpeed
data_object
AnimationTimeOffset
data_object
BakeLightIndex
data_object
ComponentVersion
data_object
Contribution
data_object
FogMode
data_object
FogStrength
data_object
Intensity
data_object
LightColor
data_object
MixedShadows
data_object
ShadowBias
data_object
ShadowHardness
data_object
Shadows
data_object
Temperature
Methods
lock
CreateSceneObject
lock
OnAwake
lock
OnDisabled
lock
OnEnabled
lock
OnTagsChanged
lock
OnUpdate
Light
class
Sandbox
.
account_tree
extends
Component
abstract
Sandbox.Engine
build
Constructors
1
Light
(
)
data_object
Properties
19
AnimationCurve
Curve
Brightness multiplier over one custom loop. The full curve time range is mapped to Duration. Negative values emit no light; values above one can brighten it.
AnimationDuration
float
Duration of one custom loop in seconds at a playback speed of one.
AnimationEnabled
bool
Animate the emitted light without changing its authored tint, intensity or temperature. Disabled by default so existing lights retain their appearance.
AnimationGradient
Gradient
Color multiplier over one custom loop. White preserves the authored tint. Gradient alpha scales brightness, allowing fades without changing the light's tint alpha.
AnimationPattern
LightAnimationPattern
Built-in light patterns, or a custom color and intensity loop. Built-in patterns advance in discrete steps, with normal brightness normalized to one.
AnimationSpeed
float
Playback speed multiplier. One plays classic patterns at ten steps per second. Zero holds the sample selected by the time offset.
AnimationTimeOffset
float
Offset in animation seconds, applied after speed. Lights with the same settings share the scene clock; change this to put otherwise identical lights out of phase.
BakeLightIndex
int
Index used by baked probe/lightmap direct-light textures, or -1 for a dynamic light.
ComponentVersion
int
Versions light defaults so existing scenes retain their original tint.
Contribution
LightContribution
Which lighting terms this light is allowed to contribute to. For example, turn off Sandbox.Light.LightContribution.Specular to stop a light producing highlights.
FogMode
FogInfluence
Controls whether this light illuminates fog and whether that lighting includes shadows.
FogStrength
float
Strength of this light's contribution to fog lighting.
Intensity
float
Brightness multiplier applied to the tint. One preserves the original brightness, zero emits no light, and values above one produce brighter HDR lighting.
LightColor
Color
Tint multiplied by the light's intensity and color temperature.
MixedShadows
bool
Baked lighting with realtime shadows from dynamic objects, like Hammer's stationary lights. Requires a baked light index and enabled shadows.
ShadowBias
float
Bias applied to shadow depth comparisons to reduce self-shadowing artifacts.
ShadowHardness
float
Controls the hardness of shadow edges.
Shadows
bool
Should this light cast shadows?
Temperature
float
Color temperature in Kelvin. The slider covers 1000 to 12000; values up to 40000 can be entered directly. Lower values are warmer and higher values are cooler. The default of 6500 K is neutral white and preserves the tint exactly.
functions
Methods
6
CreateSceneObject
(
)
SceneLight
OnAwake
(
)
OnDisabled
(
)
OnEnabled
(
)
OnTagsChanged
(
)
Tags have been updated - lets update our light's tags
OnUpdate
(
)
Refresh animated emission while the component is active, including editor previews.
Inheritance
Component
Light
DirectionalLight
PointLight
SpotLight
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.