DirectionalLightclass

A directional light that casts shadows, like the sun.

object→Light→DirectionalLight
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public class Sandbox.DirectionalLight : Sandbox.Light

Constructors1

Showing 1 constructors

Methods3

Showing 3 methods

protected virtual void DrawGizmos()PROTECTEDVIRTUAL

Returns:void—

protected virtual void OnAwake()PROTECTEDVIRTUALLIFECYCLE

Returns:void—

Properties6

Showing 6 properties

public bool Sandbox.DirectionalLight.ContactShadows { get; set; }PUBLICGETSET

Add small-scale screen-space contact shadows on top of the cascaded shadow maps. Captures fine contact detail the shadow maps miss, at some GPU cost.

Returns:bool—

public bool Sandbox.DirectionalLight.IncludeStaticShadowCasters { get; set; }PUBLICGETSET

Include static casters even when this light is indexed for baked lighting. Enable when realtime shadows are intentionally overlaid on existing baked lighting.

Returns:bool—

public int Sandbox.DirectionalLight.ShadowCascadeCount { get; set; }PUBLICGETSET

Number of cascades to split the view frustum into for the whole scene dynamic shadow. More cascades result in better shadow resolution, but adds significant rendering cost. User settings will set a maximum.

Returns:int—

public float Sandbox.DirectionalLight.ShadowCascadeSplitRatio { get; set; }PUBLICGETSET

Controls how cascades 2+ are distributed between the first cascade boundary and the far clip. 0 is uniform, 1 is fully logarithmic.

Returns:float—

public Color Sandbox.DirectionalLight.SkyColor { get; set; }PUBLICGETSET

Color of the ambient sky color This is kept for long term support, the recommended way to do this is with an Ambient Light component.

Returns:Color—

On this page