Create rendering controls UI with complete parameter access.
Initializes GUI with all post-processing and rendering controls organized in folders. Sets up auto-blur behavior and keyboard handling. Starts hidden - call show() or toggle() to display.
Post-processing manager for bloom, noise, etc.
Scene manager for camera and control access
PrivateguiThe custom GUI instance
Current rendering settings (public for state capture)
PrivatesceneScene identifier for settings persistence
PrivatezarrPrivatehasPrivatepostReference to post-processing manager
PrivatesceneReference to scene manager
Private OptionalanimationReference to animation controller for triggering re-renders
PrivatevisibleVisibility state
Private ReadonlyfocusOutside-click + focus management for the panel.
PrivatecontrollersReferences to GUI controllers for updates
Private OptionaladaptiveReference to adaptive DPR manager (persisted enabled state applied on load).
Private OptionaldensityPrivate ReadonlyclippingRAF-driven mirror of the camera near/far values into the slider displays.
PrivatecleanupCleanup callbacks collected during setup, called on dispose
Private OptionalcinematicCinematic mode preset controller (created in setupControls during construction).
PrivatesetupSetup all GUI controls
PrivateaddAdd the root-level "Reset to Defaults" button at the bottom of the panel.
PrivatecreateBuild the cinematic-mode controller. animationController is read lazily so
the cinematic toggle works correctly after setAnimationController() runs.
Reset all rendering settings to their default values.
Public because the rail Home popover's "Reset rendering" action calls it too (same behavior as this panel's own "Reset to Defaults" button).
Set the animation controller reference
The animation controller instance
Store the adaptive DPR manager reference.
The Performance controls (Adaptive Resolution toggle, Manual DPR slider,
live DPR/FPS readout) live in the Performance rail popover (right-click the
gauge) — see ui/rail-panels/performance-popover. The panel only needs the
manager so loadSettings can apply the persisted enabled state.
The AdaptiveDPRManager instance
Store the density-guard handle so loadSettings (and a reset) can
apply the persisted densityGuardEnabled flag. The toggle itself lives in
the Performance rail popover, which self-syncs from the handle when opened.
PrivateapplyApply the stored Density Guard choice — unless ?noDensityGuard turned
the guard off for this session, in which case the stored flag is left
alone (neither applied nor overwritten), like a URL DPR pin.
Set the scene identifier for settings persistence
URL of the zarr store
OptionalsceneName: string
Name of the scene
Set the zarr viewer config from the loaded scene. Called after loadSceneData() completes so the zarr metadata is available.
Whether this scene has stored settings in localStorage.
Apply zarr viewer_config as defaults for a first-time scene visit. Called when no localStorage exists and zarr provides scene-specific defaults. Re-applies the full 3-tier priority chain and updates the scene.
JSON-safe copy of the live rendering settings (the embedder API's
getRenderingSettings()). A copy, so a consumer cannot mutate the
panel's state behind its back.
Apply a partial settings override programmatically — the one path a
scene's authored viewer_config and the embedder API's
setRenderingSettings() share, so a remote controller can set exactly
what an author can bake, with the same validation and the same
side-effects (camera FOV/planes, navigation, DPR ceiling, post-processing).
Values go through validateRenderingSettings so NaN / Infinity /
out-of-range input clamps to defaults instead of reaching the renderer.
Unknown keys are ignored by validation. Nothing is persisted: like the
authored defaults, an override describes THIS session's scene, not a
user preference.
PrivatetriggerTrigger animation when parameters change
PrivateupdateUpdate clipping controls state based on dynamic clipping setting. When dynamic clipping is enabled:
Update fly speed UI slider range and value based on scene scale. Called after scene data loads and scale is known.
PrivateupdateRe-range the near/far sliders from the scene scale.
Their authored range is ABSOLUTE (near 0.0001–10, far 1–100000) while
every value they ever show is scene-relative, so on any scene that is not
roughly 100 world units across the two disagree. The visible symptom is
under dynamic clipping, where the sliders are read-only live readouts: at a
framed camera on a diagonal-100 scene near is ~44, so the number input
reads 44 truthfully while <input type=range> clamps its own value and
pins the thumb at the 10 end. On a micron-scale scene the whole useful
range collapses below the 0.0001 minimum instead.
Ranged off the same scene diagonal the rest of the scale-aware machinery
uses, and bracketing what the clipping policy can actually produce:
near bottoms out at MIN_NEAR_RADIUS_FACTOR · R (the ortho floor) and
tops out near the framed distance; far reaches dist + R at the
zoom-out limit. Mirrors the fly-speed re-ranging directly above — same
trigger, same structural cast, same reason.
The STEP is not simply the range minimum, because the GUI derives the
displayed decimal count from String(step) (slider-kit/format.ts).
A scene-derived step carries float noise into that string — String(1.05e-4)
is "0.00010499999999999999", which renders every value with TWENTY
decimals. decimalsForStep handles exponential notation, but it cannot
distinguish meaningful precision from that binary float noise, so
decadeStep hands it a clean value; see that helper for the exact bounds.
PrivateupdateApply control-type-driven visibility to the panel's camera controls.
The navigation parameter controls themselves now live in the Navigation
rail popover; the only control-type-dependent UI left in this panel is the
FOV row, which is irrelevant under the ortho (orthographic) projection.
Called on show/sync and after a control-mode switch (syncCurrentState).
Save current settings to localStorage. Public so the rail popovers
(navigation / performance) persist through this panel's per-scene key —
the shared settings object stays the single source of truth.
PrivateloadLoad settings from localStorage and apply them to GUI / managers.
Sync current state from scene manager This ensures the GUI reflects the actual state when opened
Sync only the live camera FOV and its derived preset into settings.
PrivateapplyApply current settings to the rendering pipeline. Delegates to a pure helper.
Show the rendering controls panel.
Syncs current state from scene/post-processing managers before showing to ensure GUI displays accurate values. Adds click-outside handler for better focus management.
Triggered by R key when controls are hidden.
Hide the rendering controls panel. Returns focus to the canvas so keyboard shortcuts keep working. Triggered by R or Escape.
Check if rendering controls panel is currently visible.
true if panel is shown, false if hidden
PrivateupdateUpdate the cinematic mode checkbox to reflect the current state. Called after toggleCinematicMode or when 'C' key is pressed.
Toggle cinematic mode (film-like visual preset). Delegates to CinematicModeController. Triggered by the C key.
Clean up GUI resources and remove from DOM.
Destroys the GUI instance. Should be called when rendering controls are no longer needed (e.g., application teardown).
After calling dispose(), the RenderingControls instance cannot be reused.
Advanced rendering parameters GUI for real-time visual control.
Provides comprehensive UI for controlling:
Features:
Example