History

Fix for flashing when painting textures.

Andrzej Kapolka committed 12 years ago

Commit 5c773171 parent 6e06b632 files · +13 −4Browse files

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

Unified · Split

interface/src/MetavoxelSystem.cpp+9−3
@@ -118,7 +118,7 @@ void MetavoxelSystem::render() { · 117 unmodified lines
118118 viewFrustum->getNearBottomLeft(), viewFrustum->getNearBottomRight());
119119
120120 RenderVisitor renderVisitor(getLOD());
121− guideToAugmented(renderVisitor);
121+ guideToAugmented(renderVisitor, true);
122122 }
123123
124124 class RayHeightfieldIntersectionVisitor : public RayIntersectionVisitor {
@@ -459,13 +459,19 @@ MetavoxelClient* MetavoxelSystem::createClient(const SharedNodePointer& node) { · 334 unmodified lines
459459 return new MetavoxelSystemClient(node, _updater);
460460 }
461461
462−void MetavoxelSystem::guideToAugmented(MetavoxelVisitor& visitor) {
462+void MetavoxelSystem::guideToAugmented(MetavoxelVisitor& visitor, bool render) {
463463 foreach (const SharedNodePointer& node, NodeList::getInstance()->getNodeHash()) {
464464 if (node->getType() == NodeType::MetavoxelServer) {
465465 QMutexLocker locker(&node->getMutex());
466466 MetavoxelSystemClient* client = static_cast<MetavoxelSystemClient*>(node->getLinkedData());
467467 if (client) {
468− client->getAugmentedData().guide(visitor);
468+ MetavoxelData data = client->getAugmentedData();
469+ data.guide(visitor);
470+ if (render) {
471+ // save the rendered augmented data so that its cached texture references, etc., don't
472+ // get collected when we replace it with more recent versions
473+ client->setRenderedAugmentedData(data);
474+ }
469475 }
470476 }
471477 }