PrivateroomPrivatecapturePrivatebakedPrivatehdriPrivateconfigPrivatebakedPrivateruntimePrivatecapturePrivatewantedSet by the first ensure() — a physical material exists, so the scene needs light.
PrivateactivePrivatestaleHow many live captures have run (a diagnostic the tests and the bake read).
Private ReadonlydepsWhether an environment has been built and assigned.
What the scene is currently lit by.
The authored config in force (the default when the scene authored none).
Whether a valid baked map is attached (it wins over config.source).
Set the authored config (viewer_config.environment, validated by the zarr bridge).
null restores the default. Re-applies immediately if a physical material already
asked for light; otherwise it just waits for ensure().
Clear dataset-owned state while preserving runtime wiring and the reusable room PMREM. The config goes back to the default too: the next scene's physical materials ask for light while it loads, before its own config is applied.
Attach (or clear) a baked map. A valid map takes precedence over any source.
Give the environment its app runtime (the init pipeline does this once).
A physical material now exists: make sure the scene is lit.
Idempotent — every call after the first that changes nothing returns false.
Synchronous for the room and a live capture, so a physical mesh created this
frame is lit on its first draw.
true when this call built or replaced the environment.
Something the capture depends on changed (a commit, a slice, an appearance edit).
Only meaningful while lit by a live scene capture; the next tick after
the debounce, with the loader settled, re-captures.
Per-frame hook (the init pipeline registers it). Captures the first settled scene after any pool startup finishes, or re-captures a stale live environment after the debounce. Returns whether a capture ran.
Run one exact capture of the scene from the configured (or given) probe and make
it the environment. Returns null without a runtime. Also the bake's entry point:
the returned target is what bake.ts reads the six faces back from.
Optionaloverride: { probe?: EnvironmentProbe; resolution?: number }Rebuild previously-created GPU resources after the renderer context is restored.
Release everything and clear scene.environment if it is ours.
PrivatecanPrivatependingPrivateapplyApply the precedence rule for the current state. Returns whether anything changed.
PrivatecapturePrivateapplyPrivateapplyPrivatestartRequest the configured HDRI once per URL; a failure keeps the room until the URL changes.
PrivatereleaseRelease every GPU resource (room included), clearing scene.environment if it is ours.
PrivatereleasePrivatereleaseDrop the HDRI request and dispose its texture, clearing scene.environment if it is ours.
PrivateapplyPrivaterelease
The one HDRI request for the configured URL — loading (
texturenull), loaded, or failed (null forever). Keyed by URL so a new URL starts over, and compared by identity so a superseded load can neither adopt its texture nor clear this one.