Taos API Reference
    Preparing search index...

    Interface ShadowFeatureOptions

    interface ShadowFeatureOptions {
        light?: () => DirectionalLight | null;
        shadowFar?: number | ((camera: Camera) => number);
        skinnedCasters?: () => readonly ShadowSkinnedDraw[];
        drawItems?: () => readonly ShadowMeshDraw[];
        depthBounds?: () => { near: number; far: number } | null;
        mode?: "cascade" | "clipmap";
        clipmapLevels?: number;
        clipmapLevel0Extent?: number;
        virtualize?: boolean;
    }
    Index

    Properties

    light?: () => DirectionalLight | null

    Override the light source for cascade fitting. By default the feature uses the scene's first DirectionalLightComponent.

    shadowFar?: number | ((camera: Camera) => number)
    skinnedCasters?: () => readonly ShadowSkinnedDraw[]

    External skinned shadow casters (the scene-traversal doesn't pre-bucket these — animated models supply them per-frame via this hook).

    drawItems?: () => readonly ShadowMeshDraw[]

    Override the static shadow-caster list. By default the feature reads frame.shadowCasters (built from the scene's MeshRenderers).

    depthBounds?: () => { near: number; far: number } | null

    SDSM depth feedback: a callback returning the visible scene's view-linear depth bounds (e.g. () => sdsmFeature.bounds). When it returns non-null the cascades are fit to that slab instead of the full [near, shadowFar] range, for a large texel-density gain on big scenes. See SdsmFeature.

    mode?: "cascade" | "clipmap"

    Directional shadow mode. 'cascade' (default) = classic CSM. 'clipmap' = UE5-style virtual-shadow-map clipmap (Phase 1): N concentric, camera-centered, texel-snapped levels — tilt-stable with high near-resolution. Rendered into a separately-keyed deeper shadow-map array. depthBounds/SDSM are ignored in clipmap mode (it's view-independent by construction). The matching lighting feature must read frame.extras.get('shadow:mode') (the bundled DeferredLightingFeature/ForwardPlusFeature do). See TODO/virtual-shadow-maps.md.

    clipmapLevels?: number

    Clipmap: number of concentric levels (≤ MAX_SHADOW_LEVELS). Overrides the light's own clipmapLevels when set.

    clipmapLevel0Extent?: number

    Clipmap: world-space extent of level 0. Overrides the light's clipmapLevel0Extent when set.

    virtualize?: boolean

    Virtual-shadow-map page pooling (Phase 2). Only meaningful with mode:'clipmap'. Renders/allocates only the pages the scene samples into a shared pool atlas (big VRAM win + skips unsampled coarse-level pages) and the lighting samples through a page table. CPU-readback-driven (1-frame latency, like SDSM). PCSS only — virtualised + EVSM2 is a follow-up. Requires the feature to run after the geometry feature (it reads frame.gbuffer.depth).