LightModulatorclass

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.

object→Component→LightModulator
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public sealed class Sandbox.LightModulator : Sandbox.Component

Constructors1

Showing 1 constructors

Properties44

Showing 44 properties

public float Sandbox.LightModulator.Brightness { get; set; }PUBLICGETSET

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.

Returns:float—

public float Sandbox.LightModulator.CausticsLayerScale { get; set; }PUBLICGETSET

Scale of the second caustic sample relative to the first.

Returns:float—

public float Sandbox.LightModulator.CausticsSpeed { get; set; }PUBLICGETSET

Animation speed multiplier. Zero freezes caustic motion; negative values reverse it.

Returns:float—

public float Sandbox.LightModulator.CausticsTimeOffset { get; set; }PUBLICGETSET

Offset in caustic animation time, in seconds at the default speed.

Returns:float—

public float Sandbox.LightModulator.CausticsWobble { get; set; }PUBLICGETSET

Maximum UV displacement in texture repeats.

Returns:float—

public float Sandbox.LightModulator.ChromaticSplitSeparation { get; set; }PUBLICGETSET

UV offset in texture repeats for the red and blue samples on either side of green.

Returns:float—

public float Sandbox.LightModulator.ChromaticSplitSpeed { get; set; }PUBLICGETSET

Rotation speed of the red/blue separation direction in radians per second.

Returns:float—

public float Sandbox.LightModulator.ChromaticSplitTimeOffset { get; set; }PUBLICGETSET

Offset in chromatic split animation time, in seconds at the default speed.

Returns:float—

public float Sandbox.LightModulator.CloudShadowDepth { get; set; }PUBLICGETSET

Blend from white transmission at zero to the full cloud texture at one, before colour adjustments.

Returns:float—

public float Sandbox.LightModulator.CloudShadowLayerScale { get; set; }PUBLICGETSET

Scale of the second cloud sample relative to the first.

Returns:float—

public float Sandbox.LightModulator.CloudShadowSpeed { get; set; }PUBLICGETSET

Cloud drift speed multiplier. Zero freezes the clouds; negative values reverse them.

Returns:float—

public float Sandbox.LightModulator.CloudShadowTimeOffset { get; set; }PUBLICGETSET

Offset in cloud animation time, in seconds at the default speed.

Returns:float—

public float Sandbox.LightModulator.Contrast { get; set; }PUBLICGETSET

RGB contrast around linear 0.5, before brightness and tint. One preserves the texture. Alpha is unaffected; negative RGB results are clamped to zero.

Returns:float—

public float Sandbox.LightModulator.DistanceFeather { get; set; }PUBLICGETSET

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.

Returns:float—

public float Sandbox.LightModulator.DistanceMipBias { get; set; }PUBLICGETSET

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.

Returns:float—

public float Sandbox.LightModulator.EdgeFeather { get; set; }PUBLICGETSET

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.

Returns:float—

public bool Sandbox.LightModulator.Infinite { get; set; }PUBLICGETSET

Extend the rectangle to an infinite plane, without aperture clipping or edge feathering. Sidedness and distance feathering still apply.

Returns:bool—

public float Sandbox.LightModulator.KaleidoscopeBlend { get; set; }PUBLICGETSET

Blend from the original UV mapping at zero to fully mirrored sectors at one.

Returns:float—

public int Sandbox.LightModulator.KaleidoscopeSegments { get; set; }PUBLICGETSET

Number of mirrored sectors around the center of the texture.

Returns:int—

public float Sandbox.LightModulator.KaleidoscopeSpeed { get; set; }PUBLICGETSET

Rotation speed of the mirrored pattern in degrees per second.

Returns:float—

public float Sandbox.LightModulator.KaleidoscopeTimeOffset { get; set; }PUBLICGETSET

Offset in kaleidoscope animation time, in seconds at the default speed.

Returns:float—

public float Sandbox.LightModulator.MipLevel { get; set; }PUBLICGETSET

Explicit texture mip used by divergent light queries; larger values soften the projection.

Returns:float—

public Vector2 Sandbox.LightModulator.Offset { get; set; }PUBLICGETSET

Texture-coordinate offset in repeats, applied after tiling and rotation.

Returns:Vector2—

public float Sandbox.LightModulator.PulseDepth { get; set; }PUBLICGETSET

Brightness variation, from constant brightness at zero to a full zero-to-one pulse at one.

Returns:float—

public float Sandbox.LightModulator.PulseSharpness { get; set; }PUBLICGETSET

Shape of the brightness pulse. One gives a sine wave; higher values narrow the bright interval.

Returns:float—

public float Sandbox.LightModulator.PulseSpeed { get; set; }PUBLICGETSET

Brightness cycles per second. Zero freezes the pulse; negative values reverse it.

Returns:float—

public float Sandbox.LightModulator.PulseTimeOffset { get; set; }PUBLICGETSET

Offset in pulse animation time, in seconds at the default speed.

Returns:float—

public float Sandbox.LightModulator.RippleDisplacement { get; set; }PUBLICGETSET

Maximum radial UV displacement in texture repeats.

Returns:float—

public float Sandbox.LightModulator.RippleFrequency { get; set; }PUBLICGETSET

Radial wave frequency multiplier. Higher values produce more closely spaced waves.

Returns:float—

public float Sandbox.LightModulator.RippleSpeed { get; set; }PUBLICGETSET

Wave animation speed multiplier. Zero freezes the ripples; negative values reverse them.

Returns:float—

public float Sandbox.LightModulator.RippleTimeOffset { get; set; }PUBLICGETSET

