OptionalbuilderOptionalbvhThe @pmndrs/bvh module (the same one @pmndrs/raytracer links). Default: import('@pmndrs/bvh').
OptionalenvironmentThe environment traceHitShade samples. Default none (black).
OptionalfilterWhich meshes to trace. Default: visible meshes that aren't helpers and don't set userData.noTrace.
OptionalmaterialThe 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).
OptionalminifyMinify the provider's WGSL (line breaks kept). Default true: the module with rtShade is ~50 KB unminified.
OptionalmoduleThe @pmndrs/raytracer module, if the caller already has it. Default: import('@pmndrs/raytracer').
OptionalpackingHow 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.
OptionalrayCompile the instance-mask test into the walk. Default false (W48: 1-6% of the trace pass, D3591).
OptionalshadetraceHitShade'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.
OptionalshadingPass the geometries' vertex normals for the shading normal (D1700). Default true.
OptionalsunThe sun. Default: the brightest visible DirectionalLight under objects (null: none).
OptionaltexturesMaterial 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.
'auto' (default): H-PLOC on the GPU when the device has
subgroups, tinybvh otherwise (@pmndrs/bvh'screateMeshLayoutBuilder).