xzw 2 年之前
父节点
当前提交
fdb849d075

+ 4 - 4
src/custom/materials/ModelTextureMaterial.js

@@ -365,14 +365,14 @@ export default class ModelTextureMaterial extends THREE.RawShaderMaterial {
         
         
         if(pano0){
-            this.uniforms.pano0Map.value = pano0.skyboxTex ; 
+            this.uniforms.pano0Map.value = pano0.entered ? pano0.skyboxTex : null;  
             this.uniforms.pano0Position.value.copy(pano0.position)
             this.uniforms.pano0Matrix.value.copy(pano0.panoMatrix/* pano0.mesh.matrixWorld */ ); 
-            //pano1.ensureSkyboxReadyForRender();
+          
         }
         
 		
-		this.uniforms.pano1Map.value = pano1.skyboxTex  
+		this.uniforms.pano1Map.value = pano1.skyboxTex 
 		this.uniforms.pano1Position.value.copy(pano1.position)
 		this.uniforms.pano1Matrix.value.copy(pano1.panoMatrix /* pano1.mesh.matrixWorld */ );
         
@@ -402,7 +402,7 @@ export default class ModelTextureMaterial extends THREE.RawShaderMaterial {
             this.uniforms.ceilHeight0.value = this.pano0.getCeilHeight() - this.pano0.position.z  
         }
         if(this.pano1){ 
-            this.uniforms.depthMap1.value = this.pano1.entered ? this.pano1.depthTex : null;
+            this.uniforms.depthMap1.value = this.pano1.depthTex 
             this.uniforms.cameraHeight1.value = this.pano1.floorPosition.distanceTo(this.pano1.position)
             this.uniforms.ceilHeight1.value = this.pano1.getCeilHeight() - this.pano1.position.z  
         } 

+ 8 - 2
src/custom/modules/panos/Images360.js

@@ -795,7 +795,7 @@ export class Images360 extends THREE.EventDispatcher{
                     done(true);
                    
                     this.updateDepthTex(this.currentPano)
-                    
+                    this.updateProjectedPanos()//dispose
                     
                     
                 }, 
@@ -2110,5 +2110,11 @@ Images360.prototype.updateCube = (function(){//增加细分的版本,且垂直
     } 
 })()
 
-    
+/* 
+
+
+检查贴图是否释放:
+
+viewer.images360.panos.filter(e=>e.skyboxTex && e.skyboxTex._listeners && e.skyboxTex._listeners.dispose && e.skyboxTex._listeners.dispose.length) 
 
+*/

+ 3 - 28
src/custom/modules/panos/Panorama.js

@@ -381,7 +381,7 @@ class Panorama extends THREE.EventDispatcher{
     } 
 
     exit(){   
-        
+        this.skyboxTex && this.skyboxTex.dispose() 
         this.depthTex && this.depthTex.dispose()  //贴图不使用后先dispose,下次到该点时会自动还原
         this.entered = false //add
         
@@ -402,18 +402,7 @@ class Panorama extends THREE.EventDispatcher{
         this.floorPosition && this.label.position.copy(this.floorPosition)
     }
     
-    addLabel2(){  
-        if(this.label2)return
-        this.label2 = new TextSprite(Object.assign({},
-           labelProp2, {text: /* this.originID  */   parseInt(this.id)+1   }) //{text: `id:${this.id}, dataset:${this.pointcloud.name}, 4dkkId:${this.originID}`}
-        ); 
-        this.images360.node.add(this.label2);
-        this.floorPosition && this.label2.position.copy(this.floorPosition)
-        let s = 0.4
-        this.label2.scale.set(s,s,s)
-        Potree.Utils.updateVisible(this.label2, 'notDisplay', false)
-        Potree.Utils.updateVisible(this.label2, 'panoVisi', this.visible)
-    }
+     
     
     removeTextLabel(){
         if(this.label){ 
@@ -421,21 +410,7 @@ class Panorama extends THREE.EventDispatcher{
         }
     }
     
-    dispose(){
-        
-        let i = viewer.images360.panos.indexOf(this);
-        if(i==-1)return
-        
-        this.marker.parent.remove(this.marker)
-        
-        
-        this.removeTextLabel()
-        if(this.depthTex) this.depthTex.dispose()
-        viewer.images360.panos.splice(i,1);
-        
-        this.dispatchEvent('dispose')
-        //删除tile贴图、depthTex等以后再写
-    }
+     
     
     
     getCeilHeight(){//天花板高度值   (假设不存在depth为0的点,所有为0的要么是在盲区,要么是无穷远。)