@pmndrs/reflections
    Preparing search index...

    Interface RaytracerFromObjectsOptions

    interface RaytracerFromObjectsOptions {
        builder?: BvhBuilderPreference;
        bvhModule?: unknown;
        environment?: RaytracerEnvironment | null;
        filter?: (mesh: Mesh) => boolean;
        material?: (mesh: Mesh, source: HitMaterialSource) => HitMaterial;
        minify?: boolean;
        module?: unknown;
        packing?: "auto" | "packed" | "split";
        rayMasks?: boolean;
        shade?: Readonly<Record<string, unknown>>;
        shadingNormals?: boolean;
        sun?: RaytracerSun | null;
        textures?: false | { cone?: number; maxBuckets?: number; maxSize?: number };
    }

    Hierarchy (View Summary)

    Index

    'auto' (default): H-PLOC on the GPU when the device has subgroups, tinybvh otherwise (@pmndrs/bvh's createMeshLayoutBuilder).

    bvhModule?: unknown

    The @pmndrs/bvh module (the same one @pmndrs/raytracer links). Default: import('@pmndrs/bvh').

    environment?: RaytracerEnvironment | null

    The environment traceHitShade samples. Default none (black).

    filter?: (mesh: Mesh) => boolean

    Which meshes to trace. Default: visible meshes that aren't helpers and don't set userData.noTrace.

    material?: (mesh: Mesh, source: HitMaterialSource) => HitMaterial

    The material a mesh contributes to traced-hit shading. Default defaultHitMaterial. A multi-material mesh is asked once per material its groups draw with (source, W49).

    minify?: boolean

    Minify the provider's WGSL (line breaks kept). Default true: the module with rtShade is ~50 KB unminified.

    module?: unknown

    The @pmndrs/raytracer module, if the caller already has it. Default: import('@pmndrs/raytracer').

    packing?: "auto" | "packed" | "split"

    How the scene copy is bound (@pmndrs/raytracer's SceneCopyPacking, W89 / D5450). 'auto' (default): 'packed' (one storage buffer: header + table + data) unless that buffer would pass the device's maxStorageBufferBindingSize, then 'split' (table and data, two buffers). The packed copy is what fits the trace pass under WebGPU's default 8 storage buffers.

    rayMasks?: boolean

    Compile the instance-mask test into the walk. Default false (W48: 1-6% of the trace pass, D3591).

    shade?: Readonly<Record<string, unknown>>

    traceHitShade's rtShade options (RtShadeOptions: envSampling, minAlpha, sunVisible, ...). The indirect hook stays @pmndrs/raytracer's default (black): the hit shading adds its own indirect term, if any.

    shadingNormals?: boolean

    Pass the geometries' vertex normals for the shading normal (D1700). Default true.

    sun?: RaytracerSun | null

    The sun. Default: the brightest visible DirectionalLight under objects (null: none).

    textures?: false | { cone?: number; maxBuckets?: number; maxSize?: number }

    Material textures at traced hits (W97). Stored at most maxSize texels a side (default 1024: reflections are filtered) in at most maxBuckets texture arrays (default 4; each binds one sampled texture and one sampler in the trace pass). cone: the level-of-detail ray cone's spread in radians; the footprint at a hit is t x cone. Default 0.05 (maintainer, 2026-11-27: blur over flicker): textures at traced hits read softer, and the rest flicker on a textured traced wall stays where it was (0.0108 %); 0.012 is sharper and reads 0.0110 %. false: no textures, the materials' baseColor alone.