@@ -342,11 +342,15 @@ define([
342
342
343
343
// stop traversal when we've attained the desired level of error
344
344
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
+ }
346
350
}
347
351
348
352
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 ;
350
354
var showReplacement = tile . refine === Cesium3DTileRefine . REPLACE && ( childrenVisibility & Cesium3DTileChildrenVisibility . VISIBLE_IN_REQUEST_VOLUME ) !== 0 ;
351
355
352
356
return showAdditive || showReplacement || tile . hasTilesetContent || ! defined ( tile . _ancestorWithContent ) ;
@@ -481,6 +485,7 @@ define([
481
485
482
486
// stop traversal when we've attained the desired level of error
483
487
if ( tile . _screenSpaceError <= maximumScreenSpaceError ) {
488
+ computeChildrenVisibility ( tile , this . frameState , false ) ;
484
489
return emptyArray ;
485
490
}
486
491
@@ -489,6 +494,7 @@ define([
489
494
( ! tile . hasEmptyContent && tile . contentUnloaded ) &&
490
495
defined ( tile . _ancestorWithLoadedContent ) &&
491
496
this . selectionHeuristic ( tileset , tile . _ancestorWithLoadedContent , tile ) ) {
497
+ computeChildrenVisibility ( tile , this . frameState , false ) ;
492
498
return emptyArray ;
493
499
}
494
500
}
@@ -556,7 +562,7 @@ define([
556
562
updateTransforms ( children , tile . computedTransform ) ;
557
563
computeDistanceToCamera ( children , frameState ) ;
558
564
559
- return computeChildrenVisibility ( tile , frameState ) ;
565
+ return computeChildrenVisibility ( tile , frameState , true ) ;
560
566
}
561
567
562
568
function visitTile ( tileset , tile , frameState , outOfCore ) {
@@ -605,7 +611,7 @@ define([
605
611
}
606
612
}
607
613
608
- function computeChildrenVisibility ( tile , frameState ) {
614
+ function computeChildrenVisibility ( tile , frameState , checkViewerRequestVolume ) {
609
615
var flag = Cesium3DTileChildrenVisibility . NONE ;
610
616
var children = tile . children ;
611
617
var childrenLength = children . length ;
@@ -619,15 +625,17 @@ define([
619
625
flag |= Cesium3DTileChildrenVisibility . VISIBLE ;
620
626
}
621
627
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
+ }
631
639
}
632
640
}
633
641
0 commit comments