Skip to content

Live: moving objects leave no copies of themselves (uncovered history, locks, reflections); bench-object-ghosting - #155

Merged
doodlewind merged 4 commits into
mainfrom
object-ghosting
Nov 17, 2026
Merged

doodlewind merged 4 commits into
mainfrom
object-ghosting

Conversation

@doodlewind

Copy link
Copy Markdown
Collaborator

Moving objects left copies of themselves in the live view: dragging a device in an app (Pocket Bench's Tab5) left a line of its edge where the edge had been, one a frame, and copies of its screen's text; a glowing orb thrown over a polished floor left its light along its path in the floor's reflection for as long as the history. Camera motion was measured (bench-ghosting); object motion was not. Three causes, three changes in live.wgsl, and a bench for it.

1. The band an object uncovers keeps its history (the edge lines). Behind a moving edge the nearest of the nine samples is still the object, so those pixels take its motion and fetch its colour from a frame ago, and the clamp in motion keeps it (the object's colour is among the nine). The next frame the "gone from in front" test (judge) needs the history to lie outside the noisy one-sample range of what was uncovered too, and a rim half the object's light, half the wall's, does not: it stayed, fading over 16 frames, a line a frame.

  • The g-buffer now says whether a surface is a moving object's (GB.moves, the trace's motion_in w, kept in the roughness's sign: no new buffer).
  • judge: a sample whose own surface stands still and lies behind the moving surface that was nearest there is uncovered (not the nearest of the nine: that is still the object); and a "gone" whose surface in front was moving needs no colour test.
  • reject / upscale: a gone history goes in every output pixel its verdict reaches (it was blended bilinearly with the neighbours' verdicts, which left dashed lines).

2. Locks stayed where a moving object's detail had been (the text copies). A thin feature's lock (Lock) is carried by the two cameras alone, so a lock on a moving screen's text stayed where the text was for a jitter sequence (32 frames at the 0.5 floor), sparing the old light from the clamp and from the gone test. Now a lock on a moving surface is not carried (lock_carry), and a carried lock that lands on a moving surface is dropped (track).

3. A still surface's reflection did not follow what moved past it (the floor streak). The specular history picks the surface or the mirror-image history but never held either to this frame's neighbourhood; with the camera and the floor still nothing shortened it. Now, while the lighting is live (mode.z, which moving objects already set, as the diffuse anti-lag), it is clipped to the neighbourhood's mean ± SPEC_CLIP (2) deviations in YCoCg (Lumen's reflection temporal clamps its history the same way). Settled scenes are untouched.

New bench: node tools/bench-object-ghosting.ts [--scene device|orb]: the camera still, one object moved a pose a frame by host message; shots at the move's middle and 0 / 0.1 / 0.3 s after, against converged frames of the same pose (as bench-ghosting). Scenes in tools/object-ghosting/. Added to the R2 row of docs/WORKFLOW.md for temporal changes.

Results (0.5 floor, median of 3; mean dE / p95 / trail px over the swept band)

shot main branch
device slide, mid 0.66 / 1.55 / 14 0.49 / 1.18 / 2
device slide, end 0.78 / 2.33 / 10 0.51 / 1.29 / 2
device slide, +0.1 s 0.63 / 1.86 / 6 0.48 / 1.07 / 2
device lift + turn, mid 1.08 / 4.89 / 30 0.59 / 1.53 / 8
device lift + turn, end 0.98 / 4.46 / 15 0.41 / 1.46 / 1
device lift + turn, +0.1 s 0.77 / 2.90 / 10 0.37 / 1.17 / 0
orb throw, mid 16.37 / 39.81 / 614 12.98 / 29.07 / 656
orb throw, end 23.08 / 65.11 / 976 10.31 / 31.20 / 438
orb throw, +0.1 s 17.91 / 60.19 / 950 5.33 / 16.21 / 270
orb throw, +0.3 s 13.29 / 53.64 / 861 2.95 / 8.91 / 125

main | this PR: a dragged device's edge lines and text copies; a thrown light's copies and its streak in the floor's reflection, 0.1 s after it stopped

(The orb's remaining error is mostly its effect on diffuse lighting: the block's shadow on the wall lags a few frames, see below. Checked in the app it was reported from as well: Pocket Bench dragging its Tab5 shows no copies.)

Merge gate (R2)

Tier R2 (the live temporal passes). Main eb115c9 against this branch, same machine:

  • cargo test --release: 168 passed. npm run typecheck, npm test (173): pass.
  • test:render: 237 pass, 0 fail, 3 unsupported (main's run had 1 fail, geometry/grow-live "interrupted": a setup timeout, also seen once on the branch; not a picture).
  • bench-ghosting --quick --check Bistro: all ok, identical to main within 0.01 dE / 1 px (turn-mid 0.83 / 4 px, strafe-return 1.23 vs 1.24). --scene kabukicho: identical (turn-mid 1.92 vs 1.91, strafe-mid 2.73 vs 2.72).
  • test:layer-b: Bistro 2.93 / 0.865, Zero Day 3.36 / 0.821, voxel night 2.02 / 0.924 (main 2.01 / 0.925): pass.
  • bench-window (still-bistro, still-kabukicho, still-rooms, still-rooms-wide, still-glass, rooms-turn; the Bistro slice and Tokyo not run: this machine's asset store lacks the slice's Quaternius and Poly Haven models and the city): every value as main. A first version raised still flicker (Bistro 0.44 → 0.68, Kabukichō 0.70 → 1.42) by dropping every gone history whole; now only where what went was moving: 0.438 / 0.702 (main 0.438 / 0.700).
  • bench-object-ghosting --repeat 3: the table above.
  • Perf smoke (Bistro, 0.5 floor): no change measurable. The "drive gpu p50" line read +3 ms against the cached main baseline, but main's own binary run as "this" read the same +3.08 ms (the baseline was measured from a build in out/perf-base); measured the same way main / branch: still 7.46 / 7.56, moving 12.25 / 10.78–13.73 (run-to-run spread ±3 ms on this machine today), drive p50 10.57 / 10.68–10.84. The change adds a few ALU ops to three passes and no fetches but the nine g-buffer reads judge already made.

Known and not addressed here: a fast moving light's effect on diffuse lighting (a shadow it casts) still lags by a few frames (the diffuse history and anti-lag as they were); the band just behind a moving edge starts from this frame's samples (more aliased for a frame or two, as with any disocclusion).

🤖 Generated with Claude Code

…ar variance clipping while lighting is live); the orb case in bench-object-ghosting
…argin (heavy-tailed samples); docs: moving objects in the live view, the object-ghosting bench in the R2 gate
…t went was moving (a still scene's flicker as on main)
@doodlewind
doodlewind merged commit c946cc9 into main Nov 17, 2026
8 checks passed
@doodlewind
doodlewind deleted the object-ghosting branch November 17, 2026 15:07
doodlewind added a commit to threert/native-app-template that referenced this pull request Nov 17, 2026
…ev/ThreeRT#155): the thrown orbs' trails and their streaks in the floor

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yujiaxu-ops added a commit that referenced this pull request Nov 17, 2026
… frame (#157)

#155 counted every surface of a moving object as moving. A leaf in the wind
or a far walker moves less than a traced sample a frame: its edge has not left
its place among the nine samples, yet it was taken to uncover what lies behind
it every frame, so the history there was dropped and locks were not carried.
With the camera still, wind-blown foliage flickered 4.5 times as much as
before #155 (1.41 -> 6.30) and a crowd of 150 walkers twice (1.70 -> 3.30).

`GB.moves` now says: a moving object's surface that crossed a traced sample
this frame (its own motion on screen, the camera's taken out; `stemporal`).
`track` reads the same flag. The three rules of #155 are as they were for
anything that moves that far.

With this: foliage 1.41, the crowd 1.72. `bench-object-ghosting`, main ->
this (mean dE): device slide 0.49-0.54 -> 0.51-0.54, device lift 0.59-0.32 ->
0.62-0.35, orb throw the same (12.98 / 10.31 / 5.34 / 2.98). `bench-ghosting`
quick check on Bistro ok; `cargo test` 170, test-render 241.

Left: #155's specular clip also cuts a right history where something always
moves (the crowd against offline 3.66 -> 5.2 dE); off, the orb's gain goes
with it. It wants a short-term specular history to clip against; its own PR.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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