History

Added LOD to preview + Shared voxelSystem for reduced memory consumption

atlante45 committed 13 years ago

Commit 1dc8d8d1 parent 7d9d36a10 files · +227 −104Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 10 files). Show all

Unified · Split

interface/src/VoxelSystem.cpp+13−1
@@ -420,7 +420,7 @@ int VoxelSystem::newTreeToArrays(VoxelNode* node) { · 419 unmodified lines
420 bool shouldRender = false; // assume we don't need to render it420 bool shouldRender = false; // assume we don't need to render it
421 // if it's colored, we might need to render it!421 // if it's colored, we might need to render it!
422 shouldRender = node->calculateShouldRender(_viewFrustum);422 shouldRender = node->calculateShouldRender(_viewFrustum);
423 423
424 node->setShouldRender(shouldRender);424 node->setShouldRender(shouldRender);
425 // let children figure out their renderness425 // let children figure out their renderness
426 if (!node->isLeaf()) {426 if (!node->isLeaf()) {
@@ -631,6 +631,18 @@ void VoxelSystem::init() { · 204 unmodified lines
631 _perlinModulateProgram->release();631 _perlinModulateProgram->release();
632}632}
633 633
634void VoxelSystem::changeTree(VoxelTree* newTree) {
635 disconnect(_tree, 0, this, 0);
636
637 _tree = newTree;
638 _tree->setDirtyBit();
639
640 connect(_tree, SIGNAL(importSize(float,float,float)), SIGNAL(importSize(float,float,float)));
641 connect(_tree, SIGNAL(importProgress(int)), SIGNAL(importProgress(int)));
642
643 setupNewVoxelsForDrawing();
644}
645
634void VoxelSystem::updateFullVBOs() {646void VoxelSystem::updateFullVBOs() {
635 updateVBOSegment(0, _voxelsInReadArrays);647 updateVBOSegment(0, _voxelsInReadArrays);
636 648