fix(TerrainBlending): prevent ground artifact shadows#1789
fix(TerrainBlending): prevent ground artifact shadows#1789ParticleTroned wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThis PR adjusts a depth offset constant in the Utility shader file from 5.0 to 1.25, affecting depth bias calculations when the OFFSET_DEPTH preprocessor directive is defined. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 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 |
|
✅ A pre-release build is available for this PR: |
|
Please get some testers to confirm vr and flat. You can just point to the PR pre-release that was built. |
…rs#1789) from failed depth testing by re-asserting the OM depth override at late TB hook points via descriptor-scoped TB depth override
…rs#1789) from failed depth testing by re-asserting the OM depth override at late TB hook points via descriptor-scoped TB depth override
…rs#1789) from failed depth testing by re-asserting the OM depth override at late TB hook points via descriptor-scoped TB depth override
Issue:
In VR with Terrain Blending, a rectangular ground shadow artifact can appears (not always). The artifact moves with the HMD, is visible in the shadowmask path, and is gone when TB is toggled off. The acrtifact scales with TB’s depth mismatch; lowering the bias removes it while keeping blending stable.
Fix: Decreasing Depth Offset Utility.hlsl to vsout.PositionCS.z += 1.25; I could see no difference in blending on snow, rock etc when using values from 1.5 to 10.
--> I have not tested this extensively in flat! but in principle it should behave the same as VR.
Example: vsout.PositionCS.z += 10;

Example: vsout.PositionCS.z += 5; -> artifact only visible when looking straight down

Example: vsout.PositionCS.z += 1.25; -> artifact not visible anymore in HMD

Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.