mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-15 23:39:25 -04:00
Revert "Optimize canBeSeenThroughOtherBlock
" since it caused visual bugs.
This reverts commit c405f336ddc7ecd0ab3bd0821d4dd10fccbcd4de.
This commit is contained in:
parent
1df04351de
commit
01e4184387
@ -696,11 +696,14 @@ pub const ChunkMesh = struct {
|
||||
}
|
||||
|
||||
fn canBeSeenThroughOtherBlock(block: Block, other: Block, neighbor: u3) bool {
|
||||
if(block.typ == 0) return false;
|
||||
if(other.typ == 0) return true;
|
||||
if(@as(u32, @bitCast(block)) == @as(u32, @bitCast(other))) return block.alwaysViewThrough();
|
||||
if(other.viewThrough()) return true;
|
||||
return !models.models.items[blocks.meshes.model(other)].isNeighborOccluded[neighbor ^ 1]; // TODO: Should this also solve faces between partial blocks, like fences?
|
||||
const rotatedModel = blocks.meshes.model(block);
|
||||
const model = &models.models.items[rotatedModel];
|
||||
_ = model; // TODO: Check if the neighbor model occludes this one. (maybe not that relevant)
|
||||
return block.typ != 0 and (
|
||||
other.typ == 0
|
||||
or (!std.meta.eql(block, other) and other.viewThrough()) or other.alwaysViewThrough()
|
||||
or !models.models.items[blocks.meshes.model(other)].isNeighborOccluded[neighbor ^ 1]
|
||||
);
|
||||
}
|
||||
|
||||
fn initLight(self: *ChunkMesh) void {
|
||||
|
Loading…
x
Reference in New Issue
Block a user