mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-08 19:50:23 -04:00
Fix an oversight in the last commit that caused face duplication at chunk borders.
This commit is contained in:
parent
2f52e9923b
commit
e358832f2f
@ -86,5 +86,4 @@ void main() {
|
||||
fragColor.a = 1;
|
||||
|
||||
fragColor.rgb += texture(emissionSampler, textureCoords).rgb;
|
||||
// TODO: Update the depth.
|
||||
}
|
||||
|
@ -928,6 +928,8 @@ pub const meshing = struct {
|
||||
if(neighborMesh.generated) {
|
||||
var additionalNeighborFacesOpaque = std.ArrayList(FaceData).init(main.threadAllocator);
|
||||
defer additionalNeighborFacesOpaque.deinit();
|
||||
var additionalNeighborFacesVoxel = std.ArrayList(FaceData).init(main.threadAllocator);
|
||||
defer additionalNeighborFacesVoxel.deinit();
|
||||
var additionalNeighborFacesTransparent = std.ArrayList(FaceData).init(main.threadAllocator);
|
||||
defer additionalNeighborFacesTransparent.deinit();
|
||||
var x3: u8 = if(neighbor & 1 == 0) @intCast(chunkMask) else 0;
|
||||
@ -963,7 +965,11 @@ pub const meshing = struct {
|
||||
}
|
||||
try additionalNeighborFacesTransparent.append(constructFaceData(block, neighbor, otherX, otherY, otherZ, false));
|
||||
} else {
|
||||
try additionalNeighborFacesOpaque.append(constructFaceData(block, neighbor, otherX, otherY, otherZ, false));
|
||||
if(blocks.meshes.model(block).modelIndex == 0) {
|
||||
try additionalNeighborFacesOpaque.append(constructFaceData(block, neighbor, otherX, otherY, otherZ, false));
|
||||
} else {
|
||||
try additionalNeighborFacesVoxel.append(constructFaceData(block, neighbor, otherX, otherY, otherZ, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(canBeSeenThroughOtherBlock(otherBlock, block, neighbor ^ 1)) {
|
||||
@ -983,7 +989,7 @@ pub const meshing = struct {
|
||||
}
|
||||
}
|
||||
try neighborMesh.opaqueMesh.replaceNeighbors(neighbor, additionalNeighborFacesOpaque.items);
|
||||
try neighborMesh.voxelMesh.replaceNeighbors(neighbor, additionalNeighborFacesOpaque.items);
|
||||
try neighborMesh.voxelMesh.replaceNeighbors(neighbor, additionalNeighborFacesVoxel.items);
|
||||
try neighborMesh.transparentMesh.replaceNeighbors(neighbor, additionalNeighborFacesTransparent.items);
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user