mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
feat: custom model full culling case
This commit is contained in:
parent
19836bfde3
commit
a586fe5e92
1 changed files with 17 additions and 0 deletions
|
|
@ -290,6 +290,23 @@ void BlocksRenderer::blockCustomModel(
|
|||
Z = orient.axes[2];
|
||||
}
|
||||
|
||||
if (!block.rt.extended) {
|
||||
glm::ivec3 offsets[6] {
|
||||
{-1, 0, 0}, {0, -1, 0}, {0, 0, -1},
|
||||
{1, 0, 0}, {0, 1, 0}, {0, 0, 1},
|
||||
};
|
||||
bool culled = true;
|
||||
for (int i = 0; i < 6; i++) {
|
||||
if (isOpen(icoord + offsets[i], block, variant)) {
|
||||
culled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (culled) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const auto& model = cache.getModel(block.rt.id, block.getVariantIndex(states.userbits));
|
||||
for (const auto& mesh : model.meshes) {
|
||||
if (vertexCount + mesh.vertices.size() >= capacity
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue