Skip to content

Commit c2ca6ff

Browse files
committed
fix root of tileset of tilesets
1 parent 2b858d6 commit c2ca6ff

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

Source/Scene/Cesium3DTilesetTraversal.js

+21-13
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,15 @@ define([
342342

343343
// stop traversal when we've attained the desired level of error
344344
if (tile._screenSpaceError <= this.baseScreenSpaceError) {
345-
return false;
345+
// When skipping LODs, require an existing base level of content first
346+
if (tileset.skipLODs && tile.hasRenderableContent) {
347+
computeChildrenVisibility(tile, this.frameState, false);
348+
return false;
349+
}
346350
}
347351

348352
var childrenVisibility = updateChildren(tileset, tile, this.frameState);
349-
var showAdditive = tile.refine === Cesium3DTileRefine.ADD;
353+
var showAdditive = tile.refine === Cesium3DTileRefine.ADD && tile._screenSpaceError > this.baseScreenSpaceError;
350354
var showReplacement = tile.refine === Cesium3DTileRefine.REPLACE && (childrenVisibility & Cesium3DTileChildrenVisibility.VISIBLE_IN_REQUEST_VOLUME) !== 0;
351355

352356
return showAdditive || showReplacement || tile.hasTilesetContent || !defined(tile._ancestorWithContent);
@@ -481,6 +485,7 @@ define([
481485

482486
// stop traversal when we've attained the desired level of error
483487
if (tile._screenSpaceError <= maximumScreenSpaceError) {
488+
computeChildrenVisibility(tile, this.frameState, false);
484489
return emptyArray;
485490
}
486491

@@ -489,6 +494,7 @@ define([
489494
(!tile.hasEmptyContent && tile.contentUnloaded) &&
490495
defined(tile._ancestorWithLoadedContent) &&
491496
this.selectionHeuristic(tileset, tile._ancestorWithLoadedContent, tile)) {
497+
computeChildrenVisibility(tile, this.frameState, false);
492498
return emptyArray;
493499
}
494500
}
@@ -556,7 +562,7 @@ define([
556562
updateTransforms(children, tile.computedTransform);
557563
computeDistanceToCamera(children, frameState);
558564

559-
return computeChildrenVisibility(tile, frameState);
565+
return computeChildrenVisibility(tile, frameState, true);
560566
}
561567

562568
function visitTile(tileset, tile, frameState, outOfCore) {
@@ -605,7 +611,7 @@ define([
605611
}
606612
}
607613

608-
function computeChildrenVisibility(tile, frameState) {
614+
function computeChildrenVisibility(tile, frameState, checkViewerRequestVolume) {
609615
var flag = Cesium3DTileChildrenVisibility.NONE;
610616
var children = tile.children;
611617
var childrenLength = children.length;
@@ -619,15 +625,17 @@ define([
619625
flag |= Cesium3DTileChildrenVisibility.VISIBLE;
620626
}
621627

622-
if (!child.insideViewerRequestVolume(frameState)) {
623-
if (isVisible(visibilityMask)) {
624-
flag |= Cesium3DTileChildrenVisibility.VISIBLE_NOT_IN_REQUEST_VOLUME;
625-
}
626-
visibilityMask = CullingVolume.MASK_OUTSIDE;
627-
} else {
628-
flag |= Cesium3DTileChildrenVisibility.IN_REQUEST_VOLUME;
629-
if (isVisible(visibilityMask)) {
630-
flag |= Cesium3DTileChildrenVisibility.VISIBLE_IN_REQUEST_VOLUME;
628+
if (checkViewerRequestVolume) {
629+
if (!child.insideViewerRequestVolume(frameState)) {
630+
if (isVisible(visibilityMask)) {
631+
flag |= Cesium3DTileChildrenVisibility.VISIBLE_NOT_IN_REQUEST_VOLUME;
632+
}
633+
visibilityMask = CullingVolume.MASK_OUTSIDE;
634+
} else {
635+
flag |= Cesium3DTileChildrenVisibility.IN_REQUEST_VOLUME;
636+
if (isVisible(visibilityMask)) {
637+
flag |= Cesium3DTileChildrenVisibility.VISIBLE_IN_REQUEST_VOLUME;
638+
}
631639
}
632640
}
633641

0 commit comments

Comments
 (0)