Repository navigation
Viewer: daylight look for the colored appearance; Quality tiers and a sky panel - #1217
Conversation
…und, time and weather presets The colored appearance now renders with a built-in daylight atmosphere instead of the scene theme's lights and backdrop; themes only tint the monochrome (clay) appearance. - Sun from the site's location (parcel origin or dossier point; else a location the user granted with "Use my location", else a timezone guess) and its north rotation. Time-of-day presets (golden hour, midday, blue hour, night) are defined by sun elevation, not the clock. - Art-directed sky keyed on sun elevation, fbm clouds with weather presets (clear, fair, cloudy, overcast), analytic image-based lighting from the same sky (no PMREM), metered auto exposure and eye-like partial white balance. Lamps turn on from blue hour. - Neutral squared ground to the horizon (parcel slightly lighter), distance fog capped by the camera's far plane plus an angular horizon haze, so low views meet the sky softly. - Post-processing: Neutral tone mapping, daylight grade + white balance + vignette in every shading; rendered shading adds a quality tier — high: GTAO on indirect light, TRAA, bloom; medium: half-res GTAO + TRAA; low: none. TRAA resolves the composited picture (sky included) and keeps the direct backdrop away from geometry. - Solid shading stays Lambert: the daylight grounds follow it, the sky reaches it as a hemisphere light. Snapshots share the daylight grade and white balance; sheet captures pin a fair midday; transparent captures pin a fair midday and keep their alpha. - Built only for hosts with a presentation (canonical/bake renders keep the plain path); a plugin atmosphere mounted later still takes precedence. - Display menus: Time of day, Weather and Quality when colored; Scene theme when monochrome. The OSS toolbar gains the Colors toggle. Shared `DaylightMenu` exported from the editor. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…REM sky, tuned materials; three 0.187
Ports the rest of the enhanced-viewer reference so the colored appearance renders the same:
- Room light (game tricks, lib/daylight/rooms.ts): zone polygons → a per-level room-id map; window
glass portals (sky + ground bounce, rectangle form factor), the sky patch on the floor, the
internally reflected bounce, enclosure (sky IBL ×0.1 indoors), walkable openings between rooms
(doorways, arches) carrying the neighbour's light with a threshold crossfade, lamps as sized
analytic sources with a per-room soft cap and a virtual ceiling lamp in rooms without one. At
night lit rooms throw a gobo of their main lamp and a pane glow out of their windows, lamps
outside every room light exterior surfaces analytically, and window panes glow with their
room's lamps. Built from the live scene (registry + node data) or a baked artifact's identity
tree, rebuilt after edits (uniforms/textures only, no recompiles), fed into the material
lighting through getGI/getAO. The item-light pools hand their lamps to it instead of mounting
point lights in daylight.
- Materials (one prototype hook, daylight renderer only): albedo range 40–243, EON rough diffuse
on matte surfaces, night emission boost for lamp shades, tuned glass (distance/Fresnel opacity,
near-mirror, night glow).
- Sky environment is a PMREM of the visible sky (aureole, no disc) at ×1.15; one shadowed key
(sun, or the moon below 1°) with the reference bias/normal bias/radius, a light-space frustum
fit and 4096/2048/1024 maps per tier; metered exposure from the zenith sky, +2 EV inside rooms
(room meter), room-aware white balance; display-space vignette; 6 km far plane and the
reference ground fade to the horizon.
- Quality tiers apply to both appearances and replace Solid shading (retired: the store always
resolves to rendered, saved Solid picks become Low): High = GTAO on indirect light + TRAA +
bloom, Medium = ½-res GTAO ×0.48 + TRAA, Low = FXAA (no AO), DPR caps 1.5/1.25/1. TRAA resolves
the composited picture. SSGI leaves the viewport.
- Edges: monochrome only, on/off. Display menus: Quality in both appearances; Time of day and
Weather when colored; Scene theme and Edges when monochrome.
- Fixes found on the way: the theme environment left scene.environmentIntensity at 0.6 under any
atmosphere (lit every atmosphere at 60%); themes no longer drive lamps in the colored
appearance; lamps that load late join the time of day; baked foliage is alpha-tested; the baked
site fill becomes the daylight parcel; `<Viewer daylight={false}>` replaces the implicit
`presentation={null}` switch for canonical renders.
- three 0.187.0 (patch re-applied to 0.187; normalView replaces transformedNormalView; test
doubles follow the new renderer internals).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… emitters follow their lamp - The metered exposure (up to ×4.6 at night) is for lit surfaces. Unlit scene materials (pool water, guides), the zone layer (fills, perimeter gradients), editor overlays and selection outlines are scaled by 1/exposure, so they keep their designed brightness instead of glowing (blown cyan pools, white floors and wall-base strips at blue hour, a veil over façades). - Lamp shades and bulbs follow their own lamp, as in the enhanced viewer: the exported hue at a fixed display brightness (×4 display white, ÷ exposure) while the lamp is on, dark when off, even by day. Meshes are tagged from the lamp feeds; the switch is per object (`userData.daylightLampOn`), so lamps sharing a material switch independently. Other emissive surfaces keep the night boost. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s keep their cone; only the key light - Lamp shades and bulbs follow their lamp through private node-material clones (the enhanced viewer's isolated emitters): emission = exported hue × display white ÷ exposure × that lamp's switch. Tagging meshes didn't reach glTF materials (the renderer converts them once, so the hook never recompiled) and switched-off lamps kept glowing. Clones are re-installed if an item swaps its materials and the originals come back when the daylight look leaves. - Exterior lamps keep their spotlight cone (half-angle = angle / 2, soft edge = softness, as the light pools read them): wall washers light their cones and pools instead of the whole façade. - In the daylight look only the key light is mounted: no moon slot, hemisphere or ambient light (they sat at 0 but still cost every material's shader). Co-Authored-By: Claude Opus 5.5 <[email protected]>
three r187 strips WebGPU's 256-byte row padding inside readRenderTargetPixelsAsync. The snapshot pipeline depadded again, so any capture whose width isn't a multiple of 64 px sheared into horizontal streaks. The stride now follows the readback's exact length (readbackRows), correct for both padded and tight buffers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…the ground The ortho shadow camera's depth was fitted to the casters alone, and three r187 reads a receiver beyond the far plane as fully lit, so long shadows were cut off square. Extend the depth down each light ray to the ground; a shadow keeps its caster's light-space x/y, so the map's texel density is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… indoors - The star hash read negative cell seeds as one unsigned value, leaving half the sky empty: offset the cells positive (seed kept under 2^24). Stars are now small round dots at jittered spots, the brightest few crossing the bloom threshold for a faint glow. - A camera over a level whose upper floors are hidden stood in those floors' rooms by height alone and was metered and white-balanced as a lamplit room. Only shown levels (and none above the focused one) count as indoors. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Quality gains Auto, the default: the tier the device's capabilities call for (WebGPU or not, software adapter, GPU model, memory, form factor), detected once the renderer is up, before the first frame. A manual pick still wins. - Time of day and weather move to a chip beside the compass (editor and viewer) opening a Sky panel: drag the sun along its arc for any time, presets, the live clock, cloud cover. The display menus point to it while it is mounted. - The atmosphere takes an exact time (site sun clock) or the live clock; lamps follow the sun only when it crosses into or out of the evening. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… view Outside, the meter read only moon and sky, so the exposure sat at its night cap and lamplit rooms seen from out there blew out hot orange, while inside they metered and white-balanced to their own light. - The outside meter blends in the lit rooms in view, weighted by the share of the frame each fills (fully when open from above, a little through windows); rooms only ever lower the exposure, so daytime views are unchanged. - Lamp light as drawn (not as metered) gives back most of what it is exposed above those rooms' indoor exposure, easing back to 1 indoors. - The white balance adapts towards the rooms' light by their pull on the meter. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…slowly - The chip takes the bottom dock's height and offset (editor 58 px, viewer 56 px, 24 px up) with the compass centred beside it, as in the design: a time button opening the panel and a weather button cycling the cloud cover. It drops its labels when the window-centred dock would crowd it. - Presets and Reset ease the sun along its arc and the scene with it, the short way round the clock: 1.5–3 s by distance, easing in and out; dragging or the keys take over at once. The arc is solid as far as the sun, dotted beyond. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…shade plainly Exterior lamps were lit with the rooms' metering value (log-compressed: a 7.2 cd garage sconce became 13.1), boosted ×1.2, and shaded with wrap (0.75·N·L+0.25), so a wall sconce painted bright hourglass cones up its own wall, edge-on and close. They now use the light's authored candela (capped by the compressed value, so physical-looking numbers stay tame), no boost, and plain N·L for spots, as the scene's real lights do; omni lamps keep a little wrap. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # packages/editor/src/i18n/locales/en-XA/messages.ts # packages/editor/src/i18n/locales/en/messages.ts # packages/viewer/src/components/viewer/glb-scene.tsx
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4295bd2. Configure here.
| tween = requestAnimationFrame(step) | ||
| } | ||
| tween = requestAnimationFrame(step) | ||
| } |
There was a problem hiding this comment.
Sun tween fights capture restore
Medium Severity
The sky preset ease is a module-level requestAnimationFrame loop that keeps calling setTimeOfDayMinutes until it finishes with setTimeOfDay. presentFinished never stops that loop, so a sheet capture that starts during the 1.5–3s ease still receives in-between times, and the tween’s done callback can overwrite the restore.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 4295bd2. Configure here.
| } | ||
| }) | ||
| return compact | ||
| } |
There was a problem hiding this comment.
Dock check reruns every render
Medium Severity
useClearOfDock’s useLayoutEffect has no dependency array, so every SkyControl render tears down and recreates a ResizeObserver, re-queries the dock, and remounts window listeners. Preset eases and sun-arc drags write timeOfDayMinutes on every frame, so this work runs at animation rate while the light is changing.
Reviewed by Cursor Bugbot for commit 4295bd2. Configure here.


