From 11987415198347145dc6a4b6fffcc6b1efffd28f Mon Sep 17 00:00:00 2001 From: hpinkos Date: Tue, 14 Aug 2018 12:27:53 -0400 Subject: [PATCH 1/2] invalidate tiles at frame start --- Source/Scene/QuadtreePrimitive.js | 11 +++++------ Specs/Scene/GlobeSurfaceTileProviderSpec.js | 4 +++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/Scene/QuadtreePrimitive.js b/Source/Scene/QuadtreePrimitive.js index 9ed7a6ce0aeb..475051cb1c70 100644 --- a/Source/Scene/QuadtreePrimitive.js +++ b/Source/Scene/QuadtreePrimitive.js @@ -300,6 +300,11 @@ define([ return; } + if (this._tilesInvalidated) { + invalidateAllTiles(this); + this._tilesInvalidated = false; + } + // Gets commands for any texture re-projections this._tileProvider.initialize(frameState); @@ -376,16 +381,10 @@ define([ return; } - if (this._tilesInvalidated) { - invalidateAllTiles(this); - } - // Load/create resources for terrain and imagery. Prepare texture re-projections for the next frame. processTileLoadQueue(this, frameState); updateHeights(this, frameState); updateTileLoadProgress(this, frameState); - - this._tilesInvalidated = false; }; /** diff --git a/Specs/Scene/GlobeSurfaceTileProviderSpec.js b/Specs/Scene/GlobeSurfaceTileProviderSpec.js index c287014611dd..00919c6f7c80 100644 --- a/Specs/Scene/GlobeSurfaceTileProviderSpec.js +++ b/Specs/Scene/GlobeSurfaceTileProviderSpec.js @@ -674,12 +674,14 @@ defineSuite([ var surface = scene.globe._surface; var replacementQueue = surface._tileReplacementQueue; expect(replacementQueue.count).toBeGreaterThan(0); + var oldTile = replacementQueue.head; surface.tileProvider.terrainProvider = new EllipsoidTerrainProvider(); scene.renderForSpecs(); - expect(replacementQueue.count).toBe(0); + expect(replacementQueue.count).toBeGreaterThan(0); + expect(replacementQueue.head).not.toBe(oldTile); }); }); From 4eee6966b9a55e48d4746ef4afbdac1e69d706e4 Mon Sep 17 00:00:00 2001 From: hpinkos Date: Tue, 14 Aug 2018 16:11:47 -0400 Subject: [PATCH 2/2] Update CHANGES.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index d7220293c779..31b15f03dd6b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,6 +23,7 @@ Change Log * Improved `Plane` entities so they are better aligned with the globe surface [#6887](https://github.com/AnalyticalGraphicsInc/cesium/pull/6887) * Fixed crash when rendering translucent objects when all shadow maps in the scene set `fromLightSource` to false. [#6883](https://github.com/AnalyticalGraphicsInc/cesium/pull/6883) * Fixed night shading in 2D and Columbus view. [#4122](https://github.com/AnalyticalGraphicsInc/cesium/issues/4122) +* Fixed crash that happened when calling `scene.pick` after setting a new terrain provider [#6918](https://github.com/AnalyticalGraphicsInc/cesium/pull/6918) ### 1.48 - 2018-08-01