-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Fluid Shaping #2931
Open
douira
wants to merge
29
commits into
CaffeineMC:dev
Choose a base branch
from
douira:fix-waterlogging-slants
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Improve Fluid Shaping #2931
+619
−355
Conversation
This file contains 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
…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
ok I'm marking this as ready, what follows will be fixing any bugs we might find in further testing. |
I've fixed a small bug with the flooded cave heuristic and added detailed documentation to the PR and the fluid renderer class itself. |
refactor flooded cave heuristic iteration behavior, make inner and outer up quad independently activated for better results in some cases
douira
force-pushed
the
fix-waterlogging-slants
branch
from
December 22, 2024 00:23
78b2d82
to
9c9b755
Compare
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