From a960330f34404742b51f901e0aaa48c9db239a65 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Thu, 16 Jan 2014 13:17:41 -0800 Subject: [PATCH 1/2] fix voxel randomly disappearing bug --- interface/src/VoxelSystem.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/interface/src/VoxelSystem.cpp b/interface/src/VoxelSystem.cpp index ef98271701..3c63df66ed 100644 --- a/interface/src/VoxelSystem.cpp +++ b/interface/src/VoxelSystem.cpp @@ -925,16 +925,14 @@ int VoxelSystem::newTreeToArrays(VoxelTreeElement* voxel) { // for either voxels that should not render, or those that should render and are in view // update their geometry in the array.if the voxel "should render" but is not in view, then // it actually doesn't need to be rendered - if (!shouldRender || voxel->isInView(*_viewFrustum)) { - if (_writeRenderFullVBO) { - const bool DONT_REUSE_INDEX = false; - const bool FORCE_REDRAW = true; - voxelsUpdated += updateNodeInArrays(voxel, DONT_REUSE_INDEX, FORCE_REDRAW); - } else { - const bool REUSE_INDEX = true; - const bool DONT_FORCE_REDRAW = false; - voxelsUpdated += updateNodeInArrays(voxel, REUSE_INDEX, DONT_FORCE_REDRAW); - } + if (_writeRenderFullVBO) { + const bool DONT_REUSE_INDEX = false; + const bool FORCE_REDRAW = true; + voxelsUpdated += updateNodeInArrays(voxel, DONT_REUSE_INDEX, FORCE_REDRAW); + } else { + const bool REUSE_INDEX = true; + const bool DONT_FORCE_REDRAW = false; + voxelsUpdated += updateNodeInArrays(voxel, REUSE_INDEX, DONT_FORCE_REDRAW); } voxel->clearDirtyBit(); // clear the dirty bit, do this before we potentially delete things. From a76f5a088c74f1b7e29b4f64ef4d82450f702c41 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Thu, 16 Jan 2014 13:19:21 -0800 Subject: [PATCH 2/2] fixed comment --- interface/src/VoxelSystem.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/interface/src/VoxelSystem.cpp b/interface/src/VoxelSystem.cpp index 3c63df66ed..6a7ea2ad55 100644 --- a/interface/src/VoxelSystem.cpp +++ b/interface/src/VoxelSystem.cpp @@ -922,9 +922,7 @@ int VoxelSystem::newTreeToArrays(VoxelTreeElement* voxel) { } } - // for either voxels that should not render, or those that should render and are in view - // update their geometry in the array.if the voxel "should render" but is not in view, then - // it actually doesn't need to be rendered + // update their geometry in the array. depending on our over all mode (fullVBO or not) we will reuse or not reuse the index if (_writeRenderFullVBO) { const bool DONT_REUSE_INDEX = false; const bool FORCE_REDRAW = true;