Nano WebGPU API - v0.11.0
    Preparing search index...

    Interface DirectionalLightOptions

    Configuration options specific to directional light sources.

    interface DirectionalLightOptions {
        cascadeCount?: number;
        cascadeSplitLambda?: number;
        castShadow?: boolean;
        color?: number[] | ColorLike;
        csmMaxDistance?: number;
        intensity?: number;
        position?: Vec3 | number[];
        rotation?: Vec3 | number[];
        rotationDegrees?: Vec3 | number[];
        shadowBias?: number;
        shadowDepthRange?: number;
        shadowMapSize?: number;
        shadowRadius?: number;
        useCSM?: boolean;
        usePCF?: boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    cascadeCount?: number

    Number of cascades for CSM (typically 3 or 4). Defaults to 4.

    cascadeSplitLambda?: number

    Factor weighting linear vs logarithmic cascade splits (value between 0 and 1). Defaults to 0.85.

    castShadow?: boolean

    If true, the light will cast shadows and generate an orthographic depth map. Defaults to true.

    color?: number[] | ColorLike

    Color of emitted light. Can be a Color instance, hex string, or RGB array. Defaults to #ffffff.

    csmMaxDistance?: number

    Maximum distance along camera depth for shadow mapping projection. Defaults to 100.0.

    intensity?: number

    Scalar multiplier for light emission intensity. Defaults to 1.0.

    position?: Vec3 | number[]

    Optional initial position of the light node in 3D space.

    rotation?: Vec3 | number[]

    Optional initial rotation Euler angles in radians.

    rotationDegrees?: Vec3 | number[]

    Optional initial rotation Euler angles in degrees.

    shadowBias?: number

    Custom depth bias to avoid shadow acne or peter panning. Defaults to 0.0001.

    shadowDepthRange?: number

    Total depth range along the Z axis of the shadow projection frustum. Defaults to 200.0.

    shadowMapSize?: number

    Resolution width/height of the shadow map texture. Defaults to 2048.

    shadowRadius?: number

    World-space boundary half-extent defining the orthographic shadow view box. Defaults to 20.0.

    useCSM?: boolean

    If true, the directional light will use Cascaded Shadow Maps (CSM) to divide the frustum. Defaults to false.

    usePCF?: boolean

    Toggle Percentage-Closer Filtering (PCF) to smooth out shadow edges. Defaults to true.