Skip to content

Fix crack on animated tiles #15994

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cx384
Copy link
Contributor

@cx384 cx384 commented Apr 7, 2025

  • Fixes Crack overlay does not work for animated nodes #5317
  • It adds a map to the map block mesh, which contains information about the animated crack mesh buffers, and removes it from the maps for crack and animated nodes, such that it can be updated separately when the animation frame/crack frame changes.
  • It concatenates the crack string every time and does not cache it, like it is the case for non animated crack tiles.
    I suppose this is fine since there is only one cracked node at once.

To do

Ready for Review.

How to test

Start devtest, get some "Animated Test Node" (testnodes:anim) and dig them.

@cx384 cx384 added Bug Issues that were confirmed to be a bug @ Client / Audiovisuals labels Apr 7, 2025
AnimationInfo animation_info = AnimationInfo(p.layer);
animation_info.needUpdate(animation_time); // Update current frame
// Replace tile texture with the current animation frame
p.layer.texture = (*p.layer.frames)[animation_info.getCurrentFrame()].texture;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now set to the current frame and not to the first frame.
In the crack case I noticed flickering which can be fixed this way.
I guess for non crack tiles, it is not noticeable since the map block mesh gets updated rarely, but it is probably still better to use the current frame.

@cx384 cx384 added Bugfix 🐛 PRs that fix a bug and removed Bug Issues that were confirmed to be a bug labels Apr 7, 2025
@sfan5
Copy link
Collaborator

sfan5 commented Apr 8, 2025

Not that I want to say we shouldn't merge finished code, but with outlook on texture atlasing I think it would be good to redesign the crack rendering entirely.

@cx384
Copy link
Contributor Author

cx384 commented Apr 9, 2025

I agree, the crack (and tile animation) rendering should be redesigned, i.e. done by a shader, but I suppose this will not happen anytime soon, and this bug is very old. So I think it is still worth fixing it in our current implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crack overlay does not work for animated nodes
2 participants