Small World Engine API Reference - v0.46.1
    Preparing search index...

    Interface DirectionalLightOptions

    Configuration options for directional light.

    interface DirectionalLightOptions {
        cascadeSplitLambda?: number;
        castShadow?: boolean;
        color?: Color;
        direction?: Vector3D;
        intensity?: number;
        name?: string;
        numCascades?: number;
        shadowBias?: number;
        shadowNormalBias?: number;
        shadowResolution?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    cascadeSplitLambda?: number

    Ratio between uniform and logarithmic split (0.0 = uniform, 1.0 = logarithmic). Defaults to 0.5.

    castShadow?: boolean

    Whether the light casts shadows. Defaults to false.

    color?: Color

    The color of the light. Defaults to white.

    direction?: Vector3D

    The direction of the light. Defaults to (0, -1, 0).

    intensity?: number

    The intensity of the light. Defaults to 1.0.

    name?: string

    The name of the light object. Defaults to "Light".

    numCascades?: number

    Number of shadow cascades. Defaults to 4.

    shadowBias?: number

    A small offset to prevent shadow acne. Defaults to 0.005.

    shadowNormalBias?: number

    An offset along the surface normal to prevent shadow acne. Defaults to 0.0.

    shadowResolution?: number

    The resolution of the shadow map for this light. Defaults to 512.