Showing the changes to interface/src/VoxelSystem.cpp (1 of 11 files). Show all
Unified · Split
| @@ -319,14 +319,7 @@ int VoxelSystem::newTreeToArrays(VoxelNode* node) { · 318 unmodified lines | ||
| 319 | 319 | int voxelsUpdated = 0; |
| 320 | 320 | bool shouldRender = false; // assume we don't need to render it |
| 321 | 321 | // if it's colored, we might need to render it! |
| 322 | − if (node->isColored()) { | |
| 323 | − float distanceToNode = node->distanceToCamera(*Application::getInstance()->getViewFrustum()); | |
| 324 | − float boundary = boundaryDistanceForRenderLevel(node->getLevel()); | |
| 325 | − float childBoundary = boundaryDistanceForRenderLevel(node->getLevel() + 1); | |
| 326 | − bool inBoundary = (distanceToNode <= boundary); | |
| 327 | − bool inChildBoundary = (distanceToNode <= childBoundary); | |
| 328 | − shouldRender = (node->isLeaf() && inChildBoundary) || (inBoundary && !inChildBoundary); | |
| 329 | − } | |
| 322 | + shouldRender = node->calculateShouldRender(Application::getInstance()->getViewFrustum()); | |
| 330 | 323 | node->setShouldRender(shouldRender && !node->isStagedForDeletion()); |
| 331 | 324 | // let children figure out their renderness |
| 332 | 325 | if (!node->isLeaf()) { |