diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 092fb51a2a..37e31650a0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5544,7 +5544,6 @@ void Application::update(float deltaTime) { // for nearby entities before starting bullet up. quint64 now = usecTimestampNow(); bool renderReady = _octreeProcessor.isEntitiesRenderReady(); - qDebug() << "--> render ready: " << renderReady; if (isServerlessMode() || (_octreeProcessor.isLoadSequenceComplete() && renderReady)) { // we've received a new full-scene octree stats packet, or it's been long enough to try again anyway _lastPhysicsCheckTime = now; diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 262f0b30c2..8d36b3fcb0 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -13,6 +13,7 @@ #include "EntityTreeRenderer.h" #include "ModelEntityItem.h" #include "InterfaceLogging.h" +#include "Application.h" const int SafeLanding::SEQUENCE_MODULO = std::numeric_limits::max() + 1; @@ -129,7 +130,7 @@ bool SafeLanding::isLoadSequenceComplete() { float SafeLanding::loadingProgressPercentage() { Locker lock(_lock); if (_maxTrackedEntityCount > 0) { - float trackedEntityCount = (float)_trackedEntities.size(); + float trackedEntityCount = (float)_trackedEntitiesRenderStatus.size(); return ((_maxTrackedEntityCount - trackedEntityCount) / _maxTrackedEntityCount); } @@ -170,16 +171,18 @@ bool SafeLanding::isEntityPhysicsComplete() { bool SafeLanding::entitiesRenderReady() { Locker lock(_lock); - + auto entityTree = qApp->getEntities(); for (auto entityMapIter = _trackedEntitiesRenderStatus.begin(); entityMapIter != _trackedEntitiesRenderStatus.end(); ++entityMapIter) { auto entity = entityMapIter->second; bool visuallyReady = entity->isVisuallyReady(); qDebug() << "is entityType: " << EntityTypes::getEntityTypeName(entity->getType()) << " " << visuallyReady << " " << entityMapIter->first; - if (visuallyReady) { + if (visuallyReady || !entityTree->renderableForEntityId(entityMapIter->first)) { entityMapIter = _trackedEntitiesRenderStatus.erase(entityMapIter); if (entityMapIter == _trackedEntitiesRenderStatus.end()) { break; } + } else { + entity->requestRenderUpdate(); } } qDebug() << "list size: -> " << _trackedEntitiesRenderStatus.size(); diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index ec46a37a1c..baa20a0583 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -1297,9 +1297,21 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce } }); - // Check for removal ModelPointer model; withReadLock([&] { model = _model; }); + + withWriteLock([&] { + bool visuallyReady = true; + if (_hasModel) { + if (model && _didLastVisualGeometryRequestSucceed) { + visuallyReady = (_prevModelLoaded && _texturesLoaded); + // qDebug() << visuallyReady; + } + } + entity->setVisuallyReady(visuallyReady); + }); + + // Check for removal if (!_hasModel) { if (model) { model->removeFromScene(scene, transaction); @@ -1445,7 +1457,7 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce if (!jointsMapped()) { mapJoints(entity, model->getJointNames()); //else the joint have been mapped before but we have a new animation to load - } else if (_animation && (_animation->getURL().toString() != entity->getAnimationURL())) { + } else if (_animation && (_animation->getURL().toString() != entity->getAnimationURL())) { _animation = DependencyManager::get()->getAnimation(entity->getAnimationURL()); _jointMappingCompleted = false; mapJoints(entity, model->getJointNames()); @@ -1455,11 +1467,6 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce } emit requestRenderUpdate(); } - - withWriteLock([&] { - bool visuallyReady = ((_prevModelLoaded && _texturesLoaded) || model->getURL().isEmpty()); - entity->setVisuallyReady(visuallyReady); - }); } void ModelEntityRenderer::setIsVisibleInSecondaryCamera(bool value) { diff --git a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp index 2f36796f84..cf452c9cf7 100644 --- a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp @@ -291,11 +291,12 @@ void ZoneEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scen bool visuallyReady = true; uint32_t skyboxMode = entity->getSkyboxMode(); - if (skyboxMode == COMPONENT_MODE_ENABLED) { + if (skyboxMode == COMPONENT_MODE_ENABLED && !_skyboxTextureURL.isEmpty()) { bool skyboxLoadedOrFailed = (_skyboxTexture && (_skyboxTexture->isLoaded() || _skyboxTexture->isFailed())); - qDebug() << entity->getEntityItemID() << "------> " << _skyboxTexture->isFailed() << _skyboxTexture->isLoaded() << _skyboxTextureURL.isEmpty(); - visuallyReady = (_skyboxTextureURL.isEmpty() || skyboxLoadedOrFailed); + + visuallyReady = skyboxLoadedOrFailed; } + entity->setVisuallyReady(visuallyReady); if (bloomChanged) { diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index a5e5e7c0a2..cf06e222c9 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -223,7 +223,7 @@ function startInterstitialPage() { if (timer === null) { - updateOverlays(Window.isPhysicsEnabled()); + updateOverlays(false); startAudio(); target = 0; currentProgress = 0.1; @@ -364,7 +364,6 @@ }); function update() { - var downloadInfo = GlobalServices.getDownloadInfo(); var physicsEnabled = Window.isPhysicsEnabled(); var thisInterval = Date.now(); var deltaTime = (thisInterval - lastInterval); @@ -373,14 +372,11 @@ var domainLoadingProgressPercentage = Window.domainLoadingProgress(); var progress = MAX_X_SIZE * domainLoadingProgressPercentage; - //print(progress); - if (progress >= target) { + print(progress); + //if (progress >= target) { target = progress; - } + //} - if (physicsEnabled && target < MAX_X_SIZE) { - target = MAX_X_SIZE; - } currentProgress = lerp(currentProgress, target, 0.2); var properties = { localPosition: { x: (1.85 - (currentProgress / 2) - (-0.029 * (currentProgress / MAX_X_SIZE))), y: -0.935, z: 0.0 }, @@ -391,7 +387,6 @@ }; Overlays.editOverlay(loadingBarProgress, properties); - print(JSON.stringify(downloadInfo)); if ((physicsEnabled && (currentProgress >= (MAX_X_SIZE - EPSILON)))) { updateOverlays((physicsEnabled || connectionToDomainFailed)); endAudio();