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

Avoid rendering invisible faces of simple nodeboxes #12262

Merged
merged 6 commits into from
May 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Avoid canceling opposite sides in adjacent transparent slabs
  • Loading branch information
x2048 committed May 4, 2022
commit 504e5bbb07ade082f38126180f8124cecaf2398a
8 changes: 5 additions & 3 deletions src/client/content_mapblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,12 @@ u8 MapblockMeshGenerator::getNodeBoxMask(aabb3f box, u8 solid_neighbors, u8 same

// Faces on opposite sides can cancel each other out if there is
// a matching neighbor of the same type
u8 sametype_mask =
((solid_mask & 3) == 3 ? 3 : 0) |
// Only cancel out faces in opaque nodeboxes.
u8 sametype_mask = (f->alpha == AlphaMode::ALPHAMODE_OPAQUE) ?
sfan5 marked this conversation as resolved.
Show resolved Hide resolved
(((solid_mask & 3) == 3 ? 3 : 0) |
((solid_mask & 12) == 12 ? 12 : 0) |
((solid_mask & 48) == 48 ? 48 : 0);
((solid_mask & 48) == 48 ? 48 : 0)) :
0;

// Combine masks with actual neighbors to get the faces to be skipped
return (solid_mask & solid_neighbors) | (sametype_mask & sametype_neighbors);
Expand Down