xzw 2 лет назад
Родитель
Сommit
84a57f0d14

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

@@ -97,9 +97,7 @@ export class Images360 extends THREE.EventDispatcher{
         
         
         this.depthSampler = new DepthImageSampler(); 
-        this.addEventListener('loadedDepthImg',(e)=>{
-            e.loaded && this.updateDepthTex(e.pano)
-        })
+        
         
         
         
@@ -307,20 +305,16 @@ export class Images360 extends THREE.EventDispatcher{
                         if(config2.showSkybox || config2.pointUsePanoTex){ 
                             let wait = (e)=> {
                                 viewer.ifAllLoaded()                                         
-                                if(e.pano && e.pano != this.currentPano)return//loadedDepthImg
+                                //if(e.pano && e.pano != this.currentPano)return//loadedDepthImg
                                 setTimeout( ()=>{
                                     if(this.latestRequestMode == mode ){
                                         Potree.settings.displayMode = mode 
                                     }
                                 },1) 
                             }
-                            if(!this.currentPano.depthTex && this.currentPano.pointcloud.hasDepthTex){
-                                this.addEventListener('loadedDepthImg', wait, {once:true})  
-                                pano.waitForLoad()                                 
-                                return this.currentPano.loadDepthImg()
-                            } 
+                            /* 
                             //this.updateDepthTex()  
-                            /* if(this.checkAndWaitForPanoLoad(this.currentPano,  this.basePanoSize, wait)){
+                            if(this.checkAndWaitForPanoLoad(this.currentPano,  this.basePanoSize, wait)){
                                 return
                             } */ 
                             if(!this.currentPano.skyboxTex){
@@ -673,9 +667,9 @@ export class Images360 extends THREE.EventDispatcher{
         
         {//不飞的话是否不要执行这段?
             
-            let wait = (e)=> { 
+            let wait = ( )=> { 
                 viewer.ifAllLoaded() 
-                if(e.pano && this.latestToPano && e.pano != this.latestToPano.pano)return//loadedDepthImg
+                if( this.latestToPano && pano != this.latestToPano.pano)return//loadedDepthImg
                 if(this.latestToPano != toPano)return /* Potree.Log('已经取消') *///如果取消了
                 setTimeout(()=>{ 
                     if(this.latestToPano != toPano)return
@@ -684,7 +678,7 @@ export class Images360 extends THREE.EventDispatcher{
             }
             if(!pano.depthTex && pano.pointcloud.hasDepthTex){ //点云模式也要加载depthTex,因获取neighbour需要用到
                 //console.log('等待加载depthtex')
-                this.addEventListener('loadedDepthImg', wait, {once:true}) 
+                pano.addEventListener('loadedDepthImg', wait, {once:true}) 
                 pano.waitForLoad() 
                 return pano.loadDepthImg()
             }
@@ -697,7 +691,7 @@ export class Images360 extends THREE.EventDispatcher{
                 
                 if(!pano.skyboxTex){
                     pano.waitForLoad() 
-                    this.addEventListener('loadedTex', wait, {once:true})     
+                    pano.addEventListener('loadedTex', wait, {once:true})     
                     pano.loadTex()
                 }
                 /* if(this.checkAndWaitForPanoLoad(pano, toPano.basePanoSize || this.basePanoSize,  wait )){

+ 5 - 4
src/custom/modules/panos/Panorama.js

@@ -196,13 +196,13 @@ class Panorama extends THREE.EventDispatcher{
         //console.log('开始下载depthImg', this.id)
         let texture = texLoader.load( src, ()=>{
             this.skyboxTex = texture
-            this.images360.dispatchEvent({type:'loadedTex', pano:this, loaded:true})
+            this.dispatchEvent({type:'loadedTex', pano:this, loaded:true})
             this.depthTexLoading = false
             //viewer.dispatchEvent('content_changed') 
         },null,(e)=>{//error
             console.error('loadTex失败, 数据集sceneCode'+ this.pointcloud.sceneCode,  this.id )
              
-            this.images360.dispatchEvent({type:'loadedTex', pano:this, })
+            this.dispatchEvent({type:'loadedTex', pano:this, })
         });
         texture.wrapS = THREE.RepeatWrapping;
         texture.flipY = false 
@@ -222,13 +222,14 @@ class Panorama extends THREE.EventDispatcher{
         //console.log('开始下载depthImg', this.id)
         let texture = texLoader.load( src, ()=>{
             this.depthTex = texture
-            this.images360.dispatchEvent({type:'loadedDepthImg', pano:this, loaded:true})
+            this.dispatchEvent({type:'loadedDepthImg', pano:this, loaded:true})
             this.depthTexLoading = false
+            this.images360.updateDepthTex(this)
             //viewer.dispatchEvent('content_changed') 
         },null,(e)=>{//error
             console.error('loadDepthImg失败, 数据集sceneCode'+ this.pointcloud.sceneCode,  this.id )
             this.pointcloud.hasDepthTex = false
-            this.images360.dispatchEvent({type:'loadedDepthImg', pano:this, })
+            this.dispatchEvent({type:'loadedDepthImg', pano:this, })
         });
         texture.wrapS = THREE.RepeatWrapping;
         texture.flipY = false 

+ 1 - 1
src/custom/potree.shim.js

@@ -1385,7 +1385,7 @@ Potree.updateVisibility = function(pointclouds, camera, areaSize){
 				  
                 
                 let addPow = viewer.mainViewport.view.isFlying() ? 0 : 0.5  //0-0.5,正常原本是0. 数字越大近处加载越快。但会造成远处加载慢甚至因pointBudge限制不加载。  isFlying:漫游时需要尽量加载一下远处的点云
-                addPow *= window.devicePixelRatio    //devicePixelRatio高的手机需要优先加载最近的高级点云,减少远处的中高级点云。
+                //addPow *= window.devicePixelRatio    //devicePixelRatio高的手机需要优先加载最近的高级点云,减少远处的中高级点云。
 				let distance = Math.pow(dd,0.5+addPow)//Math.sqrt(dd); //提高距离权重,为了提高近处加载速度。   某些场景近处加载慢优化明显,如SS-t-cqCAL6rJ5i 
 				
 				//let attenuateDis = 10;//add

+ 1 - 1
src/viewer/EDLRendererNew.js

@@ -197,7 +197,7 @@ export class EDLRenderer{//Eye-Dome Lighting 眼罩照明
         
         let target = params.target || null
         
-		const resolution = rtEDL ? new THREE.Vector2(rtEDL.width,rtEDL.height) : params.viewport ? params.viewport.resolution : this.viewer.renderer.getSize(new THREE.Vector2());//突然发现mobile用resolution2点云会放大
+		const resolution = rtEDL ? new THREE.Vector2(rtEDL.width,rtEDL.height) : params.viewport ? params.viewport.resolution2 : this.viewer.renderer.getSize(new THREE.Vector2());//突然发现mobile用resolution2点云会放大