Skip to content

fix: PT final upsample is phase-aware (bilinear + depth joint bilateral)#98

Merged
proggeramlug merged 1 commit into
mainfrom
fix/pt-upsample-phase
Jul 15, 2026
Merged

fix: PT final upsample is phase-aware (bilinear + depth joint bilateral)#98
proggeramlug merged 1 commit into
mainfrom
fix/pt-upsample-phase

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

The trace-to-full upsample mapped every output pixel to its CONTAINING
trace texel by integer division and centred the kernel weights there -
no fractional phase. The lighting therefore reconstructed as
trace-texel-sized constant blocks, and because the trace grid rotates
its sample phase every frame (so the EMA integrates all four sub-
positions), the block boundaries CRAWLED whenever the camera moved.
On top of renderScale 0.5 (trace = quarter of output res) that crawl
was the residual pixelated-while-moving look indoors after the
PT-9/9b disocclusion fixes.

The taps now weight by tent distance from the CONTINUOUS trace-space
position (texel centres aligned), turning the pass into a true
bilinear-plus-depth joint bilateral: smooth gradients, stable under
the per-frame phase rotation, same 3x3 tap cost. The thin-geometry
epsilon fallback and the sky guard are unchanged, and the
full-res-trace path still degenerates to modulate-and-write.

Verified: both golden PT tests pass; the translating-dolly capture at
renderScale 0.5 shows smooth wall gradients with no block crawl at
unchanged fps.

Claude-Session: https://claude.ai/code/session_018574BdCfSjdpNK3WLgx1hP

Summary by CodeRabbit

  • Bug Fixes
    • Improved image upsampling in the realtime rendering pipeline.
    • Reduced sampling artifacts and improved visual smoothness when reconstructing final rendered results.

The trace-to-full upsample mapped every output pixel to its CONTAINING
trace texel by integer division and centred the kernel weights there -
no fractional phase. The lighting therefore reconstructed as
trace-texel-sized constant blocks, and because the trace grid rotates
its sample phase every frame (so the EMA integrates all four sub-
positions), the block boundaries CRAWLED whenever the camera moved.
On top of renderScale 0.5 (trace = quarter of output res) that crawl
was the residual pixelated-while-moving look indoors after the
PT-9/9b disocclusion fixes.

The taps now weight by tent distance from the CONTINUOUS trace-space
position (texel centres aligned), turning the pass into a true
bilinear-plus-depth joint bilateral: smooth gradients, stable under
the per-frame phase rotation, same 3x3 tap cost. The thin-geometry
epsilon fallback and the sky guard are unchanged, and the
full-res-trace path still degenerates to modulate-and-write.

Verified: both golden PT tests pass; the translating-dolly capture at
renderScale 0.5 shows smooth wall gradients with no block crawl at
unchanged fps.

Claude-Session: https://claude.ai/code/session_018574BdCfSjdpNK3WLgx1hP
@proggeramlug proggeramlug merged commit 1aedf68 into main Jul 15, 2026
7 of 10 checks passed
@proggeramlug proggeramlug deleted the fix/pt-upsample-phase branch July 15, 2026 12:26
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1bca2aa6-8257-42ac-9073-bb5c7bfaee34

📥 Commits

Reviewing files that changed from the base of the PR and between 491d9de and efe21f8.

📒 Files selected for processing (1)
  • native/shared/src/renderer/shaders/pt.rs

📝 Walkthrough

Walkthrough

The SVGF final pass replaces integer trace-texel mapping and B3-spline sampling with center-aligned sub-texel coordinates and tent weights. Depth-based weighting and surrounding bounds checks remain unchanged.

Changes

SVGF final-pass resampling

Layer / File(s) Summary
Sub-texel coordinate mapping and tent weighting
native/shared/src/renderer/shaders/pt.rs
cs_final computes center-aligned continuous trace coordinates with fractional offsets, then combines separable tent weights with the existing depth agreement term.

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pt-upsample-phase

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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