From 199b235fdc2a0dbf827459f02c6fae342df83f6d Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 27 Nov 2018 21:31:40 -0500 Subject: [PATCH 1/2] Fix visibility check --- Source/Scene/Cesium3DTileset.js | 3 +++ Source/Scene/Cesium3DTilesetTraversal.js | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js index 8b394390f0b6..c374c278f179 100644 --- a/Source/Scene/Cesium3DTileset.js +++ b/Source/Scene/Cesium3DTileset.js @@ -187,6 +187,7 @@ define([ this._selectedTilesToStyle = []; this._loadTimestamp = undefined; this._timeSinceLoad = 0.0; + this._updatedVisibilityFrame = 0; this._extras = undefined; this._cullWithChildrenBounds = defaultValue(options.cullWithChildrenBounds, true); @@ -1944,6 +1945,8 @@ define([ tileset._cache.reset(); } + ++tileset._updatedVisibilityFrame; + var ready; if (isAsync) { diff --git a/Source/Scene/Cesium3DTilesetTraversal.js b/Source/Scene/Cesium3DTilesetTraversal.js index e9c0a0e962fe..c206ac8a31b1 100644 --- a/Source/Scene/Cesium3DTilesetTraversal.js +++ b/Source/Scene/Cesium3DTilesetTraversal.js @@ -217,14 +217,14 @@ define([ } function updateVisibility(tileset, tile, frameState) { - if (tile._updatedVisibilityFrame === frameState.frameNumber) { + if (tile._updatedVisibilityFrame === tileset._updatedVisibilityFrame) { // Return early if visibility has already been checked during the traversal. // The visibility may have already been checked if the cullWithChildrenBounds optimization is used. return; } tile.updateVisibility(frameState); - tile._updatedVisibilityFrame = frameState.frameNumber; + tile._updatedVisibilityFrame = tileset._updatedVisibilityFrame; } function anyChildrenVisible(tileset, tile, frameState) { @@ -470,7 +470,6 @@ define([ visitTile(tileset, tile, frameState); touchTile(tileset, tile, frameState); tile._refines = refines; - tile._updatedVisibilityFrame = 0; // Reset so visibility is checked during the next pass which may use a different camera } } From 6520c1474d6d7b1b376293f43537176ac41e37fc Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 4 Dec 2018 11:04:06 -0500 Subject: [PATCH 2/2] Updated CHANGES.md --- CHANGES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 33a24e094fee..e8b43135cda3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,11 @@ Change Log ========== +### 1.53 - 2019-01-02 + +##### Fixes :wrench: +* Fixed 3D Tiles visibility checking when running multiple passes within the same frame. [#7289](https://github.com/AnalyticalGraphicsInc/cesium/pull/7289) + ### 1.52 - 2018-12-03 ##### Breaking Changes :mega: