Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tileset mixed refinement fix #7099

Merged
merged 4 commits into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Change Log

##### Fixes :wrench:
* Fixed picking for overlapping translucent primitives. [#7039](https:/AnalyticalGraphicsInc/cesium/pull/7039)
* Fixed an issue in the 3D Tiles traversal where tilesets would render with mixed level of detail if an external tileset was visible but its root tile was not. [#7099](https:/AnalyticalGraphicsInc/cesium/pull/7099)
* Fixed an issue in the 3D Tiles traversal where external tilesets would not always traverse to their root tile. [#7035](https:/AnalyticalGraphicsInc/cesium/pull/7035)
* Fixed an issue in the 3D Tiles traversal where empty tiles would be selected instead of their nearest loaded ancestors. [#7011](https:/AnalyticalGraphicsInc/cesium/pull/7011)
* Fixed an issue where scaling near zero with an model animation could cause rendering to stop. [#6954](https:/AnalyticalGraphicsInc/cesium/pull/6954)
Expand Down
7 changes: 7 additions & 0 deletions Source/Scene/Cesium3DTilesetTraversal.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,13 @@ define([
return;
}

if (tile.hasTilesetContent && tile.children.length > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a quick comment to explain why this is needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we're already defining var hasChildren = tile.children.length > 0; on line 334, move it up here?

var child = tile.children[0];
updateTileVisibility(tileset, child, frameState);
tile._visible = child._visible;
return;
}

if (meetsScreenSpaceErrorEarly(tileset, tile, frameState)) {
tile._visible = false;
return;
Expand Down
17 changes: 17 additions & 0 deletions Specs/Scene/Cesium3DTilesetSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,23 @@ defineSuite([
});
});

it('does not select external tileset whose root has invisible children', function() {
return Cesium3DTilesTester.loadTileset(scene, tilesetOfTilesetsUrl).then(function(tileset) {
var center = Cartesian3.fromRadians(centerLongitude, centerLatitude, 50.0);
scene.camera.lookAt(center, new HeadingPitchRange(0.0, 1.57, 1.0));
var root = tileset.root;
var externalRoot = root.children[0];
externalRoot.refine = Cesium3DTileRefine.REPLACE;
scene.renderForSpecs();

expect(isSelected(tileset, root)).toBe(false);
expect(isSelected(tileset, externalRoot)).toBe(false);
expect(root._visible).toBe(false);
expect(externalRoot._visible).toBe(false);
expect(tileset.statistics.numberOfTilesCulledWithChildrenUnion).toBe(1);
});
});

it('does not select visible tiles not meeting SSE with visible children', function() {
return Cesium3DTilesTester.loadTileset(scene, tilesetReplacementWithViewerRequestVolumeUrl).then(function(tileset) {
var root = tileset.root;
Expand Down