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

Node boxes with ±0.5 size z-fight with liquid #15778

Open
ryvnf opened this issue Feb 11, 2025 · 4 comments · May be fixed by #15783
Open

Node boxes with ±0.5 size z-fight with liquid #15778

ryvnf opened this issue Feb 11, 2025 · 4 comments · May be fixed by #15783
Labels
Bug Issues that were confirmed to be a bug @ Client / Audiovisuals

Comments

@ryvnf
Copy link
Contributor

ryvnf commented Feb 11, 2025

Luanti version

Luanti 5.11.0-dev-29cfb6eff (Linux)
Using LuaJIT 2.1.0-beta3
Built by GCC 12.2
Running on Linux/6.1.0 x86_64
BUILD_TYPE=Release
RUN_IN_PLACE=0
USE_CURL=1
USE_GETTEXT=1
USE_SOUND=1
STATIC_SHAREDIR="/usr/local/share/luanti"

Operating system and version

Debian GNU/Linux 12 (bookworm)

CPU model

No response

GPU model

No response

Active renderer

No response

Summary

A similar problem has been reported for "allfaces" previously #9324. #13569 suggests that this was fixed in 5.7.0, then broken in 5.8.0-dev and fixed again. #9324 should probably be closed. The problem does however also exist with nodeboxes which this issue is about.

Since it is so common for nodeboxes to specify ±0.5 as their size, this affects pretty much all games. So I think it should be fixed in the engine.

I think one possible solution is to offset the liquid face by the polygon offset depth bias as mentioned in #15634 so it is not drawn directly on top of a nodebox of 1 unit width. Alternatively the size of nodeboxes with borders at ±0.5 could automatically be made larger by the polygon offset depth bias but that is more likely to cause problems with mods that uses overlays on top of nodeboxes (like decorated pots in Mineclonia).

Steps to reproduce

Start the Development Test game and place some of the nodebox test nodes underwater. See attached screenshot.

Image

It looks worse for nodes which have higher contrast to water, like many nodes in Mineclonia.

@ryvnf ryvnf added the Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible label Feb 11, 2025
@sfan5 sfan5 added @ Client / Audiovisuals Regression Something that used to work no longer does labels Feb 11, 2025
@sfan5
Copy link
Collaborator

sfan5 commented Feb 12, 2025

Any chance you could bisect this?

@ryvnf
Copy link
Contributor Author

ryvnf commented Feb 13, 2025

I tried bisecting and found that the problem exists in 5.5.0. Unfortunately I get compilation errors which I struggle to resolve when going further back.

@sfan5 sfan5 removed the Regression Something that used to work no longer does label Feb 13, 2025
@sfan5
Copy link
Collaborator

sfan5 commented Feb 13, 2025

Good enough. I was mainly worried that some recent change caused it.

@ryvnf ryvnf linked a pull request Feb 13, 2025 that will close this issue
@ryvnf
Copy link
Contributor Author

ryvnf commented Feb 13, 2025

I made a PR with a proposed fix #15783 just now. It culls the z-fighting faces like is done for leaves and glass.

@sfan5 sfan5 added Bug Issues that were confirmed to be a bug and removed Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug @ Client / Audiovisuals
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants