@jdultra/threedtiles 14.0.3 → 14.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1124,7 +1124,7 @@ self.onmessage = function(I) {
1124
1124
  }
1125
1125
  };
1126
1126
  //# sourceMappingURL=PointsManager.worker-dH1fNyu8.js.map
1127
- `,qC=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",ua],{type:"text/javascript;charset=utf-8"});function Vt(B){let A;try{if(A=qC&&(self.URL||self.webkitURL).createObjectURL(qC),!A)throw"";const g=new Worker(A,{type:"module",name:B?.name});return g.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(A)}),g}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(ua),{type:"module",name:B?.name})}}new d.Vector3,new d.Vector3;const la=new d.Matrix3;la.set(1,0,0,0,0,1,0,-1,0);const zt=new d.Matrix4().set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);function eQ(B,A){return(d.DataUtils.toHalfFloat(B)|d.DataUtils.toHalfFloat(A)<<16)>>>0}class fa extends d.Mesh{constructor(A,g,I){const C=Math.min(Math.ceil(4)*1024,Math.pow(1024,2));let E=1*Math.pow(1024,2);E=Math.floor(E/C)*C;const a=new d.WebGL3DRenderTarget(1024,1024,1,{magFilter:d.NearestFilter,minFilter:d.NearestFilter,type:d.UnsignedIntType,format:d.RGBAIntegerFormat,anisotropy:0,depthBuffer:!1,resolveDepthBuffer:!1});a.texture.type=d.UnsignedIntType,a.texture.format=d.RGBAIntegerFormat,a.texture.internalFormat="RGBA32UI",A.initRenderTarget(a);const i=new d.WebGL3DRenderTarget(1024,1024,1,{magFilter:d.NearestFilter,minFilter:d.NearestFilter,anisotropy:0,type:d.UnsignedIntType,format:d.RGBAIntegerFormat,depthBuffer:!1,resolveDepthBuffer:!1});i.texture.type=d.UnsignedIntType,i.texture.format=d.RGBAIntegerFormat,i.texture.internalFormat="RGBA32UI",A.initRenderTarget(i);const t=new d.ShaderMaterial({glslVersion:d.GLSL3,uniforms:{textureSize:{value:1024},numSlices:{value:1},covarianceTexture:{value:i.texture},positionColorTexture:{value:a.texture},zUpToYUpMatrix3x3:{value:la},sizeMultiplier:{value:1},cropRadius:{value:Number.MAX_VALUE},viewportPixelSize:{value:new d.Vector2},k:{value:2},beta_k:{value:2},minSplatPixelSize:{value:0},minOpacity:{value:.01},culling:{value:!1},antialiasingFactor:{value:2}},vertexShader:Fa(),fragmentShader:I||ya(),transparent:!0,side:d.FrontSide,depthTest:!1,depthWrite:!1,blending:d.NormalBlending}),e=new d.InstancedBufferGeometry,o=new Float32Array([-.5,.5,0,.5,.5,0,-.5,-.5,0,.5,-.5,0]);e.setIndex([0,2,1,2,3,1]),e.setAttribute("position",new d.BufferAttribute(o,3));const r=new Uint32Array(E),n=new d.InstancedBufferAttribute(r,1,!1);n.needsUpdate=!0,n.setUsage(d.DynamicDrawUsage),e.setAttribute("order",n),e.instanceCount=0,super(e,t),this.matrixAutoUpdate=!1,this.numBatches=0,this.numVisibleBatches=0,this.orderAttribute=n,this.textureSize=1024,this.numTextures=1,this.batchSize=C,this.maxSplats=E,this.numSplatsRendered=0,this.positionColorRenderTarget=a,this.covarianceRenderTarget=i,this.renderer=A,this.sortID=0,this.freeAddresses=new OI;for(let c=0;c<this.maxSplats;c+=C)this.freeAddresses.add(c);this.worker=new Vt,this.sortListeners=[],this.worker.onmessage=c=>{const D=new Uint32Array(c.data.order);if(this.numSplatsRendered=D.length,D.length>this.orderAttribute.count){const b=new d.InstancedBufferGeometry,h=new Float32Array([-.5,.5,0,.5,.5,0,-.5,-.5,0,.5,-.5,0]),w=[0,2,1,2,3,1];b.setIndex(w),b.setAttribute("position",new d.BufferAttribute(h,3));const f=new Uint32Array(this.maxSplats),p=new d.InstancedBufferAttribute(f,1,!1);p.needsUpdate=!0,p.setUsage(d.DynamicDrawUsage),b.setAttribute("order",p),b.instanceCount=0,this.geometry.dispose(),this.geometry=b,this.orderAttribute=p}this.orderAttribute.clearUpdateRanges(),this.orderAttribute.set(D),this.orderAttribute.addUpdateRange(0,D.length),this.orderAttribute.needsUpdate=!0,this.geometry.instanceCount=c.data.count,this.geometry.needsUpdate=!0;for(let b=this.sortListeners.length-1;b>=0;b--)this.sortListeners[b](c.data.id)&&this.sortListeners.splice(b,1)},this.cameraPosition=new d.Vector3(0,0,0),this.viewProjModel,this.rotateOnAxis(new d.Vector3(1,0,0),.5*Math.PI),this.frustumCulled=!1,this.copyMaterial2D=new d.ShaderMaterial({glslVersion:d.GLSL3,uniforms:{sourceTexture:{}},vertexShader:vC(),fragmentShader:`
1127
+ `,qC=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",ua],{type:"text/javascript;charset=utf-8"});function Vt(B){let A;try{if(A=qC&&(self.URL||self.webkitURL).createObjectURL(qC),!A)throw"";const g=new Worker(A,{type:"module",name:B?.name});return g.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(A)}),g}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(ua),{type:"module",name:B?.name})}}new d.Vector3,new d.Vector3;const la=new d.Matrix3;la.set(1,0,0,0,0,1,0,-1,0);const zt=new d.Matrix4().set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1);function eQ(B,A){return(d.DataUtils.toHalfFloat(B)|d.DataUtils.toHalfFloat(A)<<16)>>>0}class fa extends d.Mesh{constructor(A,g,I){const C=Math.min(Math.ceil(4)*1024,Math.pow(1024,2));let E=1*Math.pow(1024,2);E=Math.floor(E/C)*C;const a=new d.WebGL3DRenderTarget(1024,1024,1,{magFilter:d.NearestFilter,minFilter:d.NearestFilter,type:d.UnsignedIntType,format:d.RGBAIntegerFormat,anisotropy:0,depthBuffer:!1,resolveDepthBuffer:!1});a.texture.type=d.UnsignedIntType,a.texture.format=d.RGBAIntegerFormat,a.texture.internalFormat="RGBA32UI",A.initRenderTarget(a);const i=new d.WebGL3DRenderTarget(1024,1024,1,{magFilter:d.NearestFilter,minFilter:d.NearestFilter,anisotropy:0,type:d.UnsignedIntType,format:d.RGBAIntegerFormat,depthBuffer:!1,resolveDepthBuffer:!1});i.texture.type=d.UnsignedIntType,i.texture.format=d.RGBAIntegerFormat,i.texture.internalFormat="RGBA32UI",A.initRenderTarget(i);const t=new d.ShaderMaterial({glslVersion:d.GLSL3,uniforms:{textureSize:{value:1024},numSlices:{value:1},covarianceTexture:{value:i.texture},positionColorTexture:{value:a.texture},zUpToYUpMatrix3x3:{value:la},sizeMultiplier:{value:1},cropRadius:{value:Number.MAX_VALUE},viewportPixelSize:{value:new d.Vector2},k:{value:2},beta_k:{value:2},minSplatPixelSize:{value:0},minOpacity:{value:.01},culling:{value:!1},antialiasingFactor:{value:2}},vertexShader:Fa(),fragmentShader:I||ya(),transparent:!0,side:d.FrontSide,depthTest:!0,depthWrite:!1,blending:d.NormalBlending}),e=new d.InstancedBufferGeometry,o=new Float32Array([-.5,.5,0,.5,.5,0,-.5,-.5,0,.5,-.5,0]);e.setIndex([0,2,1,2,3,1]),e.setAttribute("position",new d.BufferAttribute(o,3));const r=new Uint32Array(E),n=new d.InstancedBufferAttribute(r,1,!1);n.needsUpdate=!0,n.setUsage(d.DynamicDrawUsage),e.setAttribute("order",n),e.instanceCount=0,super(e,t),this.matrixAutoUpdate=!1,this.numBatches=0,this.numVisibleBatches=0,this.orderAttribute=n,this.textureSize=1024,this.numTextures=1,this.batchSize=C,this.maxSplats=E,this.numSplatsRendered=0,this.positionColorRenderTarget=a,this.covarianceRenderTarget=i,this.renderer=A,this.sortID=0,this.freeAddresses=new OI;for(let c=0;c<this.maxSplats;c+=C)this.freeAddresses.add(c);this.worker=new Vt,this.sortListeners=[],this.worker.onmessage=c=>{const D=new Uint32Array(c.data.order);if(this.numSplatsRendered=D.length,D.length>this.orderAttribute.count){const b=new d.InstancedBufferGeometry,h=new Float32Array([-.5,.5,0,.5,.5,0,-.5,-.5,0,.5,-.5,0]),w=[0,2,1,2,3,1];b.setIndex(w),b.setAttribute("position",new d.BufferAttribute(h,3));const f=new Uint32Array(this.maxSplats),p=new d.InstancedBufferAttribute(f,1,!1);p.needsUpdate=!0,p.setUsage(d.DynamicDrawUsage),b.setAttribute("order",p),b.instanceCount=0,this.geometry.dispose(),this.geometry=b,this.orderAttribute=p}this.orderAttribute.clearUpdateRanges(),this.orderAttribute.set(D),this.orderAttribute.addUpdateRange(0,D.length),this.orderAttribute.needsUpdate=!0,this.geometry.instanceCount=c.data.count,this.geometry.needsUpdate=!0;for(let b=this.sortListeners.length-1;b>=0;b--)this.sortListeners[b](c.data.id)&&this.sortListeners.splice(b,1)},this.cameraPosition=new d.Vector3(0,0,0),this.viewProjModel,this.rotateOnAxis(new d.Vector3(1,0,0),.5*Math.PI),this.frustumCulled=!1,this.copyMaterial2D=new d.ShaderMaterial({glslVersion:d.GLSL3,uniforms:{sourceTexture:{}},vertexShader:vC(),fragmentShader:`
1128
1128
  precision highp float;
