Skip to content

Commit bd351d7

Browse files
committed
Fix overdraw between surfaces at chunk boundaries
1 parent db96d89 commit bd351d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

client/shaders/surface-extraction/extract.comp

Lines changed: 3 additions & 0 deletions
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 non-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)