mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:09:52 +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());
|
viewFrustum->getNearBottomLeft(), viewFrustum->getNearBottomRight());
|
||||||
|
|
||||||
RenderVisitor renderVisitor(getLOD());
|
RenderVisitor renderVisitor(getLOD());
|
||||||
guideToAugmented(renderVisitor);
|
guideToAugmented(renderVisitor, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
class RayHeightfieldIntersectionVisitor : public RayIntersectionVisitor {
|
class RayHeightfieldIntersectionVisitor : public RayIntersectionVisitor {
|
||||||
|
@ -459,13 +459,19 @@ MetavoxelClient* MetavoxelSystem::createClient(const SharedNodePointer& node) {
|
||||||
return new MetavoxelSystemClient(node, _updater);
|
return new MetavoxelSystemClient(node, _updater);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetavoxelSystem::guideToAugmented(MetavoxelVisitor& visitor) {
|
void MetavoxelSystem::guideToAugmented(MetavoxelVisitor& visitor, bool render) {
|
||||||
foreach (const SharedNodePointer& node, NodeList::getInstance()->getNodeHash()) {
|
foreach (const SharedNodePointer& node, NodeList::getInstance()->getNodeHash()) {
|
||||||
if (node->getType() == NodeType::MetavoxelServer) {
|
if (node->getType() == NodeType::MetavoxelServer) {
|
||||||
QMutexLocker locker(&node->getMutex());
|
QMutexLocker locker(&node->getMutex());
|
||||||
MetavoxelSystemClient* client = static_cast<MetavoxelSystemClient*>(node->getLinkedData());
|
MetavoxelSystemClient* client = static_cast<MetavoxelSystemClient*>(node->getLinkedData());
|
||||||
if (client) {
|
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:
|
private:
|
||||||
|
|
||||||
void guideToAugmented(MetavoxelVisitor& visitor);
|
void guideToAugmented(MetavoxelVisitor& visitor, bool render = false);
|
||||||
|
|
||||||
AttributePointer _pointBufferAttribute;
|
AttributePointer _pointBufferAttribute;
|
||||||
AttributePointer _heightfieldBufferAttribute;
|
AttributePointer _heightfieldBufferAttribute;
|
||||||
|
@ -92,6 +92,8 @@ public:
|
||||||
/// Returns a copy of the augmented data. This function is thread-safe.
|
/// Returns a copy of the augmented data. This function is thread-safe.
|
||||||
MetavoxelData getAugmentedData();
|
MetavoxelData getAugmentedData();
|
||||||
|
|
||||||
|
void setRenderedAugmentedData(const MetavoxelData& data) { _renderedAugmentedData = data; }
|
||||||
|
|
||||||
virtual int parseData(const QByteArray& packet);
|
virtual int parseData(const QByteArray& packet);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -102,6 +104,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
MetavoxelData _augmentedData;
|
MetavoxelData _augmentedData;
|
||||||
|
MetavoxelData _renderedAugmentedData;
|
||||||
QReadWriteLock _augmentedDataLock;
|
QReadWriteLock _augmentedDataLock;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue