@arcgis/core 5.1.0-next.52 → 5.1.0-next.54

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 (437) hide show
  1. package/applications/Components/SketchTooltipControls.d.ts +3 -2
  2. package/applications/Components/SketchTooltipControls.js +1 -1
  3. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/009db7b459b18f6a668b.js +1 -0
  6. package/assets/esri/core/workers/chunks/097c037705ab485372ee.js +1 -0
  7. package/assets/esri/core/workers/chunks/0ab19ad980fda1cf402a.js +1 -0
  8. package/assets/esri/core/workers/chunks/0b79630ad435a7734104.js +1 -0
  9. package/assets/esri/core/workers/chunks/0f4759efc0982fb0ea03.js +1 -0
  10. package/assets/esri/core/workers/chunks/{386435341e949f5573b4.js → 0fc60b4c44c4e865b699.js} +2 -2
  11. package/assets/esri/core/workers/chunks/{f4d31d96681b649ddc95.js → 0ff12fe9e358100668d9.js} +1 -1
  12. package/assets/esri/core/workers/chunks/11fed97adc9bca0f95e9.js +1 -0
  13. package/assets/esri/core/workers/chunks/123e15c9e068a053d54e.js +1 -0
  14. package/assets/esri/core/workers/chunks/1613123918e9b0f7cfdb.js +1 -0
  15. package/assets/esri/core/workers/chunks/16a46688df5fad5cf8d5.js +1 -0
  16. package/assets/esri/core/workers/chunks/16ed8c0af8bb8b400163.js +1 -0
  17. package/assets/esri/core/workers/chunks/16f5cd740321a3539bf1.js +1 -0
  18. package/assets/esri/core/workers/chunks/173d94e162b210dee0a2.js +1 -0
  19. package/assets/esri/core/workers/chunks/199f70c0373f6008a545.js +1 -0
  20. package/assets/esri/core/workers/chunks/1a198c9e17f7a058669e.js +1 -0
  21. package/assets/esri/core/workers/chunks/1fdd736c4932655ff1d9.js +1 -0
  22. package/assets/esri/core/workers/chunks/{d2af5342fbe80e2d8c60.js → 20f9f3470cad47d01803.js} +1 -1
  23. package/assets/esri/core/workers/chunks/2304f7b8173cf86dd805.js +1 -0
  24. package/assets/esri/core/workers/chunks/2327b368673a974dee8b.js +1 -0
  25. package/assets/esri/core/workers/chunks/23eb204d3cb818adea32.js +1 -0
  26. package/assets/esri/core/workers/chunks/{eedeff8b344ff699b0b9.js → 2714ec856c2b3223425b.js} +1 -1
  27. package/assets/esri/core/workers/chunks/2757cf54656b5d318b11.js +1 -0
  28. package/assets/esri/core/workers/chunks/2aaeaf022af8493281dc.js +1 -0
  29. package/assets/esri/core/workers/chunks/34acecd7a314fed12335.js +1 -0
  30. package/assets/esri/core/workers/chunks/34fe4570eef9e73839b8.js +1 -0
  31. package/assets/esri/core/workers/chunks/{cdeb6aec578a1c07d663.js → 3cb0f020f9bfc6653c5d.js} +1 -1
  32. package/assets/esri/core/workers/chunks/40bcfc4f8efe7de7ec9d.js +1 -0
  33. package/assets/esri/core/workers/chunks/42e084704dea6e4135b6.js +1 -0
  34. package/assets/esri/core/workers/chunks/{5b3bb636e3bec625e515.js → 4301cb9670fa7c907460.js} +1 -1
  35. package/assets/esri/core/workers/chunks/48eca6f51112ba80bd3b.js +1 -0
  36. package/assets/esri/core/workers/chunks/4c38af9ae023fde2b5cd.js +1 -0
  37. package/assets/esri/core/workers/chunks/4c8c69d081ed37bf5bc5.js +1 -0
  38. package/assets/esri/core/workers/chunks/{cc1f3a2f281a2f6e0f94.js → 4d54beab8ae5ff31e7b0.js} +1 -1
  39. package/assets/esri/core/workers/chunks/4e7bb224bde9e5039263.js +1 -0
  40. package/assets/esri/core/workers/chunks/4f847a426973bd350c11.js +1 -0
  41. package/assets/esri/core/workers/chunks/52c90975cf22add7ee2b.js +1 -0
  42. package/assets/esri/core/workers/chunks/55214e1d9f3d98fa7ed9.js +1 -0
  43. package/assets/esri/core/workers/chunks/55bb5b7817c2963c8bfa.js +1 -0
  44. package/assets/esri/core/workers/chunks/57dc80942e51dedd8335.js +1 -0
  45. package/assets/esri/core/workers/chunks/59289867cce97da74e39.js +1 -0
  46. package/assets/esri/core/workers/chunks/5a9620cb66c8e64e4668.js +1 -0
  47. package/assets/esri/core/workers/chunks/5d202f60891fcae7174d.js +1 -0
  48. package/assets/esri/core/workers/chunks/{f7fb121169b7e5a5adbc.js → 6666ef3fd6ce877a4509.js} +1 -1
  49. package/assets/esri/core/workers/chunks/69644b8a6ce340ca1159.js +1 -0
  50. package/assets/esri/core/workers/chunks/6ab8ed12d162d79a8c55.js +1 -0
  51. package/assets/esri/core/workers/chunks/796d27d1bbb2eed53cbd.js +1 -0
  52. package/assets/esri/core/workers/chunks/7d56b2ac5030dd8b748e.js +1 -0
  53. package/assets/esri/core/workers/chunks/7ef1c1f765b6d423e474.js +1 -0
  54. package/assets/esri/core/workers/chunks/{720a33a7f118d2769133.js → 851dd71d28681d4eccfd.js} +1 -1
  55. package/assets/esri/core/workers/chunks/8569ae372fc64641b6b1.js +1 -0
  56. package/assets/esri/core/workers/chunks/{88c6cc90606409b5c884.js → 87d2021e91d025a2a142.js} +1 -1
  57. package/assets/esri/core/workers/chunks/929b26999321519824b9.js +1 -0
  58. package/assets/esri/core/workers/chunks/932a0b39d85a76377d52.js +1 -0
  59. package/assets/esri/core/workers/chunks/94f80c46ccf5e19038b8.js +1 -0
  60. package/assets/esri/core/workers/chunks/{fe7dec83e40014c55a6b.js → 96e799ca97989a6ed448.js} +1 -1
  61. package/assets/esri/core/workers/chunks/979c2f52b6d6e1e8241b.js +1 -0
  62. package/assets/esri/core/workers/chunks/{617328964d480d4a3a45.js → 9806cc96414065ae0afe.js} +1 -1
  63. package/assets/esri/core/workers/chunks/9db2ff1d4cbb5d1b623e.js +1 -0
  64. package/assets/esri/core/workers/chunks/a462aa1c7b68efad6906.js +1 -0
  65. package/assets/esri/core/workers/chunks/{987dc23fdc0a8c7150b9.js → a5bf2718c02a0e645013.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{f5fd59291cb161fdc05b.js → a787fe09d3df9d4254ba.js} +1 -1
  67. package/assets/esri/core/workers/chunks/a7b315a660f0f4e1d197.js +1 -0
  68. package/assets/esri/core/workers/chunks/a8e111a5cfd6151d5dbb.js +1 -0
  69. package/assets/esri/core/workers/chunks/a971e61336f455b953d5.js +1 -0
  70. package/assets/esri/core/workers/chunks/aed45f7e7eee154a21b8.js +1 -0
  71. package/assets/esri/core/workers/chunks/b2b77598048818c957b7.js +1 -0
  72. package/assets/esri/core/workers/chunks/b39b4db86a1049f0b901.js +1 -0
  73. package/assets/esri/core/workers/chunks/{3fa5f102b6f77c523a76.js → b3e5dcb530cef678c8f8.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{c6a0e770c1a89d3b5913.js → b43889ed9737c27e89f1.js} +1 -1
  75. package/assets/esri/core/workers/chunks/b59f03c64e4965d87291.js +1 -0
  76. package/assets/esri/core/workers/chunks/bad82ce3f84f7efb7ab7.js +1 -0
  77. package/assets/esri/core/workers/chunks/bae1d6dd2376dff271e8.js +1 -0
  78. package/assets/esri/core/workers/chunks/bb047157f09471ecea53.js +1 -0
  79. package/assets/esri/core/workers/chunks/bbb9659f79511c2c4690.js +1 -0
  80. package/assets/esri/core/workers/chunks/bc3b22dc08c147b8d425.js +1 -0
  81. package/assets/esri/core/workers/chunks/be60a6e210186ff09ae2.js +1 -0
  82. package/assets/esri/core/workers/chunks/c03190faca955bffc8c1.js +1 -0
  83. package/assets/esri/core/workers/chunks/c1ad062ccc1817cbee4c.js +1 -0
  84. package/assets/esri/core/workers/chunks/{daf65bccc45dc5c400ae.js → c460ca93ed8e20d8b53a.js} +1 -1
  85. package/assets/esri/core/workers/chunks/c86b15f6a18880f921cd.js +1 -0
  86. package/assets/esri/core/workers/chunks/c93454e37ae0f124bcb0.js +1 -0
  87. package/assets/esri/core/workers/chunks/{3fcc8c455af56ae89030.js → ccf845ac0ac354507a25.js} +1 -1
  88. package/assets/esri/core/workers/chunks/cd14b6157862f33ab116.js +1 -0
  89. package/assets/esri/core/workers/chunks/ce59ec4f0cfbdf780bcb.js +1 -0
  90. package/assets/esri/core/workers/chunks/{7480bd6f892abf444cac.js → d1aa1d51662f4a01e793.js} +3 -3
  91. package/assets/esri/core/workers/chunks/d31e68e73527c88b8276.js +1 -0
  92. package/assets/esri/core/workers/chunks/{15a45e26964c2eb381a6.js → d4961d307651431328a8.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{81b830f0d620587966ca.js → d53c6fc10425adc2c0cf.js} +1 -1
  94. package/assets/esri/core/workers/chunks/d69cdee402ba4fc3735f.js +1 -0
  95. package/assets/esri/core/workers/chunks/d6f1ed8d8f76a32bc81d.js +1 -0
  96. package/assets/esri/core/workers/chunks/d7456829e404874a9e2f.js +1 -0
  97. package/assets/esri/core/workers/chunks/d9444dd0d40aa8332b28.js +1 -0
  98. package/assets/esri/core/workers/chunks/da0a61f73d45ea9e71fc.js +1 -0
  99. package/assets/esri/core/workers/chunks/{9ae90a4b281d4103e8bb.js → dc07dc1cd30edc0c4193.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{fdf8fe0f50a9ae548c16.js → ddc7956d80498518551e.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{29c91b5c9ddcea85f39a.js → e23fc5853e2f4016936b.js} +1 -1
  102. package/assets/esri/core/workers/chunks/e2d1d9929ed7744785a1.js +1 -0
  103. package/assets/esri/core/workers/chunks/e543bb228f3f9d937d43.js +1 -0
  104. package/assets/esri/core/workers/chunks/ec21311584e4fb13e510.js +1 -0
  105. package/assets/esri/core/workers/chunks/ec91d5081f423755cb07.js +1 -0
  106. package/assets/esri/core/workers/chunks/{eb36417edc11fa80e312.js → ee8cd91c27e9cdfc3b2e.js} +1 -1
  107. package/assets/esri/core/workers/chunks/f3f26f6116ab9126c2e7.js +1 -0
  108. package/assets/esri/core/workers/chunks/f4472e3486fdc33abb9a.js +1 -0
  109. package/assets/esri/core/workers/chunks/f80f04657762666b9165.js +1 -0
  110. package/assets/esri/core/workers/chunks/f8eb14170f927aecfbc8.js +1 -0
  111. package/assets/esri/core/workers/chunks/f8ee1a99580a7da42cde.js +1 -0
  112. package/assets/esri/core/workers/chunks/fcda652fb5262696d59c.js +1 -0
  113. package/assets/esri/core/workers/chunks/{792219a079c28bcdc003.js → fcfaaced184f8da3e28d.js} +1 -1
  114. package/assets/esri/core/workers/chunks/fe92f54e45fd21ccd75f.js +1 -0
  115. package/assets/esri/core/workers/chunks/ff0cb1eec14d34214f12.js +1 -0
  116. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  117. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  118. package/chunks/OITBlend.glsl.js +2 -2
  119. package/chunks/ShadowHighlight.glsl.js +1 -1
  120. package/chunks/Viewshed.glsl.js +2 -2
  121. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  122. package/chunks/arcgis-knowledge-client-core.js +1 -1
  123. package/config.js +1 -1
  124. package/core/arrayUtils.js +1 -1
  125. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  126. package/core/maybe.js +1 -1
  127. package/geometry/SpatialReference.js +1 -1
  128. package/geometry/operators/support/apiConverter.js +1 -1
  129. package/geometry/support/aaBoundingBox.js +1 -1
  130. package/geometry/support/geometryUtils.js +1 -1
  131. package/kernel.js +1 -1
  132. package/layers/FeatureLayer.js +1 -1
  133. package/layers/OrientedImageryLayer.js +1 -1
  134. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  135. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  136. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  137. package/layers/knowledgeGraph/nodeMovementUtils.js +1 -1
  138. package/layers/mixins/ArcGISImageService.js +1 -1
  139. package/layers/mixins/FeatureLayerBase.js +1 -1
  140. package/layers/raster/datasets/FunctionRaster.js +1 -1
  141. package/layers/raster/functions/AspectFunction.js +1 -1
  142. package/layers/raster/functions/BaseRasterFunction.js +1 -1
  143. package/layers/raster/functions/ConvolutionFunction.js +1 -1
  144. package/layers/raster/functions/CurvatureFunction.js +1 -1
  145. package/layers/raster/functions/HillshadeFunction.js +1 -1
  146. package/layers/raster/functions/ShadedReliefFunction.js +1 -1
  147. package/layers/raster/functions/SlopeFunction.js +1 -1
  148. package/layers/raster/functions/StatisticsFunction.js +1 -1
  149. package/layers/raster/functions/pixelUtils.js +1 -1
  150. package/layers/support/capabilities.js +1 -1
  151. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  152. package/package.json +3 -3
  153. package/rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js +1 -1
  154. package/support/revision.js +1 -1
  155. package/support/tests/serviceMockDependencies.js +1 -1
  156. package/views/2d/engine/flow/FlowContainer.js +1 -1
  157. package/views/2d/engine/flow/FlowStrategy.js +1 -1
  158. package/views/2d/engine/flow/FlowView2D.js +1 -1
  159. package/views/2d/engine/flow/dataUtils.js +1 -1
  160. package/views/2d/engine/flow/particleConstants.js +2 -0
  161. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  162. package/views/2d/engine/flow/styles/Particles.js +1 -1
  163. package/views/2d/engine/flow/styles/Stack.js +1 -1
  164. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  165. package/views/2d/engine/flow/utils.js +1 -1
  166. package/views/2d/engine/imagery/RasterVFContainer.js +1 -1
  167. package/views/2d/engine/webgl/Painter.js +1 -1
  168. package/views/2d/engine/webgl/Profiler.js +1 -1
  169. package/views/2d/engine/webgl/WGLContainer.js +1 -1
  170. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  171. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js +1 -1
  172. package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
  173. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  174. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
  175. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  176. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
  177. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  178. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  179. package/views/2d/engine/webgl/shaderGraph/techniques/flow/FlowTechnique.js +2 -0
  180. package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
  181. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  182. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  183. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  184. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  185. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
  186. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  187. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  188. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  189. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
  190. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
  191. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  192. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  193. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowImageryShader.js +2 -0
  194. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowParticlesShader.js +2 -0
  195. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowStreamlinesShader.js +2 -0
  196. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowUtils.js +2 -0
  197. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  198. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
  199. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileStencilTechnique.js +1 -1
  200. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
  201. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
  202. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  203. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
  204. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
  205. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  206. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  207. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  208. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  209. package/views/2d/layers/features/FeatureContainer.js +1 -1
  210. package/views/2d/layers/features/RenderState.js +1 -1
  211. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  212. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  213. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  214. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  215. package/views/3d/layers/I3SMeshView3D.js +1 -1
  216. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  217. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  218. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  219. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  220. package/views/3d/layers/support/Tiles3DBVH.js +1 -1
  221. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  222. package/views/3d/support/ResourceController.js +1 -1
  223. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  224. package/views/3d/support/orientedBoundingBox.js +1 -1
  225. package/views/3d/terrain/OverlayRenderer.js +1 -1
  226. package/views/3d/terrain/TerrainRenderer.js +1 -1
  227. package/views/3d/webgl/ManagedFBO.d.ts +1 -0
  228. package/views/3d/webgl/ManagedFBOResource.d.ts +1 -0
  229. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  230. package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +1 -1
  231. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  232. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  233. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  234. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  235. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  236. package/views/3d/webgl-engine/core/FBOCacheUsage.js +1 -1
  237. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +1 -1
  238. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +1 -1
  239. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  240. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  241. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  242. package/views/3d/webgl-engine/lib/GLMaterial.js +1 -1
  243. package/views/3d/webgl-engine/lib/GLMaterialLoader.js +2 -0
  244. package/views/3d/webgl-engine/lib/GLMaterialParameters.js +1 -1
  245. package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
  246. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  247. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  248. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  249. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  250. package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
  251. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  252. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  253. package/views/3d/webgl-engine/lib/ReprojectionUniforms.js +2 -0
  254. package/views/3d/webgl-engine/lib/ScreenSpaceReflectionsUniforms.js +2 -0
  255. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  256. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  257. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  258. package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
  259. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  260. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  261. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  262. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  263. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  264. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  265. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  266. package/views/3d/webgl-engine/materials/TriangleTechniqueConfiguration.js +1 -1
  267. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  268. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  269. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  270. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  271. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  272. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  273. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  274. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
  275. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  276. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  277. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  278. package/views/3d/webgl-engine/shaders/Viewshed.glsl.js +1 -1
  279. package/views/3d/webgl.js +1 -1
  280. package/views/draw/DrawTool.js +1 -1
  281. package/views/draw/plugins/ShapePlugin.js +1 -1
  282. package/views/draw/support/managers/GlobalStateManager.js +1 -1
  283. package/views/draw/support/types.d.ts +9 -0
  284. package/views/interactive/SegmentLabels.js +1 -1
  285. package/views/webgl/AllocationTracer.js +1 -1
  286. package/views/webgl/Program.js +1 -1
  287. package/views/webgl/RenderingContext.js +1 -1
  288. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  289. package/widgets/Editor/components/Settings.js +1 -1
  290. package/widgets/Features/FeaturesViewModel.js +1 -1
  291. package/widgets/Features.js +1 -1
  292. package/widgets/Search/SearchViewModel.js +1 -1
  293. package/widgets/Search/support/layerSearchUtils.js +1 -1
  294. package/widgets/Search/support/locatorUtils.js +1 -1
  295. package/widgets/Sketch.js +1 -1
  296. package/widgets/support/SketchTooltipControls.js +1 -1
  297. package/assets/esri/core/workers/chunks/001492854799c35b53bb.js +0 -1
  298. package/assets/esri/core/workers/chunks/004f991251f09b36fb09.js +0 -1
  299. package/assets/esri/core/workers/chunks/01dd849a2d335e9f3e16.js +0 -1
  300. package/assets/esri/core/workers/chunks/027d733a99f50cadcf22.js +0 -1
  301. package/assets/esri/core/workers/chunks/03d85a706669aaf24d49.js +0 -1
  302. package/assets/esri/core/workers/chunks/0450133e81bce4b48b84.js +0 -1
  303. package/assets/esri/core/workers/chunks/085778ecd39f46324a6b.js +0 -1
  304. package/assets/esri/core/workers/chunks/08dce0019b52042b01fa.js +0 -1
  305. package/assets/esri/core/workers/chunks/0b661b90f7ee3ae23425.js +0 -1
  306. package/assets/esri/core/workers/chunks/0d8294982853308225da.js +0 -1
  307. package/assets/esri/core/workers/chunks/156aecac067213642aae.js +0 -1
  308. package/assets/esri/core/workers/chunks/167e4ff7cbc88b42db71.js +0 -1
  309. package/assets/esri/core/workers/chunks/184e9147f7a2f0ae5915.js +0 -1
  310. package/assets/esri/core/workers/chunks/19f59a2a97c33ff92650.js +0 -1
  311. package/assets/esri/core/workers/chunks/1a481f3ae3146682eb00.js +0 -1
  312. package/assets/esri/core/workers/chunks/2b7d020367cb4ebb3c3d.js +0 -1
  313. package/assets/esri/core/workers/chunks/30654845ca1334f1c206.js +0 -1
  314. package/assets/esri/core/workers/chunks/3104b10770903c265626.js +0 -1
  315. package/assets/esri/core/workers/chunks/33f00633131581e06328.js +0 -1
  316. package/assets/esri/core/workers/chunks/34207774bc371e95ba3c.js +0 -1
  317. package/assets/esri/core/workers/chunks/35dbe1eeb6932b03aea2.js +0 -1
  318. package/assets/esri/core/workers/chunks/365ad1ffd496ed86637b.js +0 -1
  319. package/assets/esri/core/workers/chunks/380bb57bccc266d6442a.js +0 -1
  320. package/assets/esri/core/workers/chunks/3874362bf7d43adc41bb.js +0 -1
  321. package/assets/esri/core/workers/chunks/38dc1c4b8721efd4a165.js +0 -1
  322. package/assets/esri/core/workers/chunks/39f3bea123f20c816ab2.js +0 -1
  323. package/assets/esri/core/workers/chunks/3e9700445518b8f9ae1b.js +0 -1
  324. package/assets/esri/core/workers/chunks/42f3fdad1728433b3510.js +0 -1
  325. package/assets/esri/core/workers/chunks/436941ec88439667022e.js +0 -1
  326. package/assets/esri/core/workers/chunks/4812482f28f7205b0938.js +0 -1
  327. package/assets/esri/core/workers/chunks/5317cbef0aac29761575.js +0 -1
  328. package/assets/esri/core/workers/chunks/5351e71ce7839636d06d.js +0 -1
  329. package/assets/esri/core/workers/chunks/54a9e17d6c0fef6a9146.js +0 -1
  330. package/assets/esri/core/workers/chunks/55985c9c48b8e1d1c634.js +0 -1
  331. package/assets/esri/core/workers/chunks/55edd712c6d2d044e550.js +0 -1
  332. package/assets/esri/core/workers/chunks/5e5b358e603b13b4d7d7.js +0 -1
  333. package/assets/esri/core/workers/chunks/63b9e4a7dad358605c38.js +0 -1
  334. package/assets/esri/core/workers/chunks/64da1ad9df9094ef5c12.js +0 -1
  335. package/assets/esri/core/workers/chunks/666f201d222c50ab8428.js +0 -1
  336. package/assets/esri/core/workers/chunks/66d4cbb35d0c290150bf.js +0 -1
  337. package/assets/esri/core/workers/chunks/677d3674cb2c0c05fb7e.js +0 -1
  338. package/assets/esri/core/workers/chunks/6f58ec80abebb7bfbbb0.js +0 -1
  339. package/assets/esri/core/workers/chunks/7100c9038739121c2c4b.js +0 -1
  340. package/assets/esri/core/workers/chunks/7380177f16d914fdbc63.js +0 -1
  341. package/assets/esri/core/workers/chunks/794f604d4267e374f7dd.js +0 -1
  342. package/assets/esri/core/workers/chunks/7ae8f73c8e2afae98ecb.js +0 -1
  343. package/assets/esri/core/workers/chunks/7d4af7e2cb2f234e12eb.js +0 -1
  344. package/assets/esri/core/workers/chunks/7dba4121cdd20dbc4b20.js +0 -1
  345. package/assets/esri/core/workers/chunks/807b12ace0099300b9b9.js +0 -1
  346. package/assets/esri/core/workers/chunks/816a4b03f2ea49238a6c.js +0 -1
  347. package/assets/esri/core/workers/chunks/842b442cc012d0797333.js +0 -1
  348. package/assets/esri/core/workers/chunks/8903ff28896bd6f34b0d.js +0 -1
  349. package/assets/esri/core/workers/chunks/89e9bc8789b100316136.js +0 -1
  350. package/assets/esri/core/workers/chunks/8afe32d3db9669f972bc.js +0 -1
  351. package/assets/esri/core/workers/chunks/91fd28f50477d16e294e.js +0 -1
  352. package/assets/esri/core/workers/chunks/953f671bdeb2ca9b9f37.js +0 -1
  353. package/assets/esri/core/workers/chunks/98011b93acf3d5f0b5a2.js +0 -1
  354. package/assets/esri/core/workers/chunks/9c7fd5db0813bdc38582.js +0 -1
  355. package/assets/esri/core/workers/chunks/a2fee1611319665e6aed.js +0 -1
  356. package/assets/esri/core/workers/chunks/a644e30f65347ce846ed.js +0 -1
  357. package/assets/esri/core/workers/chunks/a64daa4945923a178fe5.js +0 -1
  358. package/assets/esri/core/workers/chunks/a84d67c1a1008bca2075.js +0 -1
  359. package/assets/esri/core/workers/chunks/a85575a8d1da09280cd7.js +0 -1
  360. package/assets/esri/core/workers/chunks/ac4f7309a249132c22da.js +0 -1
  361. package/assets/esri/core/workers/chunks/aeb1900cfdd0e51cc5f8.js +0 -1
  362. package/assets/esri/core/workers/chunks/ba62f3aa811430787863.js +0 -1
  363. package/assets/esri/core/workers/chunks/bb659dcd297b895830df.js +0 -1
  364. package/assets/esri/core/workers/chunks/c03d0091a6f385b9ce8d.js +0 -1
  365. package/assets/esri/core/workers/chunks/c20aaca8085ce897bd12.js +0 -1
  366. package/assets/esri/core/workers/chunks/c3e711dc608eedda2d14.js +0 -1
  367. package/assets/esri/core/workers/chunks/c48d1ee37c207bfb0aac.js +0 -1
  368. package/assets/esri/core/workers/chunks/c4a9006cc6d2938570e0.js +0 -1
  369. package/assets/esri/core/workers/chunks/c692ea68509bddbf7b42.js +0 -1
  370. package/assets/esri/core/workers/chunks/cb8c17daec7055bf99cc.js +0 -1
  371. package/assets/esri/core/workers/chunks/d7439d357f68160844cb.js +0 -1
  372. package/assets/esri/core/workers/chunks/df3e79b56c37156e7895.js +0 -1
  373. package/assets/esri/core/workers/chunks/df8b80b17e371c9be4e6.js +0 -1
  374. package/assets/esri/core/workers/chunks/e77198f8ab47441423c5.js +0 -1
  375. package/assets/esri/core/workers/chunks/e786da40a1c87bed64ca.js +0 -1
  376. package/assets/esri/core/workers/chunks/e8aafef6342c50340a27.js +0 -1
  377. package/assets/esri/core/workers/chunks/ec00348d74e29f48613a.js +0 -1
  378. package/assets/esri/core/workers/chunks/f4201e7dcae224d0caf0.js +0 -1
  379. package/assets/esri/core/workers/chunks/f7cc05fbfc97b4d36eba.js +0 -1
  380. package/assets/esri/core/workers/chunks/f9d369a4683f88ee9d76.js +0 -1
  381. package/assets/esri/core/workers/chunks/fc534c94d55331578195.js +0 -1
  382. package/assets/esri/themes/base/colors/css/brand_colors.css +0 -76
  383. package/assets/esri/themes/base/colors/css/calcite_core_colors.css +0 -169
  384. package/assets/esri/themes/base/colors/css/calcite_core_colors_dark.css +0 -169
  385. package/assets/esri/themes/base/colors/css/calcite_gray_colors.css +0 -43
  386. package/assets/esri/themes/base/colors/css/calcite_gray_colors_dark.css +0 -43
  387. package/assets/esri/themes/base/colors/css/calcite_highlight_colors.css +0 -43
  388. package/assets/esri/themes/base/colors/css/calcite_highlight_colors_dark.css +0 -43
  389. package/assets/esri/themes/base/colors/css/calcite_vibrant_colors.css +0 -67
  390. package/assets/esri/themes/base/colors/css/calcite_vibrant_colors_dark.css +0 -67
  391. package/assets/esri/themes/base/colors/css/complete.css +0 -610
  392. package/assets/esri/themes/base/colors/css/scss/brand_colors.scss +0 -128
  393. package/assets/esri/themes/base/colors/css/scss/calcite_core_colors.scss +0 -289
  394. package/assets/esri/themes/base/colors/css/scss/calcite_core_colors_dark.scss +0 -285
  395. package/assets/esri/themes/base/colors/css/scss/calcite_gray_colors.scss +0 -96
  396. package/assets/esri/themes/base/colors/css/scss/calcite_gray_colors_dark.scss +0 -91
  397. package/assets/esri/themes/base/colors/css/scss/calcite_highlight_colors.scss +0 -69
  398. package/assets/esri/themes/base/colors/css/scss/calcite_highlight_colors_dark.scss +0 -65
  399. package/assets/esri/themes/base/colors/css/scss/calcite_vibrant_colors.scss +0 -128
  400. package/assets/esri/themes/base/colors/css/scss/calcite_vibrant_colors_dark.scss +0 -124
  401. package/assets/esri/themes/base/colors/css/scss/complete.scss +0 -11
  402. package/assets/esri/themes/base/colors/patterns_json/brand_colors.css +0 -366
  403. package/assets/esri/themes/base/colors/patterns_json/calcite_core_colors.css +0 -687
  404. package/assets/esri/themes/base/colors/patterns_json/calcite_core_colors_dark.css +0 -673
  405. package/assets/esri/themes/base/colors/patterns_json/calcite_gray_colors.css +0 -177
  406. package/assets/esri/themes/base/colors/patterns_json/calcite_gray_colors_dark.css +0 -169
  407. package/assets/esri/themes/base/colors/patterns_json/calcite_highlight_colors.css +0 -178
  408. package/assets/esri/themes/base/colors/patterns_json/calcite_highlight_colors_dark.css +0 -169
  409. package/assets/esri/themes/base/colors/patterns_json/calcite_vibrant_colors.css +0 -273
  410. package/assets/esri/themes/base/colors/patterns_json/calcite_vibrant_colors_dark.css +0 -265
  411. package/assets/esri/themes/base/colors/patterns_json/complete.css +0 -2847
  412. package/assets/esri/themes/base/colors/patterns_json/scss/brand_colors.scss +0 -464
  413. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_core_colors.scss +0 -967
  414. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_core_colors_dark.scss +0 -964
  415. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_gray_colors.scss +0 -265
  416. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_gray_colors_dark.scss +0 -263
  417. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_highlight_colors.scss +0 -237
  418. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_highlight_colors_dark.scss +0 -235
  419. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_vibrant_colors.scss +0 -376
  420. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_vibrant_colors_dark.scss +0 -347
  421. package/assets/esri/themes/base/colors/patterns_json/scss/complete.scss +0 -12
  422. package/assets/esri/themes/base/icons/readme/download.png +0 -0
  423. package/assets/esri/themes/base/icons/readme/import-icons.png +0 -0
  424. package/assets/esri/themes/base/icons/readme/import.png +0 -0
  425. package/assets/esri/themes/base/icons/readme/load.png +0 -0
  426. package/assets/esri/themes/base/icons/selection.json +0 -1
  427. package/assets/esri/themes/base/icons/style.css +0 -774
  428. package/views/2d/engine/brushes.js +0 -2
  429. package/views/2d/engine/flow/BrushFlow.js +0 -2
  430. package/views/2d/engine/rasterBrushes.js +0 -2
  431. package/views/2d/engine/webgl/brushes/BrushClip.js +0 -2
  432. package/views/2d/engine/webgl/brushes/WGLBrush.js +0 -2
  433. package/views/2d/engine/webgl/painter/RenderPass.js +0 -2
  434. package/views/2d/engine/webgl/shaders/BackgroundPrograms.js +0 -2
  435. package/views/2d/engine/webgl/shaders/TileInfoPrograms.js +0 -2
  436. package/views/3d/webgl-engine/lib/GLMaterials.js +0 -2
  437. /package/assets/esri/core/workers/chunks/{386435341e949f5573b4.js.LICENSE.txt → 0fc60b4c44c4e865b699.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{unique as r}from"../../../core/arrayUtils.js";import{EventEmitter as t}from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as s,everyMap as i}from"../../../core/MapUtils.js";import{disposeMaybe as n}from"../../../core/maybe.js";import a from"../../../core/PooledArray.js";import{watch as o,syncAndInitial as h,on as d,initial as l}from"../../../core/reactiveUtils.js";import{someSet as c}from"../../../core/SetUtils.js";import{property as u,subclass as p}from"../../../core/accessorSupport/decorators.js";import{ortho as _,fromTranslation as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{debugFlags as f}from"../support/debugFlags.js";import{Overlay as R}from"./Overlay.js";import{OverlayRenderTargets as v}from"./OverlayRenderTargets.js";import w from"../webgl/RenderCamera.js";import{SyncRenderPlugin as x}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as T,renderHighlightBuffer as b}from"../webgl-engine/effects/highlight/Highlight.js";import{GLMaterialRepository as S}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as O}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderContext as D,defaultRenderOccludedMask as C}from"../webgl-engine/lib/RenderContext.js";import{ShadowMap as P}from"../webgl-engine/lib/ShadowMap.js";import{T as j}from"../../../chunks/Texture.glsl.js";import{TextureTechnique as E}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as M}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{AmbientLight as F}from"../webgl-engine/lighting/Lightsources.js";import{O as W}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as V}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as q,noBudget as A}from"../../support/Scheduler.js";import G from"../../webgl/Texture.js";import{TextureDescriptor as k}from"../../webgl/TextureDescriptor.js";let I=class extends x{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new W,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new a,this._passParameters=new j,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new w,this.events=new t,this.longitudeCyclical=null,this.produces=new Map([[19,e=>10!==e||this.hasHighlights],[20,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;const{state:r,stage:s}=e.parent.view,i=s.renderer.fboCache,n=s.renderView.renderingContext,o=s.renderView.techniques;this._renderContext=new D(n,new P(i,r.viewingMode),o)}initialize(){const e=this._view,r=e.stage.renderView.waterTextures;this.addHandles([o(()=>r.updating,()=>this.events.emit("content-changed"),h),o(()=>this._spatialReference,e=>this._localOriginFactory=new O(e),h),d(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),o(()=>T(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,l),o(()=>e.state.highlights,r=>{this._bindParameters.highlights=r,this._bindParameters.highlightOrderMap=e.state.highlightOrderMap},l),e.resourceController.scheduler.registerTask(q.OVERLAY_RENDERER,this)]);const t=this._camera;t.near=1,t.far=1e4,t.relativeElevation=null,this._bindParameters.slot=19,this._bindParameters.camera=t,this._bindParameters.updateLighting(new F(y()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=n(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const r=new S(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:r},this._techniques.precompile(V)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||s(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const r of this._renderers.values()){const t=r.getMaterialRenderer(e);if(t)return t}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),r(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,r){const t=this._renderers.get(e);null!=t&&t.destroy(),this._renderers.set(e,r),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(o(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&c(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=c(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=c(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=c(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new v(this._stage.renderer.fboCache),this._overlays=[new R,new R]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){const r=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(r?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(e,()=>!0)}_onMaterialOrContentChanged(){this.renderOccludedFlags=s(this._renderers,e=>e.hasOccluders)?L:1}_processDrapeSources(e,r){let t=!1;for(const[s,i]of this._renderers){if(e.done)break;(s.destroyed||r(s))&&(i.commitChanges()&&(t=!0,e.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,t=!0,this._updateSortedDrapeSourceRenderers(),e.madeProgress()),this.compact(e),t&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=s(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let r=!1;for(const t of this._renderers.values()){if(e.done)break;r=t.compact(e)||r}return r&&this.notifyChange("updating"),r}hasHighlight(e){return s(this._renderers,r=>r.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(A,e=>1===e.updatePolicy)}get isEmpty(){return!f.OVERLAY_DRAW_DEBUG_TEXTURE&&i(this._renderers,e=>e.isEmpty)}get hasWater(){const e=s(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const r=this._overlays[0];for(const i of this._overlays)i.setupGeometryViews(this.longitudeCyclical);if(!r.hasSomeSizedView())return!1;const t=this._setOutput(this._renderTargets?.targets.find(r=>r.content===e)?.output??0);++this._techniques.precompiling;const s=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(t),s}_setOutput(e){const r=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=4===e?20:19,r}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let r=!1;return this._renderers.forEach(t=>r=t.updateAnimation(e)||r),r&&this.parent.requestRender(0),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const r=this._bindParameters;r.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const t of this._renderTargets.targets){if(1===t.content&&!this._needsColorWithoutRasterImage)continue;const{output:e}=t;this._setOutput(e),10===e&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null);const s=this._renderContext.renderOccludedMask;4===t.content&&(this._renderContext.renderOccludedMask=L),this._sortedRenderers.forAll(({drapeSource:e,renderer:r})=>{1===t.content&&0===e.drapeSourceType||4===t.content&&r.hasOnlyOccluders||r.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=s,r.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,r){if(!this._overlays||!this._renderTargets)return;for(const s of this._overlays)s.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const t=this.allSourcesOccluders;for(const s of this._renderTargets.targets){if(!(0===s.content&&this._hasDrapedFlowSource)&&!s.handleRenderRequest(r)||1===s.content&&!this._needsColorWithoutRasterImage||4===s.content&&t)continue;const e=this._drawTarget(0,s),i=this._drawTarget(1,s);(e||i)&&s.fbo.generateMipMap()}}_drawTarget(e,r){const t=this._overlays[e],s=t.canvasGeometries;if(0===s.numViews)return!1;const i=this._view.state.contentPixelRatio;this._screenToWorldRatio=i*t.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:n,content:a}=r;if(this.isEmpty||4===n&&!this.hasWater||!t.hasSomeSizedView())return!1;const{_rctx:o,_camera:h,_renderContext:d,_bindParameters:l}=this;if(h.pixelRatio=t.pixelRatio*i,this._setOutput(n),l.screenToWorldRatio=this._screenToWorldRatio,l.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===a&&(d.renderOccludedMask=L),!this.renders(a))return d.renderOccludedMask=C,!1;const{resolution:c}=t,u=0===e,p=u?0:c;o.setViewport(p,0,c,c),this._bindTargetFBO(r),u&&(10===n?o.gl.clearBufferuiv(o.gl.COLOR,0,[0,0,0,0]):(o.setClearColor(0,0,0,0),o.clear(16384)));if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==a&&2!==a){this._techniques.precompile(E,z);const r=this._techniques.get(E,z);for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],t),this._ensureDebugPatternResources(t.resolution,B[e]),o.bindTechnique(r,l,this._passParameters),o.screen.draw()}if(10===n){const{fboCache:t}=this._stage.renderer,s=this._resolution;this._bindTargetFBO(r),b(o,t,s,s,l,()=>this._renderAllGeometry(e,r),p)}else this._renderAllGeometry(e,r);return o.bindFramebuffer(null),d.renderOccludedMask=C,!0}get allSourcesOccluders(){return i(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,r){const t=this._overlays[e],s=t.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:i,renderer:n})=>{if(1===r.content&&0===i.drapeSourceType)return;const{fullOpacity:a}=i,o=null!=a&&a<1&&0===r.output&&this._bindTemporaryFBO();for(let e=0;e<s.numViews;e++)this._setViewParameters(s.extents[e],t),n.render(this._renderContext);if(o){this._bindTargetFBO(r),this._overlayParameters.texture=o.getTexture(),this._overlayParameters.opacity=a,this._overlayParameters.overlayIndex=e;const t=this._techniques.get(V);this._rctx.bindTechnique(t,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),o.release()}})}_bindTargetFBO(e){const r=this._resolution,t=2*r;e.fbo.ensureFramebuffer(t,r),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,r=2*e,t=this._stage.renderer.fboCache,s=t.acquire(r,e,"overlay tmp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clear(16384),s}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,r,t,s){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(const{renderer:n}of this._sortedRenderers)i=n.intersect?.(e,r,t,s,i)??i}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),r=e.length;this._renderers.forEach((t,s)=>{const i=e.indexOf(s.layer?.uid),n=i>=0,a=s.renderGroup??(n?0:1),o=s.drapeSourcePriorityOffset??0,h=r*a+(n?i:0)+o;this._sortedRenderers.push(new U(s,t,h))}),this._sortedRenderers.sort((e,r)=>e.index-r.index)}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],_(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),g(t.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,r){if(m(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let n=0;n<e;n++)for(let r=0;r<e;r++){const i=Math.floor(r/10),a=Math.floor(n/10);i<2||a<2||10*i>e-20||10*a>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&a?1&r^1&n?0:255:1&i^1&a?0:128)}const i=new k(e);i.samplingMode=9728,this._passParameters.texture=new G(this._rctx,i,t)}get test(){}};e([u()],I.prototype,"hasHighlights",void 0),e([u()],I.prototype,"renderOccludedFlags",void 0),e([u()],I.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([u({constructOnly:!0})],I.prototype,"parent",void 0),e([u({readOnly:!0})],I.prototype,"_techniques",null),e([u({type:Boolean,readOnly:!0})],I.prototype,"updating",null),e([u()],I.prototype,"isEmpty",null),I=e([p("esri.views.3d.terrain.OverlayRenderer")],I);class U{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const B=[[1,.5,.5],[.5,.5,1]],H=-2,L=4,z=new M;z.hasAlpha=!0;export{I as OverlayRenderer,H as drapedZ,L as overlayRenderOccludedFlag};
2
+ import{__decorate as e}from"tslib";import{unique as r}from"../../../core/arrayUtils.js";import{EventEmitter as t}from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as s,everyMap as i}from"../../../core/MapUtils.js";import{disposeMaybe as n}from"../../../core/maybe.js";import a from"../../../core/PooledArray.js";import{watch as o,syncAndInitial as h,on as d,initial as l}from"../../../core/reactiveUtils.js";import{someSet as c}from"../../../core/SetUtils.js";import{property as u,subclass as p}from"../../../core/accessorSupport/decorators.js";import{ortho as _,fromTranslation as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{debugFlags as f}from"../support/debugFlags.js";import{Overlay as R}from"./Overlay.js";import{OverlayRenderTargets as v}from"./OverlayRenderTargets.js";import w from"../webgl/RenderCamera.js";import{SyncRenderPlugin as x}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as T,renderHighlightBuffer as b}from"../webgl-engine/effects/highlight/Highlight.js";import{GLMaterialRepository as S}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as O}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderContext as D,defaultRenderOccludedMask as C}from"../webgl-engine/lib/RenderContext.js";import{ShadowMap as P}from"../webgl-engine/lib/ShadowMap.js";import{T as j}from"../../../chunks/Texture.glsl.js";import{TextureTechnique as E}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as M}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{AmbientLight as F}from"../webgl-engine/lighting/Lightsources.js";import{O as W}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as V}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as q}from"../../support/Scheduler.js";import A from"../../webgl/Texture.js";import{TextureDescriptor as G}from"../../webgl/TextureDescriptor.js";let k=class extends x{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new W,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new a,this._passParameters=new j,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new w,this.events=new t,this.longitudeCyclical=null,this.produces=new Map([[19,e=>10!==e||this.hasHighlights],[20,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;const{state:r,stage:s}=e.parent.view,i=s.renderer.fboCache,n=s.renderView.renderingContext,o=s.renderView.techniques;this._renderContext=new D(n,new P(i,r.viewingMode),o)}initialize(){const e=this._view,r=e.stage.renderView.waterTextures;this.addHandles([o(()=>r.updating,()=>this.events.emit("content-changed"),h),o(()=>this._spatialReference,e=>this._localOriginFactory=new O(e),h),d(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),o(()=>T(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,l),o(()=>e.state.highlights,r=>{this._bindParameters.highlights=r,this._bindParameters.highlightOrderMap=e.state.highlightOrderMap},l),e.resourceController.scheduler.registerTask(q.OVERLAY_RENDERER,this)]);const t=this._camera;t.near=1,t.far=1e4,t.relativeElevation=null,this._bindParameters.slot=19,this._bindParameters.camera=t,this._bindParameters.updateLighting(new F(y()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=n(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const r=new S(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:r},this._techniques.precompile(V)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||s(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const r of this._renderers.values()){const t=r.getMaterialRenderer(e);if(t)return t}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),r(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,r){const t=this._renderers.get(e);null!=t&&t.destroy(),this._renderers.set(e,r),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(o(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&c(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=c(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=c(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=c(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new v(this._stage.renderer.fboCache),this._overlays=[new R,new R]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){const r=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(r?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=s(this._renderers,e=>e.hasOccluders)?H:1}_processDrapeSources(e,r){let t=!1;for(const[s,i]of this._renderers){if(r?.done)break;(s.destroyed||e(s))&&(i.commitChanges()&&(t=!0,r?.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,t=!0,this._updateSortedDrapeSourceRenderers(),r?.madeProgress()),r&&this.compact(r),t&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=s(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let r=!1;for(const t of this._renderers.values()){if(e.done)break;r=t.compact(e)||r}return r&&this.notifyChange("updating"),r}hasHighlight(e){return s(this._renderers,r=>r.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>1===e.updatePolicy)}get isEmpty(){return!f.OVERLAY_DRAW_DEBUG_TEXTURE&&i(this._renderers,e=>e.isEmpty)}get hasWater(){const e=s(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const r=this._overlays[0];for(const i of this._overlays)i.setupGeometryViews(this.longitudeCyclical);if(!r.hasSomeSizedView())return!1;const t=this._setOutput(this._renderTargets?.targets.find(r=>r.content===e)?.output??0);++this._techniques.precompiling;const s=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(t),s}_setOutput(e){const r=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=4===e?20:19,r}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let r=!1;return this._renderers.forEach(t=>r=t.updateAnimation(e)||r),r&&this.parent.requestRender(0),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const r=this._bindParameters;r.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const t of this._renderTargets.targets){if(1===t.content&&!this._needsColorWithoutRasterImage)continue;const{output:e}=t;this._setOutput(e),10===e&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null);const s=this._renderContext.renderOccludedMask;4===t.content&&(this._renderContext.renderOccludedMask=H),this._sortedRenderers.forAll(({drapeSource:e,renderer:r})=>{1===t.content&&0===e.drapeSourceType||4===t.content&&r.hasOnlyOccluders||r.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=s,r.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,r){if(!this._overlays||!this._renderTargets)return;for(const s of this._overlays)s.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const t=this.allSourcesOccluders;for(const s of this._renderTargets.targets){if(!(0===s.content&&this._hasDrapedFlowSource)&&!s.handleRenderRequest(r)||1===s.content&&!this._needsColorWithoutRasterImage||4===s.content&&t)continue;const e=this._drawTarget(0,s),i=this._drawTarget(1,s);(e||i)&&s.fbo.generateMipMap()}}_drawTarget(e,r){const t=this._overlays[e],s=t.canvasGeometries;if(0===s.numViews)return!1;const i=this._view.state.contentPixelRatio;this._screenToWorldRatio=i*t.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:n,content:a}=r;if(this.isEmpty||4===n&&!this.hasWater||!t.hasSomeSizedView())return!1;const{_rctx:o,_camera:h,_renderContext:d,_bindParameters:l}=this;if(h.pixelRatio=t.pixelRatio*i,this._setOutput(n),l.screenToWorldRatio=this._screenToWorldRatio,l.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===a&&(d.renderOccludedMask=H),!this.renders(a))return d.renderOccludedMask=C,!1;const{resolution:c}=t,u=0===e,p=u?0:c;o.setViewport(p,0,c,c),this._bindTargetFBO(r),u&&(10===n?o.gl.clearBufferuiv(o.gl.COLOR,0,[0,0,0,0]):(o.setClearColor(0,0,0,0),o.clear(16384)));if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==a&&2!==a){this._techniques.precompile(E,L);const r=this._techniques.get(E,L);for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],t),this._ensureDebugPatternResources(t.resolution,U[e]),o.bindTechnique(r,l,this._passParameters),o.screen.draw()}if(10===n){const{fboCache:t}=this._stage.renderer,s=this._resolution;this._bindTargetFBO(r),b(o,t,s,s,l,()=>this._renderAllGeometry(e,r),p)}else this._renderAllGeometry(e,r);return o.bindFramebuffer(null),d.renderOccludedMask=C,!0}get allSourcesOccluders(){return i(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,r){const t=this._overlays[e],s=t.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:i,renderer:n})=>{if(1===r.content&&0===i.drapeSourceType)return;const{fullOpacity:a}=i,o=null!=a&&a<1&&0===r.output&&this._bindTemporaryFBO();for(let e=0;e<s.numViews;e++)this._setViewParameters(s.extents[e],t),n.render(this._renderContext);if(o){this._bindTargetFBO(r),this._overlayParameters.texture=o.getTexture(),this._overlayParameters.opacity=a,this._overlayParameters.overlayIndex=e;const t=this._techniques.get(V);this._rctx.bindTechnique(t,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),o.release()}})}_bindTargetFBO(e){const r=this._resolution,t=2*r;e.fbo.ensureFramebuffer(t,r),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,r=2*e,t=this._stage.renderer.fboCache,s=t.acquire(r,e,"overlay tmp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clear(16384),s}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,r,t,s){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(const{renderer:n}of this._sortedRenderers)i=n.intersect?.(e,r,t,s,i)??i}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),r=e.length;this._renderers.forEach((t,s)=>{const i=e.indexOf(s.layer?.uid),n=i>=0,a=s.renderGroup??(n?0:1),o=s.drapeSourcePriorityOffset??0,h=r*a+(n?i:0)+o;this._sortedRenderers.push(new I(s,t,h))}),this._sortedRenderers.sort((e,r)=>e.index-r.index)}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],_(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),g(t.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,r){if(m(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let n=0;n<e;n++)for(let r=0;r<e;r++){const i=Math.floor(r/10),a=Math.floor(n/10);i<2||a<2||10*i>e-20||10*a>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&a?1&r^1&n?0:255:1&i^1&a?0:128)}const i=new G(e);i.samplingMode=9728,this._passParameters.texture=new A(this._rctx,i,t)}get test(){}};e([u()],k.prototype,"hasHighlights",void 0),e([u()],k.prototype,"renderOccludedFlags",void 0),e([u()],k.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([u({constructOnly:!0})],k.prototype,"parent",void 0),e([u({readOnly:!0})],k.prototype,"_techniques",null),e([u({type:Boolean,readOnly:!0})],k.prototype,"updating",null),e([u()],k.prototype,"isEmpty",null),k=e([p("esri.views.3d.terrain.OverlayRenderer")],k);class I{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const U=[[1,.5,.5],[.5,.5,1]],B=-2,H=4,L=new M;L.hasAlpha=!0;export{k as OverlayRenderer,B as drapedZ,H as overlayRenderOccludedFlag};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{MemCachePool as i}from"../../../core/MemCachePool.js";import r from"../../../core/ObjectPool.js";import{watch as s,sync as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../core/accessorSupport/decorators.js";import{subtract as o,set as c,dot as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as h,fromValues as u,create as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as g,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as p,set as m}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as y}from"../../../geometry/support/buffer/BufferView.js";import{overlayRenderOccludedFlag as b}from"./OverlayRenderer.js";import{PatchRenderData as x}from"./PatchRenderData.js";import{TerrainAttributesCache as T}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as R}from"./terrainUtils.js";import{TileRenderer as v}from"./TileRenderer.js";import{IteratorPreorder as P,fallsWithinLayerView as O,sortTiles as w,compareTiles as D}from"./tileUtils.js";import{getOverlayContentForOutputTerrain as S}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as B}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as E}from"../webgl-engine/lib/Attribute.js";import{IntersectorResult as F}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as j,MeshIntersectionOptions as q,intersectTriangles as C}from"../webgl-engine/lib/RayIntersections.js";import{TriangleIntersectionData as A}from"../webgl-engine/lib/TriangleIntersectionData.js";import{terrainId as M,getVerticalOffsetTerrain as G}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as U}from"../webgl-engine/materials/DrawParameters.js";import{T as k}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as I}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as N}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as L}from"../../webgl/enums.js";const V=7,z=10,H=200,Q=p();let W=class extends B{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return 1===this._stage.viewingMode}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,s,n,a){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=s,this._compressionTracker=n,this.type=7,this.isGround=!0,this._passParameters=new k,this._drawParameters=new U,this._renderDataPool=new r(()=>new x),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new P,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>1===this._desiredSlot],[6,()=>6===this._desiredSlot],[8,()=>8===this._desiredSlot],[10,()=>this._produces()&&this.renderOccludedFlags===b]]),this._tileSize=256,this._configuration=new N(1===t.viewingMode),this._tileTextureCache=new i((e,t)=>a.newCache(e,t),"TileTexture"),this.tileGeometryCache=new T(a)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(s(()=>this._overlayRenderer.renderOccludedFlags,()=>this.setNeedsRender(),n))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}get _oitEnabled(){return this._stage.renderer.oitEnabled}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get layerViewUid(){return M}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,32)}reuseTextureFromParent(e){const{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;const i=g(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;const{layerInfo:i,surface:r}=t;for(let s=0;s<i[1].length;s++){const i=r.layerViewByIndex(s,1);if(O(e,i)!==O(t,i))return!1}return!0}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,32===t?0:2),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[0])i.pendingUpdates&=-9;e.resetPendingUpdate(8);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=z-V,i=Math.max(0,Math.floor((e.level-t)/V)*V);if(this._isGlobal&&0===i)return h;for(;e.parent&&e.level>i;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new v(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=t(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&0!==this.transparency)return;const s=Z,n=J;o(s,r,i),c(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,l=e.results.max,h=e.results.ground,u=0===e.options.store,_=!!e.results.ground.target,g=G(e.verticalOffset),f=e.tolerance;let p,b=u&&null!=a.distance?a.distance:1/0;const x=e.options,T=x.normalRequired||!x.backfacesTerrain,R=new q(f,!1,T),v=c=>{const _=c.renderData;if(!_?.vao)return;const v=_.geometry;m(Q,v.boundingBox);const P=_.localOrigin;null!=g&&(g.localOrigin=P,g.applyToAabb(Q));const O=Q;if(K[0]=i[0]-P[0],K[1]=i[1]-P[1],K[2]=i[2]-P[2],!j(O,K,n,f,b))return;const w=(e,t,i)=>{e.set(this.type,c,t,i),b=u&&null!=a.distance?a.distance:1/0},D=(n,o,c)=>{if((!T||null!=c)&&n>=0&&(x.backfacesTerrain||d(c,s)<0)&&(x.invisibleTerrain||!x.selectionMode||null==t||t(i,r,n))){if((null==h.distance||n<h.distance)&&w(h,n,c),x.isFiltered)return;2===x.store&&(null==p?(p=new F(e.ray),w(p,n,c),e.results.all.push(p)):n<p.distance&&w(p,n,c)),(null==a.distance||n<a.distance)&&w(a,n,c),0!==x.store&&(null==l.distance||n>l.distance)&&w(l,n,c)}},S=X;o(S,r,P);const{indices:B,indexCount:q}=v,M=v.vertexAttributes,G=M.getField("position",y),U=new E(G.typedBuffer,3,M.stride/4),k=q/3;if(!g&&k>H){const e=c.renderData;e.intersectionData??=new A(B,k,U),e.intersectionData.intersectRay(K,S,R,D)}else C(K,S,0,k,B,U,g,R,D)},P=this._rootTiles;if(null!=P){(()=>{const t=this._tileIterator;t.reset(P);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==g&&!e.intersectsRay(i,s,f,b)||_&&this._useStencilForTile(e)?t.skipSubtree():v(e)})()}}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return this._oitEnabled?8:6;case 3:case 4:return null}}acquireTechniques(e){const{shadowMap:t,viewshedEnabled:i,cutFillEnabled:r,slot:s,hasEmission:n,useFloatBlend:a}=e.bind,l=!!has("enable-feature:terrain-shadows")&&t.enabled;if(l!==this._castShadows&&(this._castShadows=l,this._patchesByOriginDirty=!0),this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),3===this.transparency)return null;if(10===s){if(0===(e.renderOccludedMask&b))return null}else if(s!==this._desiredSlot)return null;const o=this._configuration;switch(o.screenSpaceReflections=o.cloudReflections=o.receiveShadows=o.receiveAmbientOcclusion=o.renderOccluded=o.hasHighlightMixTexture=o.hasEmission=!1,o.overlayMode=this._overlayRenderer.mode,o.useFloatBlend=a.value,e.output){case 0:case 1:case 2:{const{ssr:i,clouds:r,ssao:a}=e.bind;o.screenSpaceReflections=null!=i.lastFrameColor,o.cloudReflections=null!=r.data;const l=10===s;return o.receiveShadows=t.ready&&!l,o.renderOccluded=l,o.receiveAmbientOcclusion=!l&&null!=a,o.hasEmission=n,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:return this._acquireTechnique(e.output);case 11:return this._acquireTechnique(11);case 10:return o.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,this._passParameters.overlayContent=S(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const t=this._tileRenderer;let i;if(null!=e){const t=e.toUnitRGBA();i=u(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(i),this._allTiles.forAll(e=>t.updateTileTexture(e,0)),this._configuration.tileBlendInput=t.backgroundIsGrid?2:null!=t.backgroundColor?1:0,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)w(i,t);e.sort((e,t)=>D(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange("visibleTiles"),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i){const{rctx:r,bind:s}=e;r.bindTechnique(t,s,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;i.forEach(i=>{this._drawParameters.origin=i[0].renderData.localOrigin,t.program.bindDraw(s,this._passParameters,this._drawParameters);for(let r=0;r<i.length;r++)this._renderPatch(e,t,i[r],L.TRIANGLES,n,null===this._passParameters.overlayContent)}),r.bindVAO(null)}_renderMaterialPass(e,t){const{rctx:i,bind:r}=e,s=i.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const n=10===r.slot;n&&(s.bindTexture("tex",i.emptyTexture),s.setUniform3fv("textureOpacities",h),s.setUniform4fv("texOffsetAndScale",f));const a=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:h;1===this._configuration.tileBlendInput&&s.setUniform3fv("backgroundColor",a);const l=this._stencilEnabledLayerExtents.length>0,o=this.wireframe?L.LINES:L.TRIANGLES;this._configuration.textureFadingEnabled&&s.bindTexture("texNext",i.emptyTexture);const c=this._visiblePatchesByOrigin;for(const d of c.values()){const i=d[0].renderData.localOrigin;this._drawParameters.origin=i,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const r of d){const i=r.renderData,a=i.textureReference;if(null!=a){if(!n){s.setUniform4fv("texOffsetAndScale",a.offsetAndScale),s.bindTexture("tex",a.texture.texture);const e=i.textureFadeFactor,t=e<1?i.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(s.setUniform1f("fadeFactor",e),s.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),s.setUniform3fv("nextTexOpacities",t.opacities),s.bindTexture("texNext",t.texture.texture)):s.setUniform1f("fadeFactor",1),i.textureIsFading&&this.setNeedsRender(2),s.setUniform3fv("textureOpacities",a.opacities)}this._renderPatch(e,t,r,o,l),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}i.bindVAO(null)}_renderPatch(e,t,i,r,s,n=!1){const a=i.renderData,l=a.vao,o=l?.indexBuffer;if(!l||null==o)return void(R&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay);const{rctx:d,bind:h}=e;s&&(t.useStencil=this._useStencilForTile(i),d.setPipelineState(t.getPipeline(h)));const u=a.geometry.indexCount;d.bindVAO(l),c.assertCompatibleVertexAttributeLocations(l),d.drawElements(r,u,o.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(I,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([a({readOnly:!0})],W.prototype,"visibleTiles",null),e([a({readOnly:!0})],W.prototype,"_isGlobal",null),e([a()],W.prototype,"renderOccludedFlags",null),e([a({value:!1})],W.prototype,"renderingDisabled",null),e([a({value:!0})],W.prototype,"visible",null),e([a()],W.prototype,"renderPatchBorders",null),e([a()],W.prototype,"wireframe",null),W=e([l("esri.views.3d.terrain.TerrainRenderer")],W);const Z=_(),J=_(),K=_(),X=_();export{W as TerrainRenderer};
2
+ import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{MemCachePool as i}from"../../../core/MemCachePool.js";import r from"../../../core/ObjectPool.js";import{watch as s,sync as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../core/accessorSupport/decorators.js";import{subtract as o,set as c,dot as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as h,fromValues as u,create as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as g,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as p,set as m}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as y}from"../../../geometry/support/buffer/BufferView.js";import{overlayRenderOccludedFlag as b}from"./OverlayRenderer.js";import{PatchRenderData as x}from"./PatchRenderData.js";import{TerrainAttributesCache as T}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as R}from"./terrainUtils.js";import{TileRenderer as v}from"./TileRenderer.js";import{IteratorPreorder as P,fallsWithinLayerView as O,sortTiles as w,compareTiles as S}from"./tileUtils.js";import{getOverlayContentForOutputTerrain as D}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as B}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as E}from"../webgl-engine/lib/Attribute.js";import{IntersectorResult as F}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as j,MeshIntersectionOptions as q,intersectTriangles as C}from"../webgl-engine/lib/RayIntersections.js";import{TriangleIntersectionData as A}from"../webgl-engine/lib/TriangleIntersectionData.js";import{terrainId as M,getVerticalOffsetTerrain as G}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as U}from"../webgl-engine/materials/DrawParameters.js";import{T as k}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as I}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as N}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as L}from"../../webgl/enums.js";const V=7,z=10,H=200,Q=p();let W=class extends B{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return 1===this._stage.viewingMode}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,s,n,a){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=s,this._compressionTracker=n,this.type=7,this.isGround=!0,this._passParameters=new k,this._drawParameters=new U,this._renderDataPool=new r(()=>new x),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new P,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>1===this._desiredSlot],[6,()=>6===this._desiredSlot],[8,()=>8===this._desiredSlot],[10,()=>this._produces()&&this.renderOccludedFlags===b]]),this._tileSize=256,this._configuration=new N(1===t.viewingMode),this._tileTextureCache=new i((e,t)=>a.newCache(e,t),"TileTexture"),this.tileGeometryCache=new T(a)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(s(()=>this._overlayRenderer.renderOccludedFlags,()=>this.setNeedsRender(),n))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}get _oitEnabled(){return this._stage.renderer.oitEnabled}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get layerViewUid(){return M}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,32)}reuseTextureFromParent(e){const{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;const i=g(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;const{layerInfo:i,surface:r}=t;for(let s=0;s<i[1].length;s++){const i=r.layerViewByIndex(s,1);if(O(e,i)!==O(t,i))return!1}return!0}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,32===t?0:2),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[0])i.pendingUpdates&=-9;e.resetPendingUpdate(8);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=z-V,i=Math.max(0,Math.floor((e.level-t)/V)*V);if(this._isGlobal&&0===i)return h;for(;e.parent&&e.level>i;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new v(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=t(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&0!==this.transparency)return;const s=Z,n=J;o(s,r,i),c(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,l=e.results.max,h=e.results.ground,u=0===e.options.store,_=!!e.results.ground.target,g=G(e.verticalOffset),f=e.tolerance;let p,b=u&&null!=a.distance?a.distance:1/0;const x=e.options,T=x.normalRequired||!x.backfacesTerrain,R=new q(f,!1,T),v=c=>{const _=c.renderData;if(!_?.vao)return;const v=_.geometry;m(Q,v.boundingBox);const P=_.localOrigin;null!=g&&(g.localOrigin=P,g.applyToAabb(Q));const O=Q;if(K[0]=i[0]-P[0],K[1]=i[1]-P[1],K[2]=i[2]-P[2],!j(O,K,n,f,b))return;const w=(e,t,i)=>{e.set(this.type,c,t,i),b=u&&null!=a.distance?a.distance:1/0},S=(n,o,c)=>{if((!T||null!=o)&&n>=0&&(x.backfacesTerrain||d(o,s)<0)&&(x.invisibleTerrain||!x.selectionMode||null==t||t(i,r,n))){if((null==h.distance||n<h.distance)&&w(h,n,o),x.isFiltered)return;2===x.store&&(null==p?(p=new F(e.ray),w(p,n,o),e.results.all.push(p)):n<p.distance&&w(p,n,o)),(null==a.distance||n<a.distance)&&w(a,n,o),0!==x.store&&(null==l.distance||n>l.distance)&&w(l,n,o)}},D=X;o(D,r,P);const{indices:B,indexCount:q}=v,M=v.vertexAttributes,G=M.getField("position",y),U=new E(G.typedBuffer,3,M.stride/4),k=q/3;if(!g&&k>H){const e=c.renderData;e.intersectionData??=new A(B,k,U),e.intersectionData.intersectRay(K,D,R,S)}else C(K,D,0,k,B,U,g,R,S)},P=this._rootTiles;if(null!=P){(()=>{const t=this._tileIterator;t.reset(P);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==g&&!e.intersectsRay(i,s,f,b)||_&&this._useStencilForTile(e)?t.skipSubtree():v(e)})()}}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return this._oitEnabled?8:6;case 3:case 4:return null}}acquireTechniques(e){const{shadowMap:t,viewshedEnabled:i,cutFillEnabled:r,slot:s,hasEmission:n,useFloatBlend:a}=e.bind,l=!!has("enable-feature:terrain-shadows")&&t.enabled;if(l!==this._castShadows&&(this._castShadows=l,this._patchesByOriginDirty=!0),this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),3===this.transparency)return null;if(10===s){if(0===(e.renderOccludedMask&b))return null}else if(s!==this._desiredSlot)return null;const o=this._configuration;switch(o.screenSpaceReflections=o.cloudReflections=o.receiveShadows=o.receiveAmbientOcclusion=o.renderOccluded=o.hasHighlightMixTexture=o.hasEmission=!1,o.overlayMode=this._overlayRenderer.mode,o.useFloatBlend=a.value,e.output){case 0:case 1:case 2:{const{screenSpaceReflections:i,reprojection:r,clouds:a,ssao:l}=e.bind;o.screenSpaceReflections=i.enabled&&null!=r.lastFrameColor,o.cloudReflections=null!=a.data;const c=10===s;return o.receiveShadows=t.ready&&!c,o.renderOccluded=c,o.receiveAmbientOcclusion=!c&&null!=l,o.hasEmission=n,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:return this._acquireTechnique(e.output);case 11:return this._acquireTechnique(11);case 10:return o.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,this._passParameters.overlayContent=D(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const t=this._tileRenderer;let i;if(null!=e){const t=e.toUnitRGBA();i=u(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(i),this._allTiles.forAll(e=>t.updateTileTexture(e,0)),this._configuration.tileBlendInput=t.backgroundIsGrid?2:null!=t.backgroundColor?1:0,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)w(i,t);e.sort((e,t)=>S(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange("visibleTiles"),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i){const{rctx:r,bind:s}=e;r.bindTechnique(t,s,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;i.forEach(i=>{this._drawParameters.origin=i[0].renderData.localOrigin,t.program.bindDraw(s,this._passParameters,this._drawParameters);for(let r=0;r<i.length;r++)this._renderPatch(e,t,i[r],L.TRIANGLES,n,null===this._passParameters.overlayContent)}),r.bindVAO(null)}_renderMaterialPass(e,t){const{rctx:i,bind:r}=e,s=i.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const n=10===r.slot;n&&(s.bindTexture("tex",i.emptyTexture),s.setUniform3fv("textureOpacities",h),s.setUniform4fv("texOffsetAndScale",f));const a=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:h;1===this._configuration.tileBlendInput&&s.setUniform3fv("backgroundColor",a);const l=this._stencilEnabledLayerExtents.length>0,o=this.wireframe?L.LINES:L.TRIANGLES;this._configuration.textureFadingEnabled&&s.bindTexture("texNext",i.emptyTexture);const c=this._visiblePatchesByOrigin;for(const d of c.values()){const i=d[0].renderData.localOrigin;this._drawParameters.origin=i,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const r of d){const i=r.renderData,a=i.textureReference;if(null!=a){if(!n){s.setUniform4fv("texOffsetAndScale",a.offsetAndScale),s.bindTexture("tex",a.texture.texture);const e=i.textureFadeFactor,t=e<1?i.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(s.setUniform1f("fadeFactor",e),s.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),s.setUniform3fv("nextTexOpacities",t.opacities),s.bindTexture("texNext",t.texture.texture)):s.setUniform1f("fadeFactor",1),i.textureIsFading&&this.setNeedsRender(2),s.setUniform3fv("textureOpacities",a.opacities)}this._renderPatch(e,t,r,o,l),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}i.bindVAO(null)}_renderPatch(e,t,i,r,s,n=!1){const a=i.renderData,l=a.vao,o=l?.indexBuffer;if(!l||null==o)return void(R&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay);const{rctx:d,bind:h}=e;s&&(t.useStencil=this._useStencilForTile(i),d.setPipelineState(t.getPipeline(h)));const u=a.geometry.indexCount;d.bindVAO(l),c.assertCompatibleVertexAttributeLocations(l),d.drawElements(r,u,o.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(I,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([a({readOnly:!0})],W.prototype,"visibleTiles",null),e([a({readOnly:!0})],W.prototype,"_isGlobal",null),e([a()],W.prototype,"renderOccludedFlags",null),e([a({value:!1})],W.prototype,"renderingDisabled",null),e([a({value:!0})],W.prototype,"visible",null),e([a()],W.prototype,"renderPatchBorders",null),e([a()],W.prototype,"wireframe",null),W=e([l("esri.views.3d.terrain.TerrainRenderer")],W);const Z=_(),J=_(),K=_(),X=_();export{W as TerrainRenderer};
@@ -83,6 +83,7 @@ export default abstract class ManagedFBO extends ManagedFBOResource {
83
83
  *
84
84
  * If more than one reference exists this will not have an effect.
85
85
  *
86
+ * @returns true if the resource was released for reuse, i.e., the reference count reached zero.
86
87
  * @since 5.0
87
88
  */
88
89
  release(): boolean;
@@ -7,6 +7,7 @@ export default abstract class ManagedFBOResource extends Accessor {
7
7
  *
8
8
  * If more than one reference exists this will not have an effect.
9
9
  *
10
+ * @returns true if the resource was released for reuse, i.e., the reference count reached zero.
10
11
  * @since 5.0
11
12
  */
12
13
  release(): boolean;
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{copy as t,sub as e}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o}from"../../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as s}from"../../../../../geometry/support/DoubleArray.js";import{ComponentObjectElevationAgnosticComponentGeometryBVH as i,intersectTriangleRangeForComponent as a}from"./ComponentObjectElevationAgnosticComponentGeometryBVH.js";import{ElevationAgnosticBVH as r}from"./ElevationAgnosticBVH.js";import{MeshIntersectionOptions as c,computeInvDir as l,intersectAabbInvDir as m}from"../../lib/RayIntersections.js";import{elevationAlignVertexGlobal as h}from"../../lib/triangleIntersectionUtils.js";class p{constructor(t,e,o,s,i,a,c,l){this.vertexData=t,this.vertexStride=e,this.indexData=o,this._componentData=s,this._componentAabbs3D=i,this.geometryMinZ=a,this.planetCenterZ=c,this.localMode=l,this.maxBspNodeDepth=6,this.minElementCountForBVH=10,this.minBspNodeElementCount=3,this._ray0=u,this._ray1=D,this._invDir=n(),this._componentVerticalOffsets=null,this._verticalOffset=null,this._tolerance=0,this._intersectionOptions=y,this._callback=g,this.rayDirectionC=n(),this._componentIndexMap=null,this._bvh=new r(s.count,this),this.componentIntersectionData=new Array(s.count)}get numComponents(){return this._componentData.count}get minZGlobal(){return this.geometryMinZ-this.planetCenterZ}getAabbs2D(){return this.localMode?this.getAabbs2DLocal():this.getAabbs2DGlobal()}getAabbs2DGlobal(){const{numComponents:t,planetCenterZ:e,minZGlobal:n}=this,o=s(4*t),i=this._componentAabbs3D;for(let s=0;s<t;++s){const t=6*s,a=i[t+0],r=i[t+1],c=i[t+2],l=i[t+3],m=i[t+4],h=n/(c-e),p=n/(i[t+5]-e),b=Math.min(a*h,a*p),_=Math.min(r*h,r*p),f=Math.max(l*h,l*p),u=Math.max(m*h,m*p),D=4*s;o[D+0]=b,o[D+1]=_,o[D+2]=f,o[D+3]=u}return o}getAabbs2DLocal(){const{numComponents:t}=this,e=s(4*t),n=this._componentAabbs3D;for(let o=0;o<t;++o){const t=6*o,s=n[t+0],i=n[t+1],a=n[t+3],r=n[t+4],c=4*o;e[c+0]=s,e[c+1]=i,e[c+2]=a,e[c+3]=r}return e}intersectRay(t,e,n,o,s,i){const{isVerticalRay:a}=n;this._ray0=t,this._ray1=e,this._componentVerticalOffsets=s??null,this._verticalOffset=i??null,this._tolerance=n.tolerance,this._intersectionOptions=n,this._componentIndexMap=this._bvh.elementIndexMap,l(t,e,this._invDir),this._callback=o,this._bvh.intersectRay(t,e,a),this._callback=g}intersectRange(t,e){const n=this._componentIndexMap,o=this._componentData;for(let s=t;s<e;++s){const t=n?n[s]:s;o.isPickable(t)&&o.isVisible(t)&&this._intersectComponent(t)}}getComponentTriangleCount(t){const e=this._componentData.offsets,n=e[t]/3;return e[t+1]/3-n}getComponentAabb3D(t,e){const n=this._componentAabbs3D,o=6*t;return e[0]=n[o],e[1]=n[o+1],e[2]=n[o+2],e[3]=n[o+3],e[4]=n[o+4],e[5]=n[o+5],e}_intersectComponent(n){const o=this.getComponentAabb3D(n,b);let s=!1;const{localMode:r,_componentVerticalOffsets:c,_verticalOffset:l,_ray0:p,_ray1:u,_invDir:D,planetCenterZ:g,_tolerance:y,rayDirectionC:v,componentIntersectionData:x}=this,{isVerticalRay:A}=this._intersectionOptions,d=this._componentData.offsets,M=t(_,p),O=t(f,u),j=c?.[n]??0,V=j+(l?.offset??0);if(0!==V&&(r?(M[2]=p[2]-V,O[2]=u[2]-V,s=!0):(null!=l&&(l.componentOffset=j),A&&(h(M,-V,g,p),h(O,-V,g,u),s=!0))),null==l||s||0===V||l.applyToAabb(o),!m(o,M,D,y))return;e(v,O,M);const Z=d[n]/3,I=d[n+1]/3,R=I-Z,B=(t,e,o)=>{this._callback(t,e,n,o)},{vertexData:k,vertexStride:G,indexData:w,_intersectionOptions:E}=this,{normalRequired:H}=E;if(R>C){let t=x[n];null==t&&(t=new i(n,k,G,w,Z,I,this.geometryMinZ,g,r),x[n]=t),t.intersectRay(M,O,A,s?0:V,B,H)}else{a(M,v,Z,I,w,k,G,s?0:V,g,H,B)}}}const b=o(),_=n(),f=n(),u=n(),D=n(),g=()=>{},y=new c,C=40;export{p as ComponentObjectElevationAgnosticComponentBVH};
2
+ import{copy as t,sub as e}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o}from"../../../../../geometry/support/aaBoundingBox.js";import{newDoubleArray as s}from"../../../../../geometry/support/DoubleArray.js";import{ComponentObjectElevationAgnosticComponentGeometryBVH as i,intersectTriangleRangeForComponent as a}from"./ComponentObjectElevationAgnosticComponentGeometryBVH.js";import{ElevationAgnosticBVH as r}from"./ElevationAgnosticBVH.js";import{MeshIntersectionOptions as c,computeInvDir as l,intersectAabbInvDir as m}from"../../lib/RayIntersections.js";import{elevationAlignVertexGlobal as h}from"../../lib/triangleIntersectionUtils.js";class p{constructor(t,e,o,s,i,a,c,l){this.vertexData=t,this.vertexStride=e,this.indexData=o,this._componentData=s,this._componentAabbs3D=i,this.geometryMinZ=a,this.planetCenterZ=c,this.localMode=l,this.maxBspNodeDepth=6,this.minElementCountForBVH=10,this.minBspNodeElementCount=3,this._ray0=u,this._ray1=D,this._invDir=n(),this._componentVerticalOffsets=null,this._verticalOffset=null,this._tolerance=0,this._intersectionOptions=y,this._callback=g,this.rayDirectionC=n(),this._componentIndexMap=null,this._bvh=new r(s.count,this),this.componentIntersectionData=new Array(s.count)}get numComponents(){return this._componentData.count}get minZGlobal(){return this.geometryMinZ-this.planetCenterZ}getAabbs2D(){return this.localMode?this.getAabbs2DLocal():this.getAabbs2DGlobal()}getAabbs2DGlobal(){const{numComponents:t,planetCenterZ:e,minZGlobal:n}=this,o=s(4*t),i=this._componentAabbs3D;for(let s=0;s<t;++s){const t=6*s,a=i[t+0],r=i[t+1],c=i[t+2],l=i[t+3],m=i[t+4],h=n/(c-e),p=n/(i[t+5]-e),b=Math.min(a*h,a*p),_=Math.min(r*h,r*p),f=Math.max(l*h,l*p),u=Math.max(m*h,m*p),D=4*s;o[D+0]=b,o[D+1]=_,o[D+2]=f,o[D+3]=u}return o}getAabbs2DLocal(){const{numComponents:t}=this,e=s(4*t),n=this._componentAabbs3D;for(let o=0;o<t;++o){const t=6*o,s=n[t+0],i=n[t+1],a=n[t+3],r=n[t+4],c=4*o;e[c+0]=s,e[c+1]=i,e[c+2]=a,e[c+3]=r}return e}intersectRay(t,e,n,o,s,i){const{isVerticalRay:a}=n;this._ray0=t,this._ray1=e,this._componentVerticalOffsets=s??null,this._verticalOffset=i??null,this._tolerance=n.tolerance,this._intersectionOptions=n,this._componentIndexMap=this._bvh.elementIndexMap,l(t,e,this._invDir),this._callback=o,this._bvh.intersectRay(t,e,a),this._callback=g}intersectRange(t,e){const n=this._componentIndexMap,o=this._componentData;for(let s=t;s<e;++s){const t=n?n[s]:s;o.isPickable(t)&&o.isVisible(t)&&this._intersectComponent(t)}}getComponentTriangleCount(t){const e=this._componentData.offsets,n=e[t]/3;return e[t+1]/3-n}getComponentAabb3D(t,e){const n=this._componentAabbs3D,o=6*t;return e[0]=n[o],e[1]=n[o+1],e[2]=n[o+2],e[3]=n[o+3],e[4]=n[o+4],e[5]=n[o+5],e}_intersectComponent(n){const o=this.getComponentAabb3D(n,b);let s=!1;const{localMode:r,_componentVerticalOffsets:c,_verticalOffset:l,_ray0:p,_ray1:u,_invDir:D,planetCenterZ:g,_tolerance:y,rayDirectionC:v,componentIntersectionData:x}=this,{isVerticalRay:A}=this._intersectionOptions,d=this._componentData.offsets,M=t(_,p),O=t(f,u),j=c?.[n]??0,V=j+(l?.offset??0);if(0!==V&&(r?(M[2]=p[2]-V,O[2]=u[2]-V,s=!0):(null!=l&&(l.componentOffset=j),A&&(h(M,-V,g,p),h(O,-V,g,u),s=!0))),null==l||s||0===V||l.applyToAabb(o),!m(o,M,D,y))return;e(v,O,M);const Z=d[n]/3,I=d[n+1]/3,R=I-Z,B=(t,e,o)=>this._callback(t,o,n,e),{vertexData:k,vertexStride:G,indexData:w,_intersectionOptions:E}=this,{normalRequired:H}=E;if(R>C){let t=x[n];null==t&&(t=new i(n,k,G,w,Z,I,this.geometryMinZ,g,r),x[n]=t),t.intersectRay(M,O,A,s?0:V,B,H)}else{a(M,v,Z,I,w,k,G,s?0:V,g,H,B)}}}const b=o(),_=n(),f=n(),u=n(),D=n(),g=()=>{},y=new c,C=40;export{p as ComponentObjectElevationAgnosticComponentBVH};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{Vertices as t}from"../../lib/Attribute.js";import{TriangleIntersectionData as n}from"../../lib/TriangleIntersectionData.js";class e{constructor(e,r,s,o,i){this._componentOffsets=i,this._intersectionData=new n(s,o,new t(e,3,r))}intersectRay(t,n,e,s){const o=(t,n,e)=>{const o=r(this._componentOffsets,n);s(t,n,o,e)};this._intersectionData.intersectRay(t,n,e,o)}}function r(t,n){const{length:e}=t;if(0===e||n<t[0])return-1;if(n>t[e-1])return e;let r=0,s=e-1;for(;s-r>1;){const e=Math.round(.5*(r+s));n<=t[e]?s=e:r=e}return r}export{e as ComponentObjectFixedBVH};
2
+ import{Vertices as t}from"../../lib/Attribute.js";import{TriangleIntersectionData as n}from"../../lib/TriangleIntersectionData.js";class e{constructor(e,r,s,o,i){this._componentOffsets=i,this._intersectionData=new n(s,o,new t(e,3,r))}intersectRay(t,n,e,s){const o=(t,n,e)=>{const o=r(this._componentOffsets,e);s(t,e,o,n)};this._intersectionData.intersectRay(t,n,e,o)}}function r(t,n){const{length:e}=t;if(0===e||n<t[0])return-1;if(n>t[e-1])return e;let r=0,s=e-1;for(;s-r>1;){const e=Math.round(.5*(r+s));n<=t[e]?s=e:r=e}return r}export{e as ComponentObjectFixedBVH};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{exactEquals as e}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as t}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ComponentTechnique as r}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as s}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as i}from"../../../core/material/MaterialBase.js";import{isColor as o}from"../../../core/shaderLibrary/ShaderOutput.js";class a extends i{constructor(e,t,r,i,o){super(),this.parameters=e,this.key=o,this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this.hasEmissions=u(e,r,i),this.materialPass=n(e,r),this._configuration=new s(i),this._initializeMaterialConfiguration(e,t,r,i)}destroy(){}acquireTechnique(e,t,s,i){const o=this._updateConfiguration(t,s);return e.get(r,o,i.layout)}_initializeMaterialConfiguration(e,t,r,s){const i=this._configuration;i.hasMetallicRoughnessTexture=null!=e.metallicRoughnessTexture,i.hasOcclusionTexture=null!=e.occlusionTexture,i.hasNormalTexture=null!=e.normalTexture,i.sphereDepthInterpolate=e.sphereDepthInterpolate&&i.spherical,i.ellipsoidMode=e.ellipsoidMode,i.doubleSidedMode=e.doubleSided?1:0,i.hasColorTexture=null!=e.baseColorTexture,i.cullFace=e.cullFace,i.alphaDiscardMode=e.alphaDiscardMode,i.hasVertexColors=t.hasVertexColors,i.textureCoordinateType=t.textureCoordinateType,i.shadeNormals=t.shadeNormals,i.normalType=t.hasNormals?1:2,i.hasPolygonOffset=e.polygonOffsetEnabled,i.vertexPositionRotationType=t.vertexPositionRotationType,i.vertexNormalRotationType=t.vertexNormalRotationType,i.componentDataType=r.componentDataType,i.emissionSource=c(e,r,s)}_updateConfiguration(e,t){const r=this._configuration,{identifier:s}=e,i=0===s;r.output=t.output,r.hasEmission=t.hasEmission&&i,r.renderOccluded=10===t.slot,r.terrainDepthTest=i&&t.terrainDepthTest,r.cullAboveTerrain=!!i&&t.cullAboveTerrain;const a=this.isIntegratedMesh?d(t)?h(t)?3:2:1:0;r.integratedMeshMode=a,r.pbrMode=3===a?4:this.usePBR?this.hasParametersFromSource?0!==r.shadeNormals&&this.isIntegratedMesh?0:2:1:0,r.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,r.isGroundSlice=r.hasSlicePlane&&this.isGround;const{materialPass:n}=this;r.blendingEnabled=i&&(1===n||2===n&&e.transparent||4===n)||r.isGroundSlice,r.hasHighlightMixTexture=2===s&&null!=t.highlightMixTexture,r.snowCover=i&&t.snowCover>0,r.vertexDiscardMode=i&&2===n?e.transparent?2:1:0;const l=o(t.output);return r.receiveAmbientOcclusion=l&&this.applySSAO&&!r.renderOccluded&&null!=t.ssao?.getTexture(),r.hasOccludees=l&&t.hasOccludees,r.receiveShadows=l&&t.shadowMap.ready,r.screenSpaceReflections=l&&null!=t.ssr.lastFrameColor,r.cloudReflections=l&&null!=t.clouds.data?.cubeMap?.colorTexture,r}}function n(e,t){const{alphaDiscardMode:r,isIntegratedMesh:s,slicePlaneEnabled:i}=e,{transparent:o,opaqueOverride:a}=t,n=e.opacity<1,l=e.baseColor[3]<1;if(s)return n||i?4:3;if(n)return 1;if(0===a)return 0;if(l||0===r||3===r)return 1;switch(o){case 2:return 0;case 0:return 1;case 1:return 2}}function l(r){return null!=r.emissionTexture||!e(r.emissiveBaseColor,t)}function u(e,t,r){const s=l(e);return r.hasEmissionSupport&&2!==t.emissiveOverride&&(s||2!==t.emissiveSourceOverride)}function c(e,t,r){const s=null!=e.emissionTexture,{emissiveSourceOverride:i}=t,o=1===i,a=2===i,n=u(e,t,r),c=l(e);return n?c?a?s?4:2:o?s?5:7:6:o?7:6:0}function h(e){return null!=e.overlay?.getTexture(3)}function d(e){return null!=e.overlay?.getTexture(1)}export{a as ComponentMaterial,c as calculateEmissionSource,u as calculateHasEmissions,l as calculateHasEmissiveBase,n as computeMaterialPass};
2
+ import{exactEquals as e}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as t}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ComponentTechnique as r}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as s}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as i}from"../../../core/material/MaterialBase.js";import{isColor as o}from"../../../core/shaderLibrary/ShaderOutput.js";class a extends i{constructor(e,t,r,i,o){super(),this.parameters=e,this.key=o,this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this.hasEmissions=u(e,r,i),this.materialPass=n(e,r),this._configuration=new s(i),this._initializeMaterialConfiguration(e,t,r,i)}destroy(){}acquireTechnique(e,t,s,i){const o=this._updateConfiguration(t,s);return e.get(r,o,i.layout)}_initializeMaterialConfiguration(e,t,r,s){const i=this._configuration;i.hasMetallicRoughnessTexture=null!=e.metallicRoughnessTexture,i.hasOcclusionTexture=null!=e.occlusionTexture,i.hasNormalTexture=null!=e.normalTexture,i.sphereDepthInterpolate=e.sphereDepthInterpolate&&i.spherical,i.ellipsoidMode=e.ellipsoidMode,i.doubleSidedMode=e.doubleSided?1:0,i.hasColorTexture=null!=e.baseColorTexture,i.cullFace=e.cullFace,i.alphaDiscardMode=e.alphaDiscardMode,i.hasVertexColors=t.hasVertexColors,i.textureCoordinateType=t.textureCoordinateType,i.shadeNormals=t.shadeNormals,i.normalType=t.hasNormals?1:2,i.polygonOffset=e.polygonOffset,i.vertexPositionRotationType=t.vertexPositionRotationType,i.vertexNormalRotationType=t.vertexNormalRotationType,i.componentDataType=r.componentDataType,i.emissionSource=c(e,r,s)}_updateConfiguration(e,t){const r=this._configuration,{identifier:s}=e,i=0===s;r.output=t.output,r.enableOITOffset=t.enableOITOffset,r.hasEmission=t.hasEmission&&i,r.renderOccluded=10===t.slot,r.terrainDepthTest=i&&t.terrainDepthTest,r.cullAboveTerrain=!!i&&t.cullAboveTerrain;const a=this.isIntegratedMesh?d(t)?h(t)?3:2:1:0;r.integratedMeshMode=a,r.pbrMode=3===a?4:this.usePBR?this.hasParametersFromSource?0!==r.shadeNormals&&this.isIntegratedMesh?0:2:1:0,r.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,r.isGroundSlice=r.hasSlicePlane&&this.isGround;const{materialPass:n}=this;r.transparent=i&&(1===n||2===n&&e.transparent||4===n)||r.isGroundSlice,r.hasHighlightMixTexture=2===s&&null!=t.highlightMixTexture,r.snowCover=i&&t.snowCover>0,r.vertexDiscardMode=i&&2===n?e.transparent?2:1:0;const l=o(t.output);return r.receiveAmbientOcclusion=l&&this.applySSAO&&!r.renderOccluded&&null!=t.ssao?.getTexture(),r.hasOccludees=l&&t.hasOccludees,r.receiveShadows=l&&t.shadowMap.ready,r.screenSpaceReflections=l&&t.screenSpaceReflections.enabled&&null!=t.reprojection.lastFrameColor,r.cloudReflections=l&&null!=t.clouds.data?.cubeMap?.colorTexture,r}}function n(e,t){const{alphaDiscardMode:r,isIntegratedMesh:s,slicePlaneEnabled:i}=e,{transparent:o,opaqueOverride:a}=t,n=e.opacity<1,l=e.baseColor[3]<1;if(s)return n||i?4:3;if(n)return 1;if(0===a)return 0;if(l||0===r||3===r)return 1;switch(o){case 2:return 0;case 0:return 1;case 1:return 2}}function l(r){return null!=r.emissionTexture||!e(r.emissiveBaseColor,t)}function u(e,t,r){const s=l(e);return r.hasEmissionSupport&&2!==t.emissiveOverride&&(s||2!==t.emissiveSourceOverride)}function c(e,t,r){const s=null!=e.emissionTexture,{emissiveSourceOverride:i}=t,o=1===i,a=2===i,n=u(e,t,r),c=l(e);return n?c?a?s?4:2:o?s?5:7:6:o?7:6:0}function h(e){return null!=e.overlay?.getTexture(3)}function d(e){return null!=e.overlay?.getTexture(1)}export{a as ComponentMaterial,c as calculateEmissionSource,u as calculateHasEmissions,l as calculateHasEmissiveBase,n as computeMaterialPass};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{ComponentMaterial as e,computeMaterialPass as r,calculateHasEmissions as t,calculateEmissionSource as o}from"./ComponentMaterial.js";import{ComponentMaterialGlobalParameters as s}from"./ComponentMaterialGlobalParameters.js";class a{constructor(e,r){this._store=new Map,this.globals=new s(e,r)}destroy(){this._store.forEach(({material:e})=>e.destroy()),this._store.clear()}acquire(r,t,o){const s=this.globals,a=l(r,t,o,s),n=this._store.get(a);if(n)return n.refCount++,n.material.key,n.material;const i=new e(r,t,o,s,a);return this._store.set(a,{material:i,refCount:1}),i}release(e){const{key:r}=e,t=this._store.get(r);if(!t||t.refCount<1)throw new Error("Internal error in material repository");1===t.refCount?this._store.delete(r):t.refCount--}}function l(e,s,a,l){const n=r(e,a),i=t(e,a,l),u=o(e,a,l);return"|"+ +l.useFloatBlend+`|${+e.usePBR}|${+e.hasParametersFromSource}|${+e.isGround}`+`|${+e.slicePlaneEnabled}|${+e.isIntegratedMesh}|${+e.applySSAO}`+`|${+n}|${+a.componentDataType}|${+i}|${+u}`+`|${+e.sphereDepthInterpolate}|${+e.ellipsoidMode}|${+e.doubleSided}`+`|${+e.cullFace}|${+e.alphaDiscardMode}`+`|${+s.hasVertexColors}|${+s.textureCoordinateType}`+`|${+s.shadeNormals}|${+s.hasNormals}`+`|${+e.polygonOffsetEnabled}|${+s.vertexPositionRotationType}|${+s.vertexNormalRotationType}|`+ +(null!=e.baseColorTexture)+"|"+ +(null!=e.emissionTexture)+"|"+ +(null!=e.metallicRoughnessTexture)+"|"+ +(null!=e.occlusionTexture)+"|"+ +(null!=e.normalTexture)+"|"+ +a.emissiveOverride}export{a as ComponentMaterialRepository,l as makeMaterialKey};
2
+ import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{ComponentMaterial as e,computeMaterialPass as r,calculateHasEmissions as t,calculateEmissionSource as o}from"./ComponentMaterial.js";import{ComponentMaterialGlobalParameters as s}from"./ComponentMaterialGlobalParameters.js";class a{constructor(e,r){this._store=new Map,this.globals=new s(e,r)}destroy(){this._store.forEach(({material:e})=>e.destroy()),this._store.clear()}acquire(r,t,o){const s=this.globals,a=l(r,t,o,s),n=this._store.get(a);if(n)return n.refCount++,n.material.key,n.material;const i=new e(r,t,o,s,a);return this._store.set(a,{material:i,refCount:1}),i}release(e){const{key:r}=e,t=this._store.get(r);if(!t||t.refCount<1)throw new Error("Internal error in material repository");1===t.refCount?this._store.delete(r):t.refCount--}}function l(e,s,a,l){const n=r(e,a),i=t(e,a,l),u=o(e,a,l);return"|"+ +l.useFloatBlend+`|${+e.usePBR}|${+e.hasParametersFromSource}|${+e.isGround}`+`|${+e.slicePlaneEnabled}|${+e.isIntegratedMesh}|${+e.applySSAO}`+`|${+n}|${+a.componentDataType}|${+i}|${+u}`+`|${+e.sphereDepthInterpolate}|${+e.ellipsoidMode}|${+e.doubleSided}`+`|${+e.cullFace}|${+e.alphaDiscardMode}`+`|${+s.hasVertexColors}|${+s.textureCoordinateType}`+`|${+s.shadeNormals}|${+s.hasNormals}`+`|${e.polygonOffset}|${+s.vertexPositionRotationType}|${+s.vertexNormalRotationType}|`+ +(null!=e.baseColorTexture)+"|"+ +(null!=e.emissionTexture)+"|"+ +(null!=e.metallicRoughnessTexture)+"|"+ +(null!=e.occlusionTexture)+"|"+ +(null!=e.normalTexture)+"|"+ +a.emissiveOverride}export{a as ComponentMaterialRepository,l as makeMaterialKey};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{C as t}from"../../../../../../chunks/ComponentShader.glsl.js";import{isOITColor as i,isOITFrontFace as n}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as o}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../../../core/shaderTechnique/ShaderTechnique.js";import{depthTest as s,blending as a}from"../../../lib/OrderIndependentTransparency.js";import{stencilBaseAllZerosParams as p,stencilWriteMaskOn as d,replaceBitWhenDepthTestPasses as u}from"../../../lib/StencilUtils.js";import{IndexGlLayout as m}from"../../../materials/DefaultLayouts.js";import{i3sHolePolygonOffset as c,OITPolygonOffset as h}from"../../../materials/PolygonOffset.js";import{makePipelineState as f,defaultColorWrite as g,defaultDepthWrite as b,premultipliedAlpha as j,cullingParams as P}from"../../../../../webgl/renderState.js";let S=class extends l{constructor(e,r,i){super(e,r,i.concat(m)),this.shader=new o(t,()=>import("./ComponentShader.glsl.js")),this.ignoreUnused=!0}getPipeline(e){return e.camera.aboveGround||null==this._belowGroundPipeline?super.getPipeline(e):this._belowGroundPipeline}initializePipeline(e){return this._belowGroundPipeline=0===e.integratedMeshMode?null:this._makePipeline(e,!0),this._makePipeline(e,!1)}_makePipeline(e,r){const{integratedMeshMode:t,output:o,blendingEnabled:l,cullFace:m,hasOccludees:S,hasPolygonOffset:w,renderOccluded:O}=e,T=0!==t,y=!i(o),_=n(o);let C=P(m);return r&&C&&(C={...C,mode:2304}),f({blending:O?j:l?a(o):null,culling:C,depthTest:O?null:s(o),depthWrite:O||!y&&!_?null:b,colorWrite:g,stencilWrite:!O&&T||S?d:null,stencilTest:T?u(1):S?p:null,polygonOffset:y||_?w?c:null:h})}};S=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],S);export{S as ComponentTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{C as t}from"../../../../../../chunks/ComponentShader.glsl.js";import{isOITColor as i,isOITFrontFace as o}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as n}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../../../core/shaderTechnique/ShaderTechnique.js";import{depthTest as s,blending as a}from"../../../lib/OrderIndependentTransparency.js";import{stencilBaseAllZerosParams as p,stencilWriteMaskOn as d,replaceBitWhenDepthTestPasses as m}from"../../../lib/StencilUtils.js";import{IndexGlLayout as u}from"../../../materials/DefaultLayouts.js";import{polygonOffset as c}from"../../../materials/PolygonOffset.js";import{makePipelineState as h,defaultColorWrite as f,defaultDepthWrite as g,premultipliedAlpha as b,cullingParams as j}from"../../../../../webgl/renderState.js";let P=class extends l{constructor(e,r,i){super(e,r,i.concat(u)),this.shader=new n(t,()=>import("./ComponentShader.glsl.js")),this.ignoreUnused=!0}getPipeline(e){return e.camera.aboveGround||null==this._belowGroundPipeline?super.getPipeline(e):this._belowGroundPipeline}initializePipeline(e){return this._belowGroundPipeline=0===e.integratedMeshMode?null:this._makePipeline(e,!0),this._makePipeline(e,!1)}_makePipeline(e,r){const{integratedMeshMode:t,output:n,transparent:l,cullFace:u,hasOccludees:P,renderOccluded:S}=e,w=0!==t,T=!i(n),O=o(n);let _=j(u);return r&&_&&(_={..._,mode:2304}),h({blending:S?b:l?a(n):null,culling:_,depthTest:S?null:s(n),depthWrite:S||!T&&!O?null:g,colorWrite:f,stencilWrite:!S&&w||P?d:null,stencilTest:w?m(1):P?p:null,polygonOffset:c(e)})}};P=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],P);export{P as ComponentTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.vertexPositionRotationType=1,this.vertexNormalRotationType=0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=e.sphericalSR,this.useFloatBlend=e.useFloatBlend}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o()],s.prototype,"useFloatBlend",void 0),e([o({count:12})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:7})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"blendingEnabled",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasPolygonOffset",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0),e([o({count:2})],s.prototype,"vertexPositionRotationType",void 0),e([o({count:2})],s.prototype,"vertexNormalRotationType",void 0);export{s as ComponentTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.polygonOffset=0,this.vertexPositionRotationType=1,this.vertexNormalRotationType=0,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.transparent=!0,this.screenSpaceReflections=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.enableOITOffset=!1,this.sphereDepthInterpolate=!1,this.writeDepth=!0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=e.sphericalSR,this.useFloatBlend=e.useFloatBlend}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o()],s.prototype,"useFloatBlend",void 0),e([o({count:12})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:7})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o({count:5})],s.prototype,"polygonOffset",void 0),e([o({count:2})],s.prototype,"vertexPositionRotationType",void 0),e([o({count:2})],s.prototype,"vertexNormalRotationType",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"transparent",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"enableOITOffset",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../../../core/has.js";import e from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as t}from"../../webgl/ManagedDepthTexture.js";import a from"../../webgl/ManagedFBO.js";import{isDepthFormat as r,formatString as c,DepthTextureFormats as h,ColorFormats as i}from"./FBOCacheFormats.js";import{FBOCacheUsage as s}from"./FBOCacheUsage.js";import{FBOPool as o}from"./FBOPool.js";import{DepthStencilAttachment as n,ColorAttachment0 as l}from"../../../webgl/enums.js";import{FramebufferObject as u}from"../../../webgl/FramebufferObject.js";import m from"../../../webgl/Texture.js";class d{constructor(e){this.rctx=e,this._interactive=!1,this._usage=new s,this._acquired=new Set,this._cache=new o(e.newCache,"FBOCache"),this._depthCache=new o(e.newCache,"DepthAttachmentCache"),this._colorCache=new o(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.(),this._usage.clear()}frameEnd(){const{debugCallback:e}=this;e&&(this._usage.summarize(),this._acquired.forEach(t=>e(t.name,t.fbo)))}get usedMemory(){return Array.from(this._acquired.values()).reduce((e,t)=>e+t.usedMemory,this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e,this._interactive=e}get interactive(){return this._interactive}acquire(e,t,h,i=5){const s=p(i,e,t);let o=this._cache.pop(s);const{rctx:m}=this;if(o){o.retain(),o.setName(h);const e=o.getAttachment(n);e&&(e.name=C);const t=o.getAttachment(l);t&&(t.name=_(0)),m.unbindTexture(o.fbo.colorTexture)}else{const c=new u(m),d=(a,r,c)=>{r??=5;const h=this._acquireColor(r,e,t,c??_(a-l));return this.rctx.unbindTexture(h.attachment),o.attachColor(h,a),h.release(),o},p=a=>{a??=13;const r=this.acquireDepth(a,e,t,C);return o.attachDepth(r),r.release(),o},f=()=>{if(!o)return;this.debugCallback?.(o.name,o.fbo),this._acquired.delete(o);const e=r(i);e&&null!=o.getAttachment(n)||!e&&null!=o.getAttachment(l)?(e?(o.fbo?.invalidateAttachments([n]),o.detachAllColors()):(o.fbo?.invalidateAttachments([l]),o.detachAllButColor0()),this._trackRelease(o),this._cache.put(o)):o.dispose()};o=new a(s,h,c,d,p,f),r(i)?o.acquireDepth(i):o.acquireColor(l,i)}return this._trackAcquire(o,"f "+c(i),e,t),this._trackHandle(o)}acquireDepth(e,a,r,i){const s=p(e,a,r);let o=this._depthCache.pop(s);if(o)o.retain(),o.attachment.setShadowFiltering(!1);else{const c=new m(this.rctx,{...h[e],width:a,height:r});o=new t(s,c,()=>{this._trackRelease(o),this._depthCache.put(o)})}return o.name=i,this._trackAcquire(o,"d "+c(e),a,r),o}_acquireColor(t,a,r,h){const s=p(t,a,r);let o=this._colorCache.pop(s);if(o)o.retain();else{const c=new m(this.rctx,{...i[t],width:a,height:r,isImmutable:!0});o=new e(s,c,()=>{this._trackRelease(o),this._colorCache.put(o)})}return o.name=h,this._trackAcquire(o,"c "+c(t),a,r),o}_trackHandle(e){return this._acquired.add(e),e}_trackAcquire(e,t,a,r){this.debugCallback&&this._usage.add(e,t,a,r)}_trackRelease(e){this.debugCallback&&this._usage.remove(e)}get test(){return null}}function _(e=0){return`color${e}`}const C="depth";function p(e,t,a){return`${t}x${a}:${e}`}export{d as FBOCache};
2
+ import"../../../../core/has.js";import e from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as t}from"../../webgl/ManagedDepthTexture.js";import a from"../../webgl/ManagedFBO.js";import{isDepthFormat as r,formatString as c,DepthTextureFormats as h,ColorFormats as i}from"./FBOCacheFormats.js";import{FBOCacheUsage as s}from"./FBOCacheUsage.js";import{FBOPool as o}from"./FBOPool.js";import{DepthStencilAttachment as n,ColorAttachment0 as l}from"../../../webgl/enums.js";import{FramebufferObject as u}from"../../../webgl/FramebufferObject.js";import m from"../../../webgl/Texture.js";class d{constructor(e){this.rctx=e,this._interactive=!1,this._usage=new s,this._acquired=new Set,this._cache=new o(e.newCache,"FBOCache"),this._depthCache=new o(e.newCache,"DepthAttachmentCache"),this._colorCache=new o(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.(),this._usage.clear()}frameEnd(){const{debugCallback:e}=this;e&&(this._usage.summarize(),this._acquired.forEach(t=>e(t.name,t.fbo)))}get usedMemory(){return Array.from(this._acquired.values()).reduce((e,t)=>e+t.usedMemory,this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e,this._interactive=e}get interactive(){return this._interactive}acquire(e,t,h,i=5){const s=p(i,e,t);let o=this._cache.pop(s);const{rctx:m}=this;if(o){o.retain(),o.setName(h);const e=o.getAttachment(n);e&&(e.name=C);const t=o.getAttachment(l);t&&(t.name=_(0)),m.unbindTexture(o.fbo.colorTexture)}else{const c=new u(m),d=(a,r,c)=>{r??=5;const h=this._acquireColor(r,e,t,c??_(a-l));return this.rctx.unbindTexture(h.attachment),o.attachColor(h,a),h.release(),o},p=a=>{a??=13;const r=this.acquireDepth(a,e,t,`${o.name} ${C}`);return o.attachDepth(r),r.release(),o},f=()=>{if(!o)return;this.debugCallback?.(o.name,o.fbo),this._acquired.delete(o);const e=r(i);e&&null!=o.getAttachment(n)||!e&&null!=o.getAttachment(l)?(e?(o.fbo?.invalidateAttachments([n]),o.detachAllColors()):(o.fbo?.invalidateAttachments([l]),o.detachAllButColor0()),this._trackRelease(o),this._cache.put(o)):o.dispose()};o=new a(s,h,c,d,p,f),r(i)?o.acquireDepth(i):o.acquireColor(l,i)}return this._trackAcquire(o,"f "+c(i),e,t),this._trackHandle(o)}acquireDepth(e,a,r,i){const s=p(e,a,r);let o=this._depthCache.pop(s);if(o)o.retain(),o.attachment.setShadowFiltering(!1);else{const c=new m(this.rctx,{...h[e],width:a,height:r});o=new t(s,c,()=>{this._trackRelease(o),this._depthCache.put(o)})}return o.name=i,this._trackAcquire(o,"d "+c(e),a,r),o}_acquireColor(t,a,r,h){const s=p(t,a,r);let o=this._colorCache.pop(s);if(o)o.retain();else{const c=new m(this.rctx,{...i[t],width:a,height:r,isImmutable:!0});o=new e(s,c,()=>{this._trackRelease(o),this._colorCache.put(o)})}return o.name=h,this._trackAcquire(o,"c "+c(t),a,r),o}_trackHandle(e){return this._acquired.add(e),e}_trackAcquire(e,t,a,r){this.debugCallback&&this._usage.add(e,t,a,r)}_trackRelease(e){this.debugCallback&&this._usage.remove(e)}get test(){return null}}function _(e=0){return`color${e}`}const C="depth";function p(e,t,a){return`${t}x${a}:${e}`}export{d as FBOCache};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- class e{constructor(){this._usage=new Map}clear(){this._usage.clear()}add(e,s,t,o){const r=this._usage.get(e);r?(r[2]=!0,r[3].push(e.name)):this._usage.set(e,[s,`${t}x${o}`,!0,[e.name]]);const u=a(this._usage);console.log(Array.from(this._usage.values()).map(([e,a,s,t])=>(s?t[t.length-1]:"").padStart(u," ")).join(" | "))}remove(e){const a=this._usage.get(e);a&&(a[2]=!1)}summarize(){const e=a(this._usage);console.log(Array.from(this._usage.values()).map(([a,s])=>s.padStart(e," ")).join(" | ")),console.log(Array.from(this._usage.keys()).map(({usedMemory:a})=>`${(a/1024/1024).toFixed(1)}MB`.padStart(e," ")).join(" | ")),console.log(Array.from(this._usage.values()).map(([a])=>a.padStart(e," ")).join(" | ")),console.log("Total",(Array.from(this._usage.keys()).reduce((e,{usedMemory:a})=>e+a,0)/1024/1024).toFixed(1),"MB")}}function a(e){return Array.from(e.values()).reduce((e,[a,s,t,o])=>Math.max(a.length,s.length,o.reduce((e,a)=>Math.max(e,a.length),e)),0)}export{e as FBOCacheUsage};
2
+ class a{constructor(){this._usage=new Map,this._pad=0}clear(){this._usage.clear()}add(a,s,t,o){const r=this._usage.get(a);r?(r[2]=!0,r[3].push(a.name)):this._usage.set(a,[s,`${t}x${o}`,!0,[a.name]]),this._pad=Math.max(this._pad,e(this._usage)),console.log(Array.from(this._usage.values()).map(([a,e,s,t])=>(s?t[t.length-1]:"").padStart(this._pad," ")).join(" | "))}remove(a){const e=this._usage.get(a);e&&(e[2]=!1)}summarize(){const a=e(this._usage);console.log(Array.from(this._usage.values()).map(([e,s])=>s.padStart(a," ")).join(" | ")),console.log(Array.from(this._usage.keys()).map(({usedMemory:e})=>`${(e/1024/1024).toFixed(1)}MB`.padStart(a," ")).join(" | ")),console.log(Array.from(this._usage.values()).map(([e])=>e.padStart(a," ")).join(" | ")),console.log("Total",(Array.from(this._usage.keys()).reduce((a,{usedMemory:e})=>a+e,0)/1024/1024).toFixed(1),"MB")}}function e(a){return Array.from(a.values()).reduce((a,[e,s,t,o])=>Math.max(e.length,s.length,o.reduce((a,e)=>Math.max(a,e.length),a)),0)}export{a as FBOCacheUsage};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform as t}from"../../shaderModules/Float2BindUniform.js";import{FloatBindUniform as o}from"../../shaderModules/FloatBindUniform.js";import{glsl as r}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as i}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as a}from"../../shaderModules/Texture2DBindUniform.js";function d(d,n){if(!n.screenSpaceReflections)return;const c=d.fragment;c.include(e),c.uniforms.add(new t("nearFar",e=>e.camera.nearFar),new a("depthMap",e=>e.depth?.attachment),new i("proj",e=>e.camera.projectionMatrix),new o("invResolutionHeight",e=>1/e.camera.height),new i("reprojectionMatrix",e=>e.ssr.reprojectionMatrix)).code.add(r`
2
+ import{ReadDepth as e}from"../output/ReadDepth.glsl.js";import{Float2BindUniform as t}from"../../shaderModules/Float2BindUniform.js";import{FloatBindUniform as o}from"../../shaderModules/FloatBindUniform.js";import{glsl as r}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as i}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as a}from"../../shaderModules/Texture2DBindUniform.js";function d(d,n){if(!n.screenSpaceReflections)return;const c=d.fragment;c.include(e),c.uniforms.add(new t("nearFar",e=>e.camera.nearFar),new a("depthMap",e=>e.depth?.attachment),new i("proj",e=>e.camera.projectionMatrix),new o("invResolutionHeight",e=>1/e.camera.height),new i("reprojectionMatrix",e=>e.reprojection.matrix)).code.add(r`
3
3
  vec2 reprojectionCoordinate(vec3 projectionCoordinate)
4
4
  {
5
5
  vec4 zw = proj * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0);
@@ -40,7 +40,7 @@ vec3 normalCorrectedClouds = mix(localUp, n, correctionViewingFactor);
40
40
  vec3 reflectedWorld = normalize(reflect(-v, normalCorrectedClouds));`),v.cloudReflections&&u.uniforms.add(new l("cloudsOpacity",e=>e.clouds.opacity)).code.add(d`vec4 cloudsColor = renderClouds(reflectedWorld, position);
41
41
  cloudsColor.a = 1.0 - cloudsColor.a;
42
42
  cloudsColor = pow(cloudsColor, vec4(GAMMA));
43
- cloudsColor *= clamp(fresnelModifier.y * cloudFresnelModifier[0] - cloudFresnelModifier[1], 0.0, 1.0) * cloudsOpacity;`),v.screenSpaceReflections?u.uniforms.add(new c("view",e=>e.camera.viewMatrix),new s("lastFrameColorTexture",e=>e.ssr.lastFrameColor?.getTexture()),new l("fadeFactorSSR",e=>e.ssr.fadeFactor)).code.add(d`vec3 viewDir = normalize(viewPosition);
43
+ cloudsColor *= clamp(fresnelModifier.y * cloudFresnelModifier[0] - cloudFresnelModifier[1], 0.0, 1.0) * cloudsOpacity;`),v.screenSpaceReflections?u.uniforms.add(new c("view",e=>e.camera.viewMatrix),new s("lastFrameColorTexture",e=>e.reprojection.lastFrameColor?.getTexture()),new l("fadeFactorSSR",e=>e.screenSpaceReflections.fadeFactor)).code.add(d`vec3 viewDir = normalize(viewPosition);
44
44
  vec4 viewNormalVectorCoordinate = view * vec4(n, 0.0);
45
45
  vec3 viewNormal = normalize(viewNormalVectorCoordinate.xyz);
46
46
  vec4 viewUp = view * vec4(localUp, 0.0);
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import r from"../../../../core/PooledArray.js";class t{constructor(e){this._context=e,this._nodes=new r}destroy(){this._nodes.forEach(e=>e.destroy()),this._nodes.prune()}add(e){this._nodes.push(e)}remove(e){this._nodes.remove(e)}produces(e){return this._nodes.some(({produces:r})=>r===e)}require(e,...r){const t=this._nodes,o=r=>t.reduce((t,{consumes:o,produces:s})=>t+(!o.required.includes(e)||null!=r&&s!==r?0:1),0);return 0===r.length?o():r.reduce((e,r)=>e+o(r),0)}optional(e,...r){const t=this._nodes,o=r=>t.reduce((t,{consumes:o,produces:s})=>t+(!o.optional?.includes(e)||null!=r&&s!==r?0:1),0);return 0===r.length?o():r.reduce((e,r)=>e+o(r),0)}updateAnimation(e){return this._nodes.reduce((r,t)=>t.updateAnimation(e)||r,!1)}precompile(e,...r){++this._context.techniques.precompiling;for(const t of r)this._nodes.forEach(r=>{const o=e||!r.consumes.required.includes("emissive");r.produces===t&&o&&r.precompile()});--this._context.techniques.precompiling}render(e,r,t=()=>{}){return this._render(e,r,t)??e}produce(e,r,t=()=>{}){return this._render(e,r,t)}_render(r,t,o=()=>{}){const s="string"==typeof r?r:r.name,n=this._nodes.filter(({produces:e})=>e===s);if(0===n.length)return;let i="string"==typeof r?null:r;return n.some(r=>{const n=i?[i]:[],c=null==i;for(const e of r.consumes.required){if(e===s){if(c)return!1;continue}const r=t.get(e);if(r)n.push(r);else if("emissive"!==e||!t.get(s)?.hasAttachment(e))return o?.(n),!1}if(r.consumes.optional)for(const e of r.consumes.optional){if(e===s)continue;const r=t.get(e);r&&n.push(r)}try{const o=r.doRender(n);o&&o!==i&&(s!==o.name&&(e.getLogger(r).errorOnce(`RenderNode produced ${o.name}, expected ${s}`),o.setName(s)),i?.release(),i=o,t.set(s,i))}catch(u){e.getLogger(r).errorOnce(u)}return o?.(n),c&&null!=i}),this._context.rctx.enforceState(),i}requireGeometryDepth(){return this._nodes.some(e=>"disabled"!==e.produces&&e.requireGeometryDepth)}get test(){return{nodes:this._nodes}}}export{t as RenderNodes};
2
+ import e from"../../../../core/Logger.js";import r from"../../../../core/PooledArray.js";class t{constructor(e){this._context=e,this._nodes=new r}destroy(){this._nodes.forEach(e=>e.destroy()),this._nodes.prune()}add(e){this._nodes.push(e)}remove(e){this._nodes.remove(e)}produces(e){return this._nodes.some(({produces:r})=>r===e)}require(e,...r){const t=this._nodes,o=r=>t.reduce((t,{consumes:o,produces:s})=>t+(!o.required.includes(e)||null!=r&&s!==r?0:1),0);return 0===r.length?o():r.reduce((e,r)=>e+o(r),0)}optional(e,...r){const t=this._nodes,o=r=>t.reduce((t,{consumes:o,produces:s})=>t+(!o.optional?.includes(e)||null!=r&&s!==r?0:1),0);return 0===r.length?o():r.reduce((e,r)=>e+o(r),0)}updateAnimation(e){return this._nodes.reduce((r,t)=>t.updateAnimation(e)||r,!1)}precompile(e,...r){++this._context.techniques.precompiling;for(const t of r)this._nodes.forEach(r=>{const o=e||!r.consumes.required.includes("emissive");r.produces===t&&o&&r.precompile()});--this._context.techniques.precompiling}render(e,r,t=()=>{}){return this._render(e,r,t)??e}produce(e,r,t=()=>{}){return this._render(e,r,t)}_render(r,t,o=()=>{}){const s="string"==typeof r?r:r.name,n=this._nodes.filter(({produces:e})=>e===s);if(0===n.length)return;let i="string"==typeof r?null:r;return n.some(r=>{const n=i?[i]:[],c=null==i;for(const e of r.consumes.required){if(e===s){if(c)return!1;continue}const r=t.get(e);if(r)n.push(r);else if("emissive"!==e||!t.get(s)?.hasAttachment(e))return o?.(n),!1}if(r.consumes.optional)for(const e of r.consumes.optional){if(e===s)continue;const r=t.get(e);r&&n.push(r)}try{const o=r.doRender(n);o&&o!==i&&(s!==o.name&&(e.getLogger(r).errorOnce(`RenderNode produced ${o.name}, expected ${s}`),o.setName(s)),i?.release(),i=o,t.set(s,i))}catch(u){e.getLogger(r).errorOnce(u)}return o?.(n),c&&null!=i}),this._context.rctx.enforceState(),i}get requireGeometryDepth(){return this._nodes.some(e=>"disabled"!==e.produces&&e.requireGeometryDepth)}get test(){return{nodes:this._nodes}}}export{t as RenderNodes};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{smoothstep as t,clamp as i}from"../../../../../core/mathUtils.js";import{watch as s,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{normalize as h,set as c,dot as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderNodeOutput as p}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{ShadowHighlightPassParameters as l,ShadowHighlightTechnique as u}from"./ShadowHighlightTechnique.js";import{defaultShadowOpacity as g,defaultShadowDifference as f,defaultShadowColor as _}from"../../../../support/HighlightDefaults.js";const w=1/512,O=4e4,y=5e4;let P=class extends m{constructor(e){super(e),this.produces=p.COMPOSITE,this.consumes={required:[p.COMPOSITE,"highlights"]},this._passParameters=new l,this._maxOpacity=1,this._shadowDifference=.2}initialize(){this.addHandles([s(()=>this.view.defaultHighlight?.shadowOpacity,e=>{this._passParameters.shadowOpacity=e??g,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()},r),s(()=>this.view.defaultHighlight?.shadowDifference,e=>{this._shadowDifference=e??f,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()},r),s(()=>this.view.defaultHighlight?.shadowColor,e=>{this._passParameters.shadowColor=(e??_).toUnitRGBA(),this._ensureMaxOpacity()},r)])}_updateOccludedShadowOpacity(){this._passParameters.occludedShadowOpacity=this._passParameters.shadowOpacity*(1-this._shadowDifference)}_ensureMaxOpacity(){const e=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=e*this._passParameters.shadowColor[3],this.requestRender(1)}precompile(){this._ensureIfVisible()&&this.techniques.precompile(u)}render(e){const t=e.find(({name:e})=>e===p.COMPOSITE),i=this.bindParameters;if(!this._ensureIfVisible())return t;const s=this.techniques.getCompiled(u);if(!s)return this.requestRender(1),t;this._passParameters.highlightTexture=e.find(({name:e})=>"highlights"===e)?.getTexture(),this._passParameters.origin=i.camera.center;const r=this.renderingContext;return r.bindFramebuffer(t.fbo),r.bindTechnique(s,i,this._passParameters),r.screen.draw(),t}_ensureIfVisible(){const e=this.bindParameters;if(!e.shadowHighlightsVisible||!e.depth)return!1;const{camera:s,lighting:r}=e;this._passParameters.opacityElevation=1-t(O,y,s.relativeElevation);const a=1===this.viewingMode?h(b,s.center):c(b,0,0,1),o=n(a,r.mainLight.direction);return this._passParameters.dayNightTerminator=t(0,1,i(30*o,0,1)),this._maxOpacity*this._passParameters.opacityElevation*this._passParameters.dayNightTerminator>=w}};e([a()],P.prototype,"produces",void 0),e([a()],P.prototype,"consumes",void 0),e([a({constructOnly:!0})],P.prototype,"viewingMode",void 0),P=e([o("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlight")],P);const b=d();export{P as ShadowHighlight};
2
+ import{__decorate as e}from"tslib";import{smoothstep as t,clamp as i}from"../../../../../core/mathUtils.js";import{watch as s,syncAndInitial as a}from"../../../../../core/reactiveUtils.js";import{property as r,subclass as h}from"../../../../../core/accessorSupport/decorators.js";import{normalize as o,set as c,dot as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderNodeOutput as d}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{ShadowHighlightPassParameters as l,ShadowHighlightTechnique as u}from"./ShadowHighlightTechnique.js";import{defaultShadowOpacity as g,defaultShadowDifference as f,defaultShadowColor as _}from"../../../../support/HighlightDefaults.js";const w=1/512,O=4e4,y=5e4;let P=class extends m{constructor(e){super(e),this.produces=d.COMPOSITE,this.consumes={required:[d.COMPOSITE,"highlights"]},this._passParameters=new l,this._maxOpacity=1,this._shadowDifference=.2}initialize(){this.addHandles([s(()=>this.view.defaultHighlight?.shadowOpacity,e=>{this._passParameters.shadowOpacity=e??g,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()},a),s(()=>this.view.defaultHighlight?.shadowDifference,e=>{this._shadowDifference=e??f,this._updateOccludedShadowOpacity(),this._ensureMaxOpacity()},a),s(()=>this.view.defaultHighlight?.shadowColor,e=>{this._passParameters.shadowColor=(e??_).toUnitRGBA(),this._ensureMaxOpacity()},a)])}_updateOccludedShadowOpacity(){this._passParameters.occludedShadowOpacity=this._passParameters.shadowOpacity*(1-this._shadowDifference)}_ensureMaxOpacity(){const e=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=e*this._passParameters.shadowColor[3],this.requestRender(1)}precompile(){this._ensureIfVisible()&&this.techniques.precompile(u)}render(e){const t=e.find(({name:e})=>e===d.COMPOSITE),i=this.bindParameters;if(!this._ensureIfVisible())return t;const s=this.techniques.getCompiled(u);if(!s)return this.requestRender(1),t;this._passParameters.highlightTexture=e.find(({name:e})=>"highlights"===e)?.getTexture(),this._passParameters.origin=i.camera.center;const a=this.renderingContext,r=t.obtainDepthTexture();return a.bindFramebuffer(t.fbo),a.bindTechnique(s,i,this._passParameters),a.screen.draw(),t.attachDepth(r),r?.release(),t}_ensureIfVisible(){const e=this.bindParameters;if(!e.hasShadowHighlights||!e.mainDepth)return!1;const{camera:s,lighting:a}=e;this._passParameters.opacityElevation=1-t(O,y,s.relativeElevation);const r=1===this.viewingMode?o(b,s.center):c(b,0,0,1),h=n(r,a.mainLight.direction);return this._passParameters.dayNightTerminator=t(0,1,i(30*h,0,1)),this._maxOpacity*this._passParameters.opacityElevation*this._passParameters.dayNightTerminator>=w}};e([r()],P.prototype,"produces",void 0),e([r()],P.prototype,"consumes",void 0),e([r({constructOnly:!0})],P.prototype,"viewingMode",void 0),P=e([h("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlight")],P);const b=p();export{P as ShadowHighlight};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{releaseMaybe as t}from"../../../../core/maybe.js";import{signal as i}from"../../../../core/signal.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import s from"../../webgl/RenderCamera.js";import{CloudsParameters as r}from"../effects/clouds/CloudsParameters.js";import{OITPolygonOffsetLimit as n}from"./OrderIndependentTransparency.js";import{SceneLighting as l}from"../lighting/SceneLighting.js";class g{constructor(t,i){this.width=t,this.height=i}}class o{constructor(t,e){this._rctx=t,this.shadowMap=e,this._output=0,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.hasEmission=!1,this.useFloatBlend=i(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillEnabled=!1,this._camera=new s,this._inverseViewport=h(),this._oldLighting=new l,this._newLighting=new l,this._fadedLighting=new l,this._lighting=this._newLighting,this.ssr=new a,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.highlights=new Array,this.highlightOrderMap=new Map,this.highlightMixOrigin=h(),this.highlightMixTexture=null,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new r,this.shadowHighlightsVisible=!1}destroy(){this._camera=null,this.contentCamera=null,this.depth=t(this.depth),this.geometryDepth=null,this.mainDepth=null,this.overlay=null,this.ssao=null,this.terrainDepth=null,this.shadowMap?.dispose()}get output(){return this._output}set output(t){this._output!==t&&(this._output=t,this._rctx.resetDrawBuffers(t))}get camera(){return this._camera}set camera(t){this._camera=t,this._inverseViewport[0]=1/t.fullViewport[2],this._inverseViewport[1]=1/t.fullViewport[3]}get enableOITOffset(){return 1===this.output&&this.camera.relativeElevation<n}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(t,i,e,h){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=i,this._newLighting.globalFactor=e,this._newLighting.set(t),this._oldLighting.updateLegacy(),1===h&&this.clouds.requestFade(),this.fadeLighting()}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(t){t&&(t.name="geometry depth"),this._depth=t}get occluder(){return 11===this.slot||12===this.slot?this.slot:null}}class a{constructor(){this.fadeFactor=1,this.reprojectionMatrix=e()}}export{o as BindParameters,g as ViewportSize};
2
+ import{releaseMaybe as t}from"../../../../core/maybe.js";import{signal as i}from"../../../../core/signal.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import h from"../../webgl/RenderCamera.js";import{CloudsParameters as s}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as r}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as n}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as l}from"../lighting/SceneLighting.js";class g{constructor(t,i){this.width=t,this.height=i}}const o=5e5;class a{constructor(t,g){this._rctx=t,this.shadowMap=g,this._output=0,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.hasEmission=!1,this.useFloatBlend=i(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillEnabled=!1,this._camera=new h,this._inverseViewport=e(),this._oldLighting=new l,this._newLighting=new l,this._fadedLighting=new l,this._lighting=this._newLighting,this.screenSpaceReflections=new n,this.reprojection=new r,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.highlights=new Array,this.highlightOrderMap=new Map,this.highlightMixOrigin=e(),this.highlightMixTexture=null,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new s,this.hasShadowHighlights=!1}destroy(){this._camera=null,this.contentCamera=null,this.depth=t(this.depth),this.geometryDepth=null,this.mainDepth=null,this.overlay=null,this.ssao=null,this.terrainDepth=null,this.shadowMap?.dispose()}get output(){return this._output}set output(t){this._output!==t&&(this._output=t,this._rctx.resetDrawBuffers(t))}get camera(){return this._camera}set camera(t){this._camera=t,this._inverseViewport[0]=1/t.fullViewport[2],this._inverseViewport[1]=1/t.fullViewport[3]}get enableOITOffset(){return 1===this.output&&this.camera.relativeElevation<o}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(t,i,e,h){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=i,this._newLighting.globalFactor=e,this._newLighting.set(t),this._oldLighting.updateLegacy(),1===h&&this.clouds.requestFade(),this.fadeLighting()}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(t){t&&(t.name="geometry depth"),this._depth=t}get occluder(){return 11===this.slot||12===this.slot?this.slot:null}}export{a as BindParameters,g as ViewportSize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- class e{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(t))}ensureResources(e){return 2}}export{e as default};
2
+ class e{constructor(e){this._material=e.material,this._techniques=e.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(t))}ensureResources(e){return 2}}export{e as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ class t{constructor(t,r){this._material=t,this._repository=r}dispose(){null!=this._glMaterial&&this._repository.release(this._material)}load(t,r,e){const i=this._material.produces.get(r);if(!i?.(e))return null;if(this._glMaterial??=this._repository.acquire(this._material,r,e),this._glMaterial){if(2===this._glMaterial.ensureResources(t))return this._glMaterial;this._repository.requestRender()}return null}}export{t as GLMaterialLoader};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- class t{constructor(t,s,e,i){this.material=t,this.output=s,this.techniques=e,this.textures=i}}export{t as GLMaterialParameters};
2
+ class t{constructor(t,s,e){this.material=t,this.techniques=s,this.textures=e}}export{t as GLMaterialParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{disposeMaybe as t}from"../../../../core/maybe.js";import{NestedMap as r}from"../../../../core/NestedMap.js";import{GLMaterialParameters as i}from"./GLMaterialParameters.js";import{assert as s}from"./Util.js";class a{constructor(e,t,i,s){this._textures=e,this._techniques=t,this.materialChanged=i,this.requestRender=s,this._id2glMaterialRef=new r}dispose(){this._textures.destroy()}acquire(e,t,r){this._ownMaterial(e);const s=e.produces.get(t);if(!s?.(r))return null;let a=this._id2glMaterialRef.get(r,e.id);if(null==a){const t=e.createGLMaterial(new i(e,r,this._techniques,this._textures));a=new o(t),this._id2glMaterialRef.set(r,e.id,a)}return a.ref(),a.glMaterial}release(e,r){const i=this._id2glMaterialRef.get(r,e.id);null!=i&&(i.unref(),i.referenced||(t(i.glMaterial),this._id2glMaterialRef.delete(r,e.id)))}_ownMaterial(t){t.repository&&t.repository!==this&&e.getLogger("esri.views.3d.webgl-engine.lib.GLMaterialRepository").error("Material is already owned by a different material repository"),t.repository=this}}class o{constructor(e){this.glMaterial=e,this._refCnt=0}ref(){++this._refCnt}unref(){--this._refCnt,s(this._refCnt>=0)}get referenced(){return this._refCnt>0}}export{a as GLMaterialRepository};
2
+ import e from"../../../../core/Logger.js";import{disposeMaybe as t}from"../../../../core/maybe.js";import{GLMaterialParameters as r}from"./GLMaterialParameters.js";import{assert as i}from"./Util.js";class s{constructor(e,t,r,i){this._textures=e,this._techniques=t,this.materialChanged=r,this.requestRender=i,this._id2glMaterialRef=new Map}dispose(){this._textures.destroy()}acquire(e,t,i){this._ownMaterial(e);const s=e.produces.get(t);if(!s?.(i))return null;let l=this._id2glMaterialRef.get(e.id);if(null==l){const t=e.createGLMaterial(new r(e,this._techniques,this._textures));l=new a(t),this._id2glMaterialRef.set(e.id,l)}return l.ref(),l.glMaterial}release(e){const r=this._id2glMaterialRef.get(e.id);null!=r&&(r.unref(),r.referenced||(t(r.glMaterial),this._id2glMaterialRef.delete(e.id)))}_ownMaterial(t){t.repository&&t.repository!==this&&e.getLogger("esri.views.3d.webgl-engine.lib.GLMaterialRepository").error("Material is already owned by a different material repository"),t.repository=this}}class a{constructor(e){this.glMaterial=e,this._refCnt=0}ref(){++this._refCnt}unref(){--this._refCnt,i(this._refCnt>=0)}get referenced(){return this._refCnt>0}}export{s as GLMaterialRepository};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{releaseMaybe as t}from"../../../../core/maybe.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as e,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ViewportSize as r}from"./BindParameters.js";import{ColorAttachment1 as o}from"../../../webgl/enums.js";import{ensureAttachmentMaxSize as h}from"../../../webgl/FramebufferObject.js";class l{constructor(t,i){this._fbos=t,this._bind=i,this._size=new r(0,0),this._clearColor=e()}dispose(){this._color=t(this._color),this.releaseDepth()}initialize(t,e,s){const r=this._color;return this._color=null,this.releaseDepth(),this._size.width=t,this._size.height=e,h(this._size,this._fbos.rctx.parameters.maxTextureSize),i(this._clearColor,s),r}releaseDepth(){this._color?.detachDepth(),this._depth=t(this._depth)}update(t){return this.bind(),this._color=t(this.color),this._color}bind(){const{rctx:t}=this._fbos,i=null==this._color;this.color.attachDepth(this.depth),t.bindFramebuffer(this.color.fbo),i&&(t.setClearStencil(0),t.setClearColor(this._clearColor[0],this._clearColor[1],this._clearColor[2],this._clearColor[3]),t.clear(17664),this._bind.hasEmission&&t.clearBuffer(1,s))}get size(){return this._size}get color(){return this._ensureColor()}get depth(){return this._depth??=this._fbos.acquireDepth(13,this._size.width,this._size.height,"main depth"),this._depth}_ensureColor(){return this._color??=this._bind.hasEmission?this._fbos.acquire(this._size.width,this._size.height,"main color").acquireColor(o,this._bind.useFloatBlend.value?8:5,"emissive"):this._fbos.acquire(this._size.width,this._size.height,"main color"),this._color}}export{l as MainFramebuffer};
2
+ import{releaseMaybe as t}from"../../../../core/maybe.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as e,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ViewportSize as r}from"./BindParameters.js";import{ColorAttachment1 as o}from"../../../webgl/enums.js";import{ensureAttachmentMaxSize as h}from"../../../webgl/FramebufferObject.js";class l{constructor(t,i){this._fbos=t,this._bind=i,this._size=new r(0,0),this._clearColor=e()}dispose(){this._color=t(this._color),this.releaseDepth()}initialize(t,e,s){const r=this._color;return this._color=null,this.releaseDepth(),this._size.width=t,this._size.height=e,h(this._size,this._fbos.rctx.parameters.maxTextureSize),i(this._clearColor,s),r}releaseDepth(){this._color?.detachDepth(),this._depth=t(this._depth)}update(t){return this.bind(),this._color=t(this.color),this._color}bind(){const{rctx:t}=this._fbos,i=null==this._color;this.color.attachDepth(this.depth),t.bindFramebuffer(this.color.fbo),i&&(t.setClearStencil(0),t.setClearColor(this._clearColor[0],this._clearColor[1],this._clearColor[2],this._clearColor[3]),t.clear(17664),this._bind.hasEmission&&t.clearBuffer(1,s))}get size(){return this._size}get color(){return this._ensureColor()}get depth(){return this._depth??=this._fbos.acquireDepth(13,this._size.width,this._size.height,"main depth"),this._depth}_ensureColor(){return this._color??=this._bind.hasEmission?this._fbos.acquire(this._size.width,this._size.height,"main").acquireColor(o,this._bind.useFloatBlend.value?8:5,"emissive"):this._fbos.acquire(this._size.width,this._size.height,"main"),this._color}}export{l as MainFramebuffer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isOITColor as t}from"../core/shaderLibrary/ShaderOutput.js";import{OITPolygonOffset as e,PolygonOffsetSettings as r}from"../materials/PolygonOffset.js";import{defaultDepthWrite as n,premultipliedAlpha as u,unpremultipliedAlphaToPremultipliedAlpha as o,separateBlendingParams as f}from"../../../webgl/renderState.js";const l=f(1,0,1,771);function s(t,e=!1){switch(t){case 0:return e?u:o;case 1:return l;default:return null}}function a(t){if(t.draped)return null;switch(t.output){case 0:case 2:default:return t.writeDepth?n:null;case 1:return null}}function c(e,r=513){return{func:t(e)?515:r}}const i=5e5;function p({output:n,enableOITOffset:u,polygonOffset:o}){return t(n)?u?e:null:r[o]}export{i as OITPolygonOffsetLimit,s as blending,l as blendingColorAlpha,c as depthTest,a as depthWrite,p as oitPolygonOffset};
2
+ import{isOITColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{defaultDepthWrite as t,premultipliedAlpha as e,unpremultipliedAlphaToPremultipliedAlpha as u,separateBlendingParams as n}from"../../../webgl/renderState.js";const c=n(1,0,1,771);function a(r,t=!1){switch(r){case 0:return t?e:u;case 1:return c;default:return null}}function l(r){if(r.draped)return null;switch(r.output){case 0:case 2:default:return r.writeDepth?t:null;case 1:return null}}function o(t,e=513){return{func:r(t)?515:e}}export{a as blending,c as blendingColorAlpha,o as depthTest,l as depthWrite};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{copy as t,set as e,length as i,normalize as s,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{cross as l,set as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as p}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as f}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as b}from"../../../../geometry/support/Indices.js";import{Attribute as d,Vertices as g}from"./Attribute.js";import{decompressNormal as v,compressNormal as x}from"./Normals.js";import{intersectTriangles as A}from"./RayIntersections.js";class w{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class y extends w{constructor(t){super(t),this.color=m(255,255,255,255),this._size=n(),this.positions=u(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){p(this.color,t)}bake(n){t(this._size,n);const{numVerticesTotal:c,pathVertexData:p,positions:m,profileRightAxes:u,profileUpAxes:f,profileVertexAndNormals:b,profileAuxData:d}=this.builder;for(let t=0;t<c;++t){let c=p[t];c*=3;const g=_;let A=0,w=0;const y=v(I,u,t),j=v(D,f,t),P=4*t,F=e(V,b[P]*n[0],b[P+1]*n[1]),k=3*t;if(1===d[k+2])l(g,j,y),A=d[k]*n[0],w=d[k+1];else{const t=C,n=z;e(t,d[k],d[k+1]);const l=i(t);s(t,t);const c=r(F,t);if(Math.abs(c)>l){e(n,-t[1],t[0]);const i=r(F,n);o(t,t,l*Math.sign(c)),o(n,n,i),a(F,t,n)}h(g,0,0,0)}const N=y[0]*F[0]+j[0]*F[1],R=y[1]*F[0]+j[1]*F[1],M=y[2]*F[0]+j[2]*F[1];this.positions[k]=m[c]+N+g[0]*A,this.positions[k+1]=m[c+1]+R+g[1]*A,this.positions[k+2]=m[c+2]+M+g[2]*A;const T=b[P+2],U=b[P+3];x(this.normals,t,y[0]*T+j[0]*U+g[0]*w,y[1]*T+j[1]*U+g[1]*w,y[2]*T+j[2]*U+g[2]*w)}}createGeometryData(){const t=this.builder.vertexIndices;return[["position",new d(this.positions,t,3,!0)],["normalCompressed",new d(this.normals,t,2,!0)],["color",new d(this.color,b(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,i,s){const r=this.builder.vertexIndices,o=new g(this.positions,3),a=r.length/3;A(t,e,0,a,r,o,void 0,i,(t,e,i)=>s(t,i,e))}get size(){return this._size}}class j extends w{constructor(t,e,i,s){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=i,this.opacityAttributeValue=s,this.baked=new y(t),this._vvSize=u(this.builder.path.vertices.length).fill(e),this._vvColor=f(this.builder.path.vertices.length).fill(i),this._vvOpacity=f(this.builder.path.vertices.length).fill(s)}createGeometryData(){const t=this.builder,{pathVertexIndices:e,vertexIndices:i}=t;return[["position",new d(t.positions,e,3,!0)],["profileVertexAndNormal",new d(t.profileVertexAndNormals,i,4,!0)],["profileAuxData",new d(t.profileAuxData,i,3,!0)],["profileRight",new d(t.profileRightAxes,i,2,!0)],["profileUp",new d(t.profileUpAxes,i,2,!0)],["sizeFeatureAttribute",new d(this._vvSize,e,1,!0)],["colorFeatureAttribute",new d(this._vvColor,e,1,!0)],["opacityFeatureAttribute",new d(this._vvOpacity,e,1,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute("position");e&&(e.data=this.builder.positions)}}const V=n(),C=n(),z=n(),_=c(),I=c(),D=c();export{j as FastUpdatePathGeometry,w as PathGeometryData,y as StaticPathGeometry};
2
+ import{copy as t,set as e,length as i,normalize as s,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{cross as l,set as h}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as p}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as f}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as b}from"../../../../geometry/support/Indices.js";import{Attribute as d,Vertices as g}from"./Attribute.js";import{decompressNormal as v,compressNormal as x}from"./Normals.js";import{intersectTriangles as A}from"./RayIntersections.js";class w{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class y extends w{constructor(t){super(t),this.color=m(255,255,255,255),this._size=n(),this.positions=u(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){p(this.color,t)}bake(n){t(this._size,n);const{numVerticesTotal:c,pathVertexData:p,positions:m,profileRightAxes:u,profileUpAxes:f,profileVertexAndNormals:b,profileAuxData:d}=this.builder;for(let t=0;t<c;++t){let c=p[t];c*=3;const g=_;let A=0,w=0;const y=v(I,u,t),j=v(D,f,t),P=4*t,F=e(V,b[P]*n[0],b[P+1]*n[1]),k=3*t;if(1===d[k+2])l(g,j,y),A=d[k]*n[0],w=d[k+1];else{const t=C,n=z;e(t,d[k],d[k+1]);const l=i(t);s(t,t);const c=r(F,t);if(Math.abs(c)>l){e(n,-t[1],t[0]);const i=r(F,n);o(t,t,l*Math.sign(c)),o(n,n,i),a(F,t,n)}h(g,0,0,0)}const N=y[0]*F[0]+j[0]*F[1],R=y[1]*F[0]+j[1]*F[1],M=y[2]*F[0]+j[2]*F[1];this.positions[k]=m[c]+N+g[0]*A,this.positions[k+1]=m[c+1]+R+g[1]*A,this.positions[k+2]=m[c+2]+M+g[2]*A;const T=b[P+2],U=b[P+3];x(this.normals,t,y[0]*T+j[0]*U+g[0]*w,y[1]*T+j[1]*U+g[1]*w,y[2]*T+j[2]*U+g[2]*w)}}createGeometryData(){const t=this.builder.vertexIndices;return[["position",new d(this.positions,t,3,!0)],["normalCompressed",new d(this.normals,t,2,!0)],["color",new d(this.color,b(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,i,s){const r=this.builder.vertexIndices,o=new g(this.positions,3),a=r.length/3;A(t,e,0,a,r,o,void 0,i,s)}get size(){return this._size}}class j extends w{constructor(t,e,i,s){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=i,this.opacityAttributeValue=s,this.baked=new y(t),this._vvSize=u(this.builder.path.vertices.length).fill(e),this._vvColor=f(this.builder.path.vertices.length).fill(i),this._vvOpacity=f(this.builder.path.vertices.length).fill(s)}createGeometryData(){const t=this.builder,{pathVertexIndices:e,vertexIndices:i}=t;return[["position",new d(t.positions,e,3,!0)],["profileVertexAndNormal",new d(t.profileVertexAndNormals,i,4,!0)],["profileAuxData",new d(t.profileAuxData,i,3,!0)],["profileRight",new d(t.profileRightAxes,i,2,!0)],["profileUp",new d(t.profileUpAxes,i,2,!0)],["sizeFeatureAttribute",new d(this._vvSize,e,1,!0)],["colorFeatureAttribute",new d(this._vvColor,e,1,!0)],["opacityFeatureAttribute",new d(this._vvOpacity,e,1,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute("position");e&&(e.data=this.builder.positions)}}const V=n(),C=n(),z=n(),_=c(),I=c(),D=c();export{j as FastUpdatePathGeometry,w as PathGeometryData,y as StaticPathGeometry};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{sub as n,set as t,copy as i,cross as o,normalize as e}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setMin as s,setMax as r,create as f}from"../../../../geometry/support/aaBoundingBox.js";import{assert as u}from"./Util.js";class a{constructor(n=0,t=!1,i=!0){this.tolerance=n,this.isVerticalRay=t,this.normalRequired=i}}const l=f();function h(t,i,o,e,c,s){if(!t.visible)return;const r=n(E,e,o),f=(n,t,i)=>s(n,i,t),{tolerance:l}=i,h=new a(l,!1,i.options.normalRequired);if(t.boundingInfo)u(0===t.type),p(t.boundingInfo,o,r,l,c,h,f);else{const n=t.positionAttribute,i=t.primitivePositionIndices;T(o,r,0,i.length/3,i,n.data,n.stride,c,h,f)}}const m=c();function p(n,t,i,o,e,c,f){if(null==n)return;const u=C(i,m);if(s(l,n.bbMin),r(l,n.bbMax),null!=e&&e.applyToAabb(l),U(l,t,u,o)){const{primitiveIndices:s,position:r}=n,u=s?s.length:r.indices.length/3;if(u>z){const s=n.getChildren();if(void 0!==s){for(const n of s)p(n,t,i,o,e,c,f);return}}q(t,i,0,u,r.indices,r.data,r.stride,s,e,c,f)}}const b=c();function M(t,i,o,e,c,s,r,f,u){const{data:a,stride:l}=s;T(t,n(E,i,t),o,e,c,a,l,r,f,u)}function d(n,t,i,o){if(!i.visible)return;const e=(n,t,i)=>o(n,i,t),{boundingInfo:c}=i;if(c){const{bbMin:i,bbMax:o}=c;if(n<i[0]||n>o[0]||t<i[1]||t>o[1])return}const s=i.positionAttribute,r=i.primitivePositionIndices;x(n,t,0,r.length/3,r,s,e)}function x(n,t,i,o,e,c,s){const{data:r,stride:f}=c;for(let u=i;u<o;++u){const i=3*u,o=f*e[i],c=f*e[i+1],a=f*e[i+2],l=r[o+0]-n,h=r[o+1]-t,m=r[c+0]-n,p=r[c+1]-t,b=r[a+0]-n,M=r[a+1]-t,d=b*p-M*m,x=l*M-h*b,g=m*h-p*l;(d<0||x<0||g<0)&&(d>0||x>0||g>0)||s(0,u,null)}}function g(n,t,i,o,e,c,s,r,f,u=null,a=0){const l=n[0],h=n[1],m=n[2],p=t[0],M=t[1],d=t[2];for(let x=i;x<o;++x){const n=a+(u?.[x]??x),t=3*n,i=s*e[t],o=c[i],g=c[i+1],y=c[i+2],v=s*e[t+1],q=c[v],T=c[v+1],V=c[v+2],I=s*e[t+2],R=q-o,A=T-g,B=V-y,P=c[I]-o,w=c[I+1]-g,C=c[I+2]-y,U=M*C-w*d,k=d*P-C*p,z=p*w-P*M,E=R*U+A*k+B*z;if(Math.abs(E)<=D)continue;const F=l-o,G=h-g,H=m-y,J=F*U+G*k+H*z;if(E>0){if(J<0||J>E)continue}else if(J>0||J<E)continue;const K=G*B-A*H,L=H*R-B*F,N=F*A-R*G,O=p*K+M*L+d*N;if(E>0){if(O<0||J+O>E)continue}else if(O>0||J+O<E)continue;const Q=(P*K+w*L+C*N)/E;if(Q>=0){f(Q,n,r?j(R,A,B,P,w,C,b):null)}}}function y(n,t,i,o,e,c,s,r){const f=n[0],u=n[1],a=n[2],l=t[0],h=t[1],m=t[2];for(let p=i;p<o;++p){const n=3*p,t=n+1,i=n+2,o=c*n,M=e[o],d=e[o+1],x=e[o+2],g=c*t,y=c*i,v=e[g]-M,q=e[g+1]-d,T=e[g+2]-x,V=e[y]-M,I=e[y+1]-d,R=e[y+2]-x,A=h*R-I*m,B=m*V-R*l,P=l*I-V*h,w=v*A+q*B+T*P;if(Math.abs(w)<=D)continue;const C=f-M,U=u-d,k=a-x,z=C*A+U*B+k*P;if(w>0){if(z<0||z>w)continue}else if(z>0||z<w)continue;const E=U*T-q*k,F=k*v-T*C,G=C*q-v*U,H=l*E+h*F+m*G;if(w>0){if(H<0||z+H>w)continue}else if(H>0||z+H<w)continue;const J=(V*E+I*F+R*G)/w;if(J>=0){r(J,p,s?j(v,q,T,V,I,R,b):null)}}}function v(n,t,i,o,e,c,s,r,f,u,a,l=null,h=0){const m=n[0],p=n[1],M=n[2],d=t[0],x=t[1],g=t[2];for(let y=i;y<o;++y){const n=h+(l?.[y]??y),t=3*n,i=s*e[t],o=c[i],v=c[i+1],q=c[i+2],T=s*e[t+1],V=c[T],I=c[T+1],R=c[T+2],A=s*e[t+2],B=c[A],P=c[A+1],w=c[A+2],C=q-f,U=r/Math.sqrt(o*o+v*v+C*C),k=o+o*U,z=v+v*U,E=q+C*U,F=R-f,G=r/Math.sqrt(V*V+I*I+F*F),H=V+V*G,J=I+I*G,K=R+F*G,L=w-f,N=r/Math.sqrt(B*B+P*P+L*L),O=H-k,Q=J-z,S=K-E,W=B+B*N-k,X=P+P*N-z,Y=w+L*N-E,Z=x*Y-X*g,$=g*W-Y*d,_=d*X-W*x,nn=O*Z+Q*$+S*_;if(Math.abs(nn)<=D)continue;const tn=m-k,on=p-z,en=M-E,cn=tn*Z+on*$+en*_;if(nn>0){if(cn<0||cn>nn)continue}else if(cn>0||cn<nn)continue;const sn=on*S-Q*en,rn=en*O-S*tn,fn=tn*Q-O*on,un=d*sn+x*rn+g*fn;if(nn>0){if(un<0||cn+un>nn)continue}else if(un>0||cn+un<nn)continue;const an=(W*sn+X*rn+Y*fn)/nn;if(an>=0){a(an,n,u?j(O,Q,S,W,X,Y,b):null)}}}function q(n,t,i,o,e,c,s,r,f,u,a){const l=n[0],h=n[1],m=n[2],p=t[0],M=t[1],d=t[2],{normalRequired:x}=u;for(let g=i;g<o;++g){const n=r[g],t=3*n,i=s*e[t];let o=c[i],u=c[i+1],y=c[i+2];const v=s*e[t+1];let q=c[v],T=c[v+1],V=c[v+2];const I=s*e[t+2];let R=c[I],A=c[I+1],B=c[I+2];null!=f&&([o,u,y]=f.applyToVertex(o,u,y,g),[q,T,V]=f.applyToVertex(q,T,V,g),[R,A,B]=f.applyToVertex(R,A,B,g));const P=q-o,w=T-u,C=V-y,U=R-o,k=A-u,z=B-y,E=M*z-k*d,F=d*U-z*p,G=p*k-U*M,H=P*E+w*F+C*G;if(Math.abs(H)<=D)continue;const J=l-o,K=h-u,L=m-y,N=J*E+K*F+L*G;if(H>0){if(N<0||N>H)continue}else if(N>0||N<H)continue;const O=K*C-w*L,Q=L*P-C*J,S=J*w-P*K,W=p*O+M*Q+d*S;if(H>0){if(W<0||N+W>H)continue}else if(W>0||N+W<H)continue;const X=(U*O+k*Q+z*S)/H;if(X>=0){a(X,n,x?j(P,w,C,U,k,z,b):null)}}}function T(o,e,c,s,r,f,u,a,l,h){const m=e,p=F,b=Math.abs(m[0]),M=Math.abs(m[1]),d=Math.abs(m[2]),x=b>=M?b>=d?0:2:M>=d?1:2,g=x,y=m[g]<0?2:1,v=(x+y)%3,q=(x+(3-y))%3,T=m[v]/m[g],j=m[q]/m[g],B=1/m[g],P=V,w=I,C=R,{normalRequired:U}=l;for(let V=c;V<s;++V){const e=3*V,c=u*r[e];t(p[0],f[c+0],f[c+1],f[c+2]);const s=u*r[e+1];t(p[1],f[s+0],f[s+1],f[s+2]);const l=u*r[e+2];t(p[2],f[l+0],f[l+1],f[l+2]),a&&(i(p[0],a.applyToVertex(p[0][0],p[0][1],p[0][2],V)),i(p[1],a.applyToVertex(p[1][0],p[1][1],p[1][2],V)),i(p[2],a.applyToVertex(p[2][0],p[2][1],p[2][2],V))),n(P,p[0],o),n(w,p[1],o),n(C,p[2],o);const m=P[v]-T*P[g],b=P[q]-j*P[g],M=w[v]-T*w[g],d=w[q]-j*w[g],x=C[v]-T*C[g],y=C[q]-j*C[g],I=x*d-y*M,R=m*y-b*x,k=M*b-d*m;if((I<0||R<0||k<0)&&(I>0||R>0||k>0))continue;const z=I+R+k;if(0===z)continue;const D=I*(B*P[g])+R*(B*w[g])+k*(B*C[g]);if(D*Math.sign(z)<0)continue;const E=D/z;if(E>=0){h(E,V,U?A(p):null)}}}const V=c(),I=c(),R=c();function j(n,i,c,s,r,f,u){return t(B,n,i,c),t(P,s,r,f),o(u,B,P),e(u,u),u}function A(t){return n(B,t[1],t[0]),n(P,t[2],t[0]),o(b,B,P),e(b,b),b}const B=c(),P=c();function w(n,i,o){return t(o,1/(i[0]-n[0]),1/(i[1]-n[1]),1/(i[2]-n[2]))}function C(n,i){return t(i,1/n[0],1/n[1],1/n[2])}function U(n,t,i,o){return k(n,t,i,o,1/0)}function k(n,t,i,o,e){const c=(n[0]-o-t[0])*i[0],s=(n[3]+o-t[0])*i[0];let r=Math.min(c,s),f=Math.max(c,s);const u=(n[1]-o-t[1])*i[1],a=(n[4]+o-t[1])*i[1];if(f=Math.min(f,Math.max(u,a)),f<0)return!1;if(r=Math.max(r,Math.min(u,a)),r>f)return!1;const l=(n[2]-o-t[2])*i[2],h=(n[5]+o-t[2])*i[2];return f=Math.min(f,Math.max(l,h)),!(f<0)&&(r=Math.max(r,Math.min(l,h)),!(r>f)&&r<e)}const z=1e3,D=1e-7,E=c(),F=[c(),c(),c()];export{a as MeshIntersectionOptions,w as computeInvDir,C as computeInvDirFromDirection,j as computeNormalFromBarycentric,U as intersectAabbInvDir,k as intersectAabbInvDirBefore,g as intersectRayTriangles,T as intersectRayTrianglesWithDisplacementWatertight,v as intersectRayTrianglesWithVerticalOffsetENUGlobal,y as intersectRenderGeometryTriangles,h as intersectTriangleGeometry,d as intersectTriangleGeometry2D,M as intersectTriangles,x as intersectTriangles2d,D as triangleRayParallelTolerance};
2
+ import{sub as n,set as t,copy as i,cross as o,normalize as e}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setMin as s,setMax as r,create as f}from"../../../../geometry/support/aaBoundingBox.js";import{assert as u}from"./Util.js";class a{constructor(n=0,t=!1,i=!0){this.tolerance=n,this.isVerticalRay=t,this.normalRequired=i}}const l=f();function h(t,i,o,e,c,s){if(!t.visible)return;const r=n(E,e,o),{tolerance:f}=i,l=new a(f,!1,i.options.normalRequired);if(t.boundingInfo)u(0===t.type),p(t.boundingInfo,o,r,f,c,l,s);else{const n=t.positionAttribute,i=t.primitivePositionIndices;T(o,r,0,i.length/3,i,n.data,n.stride,c,l,s)}}const m=c();function p(n,t,i,o,e,c,f){if(null==n)return;const u=C(i,m);if(s(l,n.bbMin),r(l,n.bbMax),null!=e&&e.applyToAabb(l),U(l,t,u,o)){const{primitiveIndices:s,position:r}=n,u=s?s.length:r.indices.length/3;if(u>z){const s=n.getChildren();if(void 0!==s){for(const n of s)p(n,t,i,o,e,c,f);return}}q(t,i,0,u,r.indices,r.data,r.stride,s,e,c,f)}}const b=c();function M(t,i,o,e,c,s,r,f,u){const{data:a,stride:l}=s;T(t,n(E,i,t),o,e,c,a,l,r,f,u)}function d(n,t,i,o){if(!i.visible)return;const{boundingInfo:e}=i;if(e){const{bbMin:i,bbMax:o}=e;if(n<i[0]||n>o[0]||t<i[1]||t>o[1])return}const c=i.positionAttribute,s=i.primitivePositionIndices;x(n,t,0,s.length/3,s,c,o)}function x(n,t,i,o,e,c,s){const{data:r,stride:f}=c;for(let u=i;u<o;++u){const i=3*u,o=f*e[i],c=f*e[i+1],a=f*e[i+2],l=r[o+0]-n,h=r[o+1]-t,m=r[c+0]-n,p=r[c+1]-t,b=r[a+0]-n,M=r[a+1]-t,d=b*p-M*m,x=l*M-h*b,g=m*h-p*l;(d<0||x<0||g<0)&&(d>0||x>0||g>0)||s(0,null,u)}}function g(n,t,i,o,e,c,s,r,f,u=null,a=0){const l=n[0],h=n[1],m=n[2],p=t[0],M=t[1],d=t[2];for(let x=i;x<o;++x){const n=a+(u?.[x]??x),t=3*n,i=s*e[t],o=c[i],g=c[i+1],y=c[i+2],v=s*e[t+1],q=c[v],T=c[v+1],V=c[v+2],I=s*e[t+2],R=q-o,A=T-g,B=V-y,P=c[I]-o,w=c[I+1]-g,C=c[I+2]-y,U=M*C-w*d,k=d*P-C*p,z=p*w-P*M,E=R*U+A*k+B*z;if(Math.abs(E)<=D)continue;const F=l-o,G=h-g,H=m-y,J=F*U+G*k+H*z;if(E>0){if(J<0||J>E)continue}else if(J>0||J<E)continue;const K=G*B-A*H,L=H*R-B*F,N=F*A-R*G,O=p*K+M*L+d*N;if(E>0){if(O<0||J+O>E)continue}else if(O>0||J+O<E)continue;const Q=(P*K+w*L+C*N)/E;if(Q>=0){f(Q,r?j(R,A,B,P,w,C,b):null,n)}}}function y(n,t,i,o,e,c,s,r){const f=n[0],u=n[1],a=n[2],l=t[0],h=t[1],m=t[2];for(let p=i;p<o;++p){const n=3*p,t=n+1,i=n+2,o=c*n,M=e[o],d=e[o+1],x=e[o+2],g=c*t,y=c*i,v=e[g]-M,q=e[g+1]-d,T=e[g+2]-x,V=e[y]-M,I=e[y+1]-d,R=e[y+2]-x,A=h*R-I*m,B=m*V-R*l,P=l*I-V*h,w=v*A+q*B+T*P;if(Math.abs(w)<=D)continue;const C=f-M,U=u-d,k=a-x,z=C*A+U*B+k*P;if(w>0){if(z<0||z>w)continue}else if(z>0||z<w)continue;const E=U*T-q*k,F=k*v-T*C,G=C*q-v*U,H=l*E+h*F+m*G;if(w>0){if(H<0||z+H>w)continue}else if(H>0||z+H<w)continue;const J=(V*E+I*F+R*G)/w;if(J>=0){r(J,s?j(v,q,T,V,I,R,b):null,p)}}}function v(n,t,i,o,e,c,s,r,f,u,a,l=null,h=0){const m=n[0],p=n[1],M=n[2],d=t[0],x=t[1],g=t[2];for(let y=i;y<o;++y){const n=h+(l?.[y]??y),t=3*n,i=s*e[t],o=c[i],v=c[i+1],q=c[i+2],T=s*e[t+1],V=c[T],I=c[T+1],R=c[T+2],A=s*e[t+2],B=c[A],P=c[A+1],w=c[A+2],C=q-f,U=r/Math.sqrt(o*o+v*v+C*C),k=o+o*U,z=v+v*U,E=q+C*U,F=R-f,G=r/Math.sqrt(V*V+I*I+F*F),H=V+V*G,J=I+I*G,K=R+F*G,L=w-f,N=r/Math.sqrt(B*B+P*P+L*L),O=H-k,Q=J-z,S=K-E,W=B+B*N-k,X=P+P*N-z,Y=w+L*N-E,Z=x*Y-X*g,$=g*W-Y*d,_=d*X-W*x,nn=O*Z+Q*$+S*_;if(Math.abs(nn)<=D)continue;const tn=m-k,on=p-z,en=M-E,cn=tn*Z+on*$+en*_;if(nn>0){if(cn<0||cn>nn)continue}else if(cn>0||cn<nn)continue;const sn=on*S-Q*en,rn=en*O-S*tn,fn=tn*Q-O*on,un=d*sn+x*rn+g*fn;if(nn>0){if(un<0||cn+un>nn)continue}else if(un>0||cn+un<nn)continue;const an=(W*sn+X*rn+Y*fn)/nn;if(an>=0){a(an,u?j(O,Q,S,W,X,Y,b):null,n)}}}function q(n,t,i,o,e,c,s,r,f,u,a){const l=n[0],h=n[1],m=n[2],p=t[0],M=t[1],d=t[2],{normalRequired:x}=u;for(let g=i;g<o;++g){const n=r[g],t=3*n,i=s*e[t];let o=c[i],u=c[i+1],y=c[i+2];const v=s*e[t+1];let q=c[v],T=c[v+1],V=c[v+2];const I=s*e[t+2];let R=c[I],A=c[I+1],B=c[I+2];null!=f&&([o,u,y]=f.applyToVertex(o,u,y,g),[q,T,V]=f.applyToVertex(q,T,V,g),[R,A,B]=f.applyToVertex(R,A,B,g));const P=q-o,w=T-u,C=V-y,U=R-o,k=A-u,z=B-y,E=M*z-k*d,F=d*U-z*p,G=p*k-U*M,H=P*E+w*F+C*G;if(Math.abs(H)<=D)continue;const J=l-o,K=h-u,L=m-y,N=J*E+K*F+L*G;if(H>0){if(N<0||N>H)continue}else if(N>0||N<H)continue;const O=K*C-w*L,Q=L*P-C*J,S=J*w-P*K,W=p*O+M*Q+d*S;if(H>0){if(W<0||N+W>H)continue}else if(W>0||N+W<H)continue;const X=(U*O+k*Q+z*S)/H;if(X>=0){a(X,x?j(P,w,C,U,k,z,b):null,n)}}}function T(o,e,c,s,r,f,u,a,l,h){const m=e,p=F,b=Math.abs(m[0]),M=Math.abs(m[1]),d=Math.abs(m[2]),x=b>=M?b>=d?0:2:M>=d?1:2,g=x,y=m[g]<0?2:1,v=(x+y)%3,q=(x+(3-y))%3,T=m[v]/m[g],j=m[q]/m[g],B=1/m[g],P=V,w=I,C=R,{normalRequired:U}=l;for(let V=c;V<s;++V){const e=3*V,c=u*r[e];t(p[0],f[c+0],f[c+1],f[c+2]);const s=u*r[e+1];t(p[1],f[s+0],f[s+1],f[s+2]);const l=u*r[e+2];t(p[2],f[l+0],f[l+1],f[l+2]),a&&(i(p[0],a.applyToVertex(p[0][0],p[0][1],p[0][2],V)),i(p[1],a.applyToVertex(p[1][0],p[1][1],p[1][2],V)),i(p[2],a.applyToVertex(p[2][0],p[2][1],p[2][2],V))),n(P,p[0],o),n(w,p[1],o),n(C,p[2],o);const m=P[v]-T*P[g],b=P[q]-j*P[g],M=w[v]-T*w[g],d=w[q]-j*w[g],x=C[v]-T*C[g],y=C[q]-j*C[g],I=x*d-y*M,R=m*y-b*x,k=M*b-d*m;if((I<0||R<0||k<0)&&(I>0||R>0||k>0))continue;const z=I+R+k;if(0===z)continue;const D=I*(B*P[g])+R*(B*w[g])+k*(B*C[g]);if(D*Math.sign(z)<0)continue;const E=D/z;if(E>=0){h(E,U?A(p):null,V)}}}const V=c(),I=c(),R=c();function j(n,i,c,s,r,f,u){return t(B,n,i,c),t(P,s,r,f),o(u,B,P),e(u,u),u}function A(t){return n(B,t[1],t[0]),n(P,t[2],t[0]),o(b,B,P),e(b,b),b}const B=c(),P=c();function w(n,i,o){return t(o,1/(i[0]-n[0]),1/(i[1]-n[1]),1/(i[2]-n[2]))}function C(n,i){return t(i,1/n[0],1/n[1],1/n[2])}function U(n,t,i,o){return k(n,t,i,o,1/0)}function k(n,t,i,o,e){const c=(n[0]-o-t[0])*i[0],s=(n[3]+o-t[0])*i[0];let r=Math.min(c,s),f=Math.max(c,s);const u=(n[1]-o-t[1])*i[1],a=(n[4]+o-t[1])*i[1];if(f=Math.min(f,Math.max(u,a)),f<0)return!1;if(r=Math.max(r,Math.min(u,a)),r>f)return!1;const l=(n[2]-o-t[2])*i[2],h=(n[5]+o-t[2])*i[2];return f=Math.min(f,Math.max(l,h)),!(f<0)&&(r=Math.max(r,Math.min(l,h)),!(r>f)&&r<e)}const z=1e3,D=1e-7,E=c(),F=[c(),c(),c()];export{a as MeshIntersectionOptions,w as computeInvDir,C as computeInvDirFromDirection,j as computeNormalFromBarycentric,U as intersectAabbInvDir,k as intersectAabbInvDirBefore,g as intersectRayTriangles,T as intersectRayTrianglesWithDisplacementWatertight,v as intersectRayTrianglesWithVerticalOffsetENUGlobal,y as intersectRenderGeometryTriangles,h as intersectTriangleGeometry,d as intersectTriangleGeometry2D,M as intersectTriangles,x as intersectTriangles2d,D as triangleRayParallelTolerance};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{Milliseconds as t}from"../../../../core/time.js";import e from"../../webgl/RenderCamera.js";import{BindParameters as r}from"./BindParameters.js";class i{constructor(i,n,o){this.rctx=i,this.techniques=o,this.lastFrameCamera=new e,this.renderOccludedMask=s,this.time=t(0),this.bind=new r(i,n),this.bind.alignPixelEnabled=!0}destroy(){this.bind.destroy()}get output(){return this.bind.output}}const s=13;export{i as RenderContext,s as defaultRenderOccludedMask};
2
+ import{Milliseconds as t}from"../../../../core/time.js";import{BindParameters as i}from"./BindParameters.js";class s{constructor(s,r,n){this.rctx=s,this.techniques=n,this.renderOccludedMask=e,this.time=t(0),this.bind=new i(s,r),this.bind.alignPixelEnabled=!0}destroy(){this.bind.destroy()}get output(){return this.bind.output}}const e=13;export{s as RenderContext,e as defaultRenderOccludedMask};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{NestedMap as e}from"../../../../core/NestedMap.js";function t(t){const f=new e;if(f.set(2,1,!0),f.set(2,4,!0),f.set(2,5,!0),f.set(2,0,!0),f.set(2,3,!0),f.set(2,2,!0),f.set(2,9,!0),"low"!==t&&(f.set(0,10,!0),f.set(1,10,!0),f.set(2,10,!0),f.set(2,6,!0),f.set(2,7,!0)),"medium"===t)for(const e of s)f.set(0,e,!0),f.set(1,e,!0),f.set(2,e,!0);else if("high"===t)for(const e of o)f.set(0,e,!0),f.set(1,e,!0),f.set(2,e,!0);return f}const s=[8,1],o=[...s,0,3,4,5];export{t as setupFeatureDefaults};
2
+ import{NestedMap as e}from"../../../../core/NestedMap.js";function t(t){const f=new e;if(f.set(2,1,!0),f.set(2,4,!0),f.set(2,5,!0),f.set(2,0,!0),f.set(2,3,!0),f.set(2,2,!0),f.set(2,9,!0),"low"!==t&&(f.set(2,6,!0),f.set(2,7,!0)),"medium"===t)for(const e of s)f.set(0,e,!0),f.set(1,e,!0),f.set(2,e,!0);else if("high"===t)for(const e of o)f.set(0,e,!0),f.set(1,e,!0),f.set(2,e,!0);return f}const s=[10,8,1],o=[...s,0,3,4,5];export{t as setupFeatureDefaults};