Skip to content

fix(website): persist parametric shadows + FPV walk position in the scene URL#74

Merged
apresmoi merged 3 commits into
mainfrom
fix/gallery-scene-url-shadows
Jun 21, 2026
Merged

fix(website): persist parametric shadows + FPV walk position in the scene URL#74
apresmoi merged 3 commits into
mainfrom
fix/gallery-scene-url-shadows

Conversation

@apresmoi

@apresmoi apresmoi commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

The gallery scene-URL (?scene=) already captured camera/orbit, lighting, and basic shadow toggles — but two things were lost when sharing a link:

1. Parametric shadow settings (added in #72) were never serialized. Now round-tripped: shadowParametric (sp), shadowDefinition (sd), shadowStyle (sst, vector/pixel), shadowFollowAnimation (sfa). Also fixed a latent bug — selfShadow was serialized but missing from BOOLEAN_OPTIONS, so it failed to decode on reload.

2. FPV walk position. In first-person, WASD moves the camera eye, but FPV is authoritative and never echoed its per-frame writes to React state, so the walked-to spot wasn't in the link. Now a debounced (~900ms settle) listener syncs the resting pose — storing the eye position (getOrigin()) as target so FPV re-seeds to that spot on reload. The camera-apply effect skips FPV mode so this write never fights the live controls. (Throttled on settle, not per frame, as discussed — you rarely leave FPV mid-step.)

Verified end-to-end: set pixel + def 60 + azimuth → link restores them; enter FPV, walk forward, let it settle → the target token updates in the link. pnpm build:website green.

@apresmoi apresmoi changed the title fix(website): encode parametric shadow settings in the shareable scene URL fix(website): persist parametric shadows + FPV walk position in the scene URL Jun 21, 2026
@apresmoi apresmoi merged commit 0e184ee into main Jun 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant