8 Commits

Author SHA1 Message Date
jessikitty 653980a52e iOS WebP: render as tracked DOM img overlay instead of WebGL texture
iOS won't animate a WebP inside a WebGL texture in any form. Render the
iOS/WebKit fallback as a real DOM <img> (animates natively) and project an
invisible 3D anchor's screen position onto it each frame, so it still tracks
distance/size and bobs. Flat 2D rather than in-scene, but animated + transparent.
2026-06-22 09:59:35 +10:00
jessikitty 25832dd58f Keep WebP animating on iOS by attaching the source img to the DOM
iOS pauses animation on a detached <img>, so the CanvasTexture sampled a
frozen frame. Attach the img hidden off-screen (opacity 0.01) so WebKit
keeps advancing the WebP; remove it on clear.
2026-06-22 09:53:36 +10:00
jessikitty 4cf8ec07a4 Animate WebP fallback on iOS via per-frame CanvasTexture
Three.js doesn't advance an animated-image Texture on iOS, so the WebP
showed as a static frame. Draw the animating <img> into an offscreen
canvas each frame and sample it through a CanvasTexture, keeping the ghost
in 3D (bob/scale/lookAt) and animated, with transparency preserved.
2026-06-22 09:48:17 +10:00
jessikitty 793a17dbdf Route iOS/WebKit to transparent WebP instead of opaque VP9 WebM
WebKit (all iOS browsers + desktop Safari) plays VP9 WebM but renders its
alpha as opaque black. SUPPORTS_WEBM_ALPHA now excludes iOS/Safari so those
devices fall through to the animated WebP fallback, which IS transparent.
Desktop Chromium/Gecko keep the WebM path.
2026-06-19 22:38:53 +10:00
jessikitty 6f8b67b583 Fix VP9-alpha transparency: drop sRGB on video texture, premultipliedAlpha off
The WebM carries real alpha (alpha_mode=1) but rendered opaque because the
VideoTexture was forced to SRGBColorSpace and the material assumed
premultiplied alpha, crushing transparent regions to black. Removing the
colorspace override and setting premultipliedAlpha:false keys the black out.
2026-06-19 22:00:03 +10:00
jessikitty b2a863bd80 Fix preview: map admin raw-row *_path fields to /uploads URLs
The /api/admin/ghosts endpoint returns raw DB rows (webm_path,
webp_path, image_path as bare filenames), not the public API's
camelCase URL shape. buildGhost now reads those and prefixes /uploads/,
so WebM video renders in the preview instead of falling through to the
procedural wisp.
2026-06-19 21:49:58 +10:00
jessikitty e81f779ea5 Fix preview.html encoding (store raw HTML, not base64) 2026-06-19 15:22:33 +10:00
jessikitty a8552592c7 Add admin-gated ghost preview page (/preview)
Camera-background single-ghost preview reusing the hunt's render path
(WebM VP9+alpha VideoTexture -> WebP/GIF -> procedural wisp). Login gate
matches admin; ghost list via JWT-protected /api/admin/ghosts. Dropdown
to pick a ghost, sliders for distance/size, camera toggle.
2026-06-19 15:20:17 +10:00