Conversation
📝 WalkthroughWalkthroughThe pull request implements a normal prefiltering pipeline for Screen Space GI by introducing a dedicated compute shader that generates MIP-level encoded normal maps from the deferred normal/roughness texture. The GI shader now samples from these prefiltered normals instead of deriving them inline, with VR-specific sampling logic conditionally gated. Changes
Sequence Diagram(s)sequenceDiagram
participant CPU as CPU Setup
participant PrefilterCS as Prefilter<br/>Compute Shader
participant NormalTex as Normal<br/>MIP Textures
participant GICS as GI<br/>Compute Shader
CPU->>CPU: Create texNormal resource<br/>and UAV array
CPU->>CPU: Compile prefilterNormalCompute
Note over CPU: Rendering frame starts
CPU->>PrefilterCS: Dispatch prefilter compute<br/>(srcNormalRoughness → input)
PrefilterCS->>PrefilterCS: Decode normals from MIP 0<br/>2×2 neighborhoods
PrefilterCS->>PrefilterCS: Iteratively filter to<br/>MIPs 1–4
PrefilterCS->>NormalTex: Write encoded normals<br/>to UAV targets (u0–u4)
CPU->>GICS: Dispatch GI compute<br/>with prefiltered normals
GICS->>NormalTex: Sample srcNormal (t9)<br/>with dynamic MIP selection
GICS->>GICS: Perform horizon tests<br/>and GI sampling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
No actionable suggestions for changed features. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/Features/ScreenSpaceGI.cpp (1)
328-344: Nit: addtexNormalto the debug Buffer Viewer.The new prefiltered-normal mip chain is a prime candidate for visual inspection during tuning (e.g., verifying MIP encoding looks sane at mip 0 and doesn't degrade catastrophically at higher mips). Consider adding a
BUFFER_VIEWER_NODE(texNormal, debugRescale)alongside the existing entries.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Features/ScreenSpaceGI.cpp` around lines 328 - 344, Add the prefiltered-normal texture to the ImGui Buffer Viewer by inserting BUFFER_VIEWER_NODE(texNormal, debugRescale) into the TreeNode block so texNormal appears alongside the other debug entries; locate the ImGui::TreeNode("Buffer Viewer") block that declares static float debugRescale and append BUFFER_VIEWER_NODE(texNormal, debugRescale) with the other BUFFER_VIEWER_NODE(...) calls to enable visual inspection of the normal mip chain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/Features/ScreenSpaceGI.cpp`:
- Around line 328-344: Add the prefiltered-normal texture to the ImGui Buffer
Viewer by inserting BUFFER_VIEWER_NODE(texNormal, debugRescale) into the
TreeNode block so texNormal appears alongside the other debug entries; locate
the ImGui::TreeNode("Buffer Viewer") block that declares static float
debugRescale and append BUFFER_VIEWER_NODE(texNormal, debugRescale) with the
other BUFFER_VIEWER_NODE(...) calls to enable visual inspection of the normal
mip chain.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 863e315c-fac8-4187-8458-322b3678712d
📒 Files selected for processing (4)
features/Screen Space GI/Shaders/ScreenSpaceGI/gi.cs.hlslfeatures/Screen Space GI/Shaders/ScreenSpaceGI/prefilterNormal.cs.hlslsrc/Features/ScreenSpaceGI.cppsrc/Features/ScreenSpaceGI.h
|
✅ A pre-release build is available for this PR: |
|
I don't see any measurable improvement in perf, but ok. |
Summary by CodeRabbit