Skip to content

The specular history is held to its neighbourhood on animated shading alone - #287

Merged
yujiaxu-ops merged 1 commit into
mainfrom
specular-clamp-removed
Nov 27, 2026
Merged

yujiaxu-ops merged 1 commit into
mainfrom
specular-clamp-removed

Conversation

@yujiaxu-ops

@yujiaxu-ops yujiaxu-ops commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

What

stemporal clamped a reflection's history into the band of this frame's nine samples in three cases: while the lighting changes, where a reflection moves against its surface, and on animated shading. This removes the first two and keeps the third.

  • The change chart already follows a change of the lighting; at one sample a pixel the band also cut light that comes by rare bright samples (reflections read dark) and flickered with them.
  • On animated shading (waves) the band stays: it is the only thing that follows a normal that moves, and without it running water blurs (numbers below).

One condition in live.wgsl (held), comments and docs/RUNTIME.md. No constant goes: all are still used by the animated case. The kernel is untouched.

Measured (before -> after, one machine)

main this
bench-object-ghosting --scene orb, dE mid / end / +0.1 s / +0.3 s 9.48 / 8.30 / 4.67 / 2.94 9.44 / 7.45 / 4.30 / 2.90
the same, trail px 334 / 393 / 121 / 63 326 / 233 / 63 / 40
bench-temporal --shot edit, 'lamp on, bounce': dE at 32 frames, frames to settle 1.64, 256 1.48, 128
the same, floor beside the sign, dE at 32 frames (off / on) 0.90 / 0.88 0.79 / 0.79
bench-temporal --shot water, reflections, time held / running 3.22 / 12.45 3.22 / 12.45
bench-ghosting --quick --check 5 ok 5 ok, the same numbers

The other rows of the edit shot are within 0.03.

Not taken: the band off on animated shading too. The water's reflections then read 1.16 / 20.58 (time held / running) for 3.22 / 12.45.

Heavy clips (main -> this; dE / SSIM against the offline render, flicker)

main this
zero-day 3.54 / 0.857, 2.77 3.32 / 0.847, 2.05
bistro-crowd 3.58 / 0.827, 1.92 3.48 / 0.830, 1.97
jewellery 2.21 / 0.929, 1.62 2.35 / 0.925, 1.45
foliage 0.87 / 0.989, 1.50 0.83 / 0.989, 1.50
tokyo 2.29 / 0.962, 0.47 2.32 / 0.962, 0.46

The six other clips with a quality score read the same. Worse: jewellery's dE (+6 %, with its flicker -10 %) and the crowd's flicker (+3 %).

A frame's GPU time summed over twelve clips: 93.52 ms against 93.58 on main (-0.1 %), each clip within 0.5 %.

Checks

  • Unit tests, hardware and software traversal: 286 pass, as main.
  • Render tests: hardware 273 of 273; software 249 of 273, the same 24 that fail on main.

🤖 Generated with Claude Code


Note

Medium Risk
Changes live specular temporal behaviour for lighting and camera motion (ghosting vs. brightness), but leaves water animation on the old path and benchmark tables document expected deltas.

Overview
Specular temporal filtering no longer clamps reflection history to the nine-sample neighbourhood band when lighting is changing or when reflections slide on rough surfaces—those cases now rely on the chart alone. The neighbourhood band (Karis-style clamp) remains only for animated shading (waves/ripples: albedo.w > 1.5 and gloss), where the normal moves each frame and the chart does not track what is reflected.

In stemporal, held is narrowed from live || anim || parallax-on-rough to anim only, so the heavy 9-tap clamp path runs just on that case; SPEC_ANIM_RARE is always used in the band width there since non-animated pixels never enter the clamp. Comments in live.wgsl and docs/RUNTIME.md are rewritten to match and include 2026-11-27 bench numbers (improved orb ghosting trails, faster edit-shot settle, water unchanged when the band stays on anim).

Reviewed by Cursor Bugbot for commit c1cb45c. Bugbot is set up for automated code reviews on this repo. Configure here.

… alone

`stemporal` clamped a reflection's history into the band of this frame's nine
samples in three cases: while the lighting changes, where a reflection moves
against its surface, and on animated shading. The first two go: the change
chart follows them already, and at one sample a pixel the band cut light that
comes by rare bright samples and flickered with them. On animated shading
(waves) it stays: without it running water blurs.

Before -> after, this machine:
- bench-object-ghosting --scene orb, dE at mid / end / +0.1 s / +0.3 s:
  9.48 / 8.30 / 4.67 / 2.94 -> 9.44 / 7.45 / 4.30 / 2.90; trail
  334 / 393 / 121 / 63 -> 326 / 233 / 63 / 40 px
- bench-temporal --shot edit: 'lamp on, bounce' settles in 128 frames for
  256, the floor beside the sign dE 0.9 / 0.88 -> 0.79 at 32 frames, the
  other rows within 0.03
- bench-temporal --shot water, bench-ghosting --quick --check: the same
- not taken, the band off on animated shading too: the water's reflections,
  time held / running 3.22 / 12.45 -> 1.16 / 20.58

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@yujiaxu-ops
yujiaxu-ops merged commit 89cbffc into main Nov 27, 2026
9 checks passed
@yujiaxu-ops
yujiaxu-ops deleted the specular-clamp-removed branch November 27, 2026 03:13
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