Base parameters used to create a DirectionalShadow.

interface DirectionalShadowParams {
    light: DirectionalLight;
    camera?: OrthographicProjectionParams;
    intensity?: number;
    bias?: number;
    normalBias?: number;
    pcfSamples?: number;
    depthTextureSize?: Vec2;
    depthTextureFormat?: GPUTextureFormat;
    autoRender?: boolean;
}

Hierarchy (view full)

Properties

DirectionalLight used to create the DirectionalShadow.

intensity?: number

Intensity of the shadow in the [0, 1] range. Default to 1.

bias?: number

Shadow map bias. Default to 0.

normalBias?: number

Shadow map normal bias. Default to 0.

pcfSamples?: number

Number of samples to use for Percentage Closer Filtering calculations in the shader. Increase for smoother shadows, at the cost of performance. Default to 1.

depthTextureSize?: Vec2

Size of the depth Texture to use. Default to Vec2(512).

depthTextureFormat?: GPUTextureFormat

Format of the depth Texture to use. Default to depth24plus.

autoRender?: boolean

Whether the shadow should be automatically rendered each frame or not. Should be set to false if the scene is static and be rendered manually instead. Default to true.