OptionalonResize: (displaySize: { width: number; height: number }, camera: LuxarCamera) => void
Optional callback invoked with the display size and the
manager's current camera after every reallocation of the render-target
pyramid (resize, SSAA toggle, MSAA toggle, DPR change). Passing the live
camera keeps the hook correct across perspective/orthographic swaps.
SceneManager wires this to updateMaterialsForCurrentCamera() so point/line/gsplat
shaders pick up the new drawing-buffer size — otherwise their
cached uResolution / maxPointSize uniforms go
stale on AA toggles and the scene looks subtly wrong until the
next window resize.
PrivatehdrPrivateldrPrivatebloomPrivatemegaPrivatemegaPrivatefxaaPrivaterefractionThe scene-pass split for refract_data glass, both backends (null once disposed).
PrivatefxaaPrivatemsaaPrivatemsaaPrivatessaaPrivatessaaPrivaterenderPrivatebaseUser-configured noise sigmas (before DPR scaling).
PrivatecurrentPrivatebloomPrivatebloomPrivatebloomPrivatebloomPrivatedeferPrivatedisposedPrivate_PrivaterendererPrivatecapabilitiesPrivatescenePrivatecameraPrivate OptionalonOptional callback invoked with the display size and the
manager's current camera after every reallocation of the render-target
pyramid (resize, SSAA toggle, MSAA toggle, DPR change). Passing the live
camera keeps the hook correct across perspective/orthographic swaps.
SceneManager wires this to updateMaterialsForCurrentCamera() so point/line/gsplat
shaders pick up the new drawing-buffer size — otherwise their
cached uResolution / maxPointSize uniforms go
stale on AA toggles and the scene looks subtly wrong until the
next window resize.
PrivatelastMemo of the last applied allocation. Every window resize reaches
reallocateForSize through TWO paths — the window resize listener
(rAF-coalesced via ResizeOrchestrator) AND the canvas-parent
ResizeObserver — and the MSAA/SSAA setters call it directly too.
Without a guard, each redundant call disposed + recreated the
full-screen half-float HDR target. The memo keys on everything that
influences the allocation: display (CSS) size, effective logical
size (folds in SSAA), physical size (folds in DPR), and the HDR
target's MSAA sample count. null forces the next call to
reallocate (initial state; reset by rebuildAfterContextRestore).
PrivatewasPrivatemaxPrivateactivePrivatecomputePrivatedescribePrivategetPrivategetPrivateinitializePrivateallocatePrivateapplyPrivatedisposeOptionalstrength: numberOptionalradius: numberOptionalthreshold: numberOptionalstrength: numberOptionalradius: numberOptionalthreshold: numberThe display transform the mega-shader applies after the point where
an EXR capture is read (hdr-effects-pre-tone bypasses all of it):
exposure → offset → gamma → tone mapping → sRGB.
Exported so the offline EXR path can bundle an ffmpeg recipe that reproduces what the viewer showed, instead of encoding scene-linear floats as if they were already display-referred.
PrivateapplyRe-apply base sigmas through the DPR scaling. When DPR < 1 the sigma scales linearly with DPR (Gaussian) and photonGain scales with DPR² (shot noise).
Optionaldarkness: numberOptionaloffset: numberOptionaldistortionX: numberOptionaldistortionY: numberOptionaldispersion: numberOptionalprincipalPointX: numberOptionalprincipalPointY: numberOptionalfocalLengthX: numberOptionalfocalLengthY: numberOptionalskew: numberThe SSAA factor sitting between the size passed to resize and the requested render-target size. It EXCLUDES the pixel ratio. A framebuffer-limit clamp may reduce the achieved physical size, but limited allocations are always even in both axes. This keeps the factor sufficient for the recording session's encoder alignment after it forces the pixel ratio to 1.
The display (CSS-pixel) size the pipeline is configured for — i.e. exactly what resize was last given, and what it takes back.
This is NOT renderer.getSize(). reallocateForSize hands the
renderer the SSAA-MULTIPLIED size and stamps the display size on
the canvas CSS instead, so under SSAA the renderer reports
display × ssaaMultiplier. Feeding that back into resize
multiplies by the SSAA factor a second time.
PrivatepipelinePrivatepipelinePrivatecapturePrivatereallocateRe-allocate every GPU resource whose size depends on the effective render size. Two unit systems are at play and they must NOT be confused:
renderer.setSize(...) takes.
THREE multiplies internally by pixelRatio to derive the
canvas backbuffer.logical × pixelRatio. This is what
getDrawingBufferSize() reports to materials, what the canvas
backbuffer is, and what our render targets MUST match.A call whose full allocation key matches the last applied one is a
complete no-op (see lastAllocation).
Read raw HDR float pixel data in one of three capture modes:
'hdr-effects-pre-tone' (default): keep HDR-space effects
(bloom) but disable tone mapping, EOG, vignette, detector
noise, chromatic lens distortion. Linear HDR output —
the canonical EXR-export mode. Implemented via the
mega-shader's LUXAR_CAPTURE_RAW_HDR early-exit (skips EOG,
tone mapping, vignette, sRGB encoding).'visible-ldr': full pipeline (EOG + tone mapping + every
enabled effect), but skip the final sRGB encoding so the
captured pixels are linear LDR floats.'raw-scene-hdr': bypass the mega-shader entirely — render
the scene to hdrTarget and read it (no bloom, no effects).Returned rows are in canonical top-down order (row 0 = top of
the source target) on both backends. Pass opts.flipY = true to
receive bottom-up rows instead — only the EXR exporter does this,
to preserve the orientation external tools expect.
Optionaloptions: { type?: TextureDataType; mode?: CaptureMode }Capture every uniform / define state then rebuild from scratch. Used after a WebGL context-restore event.
Manages HDR post-processing: scene → bloom → mega-shader → (FXAA) → backbuffer. Owns all transient GPU resources and a small amount of persisted state (DPR noise scaling baseline, quality preset, etc.).