Explore a real capture with three.js r186's native WebGPU GaussianSplat and SPZLoader, inside a small Next.js + Tailwind app. No third-party splat renderer, backend, auth or API keys.
The bundled cave-lion capture runs in object mode: the camera orbits and zooms around the subject instead of flying away from it. Splat Walk also retains an environment mode for room-scale captures using the original free-flight controller.
Node.js 22+ and npm:
npm ci
npm run devOpen http://localhost:3000 in recent Chromium or Safari 26+ with WebGPU/hardware acceleration available. WebGPU needs HTTPS or localhost. Missing WebGPU shows WebGPU required; an exposed API with no usable adapter shows WebGPU unavailable. Both can be retried after browser capabilities change. Initialization, GPU-interruption and scan-load failures keep their own error messages.
npm run build
npm startRun the static/build release check before pushing:
npm run checkcheck runs TypeScript with no emit, the flat ESLint configuration, and a production Next build. For scan-source or HUD changes, also run the native-WebGPU browser regressions after that build:
npm run test:e2eThis starts and stops its own local production server at http://127.0.0.1:3107 and uses installed Google Chrome with a usable WebGPU adapter. Fourteen tests cover detail/file transitions, malformed links, recovery, and long-filename layouts at 1440×900, 390×844, 320×568 and 844×390. No browser is installed automatically and no unsafe WebGPU flags are used. SPLAT_WALK_BASE_URL targets an existing deployment instead; SPLAT_WALK_TEST_OUTPUT overrides the default system-temp splat-walk-e2e evidence folder. See QA acceptance.
For Vercel: import this repository, select the Next.js preset and leave the project root at the repository root. No environment variables are required. Build command: npm run build.
The bundled lion uses object mode:
- Drag with a mouse or trackpad to orbit around the lion. The subject remains the camera target.
- Mouse wheel or trackpad scroll dollies in and out within authored distance limits.
- Touch: one-finger drag orbits; two-finger pinch zooms.
- With the canvas focused, arrow keys orbit,
+/-zoom, and Home returns to the overview. - Hover or move near a ring to reveal its label. Click/tap a ring or its nearby splat surface to inspect it.
- Selecting a detail moves toward an authored camera composition for that feature. Direct orbit/zoom input can interrupt the camera motion immediately.
- The detail card includes cyclic Previous / Next tour navigation. Opened details are marked with a check and counted in the session-only
N / 3 founddisplay. - After all three details are discovered, Explore freely dismisses the completion prompt and Replay tour returns to the first guided detail.
- Closing with Close, Esc, or an empty-canvas tap leaves the camera at its current inspection pose. Overview is the explicit return to the authored starting view and does not clear discoveries.
- Reduced motion removes nonessential camera interpolation. Reload capture after an error retains discoveries; a full page refresh starts a new discovery session.
- Controls toggles the four-second interaction hint.
- Open scan in the header, or dropping an
.spzfile anywhere on the page, replaces the lion with that capture. The file stays in the browser; nothing is uploaded. ?scene=<url>loads a capture by link, for example/?scene=https://example.com/room.spz. Only HTTPS or same-origin URLs are used, and the host must allow CORS. Anything else falls back to the lion.- Other captures open in object mode, framed automatically: the camera targets the middle of the splat cloud, trimmed by 2% on each side of every axis to ignore stray floaters, and backs off until that trimmed volume fits the view. The lion's rings, tour and discovery counter are hidden, since their annotations only fit the lion.
- Captures get the same X half-turn as the lion (
SCAN_ROTATION). That orientation also displayed Spark's publicbutterfly.spzcorrectly. - Back to the lion returns to the bundled sample and starts a new discovery session. Unreadable files and unreachable URLs show the error card with that same option.
SCENE_MODE = "environment" preserves the original walkthrough controls: pointer-lock Explore, WASD movement, Q/E height, mouse/arrow look, drag-to-look, and split move/look touch controls.
The Safari pointer-lock note applies only to environment mode. In the recorded Safari 26.6.2 desktop pass for the earlier free-flight build, the first Esc dismissed Safari's own mouse-capture banner and a second Esc released the mouse. Object mode does not request pointer lock.
For keyboard navigation on macOS, enable Keyboard navigation in System Settings > Keyboard. Safari Settings > Advanced > Press Tab to highlight each item on a webpage controls Tab/Option-Tab behavior for clickable items. See Apple's keyboard navigation guidance. The dock uses native buttons; no browser or system preferences are changed by the app.
To preview a capture, use Open scan or ?scene= above. To ship one with authored framing and annotations instead of the lion:
- Capture Gaussian splats with Scaniverse or Polycam, not a textured mesh export.
- Clean in SuperSplat 3.0: crop, remove floaters and unnecessary background, and keep the scene at a sensible object/room scale.
- Export
.spz. If your editor only offers.ply/.splat, convert the cleaned export using Niantic's SPZ converter. The loader supports SPZ v1–v4. - Place the file in
public/scenes/, then changeSPZ_URLinlib/scene.config.ts, for example/scenes/my-room.spz. Public HTTPS URLs also work when their host allows CORS. - Choose
SCENE_MODE = "object"for an isolated subject or"environment"for a room/walkthrough. - For object mode, tune
OBJECT_CAMERA(target,yaw,pitch,radius, and radius/pitch limits) plus the named object sensitivity/damping constants. The controller derives its position from that subject-centered state and does not use arbitrary free-look quaternions. - For environment mode, tune
SPAWN_POSITION,LOOK_AT, and the existing fly/touch movement and look constants. The lion uses an X half-turn inSCAN_ROTATION; another scan may not. - Set
HOTSPOTSto{ position, label, description, camera?, framing? }.positionremains the world-space raycast/marker anchor.camerais the preferred object-mode presentation pose for the detail. Positions are world coordinates after the scan rotation, with Y up. - Adjust
HOTSPOT_RADIUSandMARKER_SIZEfor your units, then update the visible title, canvas label, attribution and share copy to match the scan.
During development, window.__splatWalk in the page's main-world console reports scene mode, camera coordinates, projected hotspot positions, last raycast point/source, revision and splat count. It is absent in production. A picked surface point helps place annotations.
app/page.tsx,app/layout.tsx: one App Router page plus canonical, Open Graph, Twitter and icon metadata.public/og.png,public/icon.svg,app/apple-icon.png: the committed 1200×630 real-scene share image and browser/touch icons.components/SplatScene.tsx: WebGPU renderer, scan, native raycasts, controller selection, rings, guided discovery state, accessible DOM HUD, responsive projection and resource cleanup.lib/object-controls.ts: subject-centered object orbit/dolly controls, damping, radius/pitch constraints, mouse/touch/keyboard input, overview reset and hotspot focus poses.lib/controls.ts: the preservedcreateFlyControls()environment controller for pointer-lock mouse, keyboard and two-zone touch input, plus the small sharedSceneControlscontract.lib/scene.config.ts: scene mode, scan URL/transforms, object and environment camera tuning, and annotations with authored camera poses.app/globals.css: Tailwind v4 and the dark museum/exhibition HUD palette.lib/scan-source.ts: the bundled/URL/file scan source type,?scene=parsing, and the automatic object framing for non-bundled captures.
The scan remains the visual treatment. Object mode keeps a stable subject target and derives camera position from yaw, pitch and radius with delta-time-aware damping. Hotspot selection changes the desired object-camera pose without blocking direct manipulation. Environment mode keeps the prior free-flight behavior.
renderer.setAnimationLoop owns the requestAnimationFrame-backed loop. DPR is capped at 2 desktop / 1.5 coarse-pointer, and rendering pauses in hidden tabs. The component cleans up source and generated geometries, materials, listeners, pending fetches and renderer resources. GPU loss ends the current attempt: the dead canvas is removed, pointer-lock state is cleared, and late loading/visibility callbacks cannot restart it. Retry creates a new renderer; app-initiated disposal does not replace the original error with a GPU-loss message.
A deliberate click invokes native Gaussian ellipsoid raycasting and selects a configured hotspot near the surface hit. Marker raycasting covers rings when no nearby surface qualifies. No mesh proxy or fake scan rendering.
The SPZ is fetched once per loading attempt. Byte progress uses the GET response's Content-Length when available; without a usable length it stays indeterminate. There is no separate HEAD probe.
The canonical public URL is https://splat-walk.vercel.app. Open Graph and Twitter cards use public/og.png, a real 1200×630 capture of the lion in the exhibition HUD rather than placeholder artwork. The image still represents the same lion/HUD world; share descriptions now describe orbit/zoom inspection rather than free flight.
The object-camera release (PR #6) has a rendered GO verdict covering desktop input, tour, responsive and reduced-motion paths, background/return, GPU-loss and HTTP-failure recovery in native WebGPU Chromium. Touch was CDP-emulated; physical touch, Safari and physical iPhone were not rerun. See the dated record.
Exercised in Chrome with the native WebGPU backend on a local dev server, with no application console errors:
- A dropped copy of the lion loaded as a file and auto-framed to about the authored overview. Title, canvas label and attribution showed its file name. The rings, counter and tour were hidden. Mouse-drag orbit and wheel zoom moved the camera.
- Open scan through the native file chooser, a same-origin
?scene=, and Spark's public HTTPSbutterfly.spz(4.0 MB) all loaded and framed correctly. - Error cases showed the error card with Back to the lion: a non-SPZ file ("invalid gzip data"), a same-origin 404, and a cross-origin URL without CORS. An
http:cross-origin?scene=was ignored and loaded the lion. - The lion's dock, Next and Escape flow still worked after returning to it. The 320×568 layout was checked with both the lion and a custom scan.
PR #9 fixes source-switch crashes while a lion detail is open, malformed URL-filename decoding, and long names pushing mobile controls off-screen. The full filename remains available in DOM text and title attributes while visual labels truncate to fit. All 14 browser regressions passed on the production build of code commit c9dcdeca1a694de9cd6561dbd001faa11e1f24e0; see the scoped evidence record. The PR release comment records deployment identity and post-merge public-site verification.
PR #10 records an iPhone 17 Pro Simulator and iPad Pro 11-inch (M5) Simulator pass on iOS 26.5 / Safari 26.5. Production loaded without horizontal overflow and correctly showed WebGPU unavailable because Apple Simulator exposed navigator.gpu but returned no usable adapter. Malformed and very long linked filenames kept the Safari page shell intact. Simulator cannot qualify splat rendering, orbit, pinch, hotspots or ready-state custom scans; see the scoped record.
The Phase 4–6 and final-hardening records below predate the object-camera iteration. They remain evidence for the renderer/recovery stack and the earlier free-flight behavior only:
- 195,099 splats rendered; the final normal load and interaction run had zero console warnings, errors or page errors.
- Native splat raycasting opened detail cards; discovery reached
3 / 3 foundand refresh reset the session. - Keyboard focus restoration, responsive layouts, reduced motion, missing-WebGPU and HTTP-failure retry paths were exercised.
- Single-fetch loading and explicit GPU-loss recovery were separately hardened and recorded.
| Record | Build tested | Scope |
|---|---|---|
| Object-camera evidence | PR #6 candidate family | Released object-camera GO record; coverage limits remain explicit. |
| Phase 4–6 evidence | Phase 4–6 candidate and production through 0ccea82 |
Earlier interaction, responsive layouts, keyboard/focus, reduced motion, metadata and release checks. |
| Single-fetch evidence and GPU-loss evidence | Local production build on fix/spz-single-fetch, code commit 7107471 |
One GET, streamed progress, real device destruction and GPU-process crash/retry. |
| Desktop device QA | Previous production, 0ccea82 |
Chrome 153 input/pointer lock and Safari 26.6.2 rendering/input for the free-flight build. |
| Physical iPhone QA | Previous production, 0ccea82 |
iPhone 12 Pro, iOS 26.6.1, Safari, portrait: earlier split-touch controls, reset, background/resume, console and network. |
Historical logs and screenshots retain their original labels and findings. Physical Android/tablet coverage was not recorded for the earlier release. Large-scene streaming/LOD, collision, multiplayer, auth, CMS and replacing the cave-lion sample remain outside this showcase scope.
Application code is MIT licensed.
The bundled public/scenes/lion.v3.spz is the unmodified 4,303,196-byte official three.js sample, licensed separately under CC BY 4.0, not MIT. Its source scene, shared by Renaud, credits Joanna Kobierska and depicts a reconstruction of a female cave lion. This viewer rotates the sample and adds annotations without modifying the asset. Preserve the sample's attribution when sharing it.
Native API references: