diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 31f6ace29d..4688160a34 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6597,6 +6597,7 @@ bool Application::gpuTextureMemSizeStable() { qint64 textureResourceGPUMemSize = renderStats->textureResourceGPUMemSize; qint64 texturePopulatedGPUMemSize = renderStats->textureResourcePopulatedGPUMemSize; + qint64 textureTransferSize = renderStats->texturePendingGPUTransferSize; if (_gpuTextureMemSizeAtLastCheck == textureResourceGPUMemSize) { _gpuTextureMemSizeStabilityCount++; @@ -6606,8 +6607,10 @@ bool Application::gpuTextureMemSizeStable() { _gpuTextureMemSizeAtLastCheck = textureResourceGPUMemSize; if (_gpuTextureMemSizeStabilityCount >= _minimumGPUTextureMemSizeStabilityCount) { - return (textureResourceGPUMemSize == texturePopulatedGPUMemSize); + qDebug() << "GPU checking"; + return (textureResourceGPUMemSize == texturePopulatedGPUMemSize) && (textureTransferSize == 0); } + qDebug() << "GPU not ready"; return false; } diff --git a/interface/src/Application.h b/interface/src/Application.h index 4841c315e6..750d9ce987 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -583,7 +583,7 @@ private: QElapsedTimer _lastTimeUpdated; QElapsedTimer _lastTimeRendered; - int _minimumGPUTextureMemSizeStabilityCount { 15 }; + int _minimumGPUTextureMemSizeStabilityCount { 30 }; ShapeManager _shapeManager; PhysicalEntitySimulationPointer _entitySimulation; diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 62fbe12acb..d5eb4c23c2 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -83,8 +83,6 @@ void SafeLanding::addTrackedEntity(const EntityItemID& entityID) { } qCDebug(interfaceapp) << "Safe Landing: Tracking entity " << entity->getItemName(); } - } else { - qCDebug(interfaceapp) << "Safe Landing: Null Entity: " << entityID; } } @@ -109,12 +107,13 @@ void SafeLanding::noteReceivedsequenceNumber(int sequenceNumber) { } bool SafeLanding::isLoadSequenceComplete() { + qDebug() << "is sequence complete" << isSequenceNumbersComplete(); if (isEntityLoadingComplete() && isSequenceNumbersComplete()) { Locker lock(_lock); - _trackedEntities.clear(); _initialStart = INVALID_SEQUENCE; _initialEnd = INVALID_SEQUENCE; _entityTree = nullptr; + _trackingEntities = false; // Don't track anything else that comes in. EntityTreeRenderer::setEntityLoadingPriorityFunction(StandardPriority); } @@ -148,7 +147,10 @@ bool SafeLanding::isSequenceNumbersComplete() { (startIter != _sequenceNumbers.end() && endIter != _sequenceNumbers.end() && distance(startIter, endIter) == sequenceSize - 1)) { - _trackingEntities = false; // Don't track anything else that comes in. + bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); + if (!enableInterstitial) { + _trackingEntities = false; // Don't track anything else that comes in. + } return true; } } @@ -188,7 +190,14 @@ bool SafeLanding::isEntityLoadingComplete() { bool isVisuallyReady = true; if (enableInterstitial) { - isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first)); + bool hasRenderable = true; + auto entityRenderable = entityTree->renderableForEntityId(entityMapIter->first); + if (!entityRenderable) { + hasRenderable = false; + entityTree->addingEntity(entityMapIter->first); + } + qDebug() << EntityTypes::getEntityTypeName(entity->getType()) << entity->isVisuallyReady() << hasRenderable << entity->isParentPathComplete(); + isVisuallyReady = entity->isVisuallyReady() || (!entityRenderable && !entity->isParentPathComplete()); } if (isEntityPhysicsReady(entity) && isVisuallyReady) { @@ -202,6 +211,10 @@ bool SafeLanding::isEntityLoadingComplete() { } } + if (!_trackedEntities.empty()) { + qDebug() << "\n"; + } + if (enableInterstitial) { _trackedEntityStabilityCount++; } diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index dbbf8af4b9..6e82d26f29 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -310,10 +310,10 @@ void EntityTreeRenderer::addPendingEntities(const render::ScenePointer& scene, r } auto entityID = entity->getEntityItemID(); - processedIds.insert(entityID); auto renderable = EntityRenderer::addToScene(*this, entity, scene, transaction); if (renderable) { _entitiesInScene.insert({ entityID, renderable }); + processedIds.insert(entityID); } } diff --git a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp index 1a263fba79..f51a3f7740 100644 --- a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp @@ -104,6 +104,10 @@ void ParticleEffectEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePoi _networkTexture.reset(); }); } + + withWriteLock([&] { + entity->setVisuallyReady(true); + }); } else { bool textureNeedsUpdate = resultWithReadLock([&]{ return !_networkTexture || _networkTexture->getURL() != QUrl(_particleProperties.textures); @@ -113,6 +117,12 @@ void ParticleEffectEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePoi _networkTexture = DependencyManager::get()->getTexture(_particleProperties.textures); }); } + + if (_networkTexture) { + withWriteLock([&] { + entity->setVisuallyReady(_networkTexture->isFailed() || _networkTexture->isLoaded()); + }); + } } void* key = (void*)this; diff --git a/libraries/entities/src/ParticleEffectEntityItem.cpp b/libraries/entities/src/ParticleEffectEntityItem.cpp index 975acf153a..cea3e94ef0 100644 --- a/libraries/entities/src/ParticleEffectEntityItem.cpp +++ b/libraries/entities/src/ParticleEffectEntityItem.cpp @@ -166,6 +166,7 @@ ParticleEffectEntityItem::ParticleEffectEntityItem(const EntityItemID& entityIte { _type = EntityTypes::ParticleEffect; setColor(DEFAULT_COLOR); + _visuallyReady = false; } void ParticleEffectEntityItem::setAlpha(float alpha) { @@ -777,4 +778,4 @@ particle::Properties ParticleEffectEntityItem::getParticleProperties() const { } return result; -} \ No newline at end of file +} diff --git a/libraries/networking/src/DomainHandler.h b/libraries/networking/src/DomainHandler.h index 1ff88b425d..ddd23339df 100644 --- a/libraries/networking/src/DomainHandler.h +++ b/libraries/networking/src/DomainHandler.h @@ -231,7 +231,7 @@ private: QString _pendingPath; QTimer _settingsTimer; mutable ReadWriteLockable _interstitialModeSettingLock; - Setting::Handle _enableInterstitialMode{ "enableInterstitialMode", false }; + Setting::Handle _enableInterstitialMode{ "enableInterstitialMode", true }; QSet _domainConnectionRefusals; bool _hasCheckedForAccessToken { false }; diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 9e1b588043..9efb040624 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -40,8 +40,8 @@ var DEFAULT_SCRIPTS_SEPARATE = [ ]; if (Window.interstitialModeEnabled) { - DEFAULT_SCRIPTS_SEPARATE.push("system/interstitialPage.js"); - DEFAULT_SCRIPTS_SEPARATE.push("system/redirectOverlays.js"); + DEFAULT_SCRIPTS_COMBINED.push("system/interstitialPage.js"); + DEFAULT_SCRIPTS_COMBINED.push("system/redirectOverlays.js"); } // add a menu item for debugging diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 39b4821192..1c2f83bb04 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -472,7 +472,7 @@ textureMemSizeAtLastCheck = textureResourceGPUMemSize; - if (textureMemSizeStabilityCount >= 15) { + if (textureMemSizeStabilityCount >= 20) { if (textureResourceGPUMemSize > 0) { // print((texturePopulatedGPUMemSize / textureResourceGPUMemSize));