Offset in ripple animation time, in seconds at the default speed.

Returns:float—

public float Sandbox.LightModulator.RotationSpeed { get; set; }PUBLICGETSET

Clockwise rotation speed in degrees per second. Negative values rotate counterclockwise.

Returns:float—

public float Sandbox.LightModulator.RotationTimeOffset { get; set; }PUBLICGETSET

Offset in rotation animation time, in seconds at the default speed.

Returns:float—

public Vector2 Sandbox.LightModulator.ScrollSpeed { get; set; }PUBLICGETSET

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.

Returns:Vector2—

public Vector2 Sandbox.LightModulator.Size { get; set; }PUBLICGETSET

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.

Returns:Vector2—

public float Sandbox.LightModulator.Strength { get; set; }PUBLICGETSET

Blend between original light at zero and full texture modulation at one. Multiplies texture alpha and edge feathering rather than dimming the light itself.

Returns:float—

public Sandbox.Texture Sandbox.LightModulator.Texture { get; set; }PUBLICGETSET

RGB transmission through the rectangle. Alpha blends between unfiltered and filtered light. Sampling uses the texture's own colour space.

Returns:Texture—

public float Sandbox.LightModulator.TextureRotation { get; set; }PUBLICGETSET

Clockwise rotation of the projected texture in degrees, around its center.

Returns:float—

public Vector2 Sandbox.LightModulator.Tiling { get; set; }PUBLICGETSET

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.

Returns:Vector2—

public Color Sandbox.LightModulator.Tint { get; set; }PUBLICGETSET

Linear RGB multiplier, including values above one for artistic caustics.

Returns:Color—

public bool Sandbox.LightModulator.TwoSided { get; set; }PUBLICGETSET

Applies the filter in both directions. Otherwise light travels along local positive X only.

Returns:bool—

public bool Sandbox.LightModulator.WorldSizedUVs { get; set; }PUBLICGETSET

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.

Returns:bool—

On this page

Constructorspublic LightModulator()Propertiespublic Sandbox.LightModulator.ModulationBlendMode Sandbox.LightModulator.BlendMode { get; set; }public System.Single Sandbox.LightModulator.Brightness { get; set; }public System.Single Sandbox.LightModulator.CausticsLayerScale { get; set; }public System.Single Sandbox.LightModulator.CausticsSpeed { get; set; }public System.Single Sandbox.LightModulator.CausticsTimeOffset { get; set; }public System.Single Sandbox.LightModulator.CausticsWobble { get; set; }public System.Single Sandbox.LightModulator.ChromaticSplitSeparation { get; set; }public System.Single Sandbox.LightModulator.ChromaticSplitSpeed { get; set; }public System.Single Sandbox.LightModulator.ChromaticSplitTimeOffset { get; set; }public System.Single Sandbox.LightModulator.CloudShadowDepth { get; set; }public System.Single Sandbox.LightModulator.CloudShadowLayerScale { get; set; }public System.Single Sandbox.LightModulator.CloudShadowSpeed { get; set; }public System.Single Sandbox.LightModulator.CloudShadowTimeOffset { get; set; }public System.Single Sandbox.LightModulator.Contrast { get; set; }public System.Single Sandbox.LightModulator.DistanceFeather { get; set; }public System.Single Sandbox.LightModulator.DistanceMipBias { get; set; }public System.Single Sandbox.LightModulator.EdgeFeather { get; set; }public Sandbox.LightModulator.ModulationEffect Sandbox.LightModulator.Effect { get; set; }public System.Boolean Sandbox.LightModulator.Infinite { get; set; }public System.Single Sandbox.LightModulator.KaleidoscopeBlend { get; set; }public System.Int32 Sandbox.LightModulator.KaleidoscopeSegments { get; set; }public System.Single Sandbox.LightModulator.KaleidoscopeSpeed { get; set; }public System.Single Sandbox.LightModulator.KaleidoscopeTimeOffset { get; set; }public System.Single Sandbox.LightModulator.MipLevel { get; set; }public Vector2 Sandbox.LightModulator.Offset { get; set; }public System.Single Sandbox.LightModulator.PulseDepth { get; set; }public System.Single Sandbox.LightModulator.PulseSharpness { get; set; }public System.Single Sandbox.LightModulator.PulseSpeed { get; set; }public System.Single Sandbox.LightModulator.PulseTimeOffset { get; set; }public System.Single Sandbox.LightModulator.RippleDisplacement { get; set; }public System.Single Sandbox.LightModulator.RippleFrequency { get; set; }public System.Single Sandbox.LightModulator.RippleSpeed { get; set; }public System.Single Sandbox.LightModulator.RippleTimeOffset { get; set; }public System.Single Sandbox.LightModulator.RotationSpeed { get; set; }public System.Single Sandbox.LightModulator.RotationTimeOffset { get; set; }public Vector2 Sandbox.LightModulator.ScrollSpeed { get; set; }public Vector2 Sandbox.LightModulator.Size { get; set; }public System.Single Sandbox.LightModulator.Strength { get; set; }public Sandbox.Texture Sandbox.LightModulator.Texture { get; set; }public System.Single Sandbox.LightModulator.TextureRotation { get; set; }public Vector2 Sandbox.LightModulator.Tiling { get; set; }public Color Sandbox.LightModulator.Tint { get; set; }public System.Boolean Sandbox.LightModulator.TwoSided { get; set; }public System.Boolean Sandbox.LightModulator.WorldSizedUVs { get; set; }Metadata