@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{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{removeMaybe as s,abortMaybe as i,destroyMaybe as a,releaseMaybe as n}from"../../../../core/maybe.js";import{throwIfAborted as h}from"../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as d,initial as _,sync as l}from"../../../../core/reactiveUtils.js";import{signal as u}from"../../../../core/signal.js";import{property as m,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{equals as c,invert as f,multiply as g}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as T}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as w,ZEROS as E}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as C}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as A,InternalRenderCategory as R,AllRenderNodeOutputs as D,AllInternalRenderNodeOutputs as S}from"../../webgl.js";import{minNearDistanceInMeters as I}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import"../../webgl/ManagedDepthAttachment.js";import{FBOCache as O}from"../core/FBOCache.js";import{RenderPassManager as y}from"../core/renderPasses/RenderPassManager.js";import{isColor as F}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as N}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{hasOit8Bit as v,hasEmissive8Bit as H}from"../effects/fboFormatUtils.js";import{RenderNodes as M}from"../effects/RenderNodes.js";import{RenderPluginManager as q}from"../effects/RenderPluginManager.js";import{WeatherFader as G}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as L}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as j}from"../effects/highlight/Highlight.js";import{OITBlend as V}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as z}from"./BoundingInfo.js";import{Compositor as Q}from"./Compositor.js";import{DepthRange as Y}from"./DepthRange.js";import{depthRangeFromScene as $}from"./depthRangeUtils.js";import{MainFramebuffer as J}from"./MainFramebuffer.js";import{RenderContext as K,defaultRenderOccludedMask as Z}from"./RenderContext.js";import{RendererBase as X}from"./RendererBase.js";import{setupFeatureDefaults as ee}from"./RenderFeature.js";import{RenderPluginInput as te}from"./RenderPluginInput.js";import{ShadowAccumulator as re}from"./ShadowAccumulator.js";import{ShadowMap as se}from"./ShadowMap.js";import ie from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{PixelType as de,ColorAttachment1 as _e,ColorAttachment2 as le,ColorAttachment0 as ue}from"../../../webgl/enums.js";let me=class extends X{constructor(e,t,r,s,i){super({stage:e}),this._techniques=r,this._rctx=s,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new y,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=w(0,0,0,1),this._sliceHelper=new ie,this.sceneDepthRange=u(Y.Infinite),this._state=u(2),this._hasOit8Bit=v(),this._hasEmissive8Bit=H(),this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=u(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new te,this._hasTransparentGeometry=!1,this._oitCallouts=!1,this._releaseNodeInputs=e=>{for(const t of Re)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._debugNeedsDepth=!1,this._fboCache=new O(s),this._compositor=new Q(s,r),this._renderStateFeatures=u(ee(e.view.qualityProfile));const a=new se(this._fboCache,e.viewingMode);this._renderContext=new K(this._rctx,a,r),this._framebuffer=new J(this._fboCache,this._bindParameters),this._performanceInfo=new he(this._rctx),this._blit=new U(r),this._shadowAccumulator=new re(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,r,s)=>{const i=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,s,!0,i),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},i),this._nodes=new M(this._renderContext),this._plugins=new q({renderContext:this._renderContext,techniques:r,materials:t,requestRender:i,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new G({view:e.view,context:this._renderContext}),this.addHandles([o(()=>e.view.state.camera,()=>i(),d),o(()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},_),o(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():E;T(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},d),o(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=N,d),o(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},l),o(()=>this._bindParameters.clouds.data?.state,()=>i(),l),o(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},_),o(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},d)])}destroy(){this._gpuTimerHandle=s(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,z.prune(),ae.prune(),C()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new V(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=ee(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(s=>s.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&this.isFeatureEnabled(5)}get _hasHighlights(){return this._plugins.produces(10,2,4,19,13,14,15)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,13,14,15)}get hasSSAO(){return this.isFeatureEnabled(4)&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmission(){return this._plugins.hasEmitters&&(this._hasEmissive8Bit||this.hasFloatBlend)}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(10)}get oitEnabled(){return this.hasFloatBlend||this._hasOit8Bit}get highResolutionAtmosphere(){return this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=n(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");h(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:xe(this.stage.view.resourceController)});return this.addHandles(o(()=>r.updating,()=>this._requestRender(),l)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&c(this._bindParameters.ssr.reprojectionMatrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){void 0!==e.shadowMap&&this._bindParameters.shadowMap.enabled!==e.shadowMap&&(this._bindParameters.shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,10)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,14),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...Te),has.water=this._plugins.produces(4,20),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new k(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?s(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r,s=!1){try{return this._isRendering=!0,this._render(e,t,r,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(A.FINAL),null)}_render(e,t,r,s){const i=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:a,contentCamera:h,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._renderContext.time=t,this._bindParameters.output=0,this._bindParameters.hasEmission=this._hasEmission,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const _=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=_?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(R.CUTFILL_COMPUTATION),this._renderOverlay(),a.setGLViewport(this._rctx);const l=this._framebuffer,u=l.initialize(a.fullWidth,a.fullHeight,this._backgroundColor);this.hasReflections?(u?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=u):u?.release(),this._ensureBindParametersCamera(a,h),this._ensureBindParametersWeatherFader(this._renderContext.time),this._plugins.sortTestsTransparentOrderedSlots(Ee),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!s,this._hasTransparentGeometry=this._plugins.produces(0,...ce),this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const m=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,m),this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowAccumulation(m,!i),this._oitCallouts=this._hasTransparentGeometry&&this.oitEnabled,this._ensureBindParametersSSR(t),this._precompileShaders(),this._bindParameters.output=0,l.bind(),this._bindParameters.mainDepth=l.depth.attachment,this._renderOpaque(),this._renderTransparent(),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),l.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),l.update(e=>this._renderNodes(R.VIEWSHED,e)),l.update(e=>this._renderNodes(R.LASERLINES,e)),l.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),l.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const p=2===r?this._renderObjectAndLayerIdColor():null;l.update(e=>this._renderNodes(A.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.depth=n(this._bindParameters.depth),l.update(e=>this._renderNodes(R.ANTIALIASING,e));const c=this._hasPhotoshopTerrain||!this._hasTransparentGeometry?1:2;let f;return this._bindParameters.hasEmission=!1,this._hasHUDHighlights&&l.update(e=>this._renderHUD(c,e)),l.update(e=>this._renderNodes(R.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||l.update(e=>this._renderHUD(c,e)),this._bindParameters.hasEmission=this._hasEmission,l.update(e=>this._renderNodes(R.MAGNIFIER,e)),l.update(e=>this._renderNodes(A.FINAL,e)),i&&this._blit.toFramebuffer(this._rctx,l.color,this._bindParameters),this.onPostRender?.(),this._releaseFBOs(),l.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(f=l.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ne(f,p)}_precompileShaders(){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const e=this._bindParameters.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(e,R.OPAQUE_ENVIRONMENT,R.PRE_TRANSPARENT);const t=this._bindParameters;if(t.terrainDepthTest=t.cullAboveTerrain=this._needsTerrainDepth,this._bindParameters.output=3,this._plugins.precompile(...fe),this._needsDepth&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._bindParameters.output=0,this._plugins.precompile(...fe),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1)}this._hasTransparentGeometry&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(t.cullAboveTerrain=!1,this._precompileTransparentGeometry(),t.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(e,R.FOCUSAREA);const r=this._hasPhotoshopTerrain&&!this._needsTerrainDepth;this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,r,e),this._oitCallouts||this._plugins.precompile(16),t.terrainDepthTest=t.cullAboveTerrain=!1,this._nodes.precompile(e,R.TRANSPARENT_ENVIRONMENT,R.VIEWSHED,R.CUTFILL_COMPUTATION,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.hasEmission=!1,this._precompileHUD(0),this._precompileHUD(1),t.hasEmission=this._hasEmission,this._hasHighlights&&(t.highlights.forEach((e,r)=>{t.highlightLevel=r,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(14,13)}),t.highlightLevel=null,this._nodes.precompile(e,R.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(e,A.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:r}=this._framebuffer.size;let s=this.fboCache.acquire(t,r,"olid");return s.acquireDepth(13),s=this._nodes.render(s,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(oe.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,s}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let s=0;t?s=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const i=Math.max(e,s);this._animationTimestep.frame(i,r)}}readMainDepth(e,t){const{mainDepth:r,camera:s}=this._bindParameters;if(!r)return;const i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(i.fbo),s.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(E),this._compositor.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,de.UNSIGNED_BYTE,t),i.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquire(r,s,"edges"),a=this._bindParameters.geometryDepth,n=()=>t.render(this._bindParameters,e);this._renderToTargets(n,i,a??this._framebuffer.depth,E),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const s=this._bindParameters.shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(7,s),s.clear(),this._renderShadowCascades(6,s)):this._renderShadowCascades(5),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(oe.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(R.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const r=this._bindParameters.output;t.bindFramebuffer();for(const s of t.cascades)s.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(s.camera,s.camera),this.renderAllGeometry(e);t.finish(e),this._bindParameters.output=r}get _needsDepth(){return this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements&&this.oitEnabled||this._hasPhotoshopTerrain}_renderAmbientIlluminationAndDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(R.AMBIENT_ILLUMINATION,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth?.release(),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(oe.DEPTH)):(e.detachDepth(),this._bindParameters.depth=n(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(this._bindParameters.depth=n(this._bindParameters.depth),!this._needsDepth)return;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"geometry depth",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(oe.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._bindParameters.output;this._bindParameters.output=3;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"terrain depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=s.obtainDepthTexture(),s.release(),this._bindParameters.output=e}_renderGeometryDepth(){if(this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),!this._needsTerrainDepth)return;const e=this._bindParameters.output,{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"geometry depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(3),this._bindParameters.output=e,this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Y.Zero;const t=$(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Y.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<L)return void(this.sceneDepthRange.value=Y.Infinite);const t=e.clone();t.near=I,t.far=1e10;const r=$(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",...D,R.VIEWSHED,R.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(4),this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&this._precompileAllGeometry(5),this.hasSSAO&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,R.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"normals",5);s.acquireDepth(13),this._rctx.bindFramebuffer(s.fbo),this._rctx.clearFramebuffer(E,!0,!0),this._bindParameters.output=4,this._plugins.render(...ge);const i=this._nodes.optional("normals",...D,R.VIEWSHED);return s.retain(e+i-1),this.performanceInfo.advance(oe.NORMALS),s}_renderSSAO(){const e=this._pluginInput.get("normals");if(this.hasSSAO&&e)return this._bindParameters.ssao=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION),this._bindParameters.ssao}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...fe),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Pe);this._renderContext.renderOccludedMask=Z}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(10),this.renderSlots(e,...Pe),this._renderContext.renderOccludedMask=Z}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(17),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(15)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillReferenceDepth(){const e=this._bindParameters.output;this._bindParameters.output=9,this._plugins.precompile(...Ae),this._bindParameters.output=e}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=s}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Ae),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._bindParameters.output=s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...be)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...pe),this._nodes.precompile(this._bindParameters.hasEmission,R.CUTFILL_COLOR,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...pe)}_renderTransparentGeometry(){this._plugins.render(...ce),this._oitCallouts&&this._plugins.render(16)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"transparent terrain"),s=()=>this._plugins.render(6);return this._renderToTargets(s,r,this._framebuffer.depth,E),this.performanceInfo.advance(oe.TRANSPARENT_TERRAIN),r}_renderTransparentGround(){this._plugins.render(...fe)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquireDepth(this._hudDepthFormat,t,r,"line callouts");this._renderToTargets(e,this._framebuffer.color,s,void 0,!0,!0),s.release()}else this._plugins.render(16)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,r=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this.oitEnabled?(this._bindParameters.output=1,this._plugins.precompile(...Te),this._bindParameters.output=2,this._plugins.precompile(...Te),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1)):(this._bindParameters.output=0,this._plugins.precompile(...Te)),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...Te)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=r}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;if(this.oitEnabled){const r=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const s=!!t.getTexture(_e);this._compositor.compositePreMultipliedAlpha(this._bindParameters,r.getTexture(),s),r.release()}else if(this._bindParameters.output=0,0===e){const t=()=>this._renderHUDElements(e),{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquireDepth(this._hudDepthFormat,r,s,"hud");this._renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(this._hudDepthFormat),this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(256),this._renderHUDElements(e),t.detachDepth();return this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,{width:s,height:i}=this._framebuffer.size,{highlights:a}=r,n=a.length>B?3:1,h=e.acquire(s,i,"highlights",n);h.acquireDepth(13);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),j(t,e,s,i,r,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...S)+this._nodes.optional("highlights",...S)-1),h}_renderHighlightGeometries(){this._plugins.render(...we),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this.oitEnabled&&F(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...ce),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=2,this._plugins.precompile(...ce),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=0):this._plugins.precompile(...ce)}_renderOIT(e,t=2){const r=1===e,{width:s,height:i}=this._framebuffer.size,a=r?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const _=r?"oit hud":"oit",l=this.fboCache.acquire(s,i,_,o),u=h.hasEmission&&(0===e||1!==t);u&&l.acquireColor(_e,o,"oit emissive");const m=u?le:_e;l.acquireColor(m,this.hasFloatBlend?7:0,"oit alpha"),r||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,E),a(),l.detachDepth(),h.output=2;const p=this.fboCache.acquire(s,i,r?"oit hud front":"oit front");u&&p.acquireColor(_e,o,"oit emissive front"),r?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(E,r),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!r;let f;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,r?(f=this.fboCache.acquire(s,i,"oit hud composite"),this._rctx.bindFramebuffer(f.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(m,0,"hud occlusion"),this._rctx.clearBuffer(m-ue,E)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,l,p,h,u,c,e),f?.detachDepth(),r||(this._rctx.bindFramebuffer(p.fbo),this._framebuffer.bind(),c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(m))),p.release(),l.release(),h.output=d,f}get _hudDepthFormat(){return this.isFeatureEnabled(8)?13:12}get _needsOpaquePass(){return this.plugins.produces(0,...pe)||this.plugins.produces(5,...pe)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._framebuffer.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),this._plugins.render(2,3));const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(A.OPAQUE,t,e)),this.fboCache.debugCallback?.(A.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderTransparent(){const e=this._framebuffer;e.bind(),e.update(e=>this._renderNodes(R.PRE_TRANSPARENT,e)),this.fboCache.debugCallback?.(R.PRE_TRANSPARENT,e.color.fbo),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),e.update(e=>this._renderNodes(A.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(A.TRANSPARENT,e.color.fbo),this._renderGeometryDepth(),this._needsTerrainDepth||this._oitCallouts||this._plugins.render(16),this._renderEdges(0);const t=this._renderPhotoshopTerrain(),r=t?.getTexture();r&&this._renderHUD(0,e.color),this._bindParameters.cullAboveTerrain=!1,r&&(e.bind(),this._compositor.compositePreMultipliedAlpha(this._bindParameters,r),t?.release(),this._needsTerrainDepth&&(this._renderEdges(1),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(oe.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=n(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(oe.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,r=!1){const s=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(s,t.fbo);const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),i}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(e){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,e,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=b:(f(Se,this._bindParameters.camera.viewMatrix),f(De,this._bindParameters.camera.projectionMatrix),g(Ie,Se,De),g(Ie,this._renderContext.lastFrameCamera.viewMatrix,Ie),g(Ie,this._renderContext.lastFrameCamera.projectionMatrix,Ie),this._reprojectionMatrix=Ie);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=b,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,s){this._bindParameters.updateLighting(e,t,r,s),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}_renderToTargets(e,t,r,s,i=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(s,i,a),e(),t.detachDepth()}get test(){}};e([m({readOnly:!0})],me.prototype,"highResolutionAtmosphere",null),e([m()],me.prototype,"_edgeView",void 0),e([m()],me.prototype,"updating",null),me=e([p("esri.views.3d.webgl-engine.lib.Renderer")],me);const pe=[0,1,2,3],ce=[8,7,4,5],fe=[6,8,7],ge=[0,1,2,4,...fe],be=[3,5],Pe=[2,4,9],Te=[17,13,15,14],we=[4,5,2,3,0,1,...fe],Ee=[4,9,5,12],Ce={0:[14],1:[13],2:[14,13],3:[14,13]},Ae=[0,1,...fe],Re=["normals","highlights"],De=P(),Se=P(),Ie=P();function xe(e){return t=>e.immediate.schedule(t)}export{me as Renderer};
2
+ import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{removeMaybe as s,abortMaybe as i,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as _,initial as l,sync as u}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as f,invert as g,multiply as b}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as P,create as T}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as E,ZEROS as A}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as C}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as R,InternalRenderCategory as D,AllRenderNodeOutputs as S,AllInternalRenderNodeOutputs as I}from"../../webgl.js";import{minNearDistanceInMeters as O}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import"../../webgl/ManagedDepthAttachment.js";import{FBOCache as y}from"../core/FBOCache.js";import{RenderPassManager as F}from"../core/renderPasses/RenderPassManager.js";import{isColor as N}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as v}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{hasOit8Bit as H,hasEmissive8Bit as M}from"../effects/fboFormatUtils.js";import{RenderNodes as q}from"../effects/RenderNodes.js";import{RenderPluginManager as G}from"../effects/RenderPluginManager.js";import{WeatherFader as L}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as j}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as V}from"../effects/highlight/Highlight.js";import{OITBlend as k}from"../effects/transparency/OITBlend.js";import{AnimationTimer as W}from"./AnimationTimer.js";import{AnimationTimeStep as z}from"./AnimationTimeStep.js";import{BoundingInfo as Q}from"./BoundingInfo.js";import{Compositor as Y}from"./Compositor.js";import{DepthRange as $}from"./DepthRange.js";import{depthRangeFromScene as J}from"./depthRangeUtils.js";import{MainFramebuffer as K}from"./MainFramebuffer.js";import{RenderContext as Z,defaultRenderOccludedMask as X}from"./RenderContext.js";import{RendererBase as ee}from"./RendererBase.js";import{setupFeatureDefaults as te}from"./RenderFeature.js";import{RenderPluginInput as re}from"./RenderPluginInput.js";import{ShadowAccumulator as se}from"./ShadowAccumulator.js";import{ShadowMap as ie}from"./ShadowMap.js";import ae from"./SliceHelper.js";import{MergedRenderer as ne}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as he}from"../parts/renderUtils.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{PixelType as _e,ColorAttachment1 as le,ColorAttachment2 as ue,ColorAttachment0 as me}from"../../../webgl/enums.js";let pe=class extends ee{constructor(e,t,r,s,i){super({stage:e}),this._techniques=r,this._rctx=s,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new F,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=E(0,0,0,1),this._sliceHelper=new ae,this.sceneDepthRange=m($.Infinite),this._state=m(2),this._hasOit8Bit=H(),this._hasEmissive8Bit=M(),this._hasAnimations=!1,this._animationTimestep=new z,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new re,this._hasTransparentGeometry=!1,this._oitCallouts=!1,this._releaseNodeInputs=e=>{for(const t of De)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new y(s),this._compositor=new Y(s,r),this._renderStateFeatures=m(te(e.view.qualityProfile));const a=new ie(this._fboCache,e.viewingMode);this._renderContext=new Z(this._rctx,a,r),this._framebuffer=new K(this._fboCache,this._bindParameters),this._performanceInfo=new oe(this._rctx),this._blit=new U(r),this._shadowAccumulator=new se(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,r,s)=>{const i=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,s,!0,i),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},i),this._nodes=new q(this._renderContext),this._plugins=new G({renderContext:this._renderContext,techniques:r,materials:t,requestRender:i,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new L({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>i(),_),d(()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},l),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():A;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},_),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=v,_),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),d(()=>this._bindParameters.clouds.data?.state,()=>i(),u),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},l),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},_)])}destroy(){this._gpuTimerHandle=s(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,Q.prune(),ne.prune(),C()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new k(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=te(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(s=>s.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&this.isFeatureEnabled(5)}get _hasHighlights(){return this._plugins.produces(10,2,4,19,13,14,15)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,13,14,15)}get hasSSAO(){return this.isFeatureEnabled(4)&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmission(){return this._plugins.hasEmitters&&(this._hasEmissive8Bit||this.hasFloatBlend)}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(10)}get oitEnabled(){return this.hasFloatBlend||this._hasOit8Bit}get highResolutionAtmosphere(){return this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:xe(this.stage.view.resourceController)});return this.addHandles(d(()=>r.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&f(this._bindParameters.reprojection.matrix,P)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){void 0!==e.shadowMap&&this._bindParameters.shadowMap.enabled!==e.shadowMap&&(this._bindParameters.shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,10)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,14),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...we),has.water=this._plugins.produces(4,20),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new W(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?s(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r,s=!1){try{return this._isRendering=!0,this._render(e,t,r,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new he(this._pluginInput.get(R.FINAL),null)}_render(e,t,r,s){const i=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:a,contentCamera:o,mode:d,alignPixelEnabled:_}=e;this._state.value=d,this._renderContext.time=t,this._bindParameters.output=0,this._bindParameters.hasEmission=this._hasEmission,this._bindParameters.alignPixelEnabled=_,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(D.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(D.CUTFILL_COMPUTATION),this._renderOverlay(),a.setGLViewport(this._rctx);const u=this._framebuffer,m=u.initialize(a.fullWidth,a.fullHeight,this._backgroundColor);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor=m):m?.release(),this._ensureBindParametersCamera(a,o),this._ensureBindParametersWeatherFader(this._renderContext.time),this._plugins.sortTestsTransparentOrderedSlots(Ae),this._plugins.prepareRender(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._hasTransparentGeometry=this._plugins.produces(0,...fe),this._precompilePrepasses(),this.performanceInfo.advance(de.PREPARE);const p=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,p),this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowAccumulation(p,!i),this._oitCallouts=this._hasTransparentGeometry&&this.oitEnabled,this._ensureBindParametersSSR(t),u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(),this._bindParameters.output=0,this._renderOpaque(),this._renderTransparent(),this._bindParameters.reprojection.lastFrameColor=n(this._bindParameters.reprojection.lastFrameColor),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(D.FOCUSAREA,this._renderFocusAreaGeometry()),u.update(e=>this._renderNodes(D.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(D.VIEWSHED,e)),u.update(e=>this._renderNodes(D.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(D.FOCUSAREA_COLOR,e)),this._pluginInput.release(D.FOCUSAREA),u.update(e=>this._renderNodes(D.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===r?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(R.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),u.update(e=>this._renderNodes(D.ANTIALIASING,e));const f=this._hasPhotoshopTerrain||!this._hasTransparentGeometry?1:2;let g;return this._bindParameters.hasEmission=!1,this._hasHUDHighlights&&u.update(e=>this._renderHUD(f,e)),u.update(e=>this._renderNodes(D.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(f,e)),this._bindParameters.hasEmission=this._hasEmission,u.update(e=>this._renderNodes(D.MAGNIFIER,e)),u.update(e=>this._renderNodes(R.FINAL,e)),i&&this._blit.toFramebuffer(this._rctx,u.color,this._bindParameters),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(g=u.color,g.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new he(g,c)}_precompileShaders(){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const e=this._bindParameters.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(e,D.OPAQUE_ENVIRONMENT,D.PRE_TRANSPARENT);const t=this._bindParameters;if(t.terrainDepthTest=t.cullAboveTerrain=this._needsTerrainDepth,this._bindParameters.output=3,this._plugins.precompile(...ge),this._needsDepth&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._bindParameters.output=0,this._plugins.precompile(...ge),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1)}this._hasTransparentGeometry&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(t.cullAboveTerrain=!1,this._precompileTransparentGeometry(),t.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(e,D.FOCUSAREA);const r=this._hasPhotoshopTerrain&&!this._needsTerrainDepth;this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,r,e),this._oitCallouts||this._plugins.precompile(16),t.terrainDepthTest=t.cullAboveTerrain=!1,this._nodes.precompile(e,D.TRANSPARENT_ENVIRONMENT,D.VIEWSHED,D.CUTFILL_COMPUTATION,D.LASERLINES,D.FOCUSAREA_COLOR,D.OCCLUDED,D.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.hasEmission=!1,this._precompileHUD(0),this._precompileHUD(1),t.hasEmission=this._hasEmission,this._hasHighlights&&(t.highlights.forEach((e,r)=>{t.highlightLevel=r,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(14,13)}),t.highlightLevel=null,this._nodes.precompile(e,D.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(e,R.COMPOSITE,D.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(D.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(de.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:r}=this._framebuffer.size;let s=this.fboCache.acquire(t,r,"olid");return s.acquireDepth(13),s=this._nodes.render(s,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,s}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let s=0;t?s=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const i=Math.max(e,s);this._animationTimestep.frame(i,r)}}readMainDepth(e,t){const{mainDepth:r,camera:s}=this._bindParameters;if(!r)return;const i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(i.fbo),s.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(A),this._compositor.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,_e.UNSIGNED_BYTE,t),i.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquire(r,s,"edges"),a=this._bindParameters.geometryDepth,n=()=>t.render(this._bindParameters,e);this._renderToTargets(n,i,a??this._framebuffer.depth,A),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?de.OPAQUE_EDGES:de.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(de.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const s=this._bindParameters.shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(7,s),s.clear(),this._renderShadowCascades(6,s)):this._renderShadowCascades(5),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(de.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(D.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const r=this._bindParameters.output;t.bindFramebuffer();for(const s of t.cascades)s.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(s.camera,s.camera),this.renderAllGeometry(e);t.finish(e),this._bindParameters.output=r}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this._shadowAccumulator.accumulating+ +this._testsNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements&&this.oitEnabled||this._hasPhotoshopTerrain}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(D.AMBIENT_ILLUMINATION,this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(de.DEPTH)):e.detachDepth(),this.hasSSAO&&this._pluginInput.release("normals")}else this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"geometry",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=s.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),s.release(),this.performanceInfo.advance(de.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._bindParameters.output;this._bindParameters.output=3;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"terrain",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=s.obtainDepthTexture(),s.release(),this._bindParameters.output=e}_renderGeometryDepth(){if(this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),!this._needsTerrainDepth)return;const e=this._bindParameters.output,{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"geometry",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(3),this._bindParameters.output=e,this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return $.Zero;const t=J(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=$.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<j)return void(this.sceneDepthRange.value=$.Infinite);const t=e.clone();t.near=O,t.far=1e10;const r=J(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",...S,D.VIEWSHED,D.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(4),this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&this._precompileAllGeometry(5),this.hasSSAO&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,D.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"normals",5);s.acquireDepth(13),this._rctx.bindFramebuffer(s.fbo),this._rctx.clearFramebuffer(A,!0,!0),this._bindParameters.output=4,this._plugins.render(...be);const i=this._nodes.optional("normals",...S,D.VIEWSHED);return s.retain(e+i-1),this.performanceInfo.advance(de.NORMALS),s}_renderSSAO(){const e=this._pluginInput.get("normals");if(this.hasSSAO&&e)return this._bindParameters.ssao=this._nodes.produce(D.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(de.AMBIENT_ILLUMINATION),this._bindParameters.ssao}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...ge),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Te);this._renderContext.renderOccludedMask=X}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(10),this.renderSlots(e,...Te),this._renderContext.renderOccludedMask=X}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(17),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(15)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillReferenceDepth(){const e=this._bindParameters.output;this._bindParameters.output=9,this._plugins.precompile(...Re),this._bindParameters.output=e}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=s}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Re),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._bindParameters.output=s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Pe)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...ce),this._nodes.precompile(this._bindParameters.hasEmission,D.CUTFILL_COLOR,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...ce)}_renderTransparentGeometry(){this._plugins.render(...fe),this._oitCallouts&&this._plugins.render(16)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"transparent terrain"),s=()=>this._plugins.render(6);return this._renderToTargets(s,r,this._framebuffer.depth,A),this.performanceInfo.advance(de.TRANSPARENT_TERRAIN),r}_renderTransparentGround(){this._plugins.render(...ge)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquireDepth(this._hudDepthFormat,t,r,"line callouts");this._renderToTargets(e,this._framebuffer.color,s,void 0,!0,!0),s.release()}else this._plugins.render(16)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,r=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this.oitEnabled?(this._bindParameters.output=1,this._plugins.precompile(...we),this._bindParameters.output=2,this._plugins.precompile(...we),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1)):(this._bindParameters.output=0,this._plugins.precompile(...we)),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...we)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=r}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;if(this.oitEnabled){const r=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const s=!!t.getTexture(le);this._compositor.compositePreMultipliedAlpha(this._bindParameters,r.getTexture(),s),r.release()}else if(this._bindParameters.output=0,0===e){const t=()=>this._renderHUDElements(e),{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquireDepth(this._hudDepthFormat,r,s,"hud");this._renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(this._hudDepthFormat),this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(256),this._renderHUDElements(e),t.detachDepth();return this.performanceInfo.advance(0===e?de.HUD_OCCLUDED:de.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,{width:s,height:i}=this._framebuffer.size,{highlights:a}=r,n=a.length>B?3:1,h=e.acquire(s,i,"highlights",n);h.acquireDepth(13);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),V(t,e,s,i,r,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(de.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...I)+this._nodes.optional("highlights",...I)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ee),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&(this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(de.ACCUMULATED_SHADOWS),this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){this.oitEnabled&&N(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...fe),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=2,this._plugins.precompile(...fe),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=0):this._plugins.precompile(...fe)}_renderOIT(e,t=2){const r=1===e,{width:s,height:i}=this._framebuffer.size,a=r?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const _=r?"oit hud":"oit",l=this.fboCache.acquire(s,i,_,o),u=h.hasEmission&&(0===e||1!==t);u&&l.acquireColor(le,o,"oit emissive");const m=u?ue:le;l.acquireColor(m,this.hasFloatBlend?7:0,"oit alpha"),r||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,A),a(),l.detachDepth(),h.output=2;const p=this.fboCache.acquire(s,i,r?"oit hud front":"oit front");u&&p.acquireColor(le,o,"oit emissive front"),r?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(A,r),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!r;let f;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,r?(f=this.fboCache.acquire(s,i,"oit hud composite"),this._rctx.bindFramebuffer(f.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(m,0,"hud occlusion"),this._rctx.clearBuffer(m-me,A)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,l,p,h,u,c,e),f?.detachDepth(),r||(this._rctx.bindFramebuffer(p.fbo),this._framebuffer.bind(),c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(m))),p.release(),l.release(),h.output=d,f}get _hudDepthFormat(){return this.isFeatureEnabled(8)?13:12}get _needsOpaquePass(){return this.plugins.produces(0,...ce)||this.plugins.produces(5,...ce)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._framebuffer.update(e=>this._renderNodes(D.CUTFILL_COLOR,e)),this._plugins.render(2,3));const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(R.OPAQUE,t,e)),this.fboCache.debugCallback?.(R.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(D.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(D.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderTransparent(){const e=this._framebuffer;e.bind(),e.update(e=>this._renderNodes(D.PRE_TRANSPARENT,e)),this.fboCache.debugCallback?.(D.PRE_TRANSPARENT,e.color.fbo),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),e.update(e=>this._renderNodes(R.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(R.TRANSPARENT,e.color.fbo),this._renderGeometryDepth(),this._needsTerrainDepth||this._oitCallouts||this._plugins.render(16),this._renderEdges(0);const t=this._renderPhotoshopTerrain(),r=t?.getTexture();r&&this._renderHUD(0,e.color),this._bindParameters.cullAboveTerrain=!1,r&&(e.bind(),this._compositor.compositePreMultipliedAlpha(this._bindParameters,r),t?.release(),this._needsTerrainDepth&&(this._renderEdges(1),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(de.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=n(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(de.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,r=!1){const s=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(s,t.fbo);const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),i}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(e){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,e,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersSSR(e){const{screenSpaceReflections:t,reprojection:r,camera:s}=this._bindParameters;if(t.enabled=this.hasReflections,t.enabled){null==this._ssrEnableTime&&(this._ssrEnableTime=e),r.lastFrameCamera.equals(s)?this._reprojectionMatrix=P:(g(Ie,s.viewMatrix),g(Se,s.projectionMatrix),b(Oe,Ie,Se),b(Oe,r.lastFrameCamera.viewMatrix,Oe),b(Oe,r.lastFrameCamera.projectionMatrix,Oe),this._reprojectionMatrix=Oe);const i=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=i>0?Math.min(i,e-this._ssrEnableTime)/i:1,t.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=P,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,s){this._bindParameters.updateLighting(e,t,r,s),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}_renderToTargets(e,t,r,s,i=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(s,i,a),e(),t.detachDepth()}get test(){}};e([p({readOnly:!0})],pe.prototype,"highResolutionAtmosphere",null),e([p()],pe.prototype,"_edgeView",void 0),e([p()],pe.prototype,"updating",null),pe=e([c("esri.views.3d.webgl-engine.lib.Renderer")],pe);const ce=[0,1,2,3],fe=[8,7,4,5],ge=[6,8,7],be=[0,1,2,4,...ge],Pe=[3,5],Te=[2,4,9],we=[17,13,15,14],Ee=[4,5,2,3,0,1,...ge],Ae=[4,9,5,12],Ce={0:[14],1:[13],2:[14,13],3:[14,13]},Re=[0,1,...ge],De=["normals","highlights"],Se=T(),Ie=T(),Oe=T();function xe(e){return t=>e.immediate.schedule(t)}export{pe as Renderer};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import t from"../../webgl/RenderCamera.js";class a{constructor(){this.lastFrameCamera=new t,this.matrix=r()}}export{a as ReprojectionUniforms};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ class t{constructor(){this.enabled=!1,this.fadeFactor=1}}export{t as ScreenSpaceReflectionsUniforms};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{sliceEquals as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as r}from"../../../../core/mathUtils.js";import{releaseMaybe as s,disposeMaybe as a}from"../../../../core/maybe.js";import{watch as o,sync as n}from"../../../../core/reactiveUtils.js";import{signal as h}from"../../../../core/signal.js";import{property as c,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{copy as l,equals as _}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as d}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as p}from"./BindParameters.js";import{DepthRange as f}from"./DepthRange.js";import{createQuadVAO as g}from"./glUtil3D.js";import{ShadowCastRenderer as b,shadowCastDisabledElevationThreshold as v,shadowCastDisableElevationMax as S,shadowCastDisableElevationMin as y}from"./ShadowCastRenderer.js";import{ShadowMap as w}from"./ShadowMap.js";import{S as A}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as R}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as F}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as C}from"../shaders/ShadowCastClearTechnique.js";import{TaskPriority as x}from"../../../support/Scheduler.js";import{PixelType as H}from"../../../webgl/enums.js";let P=class extends t{constructor(e,t,i,r,a,h){super({}),this._fbos=e,this._techniques=t,this._stage=i,this._prepareForShadowMapPass=r,this._renderToShadowMap=a,this._requestRender=h,this._primarySet=new T(new F(0),()=>this._requestRenderIfEnabled()),this._contextSet=new T(new F(1),()=>this._requestRenderIfEnabled()),this._passParameters=new d,this._depthRange=f.Zero,this._enabled=!1,this._previewing=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._bindParameters=new p(e.rctx,new w(e,i.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=g(e.rctx),this._accumulationRenderer=new b(t,e.rctx,this,h);const c=this._stage.view.resourceController.scheduler;this.addHandles([c.registerTask(x.SHADOW_ACCUMULATOR,this),o(()=>this._previewing,e=>{e?this._invalidateAccumulationSets():this._requestRenderIfEnabled()},n),o(()=>this._numActive,()=>this._numActiveChanged(),n),o(()=>this._depthRange,()=>this._invalidateAccumulationSets(),n),o(()=>this.readyToRun,e=>{e||(this._bindParameters.depth=s(this._bindParameters.depth),this.notifyChange("canAccumulate"))}),o(()=>this.accumulating&&this.canAccumulate,()=>this._precompile(),{sync:!0,once:!0})],this._shadowAccumulatorKey)}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=a(this._accumulationRenderer),this._fboHandle=a(this._fboHandle),this._vao=a(this._vao),this._bindParameters.destroy();for(const e of this._accumulationSets())e.destroy();this._contextSet=null,this._primarySet=null}*_accumulationSets(){yield this._primarySet,yield this._contextSet}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fboHandle?.getTexture()}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return this._enabled&&[...this._accumulationSets()].some(e=>e.active)}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==f.Zero&&this._opacityFromElevation>v}get _doneAccumulating(){return[...this._accumulationSets()].every(e=>e.doneAccumulating)}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get _numActive(){return[...this._accumulationSets()].reduce((e,t)=>e+(t.active?1:0),0)}get _colorFormat(){return 2===this._numActive?2:0}get readyToRun(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some(e=>e.running)}runTask(e){this._clearBuffersOnAccumulationStart(),this._prepareForShadowMapPass(this._bindParameters);let t=!1;for(const i of this._accumulationSets())this._runTaskForSet(i,e)&&(t=!0);t&&this._requestRender()}_runTaskForSet(e,t){let i=!1;for(;!t.done&&!e.doneAccumulating;)this._accumulateShadow(e),t.madeProgress(),i=!0;return i}_precompile(){for(const e of this._accumulationSets())this._techniques.precompile(R,e.configuration),this._techniques.precompile(C,e.configuration)}renderAccumulation(e,t){return this._updateCamera(e.camera),this._bindParameters.contentCamera=e.contentCamera,this._bindParameters.depth?.release(),e.depth?.retain(),this._bindParameters.depth=e.depth,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!(!this.accumulating||!this.canAccumulate)&&(this._previewing||t?(this._clearFramebuffer(),this._reset()):this._clearBuffersOnAccumulationStart(),this._accumulateSetsForRenderFrame(t))}_clearBuffersOnAccumulationStart(){if([...this._accumulationSets()].every(e=>0===e.progress))this._clearFramebuffer();else for(const e of this._accumulationSets())0===e.progress&&this._clearFramebufferForSet(this._fboHandle,e)}_accumulateSetsForRenderFrame(e){let t=!1;for(const i of this._accumulationSets())this._accumulateSetForRenderFrame(i,e)&&(t=!0);return t&&this._requestRender(),t}_accumulateSetForRenderFrame(e,t){let i=t?e.sampleCount:Math.min(q,e.sampleCount);i-=e.progress;for(let r=0;r<i;++r)this._accumulateShadow(e);return i>0}precompile(){this._accumulationRenderer.precompile()}render(e){this._accumulationRenderer.render(e)}setParameters(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const i=this._primarySet.progress;return!this.active||!this._fboHandle||i<1||e<0||e>=this._fboHandle.fbo.width||t<0||t>=this._fboHandle.fbo.height?0:(this._fboHandle.fbo.readPixels(e,t,1,1,6408,H.UNSIGNED_BYTE,j),j[0]/i)}_numActiveChanged(){if(!this._enabled||!this._fboHandle)return;const e=2===this._numActive,{width:t,height:i}=this._fboHandle.fbo,r=this._createFBO(t,i);e&&(this._clearFramebuffer(r),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fboHandle.fbo,r.fbo),this._fboHandle.dispose(),this._fboHandle=r,this._requestRender()}_enable(){this._enabled||(this._enabled=!0,this._invalidateAccumulationSets())}_disable(){this._enabled&&(this._fboHandle=a(this._fboHandle),this._enabled=!1,this._requestRender())}_createFBO(e,t){return this._fbos.acquire(e,t,"shadow accumulation",this._colorFormat)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fboHandle){e&&(this._rctx.bindFramebuffer(e.fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(16384))}_clearFramebufferForSet(e,t){if(!e)return;const i=this._techniques.get(C,t.configuration);this._rctx.bindFramebuffer(e.fbo),this._rctx.bindTechnique(i,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(e){this._renderToShadowMap(this._bindParameters,e.lightDirections[e.progress++],this._depthRange);const t=this._techniques.get(R,e.configuration);this._rctx.bindFramebuffer(this._fboHandle?.fbo),this._rctx.bindTechnique(t,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,this._vao.vertexCount("geometry"))}_updateCamera(e){if(!this._enabled)return;const t=this._bindParameters.camera;e.equals(t)||t.copyFrom(e),this._fboHandle?.fbo.width===e.fullWidth&&this._fboHandle?.fbo.height===e.fullHeight||(this._fboHandle?.release(),this._fboHandle=this._createFBO(e.fullWidth,e.fullHeight)),this._opacityFromElevation=1-r(y,S,e.relativeElevation)}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}get _rctx(){return this._fbos.rctx}updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e)}get test(){}};e([c()],P.prototype,"_refining",null),e([c()],P.prototype,"active",null),e([c()],P.prototype,"canAccumulate",null),e([c()],P.prototype,"_doneAccumulating",null),e([c()],P.prototype,"_opacityFromElevation",null),e([c()],P.prototype,"_numActive",null),e([c()],P.prototype,"_colorFormat",null),e([c()],P.prototype,"readyToRun",null),e([c()],P.prototype,"_depthRange",void 0),e([c()],P.prototype,"_enabled",void 0),e([c()],P.prototype,"_previewing",void 0),e([c()],P.prototype,"_accumulationRenderer",void 0),P=e([u("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],P);const q=6,j=new Uint8Array(4);class T{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=h(0),this._sampleCount=h(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,r=Math.min(A,e.length);if(!i(t,0,t.length,e,0,r,_)){t.length=r,this._sampleCount.value=r;for(let i=0;i<r;++i)t[i]=l(t[i]??m(),e[i]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(R,this.configuration),e.precompile(C,this.configuration)}}export{P as ShadowAccumulator};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{sliceEquals as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as r}from"../../../../core/mathUtils.js";import{releaseMaybe as s,disposeMaybe as a}from"../../../../core/maybe.js";import{watch as o,sync as n}from"../../../../core/reactiveUtils.js";import{signal as h}from"../../../../core/signal.js";import{property as c,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{copy as l,equals as _}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as d}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as p}from"./BindParameters.js";import{DepthRange as f}from"./DepthRange.js";import{createQuadVAO as g}from"./glUtil3D.js";import{ShadowCastRenderer as b,shadowCastDisabledElevationThreshold as v,shadowCastDisableElevationMax as S,shadowCastDisableElevationMin as y}from"./ShadowCastRenderer.js";import{ShadowMap as w}from"./ShadowMap.js";import{S as A}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as R}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as F}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as C}from"../shaders/ShadowCastClearTechnique.js";import{TaskPriority as x}from"../../../support/Scheduler.js";import{PixelType as H}from"../../../webgl/enums.js";let P=class extends t{constructor(e,t,i,r,a,h){super({}),this._fbos=e,this._techniques=t,this._stage=i,this._prepareForShadowMapPass=r,this._renderToShadowMap=a,this._requestRender=h,this._primarySet=new T(new F(0),()=>this._requestRenderIfEnabled()),this._contextSet=new T(new F(1),()=>this._requestRenderIfEnabled()),this._passParameters=new d,this._depthRange=f.Zero,this._enabled=!1,this._previewing=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._bindParameters=new p(e.rctx,new w(e,i.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=g(e.rctx),this._accumulationRenderer=new b(t,e.rctx,this,h);const c=this._stage.view.resourceController.scheduler;this.addHandles([c.registerTask(x.SHADOW_ACCUMULATOR,this),o(()=>this._previewing,e=>{e?this._invalidateAccumulationSets():this._requestRenderIfEnabled()},n),o(()=>this._numActive,()=>this._numActiveChanged(),n),o(()=>this._depthRange,()=>this._invalidateAccumulationSets(),n),o(()=>this.readyToRun,e=>{e||(this._bindParameters.depth=s(this._bindParameters.depth),this.notifyChange("canAccumulate"))}),o(()=>this.accumulating&&this.canAccumulate,()=>this._precompile(),{sync:!0,once:!0})],this._shadowAccumulatorKey)}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=a(this._accumulationRenderer),this._fboHandle=a(this._fboHandle),this._vao=a(this._vao),this._bindParameters.destroy();for(const e of this._accumulationSets())e.destroy();this._contextSet=null,this._primarySet=null}*_accumulationSets(){yield this._primarySet,yield this._contextSet}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fboHandle?.getTexture()}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return this._enabled&&[...this._accumulationSets()].some(e=>e.active)}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==f.Zero&&this._opacityFromElevation>v}get _doneAccumulating(){return[...this._accumulationSets()].every(e=>e.doneAccumulating)}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get _numActive(){return[...this._accumulationSets()].reduce((e,t)=>e+(t.active?1:0),0)}get _colorFormat(){return 2===this._numActive?2:0}get readyToRun(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some(e=>e.running)}runTask(e){this._clearBuffersOnAccumulationStart(),this._prepareForShadowMapPass(this._bindParameters);let t=!1;for(const i of this._accumulationSets())this._runTaskForSet(i,e)&&(t=!0);t&&this._requestRender()}_runTaskForSet(e,t){let i=!1;for(;!t.done&&!e.doneAccumulating;)this._accumulateShadow(e),t.madeProgress(),i=!0;return i}_precompile(){for(const e of this._accumulationSets())this._techniques.precompile(R,e.configuration),this._techniques.precompile(C,e.configuration)}renderAccumulation(e,t){return this._updateCamera(e.camera),this._bindParameters.contentCamera=e.contentCamera,e.depth?.retain(),this._bindParameters.depth?.release(),this._bindParameters.depth=e.depth,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!(!this.accumulating||!this.canAccumulate)&&(this._previewing||t?(this._clearFramebuffer(),this._reset()):this._clearBuffersOnAccumulationStart(),this._accumulateSetsForRenderFrame(t))}_clearBuffersOnAccumulationStart(){if([...this._accumulationSets()].every(e=>0===e.progress))this._clearFramebuffer();else for(const e of this._accumulationSets())0===e.progress&&this._clearFramebufferForSet(this._fboHandle,e)}_accumulateSetsForRenderFrame(e){let t=!1;for(const i of this._accumulationSets())this._accumulateSetForRenderFrame(i,e)&&(t=!0);return t&&this._requestRender(),t}_accumulateSetForRenderFrame(e,t){let i=t?e.sampleCount:Math.min(q,e.sampleCount);i-=e.progress;for(let r=0;r<i;++r)this._accumulateShadow(e);return i>0}precompile(){this._accumulationRenderer.precompile()}render(e){this._accumulationRenderer.render(e)}setParameters(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const i=this._primarySet.progress;return!this.active||!this._fboHandle||i<1||e<0||e>=this._fboHandle.fbo.width||t<0||t>=this._fboHandle.fbo.height?0:(this._fboHandle.fbo.readPixels(e,t,1,1,6408,H.UNSIGNED_BYTE,j),j[0]/i)}_numActiveChanged(){if(!this._enabled||!this._fboHandle)return;const e=2===this._numActive,{width:t,height:i}=this._fboHandle.fbo,r=this._createFBO(t,i);e&&(this._clearFramebuffer(r),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fboHandle.fbo,r.fbo),this._fboHandle.dispose(),this._fboHandle=r,this._requestRender()}_enable(){this._enabled||(this._enabled=!0,this._invalidateAccumulationSets())}_disable(){this._enabled&&(this._fboHandle=a(this._fboHandle),this._enabled=!1,this._requestRender())}_createFBO(e,t){return this._fbos.acquire(e,t,"shadow accumulation",this._colorFormat)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fboHandle){e&&(this._rctx.bindFramebuffer(e.fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(16384))}_clearFramebufferForSet(e,t){if(!e)return;const i=this._techniques.get(C,t.configuration);this._rctx.bindFramebuffer(e.fbo),this._rctx.bindTechnique(i,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(e){this._renderToShadowMap(this._bindParameters,e.lightDirections[e.progress++],this._depthRange);const t=this._techniques.get(R,e.configuration);this._rctx.bindFramebuffer(this._fboHandle?.fbo),this._rctx.bindTechnique(t,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,this._vao.vertexCount("geometry"))}_updateCamera(e){if(!this._enabled)return;const t=this._bindParameters.camera;e.equals(t)||t.copyFrom(e),this._fboHandle?.fbo.width===e.fullWidth&&this._fboHandle?.fbo.height===e.fullHeight||(this._fboHandle?.release(),this._fboHandle=this._createFBO(e.fullWidth,e.fullHeight)),this._opacityFromElevation=1-r(y,S,e.relativeElevation)}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}get _rctx(){return this._fbos.rctx}updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e)}get test(){}};e([c()],P.prototype,"_refining",null),e([c()],P.prototype,"active",null),e([c()],P.prototype,"canAccumulate",null),e([c()],P.prototype,"_doneAccumulating",null),e([c()],P.prototype,"_opacityFromElevation",null),e([c()],P.prototype,"_numActive",null),e([c()],P.prototype,"_colorFormat",null),e([c()],P.prototype,"readyToRun",null),e([c()],P.prototype,"_depthRange",void 0),e([c()],P.prototype,"_enabled",void 0),e([c()],P.prototype,"_previewing",void 0),e([c()],P.prototype,"_accumulationRenderer",void 0),P=e([u("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],P);const q=6,j=new Uint8Array(4);class T{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=h(0),this._sampleCount=h(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,r=Math.min(A,e.length);if(!i(t,0,t.length,e,0,r,_)){t.length=r,this._sampleCount.value=r;for(let i=0;i<r;++i)t[i]=l(t[i]??m(),e[i]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(R,this.configuration),e.precompile(C,this.configuration)}}export{P as ShadowAccumulator};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clamp as t}from"../../../../core/mathUtils.js";import{estimateNumberArrayMemory as i}from"../../../../core/memoryEstimations.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{nan as n,fromValues as s}from"../../../../geometry/support/aaBoundingBox.js";import{newContinuousIndexArray as r}from"../../../../geometry/support/Indices.js";import{MeshIntersectionOptions as o,intersectRayTriangles as a}from"./RayIntersections.js";const c=40,h=.8,m=10,l=1e-6;class d{constructor(i,n,s){this.globalTriangleVertexIndices=i,this.numTriangles=n,this.positions=s,this._rayDirection=e(),this._callback=I,this._intersectionOptions=M,this.bspNodeTree=new Array,this.triangleIndexMap=r(n);const o=p(i,n,s.data,s.stride),a=t(Math.log2(n/c),2,m),l=(t,i,e)=>{const n=g(this.triangleIndexMap,o,t,i),s=i-t;if(s<=c){const e=new f(n,void 0,0,t,i);return this.bspNodeTree.push(e),e}const{axis:r,midValue:m}=x(n),d=u(this.triangleIndexMap,o,t,i,r,m),p=(t,i)=>{if(e>a)return;const n=i-t;return n<c||n>=h*s?void 0:l(t,i,e+1)},y=new f(n,r,m,d.next,d.mid);return this.bspNodeTree.push(y),y.leftNode=p(t,d.next),y.rightNode=p(d.mid,i),y};l(0,n,0)}intersectRayTriangleRange(t,i){if(t>=i)return;const{data:e,stride:n}=this.positions;a(this._rayFrom,this._rayDirection,t,i,this.globalTriangleVertexIndices,e,n,this._intersectionOptions.normalRequired,this._callback,this.triangleIndexMap),d.numFacesTested+=i-t}intersectRay(t,i,e,n){d.numFacesTested=0;const s=t,r=i,o=r[0]-s[0],a=r[1]-s[1],c=r[2]-s[2];if(o*o+a*a+c*c<l)return;this._rayFrom=s;const h=this._rayDirection;h[0]=o,h[1]=a,h[2]=c;const m=this.triangleIndexMap.length;this._callback=n,this._intersectionOptions=e,this.intersectRayBSP(this.bspNodeTree[0],0,m),this._callback=I,this._intersectionOptions=M}intersectRayBSP(t,i,e){const n=this._rayFrom,s=this._rayDirection;if(!y(t.aabb,n,s))return;const r=t.axis,o=t.d;if(n[r]<o||s[r]<0){const e=i,n=t.midStartIndex;if(e<n){const i=t.leftNode;void 0!==i?this.intersectRayBSP(i,e,n):this.intersectRayTriangleRange(e,n)}}if(this.intersectRayTriangleRange(t.midStartIndex,t.rightStartIndex),n[r]>o||s[r]>0){const i=t.rightStartIndex,n=e;if(i<n){const e=t.rightNode;void 0!==e?this.intersectRayBSP(e,i,n):this.intersectRayTriangleRange(i,n)}}}static{this.numFacesTested=0}get estimatedMemoryUsage(){return i(this.triangleIndexMap)}}class f{constructor(t,i,e,n,s){this.aabb=t,this.axis=i,this.d=e,this.midStartIndex=n,this.rightStartIndex=s}}function u(t,i,e,n,s,r){let o=e,a=n;for(;o<a;){const e=t[o];i[6*e+s+3]<=r?++o:(--a,t[o]=t[a],t[a]=e)}let c=o;for(a=n;c<a;){const e=t[a-1];i[6*e+s]>=r?--a:(t[a-1]=t[c],t[c]=e,++c)}return{next:o,mid:c}}function g(t,i,e,r){if(r<=e)return n;let o=6*t[e];const a=s(i[o++],i[o++],i[o++],i[o++],i[o++],i[o]);for(let n=e+1;n<r;++n){let e=6*t[n];a[0]=Math.min(a[0],i[e++]),a[1]=Math.min(a[1],i[e++]),a[2]=Math.min(a[2],i[e++]),a[3]=Math.max(a[3],i[e++]),a[4]=Math.max(a[4],i[e++]),a[5]=Math.max(a[5],i[e])}return a}function x(t){const i=t[3]-t[0],e=t[4]-t[1],n=t[5]-t[2],s=i>e?i>n?0:e>n?1:2:e>n?1:n>i?2:0;return{axis:s,midValue:(t[s]+t[s+3])/2}}function p(t,i,e,n){const s=new Array;for(let r=0;r<i;++r){const i=3*r,o=t[i]*n,a=t[i+1]*n,c=t[i+2]*n;for(let t=0;t<3;++t){const i=e[o+t],n=e[a+t],h=e[c+t];s[6*r+t]=Math.min(i,n,h),s[6*r+3+t]=Math.max(i,n,h)}}return s}function y(t,i,e){const n=i,s=e;let r=0,o=1/0;for(let a=0;a<3;++a){{const i=t[a];if(n[a]<i){if(s[a]<=l)return!1;const t=(i-n[a])/s[a];r=Math.max(r,t)}else if(s[a]<=-l){const t=(i-n[a])/s[a];o=Math.min(o,t)}if(r>o)return!1}{const i=t[a+3];if(n[a]>i){if(s[a]>=-l)return!1;const t=(i-n[a])/s[a];r=Math.max(r,t)}else if(s[a]>=l){const t=(i-n[a])/s[a];o=Math.min(o,t)}if(r>o)return!1}}return!0}const M=new o,I=()=>{};export{d as TriangleIntersectionData};
2
+ import{clamp as t}from"../../../../core/mathUtils.js";import{estimateNumberArrayMemory as e}from"../../../../core/memoryEstimations.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{nan as i,fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{newContinuousIndexArray as s}from"../../../../geometry/support/Indices.js";import{MeshIntersectionOptions as a,intersectRayTriangles as o}from"./RayIntersections.js";const c=40,h=.8,d=10,l=1e-6;class m{constructor(e,i,r){this.globalTriangleVertexIndices=e,this.numTriangles=i,this.positions=r,this._rayDirection=n(),this._callback=I,this._intersectionOptions=M,this.bspNodeTree=new Array,this.triangleIndexMap=s(i);const a=x(e,i,r.data,r.stride),o=t(Math.log2(i/c),2,d),l=(t,e,n)=>{const i=u(this.triangleIndexMap,a,t,e),r=e-t;if(r<=c){const n=new g(i,void 0,0,t,e);return this.bspNodeTree.push(n),n}const{axis:s,midValue:d}=p(i),m=f(this.triangleIndexMap,a,t,e,s,d),x=(t,e)=>{if(n>o)return;const i=e-t;return i<c||i>=h*r?void 0:l(t,e,n+1)},y=new g(i,s,d,m.next,m.mid);return this.bspNodeTree.push(y),y.leftNode=x(t,m.next),y.rightNode=x(m.mid,e),y};l(0,i,0)}intersectRayTriangleRange(t,e){if(t>=e)return;const{data:n,stride:i}=this.positions;o(this._rayFrom,this._rayDirection,t,e,this.globalTriangleVertexIndices,n,i,this._intersectionOptions.normalRequired,this._callback,this.triangleIndexMap),m.numFacesTested+=e-t}intersectRay(t,e,n,i){m.numFacesTested=0;const r=t,s=e,a=s[0]-r[0],o=s[1]-r[1],c=s[2]-r[2];if(a*a+o*o+c*c<l)return;this._rayFrom=r;const h=this._rayDirection;h[0]=a,h[1]=o,h[2]=c;const d=this.triangleIndexMap.length;this._callback=i,this._intersectionOptions=n,this.intersectRayBSP(this.bspNodeTree[0],0,d),this._callback=I,this._intersectionOptions=M}intersectRayBSP(t,e,n){const i=this._rayFrom,r=this._rayDirection,s=[{node:t,rangeStart:e,rangeEnd:n}];for(;s.length>0;){const{node:t,rangeStart:e,rangeEnd:n}=s.pop();if(!y(t.aabb,i,r))continue;const a=t.axis,o=t.d;if(i[a]<o||r[a]<0){const n=e,i=t.midStartIndex;if(n<i){const e=t.leftNode;void 0!==e?s.push({node:e,rangeStart:n,rangeEnd:i}):this.intersectRayTriangleRange(n,i)}}if(this.intersectRayTriangleRange(t.midStartIndex,t.rightStartIndex),i[a]>o||r[a]>0){const e=t.rightStartIndex,i=n;if(e<i){const n=t.rightNode;void 0!==n?s.push({node:n,rangeStart:e,rangeEnd:i}):this.intersectRayTriangleRange(e,i)}}}}static{this.numFacesTested=0}get estimatedMemoryUsage(){return e(this.triangleIndexMap)}}class g{constructor(t,e,n,i,r){this.aabb=t,this.axis=e,this.d=n,this.midStartIndex=i,this.rightStartIndex=r}}function f(t,e,n,i,r,s){let a=n,o=i;for(;a<o;){const n=t[a];e[6*n+r+3]<=s?++a:(--o,t[a]=t[o],t[o]=n)}let c=a;for(o=i;c<o;){const n=t[o-1];e[6*n+r]>=s?--o:(t[o-1]=t[c],t[c]=n,++c)}return{next:a,mid:c}}function u(t,e,n,s){if(s<=n)return i;let a=6*t[n];const o=r(e[a++],e[a++],e[a++],e[a++],e[a++],e[a]);for(let i=n+1;i<s;++i){let n=6*t[i];o[0]=Math.min(o[0],e[n++]),o[1]=Math.min(o[1],e[n++]),o[2]=Math.min(o[2],e[n++]),o[3]=Math.max(o[3],e[n++]),o[4]=Math.max(o[4],e[n++]),o[5]=Math.max(o[5],e[n])}return o}function p(t){const e=t[3]-t[0],n=t[4]-t[1],i=t[5]-t[2],r=e>n?e>i?0:n>i?1:2:n>i?1:i>e?2:0;return{axis:r,midValue:(t[r]+t[r+3])/2}}function x(t,e,n,i){const r=new Array;for(let s=0;s<e;++s){const e=3*s,a=t[e]*i,o=t[e+1]*i,c=t[e+2]*i;for(let t=0;t<3;++t){const e=n[a+t],i=n[o+t],h=n[c+t];r[6*s+t]=Math.min(e,i,h),r[6*s+3+t]=Math.max(e,i,h)}}return r}function y(t,e,n){const i=e,r=n;let s=0,a=1/0;for(let o=0;o<3;++o){{const e=t[o];if(i[o]<e){if(r[o]<=l)return!1;const t=(e-i[o])/r[o];s=Math.max(s,t)}else if(r[o]<=-l){const t=(e-i[o])/r[o];a=Math.min(a,t)}if(s>a)return!1}{const e=t[o+3];if(i[o]>e){if(r[o]>=-l)return!1;const t=(e-i[o])/r[o];s=Math.max(s,t)}else if(r[o]>=l){const t=(e-i[o])/r[o];a=Math.min(a,t)}if(s>a)return!1}}return!0}const M=new a,I=()=>{};export{m as TriangleIntersectionData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import s from"../../../../core/Collection.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{disposeMaybe as r,releaseMaybe as i}from"../../../../core/maybe.js";import{watch as a,initial as o,when as n,sync as h}from"../../../../core/reactiveUtils.js";import{property as d,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{translate as c,fromTranslation as w,scale as m,mul as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{sub as u,distance as v}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Sphere as g}from"../../../../geometry/support/sphere.js";import{InternalRenderCategory as b}from"../../webgl.js";import M from"../../webgl/RenderNode.js";import{ViewshedShadowMap as S}from"./ViewshedShadowMap.js";import{V as y}from"../../../../chunks/Viewshed.glsl.js";import{ViewshedTechnique as P}from"../shaders/ViewshedTechnique.js";import{ColorAttachment0 as j}from"../../../webgl/enums.js";let x=class extends M{get shadowMap(){return this._shadowMap}get hasViewsheds(){return this._viewsheds.length>0}get _contentPixelRatio(){return this.view.state.contentPixelRatio}get _viewshedsInView(){return this._viewsheds.items.filter(e=>A(this.view,e))}constructor(e){super(e),this.isDecoration=!1,this._passParameters=new y,this._viewsheds=new s,this._shadowMap=null,this.consumes={required:[b.VIEWSHED,"normals"]},this.produces=b.VIEWSHED}initialize(){this._shadowMap=new S(this.fboCache),this.addHandles([a(()=>this.view.resolutionScale,e=>{const s=this._shadowMap;s&&(s.settings.textureSizeQuality=e)},o),n(()=>!this.hasViewsheds,()=>this._shadowMap?.dispose()),a(()=>this._viewshedsInView.map(e=>[e.observerRenderSpace,e.heading,e.tilt,e.farDistance,e.horizontalFieldOfView,e.verticalFieldOfView]),()=>this.requestRender(1),h)])}destroy(){this._shadowMap=r(this._shadowMap)}precompile(){if(this.hasViewsheds){this.techniques.precompile(P);for(const e of this._viewshedsInView)if(this._shadowMap?.isActive(e))return void this.view.stage.renderer.precompileViewshedShadowMap()}}render(e){const s=this.bindParameters,t=this.renderingContext,r=e.find(({name:e})=>e===b.VIEWSHED);if(!this.hasViewsheds||this.isDecoration&&!s.decorations)return r;const a=this.techniques.getCompiled(P);if(!a)return this.requestRender(1),r;const o=this.view.stage.renderer.isFeatureEnabled(7);this._passParameters.shadowMap=this._shadowMap??this._passParameters.shadowMap,this._passParameters.depth=r.obtainDepthTexture(),this._passParameters.normals=e.find(({name:e})=>"normals"===e)?.getTexture();for(const i of this._viewshedsInView){if(!this._renderShadowCubeMap(s,i,o)||!this._shadowMap?.ready)continue;const e=this._setupViewshedParameters(i,s.camera);t.bindFramebuffer(r.fbo),t.bindTechnique(a,s,e),t.setDrawBuffers([j]),t.screen.draw()}return this.shadowMap?.dispose(),r.attachDepth(this._passParameters.depth),this._passParameters.depth=i(this._passParameters.depth),r}updateViewsheds(e){const s=this._viewsheds,{removes:t,adds:r}=e;if(t&&(Array.isArray(t)?s.removeMany(t):s.remove(t)),r)if(Array.isArray(r)){const e=r.filter(e=>!s.includes(e));s.addMany(e)}else s.includes(r)||s.add(r)}_renderShadowCubeMap(e,s,t){const r=this._shadowMap;if(!r)return!1;const i=this.view.basemapTerrain.hasStencilEnabledExtents,a=r.start(e.camera,s,t,this._contentPixelRatio,i);return a&&r.faces.forEach(e=>this.view.stage.renderer.renderViewshedShadowMap(e)),r.finish(),a}_setupViewshedParameters(e,s){const r=this._shadowMap;if(!r)return this._passParameters;const i=this._passParameters,a=e.effectiveObserverRenderSpace;i.localOrigin=a,i.observerOffset=u(I,e.observerRenderSpace,e.effectiveObserverRenderSpace),i.fovs=[t(e.horizontalFieldOfView),t(e.verticalFieldOfView)],i.headingAndTilt=[t(e.heading),t(e.tiltParallelToSurface)],i.upVector=e.tiltedUpVector;const o=R(e.targetRenderSpace,a);i.targetVector=o;const n=new Array,h=new Array;for(let t=0;t<r.numActiveFaces;t++)c(O,r.viewshedViewMatrices[t],a),n.push(...O),D(r.viewshedProjectionMatrices[t],O,q),h.push(...q);return i.viewMatrices=n,i.projectionMatrices=h,i.volumeOffset=this.selectedViewshed?.()===e.viewshed?E(e,this.view,s.eye):0,i}get test(){return{viewsheds:this._viewsheds,shadowMap:this._shadowMap,viewshedsInView:this._viewshedsInView}}};function R(e,s){const t=_();return u(t,e,s)}function D(e,s,t){const r=V(.5,.5,.5);return w(t,r),m(t,t,r),l(t,t,e),l(t,t,s),t}function A(e,s){const t=new g(s.observerRenderSpace,s.farDistanceRenderSpace);return!!e.ready&&e.frustum.intersectsSphere(t)}function E(e,s,t){if(null==e)return 0;const{observerRenderSpace:r,targetRenderSpace:i}=e,a=v(t,r)>v(t,i)?e.observer:e.target;return s.pixelSizeAt(a)}e([d()],x.prototype,"selectedViewshed",void 0),e([d()],x.prototype,"isDecoration",void 0),e([d()],x.prototype,"shadowMap",null),e([d()],x.prototype,"hasViewsheds",null),e([d()],x.prototype,"_contentPixelRatio",null),e([d()],x.prototype,"_viewshedsInView",null),e([d()],x.prototype,"consumes",void 0),e([d()],x.prototype,"produces",void 0),x=e([p("esri.views.3d.webgl-engine.lib.Viewshed")],x);const I=_(),O=f(),q=f();export{x as Viewshed,E as computeOffsetScale};
2
+ import{__decorate as e}from"tslib";import s from"../../../../core/Collection.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{watch as i,initial as o,when as a,sync as n}from"../../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{translate as c,fromTranslation as p,scale as w,mul as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{sub as f,distance as u}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as v,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Sphere as V}from"../../../../geometry/support/sphere.js";import{InternalRenderCategory as g}from"../../webgl.js";import b from"../../webgl/RenderNode.js";import{ViewshedShadowMap as M}from"./ViewshedShadowMap.js";import{V as S}from"../../../../chunks/Viewshed.glsl.js";import{ViewshedTechnique as y}from"../shaders/ViewshedTechnique.js";import{ColorAttachment0 as j}from"../../../webgl/enums.js";let x=class extends b{get shadowMap(){return this._shadowMap}get hasViewsheds(){return this._viewsheds.length>0}get _contentPixelRatio(){return this.view.state.contentPixelRatio}get _viewshedsInView(){return this._viewsheds.items.filter(e=>D(this.view,e))}constructor(e){super(e),this.isDecoration=!1,this._passParameters=new S,this._viewsheds=new s,this._shadowMap=null,this.consumes={required:[g.VIEWSHED,"normals"]},this.produces=g.VIEWSHED}initialize(){this._shadowMap=new M(this.fboCache),this.addHandles([i(()=>this.view.resolutionScale,e=>{const s=this._shadowMap;s&&(s.settings.textureSizeQuality=e)},o),a(()=>!this.hasViewsheds,()=>this._shadowMap?.dispose()),i(()=>this._viewshedsInView.map(e=>[e.observerRenderSpace,e.heading,e.tilt,e.farDistance,e.horizontalFieldOfView,e.verticalFieldOfView]),()=>this.requestRender(1),n)])}destroy(){this._shadowMap=r(this._shadowMap)}precompile(){if(this.hasViewsheds){this.techniques.precompile(y);for(const e of this._viewshedsInView)if(this._shadowMap?.isActive(e))return void this.view.stage.renderer.precompileViewshedShadowMap()}}render(e){const s=this.bindParameters,t=this.renderingContext,r=e.find(({name:e})=>e===g.VIEWSHED);if(!this.hasViewsheds||this.isDecoration&&!s.decorations)return r;const i=this.techniques.getCompiled(y);if(!i)return this.requestRender(1),r;const o=this.view.stage.renderer.isFeatureEnabled(7);this._passParameters.shadowMap=this._shadowMap??this._passParameters.shadowMap,this._passParameters.normals=e.find(({name:e})=>"normals"===e)?.getTexture();const a=r.obtainDepthTexture();for(const n of this._viewshedsInView){if(!this._renderShadowCubeMap(s,n,o)||!this._shadowMap?.ready)continue;const e=this._setupViewshedParameters(n,s.camera);t.bindFramebuffer(r.fbo),t.bindTechnique(i,s,e),t.setDrawBuffers([j]),t.screen.draw()}return this.shadowMap?.dispose(),r.attachDepth(a),a?.release(),r}updateViewsheds(e){const s=this._viewsheds,{removes:t,adds:r}=e;if(t&&(Array.isArray(t)?s.removeMany(t):s.remove(t)),r)if(Array.isArray(r)){const e=r.filter(e=>!s.includes(e));s.addMany(e)}else s.includes(r)||s.add(r)}_renderShadowCubeMap(e,s,t){const r=this._shadowMap;if(!r)return!1;const i=this.view.basemapTerrain.hasStencilEnabledExtents,o=r.start(e.camera,s,t,this._contentPixelRatio,i);return o&&r.faces.forEach(e=>this.view.stage.renderer.renderViewshedShadowMap(e)),r.finish(),o}_setupViewshedParameters(e,s){const r=this._shadowMap;if(!r)return this._passParameters;const i=this._passParameters,o=e.effectiveObserverRenderSpace;i.localOrigin=o,i.observerOffset=f(E,e.observerRenderSpace,e.effectiveObserverRenderSpace),i.fovs=[t(e.horizontalFieldOfView),t(e.verticalFieldOfView)],i.headingAndTilt=[t(e.heading),t(e.tiltParallelToSurface)],i.upVector=e.tiltedUpVector;const a=R(e.targetRenderSpace,o);i.targetVector=a;const n=new Array,h=new Array;for(let t=0;t<r.numActiveFaces;t++)c(I,r.viewshedViewMatrices[t],o),n.push(...I),P(r.viewshedProjectionMatrices[t],I,O),h.push(...O);return i.viewMatrices=n,i.projectionMatrices=h,i.volumeOffset=this.selectedViewshed?.()===e.viewshed?A(e,this.view,s.eye):0,i}get test(){return{viewsheds:this._viewsheds,shadowMap:this._shadowMap,viewshedsInView:this._viewshedsInView}}};function R(e,s){const t=v();return f(t,e,s)}function P(e,s,t){const r=_(.5,.5,.5);return p(t,r),w(t,t,r),l(t,t,e),l(t,t,s),t}function D(e,s){const t=new V(s.observerRenderSpace,s.farDistanceRenderSpace);return!!e.ready&&e.frustum.intersectsSphere(t)}function A(e,s,t){if(null==e)return 0;const{observerRenderSpace:r,targetRenderSpace:i}=e,o=u(t,r)>u(t,i)?e.observer:e.target;return s.pixelSizeAt(o)}e([h()],x.prototype,"selectedViewshed",void 0),e([h()],x.prototype,"isDecoration",void 0),e([h()],x.prototype,"shadowMap",null),e([h()],x.prototype,"hasViewsheds",null),e([h()],x.prototype,"_contentPixelRatio",null),e([h()],x.prototype,"_viewshedsInView",null),e([h()],x.prototype,"consumes",void 0),e([h()],x.prototype,"produces",void 0),x=e([d("esri.views.3d.webgl-engine.lib.Viewshed")],x);const E=v(),I=m(),O=m();export{x as Viewshed,A as computeOffsetScale};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{glLayout as e}from"../../../support/buffer/glUtil.js";import{GLMaterials as t}from"../GLMaterials.js";import{VertexArrayObject as r}from"../VertexArrayObject.js";import{VertexBuffer as s}from"../../../../webgl/VertexBuffer.js";class o{constructor(o,i){this.geometry=i;const n=o.renderContext.rctx,m=i.renderGeometry,{material:a,layout:u,buffer:l}=m;this._materials=o.materials,a.setParameters({instancedDoublePrecision:!0}),this.glMaterials=new t(a,this._materials),this.vbo=new s(n,e(u),l),this.vao=new r(n,this.vbo)}destroy(){this.glMaterials.dispose(),this.vbo.dispose(),this.vao.dispose()}get material(){return this.geometry.renderGeometry.material}get layout(){return this.geometry.renderGeometry.layout}get boundingInfo(){return this.geometry.boundingInfo}get numTriangles(){return this.numVertices/3}get numVertices(){return this.geometry.renderGeometry.numVertices}get usedMemory(){return 128+this.vbo.usedMemory+this.vao.usedMemory}intersect(e,t,r,s,o,i,n,m){return this.geometry.intersect(e,t,r,s,o,i,n,m)}}export{o as LodComponentData};
2
+ import{glLayout as e}from"../../../support/buffer/glUtil.js";import{GLMaterialLoader as t}from"../GLMaterialLoader.js";import{VertexArrayObject as r}from"../VertexArrayObject.js";import{VertexBuffer as o}from"../../../../webgl/VertexBuffer.js";class s{constructor(s,i){this.geometry=i;const n=s.renderContext.rctx,a=i.renderGeometry,{material:m,layout:u,buffer:l}=a;this._materials=s.materials,m.setParameters({instancedDoublePrecision:!0}),this.glMaterialLoader=new t(m,this._materials),this.vbo=new o(n,e(u),l),this.vao=new r(n,this.vbo)}destroy(){this.glMaterialLoader.dispose(),this.vbo.dispose(),this.vao.dispose()}get material(){return this.geometry.renderGeometry.material}get layout(){return this.geometry.renderGeometry.layout}get boundingInfo(){return this.geometry.boundingInfo}get numTriangles(){return this.numVertices/3}get numVertices(){return this.geometry.renderGeometry.numVertices}get usedMemory(){return 128+this.vbo.usedMemory+this.vao.usedMemory}intersect(e,t,r,o,s,i,n,a){return this.geometry.intersect(e,t,r,o,s,i,n,a)}}export{s as LodComponentData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t}from"../../../../../core/arrayUtils.js";import r from"../../../../../core/Error.js";import{someMap as s,getOrCreateMapValue as n}from"../../../../../core/MapUtils.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{isAborted as i,throwIfAborted as o}from"../../../../../core/promiseUtils.js";import{property as l,subclass as c}from"../../../../../core/accessorSupport/decorators.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as d,dot as u,transformMat4 as m}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as _,freeze as p}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{debugFlags as g}from"../../../support/debugFlags.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import v from"../../../webgl/RenderCamera.js";import{isColor as b}from"../../core/shaderLibrary/ShaderOutput.js";import{AsyncRenderPlugin as I}from"../../effects/RenderPlugin.js";import{DepthRange as C}from"../DepthRange.js";import{assert as D}from"../Util.js";import{InstanceData as R}from"./InstanceData.js";import{InstanceOctree as E}from"./InstanceOctree.js";import{LevelSelector as x}from"./LevelSelector.js";import{LodLevel as S}from"./LodLevel.js";import{getRenderInstanceDataLayout as w,RenderInstanceData as L}from"./RenderInstanceData.js";import{colorMixModes as j}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as U}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as O}from"../../shaders/DefaultMaterialTechnique.js";import{defaultHighlightName as T}from"../../../../support/HighlightDefaults.js";import{TaskPriority as A,noBudget as M}from"../../../../support/Scheduler.js";import{bindVertexBufferLayout as q}from"../../../../webgl/Util.js";import{fromLayout as B}from"../../../../webgl/VertexAttributeLocations.js";const F=e=>{const t=e.baseBoundingSphere.radius,r=e.levels.map(e=>e.minScreenSpaceRadius);return new x(t,r)};let V=class extends I{constructor(e,t){super(e),this.type=3,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=new Array,this._highlightRenderInstanceDatas=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new v,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[2,e=>this._produces(e)],[4,e=>!!this._hasTransparentLevels()&&this._produces(e)]]),this._instanceData=new R({shaderTransformation:e.shaderTransformation},e.symbol.materialParameters),this.addHandles(t.registerTask(A.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=w(this.symbol.materialParameters),this._glInstanceBufferLayout=y(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){return[this._defaultRenderInstanceData,...this._highlightRenderInstanceDatas.values()]}get _allRenderInstanceDataExceptHighlightShadow(){const e=[this._defaultRenderInstanceData];for(const t of this._highlightRenderInstanceDatas)t[0]!==T&&e.push(t[1]);return e}hasHighlight(e){return this._highlightRenderInstanceDatas.has(e)}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerViewUid(){return this.metadata.layerViewUid}get instanceData(){return this._instanceData}get hasEmitters(){return this._levels.some(e=>e.components.some(e=>e.material.hasEmissions))}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((e,t)=>e+t.usedMemory,e),this._levels.reduce((e,t)=>e+t.components.reduce((e,t)=>e+t.usedMemory,0),0))}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach((e,r)=>{const s=this._allRenderInstanceData[0][r].size+this._allRenderInstanceData[1][r].size,n=e.triangleCount;t.push({renderedInstances:s,renderedTriangles:s*n,trianglesPerInstance:n})}),{totalInstances:e,renderedInstances:t.reduce((e,t)=>e+t.renderedInstances,0),renderedTriangles:t.reduce((e,t)=>e+t.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(){const{rctx:e}=this._context.renderContext;return this.symbol.levels.map(t=>new L(e,this._instanceBufferLayout))}async initializeRenderContext(e,r){this._context=e,this._defaultRenderInstanceData=this._createRenderInstanceDataArray();const s=await Promise.allSettled(this.symbol.levels.map(t=>S.create(e,t,r))),n=s.map(e=>"fulfilled"===e.status?e.value:null).filter(t);if(i(r)||n.length!==s.length){n.forEach(e=>e.destroy()),o(r);for(const e of s)if("rejected"===e.status)throw e.reason}this._levels=n,this._levelSelector=F(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDatas.forEach(e=>e.forEach(e=>e.destroy()))}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(e=>{const t=e.material.produces.get(4);return t?.(0)}))}hasHighlights(){return s(this._highlightRenderInstanceDatas,e=>e.some(e=>e.size>0))}_produces(e){return(10!==e||this.hasHighlights())&&(6!==e||this.hasHighlight(T))}prepareRender(e){if(!g.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(M),this._needFullCycle=!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e);if(!t)return null;const r=new Array,s=this.levels;return t.forEach(t=>s.forEach(({components:s},n)=>s.forEach(s=>r.push(this._beginComponent(e,t[n],s))))),r}render(e,t){const r=this._getInstanceDatas(e);if(!r||null==t)return;let s=0;const n=this.levels;r.forEach(r=>n.forEach(({components:n},a)=>n.forEach(n=>this._renderComponent(e,t[s++],r[a],n,a)))),e.rctx.unbindBuffer(34962),e.rctx.bindVAO(null)}_getInstanceDatas(e){const{output:t,bind:r}=e,s=10===t,n=6===t,a=7!==t;if(!s&&!n)return a?this._allRenderInstanceData:this._allRenderInstanceDataExceptHighlightShadow;const{_highlightRenderInstanceDatas:i}=this;if(a){if(s){const e=r.highlight?.name;if(!e)return null;const t=i.get(e);return t?[t]:null}const e=i.get(T);return n?e?[e]:null:Array.from(i.values())}return null}intersect(e,t,r,s){if(!this.baseMaterial.visible||null==this._octree)return;const n=f();d(n,s,r);const a=n=>{this._instanceData.getCombinedModelTransform(n,G),e.transform.set(G),m(W,r,e.transform.inverse),m(k,s,e.transform.inverse);const a=this._instanceData.getState(n),i=this._instanceData.getLodLevel(n),o=this._levels.length;4&a&&(D(!!(18&a),"invalid instance state"),D(i>=0&&i<o,"invaid lod level"),this._levels[i].intersect(e,t,W,k,n,this.metadata,o))};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(a):this._octree.forEachAlongRay(r,n,a)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){if(null==this._octreeCached){const e=this._instanceData,t=e.view?.state;if(!t)return null;this._octreeCached=new E(e,this.baseBoundingSphere);for(let r=0;r<e.capacity;++r)18&t.get(r)&&this._octreeCached.addInstance(r)}return this._octreeCached}_invalidateOctree(){this._octreeCached=a(this._octreeCached)}queryDepthRange(e){if(null==this._octree)return new C;const t=e.viewForward,r=this._octree.findClosest(t,1,e.frustum),s=this._octree.findClosest(t,-1,e.frustum);if(null==r||null==s)return new C;const n=e.eye,a=this._instanceData.view;a.boundingSphere.getVec(r,N),d(N,N,n);const i=u(N,t)-N[3];a.boundingSphere.getVec(s,N),d(N,N,n);const o=u(N,t)+N[3];return new C(i,o)}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,this._cycleStartIndex=this._instanceIndex,e&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.startUpdateCycle()))}get readyToRun(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:s,_levelSelector:a}=this;this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.beginUpdate()));const i=this._instanceData,o=i.view;let l=i.size;const c=i.capacity;let h=this._instanceIndex;const d=Math.ceil(c/500),{_highlightRenderInstanceDatas:u}=this;for(let m=0;m<l&&!e.done;++m){h===this._cycleStartIndex&&this._startUpdateCycle();const m=o.state.get(h);let f=0;if(!(1&m)){h=h+1===c?0:h+1,l++;continue}const _=o.lodLevel.get(h);if(2&m&&this._defaultRenderInstanceData[_].freeTail(),16&m){const e=i.geHighlightOptionsPrev(h);if(e){const t=u.get(e);if(!t)throw new r("internal:lod-renderer","Internal error in lodRenderer");t[_].freeTail(),t.every(e=>e.isEmpty)&&(t.forEach(e=>e.destroy()),u.delete(e))}}if(32&m)i.freeInstance(h);else if(4&m){let e=0;if(t&&(o.modelOrigin.getVec(h,z),e=a.selectLevel(z,i.getCombinedMedianScaleFactor(h),s)),f=-83&m,e>=0)if(8&m){const t=i.getHighlightName(h);if(t){const s=()=>{const e=this._createRenderInstanceDataArray();return e.forEach(e=>e.beginUpdate()),e},a=n(u,t,s);if(e>=a.length)throw new r("internal:lod-renderer",`LodRenderer internal error - missing lodLevel ${e}`);H(a[e],o,h)}f|=16}else H(this._defaultRenderInstanceData[e],o,h),f|=2;o.state.set(h,f),o.lodLevel.set(h,e)}else f=-83&m,o.state.set(h,f);const p=!!(18&m),g=!!(18&f);null!=this._octreeCached&&(!p&&g?this._octreeCached.addInstance(h):p&&!g?this._octreeCached.removeInstance(h):p&&g&&64&m&&(this._octreeCached.removeInstance(h),this._octreeCached.addInstance(h))),h=h+1===c?0:h+1,h%d===0&&e.madeProgress(),p!==g&&this.metadata.notifyGraphicVisibilityChanged(h),g&&64&m&&this.metadata.notifyGraphicGeometryChanged(h)}this._instanceIndex=h,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.endUpdate())),this._context.requestRender()}_beginComponent(e,t,r){if(0===t.size)return null;const s=r.glMaterials.load(e.rctx,e.bind.slot,e.output);return s?.beginSlot(e.bind)}_renderComponent(e,t,r,s,n){if(!t)return;const{bind:a,rctx:i}=e,o=i.bindTechnique(t,a,s.material.parameters,Z),l=this._glInstanceBufferLayout;o.assertCompatibleVertexAttributeLocations(s.vao,B(l)),i.bindVAO(s.vao),g.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&b(e.output)&&(o.setUniform4fv("externalColor",Y[Math.min(n,Y.length-1)]),o.setUniform1i("symbolColorMixMode",j.replace));const c=r.capacity,h=r.headIndex,d=r.tailIndex,u=r.firstIndex,m=(e,n)=>{q(i,o.locations,r.buffer,e),i.drawArraysInstanced(t.primitiveType,0,s.numVertices,n-e)};s.material.transparent&&null!=u?h>d?(D(u>=d&&u<=h,"invalid firstIndex"),m(u,h),m(d,u)):h<d&&(u<=h?(D(u>=0&&u<=h,"invalid firstIndex"),m(u,h),m(d,c),m(0,u)):(D(u>=d&&u<=c,"invalid firstIndex"),m(u,c),m(0,h),m(d,u))):h>d?m(d,h):h<d&&(m(0,h),m(d,c))}};function H(e,t,r){const s=e.allocateHead();P(t,r,e.view,s)}function P(e,t,r,s){U(e.modelOrigin,t,r.modelOriginHi,r.modelOriginLo,s),r.model.copyFrom(s,e.model,t),r.modelNormal.copyFrom(s,e.modelNormal,t),e.color&&r.color&&r.color.copyFrom(s,e.color,t),e.olidColor&&r.olidColor&&r.olidColor.copyFrom(s,e.olidColor,t),e.featureAttribute&&r.featureAttribute&&r.featureAttribute.copyFrom(s,e.featureAttribute,t)}e([l({constructOnly:!0})],V.prototype,"symbol",void 0),e([l({constructOnly:!0})],V.prototype,"metadata",void 0),e([l({constructOnly:!0})],V.prototype,"shaderTransformation",void 0),e([l()],V.prototype,"_instanceData",void 0),e([l()],V.prototype,"_cycleStartIndex",void 0),e([l({readOnly:!0})],V.prototype,"_enableLevelSelection",null),e([l()],V.prototype,"_updateCyclesWithStaticCamera",void 0),e([l({readOnly:!0})],V.prototype,"readyToRun",null),V=e([c("esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer")],V);const z=f(),N=_(),G=h(),W=f(),k=f(),Y=[p(1,0,1,1),p(0,0,1,1),p(0,1,0,1),p(1,1,0,1),p(1,0,0,1)],Z=new O;export{V as LodRenderer};
2
+ import{__decorate as e}from"tslib";import{isSome as t}from"../../../../../core/arrayUtils.js";import r from"../../../../../core/Error.js";import{someMap as s,getOrCreateMapValue as n}from"../../../../../core/MapUtils.js";import{destroyMaybe as a}from"../../../../../core/maybe.js";import{isAborted as i,throwIfAborted as o}from"../../../../../core/promiseUtils.js";import{property as l,subclass as c}from"../../../../../core/accessorSupport/decorators.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as d,dot as u,transformMat4 as m}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as _,freeze as p}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{debugFlags as g}from"../../../support/debugFlags.js";import{glLayout as y}from"../../../support/buffer/glUtil.js";import v from"../../../webgl/RenderCamera.js";import{isColor as b}from"../../core/shaderLibrary/ShaderOutput.js";import{AsyncRenderPlugin as I}from"../../effects/RenderPlugin.js";import{DepthRange as C}from"../DepthRange.js";import{assert as D}from"../Util.js";import{InstanceData as R}from"./InstanceData.js";import{InstanceOctree as E}from"./InstanceOctree.js";import{LevelSelector as x}from"./LevelSelector.js";import{LodLevel as S}from"./LodLevel.js";import{getRenderInstanceDataLayout as w,RenderInstanceData as L}from"./RenderInstanceData.js";import{colorMixModes as j}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as U}from"../../materials/renderers/utils.js";import{DefaultMaterialDrawParameters as O}from"../../shaders/DefaultMaterialTechnique.js";import{defaultHighlightName as T}from"../../../../support/HighlightDefaults.js";import{TaskPriority as A,noBudget as M}from"../../../../support/Scheduler.js";import{bindVertexBufferLayout as q}from"../../../../webgl/Util.js";import{fromLayout as B}from"../../../../webgl/VertexAttributeLocations.js";const F=e=>{const t=e.baseBoundingSphere.radius,r=e.levels.map(e=>e.minScreenSpaceRadius);return new x(t,r)};let V=class extends I{constructor(e,t){super(e),this.type=3,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=new Array,this._highlightRenderInstanceDatas=new Map,this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new v,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[2,e=>this._produces(e)],[4,e=>!!this._hasTransparentLevels()&&this._produces(e)]]),this._instanceData=new R({shaderTransformation:e.shaderTransformation},e.symbol.materialParameters),this.addHandles(t.registerTask(A.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=w(this.symbol.materialParameters),this._glInstanceBufferLayout=y(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _allRenderInstanceData(){return[this._defaultRenderInstanceData,...this._highlightRenderInstanceDatas.values()]}get _allRenderInstanceDataExceptHighlightShadow(){const e=[this._defaultRenderInstanceData];for(const t of this._highlightRenderInstanceDatas)t[0]!==T&&e.push(t[1]);return e}hasHighlight(e){return this._highlightRenderInstanceDatas.has(e)}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerViewUid(){return this.metadata.layerViewUid}get instanceData(){return this._instanceData}get hasEmitters(){return this._levels.some(e=>e.components.some(e=>e.material.hasEmissions))}get usedMemory(){return this._allRenderInstanceData.reduce((e,t)=>t.reduce((e,t)=>e+t.usedMemory,e),this._levels.reduce((e,t)=>e+t.components.reduce((e,t)=>e+t.usedMemory,0),0))}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach((e,r)=>{const s=this._allRenderInstanceData[0][r].size+this._allRenderInstanceData[1][r].size,n=e.triangleCount;t.push({renderedInstances:s,renderedTriangles:s*n,trianglesPerInstance:n})}),{totalInstances:e,renderedInstances:t.reduce((e,t)=>e+t.renderedInstances,0),renderedTriangles:t.reduce((e,t)=>e+t.renderedTriangles,0),levels:t}}_createRenderInstanceDataArray(){const{rctx:e}=this._context.renderContext;return this.symbol.levels.map(t=>new L(e,this._instanceBufferLayout))}async initializeRenderContext(e,r){this._context=e,this._defaultRenderInstanceData=this._createRenderInstanceDataArray();const s=await Promise.allSettled(this.symbol.levels.map(t=>S.create(e,t,r))),n=s.map(e=>"fulfilled"===e.status?e.value:null).filter(t);if(i(r)||n.length!==s.length){n.forEach(e=>e.destroy()),o(r);for(const e of s)if("rejected"===e.status)throw e.reason}this._levels=n,this._levelSelector=F(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData.forEach(e=>e.destroy()),this._highlightRenderInstanceDatas.forEach(e=>e.forEach(e=>e.destroy()))}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(e=>{const t=e.material.produces.get(4);return t?.(0)}))}hasHighlights(){return s(this._highlightRenderInstanceDatas,e=>e.some(e=>e.size>0))}_produces(e){return(10!==e||this.hasHighlights())&&(6!==e||this.hasHighlight(T))}prepareRender(e){if(!g.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const t=e.bind.contentCamera.equals(this._camera);this._camera.copyFrom(e.bind.contentCamera),t||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(M),this._needFullCycle=!1)}}acquireTechniques(e){if(!this.baseMaterial.visible||!this.baseMaterial.isVisibleForOutput(e.output))return null;const t=this._getInstanceDatas(e);if(!t)return null;const r=new Array,s=this.levels;return t.forEach(t=>s.forEach(({components:s},n)=>s.forEach(s=>r.push(this._beginComponent(e,t[n],s))))),r}render(e,t){const r=this._getInstanceDatas(e);if(!r||null==t)return;let s=0;const n=this.levels;r.forEach(r=>n.forEach(({components:n},a)=>n.forEach(n=>this._renderComponent(e,t[s++],r[a],n,a)))),e.rctx.unbindBuffer(34962),e.rctx.bindVAO(null)}_getInstanceDatas(e){const{output:t,bind:r}=e,s=10===t,n=6===t,a=7!==t;if(!s&&!n)return a?this._allRenderInstanceData:this._allRenderInstanceDataExceptHighlightShadow;const{_highlightRenderInstanceDatas:i}=this;if(a){if(s){const e=r.highlight?.name;if(!e)return null;const t=i.get(e);return t?[t]:null}const e=i.get(T);return n?e?[e]:null:Array.from(i.values())}return null}intersect(e,t,r,s){if(!this.baseMaterial.visible||null==this._octree)return;const n=f();d(n,s,r);const a=n=>{this._instanceData.getCombinedModelTransform(n,G),e.transform.set(G),m(W,r,e.transform.inverse),m(k,s,e.transform.inverse);const a=this._instanceData.getState(n),i=this._instanceData.getLodLevel(n),o=this._levels.length;4&a&&(D(!!(18&a),"invalid instance state"),D(i>=0&&i<o,"invaid lod level"),this._levels[i].intersect(e,t,W,k,n,this.metadata,o))};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(a):this._octree.forEachAlongRay(r,n,a)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){if(null==this._octreeCached){const e=this._instanceData,t=e.view?.state;if(!t)return null;this._octreeCached=new E(e,this.baseBoundingSphere);for(let r=0;r<e.capacity;++r)18&t.get(r)&&this._octreeCached.addInstance(r)}return this._octreeCached}_invalidateOctree(){this._octreeCached=a(this._octreeCached)}queryDepthRange(e){if(null==this._octree)return new C;const t=e.viewForward,r=this._octree.findClosest(t,1,e.frustum),s=this._octree.findClosest(t,-1,e.frustum);if(null==r||null==s)return new C;const n=e.eye,a=this._instanceData.view;a.boundingSphere.getVec(r,N),d(N,N,n);const i=u(N,t)-N[3];a.boundingSphere.getVec(s,N),d(N,N,n);const o=u(N,t)+N[3];return new C(i,o)}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,this._cycleStartIndex=this._instanceIndex,e&&(this._needFullCycle=!0,this._context.requestRender())}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.startUpdateCycle()))}get readyToRun(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:t,_camera:s,_levelSelector:a}=this;this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.beginUpdate()));const i=this._instanceData,o=i.view;let l=i.size;const c=i.capacity;let h=this._instanceIndex;const d=Math.ceil(c/500),{_highlightRenderInstanceDatas:u}=this;for(let m=0;m<l&&!e.done;++m){h===this._cycleStartIndex&&this._startUpdateCycle();const m=o.state.get(h);let f=0;if(!(1&m)){h=h+1===c?0:h+1,l++;continue}const _=o.lodLevel.get(h);if(2&m&&this._defaultRenderInstanceData[_].freeTail(),16&m){const e=i.geHighlightOptionsPrev(h);if(e){const t=u.get(e);if(!t)throw new r("internal:lod-renderer","Internal error in lodRenderer");t[_].freeTail(),t.every(e=>e.isEmpty)&&(t.forEach(e=>e.destroy()),u.delete(e))}}if(32&m)i.freeInstance(h);else if(4&m){let e=0;if(t&&(o.modelOrigin.getVec(h,z),e=a.selectLevel(z,i.getCombinedMedianScaleFactor(h),s)),f=-83&m,e>=0)if(8&m){const t=i.getHighlightName(h);if(t){const s=()=>{const e=this._createRenderInstanceDataArray();return e.forEach(e=>e.beginUpdate()),e},a=n(u,t,s);if(e>=a.length)throw new r("internal:lod-renderer",`LodRenderer internal error - missing lodLevel ${e}`);H(a[e],o,h)}f|=16}else H(this._defaultRenderInstanceData[e],o,h),f|=2;o.state.set(h,f),o.lodLevel.set(h,e)}else f=-83&m,o.state.set(h,f);const p=!!(18&m),g=!!(18&f);null!=this._octreeCached&&(!p&&g?this._octreeCached.addInstance(h):p&&!g?this._octreeCached.removeInstance(h):p&&g&&64&m&&(this._octreeCached.removeInstance(h),this._octreeCached.addInstance(h))),h=h+1===c?0:h+1,h%d===0&&e.madeProgress(),p!==g&&this.metadata.notifyGraphicVisibilityChanged(h),g&&64&m&&this.metadata.notifyGraphicGeometryChanged(h)}this._instanceIndex=h,this._allRenderInstanceData.forEach(e=>e.forEach(e=>e.endUpdate())),this._context.requestRender()}_beginComponent(e,t,r){if(0===t.size)return null;const s=r.glMaterialLoader.load(e.rctx,e.bind.slot,e.output);return s?.beginSlot(e.bind)}_renderComponent(e,t,r,s,n){if(!t)return;const{bind:a,rctx:i}=e,o=i.bindTechnique(t,a,s.material.parameters,Z),l=this._glInstanceBufferLayout;o.assertCompatibleVertexAttributeLocations(s.vao,B(l)),i.bindVAO(s.vao),g.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&b(e.output)&&(o.setUniform4fv("externalColor",Y[Math.min(n,Y.length-1)]),o.setUniform1i("symbolColorMixMode",j.replace));const c=r.capacity,h=r.headIndex,d=r.tailIndex,u=r.firstIndex,m=(e,n)=>{q(i,o.locations,r.buffer,e),i.drawArraysInstanced(t.primitiveType,0,s.numVertices,n-e)};s.material.transparent&&null!=u?h>d?(D(u>=d&&u<=h,"invalid firstIndex"),m(u,h),m(d,u)):h<d&&(u<=h?(D(u>=0&&u<=h,"invalid firstIndex"),m(u,h),m(d,c),m(0,u)):(D(u>=d&&u<=c,"invalid firstIndex"),m(u,c),m(0,h),m(d,u))):h>d?m(d,h):h<d&&(m(0,h),m(d,c))}};function H(e,t,r){const s=e.allocateHead();P(t,r,e.view,s)}function P(e,t,r,s){U(e.modelOrigin,t,r.modelOriginHi,r.modelOriginLo,s),r.model.copyFrom(s,e.model,t),r.modelNormal.copyFrom(s,e.modelNormal,t),e.color&&r.color&&r.color.copyFrom(s,e.color,t),e.olidColor&&r.olidColor&&r.olidColor.copyFrom(s,e.olidColor,t),e.featureAttribute&&r.featureAttribute&&r.featureAttribute.copyFrom(s,e.featureAttribute,t)}e([l({constructOnly:!0})],V.prototype,"symbol",void 0),e([l({constructOnly:!0})],V.prototype,"metadata",void 0),e([l({constructOnly:!0})],V.prototype,"shaderTransformation",void 0),e([l()],V.prototype,"_instanceData",void 0),e([l()],V.prototype,"_cycleStartIndex",void 0),e([l({readOnly:!0})],V.prototype,"_enableLevelSelection",null),e([l()],V.prototype,"_updateCyclesWithStaticCamera",void 0),e([l({readOnly:!0})],V.prototype,"readyToRun",null),V=e([c("esri.views.3d.webgl-engine.lib.lodRendering.LodRenderer")],V);const z=f(),N=_(),G=h(),W=f(),k=f(),Y=[p(1,0,1,1),p(0,0,1,1),p(0,1,0,1),p(1,1,0,1),p(1,0,0,1)],Z=new O;export{V as LodRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{DefaultBufferWriter as s}from"./DefaultBufferWriter.js";import{PositionUvLayout as o}from"./DefaultLayouts.js";import{TriangleMaterial as a,TriangleMaterialParameters as n}from"./TriangleMaterial.js";import{CheckerBoardTechnique as p}from"../shaders/CheckerBoardTechnique.js";import{CheckerBoardTechniqueConfiguration as h}from"../shaders/CheckerBoardTechniqueConfiguration.js";import{alphaCutoff as c}from"../../../../webscene/support/AlphaCutoff.js";class u extends a{constructor(r){super(r,m),this._configuration=new h,this.produces=new Map([[2,r=>t(r)&&!this.transparent],[4,r=>t(r)&&this.transparent&&this.parameters.writeDepth],[9,r=>t(r)&&this.transparent&&!this.parameters.writeDepth]])}updateConfiguration(r){super.updateConfiguration(r),this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain}get visible(){return this.parameters.color1[3]>=c||this.parameters.color2[3]>=c}get transparent(){return this.parameters.color1[3]<1||this.parameters.color2[3]<1}createGLMaterial(r){return new f(r)}createBufferWriter(){return new s(o)}}class f extends i{beginSlot(r){return this.getTechnique(p,r)}}class m extends n{constructor(){super(...arguments),this.size=r(1,1),this.color1=e(.75,.75,.75,1),this.color2=e(.5,.5,.5,1),this.writeDepth=!0}}export{u as CheckerBoardMaterial,m as Parameters};
2
+ import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as e}from"../core/shaderLibrary/ShaderOutput.js";import s from"../lib/GLMaterial.js";import{DefaultBufferWriter as i}from"./DefaultBufferWriter.js";import{PositionUvLayout as o}from"./DefaultLayouts.js";import{TriangleMaterial as a,TriangleMaterialParameters as n}from"./TriangleMaterial.js";import{CheckerBoardTechnique as p}from"../shaders/CheckerBoardTechnique.js";import{CheckerBoardTechniqueConfiguration as h}from"../shaders/CheckerBoardTechniqueConfiguration.js";import{alphaCutoff as c}from"../../../../webscene/support/AlphaCutoff.js";class u extends a{constructor(r){super(r,m),this._configuration=new h,this.produces=new Map([[2,r=>e(r)&&!this.transparent],[4,r=>e(r)&&this.transparent&&this.parameters.writeDepth],[9,r=>e(r)&&this.transparent&&!this.parameters.writeDepth]])}updateConfiguration(r){super.updateConfiguration(r),this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain}get visible(){return this.parameters.color1[3]>=c||this.parameters.color2[3]>=c}get transparent(){return this.parameters.color1[3]<1||this.parameters.color2[3]<1}createGLMaterial(r){return new f(r)}createBufferWriter(){return new i(o)}}class f extends s{beginSlot(r){return this.getTechnique(p,r)}}class m extends n{constructor(){super(...arguments),this.size=r(1,1),this.color1=t(.75,.75,.75,1),this.color2=t(.5,.5,.5,1),this.writeDepth=!0,this.polygonOffset=2}}export{u as CheckerBoardMaterial,m as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{exactEquals as e,set as t,copy as r,normalize as s,subtract as i,length as a,scale as o,dot as n,transformMat3 as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as u,create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOutputMRT as m,isShadowLike as p,isColor as d}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as T}from"../lib/GLTextureMaterial.js";import{Material as f}from"../lib/Material.js";import{intersectTriangleGeometry as x}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as g}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as v}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as S}from"./internal/MaterialUtil.js";import{getLayout as b,DefaultMaterialPassParameters as M,DefaultMaterialTechnique as O}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as C}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as w}from"../shaders/RealisticTreeTechnique.js";import{alphaCutoff as y}from"../../../../webscene/support/AlphaCutoff.js";class R extends f{constructor(e,t){super(e,P),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(m(e)||p(e))&&!this.transparent],[4,e=>(m(e)||p(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>(m(e)||p(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=b(this.parameters),this._configuration=new C(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:s}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(s[3])?1:s[3])>=y}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:s,doubleSided:i,doubleSidedType:a}=t;r.hasVertexTangents=!s&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=s?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.writeDepth=t.writeDepth,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.cullAboveTerrain=e.cullAboveTerrain,r.hasModelTransformation=!s&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=s?2:i&&"normal"===a?1:i&&"winding-order"===a?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,d(e.output)?(r.terrainDepthTest=e.terrainDepthTest,r.receiveShadows=t.receiveShadows,r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao):(r.terrainDepthTest=!1,r.receiveShadows=r.receiveAmbientOcclusion=!1),r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersect(e,u,c,h,m,p){if(null!=this.parameters.verticalOffset){const e=c.camera;t(N,u[12],u[13],u[14]);let p=null;switch(c.viewingMode){case 1:p=s(B,N);break;case 2:p=r(B,V)}const d=i(z,N,e.eye),T=a(d),f=o(d,d,1/T);let x=null;this.parameters.screenSizePerspective&&(x=n(p,f));const g=S(e,T,this.parameters.verticalOffset,x??0,this.parameters.screenSizePerspective,null);o(p,p,g),l(_,p,c.transform.inverseRotation),h=i(I,h,_),m=i(A,m,_)}x(e,c,h,m,g(c.verticalOffset),p)}createGLMaterial(e){return new D(e)}createBufferWriter(){return new v(this._layout)}get transparent(){return j(this.parameters)}}class D extends T{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const r=this._material.parameters;this.updateTexture(r.textureId);const s=e.camera.viewInverseTransposeMatrix;return t(r.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(r.treeRendering?w:O,e)}}class P extends M{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function j(e){const{drivenOpacity:t,opacity:r,externalColor:s,layerOpacity:i,texture:a,textureId:o,textureAlphaMode:n,colorMixMode:l}=e,u=s[3];return t||r<1&&"replace"!==l||u<1&&"ignore"!==l||i<1||(null!=a||null!=o)&&1!==n&&2!==n&&"replace"!==l}const I=c(),A=c(),V=h(0,0,1),B=c(),_=c(),N=c(),z=c();export{D as DefaultGLMaterial,R as DefaultMaterial,P as DefaultMaterialParameters,j as isTransparent};
2
+ import{exactEquals as e,set as t,copy as r,normalize as s,subtract as i,length as a,scale as o,dot as n,transformMat3 as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as u,create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOutputMRT as m,isShadowLike as p,isColor as d}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as f}from"../lib/GLTextureMaterial.js";import{Material as T}from"../lib/Material.js";import{intersectTriangleGeometry as x}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as g}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as v}from"./DefaultBufferWriter.js";import{intersectWithPolygonOffset as S}from"./PolygonOffset.js";import{verticalOffsetAtDistance as b}from"./internal/MaterialUtil.js";import{getLayout as M,DefaultMaterialPassParameters as O,DefaultMaterialTechnique as C}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as w}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as y}from"../shaders/RealisticTreeTechnique.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class D extends T{constructor(e,t){super(e,j),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(m(e)||p(e))&&!this.transparent],[4,e=>(m(e)||p(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>(m(e)||p(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=M(this.parameters),this._configuration=new w(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:s}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(s[3])?1:s[3])>=R}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:s,doubleSided:i,doubleSidedType:a}=t;r.hasVertexTangents=!s&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=s?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.writeDepth=t.writeDepth,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.cullAboveTerrain=e.cullAboveTerrain,r.hasModelTransformation=!s&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=s?2:i&&"normal"===a?1:i&&"winding-order"===a?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,d(e.output)?(r.terrainDepthTest=e.terrainDepthTest,r.receiveShadows=t.receiveShadows,r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao):(r.terrainDepthTest=!1,r.receiveShadows=r.receiveAmbientOcclusion=!1),r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersect(e,u,c,h,m,p){if(null!=this.parameters.verticalOffset){const e=c.camera;t(z,u[12],u[13],u[14]);let p=null;switch(c.viewingMode){case 1:p=s(B,z);break;case 2:p=r(B,_)}const d=i(F,z,e.eye),f=a(d),T=o(d,d,1/f);let x=null;this.parameters.screenSizePerspective&&(x=n(p,T));const g=b(e,f,this.parameters.verticalOffset,x??0,this.parameters.screenSizePerspective,null);o(p,p,g),l(N,p,c.transform.inverseRotation),h=i(A,h,N),m=i(V,m,N)}p=S(p,this._configuration,h,m),x(e,c,h,m,g(c.verticalOffset),p)}createGLMaterial(e){return new P(e)}createBufferWriter(){return new v(this._layout)}get transparent(){return I(this.parameters)}}class P extends f{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const r=this._material.parameters;this.updateTexture(r.textureId);const s=e.camera.viewInverseTransposeMatrix;return t(r.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(r.treeRendering?y:C,e)}}class j extends O{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function I(e){const{drivenOpacity:t,opacity:r,externalColor:s,layerOpacity:i,texture:a,textureId:o,textureAlphaMode:n,colorMixMode:l}=e,u=s[3];return t||r<1&&"replace"!==l||u<1&&"ignore"!==l||i<1||(null!=a||null!=o)&&1!==n&&2!==n&&"replace"!==l}const A=c(),V=c(),_=h(0,0,1),B=c(),N=c(),z=c(),F=c();export{P as DefaultGLMaterial,D as DefaultMaterial,j as DefaultMaterialParameters,I as isTransparent};
@@ -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{freeze as t,create as i,ZEROS as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{glLayout as s}from"../../support/buffer/glUtil.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import{isOITColor as a}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as n}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{ReloadableShader as m}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as c}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as p}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as u,depthTest as f,blending as h}from"../lib/OrderIndependentTransparency.js";import{stencilBaseAllZerosParams as d,stencilWriteMaskOn as b}from"../lib/StencilUtils.js";import{P as g}from"../../../../chunks/Path.glsl.js";import{advancedMRRFactors as j}from"./pbrUtils.js";import{makePipelineState as S,defaultColorWrite as v,defaultDepthWrite as y,frontFaceCullingParams as P}from"../../../webgl/renderState.js";class T extends n{constructor(){super(...arguments),this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.opacity=1,this.origin=i(),this.modelTransformation=null,this.mrrFactors=j,this.emissiveStrengthFromSymbol=0,this.emissiveSource=1,this.emissiveBaseColor=o}get emissiveStrength(){return this.emissiveStrengthFromSymbol}}let V=class extends c{constructor(e,r){super(e,r,s(x(r))),this.shader=new m(g,()=>import("./Path.glsl.js"))}initializePipeline(e){const{output:r,transparent:t,hasSlicePlane:i,doubleSidedMode:o,hasOccludees:s}=e,l=!a(r);return S({blending:t?h(r):null,culling:i&&!t&&0!==o?P:null,depthTest:f(r),depthWrite:l?y:null,colorWrite:v,stencilWrite:s?b:null,stencilTest:s?d:null,polygonOffset:u(e)})}};function x(e){const r=l().vec3f("position").vec4f16("profileVertexAndNormal").vec2i16("profileRight",{glNormalized:!0}).vec2i16("profileUp",{glNormalized:!0});return e.hasVVSize&&r.f32("sizeFeatureAttribute"),e.hasVVColor&&r.f32("colorFeatureAttribute"),e.hasVVOpacity&&r.f32("opacityFeatureAttribute"),p()&&r.vec4u8("olidColor"),r.vec3f16("profileAuxData"),r.freeze()}V=e([r("esri.views.3d.webgl-engine.materials.PathTechnique")],V);export{T as PathPassParameters,V as PathTechnique,x as getLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{freeze as t,create as i,ZEROS as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{glLayout as s}from"../../support/buffer/glUtil.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import{isOITColor as a}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as n}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{ReloadableShader as m}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as c}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as p}from"../effects/geometry/olidUtils.js";import{depthTest as f,blending as u}from"../lib/OrderIndependentTransparency.js";import{stencilBaseAllZerosParams as h,stencilWriteMaskOn as d}from"../lib/StencilUtils.js";import{P as b}from"../../../../chunks/Path.glsl.js";import{advancedMRRFactors as g}from"./pbrUtils.js";import{polygonOffset as j}from"./PolygonOffset.js";import{makePipelineState as S,defaultColorWrite as v,defaultDepthWrite as y,frontFaceCullingParams as P}from"../../../webgl/renderState.js";class T extends n{constructor(){super(...arguments),this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.opacity=1,this.origin=i(),this.modelTransformation=null,this.mrrFactors=g,this.emissiveStrengthFromSymbol=0,this.emissiveSource=1,this.emissiveBaseColor=o}get emissiveStrength(){return this.emissiveStrengthFromSymbol}}let V=class extends c{constructor(e,r){super(e,r,s(x(r))),this.shader=new m(b,()=>import("./Path.glsl.js"))}initializePipeline(e){const{output:r,transparent:t,hasSlicePlane:i,doubleSidedMode:o,hasOccludees:s}=e,l=!a(r);return S({blending:t?u(r):null,culling:i&&!t&&0!==o?P:null,depthTest:f(r),depthWrite:l?y:null,colorWrite:v,stencilWrite:s?d:null,stencilTest:s?h:null,polygonOffset:j(e)})}};function x(e){const r=l().vec3f("position").vec4f16("profileVertexAndNormal").vec2i16("profileRight",{glNormalized:!0}).vec2i16("profileUp",{glNormalized:!0});return e.hasVVSize&&r.f32("sizeFeatureAttribute"),e.hasVVColor&&r.f32("colorFeatureAttribute"),e.hasVVOpacity&&r.f32("opacityFeatureAttribute"),p()&&r.vec4u8("olidColor"),r.vec3f16("profileAuxData"),r.freeze()}V=e([r("esri.views.3d.webgl-engine.materials.PathTechnique")],V);export{T as PathPassParameters,V as PathTechnique,x as getLayout};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const t={factor:-1,units:-1},n={factor:1,units:1},r={factor:1,units:2},o={factor:0,units:-4},a={factor:-1,units:-2},c=new Array;c[0]=null,c[1]=n,c[2]=t,c[3]=o;export{a as OITPolygonOffset,c as PolygonOffsetSettings,n as behindPolygonOffset,o as hudPolygonOffset,r as i3sHolePolygonOffset,t as inFrontPolygonOffset};
2
+ import{normalize as t,sub as r,dot as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOITColor as s}from"../core/shaderLibrary/ShaderOutput.js";const c={factor:1,units:1},f={factor:1,units:2},i={factor:0,units:-4},u={factor:-5,units:-5},a={factor:-1,units:-2},e=new Array;e[0]=null,e[1]=c,e[2]=u,e[3]=i,e[4]=f;const m=e.map(t=>p(a,t));function l({output:t,enableOITOffset:r,polygonOffset:o}){return s(t)&&r?m[o]:e[o]}function p(t,r){return r?{factor:t.factor+r.factor,units:t.units+r.units}:t}function b(n,s,c,f){const i=l(s);if(!i)return n;const u=g*i.units,a=t(h,r(h,f,c));return(t,r,s)=>{const c=(r?1-Math.abs(o(a,r)):0)*i.factor*O+u;return n(t+c,r,s)}}e[1]=c;const h=n(),O=5e-5,g=5e-6;export{i as hudPolygonOffset,b as intersectWithPolygonOffset,l as polygonOffset};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{normalize as e,set as t,scale as r,add as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as o,scale as p}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{isColorOrOLID as h,isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import u from"../lib/GLMaterial.js";import{Material as m,MaterialParameters as f}from"../lib/Material.js";import{intersectTriangleGeometry as d}from"../lib/RayIntersections.js";import{assert as g}from"../lib/Util.js";import{writeAttributes as b,writePosition as S}from"./internal/bufferWriterUtils.js";import{getLayout as _,ShadedColorMaterialTechnique as j}from"../shaders/ShadedColorMaterialTechnique.js";import{ShadedColorMaterialTechniqueConfiguration as w}from"../shaders/ShadedColorMaterialTechniqueConfiguration.js";import{alphaCutoff as T}from"../../../../webscene/support/AlphaCutoff.js";class x extends m{constructor(e){super(e,D),this._configuration=new w,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,e=>10===e||h(e)&&!this.parameters.transparent],[4,e=>h(e)&&this.parameters.transparent&&this.parameters.writeDepth],[9,e=>h(e)&&this.parameters.transparent&&!this.parameters.writeDepth]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.terrainDepthTest=e.terrainDepthTest&&l(e.output),this._configuration.cullAboveTerrain=e.cullAboveTerrain}get visible(){return this.parameters.color[3]>=T}intersect(e,t,r,s,i,a){this._intersect(e,r,s,i,a)}intersectDraped(e,t,r,s){return this._pp0[0]=this._pp1[0]=r[0],this._pp0[1]=this._pp1[1]=r[1],this._intersect(e,t,this._pp0,this._pp1,s)}_intersect(e,i,a,n,c){if(this.parameters.screenSizeEnabled){const h=e.attributes.get("offset"),l={applyToVertex:(e,a,n,o)=>{const p=t(E,h.data[3*o],h.data[3*o+1],h.data[3*o+2]),c=t(M,e,a,n);return r(p,p,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(p)??1)),s(c,c,p),[c[0],c[1],c[2]]},applyToAabb:e=>{const t=o(e,E);return p(e,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(t)??1))}};d(e,i,a,n,l,c)}else d(e,i,a,n,void 0,c)}createGLMaterial(e){return new z(e)}createBufferWriter(){return new y(_(this.parameters))}}class z extends u{beginSlot(e){return this.getTechnique(j,e)}}class D extends f{constructor(){super(...arguments),this.color=n(1,1,1,1),this.shadingTint=n(0,0,0,.25),this.shadingDirection=e(a(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=0,this.screenSizeEnabled=!1,this.shadingEnabled=!0}get transparent(){return this.color[3]<1||this.forceTransparentMode}}class y{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,s,i,a){const n=b(r,s,this.layout,e,t,i,a),o=i.getField("offset",c);if(o&&r.has("offset")){const e=r.get("offset");g(3===e.size),S(e,t,o,a)}return n}}const E=a(),M=a();export{D as Parameters,x as ShadedColorMaterial};
2
+ import{normalize as e,set as t,scale as r,add as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as n,scale as p}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{isColorOrOLID as h,isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import u from"../lib/GLMaterial.js";import{Material as m,MaterialParameters as f}from"../lib/Material.js";import{intersectTriangleGeometry as d}from"../lib/RayIntersections.js";import{assert as g}from"../lib/Util.js";import{intersectWithPolygonOffset as b}from"./PolygonOffset.js";import{writeAttributes as S,writePosition as _}from"./internal/bufferWriterUtils.js";import{getLayout as j,ShadedColorMaterialTechnique as w}from"../shaders/ShadedColorMaterialTechnique.js";import{ShadedColorMaterialTechniqueConfiguration as T}from"../shaders/ShadedColorMaterialTechniqueConfiguration.js";import{alphaCutoff as x}from"../../../../webscene/support/AlphaCutoff.js";class z extends m{constructor(e){super(e,D),this._configuration=new T,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,e=>10===e||h(e)&&!this.parameters.transparent],[4,e=>h(e)&&this.parameters.transparent&&this.parameters.writeDepth],[9,e=>h(e)&&this.parameters.transparent&&!this.parameters.writeDepth]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.terrainDepthTest=e.terrainDepthTest&&l(e.output),this._configuration.cullAboveTerrain=e.cullAboveTerrain}get visible(){return this.parameters.color[3]>=x}intersect(e,t,r,s,i,a){this._intersect(e,r,s,i,a)}intersectDraped(e,t,r,s){return this._pp0[0]=this._pp1[0]=r[0],this._pp0[1]=this._pp1[1]=r[1],this._intersect(e,t,this._pp0,this._pp1,s)}_intersect(e,i,a,o,c){const h=b(c,this._configuration,a,o);if(this.parameters.screenSizeEnabled){const c=e.attributes.get("offset"),l={applyToVertex:(e,a,o,n)=>{const p=t(M,c.data[3*n],c.data[3*n+1],c.data[3*n+2]),h=t(v,e,a,o);return r(p,p,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(p)??1)),s(h,h,p),[h[0],h[1],h[2]]},applyToAabb:e=>{const t=n(e,M);return p(e,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(t)??1))}};d(e,i,a,o,l,h)}else d(e,i,a,o,void 0,h)}createGLMaterial(e){return new y(e)}createBufferWriter(){return new E(j(this.parameters))}}class y extends u{beginSlot(e){return this.getTechnique(w,e)}}class D extends f{constructor(){super(...arguments),this.color=o(1,1,1,1),this.shadingTint=o(0,0,0,.25),this.shadingDirection=e(a(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=0,this.screenSizeEnabled=!1,this.shadingEnabled=!0}get transparent(){return this.color[3]<1||this.forceTransparentMode}}class E{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,s,i,a){const o=S(r,s,this.layout,e,t,i,a),n=i.getField("offset",c);if(n&&r.has("offset")){const e=r.get("offset");g(3===e.size),_(e,t,n,a)}return o}}const M=a(),v=a();export{D as Parameters,z as ShadedColorMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{Material as t,MaterialParameters as e}from"../lib/Material.js";import{intersectTriangleGeometry as r,intersectTriangleGeometry2D as s}from"../lib/RayIntersections.js";class n extends t{updateConfiguration(t){super.updateConfiguration(t),this._configuration.transparent=this.transparent,this._configuration.enableOITOffset=t.enableOITOffset,this._configuration.polygonOffset=this.parameters.polygonOffset}intersect(t,e,s,n,i,o){return r(t,s,n,i,void 0,o)}intersectDraped(t,e,r,n){return s(r[0],r[1],t,n)}}class i extends e{constructor(){super(...arguments),this.polygonOffset=0}}export{n as TriangleMaterial,i as TriangleMaterialParameters};
2
+ import{Material as t,MaterialParameters as e}from"../lib/Material.js";import{intersectTriangleGeometry as n,intersectTriangleGeometry2D as r}from"../lib/RayIntersections.js";import{intersectWithPolygonOffset as s}from"./PolygonOffset.js";class o extends t{updateConfiguration(t){super.updateConfiguration(t),this._configuration.transparent=this.transparent,this._configuration.enableOITOffset=t.enableOITOffset,this._configuration.polygonOffset=this.parameters.polygonOffset}intersect(t,e,r,o,i,a){return a=s(a,this._configuration,o,i),n(t,r,o,i,null,a)}intersectDraped(t,e,n,s){return r(n[0],n[1],t,s)}}class i extends e{constructor(){super(...arguments),this.polygonOffset=0}}export{o as TriangleMaterial,i as TriangleMaterialParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as e}from"./DefaultTechniqueConfiguration.js";class r extends e{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}t([o({count:4})],r.prototype,"polygonOffset",void 0),t([o()],r.prototype,"transparent",void 0),t([o()],r.prototype,"enableOITOffset",void 0);export{r as TriangleTechniqueConfiguration};
2
+ import{__decorate as t}from"tslib";import{parameter as o}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as e}from"./DefaultTechniqueConfiguration.js";class r extends e{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}t([o({count:5})],r.prototype,"polygonOffset",void 0),t([o()],r.prototype,"transparent",void 0),t([o()],r.prototype,"enableOITOffset",void 0);export{r as TriangleTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as a,isHighlightOrOLID as s}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as o}from"../effects/geometry/olidUtils.js";import{DefaultBufferWriter as n}from"./DefaultBufferWriter.js";import{PositionUvf32OlidLayout as h,PositionUvf32Layout as l}from"./DefaultLayouts.js";import{TriangleMaterialParameters as c,TriangleMaterial as p}from"./TriangleMaterial.js";import{WaterGLMaterial as m}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as u}from"./WaterTechniqueConfiguration.js";class f extends p{constructor(t,e){super(t,d),this.visible=!0,this.produces=new Map([[2,t=>a(t)&&!this.transparent||s(t)],[4,t=>a(t)&&this.transparent||s(t)],[19,t=>this.parameters.draped&&a(t)||4===t||s(t)],[20,t=>4===t]]),this._configuration=new u(e.spherical)}updateConfiguration(t){super.updateConfiguration(t),this._configuration.writeDepth=!0,this._configuration.receiveShadows=a(t.output)&&t.shadowMap.enabled,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.screenSpaceReflections=null!=t.ssr.lastFrameColor,this._configuration.cloudReflections=null!=t.clouds.data,this._configuration.draped=this.parameters.draped,this._configuration.terrainDepthTest=t.terrainDepthTest&&a(t.output),this._configuration.cullAboveTerrain=t.cullAboveTerrain}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<g}get transparent(){return this.parameters.transparent}createGLMaterial(t){return new m(t)}createBufferWriter(){return new n(o()?h:l)}get test(){}}class d extends c{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const g=35e3;export{d as Parameters,f as WaterMaterial};
2
+ import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as a,isHighlightOrOLID as s}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as o}from"../effects/geometry/olidUtils.js";import{DefaultBufferWriter as n}from"./DefaultBufferWriter.js";import{PositionUvf32OlidLayout as c,PositionUvf32Layout as l}from"./DefaultLayouts.js";import{TriangleMaterialParameters as h,TriangleMaterial as p}from"./TriangleMaterial.js";import{WaterGLMaterial as m}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as u}from"./WaterTechniqueConfiguration.js";class f extends p{constructor(t,e){super(t,d),this.visible=!0,this.produces=new Map([[2,t=>a(t)&&!this.transparent||s(t)],[4,t=>a(t)&&this.transparent||s(t)],[19,t=>this.parameters.draped&&a(t)||4===t||s(t)],[20,t=>4===t]]),this._configuration=new u(e.spherical)}updateConfiguration(t){super.updateConfiguration(t),this._configuration.writeDepth=!0,this._configuration.receiveShadows=a(t.output)&&t.shadowMap.enabled,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.screenSpaceReflections=t.screenSpaceReflections.enabled&&null!=t.reprojection.lastFrameColor,this._configuration.cloudReflections=null!=t.clouds.data,this._configuration.draped=this.parameters.draped,this._configuration.terrainDepthTest=t.terrainDepthTest&&a(t.output),this._configuration.cullAboveTerrain=t.cullAboveTerrain}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<g}get transparent(){return this.parameters.transparent}createGLMaterial(t){return new m(t)}createBufferWriter(){return new n(o()?c:l)}get test(){}}class d extends h{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const g=35e3;export{d as Parameters,f as WaterMaterial};
@@ -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{WaterDistortionPassParameters as t}from"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as i}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as a,depthWrite as n,depthTest as l,blending as p}from"../lib/OrderIndependentTransparency.js";import{PositionUvf32OlidGLLayout as m,PositionUvf32GLLayout as d}from"./DefaultLayouts.js";import{W as c}from"../../../../chunks/Water.glsl.js";import{makePipelineState as f,defaultColorWrite as h}from"../../../webgl/renderState.js";class u extends t{}let g=class extends o{constructor(e,r){super(e,r,i()?m:d),this.shader=new s(c,()=>import("./Water.glsl.js"))}initializePipeline(e){const{output:r,transparent:t,draped:s}=e;return f({blending:t?p(r):null,depthTest:s?null:l(r),depthWrite:n(e),colorWrite:h,polygonOffset:a(e)})}};g=e([r("esri.views.3d.webgl-engine.materials.WaterTechnique")],g);export{u as WaterMaterialPassParameters,g as WaterTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{WaterDistortionPassParameters as t}from"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import{ReloadableShader as o}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as i}from"../effects/geometry/olidUtils.js";import{depthWrite as n,depthTest as a,blending as l}from"../lib/OrderIndependentTransparency.js";import{PositionUvf32OlidGLLayout as m,PositionUvf32GLLayout as p}from"./DefaultLayouts.js";import{polygonOffset as d}from"./PolygonOffset.js";import{W as c}from"../../../../chunks/Water.glsl.js";import{makePipelineState as f,defaultColorWrite as h}from"../../../webgl/renderState.js";class u extends t{}let g=class extends s{constructor(e,r){super(e,r,i()?m:p),this.shader=new o(c,()=>import("./Water.glsl.js"))}initializePipeline(e){const{output:r,transparent:t,draped:o}=e;return f({blending:t?l(r):null,depthTest:o?null:a(r),depthWrite:n(e),colorWrite:h,polygonOffset:d(e)})}};g=e([r("esri.views.3d.webgl-engine.materials.WaterTechnique")],g);export{u as WaterMaterialPassParameters,g as WaterTechnique};