1129
1129
  precision highp int;
1130
1130
  precision highp usampler2D;
@@ -1187,7 +1187,6 @@ void getVertexData(out vec3 position, out mat3 covariance) {
1187
1187
 
1188
1188
  highp uint uOrder = order; // Use a local uint copy
1189
1189
 
1190
- // It's good practice to ensure textureSize is treated as uint for these calcs
1191
1190
  uint uTextureSize = uint(textureSize); // textureSize uniform is float
1192
1191
  uint uPixelsPerSlice = uTextureSize * uTextureSize;
1193
1192
 
@@ -1338,11 +1337,8 @@ void main() {
1338
1337
 
1339
1338
  gl_Position = outPosition;
1340
1339
  viewZW = outPosition.zw;
1341
- /* if(computeLinearDepth){
1342
- orthographicDepth = viewZToOrthographicDepth( -gl_Position.w, cameraNear, cameraFar );
1343
- } */
1344
1340
 
1345
- #if defined( USE_LOGDEPTHBUF )
1341
+ #if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
1346
1342
  float isPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1347
1343
  splatDepth = isPerspective == 0.0 ? splatPositionProjected.z : log2( 1.0 + splatPositionProjected.w ) * logDepthBufFC * 0.5;
1348
1344
  #else
@@ -1378,7 +1374,6 @@ void main() {
1378
1374
  float alpha = color.w * exp(-beta_k * rk);
1379
1375
 
1380
1376
  fragColor = vec4(pow(color.xyz,vec3(1.0/2.2)), alpha);
1381
-
1382
1377
  gl_FragDepth = splatDepth;
1383
1378
 
1384
1379
  }`}function vC(){return`