From d3368146ce1a34f11b2eb48d27820f5931979970 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 21 Sep 2018 11:42:26 -0700 Subject: [PATCH 1/3] saving work --- interface/src/Application.cpp | 106 ++++++------------ interface/src/Application.h | 8 +- interface/src/octree/SafeLanding.cpp | 4 + .../utilities/render/textureMonitor.qml | 2 +- scripts/system/interstitialPage.js | 46 +++++++- 5 files changed, 84 insertions(+), 82 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 46cebc1661..0947a85a17 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -122,6 +122,7 @@ #include #include #include +#include #include #include #include @@ -5346,8 +5347,8 @@ void Application::resetPhysicsReadyInformation() { // collision information of nearby entities to make running bullet be safe. _fullSceneReceivedCounter = 0; _fullSceneCounterAtLastPhysicsCheck = 0; - _nearbyEntitiesCountAtLastPhysicsCheck = 0; - _nearbyEntitiesStabilityCount = 0; + _gpuTextureMemSizeStabilityCount = 0; + _gpuTextureMemSizeAtLastCheck = 0; _physicsEnabled = false; _octreeProcessor.startEntitySequence(); } @@ -5586,18 +5587,20 @@ void Application::update(float deltaTime) { // for nearby entities before starting bullet up. quint64 now = usecTimestampNow(); if (isServerlessMode() || _octreeProcessor.isLoadSequenceComplete()) { - // we've received a new full-scene octree stats packet, or it's been long enough to try again anyway - _lastPhysicsCheckTime = now; - _fullSceneCounterAtLastPhysicsCheck = _fullSceneReceivedCounter; - _lastQueriedViews.clear(); // Force new view. + if (gpuTextureMemSizeStable()) { + // we've received a new full-scene octree stats packet, or it's been long enough to try again anyway + _lastPhysicsCheckTime = now; + _fullSceneCounterAtLastPhysicsCheck = _fullSceneReceivedCounter; + _lastQueriedViews.clear(); // Force new view. - // process octree stats packets are sent in between full sends of a scene (this isn't currently true). - // We keep physics disabled until we've received a full scene and everything near the avatar in that - // scene is ready to compute its collision shape. - if (getMyAvatar()->isReadyForPhysics()) { - _physicsEnabled = true; - setIsInterstitialMode(false); - getMyAvatar()->updateMotionBehaviorFromMenu(); + // process octree stats packets are sent in between full sends of a scene (this isn't currently true). + // We keep physics disabled until we've received a full scene and everything near the avatar in that + // scene is ready to compute its collision shape. + if (getMyAvatar()->isReadyForPhysics()) { + _physicsEnabled = true; + setIsInterstitialMode(false); + getMyAvatar()->updateMotionBehaviorFromMenu(); + } } } } else if (domainLoadingInProgress) { @@ -6234,9 +6237,14 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType) { const bool isModifiedQuery = !_physicsEnabled; if (isModifiedQuery) { // Create modified view that is a simple sphere. + ConicalViewFrustum sphericalView; + ConicalViewFrustum farView; + + farView.set(_viewFrustum); + sphericalView.setSimpleRadius(INITIAL_QUERY_RADIUS); - _octreeQuery.setConicalViews({ sphericalView }); + _octreeQuery.setConicalViews({ sphericalView, farView }); _octreeQuery.setOctreeSizeScale(DEFAULT_OCTREE_SIZE_SCALE); static constexpr float MIN_LOD_ADJUST = -20.0f; _octreeQuery.setBoundaryLevelAdjust(MIN_LOD_ADJUST); @@ -6548,69 +6556,23 @@ void Application::trackIncomingOctreePacket(ReceivedMessage& message, SharedNode } } -bool Application::nearbyEntitiesAreReadyForPhysics() { - // this is used to avoid the following scenario: - // A table has some items sitting on top of it. The items are at rest, meaning they aren't active in bullet. - // Someone logs in close to the table. They receive information about the items on the table before they - // receive information about the table. The items are very close to the avatar's capsule, so they become - // activated in bullet. This causes them to fall to the floor, because the table's shape isn't yet in bullet. - EntityTreePointer entityTree = getEntities()->getTree(); - if (!entityTree) { - return false; - } +bool Application::gpuTextureMemSizeStable() { + auto renderConfig = qApp->getRenderEngine()->getConfiguration(); + auto renderStats = renderConfig->getConfig("Stats"); - // We don't want to use EntityTree::findEntities(AABox, ...) method because that scan will snarf parented entities - // whose bounding boxes cannot be computed (it is too loose for our purposes here). Instead we manufacture - // custom filters and use the general-purpose EntityTree::findEntities(filter, ...) - QVector entities; - AABox avatarBox(getMyAvatar()->getWorldPosition() - glm::vec3(PHYSICS_READY_RANGE), glm::vec3(2 * PHYSICS_READY_RANGE)); - // create two functions that use avatarBox (entityScan and elementScan), the second calls the first - std::function entityScan = [=](EntityItemPointer& entity) { - if (entity->shouldBePhysical()) { - bool success = false; - AABox entityBox = entity->getAABox(success); - // important: bail for entities that cannot supply a valid AABox - return success && avatarBox.touches(entityBox); - } - return false; - }; - std::function elementScan = [&](const OctreeElementPointer& element, void* unused) { - if (element->getAACube().touches(avatarBox)) { - EntityTreeElementPointer entityTreeElement = std::static_pointer_cast(element); - entityTreeElement->getEntities(entityScan, entities); - return true; - } - return false; - }; + quint64 textureResourceGPUMemSize = renderStats->textureResourceGPUMemSize; + quint64 texturePopulatedGPUMemSize = renderStats->textureResourcePopulatedGPUMemSize; - entityTree->withReadLock([&] { - // Pass the second function to the general-purpose EntityTree::findEntities() - // which will traverse the tree, apply the two filter functions (to element, then to entities) - // as it traverses. The end result will be a list of entities that match. - entityTree->findEntities(elementScan, entities); - }); - - uint32_t nearbyCount = entities.size(); - if (nearbyCount == _nearbyEntitiesCountAtLastPhysicsCheck) { - _nearbyEntitiesStabilityCount++; + if (_gpuTextureMemSizeAtLastCheck == textureResourceGPUMemSize) { + _gpuTextureMemSizeStabilityCount++; } else { - _nearbyEntitiesStabilityCount = 0; + _gpuTextureMemSizeStabilityCount = 0; } - _nearbyEntitiesCountAtLastPhysicsCheck = nearbyCount; + _gpuTextureMemSizeAtLastCheck = textureResourceGPUMemSize; - const uint32_t MINIMUM_NEARBY_ENTITIES_STABILITY_COUNT = 3; - if (_nearbyEntitiesStabilityCount >= MINIMUM_NEARBY_ENTITIES_STABILITY_COUNT) { - // We've seen the same number of nearby entities for several stats packets in a row. assume we've got all - // the local entities. - bool result = true; - foreach (EntityItemPointer entity, entities) { - if (entity->shouldBePhysical() && !entity->isReadyToComputeShape()) { - HIFI_FCDEBUG(interfaceapp(), "Physics disabled until entity loads: " << entity->getID() << entity->getName()); - // don't break here because we want all the relevant entities to start their downloads - result = false; - } - } - return result; + const uint32_t MINIMUM_GPU_TEXTURE_MEM_SIZE_STABILITY_COUNT = 10; + if (_gpuTextureMemSizeStabilityCount >= MINIMUM_GPU_TEXTURE_MEM_SIZE_STABILITY_COUNT) { + return (textureResourceGPUMemSize == texturePopulatedGPUMemSize); } return false; } diff --git a/interface/src/Application.h b/interface/src/Application.h index 3bebc60480..4a15c4fa61 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -528,7 +528,7 @@ private: bool importFromZIP(const QString& filePath); bool importImage(const QString& urlString); - bool nearbyEntitiesAreReadyForPhysics(); + bool gpuTextureMemSizeStable(); int processOctreeStats(ReceivedMessage& message, SharedNodePointer sendingNode); void trackIncomingOctreePacket(ReceivedMessage& message, SharedNodePointer sendingNode, bool wasStatsPacket); @@ -725,8 +725,10 @@ private: std::atomic _fullSceneReceivedCounter { 0 }; // how many times have we received a full-scene octree stats packet uint32_t _fullSceneCounterAtLastPhysicsCheck { 0 }; // _fullSceneReceivedCounter last time we checked physics ready - uint32_t _nearbyEntitiesCountAtLastPhysicsCheck { 0 }; // how many in-range entities last time we checked physics ready - uint32_t _nearbyEntitiesStabilityCount { 0 }; // how many times has _nearbyEntitiesCountAtLastPhysicsCheck been the same + + quint64 _gpuTextureMemSizeStabilityCount { 0 }; + quint64 _gpuTextureMemSizeAtLastCheck { 0 }; + quint64 _lastPhysicsCheckTime { usecTimestampNow() }; // when did we last check to see if physics was ready bool _keyboardDeviceHasFocus { true }; diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 5d4ebe9853..7c6ea3b015 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -171,6 +171,9 @@ bool SafeLanding::isEntityLoadingComplete() { bool isVisuallyReady = true; + + qDebug() << "EntityTpye" << EntityTypes::getEntityTypeName(entity->getType()) << entity->getEntityItemID(); + Settings settings; bool enableInterstitial = settings.value("enableIntersitialMode", false).toBool(); @@ -188,6 +191,7 @@ bool SafeLanding::isEntityLoadingComplete() { entityMapIter++; } } + qDebug() << "EntityList size" << _trackedEntities.size() << "\n"; return _trackedEntities.empty(); } diff --git a/scripts/developer/utilities/render/textureMonitor.qml b/scripts/developer/utilities/render/textureMonitor.qml index 97cc577ff9..b01a390fa8 100644 --- a/scripts/developer/utilities/render/textureMonitor.qml +++ b/scripts/developer/utilities/render/textureMonitor.qml @@ -75,4 +75,4 @@ Item { } } -} \ No newline at end of file +} diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 57726f397b..6c2db91010 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -14,7 +14,7 @@ (function() { Script.include("/~/system/libraries/Xform.js"); - var DEBUG = false; + var DEBUG = true; var MIN_LOADING_PROGRESS = 3.6; var TOTAL_LOADING_PROGRESS = 3.8; var EPSILON = 0.01; @@ -186,6 +186,8 @@ var currentDomain = "no domain"; var timer = null; var target = 0; + var textureMemSizeStabilityCount = 0; + var textureMemSizeAtLastCheck = 0; var connectionToDomainFailed = false; @@ -228,6 +230,8 @@ updateOverlays(false); startAudio(); target = 0; + textureMemSizeStabilityCount = 0; + textureMemSizeAtLastCheck = 0; currentProgress = 0.1; connectionToDomainFailed = false; previousCameraMode = Camera.mode; @@ -348,10 +352,11 @@ Overlays.editOverlay(loadingBarPlacard, properties); Overlays.editOverlay(loadingBarProgress, loadingBarProperties); - - Menu.setIsOptionChecked("Show Overlays", physicsEnabled); - if (!HMD.active) { - toolbar.writeProperty("visible", physicsEnabled); + if (!DEBUG) { + Menu.setIsOptionChecked("Show Overlays", physicsEnabled); + if (!HMD.active) { + toolbar.writeProperty("visible", physicsEnabled); + } } resetValues(); @@ -374,6 +379,7 @@ } function update() { + var renderStats = Render.getConfig("Stats"); var physicsEnabled = Window.isPhysicsEnabled(); var thisInterval = Date.now(); var deltaTime = (thisInterval - lastInterval); @@ -381,11 +387,39 @@ var domainLoadingProgressPercentage = Window.domainLoadingProgress(); - var progress = MIN_LOADING_PROGRESS * domainLoadingProgressPercentage; + var progress = ((TOTAL_LOADING_PROGRESS * 0.4) * domainLoadingProgressPercentage); if (progress >= target) { target = progress; } + if (currentProgress >= (TOTAL_LOADING_PROGRESS * 0.4)) { + var textureResourceGPUMemSize = renderStats.textureResourceGPUMemSize; + var texturePopulatedGPUMemSize = renderStats.textureResourcePopulatedGPUMemSize; + + if (textureMemSizeAtLastCheck === textureResourceGPUMemSize) { + textureMemSizeStabilityCount++; + } else { + textureMemSizeStabilityCount = 0; + } + + textureMemSizeAtLastCheck = textureResourceGPUMemSize; + + if (textureMemSizeStabilityCount >= 15) { + + if (textureResourceGPUMemSize > 0) { + print((texturePopulatedGPUMemSize / textureResourceGPUMemSize)); + var gpuPercantage = (TOTAL_LOADING_PROGRESS * 0.6) * (texturePopulatedGPUMemSize / textureResourceGPUMemSize); + print("---> gpu: " + gpuPercantage); + print("----> current: " + progress); + var totalProgress = progress + gpuPercantage; + print("------> totalProgress: " + totalProgress + "\n"); + if (totalProgress >= target) { + target = totalProgress; + } + } + } + } + if ((physicsEnabled && (currentProgress < TOTAL_LOADING_PROGRESS))) { target = TOTAL_LOADING_PROGRESS; } From 57ae8ff8a14fb7dc1538e57c93fe3314a3822fe5 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Mon, 24 Sep 2018 16:09:53 -0700 Subject: [PATCH 2/3] update interstitial page stability count and loading bar --- interface/src/Application.cpp | 3 +- interface/src/Application.h | 4 ++ interface/src/octree/SafeLanding.cpp | 40 ++++++++++++++----- interface/src/octree/SafeLanding.h | 3 ++ .../scripting/WindowScriptingInterface.cpp | 4 ++ .../src/scripting/WindowScriptingInterface.h | 2 + scripts/system/interstitialPage.js | 6 +-- 7 files changed, 45 insertions(+), 17 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 0947a85a17..ac21af6d44 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6570,8 +6570,7 @@ bool Application::gpuTextureMemSizeStable() { } _gpuTextureMemSizeAtLastCheck = textureResourceGPUMemSize; - const uint32_t MINIMUM_GPU_TEXTURE_MEM_SIZE_STABILITY_COUNT = 10; - if (_gpuTextureMemSizeStabilityCount >= MINIMUM_GPU_TEXTURE_MEM_SIZE_STABILITY_COUNT) { + if (_gpuTextureMemSizeStabilityCount >= _minimumGPUTextureMemSizeStabilityCount) { return (textureResourceGPUMemSize == texturePopulatedGPUMemSize); } return false; diff --git a/interface/src/Application.h b/interface/src/Application.h index 4a15c4fa61..b4df36704a 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -233,6 +233,8 @@ public: float getSettingConstrainToolbarPosition() { return _constrainToolbarPosition.get(); } void setSettingConstrainToolbarPosition(bool setting); + Q_INVOKABLE void setMinimumGPUTextureMemStabilityCount(int stabilityCount) { _minimumGPUTextureMemSizeStabilityCount = stabilityCount; } + NodeToOctreeSceneStats* getOcteeSceneStats() { return &_octreeServerSceneStats; } virtual controller::ScriptingInterface* getControllerScriptingInterface() { return _controllerScriptingInterface; } @@ -585,6 +587,8 @@ private: QElapsedTimer _lastTimeUpdated; QElapsedTimer _lastTimeRendered; + int _minimumGPUTextureMemSizeStabilityCount { 15 }; + ShapeManager _shapeManager; PhysicalEntitySimulationPointer _entitySimulation; PhysicsEnginePointer _physicsEngine; diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 7c6ea3b015..ba6e1dac8a 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -10,6 +10,9 @@ // #include "SafeLanding.h" + +#include + #include "EntityTreeRenderer.h" #include "ModelEntityItem.h" #include "InterfaceLogging.h" @@ -39,6 +42,7 @@ void SafeLanding::startEntitySequence(QSharedPointer entityT _entityTree = entityTree; _trackedEntities.clear(); _trackingEntities = true; + _maxTrackedEntityCount = 0; connect(std::const_pointer_cast(_entityTree).get(), &EntityTree::addingEntity, this, &SafeLanding::addTrackedEntity); connect(std::const_pointer_cast(_entityTree).get(), @@ -47,6 +51,7 @@ void SafeLanding::startEntitySequence(QSharedPointer entityT _sequenceNumbers.clear(); _initialStart = INVALID_SEQUENCE; _initialEnd = INVALID_SEQUENCE; + _startTime = usecTimestampNow(); EntityTreeRenderer::setEntityLoadingPriorityFunction(&ElevatedPriority); } } @@ -55,6 +60,7 @@ void SafeLanding::stopEntitySequence() { Locker lock(_lock); _trackingEntities = false; _maxTrackedEntityCount = 0; + _trackedEntityStabilityCount = 0; _initialStart = INVALID_SEQUENCE; _initialEnd = INVALID_SEQUENCE; _trackedEntities.clear(); @@ -66,13 +72,14 @@ void SafeLanding::addTrackedEntity(const EntityItemID& entityID) { Locker lock(_lock); EntityItemPointer entity = _entityTree->findEntityByID(entityID); - if (entity) { + if (entity && entity->getCreated() < _startTime) { _trackedEntities.emplace(entityID, entity); int trackedEntityCount = (int)_trackedEntities.size(); if (trackedEntityCount > _maxTrackedEntityCount) { _maxTrackedEntityCount = trackedEntityCount; + _trackedEntityStabilityCount = 0; } qCDebug(interfaceapp) << "Safe Landing: Tracking entity " << entity->getItemName(); } @@ -116,11 +123,19 @@ bool SafeLanding::isLoadSequenceComplete() { float SafeLanding::loadingProgressPercentage() { Locker lock(_lock); + + static const int MINIMUM_TRACKED_ENTITY_STABILITY_COUNT = 15; + + float percentage = 0.0f; if (_maxTrackedEntityCount > 0) { - return ((_maxTrackedEntityCount - _trackedEntities.size()) / (float)_maxTrackedEntityCount); + percentage = ((_maxTrackedEntityCount - _trackedEntities.size()) / (float)_maxTrackedEntityCount); } - return 0.0f; + if (_trackedEntityStabilityCount < MINIMUM_TRACKED_ENTITY_STABILITY_COUNT) { + percentage *= 0.20f; + } + + return percentage; } bool SafeLanding::isSequenceNumbersComplete() { @@ -166,19 +181,18 @@ bool SafeLanding::isEntityLoadingComplete() { auto entityTree = qApp->getEntities(); auto entityMapIter = _trackedEntities.begin(); + Settings settings; + bool enableInterstitial = settings.value("enableIntersitialMode", false).toBool(); + while (entityMapIter != _trackedEntities.end()) { auto entity = entityMapIter->second; bool isVisuallyReady = true; - - qDebug() << "EntityTpye" << EntityTypes::getEntityTypeName(entity->getType()) << entity->getEntityItemID(); - - Settings settings; - bool enableInterstitial = settings.value("enableIntersitialMode", false).toBool(); - if (enableInterstitial) { isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first)); + + qDebug() << "EntityTpye" << EntityTypes::getEntityTypeName(entity->getType()) << entity->getEntityItemID() << isVisuallyReady; } if (isEntityPhysicsReady(entity) && isVisuallyReady) { @@ -191,7 +205,13 @@ bool SafeLanding::isEntityLoadingComplete() { entityMapIter++; } } - qDebug() << "EntityList size" << _trackedEntities.size() << "\n"; + + if (enableInterstitial) { + _trackedEntityStabilityCount++; + qDebug() << "EntityList size" << _trackedEntities.size() << "\n"; + } + + return _trackedEntities.empty(); } diff --git a/interface/src/octree/SafeLanding.h b/interface/src/octree/SafeLanding.h index 317e4587c7..51357b60ff 100644 --- a/interface/src/octree/SafeLanding.h +++ b/interface/src/octree/SafeLanding.h @@ -52,6 +52,9 @@ private: int _initialStart { INVALID_SEQUENCE }; int _initialEnd { INVALID_SEQUENCE }; int _maxTrackedEntityCount { 0 }; + int _trackedEntityStabilityCount { 0 }; + + quint64 _startTime { 0 }; struct SequenceLessThan { bool operator()(const int& a, const int& b) const; diff --git a/interface/src/scripting/WindowScriptingInterface.cpp b/interface/src/scripting/WindowScriptingInterface.cpp index e3ae65aee1..543dfe4933 100644 --- a/interface/src/scripting/WindowScriptingInterface.cpp +++ b/interface/src/scripting/WindowScriptingInterface.cpp @@ -389,6 +389,10 @@ void WindowScriptingInterface::showAssetServer(const QString& upload) { QMetaObject::invokeMethod(qApp, "showAssetServerWidget", Qt::QueuedConnection, Q_ARG(QString, upload)); } +void WindowScriptingInterface::setMinimumGPUTextureMemSizeStabilityCount(int stabilityCount) { + QMetaObject::invokeMethod(qApp, " setMinimumGPUTextureMemStabilityCount", Qt::QueuedConnection, Q_ARG(int, stabilityCount)); +} + QString WindowScriptingInterface::checkVersion() { return QCoreApplication::applicationVersion(); } diff --git a/interface/src/scripting/WindowScriptingInterface.h b/interface/src/scripting/WindowScriptingInterface.h index 3827406729..bf93e73ea9 100644 --- a/interface/src/scripting/WindowScriptingInterface.h +++ b/interface/src/scripting/WindowScriptingInterface.h @@ -570,6 +570,8 @@ public slots: float domainLoadingProgress(); + void setMinimumGPUTextureMemSizeStabilityCount(int stabilityCount); + private slots: void onWindowGeometryChanged(const QRect& geometry); void onMessageBoxSelected(int button); diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index f5cd8293be..b8b9385a4d 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -14,7 +14,7 @@ (function() { Script.include("/~/system/libraries/Xform.js"); - var DEBUG = true; + var DEBUG = false; var MIN_LOADING_PROGRESS = 3.6; var TOTAL_LOADING_PROGRESS = 3.8; var EPSILON = 0.01; @@ -385,7 +385,6 @@ lastInterval = thisInterval; var domainLoadingProgressPercentage = Window.domainLoadingProgress(); - var progress = ((TOTAL_LOADING_PROGRESS * 0.4) * domainLoadingProgressPercentage); if (progress >= target) { target = progress; @@ -408,10 +407,7 @@ if (textureResourceGPUMemSize > 0) { print((texturePopulatedGPUMemSize / textureResourceGPUMemSize)); var gpuPercantage = (TOTAL_LOADING_PROGRESS * 0.6) * (texturePopulatedGPUMemSize / textureResourceGPUMemSize); - print("---> gpu: " + gpuPercantage); - print("----> current: " + progress); var totalProgress = progress + gpuPercantage; - print("------> totalProgress: " + totalProgress + "\n"); if (totalProgress >= target) { target = totalProgress; } From 7e138ebfff00edee42a2f3f4868bc3769ed62a9d Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 26 Sep 2018 10:52:45 -0700 Subject: [PATCH 3/3] update to new enabling method --- interface/src/Application.cpp | 15 ++++++++++----- interface/src/octree/SafeLanding.cpp | 3 +-- scripts/defaultScripts.js | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index e0d2ab2586..e6a3ca30f3 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6240,14 +6240,19 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType) { const bool isModifiedQuery = !_physicsEnabled; if (isModifiedQuery) { // Create modified view that is a simple sphere. + bool interstitialModeEnabled = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); ConicalViewFrustum sphericalView; - ConicalViewFrustum farView; - - farView.set(_viewFrustum); - sphericalView.setSimpleRadius(INITIAL_QUERY_RADIUS); - _octreeQuery.setConicalViews({ sphericalView, farView }); + + if (interstitialModeEnabled) { + ConicalViewFrustum farView; + farView.set(_viewFrustum); + _octreeQuery.setConicalViews({ sphericalView, farView }); + } else { + _octreeQuery.setConicalViews({ sphericalView }); + } + _octreeQuery.setOctreeSizeScale(DEFAULT_OCTREE_SIZE_SCALE); static constexpr float MIN_LOD_ADJUST = -20.0f; _octreeQuery.setBoundaryLevelAdjust(MIN_LOD_ADJUST); diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index ba6e1dac8a..5c11c3251f 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -181,8 +181,7 @@ bool SafeLanding::isEntityLoadingComplete() { auto entityTree = qApp->getEntities(); auto entityMapIter = _trackedEntities.begin(); - Settings settings; - bool enableInterstitial = settings.value("enableIntersitialMode", false).toBool(); + bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); while (entityMapIter != _trackedEntities.end()) { auto entity = entityMapIter->second; diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index aaf5ca7260..3f015930f4 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -38,7 +38,7 @@ var DEFAULT_SCRIPTS_SEPARATE = [ //"system/chat.js" ]; -if (Settings.getValue("enableInterstitialMode", false)) { +if (Window.interstitialModeEnabled) { DEFAULT_SCRIPTS_SEPARATE.push("system/interstitialPage.js"); }