@arcgis/core 5.2.0-next.64 → 5.2.0-next.65

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.
Files changed (90) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{bb95922cd4631d6f17fb.js → 04ac5ac6f592d8c34bbd.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{0977f4d77c36175c2895.js → 3ddd717ea12d9823eee2.js} +1 -1
  4. package/assets/esri/core/workers/chunks/5adf16c034a590b5e9f5.js +1 -0
  5. package/assets/esri/core/workers/chunks/{57824ecc10b25e3ad794.js → 903e1cd8b76eff19ebdf.js} +1 -1
  6. package/assets/esri/core/workers/chunks/93c0a620a147cbf4a0ba.js +1 -0
  7. package/assets/esri/core/workers/chunks/9be6827e5756031a56c1.js +1 -0
  8. package/assets/esri/core/workers/chunks/a52c88e2d837b525ff6c.js +1 -0
  9. package/assets/esri/core/workers/chunks/{771ead806efbe9c91fdc.js → a5fdb02b1714e93fa69e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/b4e5ee81b9eb171499a6.js +1 -0
  11. package/assets/esri/core/workers/chunks/bece22668622a9a6bfe2.js +1 -0
  12. package/assets/esri/core/workers/chunks/c02ae1d40c1fe95ae6c5.js +1 -0
  13. package/assets/esri/core/workers/chunks/d51c41c1944df0cbab3e.js +1 -0
  14. package/assets/esri/core/workers/chunks/d583bcea4d1a21da9147.js +1 -0
  15. package/assets/esri/core/workers/chunks/{ef27bf1d7941ae265ca4.js → d7267f429a051943187b.js} +1 -1
  16. package/assets/esri/core/workers/chunks/d9c78c2db04a06ee83ed.js +1 -0
  17. package/assets/esri/core/workers/chunks/{c1e45e24f5ef719a714c.js → dc7e4f7879debf557e46.js} +143 -95
  18. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  19. package/chunks/Component.glsl.js +60 -62
  20. package/chunks/DefaultMaterial.glsl.js +27 -28
  21. package/chunks/GaussianSplat.glsl.js +7 -7
  22. package/chunks/GaussianSplatShadow.glsl.js +9 -9
  23. package/chunks/GlobalIllumination.glsl.js +35 -15
  24. package/chunks/Path.glsl.js +7 -6
  25. package/chunks/RealisticTree.glsl.js +22 -24
  26. package/chunks/SSAO.glsl.js +1 -1
  27. package/chunks/Terrain.glsl.js +3 -2
  28. package/chunks/Water.glsl.js +20 -11
  29. package/chunks/_commonjsHelpers.js +1 -1
  30. package/chunks/bundle2.js +1 -1
  31. package/config.js +1 -1
  32. package/kernel.js +1 -1
  33. package/layers/graphics/sources/ParquetSource.js +1 -1
  34. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  35. package/layers/graphics/sources/parquet/ParquetFileInfo.js +1 -1
  36. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  37. package/layers/raster/datasets/EphemeralBlockCache.js +1 -1
  38. package/layers/raster/datasets/RawBlockCache.js +1 -1
  39. package/layers/support/KMLSublayer.js +1 -1
  40. package/layers/video/VideoController.js +1 -1
  41. package/libs/parquet/parquet.js +1 -1
  42. package/package.json +1 -1
  43. package/rest/support/Query.js +1 -1
  44. package/support/revision.js +1 -1
  45. package/symbols/LabelSymbol3D.js +1 -1
  46. package/symbols/LineSymbol3D.js +1 -1
  47. package/symbols/MeshSymbol3D.js +1 -1
  48. package/symbols/PointSymbol3D.js +1 -1
  49. package/symbols/PolygonSymbol3D.js +1 -1
  50. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  51. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  52. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  53. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  54. package/views/3d/state/controllers/RotateController.js +1 -1
  55. package/views/3d/state/utils/navigationUtils.js +1 -1
  56. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  57. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  58. package/views/3d/terrain/OverlayRenderer.js +1 -1
  59. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +24 -16
  60. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js +25 -0
  61. package/views/3d/webgl-engine/lib/GaussianSplatRenderUtils.js +2 -0
  62. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  63. package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
  64. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  65. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  66. package/views/3d/webgl-engine/shaders/GaussianSplatPassParameters.js +2 -0
  67. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
  68. package/views/3d/webgl-engine/shaders/GaussianSplatShadowTechnique.js +1 -1
  69. package/views/3d/webgl-engine/shaders/GaussianSplatTechnique.js +1 -1
  70. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  71. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  72. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  73. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  74. package/widgets/LayerList/ListItem.js +1 -1
  75. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  76. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  77. package/widgets/OrientedImageryViewer/services/TransformationService.js +1 -1
  78. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  79. package/widgets/OrientedImageryViewer.js +1 -1
  80. package/widgets/TableList/ListItem.js +1 -1
  81. package/assets/esri/core/workers/chunks/43b39abd49c4a8ce891f.js +0 -1
  82. package/assets/esri/core/workers/chunks/5dbd8ca7e7b8eb9a0bf7.js +0 -1
  83. package/assets/esri/core/workers/chunks/6123894e2ae9233cdf89.js +0 -1
  84. package/assets/esri/core/workers/chunks/6b536d03b4bef408035b.js +0 -1
  85. package/assets/esri/core/workers/chunks/6c98a64d92c9bca78203.js +0 -1
  86. package/assets/esri/core/workers/chunks/78b80da3bbc1b608fe83.js +0 -1
  87. package/assets/esri/core/workers/chunks/7d85048c6cd6ad84faf9.js +0 -1
  88. package/assets/esri/core/workers/chunks/9008090a5d8431ddfa22.js +0 -1
  89. package/assets/esri/core/workers/chunks/a2d8bc0efddd2e13b1ad.js +0 -1
  90. package/assets/esri/core/workers/chunks/c97451f75c23be979476.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as r,asinClamped as o}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as a,exactEquals as s,rotate as c,multiply as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as l,create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{length as h,dot as M,subtract as g,normalize as y,squaredDistance as d,copy as b,transformMat4 as x,add as j,distance as v,cross as w,scale as P,lerp as z,crossAndNormalize as I,scaleAndAdd as S,set as T}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as A}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as R,axis as q,fromPoints as F,wrapAxisAngle as H}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as U,vectorCoordinates as G}from"../../../../geometry/support/coordinateSystem.js";import{create as k,fromNormalAndOffset as E,intersectRay as C,fromPositionAndNormal as O,distance as W,projectPoint as B,projectVector as D}from"../../../../geometry/support/plane.js";import{create as J}from"../../../../geometry/support/ray.js";import{Sphere as K}from"../../../../geometry/support/sphere.js";import{sm4d as L,sv3d as N}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as Q,fromScreen as V}from"../../support/geometryUtils/ray.js";import{intersectScreen as X}from"../../support/geometryUtils/sphere.js";import Y from"../../webgl/RenderCamera.js";import{terrainId as Z}from"../../webgl-engine/lib/verticalOffsetUtils.js";const $=30,_=[1,3e8],tt=8,et=[200,1508e5],nt=5,rt=50,ot=5,it=10,at=80,st=90,ct=1e-6,ut={exclude:new Set([Z])};function lt(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function mt(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function ft(t,e,n){const r=a(L.get(),n[3],q(n));null==r||s(r,l)||(g(Fe,t.eye,e),x(Fe,Fe,r),t.eye=j(Fe,Fe,e),g(Fe,t.center,e),x(Fe,Fe,r),t.center=j(Fe,Fe,e),t.up=x(Fe,t.up,r))}function pt(t,e,n,r){return C(t,V(e,n,Ce),r)}function ht(t,e,n,r){return C(t,Q(e,n,Ce),r)}function Mt(t,e,n,r){const o=N.get();let i=1-n;g(o,e,t.eye);const a=h(o);let s=a*(1-i);i>=0&&s<r&&(s=r,i=-(s-a)/a),Math.abs(a-s)<ct||(P(o,o,i),t.eye=j(Fe,t.eye,o),t.center=z(Fe,t.center,e,i))}function gt(t,e,n){e.getScreenCenter(yt),X(t,e,yt,Fe)&&(e.center=Fe);const r=e.distance,o=r*n;if(Math.abs(r-o)<ct)return;const i=P(N.get(),e.viewForward,o);e.eye=g(Fe,e.center,i)}const yt=i();function dt(t,e){T(e,0,0,0);for(const n of t)j(e,e,n);P(e,e,1/t.length)}function bt(t,e,n,r){return Math.sin(t/h(e))*(n+r.radius)}function xt(t,e,n,r){return bt(Math.PI/2,e,n,r)+(t-Math.PI/2)}const jt={Elevation:3e4,Angle:e(16)},vt=e(80);function wt(t,e,n,r,o,i){const a=A(),s=new K;let c=!0,u=!0;const{eye:l}=e;return t.intersectScreen(n,a,i)&&ye(l,a,r)?s.radius=h(a):(u=!1,e.aboveGround&&0!==o?s.radius=Math.max(h(e.center),.9*r):s.radius=h(e.eye)-e.relativeElevation,1===o?St(s,e,n,a):c=X(s,e,n,a)),{sphere:s,scenePickPoint:c?a:null,hasGeometryIntersection:u}}function Pt(t,e,n,r){const o=t.relativeElevation;if(o>jt.Elevation&&"global"===r)return 1;Q(t,e,Oe);const i=Math.sign(o),a=n.worldUpAtPosition(t.eye,Fe);return-i*M(a,Oe.direction)<Math.sin(jt.Angle)*h(Oe.direction)?0:1}function zt(t,e,n){g(It,n,e),t.eye=g(Fe,t.eye,It),t.center=g(Fe,t.center,It)}const It=A();function St(t,e,n,r){const o=Q(e,n,Ce);return null!=o&&(t.closestPointOnSilhouette(o,Tt),t.intersectRay(o,r)?!(d(Tt,o.origin)<d(r,o.origin))||(b(r,Tt),!1):(g(At,e.eye,e.center),y(At,At),E(At,-M(y(At,At),Tt),Rt),C(Rt,o,r),!1))}const Tt=A(),At=A(),Rt=k(),qt=A(),Ft=A(),Ht=i();function Ut(t,e){return D(e,t.viewForward,qt),j(Ft,t.eye,qt),t.projectToScreen(Ft,Ht),Ht[1]}const Gt=A(),kt=k(),Et=A(),Ct=A(),Ot=A(),Wt=A(),Bt=A(),Dt=A(),Jt=A(),Kt=A(),Lt=i(),Nt=J();function Qt(t,e,n){const r=t.eye;if(v(e.center,r)<e.radius)return null;const o=t.up;Q(t,n,Nt);const i=e.radius;if(I(Gt,o,Nt.direction),O(r,Gt,kt),W(kt,e.center)>i)return null;B(kt,e.center,Et);const a=v(e.center,Et),s=Math.sqrt(i**2-a**2);g(Ct,r,Et),y(Ot,Ct),I(Wt,Gt,Ot);const c=M(Ct,Ot),u=M(Ct,Wt),l=Math.sqrt(c**2+u**2),m=s**2/l**2,f=s/l**2*Math.sqrt(l**2-s**2),p=m*c,h=f*-u,d=m*u,b=f*c,x=p-h,w=d+b,z=d-b;j(Bt,Et,S(Bt,P(Bt,Ot,p+h),Wt,w)),j(Dt,Et,S(Dt,P(Dt,Ot,x),Wt,z)),g(Jt,Bt,r),y(Jt,Jt),g(Kt,Dt,r),y(Kt,Kt);return M(t.viewForward,Jt)>=M(t.viewForward,Kt)?t.projectToScreen(Bt,Lt):t.projectToScreen(Dt,Lt),Lt[1]}function Vt(t,e,n){return e?t>n:t<n}const Xt=.05,Yt=12;function Zt(t,e){const n=t.fullHeight/t.pixelRatio,r=Math.max(e,n-e);return Math.max(Yt,Xt*r)}function $t(t,e){const n=t.fullHeight/t.pixelRatio;return Math.min(n,e+Zt(t,e))}function _t(t,e){return Math.max(0,e-Zt(t,e))}function te(i,a,s,c,u,l){let m=0;if(w(Ge,i,a),g(He,i,a),h(i)<=u||!c.aboveGround){w(s,He,c.eye);const f=M(i,a)/(h(i)*h(a));if(f<.9999)m=r(f);else{const t=h(w(A(),i,a))/(h(i)*h(a));m=o(t)}const p=Math.cos(n(t.normalize(e(l)),0,vt));m=-m-Math.max(0,h(a)-u)/(p*u)}else g(ee,c.eye,c.center),w(s,He,ee),m=-h(He)/u;return y(s,s),P(s,s,h(Ge)),m}const ee=A();function ne(o,i,a,s){let c,u;const l=Math.cos(n(t.normalize(e(s)),0,vt));return c=i>a?-(i-a)/(l*a):i<-a?Math.PI-(i+a)/(l*a):r(i/a),u=o>a?-(o-a)/(l*a):o<-a?Math.PI-(o+a)/(l*a):r(o/a),(u-c)*a}function re(t,e,n,r,o,i,a,s,c,u){const l=ne(t[2],e[2],i.radius,s),m=c?ne(t[0],e[0],i.radius,180):e[0]-t[0],p=Math.sin(a)*m-Math.cos(a)*l,h=Math.cos(a)*m+Math.sin(a)*l;y(Fe,o);const g=c?p/Math.sqrt(Math.abs(i.radius**2-M(n,Fe)**2)):p/i.radius,d=h/Math.sqrt(Math.abs(i.radius**2-M(n,r)**2));f(u,g,d)}function oe(t,e,n,r,o,i,a,s,c,u){w(Ge,t,e),U(i.up,i.eye,je,ve,we),U([0,0,1],i.eye,de,be,xe),b(n,be),b(r,de),y(n,n),P(n,n,h(Ge)),G(t,y(ve,ve),y(we,we),y(je,je),Pe),G(e,ve,we,je,ze),re(Pe,ze,t,de,be,a,s,c,u,o)}function ie(t,e,n,r,o,i,s){a(Te,o,r),a(Ae,s,i),u(Re,Te,Ae),g(e,t,n),x(e,e,Re),j(e,e,n)}function ae(t,e,n,r,o,i){a(Te,r,n),a(Ae,i,o),u(Re,Te,Ae),g(Fe,t.eye,e),x(Fe,Fe,Re),t.eye=j(Fe,Fe,e),g(Fe,t.center,e),x(Fe,Fe,Re),t.center=j(Fe,Fe,e),g(Fe,t.up,e),x(Fe,Fe,Re),t.up=j(Fe,Fe,e)}const se={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let ce=!1;function ue(t,e,n,r,o,i){const a=Math.abs(r)>Math.PI-se.Angle||Math.abs(r)<se.Angle,s=(Math.abs(t[2])<n*se.Pole||Math.abs(e)>n)&&i;return a&&s?!ce&&o<se.Tilt-se.TiltHysteresisMargin?ce=!0:ce&&o>se.Tilt+se.TiltHysteresisMargin&&(ce=!1):ce=!1,ce}function le(t,e,n,r,o,i){if(i)F(n,r,Se),ft(e,t.center,Se);else{const i=te(n,r,ke,e,t.radius,o);ft(e,t.center,H(ke,i))}}function me(t,e,n,r,o,i,a){const s=a?20:1,c=1e-12;let u,l;b(qe,r),Ue.copyFrom(e);for(let m=0;m<s&&d(n,qe)>c&&(u=d(n,qe),oe(n,qe,be,de,Ie,Ue,t,o,i,a),ae(Ue,t.center,de,Ie[1],be,Ie[0]),ie(qe,qe,t.center,de,Ie[1],be,Ie[0]),l=d(n,qe),l<u||0===m);m++)e.copyFrom(Ue)}function fe(n,r,o,i,a,s,c){ue(o,M(r.up,o),n.radius,-t.normalize(e(a)),s,r.aboveGround)?me(n,r,o,i,-t.normalize(e(a)),s,c):le(n,r,o,i,s,c)}function pe(t,e,n,r,o,i){const{eye:a}=t;U([0,0,1],a,de,be,xe);const s=e.translation[0]*n.pan,u="zoom"===o.mode?0:e.translation[1]*n.pan,l=Math.max(Math.sqrt(Math.abs(1-M(t.center,de)**2/h(t.center)**2)),.5),m=(Math.sin(i)*u+Math.cos(i)*s)/l,f=-Math.cos(i)*u+Math.sin(i)*s;switch(c(r.pan.matrix,r.pan.matrix,m,de),r.pan.enabled=!0,o.mode){case"pan":c(r.pan.matrix,r.pan.matrix,f,be),r.pan.enabled=!0;break;case"zoom":r.zoom=-e.translation[1]*n.zoom}}function he(t,e,n,r,o){const{eye:i,viewRight:a}=t,s=w(N.get(),a,i),u=e.translation[0]*n.pan;switch(0!==u&&(c(r.pan.matrix,r.pan.matrix,-u,s),r.pan.enabled=!0),o.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(r.pan.matrix,r.pan.matrix,t,a),r.pan.enabled=!0);break}case"zoom":r.zoom=-e.translation[1]*n.zoom}}function Me(n,r,o,i,a,s,c,u,l){ue(n.center,M(n.up,n.center),h(n.center),-t.normalize(e(s)),c,r.aboveGround)?pe(r,o,i,u,l,-t.normalize(e(a))):he(r,o,i,u,l)}function ge(t,e,n=1/0){const r=Math.abs(M(t,e));return Math.min(n,1/r)}function ye(t,e,n){const r=v(t,e),o=h(t);return r<Math.max(o,n)}const de=A(),be=A(),xe=A(),je=A(),ve=A(),we=A(),Pe=A(),ze=A(),Ie=p(),Se=R(),Te=m(),Ae=m(),Re=m(),qe=A(),Fe=A(),He=A();let Ue=new Y;const Ge=A(),ke=A();function Ee(){Ue=new Y}const Ce={origin:A(),direction:A()},Oe={origin:A(),direction:A()};export{vt as TiltThresholdPanningSpeed,jt as VerticalPanTresholds,zt as applyPanPlanar,le as applyPanSphericalDirectRotation,me as applyPanSphericalPreserveHeading,ft as applyRotation,ae as applyRotationWithTwoAxes,gt as applyZoomOnSphere,Mt as applyZoomToPoint,dt as centroid,Ee as cleanupNavigationUtils,_t as computeHorizonDownLimitScreenY,Zt as computeHorizonPadding,$t as computeHorizonUpLimitScreenY,ct as distanceComparisonTolerance,ut as excludeTerrain,Ut as findPlaneHorizonY,Qt as findSphereHorizonY,ge as getTiltScaleFactor,Pt as inferNavigationMode,pt as intersectPlaneFromScreenPoint,ht as intersectPlaneFromScreenPointAtEye,ye as isHitOnSamePlanetSide,ne as lengthFromPoints,nt as maxPanDistanceModifier,ot as maxRotatePivotDistanceModifier,$ as maxZoomPivotDistanceModifier,tt as maxZoomStepDistanceModifier,rt as minPinchAndPanCameraHeight,it as minRotatePivotDistance,lt as normalizeCoordinate,mt as normalizeRotationDelta,xt as offSurfaceTiltToEyeTiltGlobal,bt as onSurfaceTiltToEyeTiltGlobal,Me as panMotionToRotationMatrix,fe as panToPosition,wt as pickPointAndInitSphere,at as pivotSearchAreaSize,se as preservingHeadingThresholds,Xt as relativeHorizonPanPadding,st as rotatePivotSearchAreaSize,ie as rotatePointAroundTwoAxes,te as rotationAngleAndAxisDirectRotation,oe as rotationAnglesAndAxesHeadingPreserving,re as rotationAnglesHeadingPreserving,Vt as shouldClampScreenY,ue as shouldPreserveHeading,St as sphereOrPlanePointFromScreenPoint,_ as zoomPivotDistanceClamp,et as zoomStepDistanceClamp};
2
+ import{cyclicalPI as t}from"../../../../core/Cyclical.js";import{deg2rad as e,clamp as n,acosClamped as r,asinClamped as o}from"../../../../core/mathUtils.js";import{createScreenPointArray as i}from"../../../../core/screenUtils.js";import{fromRotation as a,exactEquals as s,rotate as c,multiply as u}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as l,create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as f}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as h,length as M,dot as g,subtract as y,normalize as d,squaredDistance as b,copy as x,transformMat4 as j,add as v,distance as w,cross as P,scale as z,lerp as I,crossAndNormalize as S,scaleAndAdd as T,set as R}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as q}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as A,axis as F,fromPoints as H,wrapAxisAngle as U}from"../../../../geometry/support/axisAngle.js";import{coordinateSystemFromOneAxisAndNormalVector as E,vectorCoordinates as G}from"../../../../geometry/support/coordinateSystem.js";import{create as k,fromNormalAndOffset as C,intersectRay as O,fromPositionAndNormal as W,distance as B,projectPoint as D,projectVector as J}from"../../../../geometry/support/plane.js";import{create as K}from"../../../../geometry/support/ray.js";import{Sphere as L}from"../../../../geometry/support/sphere.js";import{sm4d as N,sv3d as Q}from"../../../../geometry/support/vectorStacks.js";import{fromScreenAtEye as V,fromScreen as X}from"../../support/geometryUtils/ray.js";import{intersectScreen as Y}from"../../support/geometryUtils/sphere.js";import Z from"../../webgl/RenderCamera.js";import{terrainId as $}from"../../webgl-engine/lib/verticalOffsetUtils.js";const _=30,tt=[1,3e8],et=8,nt=[200,1508e5],rt=5,ot=50,it=5,at=10,st=80,ct=90,ut=1e-6,lt={exclude:new Set([$])};function mt(t,e,n){return n[0]=e[0]/(t.fullWidth/t.pixelRatio),n[1]=e[1]/(t.fullHeight/t.pixelRatio),n}function ft(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function pt(t,e,n){const r=a(N.get(),n[3],F(n));null==r||s(r,l)||(y(Ee,t.eye,e),j(Ee,Ee,r),t.eye=v(Ee,Ee,e),y(Ee,t.center,e),j(Ee,Ee,r),t.center=v(Ee,Ee,e),t.up=j(Ee,t.up,r))}function ht(t,e,n,r){return O(t,X(e,n,Be),r)}function Mt(t,e,n,r){return O(t,V(e,n,Be),r)}function gt(t,e,n,r){const o=Q.get();let i=1-n;y(o,e,t.eye);const a=M(o);let s=a*(1-i);i>=0&&s<r&&(s=r,i=-(s-a)/a),Math.abs(a-s)<ut||(z(o,o,i),t.eye=v(Ee,t.eye,o),t.center=I(Ee,t.center,e,i))}function yt(t,e,n){e.getScreenCenter(dt),Y(t,e,dt,Ee)&&(e.center=Ee);const r=e.distance,o=r*n;if(Math.abs(r-o)<ut)return;const i=z(Q.get(),e.viewForward,o);e.eye=y(Ee,e.center,i)}const dt=i();function bt(t,e){R(e,0,0,0);for(const n of t)v(e,e,n);z(e,e,1/t.length)}function xt(t,e,n,r){return Math.sin(t/M(e))*(n+r.radius)}function jt(t,e,n,r){return xt(Math.PI/2,e,n,r)+(t-Math.PI/2)}const vt={Elevation:3e4,Angle:e(16)},wt=e(80);function Pt(t,e,n,r,o,i){const a=q(),s=new L;let c=!0,u=!0;const{eye:l}=e;return t.intersectScreen(n,a,i)&&!h(l,a)&&xe(l,a,r)?s.radius=M(a):(u=!1,e.aboveGround&&0!==o?s.radius=Math.max(M(e.center),.9*r):s.radius=M(e.eye)-e.relativeElevation,1===o?Tt(s,e,n,a):c=Y(s,e,n,a)),{sphere:s,scenePickPoint:c?a:null,hasGeometryIntersection:u}}function zt(t,e,n,r){const o=t.relativeElevation;if(o>vt.Elevation&&"global"===r)return 1;V(t,e,De);const i=Math.sign(o),a=n.worldUpAtPosition(t.eye,Ee);return-i*g(a,De.direction)<Math.sin(vt.Angle)*M(De.direction)?0:1}function It(t,e,n){y(St,n,e),t.eye=y(Ee,t.eye,St),t.center=y(Ee,t.center,St)}const St=q();function Tt(t,e,n,r){const o=V(e,n,Be);return null!=o&&(t.closestPointOnSilhouette(o,Rt),t.intersectRay(o,r)?!(b(Rt,o.origin)<b(r,o.origin))||(x(r,Rt),!1):(y(qt,e.eye,e.center),d(qt,qt),C(qt,-g(d(qt,qt),Rt),At),O(At,o,r),!1))}const Rt=q(),qt=q(),At=k(),Ft=q(),Ht=q(),Ut=i();function Et(t,e){return J(e,t.viewForward,Ft),v(Ht,t.eye,Ft),t.projectToScreen(Ht,Ut),Ut[1]}const Gt=q(),kt=k(),Ct=q(),Ot=q(),Wt=q(),Bt=q(),Dt=q(),Jt=q(),Kt=q(),Lt=q(),Nt=q(),Qt=q(),Vt=i(),Xt=K();function Yt(t,e,n){const r=t.eye;if(w(e.center,r)<e.radius)return d(Dt,r),P(Jt,Dt,t.viewRight),v(Ht,r,Jt),t.projectToScreen(Ht,Vt),Vt[1];const o=t.up;V(t,n,Xt);const i=e.radius;if(S(Gt,o,Xt.direction),W(r,Gt,kt),B(kt,e.center)>i)return null;D(kt,e.center,Ct);const a=w(e.center,Ct),s=Math.sqrt(i**2-a**2);y(Ot,r,Ct),d(Wt,Ot),S(Bt,Gt,Wt);const c=g(Ot,Wt),u=g(Ot,Bt),l=Math.sqrt(c**2+u**2),m=s**2/l**2,f=s/l**2*Math.sqrt(l**2-s**2),p=m*c,h=f*-u,M=m*u,b=f*c,x=p-h,j=M+b,I=M-b;v(Kt,Ct,T(Kt,z(Kt,Wt,p+h),Bt,j)),v(Lt,Ct,T(Lt,z(Lt,Wt,x),Bt,I)),y(Nt,Kt,r),d(Nt,Nt),y(Qt,Lt,r),d(Qt,Qt);return g(t.viewForward,Nt)>=g(t.viewForward,Qt)?t.projectToScreen(Kt,Vt):t.projectToScreen(Lt,Vt),Vt[1]}function Zt(t,e,n){return e?t>n:t<n}const $t=.05,_t=12;function te(t,e){const n=t.fullHeight/t.pixelRatio,r=Math.max(e,n-e);return Math.max(_t,$t*r)}function ee(t,e){const n=t.fullHeight/t.pixelRatio;return Math.min(n,e+te(t,e))}function ne(t,e){return Math.max(0,e-te(t,e))}function re(i,a,s,c,u,l){let m=0;if(P(Ce,i,a),y(Ge,i,a),M(i)<=u||!c.aboveGround){P(s,Ge,c.eye);const f=g(i,a)/(M(i)*M(a));if(f<.9999)m=r(f);else{const t=M(P(q(),i,a))/(M(i)*M(a));m=o(t)}const p=Math.cos(n(t.normalize(e(l)),0,wt));m=-m-Math.max(0,M(a)-u)/(p*u)}else y(oe,c.eye,c.center),P(s,Ge,oe),m=-M(Ge)/u;return d(s,s),z(s,s,M(Ce)),m}const oe=q();function ie(o,i,a,s){let c,u;const l=Math.cos(n(t.normalize(e(s)),0,wt));return c=i>a?-(i-a)/(l*a):i<-a?Math.PI-(i+a)/(l*a):r(i/a),u=o>a?-(o-a)/(l*a):o<-a?Math.PI-(o+a)/(l*a):r(o/a),(u-c)*a}function ae(t,e,n,r,o,i,a,s,c,u){const l=ie(t[2],e[2],i.radius,s),m=c?ie(t[0],e[0],i.radius,180):e[0]-t[0],p=Math.sin(a)*m-Math.cos(a)*l,h=Math.cos(a)*m+Math.sin(a)*l;d(Ee,o);const M=c?p/Math.sqrt(Math.abs(i.radius**2-g(n,Ee)**2)):p/i.radius,y=h/Math.sqrt(Math.abs(i.radius**2-g(n,r)**2));f(u,M,y)}function se(t,e,n,r,o,i,a,s,c,u){P(Ce,t,e),E(i.up,i.eye,Pe,ze,Ie),E([0,0,1],i.eye,je,ve,we),x(n,ve),x(r,je),d(n,n),z(n,n,M(Ce)),G(t,d(ze,ze),d(Ie,Ie),d(Pe,Pe),Se),G(e,ze,Ie,Pe,Te),ae(Se,Te,t,je,ve,a,s,c,u,o)}function ce(t,e,n,r,o,i,s){a(Ae,o,r),a(Fe,s,i),u(He,Ae,Fe),y(e,t,n),j(e,e,He),v(e,e,n)}function ue(t,e,n,r,o,i){a(Ae,r,n),a(Fe,i,o),u(He,Ae,Fe),y(Ee,t.eye,e),j(Ee,Ee,He),t.eye=v(Ee,Ee,e),y(Ee,t.center,e),j(Ee,Ee,He),t.center=v(Ee,Ee,e),y(Ee,t.up,e),j(Ee,Ee,He),t.up=v(Ee,Ee,e)}const le={Pole:.95,Angle:e(18),Tilt:45,TiltHysteresisMargin:1e-7};let me=!1;function fe(t,e,n,r,o,i){const a=Math.abs(r)>Math.PI-le.Angle||Math.abs(r)<le.Angle,s=(Math.abs(t[2])<n*le.Pole||Math.abs(e)>n)&&i;return a&&s?!me&&o<le.Tilt-le.TiltHysteresisMargin?me=!0:me&&o>le.Tilt+le.TiltHysteresisMargin&&(me=!1):me=!1,me}function pe(t,e,n,r,o,i){if(i)H(n,r,qe),pt(e,t.center,qe);else{const i=re(n,r,Oe,e,t.radius,o);pt(e,t.center,U(Oe,i))}}function he(t,e,n,r,o,i,a){const s=a?20:1,c=1e-12;let u,l;x(Ue,r),ke.copyFrom(e);for(let m=0;m<s&&b(n,Ue)>c&&(u=b(n,Ue),se(n,Ue,ve,je,Re,ke,t,o,i,a),ue(ke,t.center,je,Re[1],ve,Re[0]),ce(Ue,Ue,t.center,je,Re[1],ve,Re[0]),l=b(n,Ue),l<u||0===m);m++)e.copyFrom(ke)}function Me(n,r,o,i,a,s,c){fe(o,g(r.up,o),n.radius,-t.normalize(e(a)),s,r.aboveGround)?he(n,r,o,i,-t.normalize(e(a)),s,c):pe(n,r,o,i,s,c)}function ge(t,e,n,r,o,i){const{eye:a}=t;E([0,0,1],a,je,ve,we);const s=e.translation[0]*n.pan,u="zoom"===o.mode?0:e.translation[1]*n.pan,l=Math.max(Math.sqrt(Math.abs(1-g(t.center,je)**2/M(t.center)**2)),.5),m=(Math.sin(i)*u+Math.cos(i)*s)/l,f=-Math.cos(i)*u+Math.sin(i)*s;switch(c(r.pan.matrix,r.pan.matrix,m,je),r.pan.enabled=!0,o.mode){case"pan":c(r.pan.matrix,r.pan.matrix,f,ve),r.pan.enabled=!0;break;case"zoom":r.zoom=-e.translation[1]*n.zoom}}function ye(t,e,n,r,o){const{eye:i,viewRight:a}=t,s=P(Q.get(),a,i),u=e.translation[0]*n.pan;switch(0!==u&&(c(r.pan.matrix,r.pan.matrix,-u,s),r.pan.enabled=!0),o.mode){case"pan":{const t=e.translation[1]*n.pan;0!==t&&(c(r.pan.matrix,r.pan.matrix,t,a),r.pan.enabled=!0);break}case"zoom":r.zoom=-e.translation[1]*n.zoom}}function de(n,r,o,i,a,s,c,u,l){fe(n.center,g(n.up,n.center),M(n.center),-t.normalize(e(s)),c,r.aboveGround)?ge(r,o,i,u,l,-t.normalize(e(a))):ye(r,o,i,u,l)}function be(t,e,n=1/0){const r=Math.abs(g(t,e));return Math.min(n,1/r)}function xe(t,e,n){const r=w(t,e),o=M(t);return r<Math.max(o,n)}const je=q(),ve=q(),we=q(),Pe=q(),ze=q(),Ie=q(),Se=q(),Te=q(),Re=p(),qe=A(),Ae=m(),Fe=m(),He=m(),Ue=q(),Ee=q(),Ge=q();let ke=new Z;const Ce=q(),Oe=q();function We(){ke=new Z}const Be={origin:q(),direction:q()},De={origin:q(),direction:q()};export{wt as TiltThresholdPanningSpeed,vt as VerticalPanTresholds,It as applyPanPlanar,pe as applyPanSphericalDirectRotation,he as applyPanSphericalPreserveHeading,pt as applyRotation,ue as applyRotationWithTwoAxes,yt as applyZoomOnSphere,gt as applyZoomToPoint,bt as centroid,We as cleanupNavigationUtils,ne as computeHorizonDownLimitScreenY,te as computeHorizonPadding,ee as computeHorizonUpLimitScreenY,ut as distanceComparisonTolerance,lt as excludeTerrain,Et as findPlaneHorizonY,Yt as findSphereHorizonY,be as getTiltScaleFactor,zt as inferNavigationMode,ht as intersectPlaneFromScreenPoint,Mt as intersectPlaneFromScreenPointAtEye,xe as isHitOnSamePlanetSide,ie as lengthFromPoints,rt as maxPanDistanceModifier,it as maxRotatePivotDistanceModifier,_ as maxZoomPivotDistanceModifier,et as maxZoomStepDistanceModifier,ot as minPinchAndPanCameraHeight,at as minRotatePivotDistance,mt as normalizeCoordinate,ft as normalizeRotationDelta,jt as offSurfaceTiltToEyeTiltGlobal,xt as onSurfaceTiltToEyeTiltGlobal,de as panMotionToRotationMatrix,Me as panToPosition,Pt as pickPointAndInitSphere,st as pivotSearchAreaSize,le as preservingHeadingThresholds,$t as relativeHorizonPanPadding,ct as rotatePivotSearchAreaSize,ce as rotatePointAroundTwoAxes,re as rotationAngleAndAxisDirectRotation,se as rotationAnglesAndAxesHeadingPreserving,ae as rotationAnglesHeadingPreserving,Zt as shouldClampScreenY,fe as shouldPreserveHeading,Tt as sphereOrPlanePointFromScreenPoint,tt as zoomPivotDistanceClamp,nt as zoomStepDistanceClamp};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{abortMaybe as t}from"../../../../core/maybe.js";import{estimateNumberArrayMemory as s}from"../../../../core/memoryEstimations.js";import{isAbortError as i}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{Milliseconds as a,now as o}from"../../../../core/time.js";import{exactEquals as n,copy as l,normalize as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,exactEquals as _,intersects as c,copy as p}from"../../../../geometry/support/aaBoundingBox.js";import{makeScheduleFunction as f}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as m}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatFadeTexture as g}from"./GaussianSplatFadeTexture.js";import{GaussianSplatHeaderTexture as T}from"./GaussianSplatHeaderTexture.js";import{GaussianSplatOrderTexture as b}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as S}from"./GaussianSplatTextureAtlas.js";import{DepthRange as y}from"../../webgl-engine/lib/DepthRange.js";import{TaskPriority as x}from"../../../support/Scheduler.js";class C{constructor(e,t,s){this._updating=r(!1),this._useDeterministicSort=!1,this._sortBufferMemory=0,this.visibleGaussians=0,this._visibleTileDepthRange=new y,this._previousVisibleTileDepthRangeEye=u(),this._previousVisibleTileDepthRangeViewForward=u(),this._previousVisibleTileDepthRangeClippingBox=d(),this._latestSortedGaussianTilesVersion=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._previousVisibleTileDepthRangeHasClippingBox=!1,this._bufferCapacity=0,this._requestedLyr3dVisibilityChange=0,this._latestCompletedLyr3dVisibilityChange=0,this._latestUpdatedGaussianTiles=new Array,this._latestSortedGaussianTiles=new Array,this._nextCommittedVisibleGaussianTiles=new Array,this._cameraDirectionNormalized=u(),this._frameTask=null,this._workerHandle=null,this._sortAbortController=null,this._isSorting=!1,this._pendingSortTask=!1,this._scheduledSortStartTimeout=null,this._lastSortStartTime=a(-1/0),this._sortInterval=a(80),this._renderer=e,this._onSortComplete=t,this._orderTexture=new b(this._renderer.renderingContext),this._fadingTexture=new g(this._renderer.renderingContext),this._headerTexture=new T(this._renderer.renderingContext),this._textureAtlas=new S(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache,s);const{resourceController:i}=this._renderer.view;this._workerHandle=new m(f(i)),this._frameTask=i.scheduler.registerTask(x.GAUSSIAN_SPLAT_SORTING)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get headerTexture(){return this._headerTexture}get textureAtlasMemory(){return this._textureAtlas.usedMemory}get orderTextureMemory(){return this._orderTexture.usedMemory}get fadingTextureMemory(){return this._fadingTexture.usedMemory}get headerTextureMemory(){return this._headerTexture.usedMemory}get sortBufferMemory(){return this._sortBufferMemory}get usedMemory(){return this.textureAtlasMemory+this.headerTextureMemory+this.orderTextureMemory+this.fadingTextureMemory+this.sortBufferMemory}queryVisibleTileDepthRange(e,t){if(0===this.visibleGaussians)return null;const{eye:s,viewForward:i}=e,r=s[0],a=s[1],o=s[2],h=i[0],u=i[1],d=i[2],f=this._visibleTileDepthRange;if(this._previousVisibleTileDepthRangeTilesVersion===this._latestSortedGaussianTilesVersion&&n(this._previousVisibleTileDepthRangeEye,s)&&n(this._previousVisibleTileDepthRangeViewForward,i)&&(null==t?!this._previousVisibleTileDepthRangeHasClippingBox:this._previousVisibleTileDepthRangeHasClippingBox&&_(this._previousVisibleTileDepthRangeClippingBox,t)))return f.near<=f.far?f:null;let m=1/0,g=-1/0;const T=this._latestSortedGaussianTiles;for(let n=0;n<T.length;n++){const e=T[n];if(null!=t){const s=e.boundingBox;if(!c(s,t))continue}const s=h*(e.obbCenterX-r)+u*(e.obbCenterY-a)+d*(e.obbCenterZ-o),i=e.paddedMbsRadius,l=s-i;l<m&&(m=l);const _=s+i;_>g&&(g=_)}const b=m<=g;return b?f.set(m,g):f.set(1/0,-1/0),this._previousVisibleTileDepthRangeTilesVersion=this._latestSortedGaussianTilesVersion,this._previousVisibleTileDepthRangeHasClippingBox=null!=t,l(this._previousVisibleTileDepthRangeEye,s),l(this._previousVisibleTileDepthRangeViewForward,i),null!=t&&p(this._previousVisibleTileDepthRangeClippingBox,t),b?f:null}updateGaussianVisibility(e,t){this._latestUpdatedGaussianTiles=e,this._requestedLyr3dVisibilityChange=t,this.requestSort()}get updating(){return this._updating.value}destroy(){this._sortAbortController=t(this._sortAbortController),this._pendingSortTask=!1,this._updating.value=!1,null!=this._scheduledSortStartTimeout&&(clearTimeout(this._scheduledSortStartTimeout),this._scheduledSortStartTimeout=null),this._frameTask.remove(),this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._headerTexture.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}requestSort(){return this._updating.value=!0,!this._pendingSortTask&&(this._pendingSortTask=!0,this._scheduleSortStart(),!0)}_scheduleSortStart(){if(this._isSorting)return;const e=o()-this._lastSortStartTime,t=this._sortInterval-e;t<=0?this._startSortIfRequired():null==this._scheduledSortStartTimeout&&(this._scheduledSortStartTimeout=setTimeout(()=>{this._scheduledSortStartTimeout=null,this._pendingSortTask&&!this._isSorting&&this._scheduleSortStart()},t))}_startSortIfRequired(){if(this._isSorting||!this._pendingSortTask)return;const e=new AbortController;this._sortAbortController=e,this._isSorting=!0,this._pendingSortTask=!1,this._lastSortStartTime=o(),this._sortOnWorker(e.signal).finally(()=>{this._sortAbortController===e&&(this._sortAbortController=null),this._handleSortComplete()})}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this._scheduleSortStart():this._updating.value=!1}_clearBuffersAndTextures(){this._atlasIndicesBuffer=void 0,this._sortedAtlasIndicesBuffer=void 0,this._distancesBuffer=void 0,this._bufferCapacity=0,this._sortBufferMemory=0,this._orderTexture.clear(),this._textureAtlas.clear(),this._headerTexture.clear()}_computeExpandedCapacity(t,s){let i=Math.max(1,t);for(;i<s;)i=Math.ceil(i*e);return i}_ensureSortBufferCapacities(e){if(this._bufferCapacity<e){const t=this._computeExpandedCapacity(this._bufferCapacity,e);this._atlasIndicesBuffer=new Uint32Array(t),this._sortedAtlasIndicesBuffer=new Uint32Array(t),this._distancesBuffer=new Float64Array(t),this._bufferCapacity=t,this._sortBufferMemory=s(this._atlasIndicesBuffer,this._sortedAtlasIndicesBuffer,this._distancesBuffer)}}_clearAllBuffersAndTextures(){this._clearBuffersAndTextures(),this._latestSortedGaussianTiles.length=0,this._nextCommittedVisibleGaussianTiles.length=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._workerHandle?.clear()}async _sortOnWorker(e){try{if(0===this._latestUpdatedGaussianTiles.length)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=this._requestedLyr3dVisibilityChange,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);this._useDeterministicSort&&this._latestUpdatedGaussianTiles.sort((e,t)=>e.obb.centerX-t.obb.centerX||e.obb.centerY-t.obb.centerY||e.obb.centerZ-t.obb.centerZ);const t=this._latestUpdatedGaussianTiles,s=t.length,i=this._requestedLyr3dVisibilityChange;let r=0;for(let e=0;e<s;e++)r+=t[e].gaussianCount;this._ensureSortBufferCapacities(r),this._textureAtlas.ensureTextureAtlas(),this._headerTexture.ensureCapacity(this._textureAtlas.pageAllocator.pageCount);const a=this._renderer.camera;h(this._cameraDirectionNormalized,a.ray.direction);const o=this._cameraDirectionNormalized[0],n=this._cameraDirectionNormalized[1],l=this._cameraDirectionNormalized[2];let u=0;const d=this._atlasIndicesBuffer,_=this._distancesBuffer,p=this._renderer.clippingBox,f=this._nextCommittedVisibleGaussianTiles;f.length=0;let m=0;const{frustum:g}=a,T=this._renderer.tileCullingRevision,b=g[0],S=g[1],y=g[2],x=g[3],C=g[4],A=g[5];for(let e=0;e<s;e++){const s=t[e],{gaussianAtlasIndices:i,relativePositions:r,obbCenterX:a,obbCenterY:h,obbCenterZ:g,paddedMbsRadius:V}=s,v=s.gaussianCount;if(s.cullingRevision!==T){let e=null==p||c(s.boundingBox,p);if(e){const t=1.5*V;e=b[0]*a+b[1]*h+b[2]*g+b[3]<t&&S[0]*a+S[1]*h+S[2]*g+S[3]<t&&y[0]*a+y[1]*h+y[2]*g+y[3]<t&&x[0]*a+x[1]*h+x[2]*g+x[3]<t&&C[0]*a+C[1]*h+C[2]*g+C[3]<t&&A[0]*a+A[1]*h+A[2]*g+A[3]<t}s.cullingRevision=T,s.cullingVisible=e}if(!s.cullingVisible)continue;d.set(i,u),f[m++]=s;const B=o*a+n*h+l*g,G=u+v;for(let e=u,t=0;e<G;e++,t+=3){const s=r[t],i=r[t+1],a=r[t+2];_[e]=s*o+i*n+a*l+B}u=G}if(f.length=m,0===u)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=i,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);const V={distances:this._distancesBuffer,atlasIndices:this._atlasIndicesBuffer,sortedAtlasIndices:this._sortedAtlasIndicesBuffer,numGaussians:u,preciseSort:this._useDeterministicSort},v=await(this._workerHandle?.sort(V,e));if(e.aborted)return;v&&(this._distancesBuffer=v.distances,this._atlasIndicesBuffer=v.atlasIndices,this._sortedAtlasIndicesBuffer=v.sortedAtlasIndices);const B=async e=>{this._orderTexture.setData(this._sortedAtlasIndicesBuffer,u);const t=this._latestSortedGaussianTiles;this._latestSortedGaussianTiles=f,this._nextCommittedVisibleGaussianTiles=t,this._latestSortedGaussianTilesVersion++,this._latestCompletedLyr3dVisibilityChange=i,this.visibleGaussians=u,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),this._renderer.requestRender(1),e.madeProgress()};await this._frameTask.schedule(B,e)}catch(t){if(i(t))return}}set useDeterministicSort(e){this._useDeterministicSort=e}}export{C as GaussianSplatDataStore};
2
+ import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{abortMaybe as t}from"../../../../core/maybe.js";import{estimateNumberArrayMemory as s}from"../../../../core/memoryEstimations.js";import{isAbortError as i}from"../../../../core/promiseUtils.js";import{signal as r}from"../../../../core/signal.js";import{Milliseconds as a,now as o}from"../../../../core/time.js";import{exactEquals as n,copy as l,normalize as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as d,exactEquals as _,intersects as c,copy as p}from"../../../../geometry/support/aaBoundingBox.js";import{makeScheduleFunction as f}from"../../layers/support/makeScheduleFunction.js";import{GaussianSplatSortWorkerHandle as m}from"../GaussianSplatWorkerHandle.js";import{GaussianSplatFadeTexture as g}from"./GaussianSplatFadeTexture.js";import{GaussianSplatHeaderTexture as T}from"./GaussianSplatHeaderTexture.js";import{GaussianSplatOrderTexture as b}from"./GaussianSplatOrderTexture.js";import{GaussianSplatTextureAtlas as S}from"./GaussianSplatTextureAtlas.js";import{DepthRange as y}from"../../webgl-engine/lib/DepthRange.js";import{TaskPriority as x}from"../../../support/Scheduler.js";class C{constructor(e,t,s){this._updating=r(!1),this._useDeterministicSort=!1,this._sortBufferMemory=0,this.visibleGaussians=0,this._visibleTileDepthRange=new y,this._previousVisibleTileDepthRangeEye=u(),this._previousVisibleTileDepthRangeViewForward=u(),this._previousVisibleTileDepthRangeClippingBox=d(),this._latestSortedGaussianTilesVersion=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._previousVisibleTileDepthRangeHasClippingBox=!1,this._bufferCapacity=0,this._requestedLyr3dVisibilityChange=0,this._latestCompletedLyr3dVisibilityChange=0,this._latestUpdatedGaussianTiles=new Array,this._latestSortedGaussianTiles=new Array,this._nextCommittedVisibleGaussianTiles=new Array,this._cameraDirectionNormalized=u(),this._frameTask=null,this._workerHandle=null,this._sortAbortController=null,this._isSorting=!1,this._pendingSortTask=!1,this._scheduledSortStartTimeout=null,this._lastSortStartTime=a(-1/0),this._sortInterval=a(80),this._renderer=e,this._onSortComplete=t,this._orderTexture=new b(this._renderer.renderingContext),this._fadingTexture=new g(this._renderer.renderingContext),this._headerTexture=new T(this._renderer.renderingContext),this._textureAtlas=new S(this._renderer.renderingContext,this._renderer.view.resourceController.memoryController,this._renderer.fboCache,s);const{resourceController:i}=this._renderer.view;this._workerHandle=new m(f(i)),this._frameTask=i.scheduler.registerTask(x.GAUSSIAN_SPLAT_SORTING)}get textureAtlas(){return this._textureAtlas}get orderTexture(){return this._orderTexture}get fadingTexture(){return this._fadingTexture}get headerTexture(){return this._headerTexture}get textureAtlasMemory(){return this._textureAtlas.usedMemory}get orderTextureMemory(){return this._orderTexture.usedMemory}get fadingTextureMemory(){return this._fadingTexture.usedMemory}get headerTextureMemory(){return this._headerTexture.usedMemory}get sortBufferMemory(){return this._sortBufferMemory}get usedMemory(){return this.textureAtlasMemory+this.headerTextureMemory+this.orderTextureMemory+this.fadingTextureMemory+this.sortBufferMemory}queryVisibleTileDepthRange(e,t){if(0===this.visibleGaussians)return null;const{eye:s,viewForward:i}=e,r=s[0],a=s[1],o=s[2],h=i[0],u=i[1],d=i[2],f=this._visibleTileDepthRange;if(this._previousVisibleTileDepthRangeTilesVersion===this._latestSortedGaussianTilesVersion&&n(this._previousVisibleTileDepthRangeEye,s)&&n(this._previousVisibleTileDepthRangeViewForward,i)&&(null==t?!this._previousVisibleTileDepthRangeHasClippingBox:this._previousVisibleTileDepthRangeHasClippingBox&&_(this._previousVisibleTileDepthRangeClippingBox,t)))return f.near<=f.far?f:null;let m=1/0,g=-1/0;const T=this._latestSortedGaussianTiles;for(let n=0;n<T.length;n++){const e=T[n];if(null!=t){const s=e.boundingBox;if(!c(s,t))continue}const s=h*(e.obbCenterX-r)+u*(e.obbCenterY-a)+d*(e.obbCenterZ-o),i=e.paddedMbsRadius,l=s-i;l<m&&(m=l);const _=s+i;_>g&&(g=_)}const b=m<=g;return b?f.set(m,g):f.set(1/0,-1/0),this._previousVisibleTileDepthRangeTilesVersion=this._latestSortedGaussianTilesVersion,this._previousVisibleTileDepthRangeHasClippingBox=null!=t,l(this._previousVisibleTileDepthRangeEye,s),l(this._previousVisibleTileDepthRangeViewForward,i),null!=t&&p(this._previousVisibleTileDepthRangeClippingBox,t),b?f:null}updateGaussianVisibility(e,t){this._latestUpdatedGaussianTiles=e,this._requestedLyr3dVisibilityChange=t,this.requestSort()}get updating(){return this._updating.value}destroy(){this._sortAbortController=t(this._sortAbortController),this._pendingSortTask=!1,this._updating.value=!1,null!=this._scheduledSortStartTimeout&&(clearTimeout(this._scheduledSortStartTimeout),this._scheduledSortStartTimeout=null),this._frameTask.remove(),this._workerHandle?.destroyWorkerAndSelf(),this._textureAtlas.destroy(),this._headerTexture.destroy(),this._orderTexture.destroy(),this._fadingTexture.destroy()}requestSort(){this._updating.value=!0,this._pendingSortTask||(this._pendingSortTask=!0,this._scheduleSortStart())}_scheduleSortStart(){if(this._isSorting)return;const e=o()-this._lastSortStartTime,t=this._sortInterval-e;t<=0?this._startSortIfRequired():null==this._scheduledSortStartTimeout&&(this._scheduledSortStartTimeout=setTimeout(()=>{this._scheduledSortStartTimeout=null,this._pendingSortTask&&!this._isSorting&&this._scheduleSortStart()},t))}_startSortIfRequired(){if(this._isSorting||!this._pendingSortTask)return;const e=new AbortController;this._sortAbortController=e,this._isSorting=!0,this._pendingSortTask=!1,this._lastSortStartTime=o(),this._sortOnWorker(e.signal).finally(()=>{this._sortAbortController===e&&(this._sortAbortController=null),this._handleSortComplete()})}_handleSortComplete(){this._isSorting=!1,this._pendingSortTask?this._scheduleSortStart():this._updating.value=!1}_clearBuffersAndTextures(){this._atlasIndicesBuffer=void 0,this._sortedAtlasIndicesBuffer=void 0,this._distancesBuffer=void 0,this._bufferCapacity=0,this._sortBufferMemory=0,this._orderTexture.clear(),this._textureAtlas.clear(),this._headerTexture.clear()}_computeExpandedCapacity(t,s){let i=Math.max(1,t);for(;i<s;)i=Math.ceil(i*e);return i}_ensureSortBufferCapacities(e){if(this._bufferCapacity<e){const t=this._computeExpandedCapacity(this._bufferCapacity,e);this._atlasIndicesBuffer=new Uint32Array(t),this._sortedAtlasIndicesBuffer=new Uint32Array(t),this._distancesBuffer=new Float64Array(t),this._bufferCapacity=t,this._sortBufferMemory=s(this._atlasIndicesBuffer,this._sortedAtlasIndicesBuffer,this._distancesBuffer)}}_clearAllBuffersAndTextures(){this._clearBuffersAndTextures(),this._latestSortedGaussianTiles.length=0,this._nextCommittedVisibleGaussianTiles.length=0,this._previousVisibleTileDepthRangeTilesVersion=-1,this._workerHandle?.clear()}async _sortOnWorker(e){try{if(0===this._latestUpdatedGaussianTiles.length)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=this._requestedLyr3dVisibilityChange,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);this._useDeterministicSort&&this._latestUpdatedGaussianTiles.sort((e,t)=>e.obb.centerX-t.obb.centerX||e.obb.centerY-t.obb.centerY||e.obb.centerZ-t.obb.centerZ);const t=this._latestUpdatedGaussianTiles,s=t.length,i=this._requestedLyr3dVisibilityChange;let r=0;for(let e=0;e<s;e++)r+=t[e].gaussianCount;this._ensureSortBufferCapacities(r),this._textureAtlas.ensureTextureAtlas(),this._headerTexture.ensureCapacity(this._textureAtlas.pageAllocator.pageCount);const a=this._renderer.camera;h(this._cameraDirectionNormalized,a.ray.direction);const o=this._cameraDirectionNormalized[0],n=this._cameraDirectionNormalized[1],l=this._cameraDirectionNormalized[2];let u=0;const d=this._atlasIndicesBuffer,_=this._distancesBuffer,p=this._renderer.clippingBox,f=this._nextCommittedVisibleGaussianTiles;f.length=0;let m=0;const{frustum:g}=a,T=this._renderer.tileCullingRevision,b=g[0],S=g[1],y=g[2],x=g[3],C=g[4],A=g[5];for(let e=0;e<s;e++){const s=t[e],{gaussianAtlasIndices:i,relativePositions:r,obbCenterX:a,obbCenterY:h,obbCenterZ:g,paddedMbsRadius:V}=s,v=s.gaussianCount;if(s.cullingRevision!==T){let e=null==p||c(s.boundingBox,p);if(e){const t=1.5*V;e=b[0]*a+b[1]*h+b[2]*g+b[3]<t&&S[0]*a+S[1]*h+S[2]*g+S[3]<t&&y[0]*a+y[1]*h+y[2]*g+y[3]<t&&x[0]*a+x[1]*h+x[2]*g+x[3]<t&&C[0]*a+C[1]*h+C[2]*g+C[3]<t&&A[0]*a+A[1]*h+A[2]*g+A[3]<t}s.cullingRevision=T,s.cullingVisible=e}if(!s.cullingVisible)continue;d.set(i,u),f[m++]=s;const B=o*a+n*h+l*g,G=u+v;for(let e=u,t=0;e<G;e++,t+=3){const s=r[t],i=r[t+1],a=r[t+2];_[e]=s*o+i*n+a*l+B}u=G}if(f.length=m,0===u)return this.visibleGaussians=0,this._clearAllBuffersAndTextures(),this._latestCompletedLyr3dVisibilityChange=i,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),void this._renderer.requestRender(1);const V={distances:this._distancesBuffer,atlasIndices:this._atlasIndicesBuffer,sortedAtlasIndices:this._sortedAtlasIndicesBuffer,numGaussians:u,preciseSort:this._useDeterministicSort},v=await(this._workerHandle?.sort(V,e));if(e.aborted)return;v&&(this._distancesBuffer=v.distances,this._atlasIndicesBuffer=v.atlasIndices,this._sortedAtlasIndicesBuffer=v.sortedAtlasIndices);const B=async e=>{this._orderTexture.setData(this._sortedAtlasIndicesBuffer,u);const t=this._latestSortedGaussianTiles;this._latestSortedGaussianTiles=f,this._nextCommittedVisibleGaussianTiles=t,this._latestSortedGaussianTilesVersion++,this._latestCompletedLyr3dVisibilityChange=i,this.visibleGaussians=u,this._onSortComplete(this._latestSortedGaussianTiles,this._latestCompletedLyr3dVisibilityChange),this._renderer.requestRender(1),e.madeProgress()};await this._frameTask.schedule(B,e)}catch(t){if(i(t))return}}set useDeterministicSort(e){this._useDeterministicSort=e}}export{C as GaussianSplatDataStore};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{signal as e}from"../../../../core/signal.js";import{Milliseconds as i}from"../../../../core/time.js";import{getGaussianSplatAlphaCutoffValue as t}from"../../webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js";class a{static{this.fadeInEase=e=>e*(2-e)}static{this.fadeOutEase=e=>e*e}static{this.inverseFadeInEase=e=>1-Math.sqrt(1-e)}static{this.inverseFadeOutEase=e=>Math.sqrt(1-e)}static{this.minimumFadeDuration=i(80)}static{this.resetFadeDurationInterval=i(1e3)}constructor(t){this.layerView=t,this._numFadingTiles=e(0),this._tmpFullyFadedOutTiles=new Array,this._previousNumFadingTiles=0,this._lastStoppedFading=i(0),this._currentFadeDuration=this.baseFadeDuration}get numFadingTiles(){return this._numFadingTiles.value}fadeTile(e,i,t){const a=this._getTargetOpacity(i);if(e.fadeDirection=i,!this.fadingEnabled)return void this._instantTileFading(e,a);const s=e.opacityModifier;if(s!==a){const a=this._getFadeProgressFromOpacity(s,i);this._startTileFading(e,a,t)}else this._stopTileFading(e)}updateAllTileFading(e){const i=this._tmpFullyFadedOutTiles;i.length=0,this.layerView.tileHandles.forEach(t=>{this._updateTileFading(t,e)&&i.push(t)});i.length>0&&(this.layerView.notifyTileObbsChanged(i),0===this._numFadingTiles.value&&this.layerView.updateGaussians()),this._numFadingTiles.value>0&&this.layerView.view.stage?.renderView.requestRender(2)}onFadeDurationChanged(e){0===e&&this.numFadingTiles>0&&this._instantlyFullyFadeAllTiles()}isTileFadingOut(e){return null!=e.fadeProgress&&1===e.fadeDirection}onTileDiscarded(e){null!=e.fadeProgress&&(this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=i(performance.now())))}updateFadeDuration(){if(this.numFadingTiles&&this.numFadingTiles>=this._previousNumFadingTiles){const e=.95*this._currentFadeDuration;this._currentFadeDuration=i(Math.max(e,a.minimumFadeDuration))}else 0===this.numFadingTiles&&performance.now()-this._lastStoppedFading>a.resetFadeDurationInterval&&(this._currentFadeDuration=this.baseFadeDuration);return this._previousNumFadingTiles=this.numFadingTiles,this._currentFadeDuration}get updating(){return this._numFadingTiles.value>0}get baseFadeDuration(){return this.layerView.view.qualitySettings.fadeDuration}get fadingEnabled(){return 0!==this.baseFadeDuration}_startTileFading(e,i,t){null==e.fadeProgress&&this._numFadingTiles.value++,e.fadeDuration=t,e.fadeProgress=i}_stopTileFading(e){null!=e.fadeProgress&&(1===e.fadeDirection&&this._onTileFullyFadedOut(e),this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=i(performance.now())),e.fadeDuration=null,e.fadeProgress=null)}_updateTileFading(e,i){const{fadeProgress:t,fadeDirection:s}=e;if(null==t)return!1;const n=this._fadeDirectionToSign(s),r=e.fadeDuration,d=this._getTargetOpacity(s),l=i/Math.abs(r||1),u=Math.min(t+l,1),o=d-n*(1-(0===s?a.fadeInEase:a.fadeOutEase)(u)),h=1===u||this._tileReachedFadeOutCutoff(e,o);if(e.opacityModifier=h?d:o,h){const i=1===s;return this._stopTileFading(e),this._updateOpacityModifier(e),i}return e.fadeProgress=u,this._updateOpacityModifier(e),!1}_updateOpacityModifier(e){for(let i=0;i<e.pageIds.length;i++){const t=e.pageIds[i];this.layerView.data.fadingTexture.updateBuffer(e.opacityModifier,t)}}_tileReachedFadeOutCutoff(e,i){if(1!==e.fadeDirection)return!1;const a=t(this.layerView.view.qualitySettings.gaussianSplat.nonIdleMinimumOpacity);return i*e.maxGaussianOpacity<=a}_instantTileFading(e,i){e.fadeDuration=null,e.fadeProgress=null,e.opacityModifier=i,this._updateOpacityModifier(e),1===e.fadeDirection&&this._onTileFullyFadedOut(e)}_instantlyFullyFadeAllTiles(){const e=this._tmpFullyFadedOutTiles;e.length=0,this.layerView.tileHandles.forEach(i=>{if(null!=i.fadeProgress){const t=1===i.fadeDirection;this._instantTileFading(i,this._getTargetOpacity(i.fadeDirection)),t&&e.push(i)}});e.length>0&&(this.layerView.updateGaussians(),this.layerView.notifyTileObbsChanged(e)),this._numFadingTiles.value=0}_onTileFullyFadedOut(e){e.lifecycleState=0,this.layerView.moveTileToCache(e)}_fadeDirectionToSign(e){return 0===e?1:-1}_getTargetOpacity(e){return 0===e?1:0}_getFadeProgressFromOpacity(e,i){const t=Math.max(0,Math.min(e,1));return 0===i?a.inverseFadeInEase(t):a.inverseFadeOutEase(t)}}export{a as GaussianSplatFadeHelper};
2
+ import{signal as i}from"../../../../core/signal.js";import{Milliseconds as e}from"../../../../core/time.js";import{getGaussianSplatAlphaCutoffValue as t}from"../../webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js";class a{static{this.fadeInEase=i=>i*(2-i)}static{this.fadeOutEase=i=>i*i}static{this.inverseFadeInEase=i=>1-Math.sqrt(1-i)}static{this.inverseFadeOutEase=i=>Math.sqrt(1-i)}static{this.minimumFadeDuration=e(80)}static{this.resetFadeDurationInterval=e(1e3)}constructor(t){this._view=t,this._numFadingTiles=i(0),this._tmpFullyFadedOutTiles=new Array,this._previousNumFadingTiles=0,this._lastStoppedFading=e(0),this._currentFadeDuration=this.baseFadeDuration}get numFadingTiles(){return this._numFadingTiles.value}updateForFrame(i){if(i!==this._lastUpdatedFrameStart){if(this._lastUpdatedFrameStart=i,0===this.numFadingTiles)this._previousFrameStart=null;else{const t=e(null==this._previousFrameStart?0:i-this._previousFrameStart);this.updateAllTileFading(t),this._previousFrameStart=i}this._view.updateFadingTexture()}}fadeTile(i,e,t){const a=this._getTargetOpacity(e);if(i.fadeDirection=e,!this.fadingEnabled)return void this._instantTileFading(i,a);const s=i.opacityModifier;if(s!==a){const a=this._getFadeProgressFromOpacity(s,e);this._startTileFading(i,a,t)}else this._stopTileFading(i)}updateAllTileFading(i){const e=this._tmpFullyFadedOutTiles;e.length=0,this._view.tileHandles.forEach(t=>{this._updateTileFading(t,i)&&e.push(t)});e.length>0&&(this._view.notifyTileObbsChanged(e),0===this._numFadingTiles.value&&this._view.updateGaussians()),this._numFadingTiles.value>0&&this._view.view.stage?.renderView.requestRender(2)}onFadeDurationChanged(i){0===i&&this.numFadingTiles>0&&this._instantlyFullyFadeAllTiles()}isTileFadingOut(i){return null!=i.fadeProgress&&1===i.fadeDirection}onTileDiscarded(i){null!=i.fadeProgress&&(this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=e(performance.now())))}updateFadeDuration(){if(this.numFadingTiles&&this.numFadingTiles>=this._previousNumFadingTiles){const i=.95*this._currentFadeDuration;this._currentFadeDuration=e(Math.max(i,a.minimumFadeDuration))}else 0===this.numFadingTiles&&performance.now()-this._lastStoppedFading>a.resetFadeDurationInterval&&(this._currentFadeDuration=this.baseFadeDuration);return this._previousNumFadingTiles=this.numFadingTiles,this._currentFadeDuration}get updating(){return this._numFadingTiles.value>0}get baseFadeDuration(){return this._view.view.qualitySettings.fadeDuration}get fadingEnabled(){return 0!==this.baseFadeDuration}_startTileFading(i,e,t){null==i.fadeProgress&&this._numFadingTiles.value++,i.fadeDuration=t,i.fadeProgress=e}_stopTileFading(i){null!=i.fadeProgress&&(1===i.fadeDirection&&this._onTileFullyFadedOut(i),this._numFadingTiles.value--,0===this._numFadingTiles.value&&(this._lastStoppedFading=e(performance.now())),i.fadeDuration=null,i.fadeProgress=null)}_updateTileFading(i,e){const{fadeProgress:t,fadeDirection:s}=i;if(null==t)return!1;const n=this._fadeDirectionToSign(s),r=i.fadeDuration,d=this._getTargetOpacity(s),u=e/Math.abs(r||1),l=Math.min(t+u,1),o=d-n*(1-(0===s?a.fadeInEase:a.fadeOutEase)(l)),h=1===l||this._tileReachedFadeOutCutoff(i,o);if(i.opacityModifier=h?d:o,h){const e=1===s;return this._stopTileFading(i),this._updateOpacityModifier(i),e}return i.fadeProgress=l,this._updateOpacityModifier(i),!1}_updateOpacityModifier(i){for(let e=0;e<i.pageIds.length;e++){const t=i.pageIds[e];this._view.data.fadingTexture.updateBuffer(i.opacityModifier,t)}}_tileReachedFadeOutCutoff(i,e){if(1!==i.fadeDirection)return!1;const a=t(this._view.view.qualitySettings.gaussianSplat.nonIdleMinimumOpacity);return e*i.maxGaussianOpacity<=a}_instantTileFading(i,e){i.fadeDuration=null,i.fadeProgress=null,i.opacityModifier=e,this._updateOpacityModifier(i),1===i.fadeDirection&&this._onTileFullyFadedOut(i)}_instantlyFullyFadeAllTiles(){const i=this._tmpFullyFadedOutTiles;i.length=0,this._view.tileHandles.forEach(e=>{if(null!=e.fadeProgress){const t=1===e.fadeDirection;this._instantTileFading(e,this._getTargetOpacity(e.fadeDirection)),t&&i.push(e)}});i.length>0&&(this._view.updateGaussians(),this._view.notifyTileObbsChanged(i)),this._numFadingTiles.value=0}_onTileFullyFadedOut(i){i.lifecycleState=0,this._view.moveTileToCache(i)}_fadeDirectionToSign(i){return 0===i?1:-1}_getTargetOpacity(i){return 0===i?1:0}_getFadeProgressFromOpacity(i,e){const t=Math.max(0,Math.min(i,1));return 0===e?a.inverseFadeInEase(t):a.inverseFadeOutEase(t)}}export{a as GaussianSplatFadeHelper};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{unique as r}from"../../../core/arrayUtils.js";import{EventEmitter as t}from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as s,everyMap as i}from"../../../core/MapUtils.js";import{disposeMaybe as n}from"../../../core/maybe.js";import o from"../../../core/PooledArray.js";import{watch as a,syncAndInitial as h,on as d,initial as l}from"../../../core/reactiveUtils.js";import{someSet as c}from"../../../core/SetUtils.js";import{property as u,subclass as p}from"../../../core/accessorSupport/decorators.js";import{ortho as _,fromTranslation as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{debugFlags as f}from"../support/debugFlags.js";import{Overlay as R}from"./Overlay.js";import{OverlayRenderTargets as v}from"./OverlayRenderTargets.js";import w from"../webgl/RenderCamera.js";import{SyncRenderPlugin as x}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as T,renderHighlightBuffer as S}from"../webgl-engine/effects/highlight/Highlight.js";import{GLMaterialRepository as b}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as O}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderContext as D,defaultRenderOccludedMask as C}from"../webgl-engine/lib/RenderContext.js";import{ShadowMap as P}from"../webgl-engine/lib/ShadowMap.js";import{T as j}from"../../../chunks/Texture.glsl.js";import{TextureTechnique as E}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as F}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{AmbientLight as M}from"../webgl-engine/lighting/Lightsources.js";import{O as W}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as V}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as q}from"../../support/Scheduler.js";import A from"../../webgl/Texture.js";import{TextureDescriptor as G}from"../../webgl/TextureDescriptor.js";let k=class extends x{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new W,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new o,this._passParameters=new j,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new w,this.events=new t,this.longitudeCyclical=null,this.produces=new Map([[18,e=>10!==e||this.hasHighlights],[19,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;const{state:r,stage:s}=e.parent.view,i=s.renderer.fboCache,n=s.renderView.renderingContext,a=s.renderView.techniques;this._renderContext=new D(n,new P(i,r.viewingMode),a)}initialize(){const e=this._view,r=e.stage.renderView.waterTextures;this.addHandles([a(()=>r.updating,()=>this.events.emit("content-changed"),h),a(()=>this._spatialReference,e=>this._localOriginFactory=new O(e),h),d(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),a(()=>T(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,l),a(()=>e.state.highlights,e=>{this._bindParameters.highlights=e},l),e.resourceController.scheduler.registerTask(q.OVERLAY_RENDERER,this)]);const t=this._camera;t.near=1,t.far=1e4,t.relativeElevation=null,this._bindParameters.slot=18,this._bindParameters.camera=t,this._bindParameters.updateLighting(new M(y()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=n(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const r=new b(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:r},this._techniques.precompile(V)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||s(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const r of this._renderers.values()){const t=r.getMaterialRenderer(e);if(t)return t}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),r(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,r){const t=this._renderers.get(e);null!=t&&t.destroy(),this._renderers.set(e,r),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(a(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&c(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=c(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=c(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=c(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new v(this._stage.renderer.fboCache),this._overlays=[new R,new R]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){const r=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(r?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=s(this._renderers,e=>e.hasOccluders)?H:1}_processDrapeSources(e,r){let t=!1;for(const[s,i]of this._renderers){if(r?.done)break;(s.destroyed||e(s))&&(i.commitChanges()&&(t=!0,r?.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,t=!0,this._updateSortedDrapeSourceRenderers(),r?.madeProgress()),r&&this.compact(r),t&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=s(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let r=!1;for(const t of this._renderers.values()){if(e.done)break;r=t.compact(e)||r}return r&&this.notifyChange("updating"),r}hasHighlight(e){return s(this._renderers,r=>r.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>1===e.updatePolicy)}get isEmpty(){return!f.OVERLAY_DRAW_DEBUG_TEXTURE&&i(this._renderers,e=>e.isEmpty)}get hasWater(){const e=s(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const r=this._overlays[0];for(const i of this._overlays)i.setupGeometryViews(this.longitudeCyclical);if(!r.hasSomeSizedView())return!1;const t=this._setOutput(this._renderTargets?.targets.find(r=>r.content===e)?.output??0);++this._techniques.precompiling;const s=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(t),s}_setOutput(e){const r=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=4===e?19:18,r}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let r=!1;return this._renderers.forEach(t=>r=t.updateAnimation(e)||r),r&&this.parent.requestRender(0),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const r=this._bindParameters;r.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const t of this._renderTargets.targets){if(1===t.content&&!this._needsColorWithoutRasterImage)continue;const{output:e}=t;this._setOutput(e),10===e&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null);const s=this._renderContext.renderOccludedMask;4===t.content&&(this._renderContext.renderOccludedMask=H),this._sortedRenderers.forAll(({drapeSource:e,renderer:r})=>{1===t.content&&0===e.drapeSourceType||4===t.content&&r.hasOnlyOccluders||r.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=s,r.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,r){if(!this._overlays||!this._renderTargets)return;for(const s of this._overlays)s.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const t=this.allSourcesOccluders;for(const s of this._renderTargets.targets){if(!(0===s.content&&this._hasDrapedFlowSource)&&!s.handleRenderRequest(r)||1===s.content&&!this._needsColorWithoutRasterImage||4===s.content&&t)continue;const e=this._drawTarget(0,s),i=this._drawTarget(1,s);(e||i)&&s.fbo.generateMipMap()}}_drawTarget(e,r){const t=this._overlays[e],s=t.canvasGeometries;if(0===s.numViews)return!1;const i=this._view.state.contentPixelRatio;this._screenToWorldRatio=i*t.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:n,content:o}=r;if(this.isEmpty||4===n&&!this.hasWater||!t.hasSomeSizedView())return!1;const{_rctx:a,_camera:h,_renderContext:d,_bindParameters:l}=this;if(h.pixelRatio=t.pixelRatio*i,this._setOutput(n),l.screenToWorldRatio=this._screenToWorldRatio,l.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===o&&(d.renderOccludedMask=H),!this.renders(o))return d.renderOccludedMask=C,!1;const{resolution:c}=t,u=0===e,p=u?0:c;a.setViewport(p,0,c,c),this._bindTargetFBO(r),u&&(10===n?a.gl.clearBufferuiv(a.gl.COLOR,0,[0,0,0,0]):(a.setClearColor(0,0,0,0),a.clear(16384)));if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==o&&2!==o){this._techniques.precompile(E,L);const r=this._techniques.get(E,L);for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],t),this._ensureDebugPatternResources(t.resolution,U[e]),a.bindTechnique(r,l,this._passParameters),a.screen.draw()}if(10===n){const{fboCache:t}=this._stage.renderer,s=this._resolution;this._bindTargetFBO(r),S(a,t,s,s,l,()=>this._renderAllGeometry(e,r),p)}else this._renderAllGeometry(e,r);return a.bindFramebuffer(null),d.renderOccludedMask=C,!0}get allSourcesOccluders(){return i(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,r){const t=this._overlays[e],s=t.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:i,renderer:n})=>{if(1===r.content&&0===i.drapeSourceType)return;const{fullOpacity:o}=i,a=null!=o&&o<1&&0===r.output&&this._bindTemporaryFBO();for(let e=0;e<s.numViews;e++)this._setViewParameters(s.extents[e],t),n.render(this._renderContext);if(a){this._bindTargetFBO(r),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const t=this._techniques.get(V);this._rctx.bindTechnique(t,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}})}_bindTargetFBO(e){const r=this._resolution,t=2*r;e.fbo.ensureFramebuffer(t,r),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,r=2*e,t=this._stage.renderer.fboCache,s=t.acquire(r,e,"overlay tmp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clear(16384),s}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersectRay(e,r,t,s){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(const{renderer:n}of this._sortedRenderers)i=n.intersectRay?.(e,r,t,s,i)??i}*intersectScreenPolygon(e,r,t){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let s=0;for(const{renderer:i}of this._sortedRenderers)s=yield*i.intersectScreenPolygon(e,r,t,s)}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),r=e.length;this._renderers.forEach((t,s)=>{const i=e.indexOf(s.layer?.uid),n=i>=0,o=s.renderGroup??(n?0:1),a=s.drapeSourcePriorityOffset??0,h=r*o+(n?i:0)+a;this._sortedRenderers.push(new I(s,t,h))}),this._sortedRenderers.sort((e,r)=>e.index-r.index)}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],_(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),g(t.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,r){if(m(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let n=0;n<e;n++)for(let r=0;r<e;r++){const i=Math.floor(r/10),o=Math.floor(n/10);i<2||o<2||10*i>e-20||10*o>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&o?1&r^1&n?0:255:1&i^1&o?0:128)}const i=new G(e);i.samplingMode=9728,this._passParameters.texture=new A(this._rctx,i,t)}get test(){}};e([u()],k.prototype,"hasHighlights",void 0),e([u()],k.prototype,"renderOccludedFlags",void 0),e([u()],k.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([u({constructOnly:!0})],k.prototype,"parent",void 0),e([u({readOnly:!0})],k.prototype,"_techniques",null),e([u({type:Boolean,readOnly:!0})],k.prototype,"updating",null),e([u()],k.prototype,"isEmpty",null),k=e([p("esri.views.3d.terrain.OverlayRenderer")],k);class I{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const U=[[1,.5,.5],[.5,.5,1]],B=-2,H=4,L=new F;L.hasAlpha=!0;export{k as OverlayRenderer,B as drapedZ,H as overlayRenderOccludedFlag};
2
+ import{__decorate as e}from"tslib";import{unique as r}from"../../../core/arrayUtils.js";import{EventEmitter as t}from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as s,everyMap as i}from"../../../core/MapUtils.js";import{disposeMaybe as n}from"../../../core/maybe.js";import o from"../../../core/PooledArray.js";import{watch as a,syncAndInitial as h,on as d,initial as l}from"../../../core/reactiveUtils.js";import{someSet as c}from"../../../core/SetUtils.js";import{property as u,subclass as p}from"../../../core/accessorSupport/decorators.js";import{ortho as _,fromTranslation as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{debugFlags as f}from"../support/debugFlags.js";import{Overlay as R}from"./Overlay.js";import{OverlayRenderTargets as v}from"./OverlayRenderTargets.js";import w from"../webgl/RenderCamera.js";import{SyncRenderPlugin as x}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as S,renderHighlightBuffer as T}from"../webgl-engine/effects/highlight/Highlight.js";import{GLMaterialRepository as b}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as D}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderContext as O,defaultRenderOccludedMask as C}from"../webgl-engine/lib/RenderContext.js";import{ShadowMap as P}from"../webgl-engine/lib/ShadowMap.js";import{T as j}from"../../../chunks/Texture.glsl.js";import{TextureTechnique as E}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as F}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{AmbientLight as M}from"../webgl-engine/lighting/Lightsources.js";import{O as W}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as V}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as q}from"../../support/Scheduler.js";import A from"../../webgl/Texture.js";import{TextureDescriptor as G}from"../../webgl/TextureDescriptor.js";let k=class extends x{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new W,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new o,this._passParameters=new j,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new w,this.events=new t,this.longitudeCyclical=null,this.produces=new Map([[18,e=>10!==e||this.hasHighlights],[19,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;const{state:r,stage:s}=e.parent.view,i=s.renderer.fboCache,n=s.renderView.renderingContext,a=s.renderView.techniques;this._renderContext=new O(n,new P(i,r.viewingMode),a)}initialize(){const e=this._view,r=e.stage.renderView.waterTextures;this.addHandles([a(()=>r.updating,()=>this.events.emit("content-changed"),h),a(()=>this._spatialReference,e=>this._localOriginFactory=new D(e),h),d(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),a(()=>S(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,l),a(()=>e.state.highlights,e=>{this._bindParameters.highlights=e},l),e.resourceController.scheduler.registerTask(q.OVERLAY_RENDERER,this)]);const t=this._camera;t.near=1,t.far=1e4,t.relativeElevation=null,this._bindParameters.slot=18,this._bindParameters.camera=t,this._bindParameters.updateLighting(new M(y()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=n(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const r=new b(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:r},this._techniques.precompile(V)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||s(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const r of this._renderers.values()){const t=r.getMaterialRenderer(e);if(t)return t}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),r(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,r){const t=this._renderers.get(e);null!=t&&t.destroy(),this._renderers.set(e,r),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(a(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&c(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=c(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=c(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=c(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new v(this._stage.renderer.fboCache),this._overlays=[new R,new R]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&(this._hasDrapedFeatureSource||this._hasDrapedRasterSource)}getTexture(e){const r=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(r?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=s(this._renderers,e=>e.hasOccluders)?H:1}_processDrapeSources(e,r){let t=!1;for(const[s,i]of this._renderers){if(r?.done)break;(s.destroyed||e(s))&&(i.commitChanges()&&(t=!0,r?.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,t=!0,this._updateSortedDrapeSourceRenderers(),r?.madeProgress()),r&&this.compact(r),t&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=s(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let r=!1;for(const t of this._renderers.values()){if(e.done)break;r=t.compact(e)||r}return r&&this.notifyChange("updating"),r}hasHighlight(e){return s(this._renderers,r=>r.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>1===e.updatePolicy)}get isEmpty(){return!f.OVERLAY_DRAW_DEBUG_TEXTURE&&i(this._renderers,e=>e.isEmpty)}get hasWater(){const e=s(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const r=this._overlays[0];for(const i of this._overlays)i.setupGeometryViews(this.longitudeCyclical);if(!r.hasSomeSizedView())return!1;const t=this._setOutput(this._renderTargets?.targets.find(r=>r.content===e)?.output??0);++this._techniques.precompiling;const s=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(t),s}_setOutput(e){const r=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=4===e?19:18,r}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let r=!1;return this._renderers.forEach(t=>r=t.updateAnimation(e)||r),r&&this.parent.requestRender(0),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const r=this._bindParameters;r.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const t of this._renderTargets.targets){if(1===t.content&&!this._needsColorWithoutRasterImage)continue;const{output:e}=t;this._setOutput(e),10===e&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null);const s=this._renderContext.renderOccludedMask;4===t.content&&(this._renderContext.renderOccludedMask=H),this._sortedRenderers.forAll(({drapeSource:e,renderer:r})=>{1===t.content&&0===e.drapeSourceType||4===t.content&&r.hasOnlyOccluders||r.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=s,r.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,r){if(!this._overlays||!this._renderTargets)return;for(const s of this._overlays)s.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const t=this.allSourcesOccluders;for(const s of this._renderTargets.targets){if(!(0===s.content&&this._hasDrapedFlowSource)&&!s.handleRenderRequest(r)||1===s.content&&!this._needsColorWithoutRasterImage||4===s.content&&t)continue;const e=this._drawTarget(0,s),i=this._drawTarget(1,s);(e||i)&&s.fbo.generateMipMap()}}_drawTarget(e,r){const t=this._overlays[e],s=t.canvasGeometries;if(0===s.numViews)return!1;const i=this._view.state.contentPixelRatio;this._screenToWorldRatio=i*t.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:n,content:o}=r;if(this.isEmpty||4===n&&!this.hasWater||!t.hasSomeSizedView())return!1;const{_rctx:a,_camera:h,_renderContext:d,_bindParameters:l}=this;if(h.pixelRatio=t.pixelRatio*i,this._setOutput(n),l.screenToWorldRatio=this._screenToWorldRatio,l.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===o&&(d.renderOccludedMask=H),!this.renders(o))return d.renderOccludedMask=C,!1;const{resolution:c}=t,u=0===e,p=u?0:c;a.setViewport(p,0,c,c),this._bindTargetFBO(r),u&&(10===n?a.gl.clearBufferuiv(a.gl.COLOR,0,[0,0,0,0]):(a.setClearColor(0,0,0,0),a.clear(16384)));if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==o&&2!==o){this._techniques.precompile(E,L);const r=this._techniques.get(E,L);for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],t),this._ensureDebugPatternResources(t.resolution,U[e]),a.bindTechnique(r,l,this._passParameters),a.screen.draw()}if(10===n){const{fboCache:t}=this._stage.renderer,s=this._resolution;this._bindTargetFBO(r),T(a,t,s,s,l,()=>this._renderAllGeometry(e,r),p)}else this._renderAllGeometry(e,r);return a.bindFramebuffer(null),d.renderOccludedMask=C,!0}get allSourcesOccluders(){return i(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,r){const t=this._overlays[e],s=t.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:i,renderer:n})=>{if(1===r.content&&0===i.drapeSourceType)return;const{fullOpacity:o}=i,a=null!=o&&o<1&&0===r.output&&this._bindTemporaryFBO();for(let e=0;e<s.numViews;e++)this._setViewParameters(s.extents[e],t),n.render(this._renderContext);if(a){this._bindTargetFBO(r),this._overlayParameters.texture=a.getTexture(),this._overlayParameters.opacity=o,this._overlayParameters.overlayIndex=e;const t=this._techniques.get(V);this._rctx.bindTechnique(t,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),a.release()}})}_bindTargetFBO(e){const r=this._resolution,t=2*r;e.fbo.ensureFramebuffer(t,r),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,r=2*e,t=this._stage.renderer.fboCache,s=t.acquire(r,e,"overlay tmp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clear(16384),s}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersectRay(e,r,t,s){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(const{renderer:n}of this._sortedRenderers)i=n.intersectRay?.(e,r,t,s,i)??i}*intersectScreenPolygon(e,r,t){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let s=0;for(const{renderer:i}of this._sortedRenderers)s=yield*i.intersectScreenPolygon(e,r,t,s)}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),r=e.length;this._renderers.forEach((t,s)=>{const i=e.indexOf(s.layer?.uid),n=i>=0,o=s.renderGroup??(n?0:1),a=s.drapeSourcePriorityOffset??0,h=r*o+(n?i:0)+a;this._sortedRenderers.push(new I(s,t,h))}),this._sortedRenderers.sort((e,r)=>e.index-r.index)}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],_(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),g(t.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,r){if(m(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let n=0;n<e;n++)for(let r=0;r<e;r++){const i=Math.floor(r/10),o=Math.floor(n/10);i<2||o<2||10*i>e-20||10*o>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&o?1&r^1&n?0:255:1&i^1&o?0:128)}const i=new G(e);i.samplingMode=9728,this._passParameters.texture=new A(this._rctx,i,t)}get test(){}};e([u()],k.prototype,"hasHighlights",void 0),e([u()],k.prototype,"renderOccludedFlags",void 0),e([u()],k.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([u({constructOnly:!0})],k.prototype,"parent",void 0),e([u({readOnly:!0})],k.prototype,"_techniques",null),e([u({type:Boolean,readOnly:!0})],k.prototype,"updating",null),e([u()],k.prototype,"isEmpty",null),k=e([p("esri.views.3d.terrain.OverlayRenderer")],k);class I{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const U=[[1,.5,.5],[.5,.5,1]],B=-2,H=4,L=new F;L.hasAlpha=!0;export{k as OverlayRenderer,B as drapedZ,H as overlayRenderOccludedFlag};
@@ -1,41 +1,49 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{addNearFar as o}from"../ForwardLinearDepthToWriteShadowMap.glsl.js";import{SliceDraw as r}from"../Slice.glsl.js";import{Transform as e}from"../Transform.glsl.js";import{NormalAttribute as t}from"../attributes/NormalAttribute.glsl.js";import{ObjectAndLayerIdColor as i}from"../attributes/ObjectAndLayerIdColor.glsl.js";import{TextureCoordinateAttribute as a}from"../attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormal as s}from"../attributes/VertexNormal.glsl.js";import{outputDepth as l}from"../output/OutputDepth.glsl.js";import{OutputHighlight as d}from"../output/OutputHighlight.glsl.js";import{VisualVariables as n}from"../shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as c}from"../util/DiscardOrAdjustAlpha.glsl.js";import{addProjViewLocalOrigin as u}from"../util/View.glsl.js";import{glsl as p,If as v}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as m}from"../../shaderModules/Texture2DPassUniform.js";function f(f,g){const{vertex:x,fragment:O,varyings:j}=f,{hasColorTexture:h,alphaDiscardMode:w}=g,V=h&&1!==w,{output:C,normalType:b,hasColorTextureTransform:A}=g;switch(C){case 3:u(x,g),f.include(e),O.include(r,g),f.include(a,g),V&&O.uniforms.add(new m("tex",o=>o.texture)),x.main.add(p`vpos = getVertexInLocalOriginSpace();
2
+ import{addNearFar as o}from"../ForwardLinearDepthToWriteShadowMap.glsl.js";import{SliceDraw as e}from"../Slice.glsl.js";import{Transform as r}from"../Transform.glsl.js";import{NormalAttribute as t}from"../attributes/NormalAttribute.glsl.js";import{ObjectAndLayerIdColor as i}from"../attributes/ObjectAndLayerIdColor.glsl.js";import{TextureCoordinateAttribute as a}from"../attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormal as l}from"../attributes/VertexNormal.glsl.js";import{DefaultMaterialExternalColor as s}from"./DefaultMaterialExternalColor.glsl.js";import{outputDepth as d}from"../output/OutputDepth.glsl.js";import{OutputHighlight as n}from"../output/OutputHighlight.glsl.js";import{VisualVariables as c}from"../shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as u}from"../util/DiscardOrAdjustAlpha.glsl.js";import{addProjViewLocalOrigin as p}from"../util/View.glsl.js";import{glsl as v,If as m}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as f}from"../../shaderModules/Texture2DPassUniform.js";function g(g,x){const{vertex:O,fragment:j,varyings:h}=g,{hasColorTexture:C,alphaDiscardMode:w}=x,V=C&&1!==w,{output:b,normalType:A,hasColorTextureTransform:y}=x;switch(b){case 3:p(O,x),g.include(r),j.include(e,x),g.include(a,x),V&&j.uniforms.add(new f("tex",o=>o.texture)),O.main.add(v`vpos = getVertexInLocalOriginSpace();
3
3
  vpos = subtractOrigin(vpos);
4
4
  vpos = addVerticalOffset(vpos, localOrigin);
5
5
  gl_Position = transformPosition(proj, view, vpos);
6
- forwardTextureCoordinates();`),f.include(c,g),O.main.add(p`
6
+ forwardTextureCoordinates();`),g.include(u,x),j.main.add(v`
7
7
  discardBySlice(vpos);
8
- ${v(V,p`vec4 texColor = texture(tex, ${A?"colorUV":"vuv0"});
9
- discardOrAdjustAlpha(texColor);`)}`);break;case 5:case 6:case 7:case 8:case 11:u(x,g),f.include(e),f.include(a,g),f.include(n,g),f.include(l,g),O.include(r,g),f.include(i,g),o(f),j.add("depth","float",{invariant:!0}),V&&O.uniforms.add(new m("tex",o=>o.texture)),x.main.add(p`vpos = getVertexInLocalOriginSpace();
8
+ ${m(V,v`vec4 texColor = texture(tex, ${y?"colorUV":"vuv0"});
9
+ discardOrAdjustAlpha(texColor);`)}`);break;case 5:case 6:case 7:case 8:case 11:p(O,x),g.include(r),g.include(a,x),g.include(c,x),g.include(d,x),j.include(e,x),g.include(i,x),o(g),h.add("depth","float",{invariant:!0}),V&&j.uniforms.add(new f("tex",o=>o.texture)),O.main.add(v`vpos = getVertexInLocalOriginSpace();
10
10
  vpos = subtractOrigin(vpos);
11
11
  vpos = addVerticalOffset(vpos, localOrigin);
12
12
  gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
13
13
  forwardTextureCoordinates();
14
- forwardObjectAndLayerIdColor();`),f.include(c,g),O.main.add(p`
14
+ forwardObjectAndLayerIdColor();`),g.include(u,x),j.main.add(v`
15
15
  discardBySlice(vpos);
16
- ${v(V,p`vec4 texColor = texture(tex, ${A?"colorUV":"vuv0"});
16
+ ${m(V,v`vec4 texColor = texture(tex, ${y?"colorUV":"vuv0"});
17
17
  discardOrAdjustAlpha(texColor);`)}
18
- ${11===C?p`outputObjectAndLayerIdColor();`:p`outputDepth(depth);`}`);break;case 4:{u(x,g),f.include(e),f.include(t,g),f.include(s,g),f.include(a,g),f.include(n,g),V&&O.uniforms.add(new m("tex",o=>o.texture)),2===b&&j.add("vPositionView","vec3",{invariant:!0});const o=0===b||1===b;x.main.add(p`
18
+ ${11===b?v`outputObjectAndLayerIdColor();`:v`outputDepth(depth);`}`);break;case 4:{p(O,x),g.include(r),g.include(t,x),g.include(l,x),g.include(a,x),g.include(c,x),g.include(s,x),V&&j.uniforms.add(new f("tex",o=>o.texture)),2===A&&h.add("vPositionView","vec3",{invariant:!0});const o=0===A||1===A;O.main.add(v`
19
+ forwardDefaultMaterialExternalColor();
20
+
21
+ if (shouldCullByOpacity()) {
22
+ gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
23
+ return;
24
+ }
25
+
19
26
  vpos = getVertexInLocalOriginSpace();
20
- ${o?p`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:p`vPositionView = (view * vec4(vpos, 1.0)).xyz;`}
27
+ ${o?v`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:v`vPositionView = (view * vec4(vpos, 1.0)).xyz;`}
21
28
  vpos = subtractOrigin(vpos);
22
29
  vpos = addVerticalOffset(vpos, localOrigin);
23
30
  gl_Position = transformPosition(proj, view, vpos);
24
- forwardTextureCoordinates();`),O.include(r,g),f.include(c,g),O.main.add(p`
31
+ forwardTextureCoordinates();`),j.include(e,x),g.include(u,x),j.main.add(v`
25
32
  discardBySlice(vpos);
26
- ${v(V,p`vec4 texColor = texture(tex, ${A?"colorUV":"vuv0"});
27
- discardOrAdjustAlpha(texColor);`)}
33
+ ${m(V,v`vec4 texColor = texture(tex, ${y?"colorUV":"vuv0"});
34
+ discardOrAdjustAlpha(texColor);`,v`vec4 texColor = vec4(1.0);`)}
35
+ float opacity = getDefaultMaterialOpacity(texColor.a);
28
36
 
29
- ${2===b?p`vec3 normal = screenDerivativeNormal(vPositionView);`:p`vec3 normal = normalize(vNormalWorld);
37
+ ${2===A?v`vec3 normal = screenDerivativeNormal(vPositionView);`:v`vec3 normal = normalize(vNormalWorld);
30
38
  if (gl_FrontFacing == false){
31
39
  normal = -normal;
32
40
  }`}
33
- fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case 10:u(x,g),f.include(e),f.include(a,g),f.include(n,g),V&&O.uniforms.add(new m("tex",o=>o.texture)),x.main.add(p`vpos = getVertexInLocalOriginSpace();
41
+ fragColor = vec4(0.5 + 0.5 * normal, opacity);`);break}case 10:p(O,x),g.include(r),g.include(a,x),g.include(c,x),V&&j.uniforms.add(new f("tex",o=>o.texture)),O.main.add(v`vpos = getVertexInLocalOriginSpace();
34
42
  vpos = subtractOrigin(vpos);
35
43
  vpos = addVerticalOffset(vpos, localOrigin);
36
44
  gl_Position = transformPosition(proj, view, vpos);
37
- forwardTextureCoordinates();`),O.include(r,g),f.include(c,g),f.include(d,g),O.main.add(p`
45
+ forwardTextureCoordinates();`),j.include(e,x),g.include(u,x),g.include(n,x),j.main.add(v`
38
46
  discardBySlice(vpos);
39
- ${v(V,p`vec4 texColor = texture(tex, ${A?"colorUV":"vuv0"});
47
+ ${m(V,v`vec4 texColor = texture(tex, ${y?"colorUV":"vuv0"});
40
48
  discardOrAdjustAlpha(texColor);`)}
41
- calculateOcclusionAndOutputHighlight();`)}}export{f as DefaultMaterialAuxiliaryPasses};
49
+ calculateOcclusionAndOutputHighlight();`)}}export{g as DefaultMaterialAuxiliaryPasses};
@@ -0,0 +1,25 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{InstanceColor as o}from"../attributes/InstanceColor.glsl.js";import{MaskedColorDefinition as r,CreateMaskedFromNaNColor as l}from"../attributes/MaskedColor.glsl.js";import{SymbolColor as a}from"../attributes/SymbolColor.glsl.js";import{VertexColor as t}from"../attributes/VertexColor.glsl.js";import{MixExternalColor as e}from"../util/MixExternalColor.glsl.js";import{Float4PassUniform as i}from"../../shaderModules/Float4PassUniform.js";import{FloatPassUniform as s}from"../../shaderModules/FloatPassUniform.js";import{glsl as d,If as n}from"../../shaderModules/glsl.js";import{colorMixModes as m}from"../../../materials/internal/MaterialUtil.js";import{alphaCutoff as p}from"../../../shaders/alphaCutoff.glsl.js";function c(c,u){const{vertex:C,fragment:f,varyings:y}=c;c.include(o,u),c.include(a,u),c.include(t,u),C.include(r),C.include(l),C.include(p),C.uniforms.add(new i("externalColor",o=>o.externalColor,{supportsNaN:!0})),y.add("vExternalColor","vec4"),C.code.add(d`
3
+ void forwardDefaultMaterialExternalColor() {
4
+ forwardVertexColor();
5
+
6
+ MaskedColor maskedColor =
7
+ applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
8
+
9
+ vExternalColor = maskedColor.color;
10
+ forwardColorMixMode(maskedColor.mask);
11
+ }
12
+
13
+ bool shouldCullByOpacity() {
14
+ return opacityMixMode != ${d.int(m.ignore)} && vExternalColor.a < alphaCutoff;
15
+ }
16
+ `),f.include(e),f.uniforms.add(new s("opacity",o=>o.opacity),new s("layerOpacity",o=>o.layerOpacity)),f.code.add(d`
17
+ float getDefaultMaterialOpacity(float textureOpacity) {
18
+ return layerOpacity * mixExternalOpacity(
19
+ ${n(u.hasVertexColors,"vColor.a * ")} opacity,
20
+ textureOpacity,
21
+ vExternalColor.a,
22
+ opacityMixMode
23
+ );
24
+ }
25
+ `)}export{c as DefaultMaterialExternalColor};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{set as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as e,scale as a,floor as i,subtract as l,set as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{positiveInfinity as n}from"../../../../geometry/support/aaBoundingBox.js";function o(t){return t.visibleGaussians>0&&null!=t.orderTexture.texture&&null!=t.textureAtlas.texture&&null!=t.headerTexture.texture}function s(a,i,l){u(a,i,l,l.eye),a.splatFading=i.data.fadingTexture.texture;const{fullHeight:r,fullWidth:n}=l,o=Math.tan(.5*l.fovY),s=o/r*n;t(a.tanFov,s,o),a.focalLength=r/(2*o),e(a.origin,l.eye)}function u(t,e,o,s){const u=e.data;t.splatOrder=u.orderTexture.texture,t.splatAtlas=u.textureAtlas.texture,t.splatHeader=u.headerTexture.texture;const{fullHeight:x,fullWidth:c}=o,d=e.view.qualitySettings.gaussianSplat,p=2===e.view.state.mode?d.idleMinimumSplatPixelRadius:d.nonIdleMinimumSplatPixelRadius;t.minSplatRadius=p*Math.sqrt(c*x)/Math.sqrt(2073600),a(t.tileCameraPosition,s,1/m),i(t.tileCameraPosition,t.tileCameraPosition),a(t.cameraDelta,t.tileCameraPosition,m),l(t.cameraDelta,s,t.cameraDelta),t.slicePlaneLocalOrigin=s;const g=e.clippingBox||n,[f,h,v,M,P,C]=g,[R,S,T]=s;r(t.clipMinCameraRelative,f-R,h-S,v-T),r(t.clipMaxCameraRelative,M-R,P-S,C-T)}const m=2.048;export{o as canRenderGaussianSplats,m as gaussianSplatTileSize,s as prepareGaussianSplatPerspectiveParameters,u as prepareGaussianSplatRenderParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../core/time.js";import{property as s,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{set as r}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{copy as o,set as n,scale as h,floor as l,subtract as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as m,set as c,positiveInfinity as d,equals as _}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as g}from"../../webgl.js";import{addWraparound as f}from"../../layers/i3s/I3SUtil.js";import P from"../../webgl/RenderNode.js";import{G as C}from"../../../../chunks/GaussianSplat.glsl.js";import{G as b}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as S}from"../shaders/GaussianSplatCompositionTechnique.js";import{GaussianSplatCompositionTechniqueConfiguration as v}from"../shaders/GaussianSplatCompositionTechniqueConfiguration.js";import{G as x}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as q}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatTechnique as R}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as w}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as E,DepthStencilAttachment as T,PrimitiveType as D}from"../../../webgl/enums.js";var y;let G=class extends P{static{y=this}constructor(e){super(e),this.consumes={required:[g.GAUSSIAN_SPLAT]},this.produces=g.GAUSSIAN_SPLAT,this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new C,this._compositionPassParameters=new b,this._depthCompositionPassParameters=new x,this._compositionConfiguration=new v,this._clipBox=m(),this._previousCameraDirection=p(),this._previousSortRequestCameraDirection=p(),this._tileCullingRevision=0,this._sortRequestDirectionEpsilon=.01,this._directionChangeEpsilon=.001,this._configuration=new w(e.view.state.isGlobal),c(this._clipBox,d)}async initialize(){this.addHandles([t(()=>this.view.state.camera,()=>this._onCameraChange()),t(()=>2===this.view.state.mode,()=>this.requestRender(1))])}precompile(){this._canRender&&(this._updateConfigurations(),this._compositionConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.hasEmission=this.bindParameters.hasOpaqueEmission,this.techniques.precompile(R,this._configuration),this.techniques.precompile(S,this._compositionConfiguration),this.techniques.precompile(q))}render(){const e=this.input;if(this._updateConfigurations(),this._handleFading(),!this._canRender)return e;const t=e.getAttachment(E);this._compositionConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.hasEmission=null!=t;const{fullWidth:i,fullHeight:s}=this.bindParameters.camera;this._prepareParameters(s,i);const a=this.renderingContext,r=this.fboCache,o=r.acquire(i,s,"gaussian color output"),n=e.getAttachment(T);o.attachDepth(n);const h=this.techniques.get(R,this._configuration);this._renderGaussianColorAndDepth(o,h);const l=r.acquire(i,s,this.produces);this._depthCompositionPassParameters.splatDepth=o.getTexture(E),l.attachDepth(e.getAttachment(T)),a.bindFramebuffer(l.fbo);const u=this.techniques.get(q);a.bindTechnique(u,this.bindParameters,this._depthCompositionPassParameters),a.screen.draw(),this._compositionPassParameters.color=e.getTexture(),this._compositionPassParameters.splatColor=o.getTexture(),t?(l.acquireColor(E,8,"emissive"),this._compositionPassParameters.emission=e.getTexture(E)):this._compositionPassParameters.emission=null,a.bindFramebuffer(l.fbo);const p=this.techniques.get(S,this._compositionConfiguration);return a.bindTechnique(p,this.bindParameters,this._compositionPassParameters),a.screen.draw(),o.release(),l}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){const t=e||d;this._hasSameClipBox(t)||(c(this._clipBox,t),this._tileCullingRevision=f(this._tileCullingRevision,1),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get tileCullingRevision(){return this._tileCullingRevision}get _clippingEnabled(){return!_(this._clipBox,d,(e,t)=>e===t)}get _isIdle(){return 2===this.view.state.mode}get _data(){return this.layerView.data}get _canRender(){return this._data.visibleGaussians>0&&null!=this._data.orderTexture.texture&&null!=this._data.textureAtlas.texture&&null!=this._data.headerTexture.texture}get _fadeHelper(){return this.layerView.fadeHelper}_updateConfigurations(){const{idleMinimumOpacity:e,nonIdleMinimumOpacity:t}=this.view.qualitySettings.gaussianSplat;this._configuration.alphaCutoff=this._isIdle?e:t,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.receiveShadows=this.bindParameters.shadowMap.ready,this._configuration.hasShadowHighlights=this._configuration.receiveShadows&&this.bindParameters.hasShadowHighlights,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&null!=this.bindParameters.slicePlane}_onCameraChange(){this._tileCullingRevision=f(this._tileCullingRevision,1);const e=this.view.state.camera.ray.direction;if(!this._directionChanged(e))return;if(o(this._previousCameraDirection,e),!this._shouldRequestSort(e))return;this._data.requestSort()&&o(this._previousSortRequestCameraDirection,e)}_directionChanged(e){return Math.abs(e[0]-this._previousCameraDirection[0])>this._directionChangeEpsilon||Math.abs(e[1]-this._previousCameraDirection[1])>this._directionChangeEpsilon||Math.abs(e[2]-this._previousCameraDirection[2])>this._directionChangeEpsilon}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_prepareParameters(e,t){this._passParameters.splatOrder=this._data.orderTexture.texture,this._passParameters.splatFading=this._data.fadingTexture.texture,this._passParameters.splatAtlas=this._data.textureAtlas.texture,this._passParameters.splatHeader=this._data.headerTexture.texture;const i=Math.tan(.5*this.camera.fovY),s=i/e*t;r(this._passParameters.tanFov,s,i),this._passParameters.focalLength=e/(2*i);const a=this.view.qualitySettings.gaussianSplat,n=this._isIdle?a.idleMinimumSplatPixelRadius:a.nonIdleMinimumSplatPixelRadius;this._passParameters.minSplatRadius=n*Math.sqrt(t*e)/Math.sqrt(2073600),o(this._passParameters.origin,this.bindParameters.camera.eye),this._prepareHighPrecisionCameraPosition(),this._updateSlicePlaneLocalOrigin(),this._updateClipUniforms()}_updateClipUniforms(){const e=this.clippingBox||d,[t,i,s,a,r,o]=e,[h,l,u]=this.camera.eye,{clipMinCameraRelative:p,clipMaxCameraRelative:m}=this._passParameters;n(p,t-h,i-l,s-u),n(m,a-h,r-l,o-u)}_updateSlicePlaneLocalOrigin(){this._passParameters.slicePlaneLocalOrigin=this.camera.eye}_hasSameClipBox(e){return _(this._clipBox,e,(e,t)=>e===t)}_renderGaussianColorAndDepth(e,t){const i=this.renderingContext;e.acquireColor(E,5,"gaussian depth output"),i.bindFramebuffer(e.fbo),i.setClearColor(0,0,0,0),i.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(D.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_prepareHighPrecisionCameraPosition(){h(this._passParameters.tileCameraPosition,this.camera.eye,1/y.tileSize),l(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),h(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,y.tileSize),u(this._passParameters.cameraDelta,this.camera.eye,this._passParameters.cameraDelta)}_handleFading(){if(0===this._fadeHelper.numFadingTiles)this._previousFrameStart=null;else{const e=this.view.stage?.renderer.renderContext.time,t=i(null==e||null==this._previousFrameStart?0:e-this._previousFrameStart);this._fadeHelper.updateAllTileFading(t),this._previousFrameStart=e}this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}static{this.tileSize=2.048}};e([s()],G.prototype,"consumes",void 0),e([s()],G.prototype,"produces",void 0),e([s({constructOnly:!0})],G.prototype,"layerView",void 0),G=y=e([a("esri.views.3d.webgl-engine.lib.GaussianSplatRenderer")],G);export{G as GaussianSplatRenderer};
2
+ import{__decorate as e}from"tslib";import{watch as i}from"../../../../core/reactiveUtils.js";import{property as t,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{copy as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o,set as n,positiveInfinity as h,equals as l}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as u}from"../../webgl.js";import{addWraparound as c}from"../../layers/i3s/I3SUtil.js";import p from"../../webgl/RenderNode.js";import{canRenderGaussianSplats as m,prepareGaussianSplatPerspectiveParameters as d}from"./GaussianSplatRenderUtils.js";import{G as _}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as g}from"../shaders/GaussianSplatCompositionTechnique.js";import{GaussianSplatCompositionTechniqueConfiguration as f}from"../shaders/GaussianSplatCompositionTechniqueConfiguration.js";import{G as C}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as b}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatPassParameters as P}from"../shaders/GaussianSplatPassParameters.js";import{GaussianSplatTechnique as S}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as q}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as v,DepthStencilAttachment as w,PrimitiveType as R}from"../../../webgl/enums.js";let x=class extends p{constructor(e){super(e),this.consumes={required:[u.GAUSSIAN_SPLAT]},this.produces=u.GAUSSIAN_SPLAT,this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new P,this._compositionPassParameters=new _,this._depthCompositionPassParameters=new C,this._compositionConfiguration=new f,this._clipBox=o(),this._previousSortRequestCameraDirection=a(),this._cameraSortDirty=!1,this._tileCullingRevision=0,this._sortRequestDirectionEpsilon=.01,this._configuration=new q(e.view.state.isGlobal),n(this._clipBox,h)}async initialize(){this.addHandles([i(()=>this.view.state.camera,()=>this._onCameraChange()),i(()=>2===this.view.state.mode,e=>{e&&this._cameraSortDirty&&this._requestCameraSort(this.view.state.camera.ray.direction),this.requestRender(1)})])}precompile(){this._canRender&&(this._updateConfigurations(),this._compositionConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.hasEmission=this.bindParameters.hasOpaqueEmission,this.techniques.precompile(S,this._configuration),this.techniques.precompile(g,this._compositionConfiguration),this.techniques.precompile(b))}render(){const e=this.input;if(this._updateConfigurations(),this._fadeHelper.updateForFrame(this.view.stage.renderView.renderer.renderContext.time),!this._canRender)return e;const i=e.getAttachment(v);this._compositionConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.hasEmission=null!=i;const{fullWidth:t,fullHeight:s}=this.bindParameters.camera;this._prepareParameters();const r=this.renderingContext,a=this.fboCache,o=a.acquire(t,s,"gaussian color output"),n=e.getAttachment(w);o.attachDepth(n);const h=this.techniques.get(S,this._configuration);this._renderGaussianColorAndDepth(o,h);const l=a.acquire(t,s,this.produces);this._depthCompositionPassParameters.splatDepth=o.getTexture(v),l.attachDepth(e.getAttachment(w)),r.bindFramebuffer(l.fbo);const u=this.techniques.get(b);r.bindTechnique(u,this.bindParameters,this._depthCompositionPassParameters),r.screen.draw(),this._compositionPassParameters.color=e.getTexture(),this._compositionPassParameters.splatColor=o.getTexture(),i?(l.acquireColor(v,8,"emissive"),this._compositionPassParameters.emission=e.getTexture(v)):this._compositionPassParameters.emission=null,r.bindFramebuffer(l.fbo);const c=this.techniques.get(g,this._compositionConfiguration);return r.bindTechnique(c,this.bindParameters,this._compositionPassParameters),r.screen.draw(),o.release(),l}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){const i=e||h;this._hasSameClipBox(i)||(n(this._clipBox,i),this._tileCullingRevision=c(this._tileCullingRevision,1),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get tileCullingRevision(){return this._tileCullingRevision}get _clippingEnabled(){return!l(this._clipBox,h,(e,i)=>e===i)}get _isIdle(){return 2===this.view.state.mode}get _data(){return this.layerView.data}get _canRender(){return m(this._data)}get _fadeHelper(){return this.layerView.fadeHelper}_updateConfigurations(){const{idleMinimumOpacity:e,nonIdleMinimumOpacity:i}=this.view.qualitySettings.gaussianSplat;this._configuration.alphaCutoff=this._isIdle?e:i,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.receiveShadows=this.bindParameters.shadowMap.ready,this._configuration.hasShadowHighlights=this._configuration.receiveShadows&&this.bindParameters.hasShadowHighlights,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&null!=this.bindParameters.slicePlane}_onCameraChange(){this._tileCullingRevision=c(this._tileCullingRevision,1);const e=this.view.state.camera.ray.direction;this._cameraSortDirty=!0,(this._isIdle||this._shouldRequestSort(e))&&this._requestCameraSort(e)}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_requestCameraSort(e){this._data.requestSort(),r(this._previousSortRequestCameraDirection,e),this._cameraSortDirty=!1}_prepareParameters(){d(this._passParameters,this.layerView,this.camera)}_hasSameClipBox(e){return l(this._clipBox,e,(e,i)=>e===i)}_renderGaussianColorAndDepth(e,i){const t=this.renderingContext;e.acquireColor(v,5,"gaussian depth output"),t.bindFramebuffer(e.fbo),t.setClearColor(0,0,0,0),t.clear(16384),this.renderingContext.bindTechnique(i,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(R.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}};e([t()],x.prototype,"consumes",void 0),e([t()],x.prototype,"produces",void 0),e([t({constructOnly:!0})],x.prototype,"layerView",void 0),x=e([s("esri.views.3d.webgl-engine.lib.GaussianSplatRenderer")],x);export{x as GaussianSplatRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{set as a,scale as s,floor as r,subtract as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{positiveInfinity as l}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as h}from"../../webgl.js";import p from"../../webgl/RenderNode.js";import{GaussianSplatRenderer as m}from"./GaussianSplatRenderer.js";import{G as u}from"../../../../chunks/GaussianSplatShadow.glsl.js";import{GaussianSplatShadowTechnique as d}from"../shaders/GaussianSplatShadowTechnique.js";import{GaussianSplatTechniqueConfiguration as c}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{PrimitiveType as _}from"../../../webgl/enums.js";let P=class extends p{constructor(e){super(e),this.consumes={required:[h.SHADOWMAP]},this.produces=h.SHADOWMAP,this.layerView=null,this._passParameters=new u,this._cameraPosition=n(),this._configuration=new c(e.view.state.isGlobal)}precompile(){this._canRender&&(this._updateConfiguration(),this.techniques.precompile(d,this._configuration))}render(){const e=this.bindRenderTarget();return this._canRender&&this._render(),e}queryDepthRange(e){return this.layerView.suspended?null:this._data.queryVisibleTileDepthRange(e,this.layerView.clippingBox)}get _data(){return this.layerView.data}get _clippingEnabled(){return null!=this.layerView.clippingBox}get _isIdle(){return 2===this.view.state.mode}get _canRender(){return!this.layerView.suspended&&this._data.visibleGaussians>0&&null!=this._data.orderTexture.texture&&null!=this._data.textureAtlas.texture&&null!=this._data.headerTexture.texture}_render(){const e=this.techniques.get(d,this._configuration);this._prepareShadowParameters(this.bindParameters.camera),this.renderingContext.bindTechnique(e,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(_.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_updateConfiguration(){this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this.layerView.slicePlaneEnabled&&null!=this.bindParameters.slicePlane,this._configuration.output=this.bindParameters.output}_prepareShadowParameters(e){const t=this._data;this._passParameters.splatOrder=t.orderTexture.texture,this._passParameters.splatAtlas=t.textureAtlas.texture,this._passParameters.splatHeader=t.headerTexture.texture;const{fullHeight:i,fullWidth:a}=e,s=this.view.qualitySettings.gaussianSplat,r=this._isIdle?s.idleMinimumSplatPixelRadius:s.nonIdleMinimumSplatPixelRadius;this._passParameters.minSplatRadius=r*Math.sqrt(a*i)/Math.sqrt(2073600),this._updateShadowCameraPosition(e),this._prepareShadowHighPrecisionCameraPosition(),this._passParameters.slicePlaneLocalOrigin=this._cameraPosition,this._updateShadowClipUniforms()}_updateShadowClipUniforms(){const e=this.layerView.clippingBox||l,[t,i,s,r,o,n]=e,[h,p,m]=this._cameraPosition,{clipMinCameraRelative:u,clipMaxCameraRelative:d}=this._passParameters;a(u,t-h,i-p,s-m),a(d,r-h,o-p,n-m)}_prepareShadowHighPrecisionCameraPosition(){s(this._passParameters.tileCameraPosition,this._cameraPosition,1/m.tileSize),r(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),s(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,m.tileSize),o(this._passParameters.cameraDelta,this._cameraPosition,this._passParameters.cameraDelta)}_updateShadowCameraPosition(e){const t=e.viewInverseTransposeMatrix;a(this._cameraPosition,t[3],t[7],t[11])}};e([t()],P.prototype,"consumes",void 0),e([t()],P.prototype,"produces",void 0),e([t({constructOnly:!0})],P.prototype,"layerView",void 0),P=e([i("esri.views.3d.webgl-engine.lib.GaussianSplatShadows")],P);export{P as GaussianSplatShadows};
2
+ import{__decorate as e}from"tslib";import{property as i,subclass as t}from"../../../../core/accessorSupport/decorators.js";import{set as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{InternalRenderCategory as a}from"../../webgl.js";import n from"../../webgl/RenderNode.js";import{canRenderGaussianSplats as o,prepareGaussianSplatRenderParameters as p}from"./GaussianSplatRenderUtils.js";import{GaussianSplatRenderParameters as h}from"../shaders/GaussianSplatPassParameters.js";import{GaussianSplatShadowTechnique as l}from"../shaders/GaussianSplatShadowTechnique.js";import{GaussianSplatTechniqueConfiguration as d}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{PrimitiveType as u}from"../../../webgl/enums.js";let c=class extends n{constructor(e){super(e),this.consumes={required:[a.SHADOWMAP]},this.produces=a.SHADOWMAP,this.layerView=null,this._passParameters=new h,this._cameraPosition=r(),this._configuration=new d(e.view.state.isGlobal)}precompile(){this._canRender&&(this._updateConfiguration(),this.techniques.precompile(l,this._configuration))}render(){const e=this.bindRenderTarget();return this._canRender&&this._render(),e}queryDepthRange(e){return this.layerView.suspended?null:this._data.queryVisibleTileDepthRange(e,this.layerView.clippingBox)}get _data(){return this.layerView.data}get _clippingEnabled(){return null!=this.layerView.clippingBox}get _canRender(){return!this.layerView.suspended&&o(this._data)}_render(){const e=this.techniques.get(l,this._configuration);this._prepareShadowParameters(this.bindParameters.camera),this.renderingContext.bindTechnique(e,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(u.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_updateConfiguration(){this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this.layerView.slicePlaneEnabled&&null!=this.bindParameters.slicePlane,this._configuration.output=this.bindParameters.output}_prepareShadowParameters(e){this._updateShadowCameraPosition(e),p(this._passParameters,this.layerView,e,this._cameraPosition)}_updateShadowCameraPosition(e){const i=e.viewInverseTransposeMatrix;s(this._cameraPosition,i[3],i[7],i[11])}};e([i()],c.prototype,"consumes",void 0),e([i()],c.prototype,"produces",void 0),e([i({constructOnly:!0})],c.prototype,"layerView",void 0),c=e([t("esri.views.3d.webgl-engine.lib.GaussianSplatShadows")],c);export{c as GaussianSplatShadows};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstanceColor.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/MaskedColor.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/SymbolColor.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TextureTransformUV.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/snowcover/SnowCover.glsl.js";import"../materials/internal/MaterialUtil.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/DefaultMaterial.glsl.js";
2
+ import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js";import"../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TextureTransformUV.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/snowcover/SnowCover.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/DefaultMaterial.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import"../core/shaderLibrary/util/RgbNormalizedDepthEncoding.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"./GaussianSplatTechniqueConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{G as GaussianSplatPassParameters,b as build}from"../../../../chunks/GaussianSplat.glsl.js";
2
+ import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import"../core/shaderLibrary/util/RgbNormalizedDepthEncoding.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"./GaussianSplatTechniqueConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/GaussianSplat.glsl.js";
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{GaussianSplatUnpackingPassParameters as t}from"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";class r extends t{constructor(){super(...arguments),this.clipMinCameraRelative=i(),this.clipMaxCameraRelative=i(),this.minSplatRadius=-1}}class a extends r{constructor(){super(...arguments),this.focalLength=-1,this.tanFov=s(),this.origin=i()}}export{a as GaussianSplatPassParameters,r as GaussianSplatRenderParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"../../../webgl/ShaderBuilder.js";export{G as GaussianSplatShadowPassParameters,b as build}from"../../../../chunks/GaussianSplatShadow.glsl.js";
2
+ import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/GaussianSplatShadow.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{a as t}from"../../../../chunks/GaussianSplatShadow.glsl.js";import{makePipelineState as a,defaultDepthWrite as i}from"../../../webgl/renderState.js";let l=class extends o{constructor(){super(...arguments),this.shader=new s(t,()=>import("./GaussianSplatShadow.glsl.js"))}initializePipeline(){return a({colorWrite:null,depthTest:{func:515},depthWrite:i})}};l=e([r("esri.views.3d.webgl-engine.shaders.GaussianSplatShadowTechnique")],l);export{l as GaussianSplatShadowTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{G as t}from"../../../../chunks/GaussianSplatShadow.glsl.js";import{makePipelineState as i,defaultDepthWrite as a}from"../../../webgl/renderState.js";let l=class extends o{constructor(){super(...arguments),this.shader=new s(t,()=>import("./GaussianSplatShadow.glsl.js"))}initializePipeline(){return i({colorWrite:null,depthTest:{func:515},depthWrite:a})}};l=e([r("esri.views.3d.webgl-engine.shaders.GaussianSplatShadowTechnique")],l);export{l as GaussianSplatShadowTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{a as o}from"../../../../chunks/GaussianSplat.glsl.js";import{makePipelineState as t,defaultColorWrite as a,separateBlendingParams as n}from"../../../webgl/renderState.js";let l=class extends i{constructor(){super(...arguments),this.shader=new s(o,()=>import("./GaussianSplat.glsl.js"))}initializePipeline(){return t({blending:n(773,773,1,1,32774,32774),depthTest:{func:515},colorWrite:a})}};l=e([r("esri.views.3d.webgl-engine.shaders.GaussianSplatTechnique")],l);export{l as GaussianSplatTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{G as o}from"../../../../chunks/GaussianSplat.glsl.js";import{makePipelineState as t,defaultColorWrite as a,separateBlendingParams as n}from"../../../webgl/renderState.js";let l=class extends i{constructor(){super(...arguments),this.shader=new s(o,()=>import("./GaussianSplat.glsl.js"))}initializePipeline(){return t({blending:n(773,773,1,1,32774,32774),depthTest:{func:515},colorWrite:a})}};l=e([r("esri.views.3d.webgl-engine.shaders.GaussianSplatTechnique")],l);export{l as GaussianSplatTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstanceColor.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/MaskedColor.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/SymbolColor.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TextureTransformUV.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/MixExternalColor.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/snowcover/SnowCover.glsl.js";import"../materials/internal/MaterialUtil.js";import"./alphaCutoff.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/RealisticTree.glsl.js";
2
+ import"../core/shaderLibrary/Offset.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js";import"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../core/shaderLibrary/attributes/VerticalOffset.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js";import"../core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TextureTransformUV.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../effects/snowcover/SnowCover.glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/RealisticTree.glsl.js";