mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 11:17:05 -04:00
Undo the performance regression of the previous commit by adding a special case for air blocks.
This commit is contained in:
parent
4ab40cc85b
commit
5fea779e37
@ -75,6 +75,7 @@ pub const ChannelChunk = struct {
|
||||
}
|
||||
|
||||
fn calculateIncomingOcclusion(result: *[3]u8, block: blocks.Block, voxelSize: u31, neighbor: usize) void {
|
||||
if(block.typ == 0) return;
|
||||
if(main.models.models.items[blocks.meshes.model(block)].isNeighborOccluded[neighbor]) {
|
||||
var absorption: [3]u8 = extractColor(block.absorption());
|
||||
absorption[0] *|= @intCast(voxelSize);
|
||||
@ -87,6 +88,7 @@ pub const ChannelChunk = struct {
|
||||
}
|
||||
|
||||
fn calculateOutgoingOcclusion(result: *[3]u8, block: blocks.Block, voxelSize: u31, neighbor: usize) void {
|
||||
if(block.typ == 0) return;
|
||||
const model = &main.models.models.items[blocks.meshes.model(block)];
|
||||
if(model.isNeighborOccluded[neighbor] and !model.isNeighborOccluded[neighbor ^ 1]) { // Avoid calculating the absorption twice.
|
||||
var absorption: [3]u8 = extractColor(block.absorption());
|
||||
|
Loading…
x
Reference in New Issue
Block a user