Browse Source

prioritize downloading tiles in frame before those out of frame

Garrett Johnson 4 years ago
parent
commit
d94a2f3921
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/base/TilesRendererBase.js

+ 5 - 0
src/base/TilesRendererBase.js

@@ -19,6 +19,11 @@ const priorityCallback = ( a, b ) => {
 		// the lastFrameVisited tracks the last frame where a tile was used
 		// the lastFrameVisited tracks the last frame where a tile was used
 		return a.__lastFrameVisited - b.__lastFrameVisited;
 		return a.__lastFrameVisited - b.__lastFrameVisited;
 
 
+	} else if ( a.__inFrustum !== b.__inFrustum ) {
+
+		// prioritize loading whatever is in the frame
+		return a.__inFrustum ? 1 : - 1;
+
 	} else if ( a.__error !== b.__error ) {
 	} else if ( a.__error !== b.__error ) {
 
 
 		// tiles which have greater error next
 		// tiles which have greater error next