Garrett Johnson před 5 roky
rodič
revize
2c5a2e1b13
2 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 3 0
      src/base/traverseFunctions.js
  2. 4 0
      src/three/TilesRenderer.js

+ 3 - 0
src/base/traverseFunctions.js

@@ -161,6 +161,9 @@ export function markUsedSetLeaves( tile, renderer ) {
 
 	if ( ! anyChildrenUsed ) {
 
+		// TODO: This isn't necessarily right because it's possible that a parent tile is considered in the
+		// frustum while the child tiles are not, making them unused. If all children have loaded and were properly
+		// considered to be in the used set then we shouldn't set ourselves to a leaf here.
 		tile.__isLeaf = true;
 
 		// TODO: stats

+ 4 - 0
src/three/TilesRenderer.js

@@ -401,9 +401,13 @@ export class TilesRenderer extends TilesRendererBase {
 
 	disposeTile( tile ) {
 
+		// This could get called before the tile has finished downloading
 		const cached = tile.cached;
 		if ( cached.scene ) {
 
+			// TODO: This should never get called if the scene hasn't been removed from the scene yet, right?
+			// TODO: this can possibly be slow because so many discard can happen at once -- maybe iteratively do it? Or lower the eviction ratio / put a cap
+			// on the amount disposed per frame.
 			const scene = cached.scene;
 			const materials = cached.materials;
 			const geometry = cached.geometry;