fix(unified water): reduce transition flicker#2367
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThree targeted fixes in UnifiedWater.cpp: deduplicate water-system objects during BuildWaterForBlock, refactor terrain detach child cleanup with null guards, and update BSWaterShader_SetupGeometry to refresh the shader plane per draw and tighten flowmap/displacement guards. ChangesUnified Water System Fixes
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 unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 OpenGrep (1.20.0)OpenGrep fatal error (exit code 2): [00.12][ERROR]: Error: exception Unix_error: No such file or directory stat src/Features/UnifiedWater.cpp 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. |
0d991a7 to
3333c5e
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@src/Features/UnifiedWater.cpp`:
- Around line 649-654: The code currently only clears block->waterAttached
inside the water-present branch, leaving stale state when block->water is null;
update the logic in the ClearWaterNodeChildren/DetachAllChildOccurrences section
so that block->waterAttached = false is executed unconditionally (i.e., move or
duplicate the assignment out of the if (water) branch) while keeping the
existing ClearWaterNodeChildren(water, globals::game::waterSystem) and
DetachAllChildOccurrences(*uw.gWaterLOD, water) calls intact and conditioned on
uw.gWaterLOD/water as before.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 58f724db-a1f3-4414-a470-0e9f8bcf87dc
📒 Files selected for processing (1)
src/Features/UnifiedWater.cpp
3333c5e to
8d36b63
Compare
|
✅ A pre-release build is available for this PR: |
SkrubbySkrubInAShrub
left a comment
There was a problem hiding this comment.
Not seeing any regressions, the obvious issues are still present. I guess it doesn't hurt.
Small follow-up to the recent Unified Water LOD ownership change.
On my setup, LOD water no longer disappeared, but after going into an interior and back out some water surfaces could flicker heavily until the area was reloaded. This keeps the current vanilla LOD ownership path, but cleans up some stale water state around terrain block transitions.
Changes:
TESWaterSysteminstead of only detaching the scene childrenAddLODWater/RemoveLODWaterhandoffBSWaterShaderProperty::planeduring water setup so stale transition data does not survive on one of the overlapping surfacesTesting:
ALL-VS2022locallySummary by CodeRabbit