Showing the changes to interface/src/VoxelSystem.cpp (1 of 2 files). Show all
Unified · Split
| @@ -60,6 +60,7 @@ VoxelSystem::VoxelSystem(float treeScale, int maxVoxels) · 59 unmodified lines | ||
| 60 | 60 | _treeScale(treeScale), |
| 61 | 61 | _maxVoxels(maxVoxels), |
| 62 | 62 | _initialized(false), |
| 63 | + _inOcclusions(false), | |
| 63 | 64 | _showCulledSharedFaces(false), |
| 64 | 65 | _usePrimitiveRenderer(false), |
| 65 | 66 | _renderer(0) { |
| @@ -1506,8 +1507,8 @@ bool VoxelSystem::inspectForInteriorOcclusionsOperation(OctreeElement* element, · 1440 unmodified lines | ||
| 1506 | 1507 | _nodeCount++; |
| 1507 | 1508 | VoxelTreeElement* voxel = (VoxelTreeElement*)element; |
| 1508 | 1509 | |
| 1509 | − // Nothing to do at the leaf level or below the should render level | |
| 1510 | − if (voxel->isLeaf() || voxel->getShouldRender()) { | |
| 1510 | + // Nothing to do at the leaf level | |
| 1511 | + if (voxel->isLeaf()) { | |
| 1511 | 1512 | return false; |
| 1512 | 1513 | } |
| 1513 | 1514 | |
| @@ -1571,8 +1572,8 @@ bool VoxelSystem::inspectForExteriorOcclusionsOperation(OctreeElement* element, · 57 unmodified lines | ||
| 1571 | 1572 | _nodeCount++; |
| 1572 | 1573 | VoxelTreeElement* voxel = (VoxelTreeElement*)element; |
| 1573 | 1574 | |
| 1574 | − // Nothing to do at the leaf level or below the should render level | |
| 1575 | − if (voxel->isLeaf() || voxel->getShouldRender()) { | |
| 1575 | + // Nothing to do at the leaf level | |
| 1576 | + if (voxel->isLeaf()) { | |
| 1576 | 1577 | return false; |
| 1577 | 1578 | } |
| 1578 | 1579 | |
| @@ -1645,7 +1646,7 @@ bool VoxelSystem::clearAllOcclusionsOperation(OctreeElement* element, void* extr · 66 unmodified lines | ||
| 1645 | 1646 | VoxelTreeElement* voxel = (VoxelTreeElement*)element; |
| 1646 | 1647 | |
| 1647 | 1648 | bool rc; |
| 1648 | − if (voxel->isLeaf() || voxel->getShouldRender()) { | |
| 1649 | + if (voxel->isLeaf()) { | |
| 1649 | 1650 | |
| 1650 | 1651 | // By definition the the exterior faces of a leaf voxel are |
| 1651 | 1652 | // always occluders. |
| @@ -1700,6 +1701,10 @@ void VoxelSystem::showCulledSharedFaces() { · 48 unmodified lines | ||
| 1700 | 1701 | |
| 1701 | 1702 | void VoxelSystem::clearAllOcclusions() { |
| 1702 | 1703 | |
| 1704 | + if (_inOcclusions) { | |
| 1705 | + return; | |
| 1706 | + } | |
| 1707 | + _inOcclusions = true; | |
| 1703 | 1708 | _nodeCount = 0; |
| 1704 | 1709 | |
| 1705 | 1710 | bool showDebugDetails = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| @@ -1715,10 +1720,16 @@ void VoxelSystem::clearAllOcclusions() { · 9 unmodified lines | ||
| 1715 | 1720 | _writeRenderFullVBO = true; |
| 1716 | 1721 | _tree->setDirtyBit(); |
| 1717 | 1722 | setupNewVoxelsForDrawing(); |
| 1723 | + | |
| 1724 | + _inOcclusions = false; | |
| 1718 | 1725 | } |
| 1719 | 1726 | |
| 1720 | 1727 | void VoxelSystem::inspectForOcclusions() { |
| 1721 | 1728 | |
| 1729 | + if (_inOcclusions) { | |
| 1730 | + return; | |
| 1731 | + } | |
| 1732 | + _inOcclusions = true; | |
| 1722 | 1733 | _nodeCount = 0; |
| 1723 | 1734 | |
| 1724 | 1735 | bool showDebugDetails = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| @@ -1736,6 +1747,7 @@ void VoxelSystem::inspectForOcclusions() { · 11 unmodified lines | ||
| 1736 | 1747 | _writeRenderFullVBO = true; |
| 1737 | 1748 | _tree->setDirtyBit(); |
| 1738 | 1749 | setupNewVoxelsForDrawing(); |
| 1750 | + _inOcclusions = false; | |
| 1739 | 1751 | } |
| 1740 | 1752 | |
| 1741 | 1753 | bool VoxelSystem::forceRedrawEntireTreeOperation(OctreeElement* element, void* extraData) { |