Skip to content

fix: water reflection flicker#2323

Merged
alandtse merged 4 commits into
community-shaders:devfrom
Dlizzio:water-reflection-fix
May 18, 2026
Merged

fix: water reflection flicker#2323
alandtse merged 4 commits into
community-shaders:devfrom
Dlizzio:water-reflection-fix

Conversation

@Dlizzio
Copy link
Copy Markdown
Contributor

@Dlizzio Dlizzio commented May 12, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved water blending calculations for more accurate visual representation in water shader rendering.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

📝 Walkthrough

Walkthrough

ISWaterBlend.hlsl refactors water history blending by replacing a hard historyMask threshold with computed historyCoverage. A new WaterBlend namespace defines threshold constants and helper functions to clamp the history mask into a normalized coverage value, which then gates and scales the blend between source and water history colors.

Changes

Water Blend History Coverage Refactor

Layer / File(s) Summary
Water coverage computation helpers
package/Shaders/ISWaterBlend.hlsl
Math.hlsli include added. WaterBlend namespace introduces WaterMaskThreshold, FullHistoryCoverageThreshold constants and SaturateRange(), GetHistoryCoverage() helpers to compute clamped history coverage from the sampled mask.
Apply coverage-based blending
package/Shaders/ISWaterBlend.hlsl
Blend condition now gates on historyCoverage > 0.0 and scales historyFactor by computed historyCoverage, replacing prior raw-mask threshold comparison.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly Related PRs

Suggested Reviewers

  • jiayev
  • alandtse
  • SkrubbySkrubInAShrub

Poem

🐰 A shader's mask grows soft and kind,
No longer hard, but gently defined,
Water blends with measured care,
Coverage flows through thinning air.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing water reflection flicker by refactoring the water blending history logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

No actionable suggestions for changed features.

@Dlizzio Dlizzio marked this pull request as ready for review May 15, 2026 11:53
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
package/Shaders/ISWaterBlend.hlsl (1)

48-93: Add an issue-closing reference in the PR description.

Since this is a bug-fix PR, consider adding Fixes #<id> / Closes #<id> for traceability and auto-close behavior.

As per coding guidelines, "When reviewing PRs... suggest adding appropriate GitHub keywords: 'Fixes #123' or 'Closes #123' for bug fixes".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package/Shaders/ISWaterBlend.hlsl` around lines 48 - 93, The PR is a bug-fix
for ISWaterBlend.hlsl (function main) but the PR description lacks an
issue-closing keyword; update the PR description to include a GitHub keyword
like "Fixes #<issue-number>" or "Closes #<issue-number>" referencing the bug
tracked for this change so the issue will auto-close when merged (e.g., add
"Fixes `#123`" to the PR body).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@package/Shaders/ISWaterBlend.hlsl`:
- Around line 48-93: The PR is a bug-fix for ISWaterBlend.hlsl (function main)
but the PR description lacks an issue-closing keyword; update the PR description
to include a GitHub keyword like "Fixes #<issue-number>" or "Closes
#<issue-number>" referencing the bug tracked for this change so the issue will
auto-close when merged (e.g., add "Fixes `#123`" to the PR body).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dde43e50-2958-42ab-bab7-efefa4d9553a

📥 Commits

Reviewing files that changed from the base of the PR and between cefdcde and eefb4d4.

📒 Files selected for processing (1)
  • package/Shaders/ISWaterBlend.hlsl

Comment thread package/Shaders/ISWaterBlend.hlsl
@alandtse alandtse merged commit 43eb987 into community-shaders:dev May 18, 2026
11 checks passed
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.

2 participants