@arcgis/core 4.33.0-next.20250311 → 4.33.0-next.20250313

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 (162) hide show
  1. package/Basemap.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/025f8b72d7d8b5cccb0f.js +1 -0
  4. package/assets/esri/core/workers/chunks/{5b1b93665c93955491c4.js → 08bfceab05b5ea02bb4e.js} +106 -107
  5. package/assets/esri/core/workers/chunks/{bc988b9d3990380be907.js → 0a98dc3ea67ce97a6e7b.js} +1 -1
  6. package/assets/esri/core/workers/chunks/0e5c77d043ed4641556f.js +1 -0
  7. package/assets/esri/core/workers/chunks/10fc47b441ae49ef4db8.js +1 -0
  8. package/assets/esri/core/workers/chunks/{eacab4bd6eb58e545f73.js → 11f9d7cd95891596b716.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{4263eee3247aaf4e64bf.js → 147e412de9972da16a1d.js} +1 -1
  10. package/assets/esri/core/workers/chunks/4908b36ef448bfe1f448.js +1 -0
  11. package/assets/esri/core/workers/chunks/4d95cc85f4b73e857b1f.js +1 -0
  12. package/assets/esri/core/workers/chunks/54ace3e4802934f3f9f2.js +1 -0
  13. package/assets/esri/core/workers/chunks/5820808c7659460969d4.js +1 -0
  14. package/assets/esri/core/workers/chunks/6388fdacb434a266b039.js +314 -0
  15. package/assets/esri/core/workers/chunks/add0770399a63b7635b5.js +1 -0
  16. package/assets/esri/core/workers/chunks/b2f8702a9f54fff23ad9.js +1 -0
  17. package/assets/esri/core/workers/chunks/b8b8425e8b1246cdc86d.js +1 -0
  18. package/assets/esri/core/workers/chunks/d0fbd4c6bffe0cb98d14.js +1 -0
  19. package/assets/esri/core/workers/chunks/{2c227d97d00b3849f441.js → d459c790a3b89ac53d2d.js} +1 -1
  20. package/assets/esri/core/workers/chunks/dd6f18bbab50be139d20.js +1 -0
  21. package/assets/esri/core/workers/chunks/de6864e120243cf0bee8.js +1 -0
  22. package/assets/esri/core/workers/chunks/fc7ce48c7b31a4665a9b.js +1 -0
  23. package/assets/esri/core/workers/chunks/fe6e7ac83cd2293d576e.js +1 -0
  24. package/chunks/ComponentShader.glsl.js +7 -8
  25. package/chunks/DefaultMaterial.glsl.js +21 -21
  26. package/chunks/HighlightApply.glsl.js +27 -132
  27. package/chunks/{SingleHighlightBlur.glsl.js → HighlightBlur.glsl.js} +4 -4
  28. package/chunks/HighlightDownsample.glsl.js +8 -8
  29. package/chunks/HighlightToSingle.glsl.js +2 -2
  30. package/chunks/Pattern.glsl.js +23 -25
  31. package/chunks/RealisticTree.glsl.js +12 -12
  32. package/chunks/ShadowHighlight.glsl.js +5 -6
  33. package/chunks/Terrain.glsl.js +30 -31
  34. package/core/LRUCache.js +1 -1
  35. package/core/MemCache.js +1 -1
  36. package/core/has.js +1 -1
  37. package/geometry/support/ShortArray.js +5 -0
  38. package/interfaces.d.ts +18 -4
  39. package/layers/support/layerUtils.js +1 -1
  40. package/layers/video/VideoController.js +1 -1
  41. package/package.json +1 -1
  42. package/support/revision.js +1 -1
  43. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  44. package/views/2d/engine/webgl/Painter.js +1 -1
  45. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  46. package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
  47. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  48. package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
  49. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  50. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  51. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  52. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  53. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  54. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  55. package/views/3d/environment/CloudsRenderer.js +1 -1
  56. package/views/3d/environment/EnvironmentManager.js +1 -1
  57. package/views/3d/environment/Fog.js +1 -1
  58. package/views/3d/environment/Precipitation.js +1 -1
  59. package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
  60. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  61. package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
  62. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  63. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  64. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  65. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  66. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  67. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  68. package/views/3d/layers/graphics/pipeline/featureData/processingUtils.js +1 -1
  69. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  70. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  71. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  72. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
  73. package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
  74. package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
  75. package/views/3d/layers/graphics/pipeline/utils.js +1 -1
  76. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  77. package/views/3d/support/flowUtils.js +5 -0
  78. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  79. package/views/3d/terrain/OverlayRenderer.js +1 -1
  80. package/views/3d/terrain/TileRenderer.js +1 -1
  81. package/views/3d/webgl/ManagedFBO.js +1 -1
  82. package/views/3d/webgl/formats.js +1 -1
  83. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  84. package/views/3d/webgl-engine/core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js +2 -2
  85. package/views/3d/webgl-engine/core/shaderLibrary/HighlightReadBitmap.glsl.js +3 -3
  86. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +63 -77
  87. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +6 -6
  88. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +7 -8
  89. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +18 -18
  90. package/views/3d/webgl-engine/core/shaderModules/UintTexture2DBindUniform.js +5 -0
  91. package/views/3d/webgl-engine/core/shaderModules/UintTexture2DDrawUniform.js +5 -0
  92. package/views/3d/webgl-engine/core/shaderModules/UintTexture2DPassUniform.js +5 -0
  93. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  94. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  95. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  96. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  97. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  98. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  99. package/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique.js +5 -0
  100. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  101. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  102. package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
  103. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  104. package/views/3d/webgl-engine/lib/Normals.js +1 -1
  105. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  106. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  107. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  108. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  109. package/views/3d/webgl-engine/lib/Program.js +1 -1
  110. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  111. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  112. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  113. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  114. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  115. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  116. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  117. package/views/3d/webgl-engine/parts/Model.js +1 -1
  118. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  119. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  120. package/views/3d/webgl-engine/shaders/{SingleHighlightBlur.glsl.js → HighlightBlur.glsl.js} +1 -1
  121. package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +1 -1
  122. package/views/3d/webgl-engine/shaders/HighlightToSingle.glsl.js +1 -1
  123. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  124. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  125. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  126. package/views/FocusAreas.js +1 -1
  127. package/views/animation/easing.js +1 -1
  128. package/views/support/imageReprojection.js +1 -1
  129. package/views/support/projectionUtils.js +1 -1
  130. package/views/webgl/FramebufferObject.js +1 -1
  131. package/views/webgl/RenderingContext.js +1 -1
  132. package/views/webgl/ShaderBuilder.js +1 -1
  133. package/views/webgl/ShaderTranspiler.js +1 -1
  134. package/views/webgl/ValidatedTextureDescriptor.js +1 -1
  135. package/views/webgl/enums.js +1 -1
  136. package/widgets/Editor/EditorViewModel.js +1 -1
  137. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  138. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  139. package/widgets/OrientedImageryViewer.js +1 -1
  140. package/widgets/support/GoTo.js +1 -1
  141. package/widgets/support/goToUtils.js +1 -1
  142. package/assets/esri/core/workers/chunks/0137c17f15d79134b4ca.js +0 -314
  143. package/assets/esri/core/workers/chunks/15fe629cd4da1bb2169f.js +0 -1
  144. package/assets/esri/core/workers/chunks/3bbf7f89bc37c01b453b.js +0 -1
  145. package/assets/esri/core/workers/chunks/40f2c8022fd583c43f42.js +0 -1
  146. package/assets/esri/core/workers/chunks/4f2bb248dd258b493663.js +0 -1
  147. package/assets/esri/core/workers/chunks/5295e685ae839087c568.js +0 -1
  148. package/assets/esri/core/workers/chunks/54b115ecf446b4095d3e.js +0 -1
  149. package/assets/esri/core/workers/chunks/5a536de1ecae424bad05.js +0 -1
  150. package/assets/esri/core/workers/chunks/7ca9230681d05ef89059.js +0 -1
  151. package/assets/esri/core/workers/chunks/8196ff250c0de00104f7.js +0 -1
  152. package/assets/esri/core/workers/chunks/840c02610d845114ace7.js +0 -1
  153. package/assets/esri/core/workers/chunks/a4228101f709f0bb9a3d.js +0 -1
  154. package/assets/esri/core/workers/chunks/be883ebdbaf11647b718.js +0 -1
  155. package/assets/esri/core/workers/chunks/d374d2a1487faee3672d.js +0 -1
  156. package/assets/esri/core/workers/chunks/dbdca19978fbee8dc106.js +0 -1
  157. package/assets/esri/core/workers/chunks/ffd28a9b1d8db3a731f4.js +0 -1
  158. package/chunks/SingleHighlightApply.glsl.js +0 -32
  159. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +0 -5
  160. package/views/3d/webgl-engine/effects/highlight/SingleHighlightApplyTechnique.js +0 -5
  161. package/views/3d/webgl-engine/effects/highlight/SingleHighlightBlurTechnique.js +0 -5
  162. package/views/3d/webgl-engine/shaders/SingleHighlightApply.glsl.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{newFloatArray as e,floatSubArray as i}from"../../../../geometry/support/FloatArray.js";import{newIntArray as s,compactIndices as r}from"../../../../geometry/support/Indices.js";class o{constructor(t,r,o,h,p,n={}){this.path=t,this.profile=r,this.extruder=o,this.startCap=h,this.endCap=p,this.options=n,this._extrusionVertexCount=0;const l=this.path.vertices.length-2;this.numExtrusionProfiles=o.numProfilesPerJoin()*l+2,this.numVerticesTotal=r.vertices.length*this.numExtrusionProfiles,this.startCap.vertexBufferStart=this.numVerticesTotal;const a=this.startCap.numVertices;this.numVerticesTotal+=a,this.endCap.vertexBufferStart=this.numVerticesTotal;const x=this.endCap.numVertices;this.numVerticesTotal+=x,this.pathVertexData=s(1*this.numVerticesTotal),this.profileRightAxes=e(4*this.numVerticesTotal),this.profileUpAxes=e(4*this.numVerticesTotal),this.profileVertexAndNormals=e(4*this.numVerticesTotal),this.positions=i(t.positions,t.offset,3*t.vertices.length),this._rebuildGeometry(),this.buildTopology()}get usedMemory(){return t(this.pathVertexData,this.profileRightAxes,this.profileUpAxes,this.profileVertexAndNormals)+this.path.usedMemory+this.profile.usedMemory}emitVertex(t,e,i,s,r){const o=4*this._extrusionVertexCount;if(this.profileRightAxes[o]=e.right[0],this.profileRightAxes[o+1]=e.right[1],this.profileRightAxes[o+2]=e.right[2],this.profileUpAxes[o]=e.up[0],this.profileUpAxes[o+1]=e.up[1],this.profileUpAxes[o+2]=e.up[2],this.profileVertexAndNormals[o]=i[0],this.profileVertexAndNormals[o+1]=i[1],this.profileVertexAndNormals[o+2]=s[0],this.profileVertexAndNormals[o+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,r){const e=this.path.vertices[t],i=e.maxStretchDistance;this.profileRightAxes[o+3]=e.rotationRight[0]*i,this.profileUpAxes[o+3]=e.rotationRight[1]*i}else this.profileRightAxes[o+3]=0,this.profileUpAxes[o+3]=0;++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){const h=4*this._extrusionVertexCount;this.profileRightAxes[h]=e.right[0],this.profileRightAxes[h+1]=e.right[1],this.profileRightAxes[h+2]=e.right[2],this.profileRightAxes[h+3]=r,this.profileUpAxes[h]=e.up[0],this.profileUpAxes[h+1]=e.up[1],this.profileUpAxes[h+2]=e.up[2],this.profileUpAxes[h+3]=o,this.profileVertexAndNormals[h]=i[0],this.profileVertexAndNormals[h+1]=i[1],this.profileVertexAndNormals[h+2]=s[0],this.profileVertexAndNormals[h+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,++this._extrusionVertexCount}_rebuildGeometry(){this._extrusionVertexCount=0;const{positions:t,offset:e,vertices:s}=this.path;this.positions=i(t,e,3*s.length);let r=0;const o=(t,e,i,s,o)=>this.emitCapVertex(r,t,e,i,s,o),h=(t,e,i,s)=>this.emitVertex(r,t,e,i,s);for(this.startCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=1;r<s.length-1;++r)this.extruder.extrude(s[r],this.profile,h);this.endCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=0,this.startCap.rebuildCapGeometry(s[r],o),r=s.length-1,this.endCap.rebuildCapGeometry(s[r],o)}buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1;let s=3*(2*(e*i));this.startCap.indexBufferStart=s,this.startCap.firstProfileVertexIndex=0,s+=this.startCap.numIndices,this.endCap.indexBufferStart=s,this.endCap.firstProfileVertexIndex=t*(this.numExtrusionProfiles-1);const o=new Array,h=new Array,p=(t,e,i)=>{o.push(t),o.push(e),o.push(i),h.push(this.pathVertexData[t]),h.push(this.pathVertexData[e]),h.push(this.pathVertexData[i])};for(let r=0;r<e;++r){const e=this.profile.indices[2*r],s=this.profile.indices[2*r+1];for(let r=0;r<i;++r){const i=r*t+e,o=(r+1)*t+s,h=r*t+s;p(i,(r+1)*t+e,o),p(i,o,h)}}this.startCap.buildTopology(this.path.vertices[0],p),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],p),this.vertexIndices=r(o),this.pathVertexIndices=r(h)}onPathChanged(){this._rebuildGeometry()}}export{o as PathBuilder};
