fix(TerrainBlending): reduce offset depth to prevent ground artifacts#1788
fix(TerrainBlending): reduce offset depth to prevent ground artifacts#1788ParticleTroned wants to merge 2 commits into
Conversation
📝 WalkthroughWalkthroughShader z-offset in the OFFSET_DEPTH path was reduced from 5.0 to 1.25. The WeatherEditor class gained a SupportsVR() override (duplicated declarations returning true), adding a public API indicating VR support. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Features/WeatherEditor.h (1)
20-30:⚠️ Potential issue | 🔴 CriticalDuplicate
SupportsVR()declaration will cause a compilation error.The same virtual override is declared twice (lines 20 and 30). This is invalid C++ and will fail to compile.
Remove line 30 to keep consistency with the other inline overrides in this class.
🐛 Proposed fix
virtual inline bool SupportsVR() override { return true; } virtual inline std::pair<std::string, std::vector<std::string>> GetFeatureSummary() override { return { "Development tool for editing weather, testing weather transitions, and managing weather-related feature settings.", { "Provides weather editing functionality", "Includes dynamic saving and loading of vanilla post processing and weather settings.", "Real-time editing and previewing of effects" } }; } - virtual bool SupportsVR() override { return true; } virtual void DataLoaded() override;
|
messed up my commits - will close and make a new PR. Sorry |
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.
Examples: vsout.PositionCS.z += 10;

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

Examples: 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.