diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 555461ce74a8..deb903d38608 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -1727,15 +1727,6 @@ define([ cancelOutOfViewRequests(this, frameState); raiseLoadProgressEvent(this, frameState); this._cache.unloadTiles(this, unloadTile); - - var statistics = this._statisticsPerPass[Cesium3DTilePass.RENDER]; - var credits = this._credits; - if (defined(credits) && statistics.selected !== 0) { - var length = credits.length; - for (var i = 0; i < length; ++i) { - frameState.creditDisplay.addCredit(credits[i]); - } - } }; /** @@ -2254,6 +2245,16 @@ define([ // Update pass statistics Cesium3DTilesetStatistics.clone(statistics, passStatistics); + if (isRender) { + var credits = tileset._credits; + if (defined(credits) && statistics.selected !== 0) { + var length = credits.length; + for (var i = 0; i < length; ++i) { + frameState.creditDisplay.addCredit(credits[i]); + } + } + } + return ready; } diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index ff0f5c303fd6..a3a89605b115 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -3198,12 +3198,9 @@ define([ } function prePassesUpdate(scene) { - var frameState = scene._frameState; - frameState.creditDisplay.update(); - frameState.creditDisplay.beginFrame(); - scene._jobScheduler.resetBudgets(); + var frameState = scene._frameState; var primitives = scene.primitives; primitives.prePassesUpdate(frameState); @@ -3212,6 +3209,7 @@ define([ } scene._pickPositionCacheDirty = true; + frameState.creditDisplay.update(); } function postPassesUpdate(scene) { @@ -3220,7 +3218,6 @@ define([ primitives.postPassesUpdate(frameState); RequestScheduler.update(); - frameState.creditDisplay.endFrame(); } var scratchBackgroundColor = new Color(); @@ -3248,6 +3245,8 @@ define([ } frameState.backgroundColor = backgroundColor; + frameState.creditDisplay.beginFrame(); + scene.fog.update(frameState); us.update(frameState); @@ -3293,6 +3292,7 @@ define([ } } + frameState.creditDisplay.endFrame(); context.endFrame(); }