5
+ import{estimateNumberArrayMemory as t}from"../../../../core/memoryEstimations.js";import{newFloatArray as e,floatSubArray as i}from"../../../../geometry/support/FloatArray.js";import{newIntArray as s,compactIndices as r}from"../../../../geometry/support/Indices.js";import{newShortArray as o}from"../../../../geometry/support/ShortArray.js";import{compressNormal as h}from"./Normals.js";class n{constructor(t,r,h,n,a,p={}){this.path=t,this.profile=r,this.extruder=h,this.startCap=n,this.endCap=a,this.options=p,this._extrusionVertexCount=0;const l=this.path.vertices.length-2;this.numExtrusionProfiles=h.numProfilesPerJoin()*l+2,this.numVerticesTotal=r.vertices.length*this.numExtrusionProfiles,this.startCap.vertexBufferStart=this.numVerticesTotal;const u=this.startCap.numVertices;this.numVerticesTotal+=u,this.endCap.vertexBufferStart=this.numVerticesTotal;const x=this.endCap.numVertices;this.numVerticesTotal+=x,this.pathVertexData=s(1*this.numVerticesTotal),this.profileRightAxes=o(2*this.numVerticesTotal),this.profileUpAxes=o(2*this.numVerticesTotal),this.profileVertexAndNormals=e(4*this.numVerticesTotal),this.profileAuxData=e(2*this.numVerticesTotal),this.positions=i(t.positions,t.offset,3*t.vertices.length),this._rebuildGeometry(),this._buildTopology()}get usedMemory(){return t(this.pathVertexData,this.profileRightAxes,this.profileUpAxes,this.profileVertexAndNormals,this.profileAuxData)+this.path.usedMemory+this.profile.usedMemory}emitVertex(t,e,i,s,r){let o=4*this._extrusionVertexCount;if(this.profileVertexAndNormals[o]=i[0],this.profileVertexAndNormals[o+1]=i[1],this.profileVertexAndNormals[o+2]=s[0],this.profileVertexAndNormals[o+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,o=2*this._extrusionVertexCount,r){const e=this.path.vertices[t],i=e.maxStretchDistance;this.profileAuxData[o]=e.rotationRight[0]*i,this.profileAuxData[o+1]=e.rotationRight[1]*i}else this.profileAuxData[o]=this.profileAuxData[o+1]=0;h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){let n=4*this._extrusionVertexCount;this.profileVertexAndNormals[n]=i[0],this.profileVertexAndNormals[n+1]=i[1],this.profileVertexAndNormals[n+2]=s[0],this.profileVertexAndNormals[n+3]=s[1],n=2*this._extrusionVertexCount,this.profileAuxData[n]=r,this.profileAuxData[n+1]=o,h(this.profileRightAxes,this._extrusionVertexCount,e.right[0],e.right[1],e.right[2]),h(this.profileUpAxes,this._extrusionVertexCount,e.up[0],e.up[1],e.up[2]),this.pathVertexData[this._extrusionVertexCount]=t,++this._extrusionVertexCount}_rebuildGeometry(){this._extrusionVertexCount=0;const{positions:t,offset:e,vertices:s}=this.path;this.positions=i(t,e,3*s.length);let r=0;const o=(t,e,i,s,o)=>this.emitCapVertex(r,t,e,i,s,o),h=(t,e,i,s)=>this.emitVertex(r,t,e,i,s);for(this.startCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=1;r<s.length-1;++r)this.extruder.extrude(s[r],this.profile,h);this.endCap.rebuildConnectingProfileGeometry(s[r],this.profile,o),r=0,this.startCap.rebuildCapGeometry(s[r],o),r=s.length-1,this.endCap.rebuildCapGeometry(s[r],o)}_buildTopology(){const t=this.profile.vertices.length,e=this.profile.numSegments,i=this.numExtrusionProfiles-1;let s=3*(2*(e*i));this.startCap.indexBufferStart=s,this.startCap.firstProfileVertexIndex=0,s+=this.startCap.numIndices,this.endCap.indexBufferStart=s,this.endCap.firstProfileVertexIndex=t*(this.numExtrusionProfiles-1);const o=new Array,h=new Array,n=(t,e,i)=>{o.push(t),o.push(e),o.push(i),h.push(this.pathVertexData[t]),h.push(this.pathVertexData[e]),h.push(this.pathVertexData[i])};for(let r=0;r<e;++r){const e=this.profile.indices[2*r],s=this.profile.indices[2*r+1];for(let r=0;r<i;++r){const i=r*t+e,o=(r+1)*t+s,h=r*t+s;n(i,(r+1)*t+e,o),n(i,o,h)}}this.startCap.buildTopology(this.path.vertices[0],n),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],n),this.vertexIndices=r(o),this.pathVertexIndices=r(h)}onPathChanged(){this._rebuildGeometry()}}export{n as PathBuilder};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{copy as t,set as e,length as s,normalize as i,dot as r,scale as o,add as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as h,e as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as m}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as u}from"../../../../geometry/support/Indices.js";import{Attribute as d,Vertices as b}from"./Attribute.js";import{compressNormal as f}from"./Normals.js";import{intersectTriangles as v}from"./RayIntersections.js";import{VertexAttribute as g}from"./VertexAttribute.js";class x{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class A extends x{constructor(t){super(t),this.color=p(255,255,255,255),this._size=n(),this.positions=m(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){this.color[0]=255*t[0],this.color[1]=255*t[1],this.color[2]=255*t[2],this.color[3]=255*(t.length>3?t[3]:1)}bake(n){t(this._size,n);const{numVerticesTotal:c,pathVertexData:p,path:m,positions:u,profileRightAxes:d,profileUpAxes:b,profileVertexAndNormals:v}=this.builder;for(let t=0;t<c;++t){let c=p[t];const g=0===c||c===m.vertices.length-1;c*=3;const x=D;let A=0,I=0;const E=4*t,C=h(j,d[E],d[E+1],d[E+2]),N=h(w,b[E],b[E+1],b[E+2]),T=e(O,v[E]*n[0],v[E+1]*n[1]);if(g)l(x,N,C),A=d[E+3]*n[0],I=b[E+3];else{const t=P,n=V;e(t,d[E+3],b[E+3]);const l=s(t);i(t,t);const c=r(T,t);if(Math.abs(c)>l){e(n,-t[1],t[0]);const s=r(T,n);o(t,t,l*Math.sign(c)),o(n,n,s),a(T,t,n)}h(x,0,0,0)}const y=h(R,C[0]*T[0]+N[0]*T[1],C[1]*T[0]+N[1]*T[1],C[2]*T[0]+N[2]*T[1]),L=3*t;this.positions[L]=u[c]+y[0]+x[0]*A,this.positions[L+1]=u[c+1]+y[1]+x[1]*A,this.positions[L+2]=u[c+2]+y[2]+x[2]*A;const z=e(O,v[E+2],v[E+3]);f(this.normals,t,C[0]*z[0]+N[0]*z[1]+x[0]*I,C[1]*z[0]+N[1]*z[1]+x[1]*I,C[2]*z[0]+N[2]*z[1]+x[2]*I)}}createGeometryData(){const t=this.builder.vertexIndices;return[[g.POSITION,new d(this.positions,t,3,!0)],[g.NORMALCOMPRESSED,new d(this.normals,t,2,!0)],[g.COLOR,new d(this.color,u(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,s,i){const r=this.builder.vertexIndices,o=new b(this.positions,3),a=r.length/3;v(t,e,0,a,r,o,void 0,s,((t,e,s)=>i(t,s,e,!1)))}get size(){return this._size}}class I extends x{constructor(t,e,s,i){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=s,this.opacityAttributeValue=i,this.vvData=null,this.baked=new A(t),this.vvData=m(4*this.builder.path.vertices.length);for(let r=0;r<this.builder.path.vertices.length;++r){this.vvData[4*r]=e,this.vvData[4*r+1]=s,this.vvData[4*r+2]=i;const t=0===r||r===this.builder.path.vertices.length-1;this.vvData[4*r+3]=t?1:0}}createGeometryData(){const{positions:t,profileRightAxes:e,profileUpAxes:s,profileVertexAndNormals:i,pathVertexIndices:r,vertexIndices:o}=this.builder;return[[g.POSITION,new d(t,r,3,!0)],[g.PROFILERIGHT,new d(e,o,4,!0)],[g.PROFILEUP,new d(s,o,4,!0)],[g.PROFILEVERTEXANDNORMAL,new d(i,o,4,!0)],[g.FEATUREVALUE,new d(this.vvData,r,4,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute(g.POSITION);e&&(e.data=this.builder.positions)}}const O=n(),P=n(),V=n(),R=c(),D=c(),j=c(),w=c();export{I as FastUpdatePathGeometry,x as PathGeometryData,A as StaticPathGeometry};
5
+ import{copy as t,set as e,length as s,normalize as i,dot as r,scale as o,add as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as h,i as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as m}from"../../../../geometry/support/Indices.js";import{Attribute as d,Vertices as f}from"./Attribute.js";import{decompressNormal as b,compressNormal as v}from"./Normals.js";import{intersectTriangles as g}from"./RayIntersections.js";import{VertexAttribute as A}from"./VertexAttribute.js";class x{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class I extends x{constructor(t){super(t),this.color=p(255,255,255,255),this._size=n(),this.positions=u(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){this.color[0]=255*t[0],this.color[1]=255*t[1],this.color[2]=255*t[2],this.color[3]=255*(t.length>3?t[3]:1)}bake(n){t(this._size,n);const{numVerticesTotal:c,pathVertexData:p,path:u,positions:m,profileRightAxes:d,profileUpAxes:f,profileVertexAndNormals:g,profileAuxData:A}=this.builder;for(let t=0;t<c;++t){let c=p[t];const x=0===c||c===u.vertices.length-1;c*=3;const I=V;let D=0,E=0;const T=b(w,d,t),C=b(j,f,t),N=4*t,y=e(O,g[N]*n[0],g[N+1]*n[1]),L=2*t;if(x)h(I,C,T),D=A[L]*n[0],E=A[L+1];else{const t=P,n=R;e(t,A[L],A[L+1]);const h=s(t);i(t,t);const c=r(y,t);if(Math.abs(c)>h){e(n,-t[1],t[0]);const s=r(y,n);o(t,t,h*Math.sign(c)),o(n,n,s),a(y,t,n)}l(I,0,0,0)}const z=T[0]*y[0]+C[0]*y[1],F=T[1]*y[0]+C[1]*y[1],M=T[2]*y[0]+C[2]*y[1],U=3*t;this.positions[U]=m[c]+z+I[0]*D,this.positions[U+1]=m[c+1]+F+I[1]*D,this.positions[U+2]=m[c+2]+M+I[2]*D;const k=g[N+2],S=g[N+3];v(this.normals,t,T[0]*k+C[0]*S+I[0]*E,T[1]*k+C[1]*S+I[1]*E,T[2]*k+C[2]*S+I[2]*E)}}createGeometryData(){const t=this.builder.vertexIndices;return[[A.POSITION,new d(this.positions,t,3,!0)],[A.NORMALCOMPRESSED,new d(this.normals,t,2,!0)],[A.COLOR,new d(this.color,m(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,s,i){const r=this.builder.vertexIndices,o=new f(this.positions,3),a=r.length/3;g(t,e,0,a,r,o,void 0,s,((t,e,s)=>i(t,s,e,!1)))}get size(){return this._size}}class D extends x{constructor(t,e,s,i){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=s,this.opacityAttributeValue=i,this.vvData=null,this.baked=new I(t),this.vvData=u(4*this.builder.path.vertices.length);for(let r=0;r<this.builder.path.vertices.length;++r){this.vvData[4*r]=e,this.vvData[4*r+1]=s,this.vvData[4*r+2]=i;const t=0===r||r===this.builder.path.vertices.length-1;this.vvData[4*r+3]=t?1:0}}createGeometryData(){const t=this.builder,{pathVertexIndices:e,vertexIndices:s}=t;return[[A.POSITION,new d(t.positions,e,3,!0)],[A.PROFILEVERTEXANDNORMAL,new d(t.profileVertexAndNormals,s,4,!0)],[A.FEATUREVALUE,new d(this.vvData,e,4,!0)],[A.PROFILEAUXDATA,new d(t.profileAuxData,s,2,!0)],[A.PROFILERIGHT,new d(t.profileRightAxes,s,2,!0)],[A.PROFILEUP,new d(t.profileUpAxes,s,2,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute(A.POSITION);e&&(e.data=this.builder.positions)}}const O=n(),P=n(),R=n(),V=c(),w=c(),j=c();export{D as FastUpdatePathGeometry,x as PathGeometryData,I as StaticPathGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/PooledArray.js";import{webglDebugEnabled as e}from"../../../webgl/checkWebGLError.js";class r{constructor(r,i,s){this._context=r,this._locations=s,this._textures=new Map,this._freeTextureUnits=new t({deallocator:null}),this._glProgram=r.programCache.acquire(i.generate("vertex",!0),i.generate("fragment",!0),s),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=i.generateBind(this),this.bindPass=i.generateBindPass(this),this.bindDraw=i.generateBindDraw(this),this._fragmentUniforms=e()?i.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,e){this._glProgram.setUniform1i(t,e?1:0)}setUniform1i(t,e){this._glProgram.setUniform1i(t,e)}setUniform1f(t,e){this._glProgram.setUniform1f(t,e)}setUniform2fv(t,e){this._glProgram.setUniform2fv(t,e)}setUniform3fv(t,e){this._glProgram.setUniform3fv(t,e)}setUniform4fv(t,e){this._glProgram.setUniform4fv(t,e)}setUniformMatrix3fv(t,e){this._glProgram.setUniformMatrix3fv(t,e)}setUniformMatrix4fv(t,e){this._glProgram.setUniformMatrix4fv(t,e)}setUniform1fv(t,e){this._glProgram.setUniform1fv(t,e)}setUniform1iv(t,e){this._glProgram.setUniform1iv(t,e)}setUniform2iv(t,e){this._glProgram.setUniform2iv(t,e)}setUniform3iv(t,e){this._glProgram.setUniform3iv(t,e)}setUniform4iv(t,e){this._glProgram.setUniform4iv(t,e)}assertCompatibleVertexAttributeLocations(t){t.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(t,e){if(null==e?.glName){const e=this._textures.get(t);return e&&(this._context.bindTexture(null,e.unit),this._freeTextureUnit(e),this._textures.delete(t)),null}let r=this._textures.get(t);return null==r?(r=this._allocTextureUnit(e),this._textures.set(t,r)):r.texture=e,this._context.useProgram(this),this.setUniform1i(t,r.unit),this._context.bindTexture(e,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((t,e)=>{this._context.bindTexture(t.texture,t.unit),this.setUniform1i(e,t.unit)})),this._fragmentUniforms?.forEach((t=>{"sampler2D"!==t.type&&"samplerCube"!==t.type||this._textures.has(t.name)||console.error(`Texture sampler ${t.name} has no bound texture`)}))}_allocTextureUnit(t){return{texture:t,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(t){this._freeTextureUnits.push(t.unit)}}export{r as Program};
5
+ import t from"../../../../core/PooledArray.js";import{webglDebugEnabled as r}from"../../../webgl/checkWebGLError.js";class e{constructor(e,i,s){this._context=e,this._locations=s,this._textures=new Map,this._freeTextureUnits=new t({deallocator:null}),this._glProgram=e.programCache.acquire(i.generate("vertex",!0),i.generate("fragment",!0),s),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=i.generateBind(this),this.bindPass=i.generateBindPass(this),this.bindDraw=i.generateBindDraw(this),this._fragmentUniforms=r()?i.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,r){this._glProgram.setUniform1i(t,r?1:0)}setUniform1i(t,r){this._glProgram.setUniform1i(t,r)}setUniform1f(t,r){this._glProgram.setUniform1f(t,r)}setUniform2fv(t,r){this._glProgram.setUniform2fv(t,r)}setUniform3fv(t,r){this._glProgram.setUniform3fv(t,r)}setUniform4fv(t,r){this._glProgram.setUniform4fv(t,r)}setUniformMatrix3fv(t,r){this._glProgram.setUniformMatrix3fv(t,r)}setUniformMatrix4fv(t,r){this._glProgram.setUniformMatrix4fv(t,r)}setUniform1fv(t,r){this._glProgram.setUniform1fv(t,r)}setUniform1iv(t,r){this._glProgram.setUniform1iv(t,r)}setUniform2iv(t,r){this._glProgram.setUniform2iv(t,r)}setUniform3iv(t,r){this._glProgram.setUniform3iv(t,r)}setUniform4iv(t,r){this._glProgram.setUniform4iv(t,r)}assertCompatibleVertexAttributeLocations(t){t.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(t,r){let e=this._textures.get(t);return null==e?(e=this._allocTextureUnit(r),this._textures.set(t,e)):e.texture=r,this._context.useProgram(this),this.setUniform1i(t,e.unit),this._context.bindTexture(r,e.unit),e.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((t,r)=>{this._context.bindTexture(t.texture,t.unit),this.setUniform1i(r,t.unit)})),this._fragmentUniforms?.forEach((t=>{"sampler2D"!==t.type&&"usampler2D"!==t.type&&"samplerCube"!==t.type||this._textures.has(t.name)||console.error(`Texture sampler ${t.name} has no bound texture`)}))}_allocTextureUnit(t){return{texture:t,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}}export{e as Program};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as _}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as p,initial as u,sync as m}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/interfaces.js";import"../../../../core/accessorSupport/tracking/Flags.js";import"../../../../core/Warning.js";import"../../../../core/Error.js";import{equals as b,invert as T,multiply as E}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as A,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as R}from"../../../../chunks/vec42.js";import{ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as C,ZEROS as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as w}from"../../../../geometry/support/Indices.js";import{RenderCategory as D,InternalRenderCategory as O}from"../../webgl.js";import{debugFlags as N}from"../../support/debugFlags.js";import{DepthFormat as y,ColorFormat as H}from"../../webgl/formats.js";import{FBOCache as x,defaultWebGLFBO as L}from"../core/FBOCache.js";import{RenderPassManager as M}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as U,isColorOrColorEmission as F}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as v}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as G}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as q}from"../effects/RenderNodes.js";import{RenderPluginManager as V}from"../effects/RenderPluginManager.js";import{Blit as j}from"../effects/blit/Blit.js";import{renderHighlightBuffer as B}from"../effects/highlight/Highlight.js";import{OITBlend as Q}from"../effects/transparency/OITBlend.js";import{AnimationTimer as W}from"./AnimationTimer.js";import{AnimationTimeStep as k}from"./AnimationTimeStep.js";import{RenderRequestType as z}from"./basicInterfaces.js";import{BoundingInfo as X}from"./BoundingInfo.js";import{DepthRange as Y}from"./DepthRange.js";import{depthRangeFromScene as K}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as J}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as Z}from"./MainFramebuffer.js";import{RenderOccludedFlag as $}from"./Material.js";import{OITPass as ee}from"./OITPass.js";import{RenderContext as te,defaultRenderOccludedMask as re}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as ie,RendererTarget as se}from"./rendererUtils.js";import{setupFeatureDefaults as ae,RenderFeature as ne}from"./RenderFeature.js";import{RenderPluginInput as he}from"./RenderPluginInput.js";import{RenderSlot as oe}from"./RenderSlot.js";import{ShadowAccumulator as de}from"./ShadowAccumulator.js";import{ShadowMap as _e,SnapshotSlot as le}from"./ShadowMap.js";import pe from"./SliceHelper.js";import{Transparency as ue}from"./edgeRendering/interfaces.js";import{MergedRenderer as me}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ce}from"../parts/renderUtils.js";import{RendererPerformanceInfo as ge,PerformanceCategory as fe}from"../statistics/RendererPerformanceInfo.js";import{RenderState as be}from"../../../support/RenderState.js";import{PixelFormat as Te,PixelType as Ee,DepthStencilAttachment as Ae,FramebufferBit as Pe,ColorAttachment as Re}from"../../../webgl/enums.js";class Se{constructor(e,t,r,s,a,n){this._stage=e,this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this._renderers=new Map,this.renderPassManager=new M,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=C(0,0,0,1),this._sliceHelper=new pe,this._blit=null,this._oitblend=null,this._state=c(be.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new k,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=c(0),this._lastFrameTime=g(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new he,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new x(s),this._renderStateFeatures=c(ae(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new Z(this.fboCache),this.performanceInfo=new ge(this._rctx),this._shadowMap=new _e(this.fboCache,e.viewingMode),this._shadowAccumulator=new de(this.fboCache,r,e,(e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t}),((e,t,r)=>{const i=this._stage.view.qualitySettings.maximumPixelRatio;e.shadowMap.start(e.camera,t,r,!0,i),this._renderShadowCascades(U.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(e.camera,e.contentCamera)}),n),this._renderContext=new te(this._rctx,this._shadowMap,r),this._nodes=new q(this._renderContext),this._plugins=new V({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this._handles=[l((()=>this._stage.view.state.camera),(()=>n()),p),l((()=>N.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(ue.TRANSPARENT):()=>{},n()}),u),l((()=>this._stage.view.environment.background?.color),(e=>{const t=e?i(e):I;R(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),p),l((()=>this._stage.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=G),p),l((()=>this._bindParameters.clouds.fadeFactor),(()=>this._bindParameters.fadeLighting()),m),l((()=>this._bindParameters.clouds.data?.state),(()=>n()),m),l((()=>this._stage.view.state.highlights),(e=>{this._bindParameters.highlights=e,this._updateHighlights(),n()}),u)]}destroy(){this._handles.forEach((e=>e.remove())),this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.dispose(),this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),this._plugins.destroy(),this._renderers.clear(),this._blit=null,this._oitblend=null,X.prune(),me.prune(),w()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=ae(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate((i=>i.set(t,e,r))),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(ne.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(ne.WaterReflection))}get _hasHighlights(){return this._plugins.produces(U.Highlight,oe.OPAQUE_MATERIAL,oe.TRANSPARENT_MATERIAL,oe.DRAPED_MATERIAL,oe.HUD_MATERIAL,oe.LABEL_MATERIAL)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(U.Highlight,oe.HUD_MATERIAL,oe.LABEL_MATERIAL)}get hasSSAO(){return(this._stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(ne.SSAO))&&!this._inGlobeView}get hasSMAA(){return this._stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(ne.Antialiasing)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(ne.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r((async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");_(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ue(this._stage.view.resourceController)});return this._handles.push(l((()=>r.updating),(()=>this._requestRender()),m)),this._requestRender(),this._edgeViewCallbacks.forEach((e=>e(r))),this._edgeViewCallbacks.length=0,r}))),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.ssr.reprojectionMatrix,A)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slicePlane(e){this._sliceHelper.plane!==e&&(this._sliceHelper.plane=e,this._requestRender())}get plugins(){return this._plugins}getMaterialRenderer(e){return this._renderers.get(e)}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,t){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:i,updates:s}=e;if(0===r.length&&0===i.length&&0===s.length)return;ie(e).forEach(((r,i)=>{if(t.done)return;let s=this._renderers.get(i);null==s&&r.adds.length>0&&(s=new me({material:i,highlightOrderMap:this._stage.view.state.highlightOrderMap}),s.initializeRenderContext(this._plugins.context),this._plugins.add(s),this._renderers.set(i,s)),s&&(s.modify(r),s.updateHighlights(this._stage.view.state.highlightOrderMap),0===s.numGeometries&&(this._renderers.delete(s.material),this._plugins.remove(s),s.destroy())),r.removes.forEach((t=>e.removes.removeUnordered(t))),r.adds.forEach((t=>e.adds.removeUnordered(t))),r.updates.forEach((t=>e.updates.removeUnordered(t))),t.madeProgress()})),this.updateHasFlags()}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(U.Color,...ye),has.water=this._plugins.produces(U.Normal,oe.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new W(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r=se.Default,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new ce(this._pluginInput.get(D.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:_}=J,l=this._stage.view,p=l.stateManager.camera,u=l.qualitySettings.fadeDuration,m=e===be.IDLE?r:i,c=s((p.tilt-h)/(o-h),0,1),g=s((p.position.z??0-d)/(_-d),0,1),f=a(a(1,m,c),1,g),b=this._bindParameters.hudOccludedFragmentOpacity;if(u<=0||b===f||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=f,void(this._lastFrameTime=t);const T=t-this._lastFrameTime;this._lastFrameTime=t;const E=Math.min(Math.abs(r-i)*T/u,n);E>=Math.abs(f-b)?this._bindParameters.hudOccludedFragmentOpacity=f:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(f-b)*E,this._requestRender())}_render(e,t,r=se.Default,i){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===se.Default,this._disposeBindBuffers();const{camera:s,contentCamera:a,mode:n,alignPixelEnabled:h}=e;this._state.value=n;const o=this._nodes.produces("magnifier-color"),_=this._nodes.produces(D.FINAL),l=this._nodes.require("emissive",D.FINAL,D.COMPOSITE)>0&&this._plugins.hasEmissions,p=l?U.ColorEmission:U.Color;this._renderContext.time=t,this._renderContext.output=p,this._bindParameters.oitPass=ee.NONE,this._bindParameters.alignPixelEnabled=h,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null,this._bindParameters.slicePlane=this._sliceHelper.plane,this._bindParameters.viewshedEnabled=this._nodes.produces(O.VIEWSHED),this._renderOverlay(t),s.setGLViewport(this._rctx);const u=this._framebuffer,m=u.initialize(s.fullWidth,s.fullHeight,this._backgroundColor,l);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=m):m?.release(),this._ensureBindParametersCamera(s,a),this._updateHUDOccludedFragmentOpacity(n,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const c=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(U.Color,...Oe);this._precompilePrepasses(),this.performanceInfo.advance(fe.PREPARE);const f=this._computeDepthRange(s);this._renderShadowMap(s,this._bindParameters.lighting.mainLight.direction,f),this._ensureBindParametersCamera(s,a),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(f,s,a),this._ensureBindParametersSSR(t),this._precompileShaders(c,g,p),this._renderContext.output=p,u.bind(),this._bindParameters.mainDepth=u.depth.attachment;const b=this.plugins.produces(U.Color,...De);b&&this._renderOpaqueGeometry(),u.update((e=>this._renderNodes(D.OPAQUE,e,b))),this.fboCache.debugCallback?.(D.OPAQUE,u.color.fbo),u.update((e=>this._renderNodes(O.OPAQUE_ENVIRONMENT,e))),this.fboCache.debugCallback?.(O.OPAQUE_ENVIRONMENT,u.color.fbo),this._renderTerrainDepth(c),this._renderEdges(ue.OPAQUE),u.bind(),this._renderPlugins(oe.VOXEL,fe.VOXEL),this._renderHiddenTransparentEdges(),g&&(this._oitEnabled?this._renderOIT(Ce.Geometry,p):this._renderTransparentGeometry()),u.update((e=>this._renderNodes(D.TRANSPARENT,e,g))),this.fboCache.debugCallback?.(D.TRANSPARENT,u.color.fbo),this._renderGeometryDepth(c),this._renderHUDVisibility(),c||this._plugins.render(this._pluginInput,oe.LINE_CALLOUTS),this._renderEdges(ue.TRANSPARENT);const T=this._hasTransparentTerrain?this._renderTransparentTerrain():null;T&&(this.performanceInfo.advance(fe.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(c?this._renderLineCallouts(v.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,T.getTexture())),this._renderHUD(v.Occluded,u.color,p))),this._bindParameters.cullAboveTerrain=!1,T&&(u.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,T.getTexture()),T.release(),c&&(this._renderEdges(ue.OPAQUE),g&&(this._oitEnabled?this._renderOIT(Ce.Geometry,p):this._renderTransparentGeometry(),this.performanceInfo.advance(fe.TRANSPARENT)),this._renderEdges(ue.TRANSPARENT))),this._bindParameters.ssao=d(this._bindParameters.ssao),c&&this._renderLineCallouts(v.NotOccluded),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment(),this._pluginInput.set(O.FOCUSAREA,this._renderFocusAreaGeometry()),u.update((e=>this._renderNodes(O.TRANSPARENT_ENVIRONMENT,e))),u.update((e=>this._renderNodes(O.VIEWSHED,e))),u.update((e=>this._renderNodes(O.LASERLINES,e))),u.update((e=>this._renderNodes(O.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass());const E=r===se.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;u.update((e=>this._renderNodes(D.COMPOSITE,e))),this._pluginInput.release(O.FOCUSAREA);const A=!(r!==se.Default||_||o&&!i),P=this._pluginInput.get(D.COMPOSITE),R=A?L:this.fboCache.acquire(P.fbo.width,P.fbo.height,O.ANTIALIASING),S=this._nodes.produces(O.ANTIALIASING)?this._renderNodes(O.ANTIALIASING,R):this._blitFBO(P,R,!1);let C;this._pluginInput.set(O.ANTIALIASING,S),this._hasHUDHighlights?(this._renderHUD(v.NotOccluded,S,p),C=this._renderNodes(O.HIGHLIGHTS,S)):(C=this._renderNodes(O.HIGHLIGHTS,S),this._renderHUD(v.NotOccluded,C,p));const I=this._renderNodes(O.MAGNIFIER,C);return o&&!i&&r===se.Default&&!_&&this._blitFBO(I),_?(I.attachDepth(u.depth),this._blitFBO(this._renderNodes(D.FINAL,I)),I.detachDepth()):this._pluginInput.set(D.FINAL,I),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),u.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==se.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new ce(this._pluginInput.get(D.FINAL),E)}_precompileShaders(e,t,r){if(++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(O.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=U.Depth,this._plugins.precompile(oe.TRANSPARENT_TERRAIN),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(oe.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(O.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(oe.OCCLUSION_PIXELS),this._plugins.precompile(oe.LINE_CALLOUTS),this._precompileHUD(v.Occluded),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(O.VIEWSHED,O.LASERLINES,O.OCCLUDED,O.ANTIALIASING,O.HIGHLIGHTS),this._precompileHUD(v.NotOccluded),this._hasHighlights){const e=this._bindParameters;e.highlights.forEach(((t,r)=>{e.highlightLevel=r,this._precompileAllGeometry(U.Highlight)})),e.highlightLevel=null}this._nodes.precompile(D.COMPOSITE,O.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),--this._plugins.context.techniques.precompiling}_updateHighlights(){const e=this._stage.view.state;this._renderers.forEach((t=>t.updateHighlights(e.highlightOrderMap)))}_renderFocusAreaGeometry(){if(!this._nodes.produces(O.FOCUSAREA))return null;const{width:e,height:t}=this._framebufferSize;let r=this.fboCache.acquire(e,t,O.FOCUSAREA);return r=this._nodes.render(r,this._pluginInput),this.performanceInfo.advance(fe.FOCUS_AREA_MASK),r}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(y.DEPTH_STENCIL_TEXTURE),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(fe.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===z.BACKGROUND;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear-depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(I),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],Te.RGBA,Ee.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,Te.RGBA,Ee.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=()=>t.render(this._bindParameters,e),a=this._bindParameters.geometryDepth;this.renderToTargets(s,i,a??this._framebuffer.depth,I),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===ue.OPAQUE?fe.OPAQUE_EDGES:fe.TRANSPARENT_EDGES)}_renderOverlay(e){this._bindParameters.overlay=this.overlay?.render(e),this._bindParameters.overlay&&this.performanceInfo.advance(fe.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(ne.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(U.ShadowHighlight,this._shadowMap),i.moveSnapshot(le.Highlight),this._renderShadowCascades(U.ShadowExcludeHighlight,this._shadowMap),i.copySnapshot(le.ExcludeHighlight),this._renderShadowCascades(U.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(U.Shadow),i.finish(),e.setGLViewport(this._rctx),this.performanceInfo.advance(fe.SHADOW_MAP)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(U.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._needsShadowAccumulation||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");if(e){const t=this._needsDepth?e.getAttachment(Ae):null;t?.retain(),this._pluginInput.set(O.SSAO,this._renderSSAO()),this._renderGeometryWithoutNormalsDepth(t)}else this._renderAllGeometryDepth()}_renderGeometryWithoutNormalsDepth(e){if(!this._needsDepth||!e)return void(this._bindParameters.depth=d(this._bindParameters.depth));const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"depth");r.attachDepth(e),e.release(),this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(Pe.STENCIL),this._renderGeometryWithoutNormals(U.Depth),d(this._bindParameters.depth),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(fe.DEPTH)}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"depth").acquireDepth(y.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(Pe.DEPTH|Pe.STENCIL),this.renderAllGeometry(U.Depth),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(fe.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=U.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth").acquireDepth(y.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(Pe.DEPTH|Pe.STENCIL),this._renderTransparentTerrain(),d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth").acquireDepth(y.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(Pe.DEPTH|Pe.STENCIL),this._renderOpaqueAndTransparentGeometry(U.Depth),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowAccumulation}_computeDepthRange(e){if(!this._needsDepthRange)return Y.zero;const t=K(e,this._plugins.plugins,this._stage.layers);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}get _normalsRequired(){const e=this._nodes.require("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,O.VIEWSHED,O.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(U.Normal),this._needsDepth&&this._precompileAllGeometry(U.Depth),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(U.ShadowHighlight),this._precompileShadowCascades(U.ShadowExcludeHighlight),this._precompileShadowCascades(U.ShadowHighlight)):this._precompileShadowCascades(U.Shadow)),this._needsShadowAccumulation&&this._precompileAllGeometry(U.Shadow)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",H.RGBA);r.acquireDepth(y.DEPTH_STENCIL_TEXTURE),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(I,!0,!0),this._renderGeometryWithNormals(U.Normal);const i=this._nodes.optional("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,O.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(fe.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return void e?.detachDepth();L.setName(O.SSAO);const t=this._nodes.render(L,this._pluginInput);return this._bindParameters.ssao=t,e.detachDepth(),this._pluginInput.release("normals"),this.performanceInfo.advance(fe.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(oe.TRANSPARENT_TERRAIN),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Ne);this._renderContext.renderOccludedMask=re}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll((e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t,this._pluginInput)}))}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>$.Occlude&&this._plugins.render(this._pluginInput,oe.OCCLUDED_TERRAIN),this.renderSlots(e,...Ne),this._renderContext.renderOccludedMask=re}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,oe.HUD_MATERIAL)}precompileViewshedShadowMap(){this._precompileAllGeometry(U.ViewshedShadow)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(U.ViewshedShadow),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Ie),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...we)}_precompileOpaqueGeometry(){this._plugins.precompile(...De)}_renderOpaqueGeometry(){this._plugins.render(this._pluginInput,...De)}_renderTransparentGeometry(){this._plugins.render(this._pluginInput,...Oe)}get _hasTransparentTerrain(){return this._plugins.produces(U.Color,oe.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(this._pluginInput,oe.TRANSPARENT_TERRAIN);if(!F(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,I),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,oe.OCCLUSION_PIXELS)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",H.RGBA4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(this._pluginInput,oe.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(fe.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===v.Occluded){const e=()=>this._plugins.render(this._pluginInput,oe.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(y.DEPTH16_BUFFER,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(this._pluginInput,oe.LINE_CALLOUTS)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=U.Highlight,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&F(this._renderContext.output)?(this._bindParameters.oitPass=ee.ColorAlpha,this._plugins.precompile(...ye),this._bindParameters.oitPass=ee.FrontFace,this._plugins.precompile(...ye),this._bindParameters.oitPass=ee.NONE):this._plugins.precompile(...ye),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(Ce.HUD,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(this._renderContext.output=r,e===v.Occluded){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(y.DEPTH16_BUFFER,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(y.DEPTH16_BUFFER),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===v.Occluded?fe.HUD_OCCLUDED:fe.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,...ye)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(U.ShadowHighlight,oe.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,s=e.acquire(i.width,i.height,"highlights",H.RG);return s.acquireDepth(y.DEPTH_STENCIL_TEXTURE),t.bindFramebuffer(s.fbo),t.clearFramebuffer(I,!0),this._renderContext.output=U.Highlight,t.bindFramebuffer(s.fbo),B(t,e,i,r,(()=>this._renderHighlightGeometries())),this.performanceInfo.advance(fe.HIGHLIGHTS),s}_renderHighlightGeometries(){this._plugins.render(this._pluginInput,...He),this._rctx.clear(Pe.DEPTH),this._renderHUDElements(v.Both)}get _needsShadowAccumulation(){return this._shadowAccumulator.accumulating}_renderShadowAccumulation(e,t,r){this._needsShadowAccumulation&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,e,t,r)&&this.performanceInfo.advance(fe.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&F(this._renderContext.output)?(this._bindParameters.oitPass=ee.ColorAlpha,this._plugins.precompile(...Oe),this._bindParameters.oitPass=ee.FrontFace,this._plugins.precompile(...Oe),this._bindParameters.oitPass=ee.NONE):this._plugins.precompile(...Oe)}_renderOIT(e,t,r=v.Both){const i=e===Ce.HUD,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=ee.ColorAlpha;const d=a?"oit hud color+alpha":"oit color+alpha",_=this.fboCache.acquire(s.width,s.height,d,H.RGBA16F),l=t===U.ColorEmission;l&&_.acquireColor(Re.COLOR_ATTACHMENT1,H.RGBA16F,"emissive"),_.acquireColor(l?Re.COLOR_ATTACHMENT2:Re.COLOR_ATTACHMENT1,H.R16F),a||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),l&&this._rctx.gl.clearBufferfv(this._rctx.gl.COLOR,1,S),n(),_.detachDepth(),h.oitPass=ee.FrontFace;const p=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return l&&p.acquireColor(Re.COLOR_ATTACHMENT1,H.RGBA,"emissive"),a?p.acquireDepth(y.DEPTH16_BUFFER):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(I,!!a),n(),p.detachDepth(),h.oitPass=ee.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(Pe.COLOR)):this._framebuffer.bind(),this._oitblend??=new Q(this._techniques),this._oitblend.blend(this._rctx,_,p,h,l),a?.detachDepth(),p.release(),_.release(),this._renderContext.output=o,a}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(fe.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(this._pluginInput,oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),this.performanceInfo.advance(fe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(this._pluginInput,e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}_blitFBO(e,t=L,r=!0){return this._blit??=new j(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=A:(T(Le,this._bindParameters.camera.viewMatrix),T(xe,this._bindParameters.camera.projectionMatrix),E(Me,Le,xe),E(Me,this._renderContext.lastFrameCamera.viewMatrix,Me),E(Me,this._renderContext.lastFrameCamera.projectionMatrix,Me),this._reprojectionMatrix=Me);const t=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=A,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(z.UPDATE)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}}var Ce;e([f({readOnly:!0})],Se.prototype,"fullResolutionAtmosphere",null),e([f()],Se.prototype,"_edgeView",void 0),e([f()],Se.prototype,"updating",null),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(Ce||(Ce={}));const Ie=[oe.INTEGRATED_MESH,oe.OPAQUE_TERRAIN,oe.OPAQUE_MATERIAL,oe.TRANSPARENT_MATERIAL],we=[oe.OPAQUE_MATERIAL_WITHOUT_NORMALS,oe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],De=[oe.INTEGRATED_MESH,oe.OPAQUE_TERRAIN,oe.OPAQUE_MATERIAL,oe.OPAQUE_MATERIAL_WITHOUT_NORMALS],Oe=[oe.TRANSPARENT_MATERIAL,oe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Ne=[oe.OPAQUE_MATERIAL,oe.TRANSPARENT_MATERIAL,oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH],ye=[oe.LINE_CALLOUTS_HUD_DEPTH,oe.HUD_MATERIAL,oe.LABEL_MATERIAL],He=[oe.TRANSPARENT_MATERIAL,oe.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,oe.OPAQUE_MATERIAL,oe.OPAQUE_MATERIAL_WITHOUT_NORMALS,oe.TRANSPARENT_TERRAIN,oe.INTEGRATED_MESH,oe.OPAQUE_TERRAIN],xe=P(),Le=P(),Me=P();function Ue(e){return t=>e.immediate.schedule(t)}export{Se as Renderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as _}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as p,initial as u,sync as m}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/interfaces.js";import"../../../../core/accessorSupport/tracking/Flags.js";import"../../../../core/Warning.js";import"../../../../core/Error.js";import{equals as b,invert as T,multiply as E}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as A,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as R}from"../../../../chunks/vec42.js";import{ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as I,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as w}from"../../../../geometry/support/Indices.js";import{RenderCategory as D,InternalRenderCategory as O}from"../../webgl.js";import{debugFlags as N}from"../../support/debugFlags.js";import{DepthFormat as y,ColorFormat as H}from"../../webgl/formats.js";import{FBOCache as x,defaultWebGLFBO as L}from"../core/FBOCache.js";import{RenderPassManager as M}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as U,isColorOrColorEmission as F}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as v}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as G}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as q}from"../effects/RenderNodes.js";import{RenderPluginManager as V}from"../effects/RenderPluginManager.js";import{Blit as j}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as Q}from"../effects/highlight/Highlight.js";import{OITBlend as W}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as z}from"./AnimationTimeStep.js";import{RenderRequestType as X}from"./basicInterfaces.js";import{BoundingInfo as Y}from"./BoundingInfo.js";import{DepthRange as K}from"./DepthRange.js";import{depthRangeFromScene as J}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as Z}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as $}from"./MainFramebuffer.js";import{RenderOccludedFlag as ee}from"./Material.js";import{OITPass as te}from"./OITPass.js";import{RenderContext as re,defaultRenderOccludedMask as ie}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as se,RendererTarget as ae}from"./rendererUtils.js";import{setupFeatureDefaults as ne,RenderFeature as he}from"./RenderFeature.js";import{RenderPluginInput as oe}from"./RenderPluginInput.js";import{RenderSlot as de}from"./RenderSlot.js";import{ShadowAccumulator as _e}from"./ShadowAccumulator.js";import{ShadowMap as le,SnapshotSlot as pe}from"./ShadowMap.js";import ue from"./SliceHelper.js";import{Transparency as me}from"./edgeRendering/interfaces.js";import{MergedRenderer as ce}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ge}from"../parts/renderUtils.js";import{RendererPerformanceInfo as fe,PerformanceCategory as be}from"../statistics/RendererPerformanceInfo.js";import{RenderState as Te}from"../../../support/RenderState.js";import{PixelFormat as Ee,PixelType as Ae,DepthStencilAttachment as Pe,FramebufferBit as Re,ColorAttachment1 as Se,ColorAttachment2 as Ie}from"../../../webgl/enums.js";class Ce{constructor(e,t,r,s,a,n){this._stage=e,this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this._renderers=new Map,this.renderPassManager=new M,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=I(0,0,0,1),this._sliceHelper=new ue,this._blit=null,this._oitblend=null,this._state=c(Te.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new z,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=c(0),this._lastFrameTime=g(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new oe,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new x(s),this._renderStateFeatures=c(ne(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new $(this.fboCache),this.performanceInfo=new fe(this._rctx),this._shadowMap=new le(this.fboCache,e.viewingMode),this._shadowAccumulator=new _e(this.fboCache,r,e,(e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t}),((e,t,r)=>{const i=this._stage.view.qualitySettings.maximumPixelRatio;e.shadowMap.start(e.camera,t,r,!0,i),this._renderShadowCascades(U.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(e.camera,e.contentCamera)}),n),this._renderContext=new re(this._rctx,this._shadowMap,r),this._nodes=new q(this._renderContext),this._plugins=new V({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this._handles=[l((()=>this._stage.view.state.camera),(()=>n()),p),l((()=>N.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(me.TRANSPARENT):()=>{},n()}),u),l((()=>this._stage.view.environment.background?.color),(e=>{const t=e?i(e):C;R(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),p),l((()=>this._stage.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=G),p),l((()=>this._bindParameters.clouds.fadeFactor),(()=>this._bindParameters.fadeLighting()),m),l((()=>this._bindParameters.clouds.data?.state),(()=>n()),m),l((()=>this._stage.view.state.highlights),(e=>{this._bindParameters.highlights=e,this._updateHighlights(),n()}),u)]}destroy(){this._handles.forEach((e=>e.remove())),this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.dispose(),this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),this._plugins.destroy(),this._renderers.clear(),this._blit=null,this._oitblend=null,Y.prune(),ce.prune(),w()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=ne(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate((i=>i.set(t,e,r))),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(he.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(he.WaterReflection))}get _hasHighlights(){return this._plugins.produces(U.Highlight,de.OPAQUE_MATERIAL,de.TRANSPARENT_MATERIAL,de.DRAPED_MATERIAL,de.HUD_MATERIAL,de.LABEL_MATERIAL)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(U.Highlight,de.HUD_MATERIAL,de.LABEL_MATERIAL)}get hasSSAO(){return(this._stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(he.SSAO))&&!this._inGlobeView}get hasSMAA(){return this._stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(he.Antialiasing)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(he.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r((async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");_(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:ve(this._stage.view.resourceController)});return this._handles.push(l((()=>r.updating),(()=>this._requestRender()),m)),this._requestRender(),this._edgeViewCallbacks.forEach((e=>e(r))),this._edgeViewCallbacks.length=0,r}))),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.ssr.reprojectionMatrix,A)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slicePlane(e){this._sliceHelper.plane!==e&&(this._sliceHelper.plane=e,this._requestRender())}get plugins(){return this._plugins}getMaterialRenderer(e){return this._renderers.get(e)}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,t){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:i,updates:s}=e;if(0===r.length&&0===i.length&&0===s.length)return;se(e).forEach(((r,i)=>{if(t.done)return;let s=this._renderers.get(i);null==s&&r.adds.length>0&&(s=new ce({material:i,highlightOrderMap:this._stage.view.state.highlightOrderMap}),s.initializeRenderContext(this._plugins.context),this._plugins.add(s),this._renderers.set(i,s)),s&&(s.modify(r),s.updateHighlights(this._stage.view.state.highlightOrderMap),0===s.numGeometries&&(this._renderers.delete(s.material),this._plugins.remove(s),s.destroy())),r.removes.forEach((t=>e.removes.removeUnordered(t))),r.adds.forEach((t=>e.adds.removeUnordered(t))),r.updates.forEach((t=>e.updates.removeUnordered(t))),t.madeProgress()})),this.updateHasFlags()}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(U.Color,...xe),has.water=this._plugins.produces(U.Normal,de.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new k(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r=ae.Default,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new ge(this._pluginInput.get(D.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:_}=Z,l=this._stage.view,p=l.stateManager.camera,u=l.qualitySettings.fadeDuration,m=e===Te.IDLE?r:i,c=s((p.tilt-h)/(o-h),0,1),g=s((p.position.z??0-d)/(_-d),0,1),f=a(a(1,m,c),1,g),b=this._bindParameters.hudOccludedFragmentOpacity;if(u<=0||b===f||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=f,void(this._lastFrameTime=t);const T=t-this._lastFrameTime;this._lastFrameTime=t;const E=Math.min(Math.abs(r-i)*T/u,n);E>=Math.abs(f-b)?this._bindParameters.hudOccludedFragmentOpacity=f:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(f-b)*E,this._requestRender())}_render(e,t,r=ae.Default,i){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===ae.Default,this._disposeBindBuffers();const{camera:s,contentCamera:a,mode:n,alignPixelEnabled:h}=e;this._state.value=n;const o=this._nodes.produces("magnifier-color"),_=this._nodes.produces(D.FINAL),l=this._nodes.require("emissive",D.FINAL,D.COMPOSITE)>0&&this._plugins.hasEmissions,p=l?U.ColorEmission:U.Color;this._renderContext.time=t,this._renderContext.output=p,this._bindParameters.oitPass=te.NONE,this._bindParameters.alignPixelEnabled=h,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null,this._bindParameters.slicePlane=this._sliceHelper.plane,this._bindParameters.viewshedEnabled=this._nodes.produces(O.VIEWSHED),this._renderOverlay(t),s.setGLViewport(this._rctx);const u=this._framebuffer,m=u.initialize(s.fullWidth,s.fullHeight,this._backgroundColor,l);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=m):m?.release(),this._ensureBindParametersCamera(s,a),this._updateHUDOccludedFragmentOpacity(n,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const c=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(U.Color,...ye);this._precompilePrepasses(),this.performanceInfo.advance(be.PREPARE);const f=this._computeDepthRange(s);this._renderShadowMap(s,this._bindParameters.lighting.mainLight.direction,f),this._ensureBindParametersCamera(s,a),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(f,s,a),this._ensureBindParametersSSR(t),this._precompileShaders(c,g,p),this._renderContext.output=p,u.bind(),this._bindParameters.mainDepth=u.depth.attachment;const b=this.plugins.produces(U.Color,...Ne);b&&this._renderOpaqueGeometry(),u.update((e=>this._renderNodes(D.OPAQUE,e,b))),this.fboCache.debugCallback?.(D.OPAQUE,u.color.fbo),u.update((e=>this._renderNodes(O.OPAQUE_ENVIRONMENT,e))),this.fboCache.debugCallback?.(O.OPAQUE_ENVIRONMENT,u.color.fbo),this._renderTerrainDepth(c),this._renderEdges(me.OPAQUE),u.bind(),this._renderPlugins(de.VOXEL,be.VOXEL),this._renderHiddenTransparentEdges(),g&&(this._oitEnabled?this._renderOIT(we.Geometry,p):this._renderTransparentGeometry()),u.update((e=>this._renderNodes(D.TRANSPARENT,e,g))),this.fboCache.debugCallback?.(D.TRANSPARENT,u.color.fbo),this._renderGeometryDepth(c),this._renderHUDVisibility(),c||this._plugins.render(this._pluginInput,de.LINE_CALLOUTS),this._renderEdges(me.TRANSPARENT);const T=this._hasTransparentTerrain?this._renderTransparentTerrain():null;T&&(this.performanceInfo.advance(be.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(c?this._renderLineCallouts(v.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,T.getTexture())),this._renderHUD(v.Occluded,u.color,p))),this._bindParameters.cullAboveTerrain=!1,T&&(u.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,T.getTexture()),T.release(),c&&(this._renderEdges(me.OPAQUE),g&&(this._oitEnabled?this._renderOIT(we.Geometry,p):this._renderTransparentGeometry(),this.performanceInfo.advance(be.TRANSPARENT)),this._renderEdges(me.TRANSPARENT))),this._bindParameters.ssao=d(this._bindParameters.ssao),c&&this._renderLineCallouts(v.NotOccluded),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment(),this._pluginInput.set(O.FOCUSAREA,this._renderFocusAreaGeometry()),u.update((e=>this._renderNodes(O.TRANSPARENT_ENVIRONMENT,e))),u.update((e=>this._renderNodes(O.VIEWSHED,e))),u.update((e=>this._renderNodes(O.LASERLINES,e))),u.update((e=>this._renderNodes(O.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass());const E=r===ae.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;u.update((e=>this._renderNodes(D.COMPOSITE,e))),this._pluginInput.release(O.FOCUSAREA);const A=!(r!==ae.Default||_||o&&!i),P=this._pluginInput.get(D.COMPOSITE),R=A?L:this.fboCache.acquire(P.fbo.width,P.fbo.height,O.ANTIALIASING),S=this._nodes.produces(O.ANTIALIASING)?this._renderNodes(O.ANTIALIASING,R):this._blitFBO(P,R,!1);let I;this._pluginInput.set(O.ANTIALIASING,S),this._hasHUDHighlights?(this._renderHUD(v.NotOccluded,S,p),I=this._renderNodes(O.HIGHLIGHTS,S)):(I=this._renderNodes(O.HIGHLIGHTS,S),this._renderHUD(v.NotOccluded,I,p));const C=this._renderNodes(O.MAGNIFIER,I);return o&&!i&&r===ae.Default&&!_&&this._blitFBO(C),_?(C.attachDepth(u.depth),this._blitFBO(this._renderNodes(D.FINAL,C)),C.detachDepth()):this._pluginInput.set(D.FINAL,C),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),u.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==ae.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new ge(this._pluginInput.get(D.FINAL),E)}_precompileShaders(e,t,r){if(++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(O.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=U.Depth,this._plugins.precompile(de.TRANSPARENT_TERRAIN),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(de.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(O.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(de.OCCLUSION_PIXELS),this._plugins.precompile(de.LINE_CALLOUTS),this._precompileHUD(v.Occluded),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(O.VIEWSHED,O.LASERLINES,O.OCCLUDED,O.ANTIALIASING,O.HIGHLIGHTS),this._precompileHUD(v.NotOccluded),this._hasHighlights){const e=this._bindParameters;e.highlights.forEach(((t,r)=>{e.highlightLevel=r,this._precompileAllGeometry(U.Highlight)})),e.highlightLevel=null}this._nodes.precompile(D.COMPOSITE,O.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),--this._plugins.context.techniques.precompiling}_updateHighlights(){const e=this._stage.view.state;this._renderers.forEach((t=>t.updateHighlights(e.highlightOrderMap)))}_renderFocusAreaGeometry(){if(!this._nodes.produces(O.FOCUSAREA))return null;const{width:e,height:t}=this._framebufferSize;let r=this.fboCache.acquire(e,t,O.FOCUSAREA);return r=this._nodes.render(r,this._pluginInput),this.performanceInfo.advance(be.FOCUS_AREA_MASK),r}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(y.DEPTH_STENCIL_TEXTURE),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(be.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===X.BACKGROUND;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear-depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],Ee.RGBA,Ae.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,Ee.RGBA,Ae.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=()=>t.render(this._bindParameters,e),a=this._bindParameters.geometryDepth;this.renderToTargets(s,i,a??this._framebuffer.depth,C),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===me.OPAQUE?be.OPAQUE_EDGES:be.TRANSPARENT_EDGES)}_renderOverlay(e){this._bindParameters.overlay=this.overlay?.render(e),this._bindParameters.overlay&&this.performanceInfo.advance(be.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(he.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(U.ShadowHighlight,this._shadowMap),i.moveSnapshot(pe.Highlight),this._renderShadowCascades(U.ShadowExcludeHighlight,this._shadowMap),i.copySnapshot(pe.ExcludeHighlight),this._renderShadowCascades(U.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(U.Shadow),i.finish(),e.setGLViewport(this._rctx),this.performanceInfo.advance(be.SHADOW_MAP)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(U.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._needsShadowAccumulation||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");if(e){const t=this._needsDepth?e.getAttachment(Pe):null;t?.retain(),this._pluginInput.set(O.SSAO,this._renderSSAO()),this._renderGeometryWithoutNormalsDepth(t)}else this._renderAllGeometryDepth()}_renderGeometryWithoutNormalsDepth(e){if(!this._needsDepth||!e)return void(this._bindParameters.depth=d(this._bindParameters.depth));const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"depth");r.attachDepth(e),e.release(),this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(Re.STENCIL),this._renderGeometryWithoutNormals(U.Depth),d(this._bindParameters.depth),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(be.DEPTH)}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"depth").acquireDepth(y.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(Re.DEPTH|Re.STENCIL),this.renderAllGeometry(U.Depth),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(be.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=U.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth").acquireDepth(y.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(Re.DEPTH|Re.STENCIL),this._renderTransparentTerrain(),d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth").acquireDepth(y.DEPTH_STENCIL_TEXTURE);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(Re.DEPTH|Re.STENCIL),this._renderOpaqueAndTransparentGeometry(U.Depth),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowAccumulation}_computeDepthRange(e){if(!this._needsDepthRange)return K.zero;const t=J(e,this._plugins.plugins,this._stage.layers);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}get _normalsRequired(){const e=this._nodes.require("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,O.VIEWSHED,O.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(U.Normal),this._needsDepth&&this._precompileAllGeometry(U.Depth),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(U.ShadowHighlight),this._precompileShadowCascades(U.ShadowExcludeHighlight),this._precompileShadowCascades(U.ShadowHighlight)):this._precompileShadowCascades(U.Shadow)),this._needsShadowAccumulation&&this._precompileAllGeometry(U.Shadow)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",H.RGBA);r.acquireDepth(y.DEPTH_STENCIL_TEXTURE),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._renderGeometryWithNormals(U.Normal);const i=this._nodes.optional("normals",D.FINAL,D.COMPOSITE,D.OPAQUE,D.TRANSPARENT,O.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(be.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return void e?.detachDepth();L.setName(O.SSAO);const t=this._nodes.render(L,this._pluginInput);return this._bindParameters.ssao=t,e.detachDepth(),this._pluginInput.release("normals"),this.performanceInfo.advance(be.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(de.TRANSPARENT_TERRAIN),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...He);this._renderContext.renderOccludedMask=ie}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll((e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t,this._pluginInput)}))}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>ee.Occlude&&this._plugins.render(this._pluginInput,de.OCCLUDED_TERRAIN),this.renderSlots(e,...He),this._renderContext.renderOccludedMask=ie}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,de.HUD_MATERIAL)}precompileViewshedShadowMap(){this._precompileAllGeometry(U.ViewshedShadow)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(U.ViewshedShadow),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...De),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Oe)}_precompileOpaqueGeometry(){this._plugins.precompile(...Ne)}_renderOpaqueGeometry(){this._plugins.render(this._pluginInput,...Ne)}_renderTransparentGeometry(){this._plugins.render(this._pluginInput,...ye)}get _hasTransparentTerrain(){return this._plugins.produces(U.Color,de.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(this._pluginInput,de.TRANSPARENT_TERRAIN);if(!F(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,C),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,de.OCCLUSION_PIXELS)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",H.RGBA4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(this._pluginInput,de.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(be.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===v.Occluded){const e=()=>this._plugins.render(this._pluginInput,de.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(y.DEPTH16_BUFFER,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(this._pluginInput,de.LINE_CALLOUTS)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=U.Highlight,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&F(this._renderContext.output)?(this._bindParameters.oitPass=te.ColorAlpha,this._plugins.precompile(...xe),this._bindParameters.oitPass=te.FrontFace,this._plugins.precompile(...xe),this._bindParameters.oitPass=te.NONE):this._plugins.precompile(...xe),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(we.HUD,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(this._renderContext.output=r,e===v.Occluded){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(y.DEPTH16_BUFFER,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(y.DEPTH16_BUFFER),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===v.Occluded?be.HUD_OCCLUDED:be.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,...xe)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(U.ShadowHighlight,de.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>B?H.RG8UI:H.R8UI);a.acquireDepth(y.DEPTH_STENCIL_TEXTURE),t.bindFramebuffer(a.fbo);const{gl:n}=t;return n.clearBufferuiv(n.COLOR,0,[0,0,0,0]),this._renderContext.output=U.Highlight,t.bindFramebuffer(a.fbo),Q(t,e,i,r,(()=>this._renderHighlightGeometries())),this.performanceInfo.advance(be.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(this._pluginInput,...Le),this._rctx.clear(Re.DEPTH),this._renderHUDElements(v.Both)}get _needsShadowAccumulation(){return this._shadowAccumulator.accumulating}_renderShadowAccumulation(e,t,r){this._needsShadowAccumulation&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,e,t,r)&&this.performanceInfo.advance(be.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&F(this._renderContext.output)?(this._bindParameters.oitPass=te.ColorAlpha,this._plugins.precompile(...ye),this._bindParameters.oitPass=te.FrontFace,this._plugins.precompile(...ye),this._bindParameters.oitPass=te.NONE):this._plugins.precompile(...ye)}_renderOIT(e,t,r=v.Both){const i=e===we.HUD,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=te.ColorAlpha;const d=a?"oit hud color+alpha":"oit color+alpha",_=this.fboCache.acquire(s.width,s.height,d,H.RGBA16F),l=t===U.ColorEmission;l&&_.acquireColor(Se,H.RGBA16F,"emissive"),_.acquireColor(l?Ie:Se,H.R16F),a||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),l&&this._rctx.gl.clearBufferfv(this._rctx.gl.COLOR,1,S),n(),_.detachDepth(),h.oitPass=te.FrontFace;const p=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return l&&p.acquireColor(Se,H.RGBA16F,"emissive"),a?p.acquireDepth(y.DEPTH16_BUFFER):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,!!a),n(),p.detachDepth(),h.oitPass=te.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(Re.COLOR)):this._framebuffer.bind(),this._oitblend??=new W(this._techniques),this._oitblend.blend(this._rctx,_,p,h,l),a?.detachDepth(),p.release(),_.release(),this._renderContext.output=o,a}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(be.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(this._pluginInput,de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),this.performanceInfo.advance(be.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(this._pluginInput,e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}_blitFBO(e,t=L,r=!0){return this._blit??=new j(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=A:(T(Ue,this._bindParameters.camera.viewMatrix),T(Me,this._bindParameters.camera.projectionMatrix),E(Fe,Ue,Me),E(Fe,this._renderContext.lastFrameCamera.viewMatrix,Fe),E(Fe,this._renderContext.lastFrameCamera.projectionMatrix,Fe),this._reprojectionMatrix=Fe);const t=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=A,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(X.UPDATE)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}}var we;e([f({readOnly:!0})],Ce.prototype,"fullResolutionAtmosphere",null),e([f()],Ce.prototype,"_edgeView",void 0),e([f()],Ce.prototype,"updating",null),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(we||(we={}));const De=[de.INTEGRATED_MESH,de.OPAQUE_TERRAIN,de.OPAQUE_MATERIAL,de.TRANSPARENT_MATERIAL],Oe=[de.OPAQUE_MATERIAL_WITHOUT_NORMALS,de.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],Ne=[de.INTEGRATED_MESH,de.OPAQUE_TERRAIN,de.OPAQUE_MATERIAL,de.OPAQUE_MATERIAL_WITHOUT_NORMALS],ye=[de.TRANSPARENT_MATERIAL,de.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],He=[de.OPAQUE_MATERIAL,de.TRANSPARENT_MATERIAL,de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH],xe=[de.LINE_CALLOUTS_HUD_DEPTH,de.HUD_MATERIAL,de.LABEL_MATERIAL],Le=[de.TRANSPARENT_MATERIAL,de.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,de.OPAQUE_MATERIAL,de.OPAQUE_MATERIAL_WITHOUT_NORMALS,de.TRANSPARENT_TERRAIN,de.INTEGRATED_MESH,de.OPAQUE_TERRAIN],Me=P(),Ue=P(),Fe=P();function ve(e){return t=>e.immediate.schedule(t)}export{Ce as Renderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- var e;function E(E){return E===e.POSITION}!function(e){e.POSITION="position",e.NORMAL="normal",e.NORMALCOMPRESSED="normalCompressed",e.UV0="uv0",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.ROTATION="rotation",e.TANGENT="tangent",e.OFFSET="offset",e.PERSPECTIVEDIVIDE="perspectiveDivide",e.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",e.LENGTH="length",e.PREVPOSITION="prevPosition",e.NEXTPOSITION="nextPosition",e.SUBDIVISIONFACTOR="subdivisionFactor",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.FEATUREVALUE="featureValue",e.INSTANCEMODELORIGINHI="instanceModelOriginHi",e.INSTANCEMODELORIGINLO="instanceModelOriginLo",e.INSTANCEMODEL="instanceModel",e.INSTANCEMODELNORMAL="instanceModelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMAL2COMPRESSED="normal2Compressed",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.START_UP="startUp",e.END_UP="endUp",e.EXTRUDE="extrude",e.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",e.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(e||(e={}));export{e as VertexAttribute,E as affectsGeometry};
5
+ var e;function E(E){return E===e.POSITION}!function(e){e.POSITION="position",e.NORMAL="normal",e.NORMALCOMPRESSED="normalCompressed",e.UV0="uv0",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.ROTATION="rotation",e.TANGENT="tangent",e.OFFSET="offset",e.PERSPECTIVEDIVIDE="perspectiveDivide",e.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",e.LENGTH="length",e.PREVPOSITION="prevPosition",e.NEXTPOSITION="nextPosition",e.SUBDIVISIONFACTOR="subdivisionFactor",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.PROFILEAUXDATA="profileAuxData",e.FEATUREVALUE="featureValue",e.INSTANCEMODELORIGINHI="instanceModelOriginHi",e.INSTANCEMODELORIGINLO="instanceModelOriginLo",e.INSTANCEMODEL="instanceModel",e.INSTANCEMODELNORMAL="instanceModelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMAL2COMPRESSED="normal2Compressed",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.START_UP="startUp",e.END_UP="endUp",e.EXTRUDE="extrude",e.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",e.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(e||(e={}));export{e as VertexAttribute,E as affectsGeometry};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{i as e,I as t,t as r}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as a,isColor as n,isDepth as o,isColorHighlightOrDepth as h,isColorOrColorEmission as c}from"../core/shaderLibrary/ShaderOutput.js";import p from"../lib/GLMaterial.js";import{Material as m,RenderOccludedFlag as l}from"../lib/Material.js";import{RenderSlot as u}from"../lib/RenderSlot.js";import{VertexAttribute as T}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as d}from"./VisualVariablePassParameters.js";import{vertexAttributeLocations as f,LineMarkerTechnique as A}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as v,LineMarkerSpace as _,LineMarkerAnchor as E}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as g}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as O}from"../../../../webscene/support/AlphaCutoff.js";class S extends m{constructor(e){super(e,I),this._configuration=new v,this.vertexAttributeLocations=f,this.produces=new Map([[u.OPAQUE_MATERIAL,e=>e===a.Highlight||n(e)&&this.parameters.renderOccluded===l.OccludeAndTransparentStencil],[u.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>o(e)],[u.OCCLUDER_MATERIAL,e=>h(e)&&this.parameters.renderOccluded===l.OccludeAndTransparentStencil],[u.TRANSPARENT_OCCLUDER_MATERIAL,e=>h(e)&&this.parameters.renderOccluded===l.OccludeAndTransparentStencil],[u.TRANSPARENT_MATERIAL,e=>n(e)&&this.parameters.writeDepth],[u.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>n(e)&&!this.parameters.writeDepth],[u.DRAPED_MATERIAL,e=>c(e)||e===a.Highlight]]),this._layout=this.createLayout()}getConfiguration(e,t){return this._configuration.output=e,this._configuration.space=t.slot===u.DRAPED_MATERIAL?_.Draped:this.parameters.worldSpace?_.World:_.Screen,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==g.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=t.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.occluder=this.parameters.renderOccluded===l.OccludeAndTransparentStencil,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest&&c(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}get visible(){return this.parameters.color[3]>=O}intersect(){}createLayout(){const e=s().vec3f(T.POSITION).vec3f(T.PREVPOSITION).vec2f(T.UV0);return this.parameters.worldSpace&&e.vec3f(T.NORMAL),this.parameters.vvSize?e.f32(T.SIZEFEATUREATTRIBUTE):e.f32(T.SIZE),this.parameters.vvColor?e.f32(T.COLORFEATUREATTRIBUTE):e.vec4f(T.COLOR),this.parameters.vvOpacity&&e.f32(T.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new L(this._layout,this.parameters)}createGLMaterial(e){return new R(e)}}class R extends p{constructor(){super(...arguments),this._markerPrimitive=null}dispose(){super.dispose(),this._markerTextures.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(A,e)}}class I extends d{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=g.BUTT,this.anchor=E.Center,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.markerTexture=null}}class L{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,s,a,n,o,h){const c=a.get(T.POSITION).data,p=c.length/3;let m=[1,0,0];const l=a.get(T.NORMAL);this._parameters.worldSpace&&null!=l&&(m=l.data);let u=1,d=0;this._parameters.vvSize?d=a.get(T.SIZEFEATUREATTRIBUTE).data[0]:a.has(T.SIZE)&&(u=a.get(T.SIZE).data[0]);let f=[1,1,1,1],A=0;this._parameters.vvColor?A=a.get(T.COLORFEATUREATTRIBUTE).data[0]:a.has(T.COLOR)&&(f=a.get(T.COLOR).data);let v=0;this._parameters.vvOpacity&&(v=a.get(T.OPACITYFEATUREATTRIBUTE).data[0]);const _=new Float32Array(o.buffer);let E=h*(this.vertexBufferLayout.stride/4);const g=(e,t,r,i)=>{if(_[E++]=e[0],_[E++]=e[1],_[E++]=e[2],_[E++]=t[0],_[E++]=t[1],_[E++]=t[2],_[E++]=r[0],_[E++]=r[1],this._parameters.worldSpace&&(_[E++]=m[0],_[E++]=m[1],_[E++]=m[2]),this._parameters.vvSize?_[E++]=d:_[E++]=u,this._parameters.vvColor)_[E++]=A;else{const e=Math.min(4*i,f.length-4);_[E++]=f[e],_[E++]=f[e+1],_[E++]=f[e+2],_[E++]=f[e+3]}this._parameters.vvOpacity&&(_[E++]=v)};let O;!function(e){e[e.ASCENDING=1]="ASCENDING",e[e.DESCENDING=-1]="DESCENDING"}(O||(O={}));const S=(s,a)=>{const n=e(P,c[3*s],c[3*s+1],c[3*s+2]),o=C;let h=s+a;do{e(o,c[3*h],c[3*h+1],c[3*h+2]),h+=a}while(t(n,o)&&h>=0&&h<p);i&&(r(n,n,i),r(o,o,i)),g(n,o,[-1,-1],s),g(n,o,[1,-1],s),g(n,o,[1,1],s),g(n,o,[-1,-1],s),g(n,o,[1,1],s),g(n,o,[-1,1],s)},R=this._parameters.placement;return"begin"!==R&&"begin-end"!==R||S(0,O.ASCENDING),"end"!==R&&"begin-end"!==R||S(p-1,O.DESCENDING),null}}const P=i(),C=i();export{S as LineMarkerMaterial,I as Parameters};
5
+ import{i as e,I as t,t as r}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as s,isColor as n,isDepth as o,isColorHighlightOrDepth as h,isColorOrColorEmission as c}from"../core/shaderLibrary/ShaderOutput.js";import p from"../lib/GLMaterial.js";import{Material as m,RenderOccludedFlag as l}from"../lib/Material.js";import{RenderSlot as u}from"../lib/RenderSlot.js";import{VertexAttribute as T}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as d}from"./VisualVariablePassParameters.js";import{vertexAttributeLocations as f,LineMarkerTechnique as A}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as v,LineMarkerSpace as _,LineMarkerAnchor as E}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as g}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as O}from"../../../../webscene/support/AlphaCutoff.js";class S extends m{constructor(e){super(e,I),this._configuration=new v,this.vertexAttributeLocations=f,this.produces=new Map([[u.OPAQUE_MATERIAL,e=>e===s.Highlight||n(e)&&this.parameters.renderOccluded===l.OccludeAndTransparentStencil],[u.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>o(e)],[u.OCCLUDER_MATERIAL,e=>h(e)&&this.parameters.renderOccluded===l.OccludeAndTransparentStencil],[u.TRANSPARENT_OCCLUDER_MATERIAL,e=>h(e)&&this.parameters.renderOccluded===l.OccludeAndTransparentStencil],[u.TRANSPARENT_MATERIAL,e=>n(e)&&this.parameters.writeDepth],[u.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>n(e)&&!this.parameters.writeDepth],[u.DRAPED_MATERIAL,e=>c(e)||e===s.Highlight]]),this._layout=this.createLayout()}getConfiguration(e,t){return this._configuration.output=e,this._configuration.space=t.slot===u.DRAPED_MATERIAL?_.Draped:this.parameters.worldSpace?_.World:_.Screen,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==g.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=t.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.occluder=this.parameters.renderOccluded===l.OccludeAndTransparentStencil,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest&&c(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}get visible(){return this.parameters.color[3]>=O}intersect(){}createLayout(){const e=a().vec3f(T.POSITION).vec3f(T.PREVPOSITION).vec2f(T.UV0);return this.parameters.worldSpace&&e.vec3f(T.NORMAL),this.parameters.vvSize?e.f32(T.SIZEFEATUREATTRIBUTE):e.f32(T.SIZE),this.parameters.vvColor?e.f32(T.COLORFEATUREATTRIBUTE):e.vec4u8(T.COLOR),this.parameters.vvOpacity&&e.f32(T.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new L(this._layout,this.parameters)}createGLMaterial(e){return new R(e)}}class R extends p{constructor(){super(...arguments),this._markerPrimitive=null}dispose(){super.dispose(),this._markerTextures.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(A,e)}}class I extends d{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=g.BUTT,this.anchor=E.Center,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.markerTexture=null}}class L{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,a,s,n,o,h){const c=s.get(T.POSITION).data,p=c.length/3;let m=[1,0,0];const l=s.get(T.NORMAL);this._parameters.worldSpace&&null!=l&&(m=l.data);let u=1,d=0;this._parameters.vvSize?d=s.get(T.SIZEFEATUREATTRIBUTE).data[0]:s.has(T.SIZE)&&(u=s.get(T.SIZE).data[0]);let f=[1,1,1,1],A=0;this._parameters.vvColor?A=s.get(T.COLORFEATUREATTRIBUTE).data[0]:s.has(T.COLOR)&&(f=s.get(T.COLOR).data);let v=0;this._parameters.vvOpacity&&(v=s.get(T.OPACITYFEATUREATTRIBUTE).data[0]);const _=new Float32Array(o.buffer),E=new Uint8Array(o.buffer);let g=h*(this.vertexBufferLayout.stride/4);const O=(e,t,r,i)=>{if(_[g++]=e[0],_[g++]=e[1],_[g++]=e[2],_[g++]=t[0],_[g++]=t[1],_[g++]=t[2],_[g++]=r[0],_[g++]=r[1],this._parameters.worldSpace&&(_[g++]=m[0],_[g++]=m[1],_[g++]=m[2]),this._parameters.vvSize?_[g++]=d:_[g++]=u,this._parameters.vvColor)_[g++]=A;else{const e=Math.min(4*i,f.length-4),t=4*g;g++,E[t]=f[e],E[t+1]=f[e+1],E[t+2]=f[e+2],E[t+3]=f[e+3]}this._parameters.vvOpacity&&(_[g++]=v)};let S;!function(e){e[e.ASCENDING=1]="ASCENDING",e[e.DESCENDING=-1]="DESCENDING"}(S||(S={}));const R=(a,s)=>{const n=e(P,c[3*a],c[3*a+1],c[3*a+2]),o=C;let h=a+s;do{e(o,c[3*h],c[3*h+1],c[3*h+2]),h+=s}while(t(n,o)&&h>=0&&h<p);i&&(r(n,n,i),r(o,o,i)),O(n,o,[-1,-1],a),O(n,o,[1,-1],a),O(n,o,[1,1],a),O(n,o,[-1,-1],a),O(n,o,[1,1],a),O(n,o,[-1,1],a)},I=this._parameters.placement;return"begin"!==I&&"begin-end"!==I||R(0,S.ASCENDING),"end"!==I&&"begin-end"!==I||R(p-1,S.DESCENDING),null}}const P=i(),C=i();export{S as LineMarkerMaterial,I as Parameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as e}from"../../../../core/mathUtils.js";import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as i}from"../../../../chunks/vec32.js";import{ZEROS as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as s}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as o,is3DGeometryOutputMRT as n,isColorOrColorEmission as c,ShaderOutput as h}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as u}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as m}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as p}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as f}from"../effects/geometry/olidUtils.js";import l from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as _}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as y}from"./DefaultBufferWriter.js";import{vertexAttributeLocations as j,PathTechnique as A,PathPassParameters as O}from"./PathTechnique.js";import{PathTechniqueConfiguration as P}from"./PathTechniqueConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class L extends d{constructor(e,t){super(e,M),this._vertexBufferLayout=T(),this.vertexAttributeLocations=j,this.supportsEdges=!0,this.produces=new Map([[S.OPAQUE_MATERIAL,e=>(this.parameters.castShadows&&o(e)||n(e))&&!this.transparent],[S.TRANSPARENT_MATERIAL,e=>(this.parameters.castShadows&&o(e)||n(e))&&this.transparent]]),this._configuration=new P(t.spherical)}get hasEmissions(){return!i(this.parameters.emissiveFactor,r)}getConfiguration(e,t){return this._configuration.output=e,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,c(e)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?m.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?m.WindingOrder:m.None,this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?p.Schematic:p.Disabled,this._configuration.emissionSource=this.parameters.usePBR?u.Value:u.None,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}isVisibleForOutput(e){return e!==h.Shadow&&e!==h.ShadowExcludeHighlight&&e!==h.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=R}intersect(i,r,a,o,n,c){const h=i;if(!b(h))return;const u=h.path,m=t(this.parameters.size);if(this.parameters.vvSize){const{offset:t,factor:i,minSize:r,maxSize:s,fallback:a}=this.parameters.vvSize,o=u.sizeAttributeValue;Number.isNaN(o)?(m[0]*=a[0],m[1]*=a[2]):(m[0]*=e(t[0]+o*i[0],r[0],s[0]),m[1]*=e(t[2]+o*i[2],r[2],s[2]))}const p=new g(!1,a.options.normalRequired),f=Math.max(m[0],m[1]),l=i.boundingInfo;if(null==l)return void E(u,m,o,n,p,c);const d=s(l.bbMin[0]-f,l.bbMin[1]-f,l.bbMin[2]-f,l.bbMax[0]+f,l.bbMax[1]+f,l.bbMax[2]+f),S=[n[0]-o[0],n[1]-o[1],n[2]-o[2]],_=Math.sqrt(S[0]*S[0]+S[1]*S[1]+S[2]*S[2]),y=[_/S[0],_/S[1],_/S[2]];v(d,o,y,a.tolerance)&&E(u,m,o,n,p,c)}createBufferWriter(){return new y(this._vertexBufferLayout)}createGLMaterial(e){return new w(e)}get transparent(){const{parameters:e}=this;return e.drivenOpacity||e.opacity<1}}function T(){const e=a().vec3f(_.POSITION).vec4f(_.PROFILERIGHT).vec4f(_.PROFILEUP).vec4f(_.PROFILEVERTEXANDNORMAL).vec4f(_.FEATUREVALUE);return f()&&e.vec4u8(_.OBJECTANDLAYERIDCOLOR),e}class w extends l{beginSlot(e){return this.getTechnique(A,e)}}function E(e,t,i,r,s,a){e.baked.size&&e.baked.size[0]===t[0]&&e.baked.size[1]===t[1]||e.baked.bake(t),e.baked.intersect(i,r,s,a)}class M extends O{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{M as Parameters,L as PathMaterial};
5
+ import{clamp as e}from"../../../../core/mathUtils.js";import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as i}from"../../../../chunks/vec32.js";import{ZEROS as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as s}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as o,is3DGeometryOutputMRT as n,isColorOrColorEmission as c,ShaderOutput as h}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as u}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as m}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as l}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as p}from"../effects/geometry/olidUtils.js";import f from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as A}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as _}from"./DefaultBufferWriter.js";import{vertexAttributeLocations as y,PathTechnique as O,PathPassParameters as j}from"./PathTechnique.js";import{PathTechniqueConfiguration as P}from"./PathTechniqueConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class L extends d{constructor(e,t){super(e,M),this._vertexBufferLayout=T(),this.vertexAttributeLocations=y,this.supportsEdges=!0,this.produces=new Map([[S.OPAQUE_MATERIAL,e=>(this.parameters.castShadows&&o(e)||n(e))&&!this.transparent],[S.TRANSPARENT_MATERIAL,e=>(this.parameters.castShadows&&o(e)||n(e))&&this.transparent]]),this._configuration=new P(t.spherical)}get hasEmissions(){return!i(this.parameters.emissiveFactor,r)}getConfiguration(e,t){return this._configuration.output=e,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,c(e)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?m.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?m.WindingOrder:m.None,this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?l.Schematic:l.Disabled,this._configuration.emissionSource=this.parameters.usePBR?u.Value:u.None,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}isVisibleForOutput(e){return e!==h.Shadow&&e!==h.ShadowExcludeHighlight&&e!==h.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=R}intersect(i,r,a,o,n,c){const h=i;if(!b(h))return;const u=h.path,m=t(this.parameters.size);if(this.parameters.vvSize){const{offset:t,factor:i,minSize:r,maxSize:s,fallback:a}=this.parameters.vvSize,o=u.sizeAttributeValue;Number.isNaN(o)?(m[0]*=a[0],m[1]*=a[2]):(m[0]*=e(t[0]+o*i[0],r[0],s[0]),m[1]*=e(t[2]+o*i[2],r[2],s[2]))}const l=new g(!1,a.options.normalRequired),p=Math.max(m[0],m[1]),f=i.boundingInfo;if(null==f)return void w(u,m,o,n,l,c);const d=s(f.bbMin[0]-p,f.bbMin[1]-p,f.bbMin[2]-p,f.bbMax[0]+p,f.bbMax[1]+p,f.bbMax[2]+p),S=[n[0]-o[0],n[1]-o[1],n[2]-o[2]],A=Math.sqrt(S[0]*S[0]+S[1]*S[1]+S[2]*S[2]),_=[A/S[0],A/S[1],A/S[2]];v(d,o,_,a.tolerance)&&w(u,m,o,n,l,c)}createBufferWriter(){return new _(this._vertexBufferLayout)}createGLMaterial(e){return new E(e)}get transparent(){const{parameters:e}=this;return e.drivenOpacity||e.opacity<1}}function T(){const e=a().vec3f(A.POSITION).vec4f(A.PROFILEVERTEXANDNORMAL).vec4f(A.FEATUREVALUE).vec2f(A.PROFILEAUXDATA).vec2i16(A.PROFILERIGHT,{glNormalized:!0}).vec2i16(A.PROFILEUP,{glNormalized:!0});return p()&&e.vec4u8(A.OBJECTANDLAYERIDCOLOR),e}class E extends f{beginSlot(e){return this.getTechnique(O,e)}}function w(e,t,i,r,s,a){e.baked.size&&e.baked.size[0]===t[0]&&e.baked.size[1]===t[1]||e.baked.bake(t),e.baked.intersect(i,r,s,a)}class M extends j{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{M as Parameters,L as PathMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{freeze as r,create as e,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColorOrColorEmission as t,ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as o}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as l}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as n}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as m}from"../lib/OITPass.js";import{blending as c,oitDepthTest as p,getDrawBuffers as u,OITPolygonOffset as h}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as d,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{advancedMRRFactors as O}from"./pbrUtils.js";import{P as j}from"../../../../chunks/Path.glsl.js";import{SpecialDrawBuffers as P}from"../../../webgl/enums.js";import{makePipelineState as T,frontFaceCullingParams as g,defaultDepthWrite as E,defaultColorWrite as L}from"../../../webgl/renderState.js";class N extends o{constructor(){super(...arguments),this.ambient=r(.2,.2,.2),this.diffuse=r(.8,.8,.8),this.specular=r(0,0,0),this.opacity=1,this.origin=e(),this.modelTransformation=null,this.mrrFactors=O,this.emissiveFactor=s}}class R extends a{constructor(r,e){super(r,e,new n(j,(()=>import("../shaders/Path.glsl.js"))),I)}initializePipeline(r){const{output:e,transparent:s,hasSlicePlane:o,doubleSidedMode:n,hasOccludees:a,oitPass:b}=r,O=b===m.NONE,j=b===m.FrontFace;return T({blending:t(e)&&s?c(b):null,culling:o&&!s&&n!==l.None?g:null,depthTest:{func:p(b)},depthWrite:O||j?E:null,drawBuffers:e===i.Depth?{buffers:[P.NONE]}:u(b,e),colorWrite:L,stencilWrite:a?d:null,stencilTest:a?f:null,polygonOffset:O||j?null:h})}}const I=new Map([[b.POSITION,0],[b.PROFILERIGHT,1],[b.PROFILEUP,2],[b.PROFILEVERTEXANDNORMAL,3],[b.FEATUREVALUE,4],[b.OBJECTANDLAYERIDCOLOR,5]]);export{N as PathPassParameters,R as PathTechnique,I as vertexAttributeLocations};
5
+ import{freeze as r,create as e,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColorOrColorEmission as t,ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as o}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as l}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as n}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as m}from"../lib/OITPass.js";import{blending as c,oitDepthTest as p,getDrawBuffers as u,OITPolygonOffset as h}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as d,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{advancedMRRFactors as O}from"./pbrUtils.js";import{P as j}from"../../../../chunks/Path.glsl.js";import{SpecialDrawBuffers as P}from"../../../webgl/enums.js";import{makePipelineState as T,frontFaceCullingParams as E,defaultDepthWrite as g,defaultColorWrite as L}from"../../../webgl/renderState.js";class R extends o{constructor(){super(...arguments),this.ambient=r(.2,.2,.2),this.diffuse=r(.8,.8,.8),this.specular=r(0,0,0),this.opacity=1,this.origin=e(),this.modelTransformation=null,this.mrrFactors=O,this.emissiveFactor=s}}class A extends a{constructor(r,e){super(r,e,new n(j,(()=>import("../shaders/Path.glsl.js"))),I)}initializePipeline(r){const{output:e,transparent:s,hasSlicePlane:o,doubleSidedMode:n,hasOccludees:a,oitPass:b}=r,O=b===m.NONE,j=b===m.FrontFace;return T({blending:t(e)&&s?c(b):null,culling:o&&!s&&n!==l.None?E:null,depthTest:{func:p(b)},depthWrite:O||j?g:null,drawBuffers:e===i.Depth?{buffers:[P.NONE]}:u(b,e),colorWrite:L,stencilWrite:a?d:null,stencilTest:a?f:null,polygonOffset:O||j?null:h})}}const I=new Map([[b.POSITION,0],[b.PROFILEVERTEXANDNORMAL,1],[b.FEATUREVALUE,2],[b.PROFILEAUXDATA,3],[b.PROFILERIGHT,4],[b.PROFILEUP,5],[b.OBJECTANDLAYERIDCOLOR,6]]);export{R as PathPassParameters,A as PathTechnique,I as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,f as n,h as o,g as l,c,l as p,j as h,t as u}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{PlaneIndex as T}from"../../../../geometry/support/frustum.js";import{create as d,distance2 as _,fromPoints as E,closestLineSegmentPoint as A}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as O,signedDistance as g,getNormal as S}from"../../../../geometry/support/plane.js";import{newLayout as I}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as v,isColorOrColorEmission as N,isDepth as P,isColorEmissionHighlightOIDOrDepth as L,is2DGeometryOutput as b,ShaderOutput as C}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as U}from"../effects/geometry/olidUtils.js";import y from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as j}from"../lib/Material.js";import{RenderSlot as F}from"../lib/RenderSlot.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{VertexAttribute as M}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as B}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as J}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as z,RibbonLineTechnique as H}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as G,CapType as k}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as V}from"../../../../webscene/support/AlphaCutoff.js";var Z;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Z||(Z={}));class W extends D{constructor(e){super(e,q),this._configuration=new G,this.vertexAttributeLocations=z,this.produces=new Map([[F.OPAQUE_MATERIAL,e=>v(e)||N(e)&&this.parameters.renderOccluded===j.OccludeAndTransparentStencil],[F.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>P(e)],[F.OCCLUDER_MATERIAL,e=>L(e)&&this.parameters.renderOccluded===j.OccludeAndTransparentStencil],[F.TRANSPARENT_OCCLUDER_MATERIAL,e=>L(e)&&this.parameters.renderOccluded===j.OccludeAndTransparentStencil],[F.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==j.OccludeAndTransparentStencil],[F.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==j.OccludeAndTransparentStencil],[F.DRAPED_MATERIAL,e=>b(e)]])}getConfiguration(e,t){this._configuration.output=e,this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===F.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==C.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&$(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===j.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=V||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>V}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n,o){if(!s.options.selectionMode)return;const l=e.get(M.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.get(M.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?c*=this.parameters.vvSize.fallback[0]:c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const p=a[0],h=a[1],u=(c/2+4)*r;let m=Number.MAX_VALUE,f=0;const T=e.get(M.POSITION).data,d=K(this.parameters,e)?T.length-2:T.length-5;for(let _=0;_<d;_+=3){const e=T[_],r=T[_+1],i=(_+3)%T.length,s=p-e,a=h-r,n=T[i]-e,o=T[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),c=n*l-s,u=o*l-a,d=c*c+u*u;d<m&&(m=d,f=_/3)}m<u*u&&n(o.dist,o.normal,f,!1)}intersect(r,u,m,f,d,R){if(!m.options.selectionMode||!r.visible)return;if(!w(u))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const I=r.attributes,v=I.get(M.POSITION).data;let N=this.parameters.width;if(this.parameters.vvSize){const e=I.get(M.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(N*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else I.has(M.SIZE)&&(N*=I.get(M.SIZE).data[0]);const P=m.camera,L=se;i(L,m.point);const b=N*P.pixelRatio/2+4*P.pixelRatio;s(fe[0],L[0]-b,L[1]+b,0),s(fe[1],L[0]+b,L[1]+b,0),s(fe[2],L[0]+b,L[1]-b,0),s(fe[3],L[0]-b,L[1]-b,0);for(let e=0;e<4;e++)if(!P.unprojectFromRenderScreen(fe[e],Te[e]))return;O(P.eye,Te[0],Te[1],de),O(P.eye,Te[1],Te[2],_e),O(P.eye,Te[2],Te[3],Ee),O(P.eye,Te[3],Te[0],Ae);let C=Number.MAX_VALUE,U=0;const y=K(this.parameters,I)?v.length-2:v.length-5;for(let e=0;e<y;e+=3){ee[0]=v[e]+u[12],ee[1]=v[e+1]+u[13],ee[2]=v[e+2]+u[14];const t=(e+3)%v.length;if(te[0]=v[t]+u[12],te[1]=v[t+1]+u[13],te[2]=v[t+2]+u[14],g(de,ee)<0&&g(de,te)<0||g(_e,ee)<0&&g(_e,te)<0||g(Ee,ee)<0&&g(Ee,te)<0||g(Ae,ee)<0&&g(Ae,te)<0)continue;if(P.projectToRenderScreen(ee,ae),P.projectToRenderScreen(te,ne),ae[2]<0&&ne[2]>0){a(re,ee,te);const e=P.frustum,t=-g(e[T.NEAR],ee)/n(re,S(e[T.NEAR]));o(re,re,t),l(ee,ee,re),P.projectToRenderScreen(ee,ae)}else if(ae[2]>0&&ne[2]<0){a(re,te,ee);const e=P.frustum,t=-g(e[T.NEAR],te)/n(re,S(e[T.NEAR]));o(re,re,t),l(te,te,re),P.projectToRenderScreen(te,ne)}else if(ae[2]<0&&ne[2]<0)continue;ae[2]=0,ne[2]=0;const r=_(E(ae,ne,ce),L);r<C&&(C=r,c(oe,ee),c(le,te),U=e/3)}const D=m.rayBegin,j=m.rayEnd;if(C<b*b){let e=Number.MAX_VALUE;if(A(E(oe,le,ce),E(D,j,pe),ie)){a(ie,ie,D);const t=p(ie);o(ie,ie,1/t),e=t/h(D,j)}R(e,ie,U,!1)}}get _layout(){const e=I().vec3f(M.POSITION).vec3f(M.PREVPOSITION).vec3f(M.NEXTPOSITION).f32(M.SUBDIVISIONFACTOR).vec2f(M.UV0);return this.parameters.vvSize?e.f32(M.SIZEFEATUREATTRIBUTE):e.f32(M.SIZE),this.parameters.vvColor?e.f32(M.COLORFEATUREATTRIBUTE):e.vec4f(M.COLOR),this.parameters.vvOpacity&&e.f32(M.OPACITYFEATUREATTRIBUTE),U()&&e.vec4u8(M.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new X(this._layout,this.parameters)}createGLMaterial(e){return new Y(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class Y extends y{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(H,e)}}class q extends x{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=k.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class X{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t,this.numJoinSubdivisions=0;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=J+r}}_isClosed(e){return K(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(M.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=he,l=ue,p=me,m=r.get(M.POSITION),f=m.indices,T=m.data.length/3,d=r.get(M.DISTANCETOSTART)?.data;f&&f.length!==2*(T-1)&&console.warn("RibbonLineMaterial does not support indices");const _=r.get(M.SIZEFEATUREATTRIBUTE)?.data[0]??r.get(M.SIZE)?.data[0]??1;let E=[1,1,1,1],A=0;const R=this.vertexBufferLayout.fields.has(M.COLORFEATUREATTRIBUTE);R?A=r.get(M.COLORFEATUREATTRIBUTE).data[0]:r.has(M.COLOR)&&(E=r.get(M.COLOR).data);const O=this.vertexBufferLayout.fields.has(M.OPACITYFEATUREATTRIBUTE),g=O?r.get(M.OPACITYFEATUREATTRIBUTE).data[0]:0,S=new Float32Array(a.buffer),I=U()?new Uint8Array(a.buffer):null,v=this.vertexBufferLayout.stride/4;let N=n*v;const P=N;let L=0;const b=d?(e,t,r)=>L=d[r]:(e,t,r)=>L+=h(e,t),C=(e,t,r,s,a,n,o)=>{if(S[N++]=t[0],S[N++]=t[1],S[N++]=t[2],S[N++]=e[0],S[N++]=e[1],S[N++]=e[2],S[N++]=r[0],S[N++]=r[1],S[N++]=r[2],S[N++]=s,S[N++]=o,S[N++]=a,S[N++]=_,R)S[N++]=A;else{const e=Math.min(4*n,E.length-4);S[N++]=E[e],S[N++]=E[e+1],S[N++]=E[e+2],S[N++]=E[e+3]}O&&(S[N++]=g),U()&&(i&&(I[4*N]=i[0],I[4*N+1]=i[1],I[4*N+2]=i[2],I[4*N+3]=i[3]),N++)};N+=v,s(l,m.data[0],m.data[1],m.data[2]),e&&u(l,l,e);const y=this._isClosed(r);if(y){const t=m.data.length-3;s(o,m.data[t],m.data[t+1],m.data[t+2]),e&&u(o,o,e)}else s(p,m.data[3],m.data[4],m.data[5]),e&&u(p,p,e),C(l,l,p,1,Z.LEFT_CAP_START,0,0),C(l,l,p,1,Z.RIGHT_CAP_START,0,0),c(o,l),c(l,p);const D=y?0:1,j=y?T:T-1;for(let h=D;h<j;h++){const t=(h+1)%T*3;s(p,m.data[t],m.data[t+1],m.data[t+2]),e&&u(p,p,e),b(o,l,h),C(o,l,p,0,Z.LEFT_JOIN_END,h,L),C(o,l,p,0,Z.RIGHT_JOIN_END,h,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);C(o,l,p,t,Z.LEFT_JOIN_END,h,L),C(o,l,p,t,Z.RIGHT_JOIN_END,h,L)}C(o,l,p,1,Z.LEFT_JOIN_START,h,L),C(o,l,p,1,Z.RIGHT_JOIN_START,h,L),c(o,l),c(l,p)}y?(s(p,m.data[3],m.data[4],m.data[5]),e&&u(p,p,e),L=b(o,l,j),C(o,l,p,0,Z.LEFT_JOIN_END,D,L),C(o,l,p,0,Z.RIGHT_JOIN_END,D,L)):(L=b(o,l,j),C(o,l,l,0,Z.LEFT_CAP_END,j,L),C(o,l,l,0,Z.RIGHT_CAP_END,j,L)),Q(S,P+v,S,P,v);return N=Q(S,N-v,S,N,v),this._parameters.wireframe&&this._addWireframeVertices(a,P,N,v),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=Q(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function Q(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function K(e,t){if(!e.isClosed)return!1;return t.get(M.POSITION).indices.length>2}function $(e){return e.anchor===B.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const ee=m(),te=m(),re=m(),ie=m(),se=m(),ae=r(),ne=r(),oe=m(),le=m(),ce=d(),pe=d(),he=m(),ue=m(),me=m(),fe=[r(),r(),r(),r()],Te=[m(),m(),m(),m()],de=R(),_e=R(),Ee=R(),Ae=R();export{q as Parameters,W as RibbonLineMaterial};
5
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as a,f as n,h as o,g as l,c,l as p,j as h,t as u}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{PlaneIndex as T}from"../../../../geometry/support/frustum.js";import{create as d,distance2 as _,fromPoints as E,closestLineSegmentPoint as A}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as O,signedDistance as g,getNormal as S}from"../../../../geometry/support/plane.js";import{newLayout as I}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as v,isColorOrColorEmission as N,isDepth as P,isColorEmissionHighlightOIDOrDepth as L,is2DGeometryOutput as b,ShaderOutput as C}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as U}from"../effects/geometry/olidUtils.js";import y from"../lib/GLMaterial.js";import{Material as D,RenderOccludedFlag as j}from"../lib/Material.js";import{RenderSlot as F}from"../lib/RenderSlot.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{VertexAttribute as M}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{LineMarkerAnchor as B}from"../shaders/LineMarkerTechniqueConfiguration.js";import{r as J}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as z,RibbonLineTechnique as H}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as G,CapType as k}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as V}from"../../../../webscene/support/AlphaCutoff.js";var Z;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(Z||(Z={}));class W extends D{constructor(e){super(e,q),this._configuration=new G,this.vertexAttributeLocations=z,this.produces=new Map([[F.OPAQUE_MATERIAL,e=>v(e)||N(e)&&this.parameters.renderOccluded===j.OccludeAndTransparentStencil],[F.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>P(e)],[F.OCCLUDER_MATERIAL,e=>L(e)&&this.parameters.renderOccluded===j.OccludeAndTransparentStencil],[F.TRANSPARENT_OCCLUDER_MATERIAL,e=>L(e)&&this.parameters.renderOccluded===j.OccludeAndTransparentStencil],[F.TRANSPARENT_MATERIAL,e=>N(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==j.OccludeAndTransparentStencil],[F.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>N(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==j.OccludeAndTransparentStencil],[F.DRAPED_MATERIAL,e=>b(e)]])}getConfiguration(e,t){this._configuration.output=e,this._configuration.oitPass=t.oitPass,this._configuration.draped=t.slot===F.DRAPED_MATERIAL;const r=null!=this.parameters.stipplePattern&&e!==C.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&$(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=t.hasOccludees,this._configuration.occluder=this.parameters.renderOccluded===j.OccludeAndTransparentStencil,this._configuration.terrainDepthTest=t.terrainDepthTest&&N(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration}get visible(){return this.parameters.color[3]>=V||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>V}intersectDraped({attributes:e,screenToWorldRatio:r},i,s,a,n,o){if(!s.options.selectionMode)return;const l=e.get(M.SIZE);let c=this.parameters.width;if(this.parameters.vvSize){const r=e.get(M.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(r)?c*=this.parameters.vvSize.fallback[0]:c*=t(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else l&&(c*=l.data[0]);const p=a[0],h=a[1],u=(c/2+4)*r;let m=Number.MAX_VALUE,f=0;const T=e.get(M.POSITION).data,d=K(this.parameters,e)?T.length-2:T.length-5;for(let _=0;_<d;_+=3){const e=T[_],r=T[_+1],i=(_+3)%T.length,s=p-e,a=h-r,n=T[i]-e,o=T[i+1]-r,l=t((n*s+o*a)/(n*n+o*o),0,1),c=n*l-s,u=o*l-a,d=c*c+u*u;d<m&&(m=d,f=_/3)}m<u*u&&n(o.dist,o.normal,f,!1)}intersect(r,u,m,f,d,R){if(!m.options.selectionMode||!r.visible)return;if(!w(u))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const I=r.attributes,v=I.get(M.POSITION).data;let N=this.parameters.width;if(this.parameters.vvSize){const e=I.get(M.SIZEFEATUREATTRIBUTE).data[0];Number.isNaN(e)||(N*=t(this.parameters.vvSize.offset[0]+e*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else I.has(M.SIZE)&&(N*=I.get(M.SIZE).data[0]);const P=m.camera,L=se;i(L,m.point);const b=N*P.pixelRatio/2+4*P.pixelRatio;s(fe[0],L[0]-b,L[1]+b,0),s(fe[1],L[0]+b,L[1]+b,0),s(fe[2],L[0]+b,L[1]-b,0),s(fe[3],L[0]-b,L[1]-b,0);for(let e=0;e<4;e++)if(!P.unprojectFromRenderScreen(fe[e],Te[e]))return;O(P.eye,Te[0],Te[1],de),O(P.eye,Te[1],Te[2],_e),O(P.eye,Te[2],Te[3],Ee),O(P.eye,Te[3],Te[0],Ae);let C=Number.MAX_VALUE,U=0;const y=K(this.parameters,I)?v.length-2:v.length-5;for(let e=0;e<y;e+=3){ee[0]=v[e]+u[12],ee[1]=v[e+1]+u[13],ee[2]=v[e+2]+u[14];const t=(e+3)%v.length;if(te[0]=v[t]+u[12],te[1]=v[t+1]+u[13],te[2]=v[t+2]+u[14],g(de,ee)<0&&g(de,te)<0||g(_e,ee)<0&&g(_e,te)<0||g(Ee,ee)<0&&g(Ee,te)<0||g(Ae,ee)<0&&g(Ae,te)<0)continue;if(P.projectToRenderScreen(ee,ae),P.projectToRenderScreen(te,ne),ae[2]<0&&ne[2]>0){a(re,ee,te);const e=P.frustum,t=-g(e[T.NEAR],ee)/n(re,S(e[T.NEAR]));o(re,re,t),l(ee,ee,re),P.projectToRenderScreen(ee,ae)}else if(ae[2]>0&&ne[2]<0){a(re,te,ee);const e=P.frustum,t=-g(e[T.NEAR],te)/n(re,S(e[T.NEAR]));o(re,re,t),l(te,te,re),P.projectToRenderScreen(te,ne)}else if(ae[2]<0&&ne[2]<0)continue;ae[2]=0,ne[2]=0;const r=_(E(ae,ne,ce),L);r<C&&(C=r,c(oe,ee),c(le,te),U=e/3)}const D=m.rayBegin,j=m.rayEnd;if(C<b*b){let e=Number.MAX_VALUE;if(A(E(oe,le,ce),E(D,j,pe),ie)){a(ie,ie,D);const t=p(ie);o(ie,ie,1/t),e=t/h(D,j)}R(e,ie,U,!1)}}get _layout(){const e=I().vec3f(M.POSITION).vec3f(M.PREVPOSITION).vec3f(M.NEXTPOSITION).f32(M.SUBDIVISIONFACTOR).vec2f(M.UV0);return this.parameters.vvSize?e.f32(M.SIZEFEATUREATTRIBUTE):e.f32(M.SIZE),this.parameters.vvColor?e.f32(M.COLORFEATUREATTRIBUTE):e.vec4u8(M.COLOR),this.parameters.vvOpacity&&e.f32(M.OPACITYFEATUREATTRIBUTE),U()&&e.vec4u8(M.OBJECTANDLAYERIDCOLOR),e}createBufferWriter(){return new X(this._layout,this.parameters)}createGLMaterial(e){return new Y(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}}class Y extends y{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(H,e)}}class q extends x{constructor(){super(...arguments),this.width=0,this.color=f,this.join="miter",this.cap=k.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1}get transparent(){return this.color[3]<1||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}}class X{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t,this.numJoinSubdivisions=0;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=J+r}}_isClosed(e){return K(this._parameters,e)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.get(M.POSITION).indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,a,n){const o=he,l=ue,p=me,m=r.get(M.POSITION),f=m.indices,T=m.data.length/3,d=r.get(M.DISTANCETOSTART)?.data;f&&f.length!==2*(T-1)&&console.warn("RibbonLineMaterial does not support indices");const _=r.get(M.SIZEFEATUREATTRIBUTE)?.data[0]??r.get(M.SIZE)?.data[0]??1;let E=[1,1,1,1],A=0;const R=this.vertexBufferLayout.fields.has(M.COLORFEATUREATTRIBUTE);R?A=r.get(M.COLORFEATUREATTRIBUTE).data[0]:r.has(M.COLOR)&&(E=r.get(M.COLOR).data);const O=this.vertexBufferLayout.fields.has(M.OPACITYFEATUREATTRIBUTE),g=O?r.get(M.OPACITYFEATUREATTRIBUTE).data[0]:0,S=new Float32Array(a.buffer),I=new Uint8Array(a.buffer),v=this.vertexBufferLayout.stride/4;let N=n*v;const P=N;let L=0;const b=d?(e,t,r)=>L=d[r]:(e,t,r)=>L+=h(e,t),C=(e,t,r,s,a,n,o)=>{if(S[N++]=t[0],S[N++]=t[1],S[N++]=t[2],S[N++]=e[0],S[N++]=e[1],S[N++]=e[2],S[N++]=r[0],S[N++]=r[1],S[N++]=r[2],S[N++]=s,S[N++]=o,S[N++]=a,S[N++]=_,R)S[N++]=A;else{const e=Math.min(4*n,E.length-4),t=4*N;N++,I[t]=E[e],I[t+1]=E[e+1],I[t+2]=E[e+2],I[t+3]=E[e+3]}if(O&&(S[N++]=g),U()){const e=4*N;N++,i&&(I[e]=i[0],I[e+1]=i[1],I[e+2]=i[2],I[e+3]=i[3])}};N+=v,s(l,m.data[0],m.data[1],m.data[2]),e&&u(l,l,e);const y=this._isClosed(r);if(y){const t=m.data.length-3;s(o,m.data[t],m.data[t+1],m.data[t+2]),e&&u(o,o,e)}else s(p,m.data[3],m.data[4],m.data[5]),e&&u(p,p,e),C(l,l,p,1,Z.LEFT_CAP_START,0,0),C(l,l,p,1,Z.RIGHT_CAP_START,0,0),c(o,l),c(l,p);const D=y?0:1,j=y?T:T-1;for(let h=D;h<j;h++){const t=(h+1)%T*3;s(p,m.data[t],m.data[t+1],m.data[t+2]),e&&u(p,p,e),b(o,l,h),C(o,l,p,0,Z.LEFT_JOIN_END,h,L),C(o,l,p,0,Z.RIGHT_JOIN_END,h,L);const r=this.numJoinSubdivisions;for(let e=0;e<r;++e){const t=(e+1)/(r+1);C(o,l,p,t,Z.LEFT_JOIN_END,h,L),C(o,l,p,t,Z.RIGHT_JOIN_END,h,L)}C(o,l,p,1,Z.LEFT_JOIN_START,h,L),C(o,l,p,1,Z.RIGHT_JOIN_START,h,L),c(o,l),c(l,p)}y?(s(p,m.data[3],m.data[4],m.data[5]),e&&u(p,p,e),L=b(o,l,j),C(o,l,p,0,Z.LEFT_JOIN_END,D,L),C(o,l,p,0,Z.RIGHT_JOIN_END,D,L)):(L=b(o,l,j),C(o,l,l,0,Z.LEFT_CAP_END,j,L),C(o,l,l,0,Z.RIGHT_CAP_END,j,L)),Q(S,P+v,S,P,v);return N=Q(S,N-v,S,N,v),this._parameters.wireframe&&this._addWireframeVertices(a,P,N,v),null}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=Q(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function Q(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function K(e,t){if(!e.isClosed)return!1;return t.get(M.POSITION).indices.length>2}function $(e){return e.anchor===B.Tip&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}const ee=m(),te=m(),re=m(),ie=m(),se=m(),ae=r(),ne=r(),oe=m(),le=m(),ce=d(),pe=d(),he=m(),ue=m(),me=m(),fe=[r(),r(),r(),r()],Te=[m(),m(),m(),m()],de=R(),_e=R(),Ee=R(),Ae=R();export{q as Parameters,W as RibbonLineMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{hasIdentityRotation as e,isOrthoNormal as t}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as f,BufferViewVec4f as r,BufferViewFloat as o,BufferViewVec2f as i,BufferViewVec2i16 as n,BufferViewVec3f as s}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as c}from"../../lib/Util.js";import{VertexAttribute as l}from"../../lib/VertexAttribute.js";function d(e,t,f,r=1){const{data:o,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===r)for(let l=0;l<c;++l)n[f]=o[i[l]],f+=s;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)n[f]=e,f+=s}}function u(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,n=t.typedBufferStride,s=o.length;f*=n;for(let c=0;c<s;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=n}}function a(e,t,f,r){const{data:o,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,null==r||1===r)for(let l=0;l<c;++l){const e=3*i[l];n[f]=o[e],n[f+1]=o[e+1],n[f+2]=o[e+2],f+=s}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)n[f]=o[e],n[f+1]=o[e+1],n[f+2]=o[e+2],f+=s}}function p(e,t,f,r=1){const{data:o,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===r)for(let l=0;l<c;++l){const e=4*i[l];n[f]=o[e],n[f+1]=o[e+1],n[f+2]=o[e+2],n[f+3]=o[e+3],f+=s}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)n[f]=o[e],n[f+1]=o[e+1],n[f+2]=o[e+2],n[f+3]=o[e+3],f+=s}}function B(e,t,f){const r=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let i=0;i<f;++i)r[t]=0,r[t+1]=0,r[t+2]=0,r[t+3]=0,t+=o}function y(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,n=t.typedBufferStride,s=o.length;f*=n;for(let c=0;c<s;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=n}}function g(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,n=t.typedBufferStride,s=o.length;f*=n;for(let c=0;c<s;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=n}}function O(t,f,r,o,i=1){if(!f)return void a(t,r,o,i);const{data:n,indices:s}=t,c=r.typedBuffer,l=r.typedBufferStride,d=s.length,u=f[0],p=f[1],B=f[2],y=f[4],g=f[5],O=f[6],b=f[8],h=f[9],m=f[10],S=f[12],N=f[13],R=f[14];o*=l;let E=0,I=0,F=0;const z=e(f)?e=>{E=n[e]+S,I=n[e+1]+N,F=n[e+2]+R}:e=>{const t=n[e],f=n[e+1],r=n[e+2];E=u*t+y*f+b*r+S,I=p*t+g*f+h*r+N,F=B*t+O*f+m*r+R};if(1===i)for(let e=0;e<d;++e)z(3*s[e]),c[o]=E,c[o+1]=I,c[o+2]=F,o+=l;else for(let e=0;e<d;++e){z(3*s[e]);for(let e=0;e<i;++e)c[o]=E,c[o+1]=I,c[o+2]=F,o+=l}}function b(f,r,o,i,n=1){if(!r)return void a(f,o,i,n);const{data:s,indices:c}=f,l=r,d=o.typedBuffer,u=o.typedBufferStride,p=c.length,B=l[0],y=l[1],g=l[2],O=l[4],b=l[5],h=l[6],m=l[8],S=l[9],N=l[10],R=!t(l),E=1e-6,I=1-E;i*=u;let F=0,z=0,A=0;const L=e(l)?e=>{F=s[e],z=s[e+1],A=s[e+2]}:e=>{const t=s[e],f=s[e+1],r=s[e+2];F=B*t+O*f+m*r,z=y*t+b*f+S*r,A=g*t+h*f+N*r};if(1===n)if(R)for(let e=0;e<p;++e){L(3*c[e]);const t=F*F+z*z+A*A;if(t<I&&t>E){const e=1/Math.sqrt(t);d[i]=F*e,d[i+1]=z*e,d[i+2]=A*e}else d[i]=F,d[i+1]=z,d[i+2]=A;i+=u}else for(let e=0;e<p;++e)L(3*c[e]),d[i]=F,d[i+1]=z,d[i+2]=A,i+=u;else for(let e=0;e<p;++e){if(L(3*c[e]),R){const e=F*F+z*z+A*A;if(e<I&&e>E){const t=1/Math.sqrt(e);F*=t,z*=t,A*=t}}for(let e=0;e<n;++e)d[i]=F,d[i+1]=z,d[i+2]=A,i+=u}}function h(e,f,r,o,i=1){if(!f)return void p(e,r,o,i);const{data:n,indices:s}=e,c=f,l=r.typedBuffer,d=r.typedBufferStride,u=s.length,a=c[0],B=c[1],y=c[2],g=c[4],O=c[5],b=c[6],h=c[8],m=c[9],S=c[10],N=!t(c),R=1e-6,E=1-R;if(o*=d,1===i)for(let t=0;t<u;++t){const e=4*s[t],f=n[e],r=n[e+1],i=n[e+2],c=n[e+3];let u=a*f+g*r+h*i,p=B*f+O*r+m*i,I=y*f+b*r+S*i;if(N){const e=u*u+p*p+I*I;if(e<E&&e>R){const t=1/Math.sqrt(e);u*=t,p*=t,I*=t}}l[o]=u,l[o+1]=p,l[o+2]=I,l[o+3]=c,o+=d}else for(let t=0;t<u;++t){const e=4*s[t],f=n[e],r=n[e+1],c=n[e+2],u=n[e+3];let p=a*f+g*r+h*c,I=B*f+O*r+m*c,F=y*f+b*r+S*c;if(N){const e=p*p+I*I+F*F;if(e<E&&e>R){const t=1/Math.sqrt(e);p*=t,I*=t,F*=t}}for(let t=0;t<i;++t)l[o]=p,l[o+1]=I,l[o+2]=F,l[o+3]=u,o+=d}}function m(e,t,f,r,o=1){const{data:i,indices:n}=e,s=f.typedBuffer,c=f.typedBufferStride,l=n.length;if(r*=c,t!==i.length||4!==t)if(1!==o)if(4!==t)for(let d=0;d<l;++d){const e=3*n[d];for(let t=0;t<o;++t)s[r]=i[e],s[r+1]=i[e+1],s[r+2]=i[e+2],s[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*n[d];for(let t=0;t<o;++t)s[r]=i[e],s[r+1]=i[e+1],s[r+2]=i[e+2],s[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*n[e];s[r]=i[t],s[r+1]=i[t+1],s[r+2]=i[t+2],s[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*n[e];s[r]=i[t],s[r+1]=i[t+1],s[r+2]=i[t+2],s[r+3]=255,r+=c}}else{s[r]=i[0],s[r+1]=i[1],s[r+2]=i[2],s[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,n=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=n,r+=t}}function S(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,n=t.typedBufferStride,s=o.length,c=r[0];f*=n;for(let l=0;l<s;++l)i[f]=c,f+=n}function N(e,t,f,r,o=1){const i=t.typedBuffer,n=t.typedBufferStride;if(r*=n,1===o)for(let s=0;s<f;++s)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=n;else for(let s=0;s<f;++s)for(let t=0;t<o;++t)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=n}function R(e,t,r,o,i,n,s){let c={numItems:0,numVerticesPerItem:0};for(const d of r.fields.keys()){const r=e.get(d),u=r?.indices;if(r&&u)d===l.POSITION&&(c={numItems:1,numVerticesPerItem:u.length}),E(d,r,o,i,n,s);else if(d===l.OBJECTANDLAYERIDCOLOR&&null!=t){const r=e.get(l.POSITION)?.indices;if(r){const e=r.length;N(t,n.getField(d,f),e,s)}}}return c}function E(e,t,d,a,B,y){switch(e){case l.POSITION:{c(3===t.size);const f=B.getField(e,s);c(!!f,`No buffer view for ${e}`),f&&O(t,d,f,y);break}case l.NORMAL:{c(3===t.size);const f=B.getField(e,s);c(!!f,`No buffer view for ${e}`),f&&b(t,a,f,y);break}case l.NORMALCOMPRESSED:{c(2===t.size);const f=B.getField(e,n);c(!!f,`No buffer view for ${e}`),f&&u(t,f,y);break}case l.UV0:{c(2===t.size);const f=B.getField(e,i);c(!!f,`No buffer view for ${e}`),f&&u(t,f,y);break}case l.COLOR:case l.SYMBOLCOLOR:{const r=B.getField(e,f);c(!!r,`No buffer view for ${e}`),c(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||m(t,t.size,r,y);break}case l.COLORFEATUREATTRIBUTE:{const f=B.getField(e,o);c(!!f,`No buffer view for ${e}`),c(1===t.size),f&&1===t.size&&S(t,f,y);break}case l.TANGENT:{c(4===t.size);const f=B.getField(e,r);c(!!f,`No buffer view for ${e}`),f&&h(t,d,f,y);break}case l.PROFILERIGHT:case l.PROFILEUP:case l.PROFILEVERTEXANDNORMAL:case l.FEATUREVALUE:{c(4===t.size);const f=B.getField(e,r);c(!!f,`No buffer view for ${e}`),f&&p(t,f,y)}}}export{d as writeBufferFloat,y as writeBufferMat3f,g as writeBufferMat4f,u as writeBufferVec2,a as writeBufferVec3,p as writeBufferVec4,B as writeBufferVec4Zeros,m as writeColor,S as writeColorFeatureAttribute,E as writeDefaultAttribute,R as writeDefaultAttributes,b as writeNormal,N as writeObjectAndLayerIdColor,O as writePosition,h as writeTangent};
5
+ import{hasIdentityRotation as e,isOrthoNormal as t}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as f,BufferViewVec2f as r,BufferViewVec4f as o,BufferViewFloat as i,BufferViewVec2i16 as s,BufferViewVec3f as n}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as c}from"../../lib/Util.js";import{VertexAttribute as l}from"../../lib/VertexAttribute.js";function d(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l)s[f]=o[i[l]],f+=n;else for(let l=0;l<c;++l){const e=o[i[l]];for(let t=0;t<r;t++)s[f]=e,f+=n}}function u(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=2*o[c];i[f]=r[e],i[f+1]=r[e+1],f+=s}}function a(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=3*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],f+=n}}function p(e,t,f,r=1){const{data:o,indices:i}=e,s=t.typedBuffer,n=t.typedBufferStride,c=i.length;if(f*=n,1===r)for(let l=0;l<c;++l){const e=4*i[l];s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<r;++t)s[f]=o[e],s[f+1]=o[e+1],s[f+2]=o[e+2],s[f+3]=o[e+3],f+=n}}function B(e,t,f){const r=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let i=0;i<f;++i)r[t]=0,r[t+1]=0,r[t+2]=0,r[t+3]=0,t+=o}function y(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=9*o[c];for(let t=0;t<9;++t)i[f+t]=r[e+t];f+=s}}function g(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length;f*=s;for(let c=0;c<n;++c){const e=16*o[c];for(let t=0;t<16;++t)i[f+t]=r[e+t];f+=s}}function O(t,f,r,o,i=1){if(!f)return void a(t,r,o,i);const{data:s,indices:n}=t,c=r.typedBuffer,l=r.typedBufferStride,d=n.length,u=f[0],p=f[1],B=f[2],y=f[4],g=f[5],O=f[6],b=f[8],h=f[9],m=f[10],N=f[12],S=f[13],R=f[14];o*=l;let E=0,I=0,A=0;const F=e(f)?e=>{E=s[e]+N,I=s[e+1]+S,A=s[e+2]+R}:e=>{const t=s[e],f=s[e+1],r=s[e+2];E=u*t+y*f+b*r+N,I=p*t+g*f+h*r+S,A=B*t+O*f+m*r+R};if(1===i)for(let e=0;e<d;++e)F(3*n[e]),c[o]=E,c[o+1]=I,c[o+2]=A,o+=l;else for(let e=0;e<d;++e){F(3*n[e]);for(let e=0;e<i;++e)c[o]=E,c[o+1]=I,c[o+2]=A,o+=l}}function b(f,r,o,i,s=1){if(!r)return void a(f,o,i,s);const{data:n,indices:c}=f,l=r,d=o.typedBuffer,u=o.typedBufferStride,p=c.length,B=l[0],y=l[1],g=l[2],O=l[4],b=l[5],h=l[6],m=l[8],N=l[9],S=l[10],R=!t(l),E=1e-6,I=1-E;i*=u;let A=0,F=0,z=0;const L=e(l)?e=>{A=n[e],F=n[e+1],z=n[e+2]}:e=>{const t=n[e],f=n[e+1],r=n[e+2];A=B*t+O*f+m*r,F=y*t+b*f+N*r,z=g*t+h*f+S*r};if(1===s)if(R)for(let e=0;e<p;++e){L(3*c[e]);const t=A*A+F*F+z*z;if(t<I&&t>E){const e=1/Math.sqrt(t);d[i]=A*e,d[i+1]=F*e,d[i+2]=z*e}else d[i]=A,d[i+1]=F,d[i+2]=z;i+=u}else for(let e=0;e<p;++e)L(3*c[e]),d[i]=A,d[i+1]=F,d[i+2]=z,i+=u;else for(let e=0;e<p;++e){if(L(3*c[e]),R){const e=A*A+F*F+z*z;if(e<I&&e>E){const t=1/Math.sqrt(e);A*=t,F*=t,z*=t}}for(let e=0;e<s;++e)d[i]=A,d[i+1]=F,d[i+2]=z,i+=u}}function h(e,f,r,o,i=1){if(!f)return void p(e,r,o,i);const{data:s,indices:n}=e,c=f,l=r.typedBuffer,d=r.typedBufferStride,u=n.length,a=c[0],B=c[1],y=c[2],g=c[4],O=c[5],b=c[6],h=c[8],m=c[9],N=c[10],S=!t(c),R=1e-6,E=1-R;if(o*=d,1===i)for(let t=0;t<u;++t){const e=4*n[t],f=s[e],r=s[e+1],i=s[e+2],c=s[e+3];let u=a*f+g*r+h*i,p=B*f+O*r+m*i,I=y*f+b*r+N*i;if(S){const e=u*u+p*p+I*I;if(e<E&&e>R){const t=1/Math.sqrt(e);u*=t,p*=t,I*=t}}l[o]=u,l[o+1]=p,l[o+2]=I,l[o+3]=c,o+=d}else for(let t=0;t<u;++t){const e=4*n[t],f=s[e],r=s[e+1],c=s[e+2],u=s[e+3];let p=a*f+g*r+h*c,I=B*f+O*r+m*c,A=y*f+b*r+N*c;if(S){const e=p*p+I*I+A*A;if(e<E&&e>R){const t=1/Math.sqrt(e);p*=t,I*=t,A*=t}}for(let t=0;t<i;++t)l[o]=p,l[o+1]=I,l[o+2]=A,l[o+3]=u,o+=d}}function m(e,t,f,r,o=1){const{data:i,indices:s}=e,n=f.typedBuffer,c=f.typedBufferStride,l=s.length;if(r*=c,t!==i.length||4!==t)if(1!==o)if(4!==t)for(let d=0;d<l;++d){const e=3*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=255,r+=c}else for(let d=0;d<l;++d){const e=4*s[d];for(let t=0;t<o;++t)n[r]=i[e],n[r+1]=i[e+1],n[r+2]=i[e+2],n[r+3]=i[e+3],r+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=c}return}for(let e=0;e<l;++e){const t=3*s[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=255,r+=c}}else{n[r]=i[0],n[r+1]=i[1],n[r+2]=i[2],n[r+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,s=e[r/=4];r+=t;const d=l*o;for(let f=1;f<d;++f)e[r]=s,r+=t}}function N(e,t,f){const{data:r,indices:o}=e,i=t.typedBuffer,s=t.typedBufferStride,n=o.length,c=r[0];f*=s;for(let l=0;l<n;++l)i[f]=c,f+=s}function S(e,t,f,r,o=1){const i=t.typedBuffer,s=t.typedBufferStride;if(r*=s,1===o)for(let n=0;n<f;++n)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s;else for(let n=0;n<f;++n)for(let t=0;t<o;++t)i[r]=e[0],i[r+1]=e[1],i[r+2]=e[2],i[r+3]=e[3],r+=s}function R(e,t,r,o,i,s,n){let c={numItems:0,numVerticesPerItem:0};for(const d of r.fields.keys()){const r=e.get(d),u=r?.indices;if(r&&u)d===l.POSITION&&(c={numItems:1,numVerticesPerItem:u.length}),E(d,r,o,i,s,n);else if(d===l.OBJECTANDLAYERIDCOLOR&&null!=t){const r=e.get(l.POSITION)?.indices;if(r){const e=r.length;S(t,s.getField(d,f),e,n)}}}return c}function E(e,t,d,a,B,y){switch(e){case l.POSITION:{c(3===t.size);const f=B.getField(e,n);c(!!f,`No buffer view for ${e}`),f&&O(t,d,f,y);break}case l.NORMAL:{c(3===t.size);const f=B.getField(e,n);c(!!f,`No buffer view for ${e}`),f&&b(t,a,f,y);break}case l.NORMALCOMPRESSED:case l.PROFILERIGHT:case l.PROFILEUP:{c(2===t.size);const f=B.getField(e,s);c(!!f,`No buffer view for ${e}`),f&&u(t,f,y);break}case l.UV0:{c(2===t.size);const f=B.getField(e,r);c(!!f,`No buffer view for ${e}`),f&&u(t,f,y);break}case l.COLOR:case l.SYMBOLCOLOR:{const r=B.getField(e,f);c(!!r,`No buffer view for ${e}`),c(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||m(t,t.size,r,y);break}case l.COLORFEATUREATTRIBUTE:{const f=B.getField(e,i);c(!!f,`No buffer view for ${e}`),c(1===t.size),f&&1===t.size&&N(t,f,y);break}case l.TANGENT:{c(4===t.size);const f=B.getField(e,o);c(!!f,`No buffer view for ${e}`),f&&h(t,d,f,y);break}case l.PROFILEVERTEXANDNORMAL:case l.FEATUREVALUE:{c(4===t.size);const f=B.getField(e,o);c(!!f,`No buffer view for ${e}`),f&&p(t,f,y)}break;case l.PROFILEAUXDATA:{c(2===t.size);const f=B.getField(e,r);c(!!f,`No buffer view for ${e}`),f&&u(t,f,y)}}}export{d as writeBufferFloat,y as writeBufferMat3f,g as writeBufferMat4f,u as writeBufferVec2,a as writeBufferVec3,p as writeBufferVec4,B as writeBufferVec4Zeros,m as writeColor,N as writeColorFeatureAttribute,E as writeDefaultAttribute,R as writeDefaultAttributes,b as writeNormal,S as writeObjectAndLayerIdColor,O as writePosition,h as writeTangent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import"../../../../core/has.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as i}from"../../../../chunks/sphere.js";import{ContentObjectType as s}from"../lib/ContentObjectType.js";import{GridLocalOriginFactory as a}from"../lib/GridLocalOriginFactory.js";import c from"../lib/ModelDirtySet.js";import{RenderGeometry as d}from"../lib/RenderGeometry.js";import{assert as m}from"../lib/Util.js";import{isWebGLLayer as l}from"../lib/WebGLLayer.js";let h=class extends e{constructor(){super(...arguments),this.dirtySet=new c({model:this}),this._content=new Map,this._originFactory=new a(null)}getObject(t){return this._content.get(t)}add(t){const e=t.id;m(!this._content.has(e),"Model/Stage already contains object to be added"),this._content.set(e,t),l(t)&&this.dirtySet.layerAdded(t)}remove(t){return!!this._content.has(t.id)&&(this._content.delete(t.id),l(t)&&this.dirtySet.layerRemoved(t),!0)}addMany(t){for(const e of t)e&&(m(!this._content.has(e.id),"Model/Stage already contains object to be added"),this._content.set(e.id,e))}removeMany(t){for(const e of t)e&&(m(this._content.has(e.id),"Model/Stage doesn't contain object to be removed"),this._content.delete(e.id))}has(t){return this._content.has(t.id)}forEachOfType(t,e){this._content.forEach((o=>{o.type===t&&e(o)}))}getRenderGeometry(t,e){const o=new d(e,{castShadow:t.castShadow,objectShaderTransformation:t.shaderTransformation});o.transformation=t.getCombinedStaticTransformation(e,p);const{localOrigin:r}=e;return o.localOrigin=null!=r?r:this._originFactory.getOrigin(i(o.boundingSphere)),o}updateRenderGeometryTransformation(t,e,o){if(null==t)return!1;o.transformation=t.getCombinedStaticTransformation(e,p);const r=this._originFactory.getOrigin(i(o.boundingSphere));return o.localOrigin!==r}getStats(){const t={},e=Array.from(this._content.values());for(let o=0;o<s.COUNT;++o)t[o]=e.filter((t=>t.type===o)).length;return{contentTypes:t,dirtySet:this.dirtySet.formatDebugInfo()}}get test(){}};t([o({constructOnly:!0})],h.prototype,"dirtySet",void 0),h=t([r("esri.views.3d.webgl-engine.parts.Model")],h);const p=n();export{h as Model};
5
+ import{_ as t}from"../../../../chunks/tslib.es6.js";import e from"../../../../core/Accessor.js";import"../../../../core/has.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as r}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as n}from"../../../../chunks/sphere.js";import{ContentObjectType as s}from"../lib/ContentObjectType.js";import{GridLocalOriginFactory as a}from"../lib/GridLocalOriginFactory.js";import c from"../lib/ModelDirtySet.js";import{RenderGeometry as d}from"../lib/RenderGeometry.js";import{assert as m}from"../lib/Util.js";import{isWebGLLayer as l}from"../lib/WebGLLayer.js";let h=class extends e{constructor(){super(...arguments),this.dirtySet=new c({model:this}),this._content=new Map,this._originFactory=new a(null)}getObject(t){return this._content.get(t)}add(t){const e=t.id;m(!this._content.has(e),"Model/Stage already contains object to be added"),this._content.set(e,t),l(t)&&this.dirtySet.layerAdded(t)}remove(t){return!!this._content.has(t.id)&&(this._content.delete(t.id),l(t)&&this.dirtySet.layerRemoved(t),!0)}addMany(t){for(const e of t)e&&(m(!this._content.has(e.id),"Model/Stage already contains object to be added"),this._content.set(e.id,e))}removeMany(t){for(const e of t)e&&(m(this._content.has(e.id),"Model/Stage doesn't contain object to be removed"),this._content.delete(e.id))}has(t){return this._content.has(t.id)}forEachOfType(t,e){this._content.forEach((o=>{o.type===t&&e(o)}))}getRenderGeometry(t,e){const o=new d(e,{castShadow:t.castShadow,objectShaderTransformation:t.shaderTransformation}),r=e.localOrigin;return o.transformation=t.getCombinedStaticTransformation(e,p),o.localOrigin=r??this._originFactory.getOrigin(n(o.boundingSphere)),o}updateRenderGeometryTransformation(t,e,o){if(null==t)return!1;o.transformation=t.getCombinedStaticTransformation(e,p);const r=this._originFactory.getOrigin(n(o.boundingSphere));return o.localOrigin!==r}getStats(){const t={},e=Array.from(this._content.values());for(let o=0;o<s.COUNT;++o)t[o]=e.filter((t=>t.type===o)).length;return{contentTypes:t,dirtySet:this.dirtySet.formatDebugInfo()}}get test(){}};t([o({constructOnly:!0})],h.prototype,"dirtySet",void 0),h=t([r("esri.views.3d.webgl-engine.parts.Model")],h);const p=i();export{h as Model};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";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/PositionAttribute.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/TerrainDepthTest.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"../lib/VertexAttribute.js";import"./OutputColorHighlightOID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/DefaultMaterial.glsl.js";
5
+ import"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../core/shaderLibrary/ForwardLinearDepth.glsl.js";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/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/TerrainDepthTest.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"../lib/VertexAttribute.js";import"./OutputColorHighlightOID.glsl.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build}from"../../../../chunks/DefaultMaterial.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js";import"../core/shaderLibrary/HighlightReadBitmap.glsl.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerBindUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/HighlightApply.glsl.js";
5
+ import"../core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js";import"../core/shaderLibrary/HighlightReadBitmap.glsl.js";import"../core/shaderModules/Float2DrawUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../core/shaderModules/UintTexture2DPassUniform.js";import"../../../../chunks/HighlightDownsample.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/HighlightApply.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js";import"../core/shaderModules/Float2DrawUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DDrawUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{S as SingleHighlightBlurDrawParameters,b as build}from"../../../../chunks/SingleHighlightBlur.glsl.js";
5
+ import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js";import"../core/shaderModules/Float2DrawUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DDrawUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{H as HighlightBlurDrawParameters,b as build}from"../../../../chunks/HighlightBlur.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DDrawUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{H as HighlightDownsampleDrawParameters,b as blurSize,c as build,g as gridCellPixelSize,o as outlineSize}from"../../../../chunks/HighlightDownsample.glsl.js";
5
+ import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/UintTexture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{H as HighlightDownsampleDrawParameters,b as blurSize,c as build,g as gridCellPixelSize,o as outlineSize}from"../../../../chunks/HighlightDownsample.glsl.js";