Uh oh!
There was an error while loading. Please reload this page.
PT-6/7/8: skinned meshes in the TLAS, real motion vectors, correctness oracle - #94
Conversation
…lections) Skinned characters were invisible to every ray: skinning happened only in the vertex shader, so no posed geometry existed for a BLAS and the TLAS was scene-nodes-only. Now: - cache_model_if_static retains bind-pose CPU geometry for skinned meshes (+ STORAGE usage on their VBs) and their material params. - draw_model_cached_skinned registers each mesh as a PtDynamicDraw. - rebuild_instance_data appends a megabuffer window + InstanceGiData entry per dynamic draw (white albedo: hit shading multiplies the base-colour texture; the geo window gives interpolated normals/UVs). - A new compute pre-skin pass (PT_SKIN_WGSL, same palette blend as the raster VS) overwrites the window position/normal with posed WORLD-SPACE data - the joint palette bakes placement, so the TLAS instance transform is identity. - Per-slot BLASes rebuild every frame from the megabuffer windows (BLAS reads the same bytes the PT kernel interpolates: first_vertex/ first_index into the megabuffers, which gain BLAS_INPUT usage). - The TLAS gains the dynamic instances after the node instances and now recreates when the total exceeds the capacity it was built with (tlas_created_cap - wave spawns grow the count mid-run). Lumen HW probe trace sees the same instances, so skinned characters now contribute to GI as well. Verified: debug-6 traced-primary view shows the skinned player with interpolated normals (first time any skinned mesh appears in a traced view); RT gameplay clean at ~24 fps with waves live. Claude-Session: https://claude.ai/code/session_018574BdCfSjdpNK3WLgx1hP
…ction Skinned draws wrote EXACTLY zero velocity: no previous-frame joint palette existed anywhere and the cached path stamped prev_mvp with the current VP - enemies ghosted under TAA/TSR and invalidated their own path-tracer history every frame (young-history blur ring). - The joint palette is now double-buffered: set_joint_matrices_scaled takes a pairing key (the FFI anim handle) and stages last frame''s palette for the same model in lockstep, so both arenas share offsets. flush uploads both; joint bind group gains binding 1. - The scene VS reconstructs last frame''s world position from the prev palette and projects it through the EN-022 velocity-reference VP - skeletal AND locomotion motion now land in the velocity MRT. - The PT kernel binds the velocity MRT (binding 22): reprojection follows per-pixel motion when it is non-zero (TAA''s convention) and falls back to the camera prev_vp math otherwise, so moving skinned characters keep their SVGF history instead of resetting to 1 spp. Verified: debug-20 history heat shows no rejection hole on the animating player; RT gameplay clean. Claude-Session: https://claude.ai/code/session_018574BdCfSjdpNK3WLgx1hP
…NG seed fix) Two headless golden tests on a ray-query device (skip cleanly without one): pt_progressive (converged 300-frame static scene - transport regressions) and pt_realtime_motion (orbiting camera through the SVGF history - reprojection regressions of the prev_vp-transpose class that survived three human review rounds). BLOOM_UPDATE_GOLDEN=1 regenerates. The oracle caught a real bug before it was committed: the kernel seeded its RNG from taa_frame_index, which freezes when TAA is off - the sample sequence froze and progressive accumulation silently never converged (300 frames rendered the same image as 1). A player turning TAA off in settings would have hit this in-game. PT now keeps its own rolling pt_frame_index. DXC note: on Windows the tests need dxcompiler.dll/dxil.dll loadable (untracked local copies next to native/shared; gitignored). Docs: docs/pt/PT-6-7-8-skinned-tlas-motion-oracle.md covers this round. Claude-Session: https://claude.ai/code/session_018574BdCfSjdpNK3WLgx1hP
Uh oh!
There was an error while loading. Please reload this page.
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (12)
📝 WalkthroughWalkthroughAdds dynamic skinned meshes to path-tracing acceleration structures, tracks previous joint poses for motion vectors, introduces velocity-based PT reprojection, separates PT frame sequencing from TAA, and adds ray-query golden tests. ChangesSkinned PT pipeline
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant SkinnedDraw
participant Renderer
participant PreSkin
participant TLAS
participant PT
SkinnedDraw->>Renderer: register dynamic skinned draw
Renderer->>PreSkin: write posed vertices to PT megabuffer
PreSkin->>TLAS: provide updated BLAS geometry
TLAS->>PT: expose skinned instances for ray queries
Renderer->>PT: bind raster velocity and advance PT frame index
PT->>PT: reproject using velocity or prev_vp
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Summary
Closes the three headline gaps left after the PT roadmap:
Verified on the 760M: debug-6 traced view shows the skinned player with interpolated normals (first skinned mesh ever to appear in a traced image); debug-20 history heat shows no rejection hole on animating characters; all 9 golden tests pass; RT gameplay clean at ~19-24 fps.
Docs: docs/pt/PT-6-7-8-skinned-tlas-motion-oracle.md.
https://claude.ai/code/session_018574BdCfSjdpNK3WLgx1hP
Summary by CodeRabbit
New Features
Bug Fixes