Skip to content

fix(TerrainBlending): prevent ground artifact shadows#1789

Closed
ParticleTroned wants to merge 1 commit into
community-shaders:devfrom
ParticleTroned:tb-offset-clean
Closed

fix(TerrainBlending): prevent ground artifact shadows#1789
ParticleTroned wants to merge 1 commit into
community-shaders:devfrom
ParticleTroned:tb-offset-clean

Conversation

@ParticleTroned
Copy link
Copy Markdown
Contributor

@ParticleTroned ParticleTroned commented Jan 31, 2026

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;
vs10

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

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

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted depth offset calculations to enhance rendering accuracy in shadow mapping and VR scenarios.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Shader Depth Bias
package/Shaders/Utility.hlsl
Reduced depth offset value from 5.0 to 1.25 in the OFFSET_DEPTH conditional code path, adjusting z-position bias for depth calculations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • alandtse
  • doodlum

Poem

🐰 A whisker-deep adjustment, so small yet precise,
From five-point-oh down to one-point-two-five's nice,
The shadows now shimmer with quantum delight,
As depth takes a softer, more subtle bite! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title describes the main change—reducing depth offset to prevent ground artifact shadows in terrain blending—which aligns with the PR's primary objective of fixing VR shadow artifacts.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@github-actions
Copy link
Copy Markdown

Using provided base ref: e9462c2
Using base ref: e9462c2
Base commit date: 2026-01-30T00:39:41-08:00 (Friday, January 30, 2026 12:39 AM)
No actionable suggestions for changed features.

@github-actions
Copy link
Copy Markdown

✅ A pre-release build is available for this PR:
Download

@alandtse alandtse changed the title fix(TerrainBlending): reduce offset depth to prevent ground artifact shadows fix(TerrainBlending): prevent ground artifact shadows Jan 31, 2026
@alandtse
Copy link
Copy Markdown
Collaborator

Please get some testers to confirm vr and flat. You can just point to the PR pre-release that was built.

Copy link
Copy Markdown
Collaborator

@doodlum doodlum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a real fix

@doodlum doodlum marked this pull request as draft February 1, 2026 19:13
@alandtse alandtse closed this Feb 3, 2026
ParticleTroned added a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request Feb 25, 2026
…rs#1789) from failed depth testing by re-asserting the OM depth override at late TB hook points via descriptor-scoped TB depth override
ParticleTroned added a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request Feb 25, 2026
…rs#1789) from failed depth testing by re-asserting the OM depth override at late TB hook points via descriptor-scoped TB depth override
ParticleTroned added a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request Feb 26, 2026
…rs#1789) from failed depth testing by re-asserting the OM depth override at late TB hook points via descriptor-scoped TB depth override
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.

3 participants