mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 18:10:37 +02:00
only add voxel to be drawn if not transparent
This commit is contained in:
parent
d2da9000f4
commit
1efbaef44b
1 changed files with 11 additions and 9 deletions
|
@ -82,6 +82,7 @@ int VoxelSystem::treeToArrays(VoxelNode *currentNode) {
|
|||
float * startVertex = firstVertexForCode(currentNode->octalCode);
|
||||
float voxelScale = 1 / powf(2, *currentNode->octalCode);
|
||||
|
||||
if (currentNode->color[3] == 1) {
|
||||
// populate the array with points for the 8 vertices
|
||||
// and RGB color for each added vertex
|
||||
for (int j = 0; j < VERTEX_POINTS_PER_VOXEL; j++ ) {
|
||||
|
@ -91,11 +92,12 @@ int VoxelSystem::treeToArrays(VoxelNode *currentNode) {
|
|||
verticesEndPointer++;
|
||||
}
|
||||
|
||||
delete [] startVertex;
|
||||
|
||||
voxelsAdded++;
|
||||
}
|
||||
|
||||
delete [] startVertex;
|
||||
}
|
||||
|
||||
return voxelsAdded;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue