@pmndrs/reflections
    Preparing search index...

    Class ReflectionProbes

    A set of ReflectionProbe children baked into one texture. Assign reflectionProbes( probes ) to scene.environmentNode. Smaller volumes take priority over larger ones; uncovered surfaces fall back to scene.environment. WebGPU backend only.

    Hierarchy

    • Object3D
      • ReflectionProbes
    Index
    bakedAtlases: number[] = []

    Per baked probe: the index in textures of the atlas holding it (D4700).

    bakedEnvironmentSlot: number = 0

    The environment's slot in textures[0] (after the probes that live there).

    bakedLayout: ProbeStorage = 'cube2d'

    The storage the current texture uses ('cube2d' before the first bake).

    bakedProbes: ReflectionProbe[] = []

    The probes in baked order, smallest volume first.

    bakedResolutions: number[] = []

    Face size of each of textures.

    bakedSeamFix: SeamFix = 'warp'

    The seam fix the current texture was baked with (the node samples to match); 'none' on cube arrays.

    bakedSlots: number[] = []

    Per baked probe: its slot (cube index) within that atlas.

    boxProjection: boolean = true

    Whether the probes use box projection.

    capturing: boolean = false

    Whether a bake is in progress. Probes then contribute only the environment.

    irradiance: GPUBuffer | null = null

    L1 SH radiance coefficients per slot (3 vec4 rows each, core's table layout), from the last bake; null before.

    irradianceVersion: number = 0

    Bumped when irradiance is recomputed.

    isReflectionProbes: true
    layout: ProbeStorageOption = 'auto'

    Storage of the next bake (not in #35046, which always uses a cube array): 'auto' (default) a CubeArrayTexture when the renderer can bind one (three with #35053, or after await installCubeArraySupport( renderer )), else the 2D array; 'cube-array' requires it (the bake throws without it); 'cube2d' always the 2D array. bakedLayout is what the bake chose.

    refitClamp: number = 4

    Upper bound of the re-fit ratio frameIrradiance / probeIrradiance (lookups with frameIrradiance).

    seamFix: SeamFix = 'warp'

    Face-edge handling of the manual cube lookup on the 2D-array storage (not in #35046, see the file header). A no-op on cube arrays (hardware filtering is seamless). Re-bake after changing it.

    texture: Texture<unknown, TextureEventMap> | null = null

    The baked texture: one cube per probe, then one for the environment; mips = roughness. A CubeArrayTexture when bakedLayout is 'cube-array', else a 2D array texture of 6 layers per cube. With probes of several resolutions (D4700) this is the set default's atlas (its probes and the environment), textures[0]; the others are in textures.

    textures: Texture<unknown, TextureEventMap>[] = []

    Every atlas of the last bake, one per probe resolution (D4700): [texture] when every probe uses the set default. Same storage and seam fix for all; each has its own size and mips.

    • get distanceRoughness(): boolean

      Lagarde 2014's distance-based roughness on box-projected probes (not in #35046, D53): a glossy lookup is sharp where the surface is near the projection box and keeps its roughness from the capture point's distance on, r' = mix( clamp( dHit / dCapture * r, 0, r ), r, r ), as an SSR hit there would be. Default true. The default of every lookup of this set (reflectionProbes(), sampleReflectionProbes(), the hybrid composite), so lit and composite agree; a lookup's own distanceRoughness option overrides it. Changing it rebuilds the set's nodes (an environment node at once; a composite on its next rebuild). Not in #35046 (set it false for #35046's look).

      Returns boolean

    • set distanceRoughness(v: boolean): void

      Parameters

      • v: boolean

      Returns void

    • get roughnessLerp(): boolean

      Lagarde 2014's lerp of the box-projected direction back toward the unprojected one by roughness (Appendix F, D53): rough lookups lose the parallax a centre-convolved probe can't honour. The set-wide default, like distanceRoughness. Default false: it narrowed the SSR-to-probe step on glossy floors but moved every showcase stage away from the path-traced reference (W26).

      Returns boolean

    • set roughnessLerp(v: boolean): void

      Parameters

      • v: boolean

      Returns void

    • Captures the probes and scene.environment into the array (see BakeOptions for which ones). Hide helpers and objects that should not appear in reflections first. Reuses the array, the capture cube and the prefilter between bakes of the same layout, so re-baking every frame neither allocates nor changes the texture materials sample.

      Parameters

      • renderer: WebGPURenderer
      • scene: Scene
      • options: BakeOptions = {}

      Returns void

    • Registers a node that samples this set. A bake that replaces the texture (a new layout) marks it for rebuild, so static meshes rebind the new texture on the next frame; r186/r187 don't rebind unchanged render objects on its own. Called by ReflectionProbesNode.

      Parameters

      • node: Node

      Returns void