Skip to content
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

Fix Fluid Occlusion For Waterlogged Blocks #2907

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

douira
Copy link
Collaborator

@douira douira commented Dec 3, 2024

Fixes fluid occlusion by using voxel shape comparison with the waterlogged block using BlockOcclusionCache. Using isFaceSturdy was wrong for occlusion purposes since it deals with hitboxes and not what is rendered. Thanks to @XFactHD for clearing this up.

Fixes #2699

I've also made a 1.21.1 branch of this for testing purposes since FramedBlocks, which I was using to reproduce the issue, isn't available on the latest Minecraft version that dev uses. When backporting this to 1.21.1, you can use the commit on that branch, which slightly differs because of changes to getFaceOcclusionShape.

From my testing it doesn't regress the other fluid occlusion issue #2606. Visual discontinuities arising from water flowing along a row of slabs getting culled suddenly once its height goes below half a block are normal and exist in both upstream Sodium and vanilla.

@jellysquid3
Copy link
Member

This patch looks good outside of the aforementioned comments.

@douira
Copy link
Collaborator Author

douira commented Dec 4, 2024

Resolved review items by using the existing utility methods that check for empty or full shapes.

@jellysquid3 jellysquid3 merged commit d818a6e into CaffeineMC:dev Dec 4, 2024
1 check passed
@jellysquid3
Copy link
Member

Thanks!

@douira douira deleted the fix-fluid-occlusion branch December 4, 2024 18:57
jellysquid3 added a commit that referenced this pull request Dec 4, 2024
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.

Water is not rendered in some cases with Framed Blocks (occlusion when waterlogged)
2 participants