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
LightModulator
chevron_left
Components
class
LightModulator
Constructors
functions
LightModulator
Properties
data_object
BlendMode
data_object
Brightness
data_object
CausticsLayerScale
data_object
CausticsSpeed
data_object
CausticsTimeOffset
data_object
CausticsWobble
data_object
ChromaticSplitSeparation
data_object
ChromaticSplitSpeed
data_object
ChromaticSplitTimeOffset
data_object
CloudShadowDepth
data_object
CloudShadowLayerScale
data_object
CloudShadowSpeed
data_object
CloudShadowTimeOffset
data_object
Contrast
data_object
DistanceFeather
data_object
DistanceMipBias
data_object
EdgeFeather
data_object
Effect
data_object
Infinite
data_object
KaleidoscopeBlend
data_object
KaleidoscopeSegments
data_object
KaleidoscopeSpeed
data_object
KaleidoscopeTimeOffset
data_object
MipLevel
data_object
Offset
data_object
PulseDepth
data_object
PulseSharpness
data_object
PulseSpeed
data_object
PulseTimeOffset
data_object
RippleDisplacement
data_object
RippleFrequency
data_object
RippleSpeed
data_object
RippleTimeOffset
data_object
RotationSpeed
data_object
RotationTimeOffset
data_object
ScrollSpeed
data_object
Size
data_object
Strength
data_object
Texture
data_object
TextureRotation
data_object
Tiling
data_object
Tint
data_object
TwoSided
data_object
WorldSizedUVs
LightModulator
Filters direct light passing through a textured rectangle or infinite plane in the local Y/Z plane. This changes lighting on receivers; add a separate renderer to display the glass itself.
class
Sandbox
.
account_tree
extends
Component
sealed
Sandbox.Engine
build
Constructors
1
LightModulator
(
)
data_object
Properties
44
BlendMode
ModulationBlendMode
Multiply applies the texture directly; Lighten only boosts light and Darken only reduces it. Applied per RGB channel after contrast, brightness and tint, before strength and alpha.
Brightness
float
Linear brightness multiplier after contrast. One preserves brightness; values above one boost light. Alpha is unaffected. This is an artistic light multiplier, not physical light focusing.
CausticsLayerScale
float
Scale of the second caustic sample relative to the first.
CausticsSpeed
float
Animation speed multiplier. Zero freezes caustic motion; negative values reverse it.
CausticsTimeOffset
float
Offset in caustic animation time, in seconds at the default speed.
CausticsWobble
float
Maximum UV displacement in texture repeats.
ChromaticSplitSeparation
float
UV offset in texture repeats for the red and blue samples on either side of green.
ChromaticSplitSpeed
float
Rotation speed of the red/blue separation direction in radians per second.
ChromaticSplitTimeOffset
float
Offset in chromatic split animation time, in seconds at the default speed.
CloudShadowDepth
float
Blend from white transmission at zero to the full cloud texture at one, before colour adjustments.
CloudShadowLayerScale
float
Scale of the second cloud sample relative to the first.
CloudShadowSpeed
float
Cloud drift speed multiplier. Zero freezes the clouds; negative values reverse them.
CloudShadowTimeOffset
float
Offset in cloud animation time, in seconds at the default speed.
Contrast
float
RGB contrast around linear 0.5, before brightness and tint. One preserves the texture. Alpha is unaffected; negative RGB results are clamped to zero.
DistanceFeather
float
Fade in modulation over this many world units from the rectangle's plane. Uses perpendicular distance for both surfaces and fog, independent of light angle or object scale. Zero disables distance feathering; full strength is reached at this distance and beyond.
DistanceMipBias
float
Softens transmission as light travels from the glass to the receiving surface or fog sample. Adds this many mip levels at 128 world units, twice as many at 384 units. Zero disables distance softening.
EdgeFeather
float
Fade inward from each rectangle edge, as a fraction of its width or height. Zero gives a hard boundary; 0.1 fades across the outer ten percent on each axis. Uses the physical rectangle, independent of texture tiling or scrolling.
Effect
ModulationEffect
Animate the projected texture before contrast, brightness, tint and blending. None preserves the existing texture mapping.
Infinite
bool
Extend the rectangle to an infinite plane, without aperture clipping or edge feathering. Sidedness and distance feathering still apply.
KaleidoscopeBlend
float
Blend from the original UV mapping at zero to fully mirrored sectors at one.
KaleidoscopeSegments
int
Number of mirrored sectors around the center of the texture.
KaleidoscopeSpeed
float
Rotation speed of the mirrored pattern in degrees per second.
KaleidoscopeTimeOffset
float
Offset in kaleidoscope animation time, in seconds at the default speed.
MipLevel
float
Explicit texture mip used by divergent light queries; larger values soften the projection.
Offset
Vector2
Texture-coordinate offset in repeats, applied after tiling and rotation.
PulseDepth
float
Brightness variation, from constant brightness at zero to a full zero-to-one pulse at one.
PulseSharpness
float
Shape of the brightness pulse. One gives a sine wave; higher values narrow the bright interval.
PulseSpeed
float
Brightness cycles per second. Zero freezes the pulse; negative values reverse it.
PulseTimeOffset
float
Offset in pulse animation time, in seconds at the default speed.
RippleDisplacement
float
Maximum radial UV displacement in texture repeats.
RippleFrequency
float
Radial wave frequency multiplier. Higher values produce more closely spaced waves.
RippleSpeed
float
Wave animation speed multiplier. Zero freezes the ripples; negative values reverse them.
RippleTimeOffset
float
Offset in ripple animation time, in seconds at the default speed.
RotationSpeed
float
Clockwise rotation speed in degrees per second. Negative values rotate counterclockwise.
RotationTimeOffset
float
Offset in rotation animation time, in seconds at the default speed.
ScrollSpeed
Vector2
Scroll effect movement in repeats per second along U and V. Zero leaves the projection still. Runs in the shader without rebuilding textures or light candidate lists each frame.
Size
Vector2
Rectangle width along local Y and height along local Z, before object scaling. For an infinite plane, this is the UV reference size when World Sized UVs is disabled.
Strength
float
Blend between original light at zero and full texture modulation at one. Multiplies texture alpha and edge feathering rather than dimming the light itself.
Texture
Texture
RGB transmission through the rectangle. Alpha blends between unfiltered and filtered light. Sampling uses the texture's own colour space.
TextureRotation
float
Clockwise rotation of the projected texture in degrees, around its center.
Tiling
Vector2
Texture repeats across the rectangle, or per 128 world units with World Sized UVs enabled. Negative values mirror the texture. Scaling and rotation are centered on the rectangle.
Tint
Color
Linear RGB multiplier, including values above one for artistic caustics.
TwoSided
bool
Applies the filter in both directions. Otherwise light travels along local positive X only.
WorldSizedUVs
bool
Keep texture density independent of rectangle size and object scale. Tiling specifies repeats per 128 world units along the plane's axes, centered on its origin.
Inheritance
Component
LightModulator
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.