mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-11 05:19:18 -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.a = 1;
|
||||||
|
|
||||||
fragColor.rgb += texture(emissionSampler, textureCoords).rgb;
|
fragColor.rgb += texture(emissionSampler, textureCoords).rgb;
|
||||||
// TODO: Update the depth.
|
|
||||||
}
|
}
|
||||||
|
@ -928,6 +928,8 @@ pub const meshing = struct {
|
|||||||
if(neighborMesh.generated) {
|
if(neighborMesh.generated) {
|
||||||
var additionalNeighborFacesOpaque = std.ArrayList(FaceData).init(main.threadAllocator);
|
var additionalNeighborFacesOpaque = std.ArrayList(FaceData).init(main.threadAllocator);
|
||||||
defer additionalNeighborFacesOpaque.deinit();
|
defer additionalNeighborFacesOpaque.deinit();
|
||||||
|
var additionalNeighborFacesVoxel = std.ArrayList(FaceData).init(main.threadAllocator);
|
||||||
|
defer additionalNeighborFacesVoxel.deinit();
|
||||||
var additionalNeighborFacesTransparent = std.ArrayList(FaceData).init(main.threadAllocator);
|
var additionalNeighborFacesTransparent = std.ArrayList(FaceData).init(main.threadAllocator);
|
||||||
defer additionalNeighborFacesTransparent.deinit();
|
defer additionalNeighborFacesTransparent.deinit();
|
||||||
var x3: u8 = if(neighbor & 1 == 0) @intCast(chunkMask) else 0;
|
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));
|
try additionalNeighborFacesTransparent.append(constructFaceData(block, neighbor, otherX, otherY, otherZ, false));
|
||||||
} else {
|
} 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)) {
|
if(canBeSeenThroughOtherBlock(otherBlock, block, neighbor ^ 1)) {
|
||||||
@ -983,7 +989,7 @@ pub const meshing = struct {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
try neighborMesh.opaqueMesh.replaceNeighbors(neighbor, additionalNeighborFacesOpaque.items);
|
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);
|
try neighborMesh.transparentMesh.replaceNeighbors(neighbor, additionalNeighborFacesTransparent.items);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user