Skip to content

Conversation

@leMaik
Copy link
Member

@leMaik leMaik commented Dec 24, 2025

Well, this isn't the big refactoring I wanted to do in #1293, but at least it fixes #1236.

Fixing that bug, refactoring the octree finalization and changing how we handle water levels at once was a pain, so I just fixed the bug instead and at least improved variable naming.

Water angles/levels in Chunky don't match Minecraft's water angles, which are pretty complex and depend on the surrounding blocks per corner. If somebody wants to work on that, feel free. After putting many hours into that, I'll focus on other things for now.

This PR also fixes a finalization inconsistency that would cause water blocks below solid blocks to have full height at chunk borders (the two lava-reflecting blocks are water blocks at the chunk edge):
image

Having all water blocks below blocks have full height might be desirable for underwater world renders. However, this would cause full height water blocks to be shown at the water surface (similar to the image above).
Minecraft works around this by simply not rendering the water surface when viewed from below for such water blocks (no air in the 3x3 blocks above), but we can't have one-sided water surfaces in a path tracer. Maybe a follow-up PR could add an underwater mode where we apply full block height to all water blocks with a non-air block above them.

@leMaik leMaik changed the title Fix water again Fix water-related bugs Dec 24, 2025
Copy link
Member

@NotStirred NotStirred left a comment

Choose a reason for hiding this comment

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

👍

@leMaik leMaik merged commit c75e8f9 into chunky-dev:master Dec 26, 2025
1 check passed
@leMaik leMaik deleted the fix-water-again branch December 26, 2025 23:53
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 level is incorrect in 2.5.0 snapshots

2 participants