Browse Source

Merge branch 'xj' of http://192.168.0.115:3000/bill/fuse-code into xj

bill 1 năm trước cách đây
mục cha
commit
9b1c0aeec9
3 tập tin đã thay đổi với 37 bổ sung24 xóa
  1. 34 21
      public/lib/potree/potree.js
  2. 1 1
      public/lib/potree/potree.js.map
  3. 2 2
      src/sdk/cover/index.js

+ 34 - 21
public/lib/potree/potree.js

@@ -73865,7 +73865,7 @@ void main()
 
 
 
-	Utils.loadSkybox = function(path, oldSky ) {
+	Utils.loadSkybox = function(path, oldSky, callback ) {
 	    let  camera, scene, parent , cameraOrtho;
 	    if(!oldSky){
 	        parent = new Object3D("skybox_root");
@@ -73918,7 +73918,8 @@ void main()
 	        texture.flipY = false; 
 	        texture.magFilter = LinearFilter;
 	        texture.minFilter = LinearFilter;
-	        scene.children[0].material.uniforms.tDiffuse.value = texture;  
+	        scene.children[0].material.uniforms.tDiffuse.value = texture; 
+	        callback && callback();
 	        viewer.dispatchEvent('content_changed');
 	    },null,(e)=>{//error
 	        console.error('loadSkybox失败',path); 
@@ -77702,7 +77703,10 @@ void main()
 	    pickFrontPointRatio:config$1.pickFrontPointRatio, //默认pick点云时选中靠近镜头的点的偏向
 	    dragPolyBeyondPoint: browser.urlHasValue('dragPolyBeyondPoint'),  //ctrlPolygon是否可以拖拽到没点云的地方
 	    panoZoomByPointer: false,//全景图是否定点缩放
-	    areaAtNotPlane: false
+	    areaAtNotPlane: false,
+	    
+	    
+	    fastTran: isTest
 	};
 
 
@@ -81699,7 +81703,7 @@ void main()
             uniform float modelAlpha;
             uniform float opacity;
             uniform float progress;
-            uniform int blackout;
+            uniform int tranType;
             uniform vec3 pano0Position;
             uniform vec3 pano1Position;
             uniform float maxDistance;
@@ -81787,16 +81791,18 @@ void main()
             {
                 vec3 vWorldPosition0N = normalize(vWorldPosition0);
                 vec3 vWorldPosition1N = normalize(vWorldPosition1);
-               
+                float progress_ = progress;
                 
                 vec4 colorFromPano0 = vec4(0.0,0.0,0.0,0.0);
                 #if defined(usePanoMap0)
                     //即progress < 1.0   通常是1
                     colorFromPano0=textureCube(pano0Map,vWorldPosition0N.xyz);
+                #else 
+                    progress_ = 1.0;
                 #endif
                 vec4 colorFromPano1=textureCube(pano1Map,vWorldPosition1N.xyz);
  
-                gl_FragColor = mix(colorFromPano0,colorFromPano1,progress);
+                gl_FragColor = mix(colorFromPano0,colorFromPano1,progress_);
               
               
                 
@@ -81819,7 +81825,7 @@ void main()
                     vec2 depth1 = getDepth(vWorldPosition1N, depthMap1, cameraHeight1, ceilHeight1, eyePos);
                     
                     
-                    gl_FragDepthEXT = mix(depth0.y,depth1.y,progress); 
+                    gl_FragDepthEXT = mix(depth0.y,depth1.y,progress_); 
                     gl_FragDepthEXT = clamp(gl_FragDepthEXT, 0.0, 1.0);    //防止部分手机出现黑块。ios 16  。 因为我给的超远值超出范围
                     
 
@@ -86550,7 +86556,7 @@ void main()
 	        this.node.name = 'ImagesNode';
 	         
 	        this.cubePanos = [];
-	        
+	        //this.fastTranMaskPass = new THREE.TransitionPass()
 	        
 	        {
 	            this.cube = new Mesh(new BoxBufferGeometry(1,1,1,1),new ModelTextureMaterial());
@@ -87359,6 +87365,9 @@ void main()
 	            this.dispatchEvent({type:'flyToPano', toPano});
 	            
 	             
+	             
+	            Potree.settings.fastTran && viewer.scene.view.position.copy(endPosition);
+	             
 	            viewer.scene.view.setView({position:endPosition, target, quaternion:toPano.quaternion , duration:toPano.duration,  
 	                onUpdate:(progress_, delta)=>{
 	                    
@@ -159500,10 +159509,12 @@ ENDSEC
 	                this.fxaaPass.renderToScreen = true;
 	                
 					this.composer.addPass( this.fxaaPass );  */
-	                //抗锯齿截图 效果时而好时而不好,文字比较模糊
+	                //抗锯齿截图 效果时而好时而不好,文字比较模糊 
+	                //这两个暂时不能一起用。目前刚好不需要一起用
 	                
 	                
-	                //这两个暂时不能一起用。目前刚好不需要一起用
+	                //this.composer.addPass(this.images360.fastTranMaskPass)//add
+	                
 	                
 	            }
 	            
@@ -160682,10 +160693,11 @@ ENDSEC
 
 			if(bg === "skybox"){
 	            if(!src)src = Potree.resourcePath+'/textures/skybox/xingkong.jpg';
-				this.skybox = Utils.loadSkybox(src, this.skybox);
-			} 
-
-			this.background = bg;
+				this.skybox = Utils.loadSkybox(src, this.skybox, ()=>{
+	                this.background = bg;
+	            });
+			}else {  this.background = bg;
+	        }
 	        this.backgroundOpacity = 1;//add
 			this.dispatchEvent({'type': 'background_changed', 'viewer': this});
 		}
@@ -162622,7 +162634,9 @@ ENDSEC
 	            viewports = viewports.filter(v=>v.active); 
 	            if(viewports.length > 0){   
 	                params.viewports = viewports;  
-	                if(this.outlinePass.selectedObjects.length && this.outlinePass.edgeStrength > 0 && !params.screenshot){  
+	                if(this.outlinePass.selectedObjects.length && this.outlinePass.edgeStrength > 0 && !params.screenshot 
+	                   // || this.images360.fastTranMaskPass.enabled
+	                ){  
 	                    let scenes = this.inputHandler.interactiveScenes.concat(this.scene.scene).concat(viewer.scene.scenePointCloud); 
 	                    this.composer.render(scenes, null, this.viewports, this.renderDefault.bind(this));  
 	                }else {  
@@ -164331,14 +164345,13 @@ ENDSEC
 	                    //console.log(child.name, 'roughness',child.material.roughness,'metalness',child.material.metalness)
 	                       
 
-	                     //暂时用这种材质:
-	                    if(fileInfo_.unlit && (!(child.material instanceof MeshBasicMaterial) || object.fileType == 'glb')){
+	                     
+	                    /* if(fileInfo_.unlit && (!(child.material instanceof BasicMaterial) || object.fileType == 'glb')){ //注释掉是因为已经写入到loader文件里了
 	                        //let material = new THREE.MeshBasicMaterial({map:child.material.map})
-	                        let material = new BasicMaterial({map : child.material.map});  //很奇怪glb的图会使原本的MeshBasicMaterial 会偏暗,所以自己重新写
-	                        
+	                        let material = new BasicMaterial({map : child.material.map, opacity:child.material.opacity})  //很奇怪glb的图会使原本的MeshBasicMaterial 会偏暗,所以自己重新写
 	                        //child.material.dispose()
-	                        child.material = material; 
-	                    } 
+	                        child.material = material 
+	                    } */ 
 	                    if(fileInfo_.useStandandMat && !(child.material instanceof MeshStandardMaterial)){
 	                        child.material = new MeshStandardMaterial();
 	                    } 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
public/lib/potree/potree.js.map


+ 2 - 2
src/sdk/cover/index.js

@@ -399,7 +399,7 @@ export const enter = (dom, mapDom, isLocal, lonlat) => {
          
  
         setBackdrop(sky, type, {scale,rotate}){//天空盒背景
-            //console.log('天空盒背景',  sky,type)
+            console.log('天空盒背景',  sky,type)
             
             let setGroundAndText = (color)=>{
                 MergeEditor.secondCompass.dom.find(".dirText").css({'color':color})
@@ -576,7 +576,7 @@ export const enter = (dom, mapDom, isLocal, lonlat) => {
                 readyToAddModel = true 
                 
                 //0看看,1看见,2深时,3用户上传三维模型,4深时mesh,5深光点云,6深光mesh
-                if(props.fromType == 4 || props.fromType == 6 ){//来自4dkk的3dtiles初始需要转90度
+                if(props.fromType == 1 || props.fromType == 4 || props.fromType == 6 ){//来自4dkk的3dtiles初始需要转90度
                     props.rotation = new THREE.Euler(Math.PI/2, 0,0)
                 }
             }