|
@@ -1,4 +1,10 @@
|
|
|
-import { LOADED } from './constants.js';
|
|
|
+import { LOADED, FAILED } from './constants.js';
|
|
|
+
|
|
|
+function isDownloadFinished( value ) {
|
|
|
+
|
|
|
+ return value === LOADED || value === FAILED;
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
// Checks whether this tile was last used on the given frame.
|
|
|
function isUsedThisFrame( tile, frameCount ) {
|
|
@@ -195,7 +201,7 @@ export function markUsedSetLeaves( tile, renderer ) {
|
|
|
|
|
|
if ( isUsedThisFrame( c, frameCount ) ) {
|
|
|
|
|
|
- const childLoaded = ( ! c.__contentEmpty && c.__loadingState === LOADED ) || c.__allChildrenLoaded;
|
|
|
+ const childLoaded = ( ! c.__contentEmpty && isDownloadFinished( c.__loadingState ) ) || c.__allChildrenLoaded;
|
|
|
allChildrenLoaded = allChildrenLoaded && childLoaded;
|
|
|
|
|
|
}
|
|
@@ -253,7 +259,7 @@ export function skipTraversal( tile, renderer ) {
|
|
|
const errorRequirement = ( renderer.errorTarget + 1 ) * renderer.errorThreshold;
|
|
|
const meetsSSE = tile.__error <= errorRequirement;
|
|
|
const hasContent = ! tile.__contentEmpty;
|
|
|
- const loadedContent = tile.__loadingState === LOADED && ! tile.__contentEmpty;
|
|
|
+ const loadedContent = isDownloadFinished( tile.__loadingState ) && ! tile.__contentEmpty;
|
|
|
const childrenWereVisible = tile.__childrenWereVisible;
|
|
|
const children = tile.children;
|
|
|
let allChildrenHaveContent = tile.__allChildrenLoaded;
|
|
@@ -277,7 +283,9 @@ export function skipTraversal( tile, renderer ) {
|
|
|
// all children have loaded yet, and if no children were visible last frame. We want to keep children visible
|
|
|
// that _were_ visible to avoid a pop in level of detail as the camera moves around and parent / sibling tiles
|
|
|
// load in.
|
|
|
- if ( meetsSSE && ! allChildrenHaveContent && ! childrenWereVisible ) {
|
|
|
+
|
|
|
+ // Skip the tile entirely if there's no content to load
|
|
|
+ if ( meetsSSE && ! allChildrenHaveContent && ! childrenWereVisible && hasContent ) {
|
|
|
|
|
|
if ( loadedContent ) {
|
|
|
|