What does this PR do?
Gives the viewer's colored appearance a physically based daylight look, and reworks its settings. The monochrome appearance is unchanged.
Daylight rendering (
@pascal-app/viewer)Settings (
@pascal-app/editor)How to test
Screenshots / screen recording
To be added before marking ready.
Notes
Checklist
bun devbun checkto verify)mainbranch🤖 Generated with Claude Code
Note
Medium Risk
Large changes to viewer lighting, post-processing, and UI state, plus a three.js minor upgrade that touches WebGPU readbacks and patched dependencies.
Overview
Introduces a physically based daylight look for the colored (textured) appearance and reorganizes how users control it. Solid/Rendered shading is replaced by Quality: Auto · Low · Medium · High (
renderQuality), wired through sharedQualityMenucomponents in the editor toolbar, viewer dock, and command palette.Display menus now branch on a Colors toggle (
textures): in colored mode users getDaylightMenu(or a link to the in-viewport control whenSkyControlis mounted); in monochrome mode they keep scene theme and a simplified edges on/off toggle instead of soft/strong edge modes.SkyControladds a bottom-left chip (beside the compass, aligned with the dock) with time, weather cycling, and a panel for sun arc, presets, live clock, and cloud cover. The editor mounts it when colored mode is on (desktop, normal editing); capturepresentFinishedresets lighting to fair midday and restores the user's time/weather afterward.three.js is upgraded to 0.187 (patched dependency and workspace overrides).
PostProcessingResourcesnow disposes effect nodes explicitly; ceiling-bracket tests stubdestroyAttributefor the new WebGPU path.Risk is concentrated in the rendering stack and dependency bump rather than auth or data handling.
Reviewed by Cursor Bugbot for commit 4295bd2. Bugbot is set up for automated code reviews on this repo. Configure here.