Skip to content

Commit 7738b0f

Browse files
committed
Fix overdraw between surfaces at chunk boundaries
1 parent f6ba498 commit 7738b0f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: client/shaders/surface-extraction/extract.comp

+3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ bool find_face(out Face info) {
7676
// Flip face around if the neighbor is the solid one
7777
info.inward = self_mat == 0;
7878
info.material = self_mat | neighbor_mat;
79+
// If self or neighbor is a void margin, then no surface should be generated, as any surface
80+
// that would be rendered is the responsibility of the adjacent chunk.
81+
if ((self_mat == 0 && info.voxel[info.axis] == dimension) || (neighbor_mat == 0 && neighbor[info.axis] == -1)) return false;
7982
return (neighbor_mat == 0) != (self_mat == 0);
8083
}
8184

0 commit comments

Comments
 (0)