mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 15:23:56 +02:00
Fix for flashing when painting textures.
This commit is contained in:
parent
6e06b63709
commit
5c77317cfd
2 changed files with 13 additions and 4 deletions
|
@ -118,7 +118,7 @@ void MetavoxelSystem::render() {
|
|||
viewFrustum->getNearBottomLeft(), viewFrustum->getNearBottomRight());
|
||||
|
||||
RenderVisitor renderVisitor(getLOD());
|
||||
guideToAugmented(renderVisitor);
|
||||
guideToAugmented(renderVisitor, true);
|
||||
}
|
||||
|
||||
class RayHeightfieldIntersectionVisitor : public RayIntersectionVisitor {
|
||||
|
@ -459,13 +459,19 @@ MetavoxelClient* MetavoxelSystem::createClient(const SharedNodePointer& node) {
|
|||
return new MetavoxelSystemClient(node, _updater);
|
||||
}
|
||||
|
||||
void MetavoxelSystem::guideToAugmented(MetavoxelVisitor& visitor) {
|
||||
void MetavoxelSystem::guideToAugmented(MetavoxelVisitor& visitor, bool render) {
|
||||
foreach (const SharedNodePointer& node, NodeList::getInstance()->getNodeHash()) {
|
||||
if (node->getType() == NodeType::MetavoxelServer) {
|
||||
QMutexLocker locker(&node->getMutex());
|
||||
MetavoxelSystemClient* client = static_cast<MetavoxelSystemClient*>(node->getLinkedData());
|
||||
if (client) {
|
||||
client->getAugmentedData().guide(visitor);
|
||||
MetavoxelData data = client->getAugmentedData();
|
||||
data.guide(visitor);
|
||||
if (render) {
|
||||
// save the rendered augmented data so that its cached texture references, etc., don't
|
||||
// get collected when we replace it with more recent versions
|
||||
client->setRenderedAugmentedData(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ protected:
|
|||
|
||||
private:
|
||||
|
||||
void guideToAugmented(MetavoxelVisitor& visitor);
|
||||
void guideToAugmented(MetavoxelVisitor& visitor, bool render = false);
|
||||
|
||||
AttributePointer _pointBufferAttribute;
|
||||
AttributePointer _heightfieldBufferAttribute;
|
||||
|
@ -92,6 +92,8 @@ public:
|
|||
/// Returns a copy of the augmented data. This function is thread-safe.
|
||||
MetavoxelData getAugmentedData();
|
||||
|
||||
void setRenderedAugmentedData(const MetavoxelData& data) { _renderedAugmentedData = data; }
|
||||
|
||||
virtual int parseData(const QByteArray& packet);
|
||||
|
||||
protected:
|
||||
|
@ -102,6 +104,7 @@ protected:
|
|||
private:
|
||||
|
||||
MetavoxelData _augmentedData;
|
||||
MetavoxelData _renderedAugmentedData;
|
||||
QReadWriteLock _augmentedDataLock;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue