xzw 2 rokov pred
rodič
commit
9d498e98ce

+ 2 - 4
src/ExtendPointCloudOctree.js

@@ -197,10 +197,8 @@ export class ExtendPointCloudOctree extends PointCloudOctree{
 		material.fov = camera.fov * (Math.PI / 180);
 		/* material.screenWidth = renderer.domElement.clientWidth;
 		material.screenHeight = renderer.domElement.clientHeight; */
-        material.resolution = resolution
-        
-        
-		//material.spacing = this.pcoGeometry.spacing; // * Math.max(this.scale.x, this.scale.y, this.scale.z);  //应该不需要
+        material.resolution = resolution 
+		material.spacing = this.pcoGeometry.spacing; // * Math.max(this.scale.x, this.scale.y, this.scale.z); 
 		material.near = camera.near;
 		material.far = camera.far;
 		material.uniforms.octreeSize.value = this.pcoGeometry.boundingBox.getSize(new THREE.Vector3()).x;

+ 3 - 1
src/materials/shaders/pointcloud_new.fs

@@ -153,7 +153,9 @@ void main() {
 		float expDepth = pos.z;
 		depth = (pos.z + 1.0) / 2.0;
 		gl_FragDepthEXT = depth;
-		
+		gl_FragDepthEXT = clamp(gl_FragDepthEXT, 0.0, 1.0);  //add
+        
+        
 		#if defined(color_type_depth)
 			color.r = linearDepth;
 			color.g = expDepth;

+ 13 - 0
改bug的历史.txt

@@ -3,9 +3,22 @@
 
 
 
+2023.6.16
+iphone支持 EXT_DEPTH 的 orthoCamera下, paraboloid_point_shape形状的 点云绘制不出。导致无法pick出点云位置
 
+因为不支持的曾经加过这个:
+if(!Features.EXT_DEPTH.isSupported() && this.shape === PointShape.PARABOLOID){
+    this.shape = PointShape.SQUARE ;//强行替换
+}
 
 
+结果:在#if defined paraboloid_point_shape处添加一行:
+gl_FragDepthEXT = clamp(gl_FragDepthEXT, 0.0, 1.0);
+这句在解决ios16全景里经常有黑块是一样的处理方式。
+
+--------------------------------------------------------------
+另外将depthBasicMaterial和线的resolution改为了resolution2否则手机的遮挡错误。但是为何之前没事?且专门记录了应该使用resolution
+
 
 
 2023.4.21