Merged
Conversation
Contributor
Author
|
ok I'm marking this as ready, what follows will be fixing any bugs we might find in further testing. |
Contributor
Author
|
I've fixed a small bug with the flooded cave heuristic and added detailed documentation to the PR and the fluid renderer class itself. |
78b2d82 to
9c9b755
Compare
9c9b755 to
4813513
Compare
34b6463 to
e4bed5b
Compare
IMS212
approved these changes
Mar 21, 2026
Member
IMS212
left a comment
There was a problem hiding this comment.
Seems fine to me. Not very knowledgeable about fluid rendering, though.
Contributor
Author
|
Thanks! I've done a few rounds of testing and feedback. If something significant pops up after release, we can fix it. |
…he fluids towards each other unless they're actually connected
move occlusion test methods out of BlockOcclusionCache and rename to ShapeComparisonCache,
…dundant checks and methods, simplify methods where possible
…of thin flowing water end-pieces
add comments
…ally reduce visibility as available
refactor flooded cave heuristic iteration behavior, make inner and outer up quad independently activated for better results in some cases
…logged blocks and hidden fluid culling. allow using both the new and old fluid renderer implementation to compare
… when breaking blocks
e4bed5b to
dfbbd28
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactors the fluid renderer to improve fluid shaping in a variety of situations. Profiling shows that the performance impact appears to be negligible.
Screenshots are ordered dev and then this patch.
Regular water slopes look the same.




Water slopes are nearly identical. I experimented with changing the sloping behavior and it didn't work out well.


Water shaping around stairs (foreground) and between stairs (further back): Water height doesn't propagate through the closed sides of block faces, fixing issues with unnecessarily bent water faces and water connecting to waterlogged blocks where it shouldn't.




Fixes #1211
The cave heuristic has been refined to search 2 blocks around and 1 block up (compared to 1 block around and 1 block up). This improves the appearance of inward up face culling somewhat. Player builds are still somewhat weird but generally improved.




To make the presentation more self-consistent and to avoid situations where seams in the fluid are visible from air spaces that the player could inhabit, some cases now have more fluid quads than before. In other cases, less faces are shown to make glass rendering more consistent. Glass being right above water doesn't constitute enough "air" to make it render inwards facing quads, but outwards facing quads will render to ensure the fluid is visible when viewing it through the glass from above.
Fixes #2470, nearly completely, to the point where I would call it fixed.
Fixes #2935 by providing a feasible yet pretty good cull heuristic.
Fixes #2947 by hiding down-facing fluid up quads against glass in all reasonable cases.
Outward up faces are now culled with the refined cave heuristic. This slightly increases rendering performance if there's a lot of flooded visible caves. I have reports of increased fps anywhere up to around 2 to 6%.


The test for bottom quad occlusion to show inward water quads on air, but not on glass for example. By using the same test for overlays as the sides, this more consistently shows and hides the inward bottom face.


Fixes #1210
Fixes #1212
Fixes #3523