@arcgis/core 5.1.0-next.71 → 5.1.0-next.72

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 (365) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/003fd7745966fe03510c.js +1 -0
  4. package/assets/esri/core/workers/chunks/00bae4b7e179336e0362.js +1 -0
  5. package/assets/esri/core/workers/chunks/{36031cb53c486630f3c9.js → 026d3fa331caec1ea3d2.js} +1 -1
  6. package/assets/esri/core/workers/chunks/027c3ea756db68e51f0a.js +1 -0
  7. package/assets/esri/core/workers/chunks/{c06d021180418f2014de.js → 02876e434dc91c42b2f4.js} +1 -1
  8. package/assets/esri/core/workers/chunks/041c372e98a6fba90b36.js +1 -0
  9. package/assets/esri/core/workers/chunks/{a5a46d0a0831497cf1b4.js → 0783890816bac45277b9.js} +1 -1
  10. package/assets/esri/core/workers/chunks/07aac6245a0d1adbb2d4.js +1 -0
  11. package/assets/esri/core/workers/chunks/0839da55707f7c4cf780.js +1 -0
  12. package/assets/esri/core/workers/chunks/0c00e5e4bd18467bcecd.js +1 -0
  13. package/assets/esri/core/workers/chunks/{d69110ec4078c583a05e.js → 0d96e39380fd84cea9ba.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0dad0bca8d58b2c63d22.js +1 -0
  15. package/assets/esri/core/workers/chunks/0ef93722524620023f69.js +1 -0
  16. package/assets/esri/core/workers/chunks/127cd8fee3717a473fc5.js +1 -0
  17. package/assets/esri/core/workers/chunks/1286f41f245ef22b3a26.js +1 -0
  18. package/assets/esri/core/workers/chunks/161d60fdac2013c15543.js +1 -0
  19. package/assets/esri/core/workers/chunks/1661684357912726a72a.js +1 -0
  20. package/assets/esri/core/workers/chunks/168de44a789d1cecc1f8.js +1 -0
  21. package/assets/esri/core/workers/chunks/1961b59756933e0a82f2.js +1 -0
  22. package/assets/esri/core/workers/chunks/1d9d7915cf7449e5d468.js +1 -0
  23. package/assets/esri/core/workers/chunks/1f85646936200a399c15.js +1 -0
  24. package/assets/esri/core/workers/chunks/{deb8a0b306d7b9c86b97.js → 2171aaa147aa4d9fc5b5.js} +1 -1
  25. package/assets/esri/core/workers/chunks/235cb82952a18ff8d206.js +1 -0
  26. package/assets/esri/core/workers/chunks/260d4571722cb1ff1366.js +1 -0
  27. package/assets/esri/core/workers/chunks/{3e972ae291df1844017d.js → 266ba61b72a278d93a26.js} +1 -1
  28. package/assets/esri/core/workers/chunks/27b80c386cebadcaca3c.js +1 -0
  29. package/assets/esri/core/workers/chunks/29d3890a5a43d934067a.js +1 -0
  30. package/assets/esri/core/workers/chunks/{333a0038d782d8a34d58.js → 2abf124e2956e4f76688.js} +1 -1
  31. package/assets/esri/core/workers/chunks/2f17438d215bea3ce70f.js +1 -0
  32. package/assets/esri/core/workers/chunks/{f6d5dd2eef0d9918096e.js → 30e710ec4d22c43d4e7e.js} +1 -1
  33. package/assets/esri/core/workers/chunks/356cb86606b8c674f947.js +1 -0
  34. package/assets/esri/core/workers/chunks/398e0dd2bc7e1ab84831.js +1 -0
  35. package/assets/esri/core/workers/chunks/3b1052aa30af3f6186cc.js +1 -0
  36. package/assets/esri/core/workers/chunks/3bbf684ee2484eb44c9f.js +1 -0
  37. package/assets/esri/core/workers/chunks/3cd9bd20e75ba4d5b294.js +1 -0
  38. package/assets/esri/core/workers/chunks/3e87e3ad857d72f6ecbb.js +1 -0
  39. package/assets/esri/core/workers/chunks/{7cb6d8f7eaf762279632.js → 3ea5a18b264628dc37f0.js} +1 -1
  40. package/assets/esri/core/workers/chunks/41809c16544ec25120fa.js +1 -0
  41. package/assets/esri/core/workers/chunks/41913575dd45c65d645e.js +1 -0
  42. package/assets/esri/core/workers/chunks/42e483fde18f12da32a6.js +1 -0
  43. package/assets/esri/core/workers/chunks/43ab44d37bc0ea97ef98.js +1 -0
  44. package/assets/esri/core/workers/chunks/46e622857ba92a72a317.js +1 -0
  45. package/assets/esri/core/workers/chunks/47f2113357b2aa4f4f37.js +1 -0
  46. package/assets/esri/core/workers/chunks/488ed9584b527ec47be3.js +1 -0
  47. package/assets/esri/core/workers/chunks/4ad32580e0c0699fde1f.js +1 -0
  48. package/assets/esri/core/workers/chunks/4d0f793dee4ad919221b.js +1 -0
  49. package/assets/esri/core/workers/chunks/4eed175277eb0df3c821.js +1 -0
  50. package/assets/esri/core/workers/chunks/{916a8f3eed1fafdc7242.js → 54d07eadf113f0e4e506.js} +1 -1
  51. package/assets/esri/core/workers/chunks/54ed37ec9682ea739deb.js +1 -0
  52. package/assets/esri/core/workers/chunks/{9187d1caca1fd2d713e0.js → 55369c5bd65bcaf78da1.js} +1 -1
  53. package/assets/esri/core/workers/chunks/56fd3da911c2c4511e5d.js +1 -0
  54. package/assets/esri/core/workers/chunks/59592bb25f226865e88a.js +1 -0
  55. package/assets/esri/core/workers/chunks/{e77d958cb62536b8eebc.js → 5a4d7ba6dc1d4b41d80d.js} +1 -1
  56. package/assets/esri/core/workers/chunks/5d55b4449bcb24cd72b6.js +1 -0
  57. package/assets/esri/core/workers/chunks/5d8fe41a3c06ddb4094b.js +1 -0
  58. package/assets/esri/core/workers/chunks/{fe68c28d3c61f116ff23.js → 5ef37f37e405b3bb5450.js} +1 -1
  59. package/assets/esri/core/workers/chunks/608d707fd9d9f9088473.js +1 -0
  60. package/assets/esri/core/workers/chunks/{c92352b0e39576ca317a.js → 61ef14e42bc09b787d89.js} +1 -1
  61. package/assets/esri/core/workers/chunks/656d6963e8f837fbf28f.js +1 -0
  62. package/assets/esri/core/workers/chunks/68b47a5a50e0b5fffca2.js +1 -0
  63. package/assets/esri/core/workers/chunks/{a5afcd633b32e6ee31a7.js → 6a0352d20596ca3f4b64.js} +1 -1
  64. package/assets/esri/core/workers/chunks/6c7ff968bd4fc816442d.js +1 -0
  65. package/assets/esri/core/workers/chunks/6e526c06825ecc6c99c0.js +1 -0
  66. package/assets/esri/core/workers/chunks/6ea8b0d68881d16a2432.js +1 -0
  67. package/assets/esri/core/workers/chunks/6f9ea461c268c421f9c9.js +1 -0
  68. package/assets/esri/core/workers/chunks/7027d93dc5a4595d70c6.js +1 -0
  69. package/assets/esri/core/workers/chunks/70b35b2446558d5280e3.js +1 -0
  70. package/assets/esri/core/workers/chunks/7349cb45a93e6916f115.js +1 -0
  71. package/assets/esri/core/workers/chunks/751609831b283903ba48.js +1 -0
  72. package/assets/esri/core/workers/chunks/76edaeaf8fe344bb77a8.js +1 -0
  73. package/assets/esri/core/workers/chunks/76fe5b821d6b54db5721.js +1 -0
  74. package/assets/esri/core/workers/chunks/81d30c9062ad0120a863.js +1 -0
  75. package/assets/esri/core/workers/chunks/84772b023d04e415f17f.js +1 -0
  76. package/assets/esri/core/workers/chunks/{123e920e4460124ec3bb.js → 88b480a1d1fb01778798.js} +9 -30
  77. package/assets/esri/core/workers/chunks/88c5f7c712c6b89b5109.js +1 -0
  78. package/assets/esri/core/workers/chunks/88e469b82d2594f23649.js +1 -0
  79. package/assets/esri/core/workers/chunks/8a14e3db28c403b046cf.js +1 -0
  80. package/assets/esri/core/workers/chunks/8a664451845a47048859.js +1 -0
  81. package/assets/esri/core/workers/chunks/8a8242e7cc7e6a9e7876.js +1 -0
  82. package/assets/esri/core/workers/chunks/{4d51261d6131c07402cd.js → 8acee3fba488f202f82f.js} +1 -1
  83. package/assets/esri/core/workers/chunks/91a0227a64a944af3286.js +596 -0
  84. package/assets/esri/core/workers/chunks/9444ed8ea117861ae89b.js +1 -0
  85. package/assets/esri/core/workers/chunks/96bba4d93a32ad34a1c8.js +1 -0
  86. package/assets/esri/core/workers/chunks/9a38fd68b02b617c45d3.js +1 -0
  87. package/assets/esri/core/workers/chunks/9d434360dfce1e49b7b9.js +1 -0
  88. package/assets/esri/core/workers/chunks/9f4b97204def91567e3c.js +1 -0
  89. package/assets/esri/core/workers/chunks/a37c28e3c4a2be9fd1d5.js +1 -0
  90. package/assets/esri/core/workers/chunks/{58b3c888c8bfedbe6443.js → a37fc886227365f7ecd5.js} +1 -1
  91. package/assets/esri/core/workers/chunks/a8d7f59927bdad564141.js +1 -0
  92. package/assets/esri/core/workers/chunks/{f89976ec97938bf86996.js → abc06d10c7ac8ba5b0e4.js} +1 -1
  93. package/assets/esri/core/workers/chunks/abe22ae8ee0dcc9efbb7.js +1 -0
  94. package/assets/esri/core/workers/chunks/{fef5dc19736f12dfa99a.js → af5db0372d526e592fcc.js} +1 -1
  95. package/assets/esri/core/workers/chunks/{eb3cdc4ff45243fc3cc5.js → b475f5492c6e3fd4cca8.js} +1 -1
  96. package/assets/esri/core/workers/chunks/b495f14d90abe8d1a558.js +1 -0
  97. package/assets/esri/core/workers/chunks/{6ac5ec3ecbca8860338b.js → b54b7cc6b23a70fed700.js} +1 -1
  98. package/assets/esri/core/workers/chunks/b702279c48f3009f6dd8.js +1 -0
  99. package/assets/esri/core/workers/chunks/b79058f5bda6fcac22f8.js +1 -0
  100. package/assets/esri/core/workers/chunks/b801631b58e6fc6cec8a.js +1 -0
  101. package/assets/esri/core/workers/chunks/{31071a43e2c03984d619.js → b92794def31592a6a25f.js} +1 -1
  102. package/assets/esri/core/workers/chunks/be1d6a571f76933dfbb0.js +1 -0
  103. package/assets/esri/core/workers/chunks/bea70be8e38b8c83ccd2.js +1 -0
  104. package/assets/esri/core/workers/chunks/bfcdc5c315131aae34d8.js +1 -0
  105. package/assets/esri/core/workers/chunks/c0f624a2ca0d07ef8f8c.js +1 -0
  106. package/assets/esri/core/workers/chunks/c1838822b096d5f36a8b.js +1 -0
  107. package/assets/esri/core/workers/chunks/c3381b9a36299210ee47.js +1 -0
  108. package/assets/esri/core/workers/chunks/{c2882a9e67124b7c18be.js → c503c79ba5761f7abbeb.js} +1 -1
  109. package/assets/esri/core/workers/chunks/cb5e4b9b4a59c2622eb5.js +1 -0
  110. package/assets/esri/core/workers/chunks/d201a5dff18a5bb467ab.js +1 -0
  111. package/assets/esri/core/workers/chunks/{3b7cda16e656db450f11.js → d2aa75816e84b1e7fd25.js} +1 -1
  112. package/assets/esri/core/workers/chunks/{4d8670f6fa8952b7bab6.js → d950d5c2844206502ff0.js} +1 -1
  113. package/assets/esri/core/workers/chunks/db3c484bfa607dec6050.js +1 -0
  114. package/assets/esri/core/workers/chunks/db588bf3256e95c977b7.js +1 -0
  115. package/assets/esri/core/workers/chunks/{967758a05170545cd371.js → dcc719e15b2e0cce1f3b.js} +1 -1
  116. package/assets/esri/core/workers/chunks/{6bb090f3e5c18604cb39.js → dd5b362bded458afa2d6.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{e957d52cb9643961a843.js → de583214195eff13cb00.js} +58 -45
  118. package/assets/esri/core/workers/chunks/dec6d41d614105e6fd93.js +1 -0
  119. package/assets/esri/core/workers/chunks/dfdd474fddcd1d6091ce.js +1 -0
  120. package/assets/esri/core/workers/chunks/e235ea4293d5d463acfb.js +1 -0
  121. package/assets/esri/core/workers/chunks/e43486113aaf72ac4dc1.js +1 -0
  122. package/assets/esri/core/workers/chunks/ea4c3393c5757e309a71.js +1 -0
  123. package/assets/esri/core/workers/chunks/ed216ddeb7f59f510bd0.js +1 -0
  124. package/assets/esri/core/workers/chunks/ef8886dff54063928bcb.js +1 -0
  125. package/assets/esri/core/workers/chunks/{231f502cd15f30d12be2.js → f1673e723b336204ad77.js} +1 -1
  126. package/assets/esri/core/workers/chunks/f5223ffb3be548c9b0a1.js +1 -0
  127. package/assets/esri/core/workers/chunks/fae147d03ed723ab234d.js +1 -0
  128. package/chunks/CheckerBoard.glsl.js +3 -5
  129. package/chunks/ColorMaterial.glsl.js +4 -6
  130. package/chunks/ComponentShader.glsl.js +42 -44
  131. package/chunks/DefaultMaterial.glsl.js +21 -23
  132. package/chunks/EdgeShader.glsl.js +9 -11
  133. package/chunks/GaussianSplat.glsl.js +8 -8
  134. package/chunks/ImageMaterial.glsl.js +5 -7
  135. package/chunks/LineCallout.glsl.js +9 -12
  136. package/chunks/LineMarker.glsl.js +24 -26
  137. package/chunks/Path.glsl.js +15 -17
  138. package/chunks/Pattern.glsl.js +25 -27
  139. package/chunks/RealisticTree.glsl.js +11 -13
  140. package/chunks/RibbonLine.glsl.js +42 -45
  141. package/chunks/ShadedColorMaterial.glsl.js +8 -9
  142. package/chunks/Water.glsl.js +18 -20
  143. package/config.js +1 -1
  144. package/kernel.js +1 -1
  145. package/layers/VoxelWasmPerSceneView.js +1 -1
  146. package/layers/graphics/FlatFeature.js +1 -1
  147. package/layers/graphics/FlatFeatureSet.js +1 -1
  148. package/layers/graphics/OptimizedFeature.js +1 -1
  149. package/layers/graphics/data/AttributesBuilder.js +1 -1
  150. package/layers/graphics/data/QueryEngineResult.js +1 -1
  151. package/layers/graphics/data/flatFeatureQueryEngineAdapter.js +1 -1
  152. package/layers/graphics/data/optimizedFeatureQueryEngineAdapter.js +1 -1
  153. package/layers/graphics/featureConversionUtils.js +1 -1
  154. package/layers/support/LabelClass.js +1 -1
  155. package/layers/support/featureLayerUtils.js +1 -1
  156. package/layers/support/labelUtils.js +1 -1
  157. package/layers/video/videoUtils.js +1 -1
  158. package/package.json +1 -1
  159. package/popupTemplateUtils.js +2 -0
  160. package/renderers/visualVariables/SizeVariable.js +1 -1
  161. package/renderers/visualVariables/support/sizeVariableUtils.js +1 -1
  162. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  163. package/rest/support/OutDistance.js +2 -0
  164. package/rest/support/Query.js +1 -1
  165. package/smartMapping/statistics/support/utils.js +1 -1
  166. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  167. package/support/arcadeUtils.js +1 -1
  168. package/support/revision.js +1 -1
  169. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  170. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  171. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  172. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  173. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  174. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  175. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  176. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  177. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  178. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  179. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  180. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  181. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  182. package/views/3d/layers/IntegratedMeshNormals.js +1 -1
  183. package/views/3d/layers/StreamLayerView3D.js +1 -1
  184. package/views/3d/layers/graphics/featureExpressionInfoUtils.js +1 -1
  185. package/views/3d/state/ViewStateManager.js +1 -1
  186. package/views/3d/terrain/OverlayRenderer.js +1 -1
  187. package/views/3d/terrain/TerrainRenderer.js +1 -1
  188. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  189. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialGlobalParameters.js +1 -1
  190. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  191. package/views/3d/webgl-engine/collections/Component/Material/ComponentShader.glsl.js +1 -1
  192. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  193. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +20 -32
  194. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +5 -3
  195. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  196. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  197. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  198. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  199. package/views/3d/webgl-engine/lib/Compositor.js +1 -1
  200. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  201. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  202. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  203. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  204. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  205. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  206. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
  207. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechniqueConfiguration.js +1 -1
  208. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  209. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  210. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  211. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  212. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  213. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  214. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  215. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  216. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  217. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  218. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  219. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  220. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  221. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  222. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  223. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  224. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  225. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  226. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  227. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  228. package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
  229. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  230. package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
  231. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  232. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  233. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  234. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  235. package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
  236. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  237. package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
  238. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  239. package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
  240. package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
  241. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  242. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  243. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  244. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  245. package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
  246. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  247. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  248. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  249. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  250. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  251. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
  252. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  253. package/views/VideoView.js +1 -1
  254. package/views/layers/FeatureLikeLayerView.js +1 -1
  255. package/views/video/VideoOperationalDataView.js +1 -1
  256. package/views/webgl/ShaderBuilder.js +1 -1
  257. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +19 -3
  258. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  259. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  260. package/widgets/FeatureTable/VisibleElements.d.ts +15 -1
  261. package/widgets/FeatureTable/VisibleElements.js +1 -1
  262. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  263. package/widgets/FeatureTable.d.ts +15 -1
  264. package/widgets/FeatureTable.js +1 -1
  265. package/widgets/Search/SearchViewModel.js +1 -1
  266. package/assets/esri/core/workers/chunks/09ecb36e44096e577af8.js +0 -1
  267. package/assets/esri/core/workers/chunks/0ca06ea649bbdb93ff49.js +0 -1
  268. package/assets/esri/core/workers/chunks/10308c9f3f0d709d96bc.js +0 -1
  269. package/assets/esri/core/workers/chunks/141edf5ed890105a079b.js +0 -1
  270. package/assets/esri/core/workers/chunks/160b9a76b75875507c86.js +0 -1
  271. package/assets/esri/core/workers/chunks/16dfdee05704df249e95.js +0 -1
  272. package/assets/esri/core/workers/chunks/17ef955dc48e329aa184.js +0 -1
  273. package/assets/esri/core/workers/chunks/18001536ed345955121a.js +0 -1
  274. package/assets/esri/core/workers/chunks/20e715e3aeb1c3265901.js +0 -1
  275. package/assets/esri/core/workers/chunks/238f51d0b36f998017b8.js +0 -1
  276. package/assets/esri/core/workers/chunks/2cee6d751c5e73fe09d4.js +0 -1
  277. package/assets/esri/core/workers/chunks/314140e2e9b813191907.js +0 -1
  278. package/assets/esri/core/workers/chunks/3158a3487d3e8a61b680.js +0 -1
  279. package/assets/esri/core/workers/chunks/3b1446286a9b87f34761.js +0 -1
  280. package/assets/esri/core/workers/chunks/3f7fd58ee7d71989fc83.js +0 -1
  281. package/assets/esri/core/workers/chunks/41396724040180d2537f.js +0 -1
  282. package/assets/esri/core/workers/chunks/416e031bafc0189544fa.js +0 -1
  283. package/assets/esri/core/workers/chunks/55ee78923987ed17ea8c.js +0 -1
  284. package/assets/esri/core/workers/chunks/56c7d7c7217557375fb6.js +0 -1
  285. package/assets/esri/core/workers/chunks/5a1d975b3e9e6b7eff67.js +0 -1
  286. package/assets/esri/core/workers/chunks/5f6942ac94acd7842926.js +0 -1
  287. package/assets/esri/core/workers/chunks/6118706b9a038e9a06b8.js +0 -1
  288. package/assets/esri/core/workers/chunks/6d15229b3fa84a7acf4d.js +0 -599
  289. package/assets/esri/core/workers/chunks/7314c0131403cac84ad7.js +0 -1
  290. package/assets/esri/core/workers/chunks/73545bb13c70f6a347a4.js +0 -1
  291. package/assets/esri/core/workers/chunks/73a045061e69a22b6869.js +0 -1
  292. package/assets/esri/core/workers/chunks/75669912cddcb5db52c8.js +0 -1
  293. package/assets/esri/core/workers/chunks/7ca32806e47be15109a4.js +0 -1
  294. package/assets/esri/core/workers/chunks/7d6ed65bbcd279448191.js +0 -1
  295. package/assets/esri/core/workers/chunks/81f149e45c79b9b086fb.js +0 -1
  296. package/assets/esri/core/workers/chunks/84fa25f66a6949290221.js +0 -1
  297. package/assets/esri/core/workers/chunks/852aabbf671d2ca9cd33.js +0 -1
  298. package/assets/esri/core/workers/chunks/854fe80272b59fafc2e9.js +0 -1
  299. package/assets/esri/core/workers/chunks/861817be5e050e9522ab.js +0 -1
  300. package/assets/esri/core/workers/chunks/89345a682dea60ef1643.js +0 -1
  301. package/assets/esri/core/workers/chunks/8985402c328b90af5724.js +0 -1
  302. package/assets/esri/core/workers/chunks/89fdf9ad10ca8fbb08a5.js +0 -1
  303. package/assets/esri/core/workers/chunks/8b094330323d9b16fb5d.js +0 -1
  304. package/assets/esri/core/workers/chunks/90aed8c4b266832f84ca.js +0 -1
  305. package/assets/esri/core/workers/chunks/9776c2db337222ceceef.js +0 -1
  306. package/assets/esri/core/workers/chunks/990853e9df38fdfc58b5.js +0 -1
  307. package/assets/esri/core/workers/chunks/9a21ba0c45a96b94c05e.js +0 -1
  308. package/assets/esri/core/workers/chunks/9a235c92f21df2c17aa8.js +0 -1
  309. package/assets/esri/core/workers/chunks/9b56162ac67c992193ce.js +0 -1
  310. package/assets/esri/core/workers/chunks/9f1f5fb648302c43ad12.js +0 -1
  311. package/assets/esri/core/workers/chunks/a1e6187c239fdc7553ed.js +0 -1
  312. package/assets/esri/core/workers/chunks/a4b6fdbc995be03d2afb.js +0 -1
  313. package/assets/esri/core/workers/chunks/a760be8fa6c6ea6b745c.js +0 -1
  314. package/assets/esri/core/workers/chunks/a8782286ce3c0d6c20e6.js +0 -1
  315. package/assets/esri/core/workers/chunks/a96692514dcaa50340dd.js +0 -1
  316. package/assets/esri/core/workers/chunks/a994a3c912a33b2f4100.js +0 -1
  317. package/assets/esri/core/workers/chunks/aa7aaeae31ddb259e55e.js +0 -1
  318. package/assets/esri/core/workers/chunks/abcc5fb71be2bd94878c.js +0 -1
  319. package/assets/esri/core/workers/chunks/aecb05df4ad1454f5435.js +0 -1
  320. package/assets/esri/core/workers/chunks/aecb105db7cec2c9c4c5.js +0 -1
  321. package/assets/esri/core/workers/chunks/b19f33e026a2a43b17c4.js +0 -1
  322. package/assets/esri/core/workers/chunks/b3950d5f1f3352521504.js +0 -1
  323. package/assets/esri/core/workers/chunks/b3f0600729227b458a75.js +0 -1
  324. package/assets/esri/core/workers/chunks/b5922991d2f450e6a9d9.js +0 -1
  325. package/assets/esri/core/workers/chunks/b8643976a7f984552d94.js +0 -1
  326. package/assets/esri/core/workers/chunks/b8a11d32a4847513619b.js +0 -1
  327. package/assets/esri/core/workers/chunks/b8acb6c2538053c01cc6.js +0 -1
  328. package/assets/esri/core/workers/chunks/ba4259aa050169c1d523.js +0 -1
  329. package/assets/esri/core/workers/chunks/bbaf1d9835671c0165ca.js +0 -1
  330. package/assets/esri/core/workers/chunks/bcefdf9753d9d2f6f1be.js +0 -1
  331. package/assets/esri/core/workers/chunks/c178e2cfc34603661b1d.js +0 -1
  332. package/assets/esri/core/workers/chunks/c3e80c0e29ac6a7a6f80.js +0 -1
  333. package/assets/esri/core/workers/chunks/c79827f879d1d58d3f1b.js +0 -1
  334. package/assets/esri/core/workers/chunks/c92b40a532e708e506cc.js +0 -1
  335. package/assets/esri/core/workers/chunks/cb903ccbce87172a0757.js +0 -1
  336. package/assets/esri/core/workers/chunks/cda2e445eb2ac269abdf.js +0 -1
  337. package/assets/esri/core/workers/chunks/ce44e172e2847fd8df14.js +0 -1
  338. package/assets/esri/core/workers/chunks/cff7e921649aef715c78.js +0 -1
  339. package/assets/esri/core/workers/chunks/d315098b038a96084ff5.js +0 -1
  340. package/assets/esri/core/workers/chunks/d8c0d18f0132872decd3.js +0 -1
  341. package/assets/esri/core/workers/chunks/db0061a6d5bf454cc509.js +0 -1
  342. package/assets/esri/core/workers/chunks/dcfafcf4386f2940d000.js +0 -1
  343. package/assets/esri/core/workers/chunks/e2b034c391c603f7f825.js +0 -1
  344. package/assets/esri/core/workers/chunks/e3a73d9acebccd3ba49b.js +0 -1
  345. package/assets/esri/core/workers/chunks/e67bdd8bf38ebe89a344.js +0 -1
  346. package/assets/esri/core/workers/chunks/e797d45eba0884dc7e6f.js +0 -1
  347. package/assets/esri/core/workers/chunks/e81a3da05fcff97b4752.js +0 -1
  348. package/assets/esri/core/workers/chunks/e9dd60d0220036545ebb.js +0 -1
  349. package/assets/esri/core/workers/chunks/ea6d3b7c7d720aa7bc94.js +0 -1
  350. package/assets/esri/core/workers/chunks/eb9982bc866976fef960.js +0 -1
  351. package/assets/esri/core/workers/chunks/ec4669a0edeca94710e0.js +0 -1
  352. package/assets/esri/core/workers/chunks/ef9d74f8d5a502fda809.js +0 -1
  353. package/assets/esri/core/workers/chunks/f09446b9ff937a84d6d3.js +0 -1
  354. package/assets/esri/core/workers/chunks/f0bc5e8e44d53b73d431.js +0 -1
  355. package/assets/esri/core/workers/chunks/f653970d983f17fb764b.js +0 -1
  356. package/assets/esri/core/workers/chunks/f9edc685099f51363f41.js +0 -1
  357. package/assets/esri/core/workers/chunks/fa687ba2d66fcc2501da.js +0 -1
  358. package/assets/esri/core/workers/chunks/fb9a889ec9fd23739a14.js +0 -1
  359. package/assets/esri/core/workers/chunks/fe1b67ab7748a3aef231.js +0 -1
  360. package/chunks/HUDCompositing.glsl.js +0 -2
  361. package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +0 -5
  362. package/views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js +0 -8
  363. package/views/3d/webgl-engine/effects/fboFormatUtils.js +0 -2
  364. package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +0 -2
  365. package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +0 -2
@@ -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 s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as r,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 l,initial as _,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 b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as T,create as E}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 A,ZEROS as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as C}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as D,InternalRenderCategory as R,AllRenderNodeOutputs as O,AllInternalRenderNodeOutputs as S}from"../../webgl.js";import{minNearDistanceInMeters as F}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 N}from"../core/renderPasses/RenderPassManager.js";import{isColor as G}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as H}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{hasOit8Bit as v,hasEmissive8Bit as M}from"../effects/fboFormatUtils.js";import{RenderNodes as q}from"../effects/RenderNodes.js";import{RenderPluginManager as L}from"../effects/RenderPluginManager.js";import{WeatherFader as U}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as j}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as B}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as V,renderHighlightBuffer as k}from"../effects/highlight/Highlight.js";import{OITBlend as W}from"../effects/transparency/OITBlend.js";import{AnimationTimer as z}from"./AnimationTimer.js";import{AnimationTimeStep as Q}from"./AnimationTimeStep.js";import{BoundingInfo as Y}from"./BoundingInfo.js";import{Compositor as X}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 ee}from"./RenderContext.js";import{RendererBase as te}from"./RendererBase.js";import{setupFeatureDefaults as se}from"./RenderFeature.js";import{RenderPluginInput as re}from"./RenderPluginInput.js";import{ShadowAccumulator as ie}from"./ShadowAccumulator.js";import{ShadowMap as ae}from"./ShadowMap.js";import ne from"./SliceHelper.js";import{MergedRenderer as he}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as oe}from"../parts/renderUtils.js";import{RendererPerformanceInfo as de,PerformanceCategory as le}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as _e,PixelType as ue,ColorAttachment2 as me,ColorAttachment0 as pe}from"../../../webgl/enums.js";let ce=class extends te{constructor(e,t,s,r,i){super({stage:e}),this._techniques=s,this._rctx=r,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new N,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ne,this.sceneDepthRange=m($.Infinite),this._state=m(2),this._hasGlobalIlluminationFlag=!!has("global-illumination"),this._hasOit8Bit=v(),this._hasEmissive8Bit=M(),this._hasAnimations=!1,this._animationTimestep=new Q,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 Re)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new y(r),this._compositor=new X(r,s),this._renderStateFeatures=m(se(e.view.qualityProfile));const a=new ae(this._fboCache,e.viewingMode);this._renderContext=new Z(this._rctx,a,s),this._framebuffer=new K(this._fboCache,this._bindParameters),this._performanceInfo=new de(this._rctx),this._blit=new B(s),this._shadowAccumulator=new ie(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,s,r)=>{const i=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,r,!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 L({renderContext:this._renderContext,techniques:s,materials:t,requestRender:i,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new U({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>i(),l),d(()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},_),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():I;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=H,l),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()},_),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=r(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,Y.prune(),he.prune(),C()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new W(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=se(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(r=>r.set(t,e,s)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(5),this._bindParameters.screenSpaceReflections.enabled}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 hasAmbientIllumination(){return this.isFeatureEnabled(4)&&!this._inGlobeView}get _hasGlobalIllumination(){return this.hasAmbientIllumination&&this._hasGlobalIlluminationFlag}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmissions(){return this._hasEmissive8Bit||this.hasFloatBlend?this._plugins.hasEmissions:0}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._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),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=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const s=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:ye(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.reprojection.matrix,T)}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 z(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?r(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,s,r=!1){try{return this._isRendering=!0,this._render(e,t,s,r)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new oe(this._pluginInput.get(D.FINAL),null)}_render(e,t,s,r){const i=0===s;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:a,contentCamera:o,mode:d,alignPixelEnabled:l}=e;this._state.value=d,this._renderContext.time=t,this._bindParameters.output=0,this._bindParameters.emissions=this._hasEmissions,this._bindParameters.alignPixelEnabled=l,this._bindParameters.decorations=!r,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const _=!r||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=_?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(R.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(R.CUTFILL_COLOR),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._ensureBindParameters(a,o,t),this._plugins.sortTestsTransparentOrderedSlots(Ie),this._plugins.prepareRender(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!r,this._hasTransparentGeometry=this._plugins.produces(0,...fe),this._precompilePrepasses(),this.performanceInfo.advance(le.PREPARE);const p=this._computeShadowDepthRange(a);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(a,o,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p,!i),this._oitCallouts=this._hasTransparentGeometry&&this.oitEnabled,u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(),this._bindParameters.output=0;this._bindParameters.hasOpaqueEmissions||0===this._bindParameters.emissions?(this._renderOpaque(),this._renderPreTransparent()):(this._bindParameters.emissions=0,this._renderOpaque(),this._renderPreTransparent(),this._bindParameters.emissions=2),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(R.FOCUSAREA,this._renderFocusAreaGeometry()),u.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(R.VIEWSHED,e)),u.update(e=>this._renderNodes(R.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),u.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.GROUND_DEPTH),u.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===s?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(D.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),this._hasGlobalIllumination&&this._hasEmissions&&(this._bindParameters.reprojection.lastFrameEmission=u.color.obtainAttachment(_e)),u.update(e=>this._renderNodes(R.ANTIALIASING,e));const b=this._hasPhotoshopTerrain||!this._hasTransparentGeometry?1:2;let f;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(b,e)),u.update(e=>this._renderNodes(R.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=this._hasEmissions,u.update(e=>this._renderNodes(R.MAGNIFIER,e)),u.update(e=>this._renderNodes(D.FINAL,e)),i&&this._blit.toFramebuffer(this._rctx,u.color,this._bindParameters),this._hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),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||(f=u.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new oe(f,c)}_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.GAUSSIAN_SPLAT,R.OPAQUE_OCCLUSION_QUERY,R.VOXEL);2===this._bindParameters.emissions&&(this._bindParameters.emissions=0,this._precompileOpaqueGeometry(),this._bindParameters.emissions=2);const t=this._bindParameters;if(t.terrainDepthTest=t.cullAboveTerrain=this._needsTerrainDepth,this._bindParameters.output=3,this._plugins.precompile(...ge),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,R.FOCUSAREA);const s=this._hasPhotoshopTerrain&&!this._needsTerrainDepth;this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,s,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.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=this._hasEmissions,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,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,D.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(le.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let r=this.fboCache.acquire(t,s,"olid");return r.acquireDepth(13),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(le.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let r=0;t?r=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const i=Math.max(e,r);this._animationTimestep.frame(i,s)}}readMainDepth(e,t){const{mainDepth:s,camera:r}=this._bindParameters;if(!s)return;const i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(i.fbo),r.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(I),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),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,ue.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:s,height:r}=this._framebuffer.size,i=this.fboCache.acquire(s,r,"edges"),a=this._bindParameters.geometryDepth,n=()=>t.render(this._bindParameters,e);this._renderToTargets(n,i,a??this._framebuffer.depth,I),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?le.OPAQUE_EDGES:le.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(le.OVERLAY)}_renderShadowMap(e,t,s,r){if(!this.shadowsEnabled)return;const i=this._bindParameters.shadowMap;if(i.start(e,s,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,i),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(R.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,i.disposeOutput(6),i.clear(),this._renderShadowCascades(7,i)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(le.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 s=this._bindParameters.output;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e);t.finish(e),this._bindParameters.output=s}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this._hasGlobalIllumination+ +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(R.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():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(le.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"geometry",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=r.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),r.release(),this.performanceInfo.advance(le.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:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"terrain",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=r.obtainDepthTexture(),r.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:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"geometry",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(3),this._bindParameters.output=e,this._bindParameters.geometryDepth=r.obtainDepthTexture(),r.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=F,t.far=1e10;const s=J(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...O,R.VIEWSHED,R.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){this._normalsRequired?(this._precompilePlugins(4,Pe),this._needsDepth&&this._precompilePlugins(3,Te)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,R.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&this._precompileAllGeometry(5),this.hasAmbientIllumination&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,R.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquire(t,s,"normals",5);r.acquireDepth(13),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(I,!0,!0),this._bindParameters.output=4,this._plugins.render(...Pe);const i=this._nodes.optional("normals",...O,R.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(le.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(this.hasAmbientIllumination&&e)return this._bindParameters.ssao=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(le.AMBIENT_ILLUMINATION),this._bindParameters.ssao}_renderGlobalIllumination(){if(!this.hasAmbientIllumination)return void this._releaseGlobalIlluminationBuffers();const e=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=e,this.performanceInfo.advance(le.AMBIENT_ILLUMINATION),e}_releaseGlobalIlluminationBuffers(){this._bindParameters.reprojection.lastFrameDepth=h(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=h(this._bindParameters.reprojection.lastFrameEmission),this._bindParameters.globalIllumination=h(this._bindParameters.globalIllumination)}_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 s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Ee);this._renderContext.renderOccludedMask=ee}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,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,...Ee),this._renderContext.renderOccludedMask=ee}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)}precompileCutFillOrthographicReferenceDepth(){this._precompilePlugins(9,De)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=r}renderCutFillOrthographicReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...De),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=r}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,R.GROUND_DEPTH,13);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Te)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...be),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...be)}_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,s=this.fboCache.acquire(e,t,"transparent terrain"),r=()=>this._plugins.render(6);return this._renderToTargets(r,s,this._framebuffer.depth,I),this.performanceInfo.advance(le.TRANSPARENT_TERRAIN),s}_renderTransparentGround(){this._plugins.render(...ge)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),{width:t,height:s}=this._framebuffer.size,r=this.fboCache.acquireDepth(this._hudDepthFormat,t,s,"line callouts");this._renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(16)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=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=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;if(this.oitEnabled){const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const r=!!t.getTexture(_e);this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),r),s.release()}else if(this._bindParameters.output=0,0===e){const t=()=>this._renderHUDElements(e),{width:s,height:r}=this._framebuffer.size,i=this.fboCache.acquireDepth(this._hudDepthFormat,s,r,"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?le.HUD_OCCLUDED:le.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:r,height:i}=this._framebuffer.size,{highlights:a}=s,n=a.length>V?3:1,h=e.acquire(r,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),k(t,e,r,i,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(le.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...S)+this._nodes.optional("highlights",...S)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ae),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(le.ACCUMULATED_SHADOWS),this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){this.oitEnabled&&G(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 s=1===e,{width:r,height:i}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",_=this.fboCache.acquire(r,i,l,o),u=h.hasEmission&&(0===e||1!==t);u&&_.acquireColor(_e,o,"oit emissive");const m=u?me:_e;_.acquireColor(m,this.hasFloatBlend?7:0,"oit alpha"),s||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,I),a(),_.detachDepth(),h.output=2;const p=this.fboCache.acquire(r,i,s?"oit hud front":"oit front");u&&p.acquireColor(_e,o,"oit emissive front"),s?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(I,s),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(r,i,"oit hud composite"),this._rctx.bindFramebuffer(b.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-pe,I)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,_,p,h,u,c,e),b?.detachDepth(),s||c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(m)),p.release(),_.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(8)?13:12}get _needsOpaquePass(){return this.plugins.produces(0,...be)||this.plugins.produces(5,...be)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(R.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(D.OPAQUE,t,e)),this.fboCache.debugCallback?.(D.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)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(R.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(R.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(R.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.VOXEL,e)),this.fboCache.debugCallback?.(R.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;2===this._bindParameters.emissions&&e.ensureEmissionAttachment(),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),e.update(e=>this._renderNodes(D.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(D.TRANSPARENT,e.color.fbo),this._renderGeometryDepth(),this._needsTerrainDepth||this._oitCallouts||this._plugins.render(16),this._renderEdges(0);const t=this._renderPhotoshopTerrain(),s=t?.getTexture();s&&this._renderHUD(0,e.color),this._bindParameters.cullAboveTerrain=!1,s&&(e.bind(),this._compositor.compositePreMultipliedAlpha(this._bindParameters,s),t?.release(),this._needsTerrainDepth&&(this._renderEdges(1),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(le.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(le.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(le.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const r=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(r,t.fbo);const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),i}_ensureBindParameters(e,t,s){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(s),this._ensureBindParametersScreenSpaceReflections(s),this._ensureBindParametersReprojection()}_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)}_ensureBindParametersScreenSpaceReflections(e){const{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){const{reprojection:e,camera:t}=this._bindParameters;if(!(this.hasReflections||this._hasGlobalIllumination))return void(this._reprojectionMatrix=T);const{lastFrameCamera:s}=e,r=!s.equals(t);if(r?(f(Se,t.viewMatrix),f(Oe,t.projectionMatrix),g(Fe,Se,Oe),g(Fe,s.viewMatrix,Fe),g(Fe,s.projectionMatrix,Fe),this._reprojectionMatrix=Fe):this._reprojectionMatrix=T,this._hasGlobalIllumination){const{viewMatrix:t}=e;r?(g(xe,s.viewMatrix,Se),P(t,xe)):P(t,T)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,r){this._bindParameters.updateLighting(e,t,s,r),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,s,r,i=!1,a=!1){t.attachDepth(s),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(r,i,a),e(),t.detachDepth()}get test(){}};e([p()],ce.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],ce.prototype,"hasAmbientIllumination",null),e([p({readOnly:!0})],ce.prototype,"highResolutionAtmosphere",null),e([p()],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),ce=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ce);const be=[0,1,2,3],fe=[8,7,4,5],ge=[6,8,7],Pe=[0,1,2,4,...ge],Te=[3,5],Ee=[2,4,9],we=[17,13,15,14],Ae=[4,5,2,3,0,1,...ge],Ie=[4,9,5,12],Ce={0:[14],1:[13],2:[14,13],3:[14,13]},De=[0,1,...ge],Re=["normals","highlights"],Oe=E(),Se=E(),Fe=E(),xe=E();function ye(e){return t=>e.immediate.schedule(t)}export{ce as Renderer};
2
+ import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,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 l,initial as m,sync as u}from"../../../../core/reactiveUtils.js";import{signal as _}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as f,invert as b,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as w,create as E}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as I}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as A,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as T}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as R,InternalRenderCategory as O,AllRenderNodeOutputs as S,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import"../../webgl/ManagedDepthAttachment.js";import{FBOCache as N}from"../core/FBOCache.js";import{RenderPassManager as H}from"../core/renderPasses/RenderPassManager.js";import{isColor as G}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as y}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as v}from"../effects/RenderNodes.js";import{RenderPluginManager as M}from"../effects/RenderPluginManager.js";import{WeatherFader as L}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as q}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as j,renderHighlightBuffer as B}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 X}from"./depthRangeUtils.js";import{MainFramebuffer as $}from"./MainFramebuffer.js";import{RenderContext as J,defaultRenderOccludedMask as K}from"./RenderContext.js";import{RendererBase as Z}from"./RendererBase.js";import{setupFeatureDefaults as ee}from"./RenderFeature.js";import{RenderPluginInput as te}from"./RenderPluginInput.js";import{ShadowAccumulator as se}from"./ShadowAccumulator.js";import{ShadowMap as ie}from"./ShadowMap.js";import re 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{ColorAttachment1 as de,PixelType as le,ColorAttachment2 as me,ColorAttachment0 as ue}from"../../../webgl/enums.js";let _e=class extends Z{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new H,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new re,this.sceneDepthRange=_(Y.Infinite),this._state=_(2),this._hasGlobalIlluminationFlag=!!has("global-illumination"),this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=_(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new te,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of Te)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new N(i),this._compositor=new Q(i,s),this._renderStateFeatures=_(ee(e.view.qualityProfile));const a=new ie(this._fboCache,e.viewingMode);this._renderContext=new J(this._rctx,a,s),this._framebuffer=new $(this._fboCache,this._bindParameters),this._performanceInfo=new he(this._rctx),this._blit=new U(s),this._shadowAccumulator=new se(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,s,i)=>{const r=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,i,!0,r),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},r),this._nodes=new v(this._renderContext),this._plugins=new M({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new L({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},m),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;I(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=y,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),d(()=>this._bindParameters.clouds.data?.state,()=>r(),u),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},m),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=r(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(),T()}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,s){this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender()}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this.isFeatureEnabled(3)&&!this._inGlobeView}get _hasGlobalIllumination(){return this.hasAmbientIllumination&&this._hasGlobalIlluminationFlag}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmissions(){return this._plugins.hasEmissions}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),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=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const s=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:Fe(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),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,w)}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,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...we),has.water=this._plugins.produces(4,19),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 s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(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,s,i=!1){try{return this._isRendering=!0,this._render(e,t,s,i)}catch(r){console.error(`Exception during rendering: ${r}:\n${r.stack}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(R.FINAL),null)}_render(e,t,s,i){const r=0===s;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r,this._disposeBindBuffers();const{camera:a,contentCamera:o,mode:d,alignPixelEnabled:l}=e;this._state.value=d,this._renderContext.time=t,this._bindParameters.output=0,this._bindParameters.emissions=this._hasEmissions,this._bindParameters.alignPixelEnabled=l,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const m=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=m?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(O.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(O.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(O.CUTFILL_COLOR),this._renderOverlay(),a.setGLViewport(this._rctx);const u=this._framebuffer,_=u.initialize(a.fullWidth,a.fullHeight,this._backgroundColor);this.hasReflections?(_?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor=_):_?.release(),this._ensureBindParameters(a,o,t),this._plugins.sortTestsTransparentOrderedSlots(Ie),this._plugins.prepareRender(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!i,this._hasTransparentGeometry=this._plugins.produces(0,...ce),this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const p=this._computeShadowDepthRange(a);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(a,o,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p,!r),u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(),this._bindParameters.output=0;this._bindParameters.hasOpaqueEmissions||0===this._bindParameters.emissions?(this._renderOpaque(),this._renderPreTransparent()):(this._bindParameters.emissions=0,this._renderOpaque(),this._renderPreTransparent(),this._bindParameters.emissions=2),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(O.FOCUSAREA,this._renderFocusAreaGeometry()),u.update(e=>this._renderNodes(O.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(O.VIEWSHED,e)),u.update(e=>this._renderNodes(O.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(O.FOCUSAREA_COLOR,e)),u.update(e=>this._renderNodes(O.CUTFILL_COLOR,e)),this._pluginInput.release(O.FOCUSAREA),this._pluginInput.release(O.GROUND_DEPTH),u.update(e=>this._renderNodes(O.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===s?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(R.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),this._hasGlobalIllumination&&this._hasEmissions&&(this._bindParameters.reprojection.lastFrameEmission=u.color.obtainAttachment(de)),u.update(e=>this._renderNodes(O.ANTIALIASING,e));const f=this._hasTransparentGeometry?2:1;let b;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(f,e)),u.update(e=>this._renderNodes(O.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(f,e)),this._bindParameters.emissions=this._hasEmissions,u.update(e=>this._renderNodes(O.MAGNIFIER,e)),u.update(e=>this._renderNodes(R.FINAL,e)),r&&this._blit.toFramebuffer(this._rctx,u.color,this._bindParameters),this._hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),r||(b=u.color,b.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ne(b,c)}_precompileShaders(){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const e=this._bindParameters.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(e,O.OPAQUE_ENVIRONMENT,O.GAUSSIAN_SPLAT,O.OPAQUE_OCCLUSION_QUERY,O.VOXEL);2===this._bindParameters.emissions&&(this._bindParameters.emissions=0,this._precompileOpaqueGeometry(),this._bindParameters.emissions=2);const t=this._bindParameters;if(this._bindParameters.output=3,this._plugins.precompile(...fe),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._precompileTransparentGeometry()}this._nodes.precompile(e,O.FOCUSAREA),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,e),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(e,O.TRANSPARENT_ENVIRONMENT,O.VIEWSHED,O.CUTFILL_COMPUTATION,O.CUTFILL_COLOR,O.LASERLINES,O.FOCUSAREA_COLOR,O.OCCLUDED,O.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=this._hasEmissions,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(e,O.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(e,R.COMPOSITE,O.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(O.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:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,"olid");return i.acquireDepth(13),i=this._nodes.render(i,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(oe.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const r=Math.max(e,i);this._animationTimestep.frame(r,s)}}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,le.UNSIGNED_BYTE,t),r.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:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.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,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(O.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(oe.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(O.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output;t.bindFramebuffer();for(const i of t.cascades)i.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(i.camera,i.camera),this.renderAllGeometry(e);t.finish(e),this._bindParameters.output=s}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this._hasGlobalIllumination+ +this._shadowAccumulator.accumulating+ +this._testsNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(O.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():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(oe.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",13);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(oe.DEPTH)}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Y.Zero;const t=X(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)<q)return void(this.sceneDepthRange.value=Y.Infinite);const t=e.clone();t.near=F,t.far=1e10;const s=X(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...S,O.VIEWSHED,O.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){this._normalsRequired?(this._precompilePlugins(4,be),this._needsDepth&&this._precompilePlugins(3,ge)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,O.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&this._precompileAllGeometry(5),this.hasAmbientIllumination&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,O.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals",5);i.acquireDepth(13),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...be);const r=this._nodes.optional("normals",...S,O.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(oe.NORMALS),i}_renderSSAO(){const e=this._pluginInput.get("normals");if(this.hasAmbientIllumination&&e)return this._bindParameters.ssao=this._nodes.produce(O.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION),this._bindParameters.ssao}_renderGlobalIllumination(){if(!this.hasAmbientIllumination)return void this._releaseGlobalIlluminationBuffers();const e=this._nodes.produce(O.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=e,this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION),e}_releaseGlobalIlluminationBuffers(){this._bindParameters.reprojection.lastFrameDepth=h(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=h(this._bindParameters.reprojection.lastFrameEmission),this._bindParameters.globalIllumination=h(this._bindParameters.globalIllumination)}_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 s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Pe);this._renderContext.renderOccludedMask=K}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,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(9),this.renderSlots(e,...Pe),this._renderContext.renderOccludedMask=K}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ae[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillOrthographicReferenceDepth(){this._precompilePlugins(9,Ce)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillOrthographicReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Ce),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,O.GROUND_DEPTH,13);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...ge)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...pe),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...pe)}_renderTransparentGeometry(){this._plugins.render(...ce),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...fe)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,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._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...we)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(de);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),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:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>j?3:1,h=e.acquire(i,r,"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),B(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-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(oe.ACCUMULATED_SHADOWS),this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){G(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...ce),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...ce),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...ce)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",m=this.fboCache.acquire(i,r,l,o),u=h.hasEmission&&(0===e||1!==t);u&&m.acquireColor(de,o,"oit emissive");const _=u?me:de;m.acquireColor(_,this.hasFloatBlend?7:0,"oit alpha"),s||m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,C),a(),m.detachDepth(),h.output=2;const p=this.fboCache.acquire(i,r,s?"oit hud front":"oit front");u&&p.acquireColor(de,o,"oit emissive front"),s?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,s),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let f;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(f=this.fboCache.acquire(i,r,"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(_,0,"hud occlusion"),this._rctx.clearBuffer(_-ue,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,m,p,h,u,c,e),f?.detachDepth(),s||c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(_)),p.release(),m.release(),h.output=d,f}get _hudDepthFormat(){return this.isFeatureEnabled(7)?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._pluginInput.set(O.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(R.OPAQUE,t,e)),this.fboCache.debugCallback?.(R.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(O.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(O.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(O.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(O.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(O.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(O.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(O.VOXEL,e)),this.fboCache.debugCallback?.(O.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;2===this._bindParameters.emissions&&e.ensureEmissionAttachment(),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(R.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(R.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(oe.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const i=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(i,t.fbo);const r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),r}_ensureBindParameters(e,t,s){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(s),this._ensureBindParametersScreenSpaceReflections(s),this._ensureBindParametersReprojection()}_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)}_ensureBindParametersScreenSpaceReflections(e){const{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){const{reprojection:e,camera:t}=this._bindParameters;if(!(this.hasReflections||this._hasGlobalIllumination))return void(this._reprojectionMatrix=w);const{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(b(Oe,t.viewMatrix),b(Re,t.projectionMatrix),g(Se,Oe,Re),g(Se,s.viewMatrix,Se),g(Se,s.projectionMatrix,Se),this._reprojectionMatrix=Se):this._reprojectionMatrix=w,this._hasGlobalIllumination){const{viewMatrix:t}=e;i?(g(De,s.viewMatrix,Oe),P(t,De)):P(t,w)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p()],_e.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],_e.prototype,"hasAmbientIllumination",null),e([p({readOnly:!0})],_e.prototype,"highResolutionAtmosphere",null),e([p()],_e.prototype,"_edgeView",void 0),e([p()],_e.prototype,"updating",null),_e=e([c("esri.views.3d.webgl-engine.lib.Renderer")],_e);const pe=[0,1,2,3],ce=[7,6,4,5],fe=[7,6],be=[0,1,2,4,...fe],ge=[3,5],Pe=[2,4,8],we=[16,12,14,13],Ee=[4,5,2,3,0,1,...fe],Ie=[4,8,5,11],Ae={0:[13],1:[12],2:[13,12],3:[13,12]},Ce=[0,1,...fe],Te=["normals","highlights"],Re=E(),Oe=E(),Se=E(),De=E();function Fe(e){return t=>e.immediate.schedule(t)}export{_e as Renderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as s,everyMap as i}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{OverlayTarget as h}from"../../terrain/Intersector.js";import{ChangeSet as c,RenderGeometryUpdate as l}from"./ChangeSet.js";import{IntersectorResult as p}from"./IntersectorResult.js";import{RendererBase as u}from"./RendererBase.js";import{noBudget as g}from"../../../support/Scheduler.js";let m=class extends u{constructor(e){super(e),this._pending=new y,this._changes=new c,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return s(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&s(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return i(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,g,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=s(this.renderers,e=>{const r=e.produces.get(19);return!!r&&r(10)}),this._hasWater=s(this.renderers,e=>{const r=e.produces.get(20);return!!r&&r(4)})),this.notifyChange("updating"),!0)}rendererAdded(){this._sortedRenderers.clear()}rendererRemoved(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);switch(s&&this.notifyChange("updating"),r){case 0:this._notifyGraphicVisibilityChanged(e);break;case 1:this._notifyGraphicGeometryChanged(e)}}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=new l;this._changes.updates.push(e),e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case 4:case 2:return this._notifyGraphicGeometryChanged(e);case 1:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere.center[0]-n.boundingSphere.radius<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere.center[0]+n.boundingSphere.radius>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.length=0,this._changes.removes.length=0,r(this._changes.adds,Array.from(this._pending.adds)),r(this._changes.removes,Array.from(this._pending.removes)),t(this._changes.updates,({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],f[0]=t[0]-s,f[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,i,f,(t,s,o)=>{_(r,o,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(e.boundingSphere.center)),e}get test(){}};e([o({constructOnly:!0})],m.prototype,"drapeSource",void 0),e([o({constructOnly:!0})],m.prototype,"rendererContext",void 0),e([o()],m.prototype,"updating",null),e([o()],m.prototype,"rctx",null),e([o()],m.prototype,"_localOriginFactory",null),e([o({readOnly:!0})],m.prototype,"isEmpty",null),e([o()],m.prototype,"_geometries",void 0),m=e([d("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],m);class y{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function _(e,r,t,s,i,n,o){const d=new h(n,o,r),a=r=>{r.set(5,d,e.distance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.distance||i.results.ground.distance<=i.results.min.distance)&&a(i.results.min),0!==i.options.store&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.distance||i.results.ground.distance>i.results.max.distance)&&a(i.results.max),2===i.options.store){const e=new p(i.ray);a(e),i.results.all.push(e)}}const f=a();export{m as SortedRenderGeometryRenderer};
2
+ import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as s,everyMap as i}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{OverlayTarget as h}from"../../terrain/Intersector.js";import{ChangeSet as c,RenderGeometryUpdate as l}from"./ChangeSet.js";import{IntersectorResult as p}from"./IntersectorResult.js";import{RendererBase as u}from"./RendererBase.js";import{noBudget as g}from"../../../support/Scheduler.js";let m=class extends u{constructor(e){super(e),this._pending=new y,this._changes=new c,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return s(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&s(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return i(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,g,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=s(this.renderers,e=>{const r=e.produces.get(18);return!!r&&r(10)}),this._hasWater=s(this.renderers,e=>{const r=e.produces.get(19);return!!r&&r(4)})),this.notifyChange("updating"),!0)}rendererAdded(){this._sortedRenderers.clear()}rendererRemoved(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);switch(s&&this.notifyChange("updating"),r){case 0:this._notifyGraphicVisibilityChanged(e);break;case 1:this._notifyGraphicGeometryChanged(e)}}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=new l;this._changes.updates.push(e),e.renderGeometry=this._ensureValidRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case 4:case 2:return this._notifyGraphicGeometryChanged(e);case 1:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere.center[0]-n.boundingSphere.radius<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere.center[0]+n.boundingSphere.radius>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.length=0,this._changes.removes.length=0,r(this._changes.adds,Array.from(this._pending.adds)),r(this._changes.removes,Array.from(this._pending.removes)),t(this._changes.updates,({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible||!e.material.intersectDraped)return;let o=0;s+=e.transformation[12],o=e.transformation[13],f[0]=t[0]-s,f[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,i,f,(t,s,o)=>{_(r,o,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)},r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(e.boundingSphere.center)),e}get test(){}};e([o({constructOnly:!0})],m.prototype,"drapeSource",void 0),e([o({constructOnly:!0})],m.prototype,"rendererContext",void 0),e([o()],m.prototype,"updating",null),e([o()],m.prototype,"rctx",null),e([o()],m.prototype,"_localOriginFactory",null),e([o({readOnly:!0})],m.prototype,"isEmpty",null),e([o()],m.prototype,"_geometries",void 0),m=e([d("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],m);class y{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function _(e,r,t,s,i,n,o){const d=new h(n,o,r),a=r=>{r.set(5,d,e.distance,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.distance||i.results.ground.distance<=i.results.min.distance)&&a(i.results.min),0!==i.options.store&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.distance||i.results.ground.distance>i.results.max.distance)&&a(i.results.max),2===i.options.store){const e=new p(i.ray);a(e),i.results.all.push(e)}}const f=a();export{m as SortedRenderGeometryRenderer};
@@ -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}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};
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(6);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 e from"../../../../../core/PooledArray.js";import{transpose as r,invert as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{set as i}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{debugFlags as o}from"../../../support/debugFlags.js";import{TwoVectorPosition as n}from"../../core/util/TwoVectorPosition.js";import{EdgeDrawParameters as a}from"./EdgeShaderParameters.js";import{EdgeShaderTechnique as l}from"./EdgeShaderTechnique.js";import{EdgeShaderTechniqueConfiguration as d}from"./EdgeShaderTechniqueConfiguration.js";import{isLegacyTransform as h}from"./LegacyTransform.js";import{PrimitiveType as c}from"../../../../webgl/enums.js";const m=8,f=128,g={type:0,hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0};class _{constructor(r,t,s){this.rctx=r,this._techniques=t,this._configuration=new d,this.refCount=0,this._renderables=new Set,this._sortedRenderables={0:{0:new e,1:new e},1:{0:new e,1:new e}},this._renderablesDirty=!1,this._drawParameters=new a,this._settings={...g,...s},this.key=_.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const i=this._settings.strokesTexture.variants;this.writerSettings={variants:i,reducedPrecision:!o.ENABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.type=this._settings.type,this._configuration.silhouette=!1,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.spherical=s.spherical}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,r){this._renderablesDirty&&this._sortRenderables();const t=this._sortedRenderables[r];t[0].forAll(e),t[1].forAll(e)}acquireTechnique(e,r){return this._lastOriginId=null,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.silhouette=r,this._techniques.get(l,this._configuration)}renderRegularEdges(e,r,t,s,i){this._render(e,r,r.regular.vao,t,s,i)}renderSilhouetteEdges(e,r,t,s,i){this._render(e,r,r.silhouette.vao,t,s,i)}get strokesTexture(){return this._settings.strokesTexture}_render(e,r,t,s,i,o){o>0&&(this._bindDraw(e,r,s,i),this.rctx.bindVAO(t),this.rctx.drawArraysInstanced(c.TRIANGLE_FAN,0,4,o))}_bindDraw(e,s,o,a){if(this._drawParameters.componentDataTextureBuffer=s.components.buffer.textureBuffer,h(s.transform)){const{origin:r}=s.transform,t=r.origin.id;this._lastOriginId!==t&&(e.setUniformMatrix4fv("localView",r.viewMatrix),this._lastOriginId=t),e.setUniformMatrix4fv("model",s.transform.modelMatrix),this._drawParameters.slicePlaneLocalOrigin=r.origin.vec3}else{const o=new n(s.transform.position),l=r(u,t(u,s.transform.rotationScale));e.setUniform3fv("transformWorldFromModelTL",o.low),e.setUniform3fv("transformWorldFromModelTH",o.high),e.setUniformMatrix3fv("transformWorldFromModelRS",s.transform.rotationScale),e.setUniformMatrix3fv("transformNormalGlobalFromModel",l);const d=a.camera.viewInverseTransposeMatrix;i(this._drawParameters.slicePlaneLocalOrigin,d[3],d[7],d[11])}e.bindDraw(a,o,this._drawParameters)}_sortRenderables(){this._renderablesDirty=!1,this._sortedRenderables[0][0].clear(),this._sortedRenderables[0][1].clear(),this._sortedRenderables[1][0].clear(),this._sortedRenderables[1][1].clear(),this._renderables.forEach(e=>this._sortedRenderables[e.objectTransparency][e.edgeTransparency].push(e));const e=(e,r)=>h(e.transform)?h(r.transform)?e.transform.origin.origin.id<r.transform.origin.origin.id?-1:e.transform.origin.origin.id>r.transform.origin.origin.id?1:0:1:0;this._sortedRenderables[0][0].sort(e),this._sortedRenderables[0][1].sort(e),this._sortedRenderables[1][0].sort(e),this._sortedRenderables[1][1].sort(e)}static getKey(e,r,t){return`edges-t:${e}:${r}:${t}`}}const u=s();export{_ as EdgeRenderer,f as extensionLengthOffset,m as lineWidthFractionFactor};
2
+ import e from"../../../../../core/PooledArray.js";import{transpose as r,invert as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{set as i}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{debugFlags as o}from"../../../support/debugFlags.js";import{TwoVectorPosition as n}from"../../core/util/TwoVectorPosition.js";import{EdgeDrawParameters as a}from"./EdgeShaderParameters.js";import{EdgeShaderTechnique as l}from"./EdgeShaderTechnique.js";import{EdgeShaderTechniqueConfiguration as d}from"./EdgeShaderTechniqueConfiguration.js";import{isLegacyTransform as h}from"./LegacyTransform.js";import{PrimitiveType as c}from"../../../../webgl/enums.js";const m=8,f=128,g={type:0,hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0};class _{constructor(r,t,s){this.rctx=r,this._techniques=t,this._configuration=new d,this.refCount=0,this._renderables=new Set,this._sortedRenderables={0:{0:new e,1:new e},1:{0:new e,1:new e}},this._renderablesDirty=!1,this._drawParameters=new a,this._settings={...g,...s},this.key=_.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const i=this._settings.strokesTexture.variants;this.writerSettings={variants:i,reducedPrecision:!o.ENABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.type=this._settings.type,this._configuration.silhouette=!1,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.spherical=s.spherical}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,r){this._renderablesDirty&&this._sortRenderables();const t=this._sortedRenderables[r];t[0].forAll(e),t[1].forAll(e)}acquireTechnique(e,r){return this._lastOriginId=null,this._configuration.silhouette=r,this._techniques.get(l,this._configuration)}renderRegularEdges(e,r,t,s,i){this._render(e,r,r.regular.vao,t,s,i)}renderSilhouetteEdges(e,r,t,s,i){this._render(e,r,r.silhouette.vao,t,s,i)}get strokesTexture(){return this._settings.strokesTexture}_render(e,r,t,s,i,o){o>0&&(this._bindDraw(e,r,s,i),this.rctx.bindVAO(t),this.rctx.drawArraysInstanced(c.TRIANGLE_FAN,0,4,o))}_bindDraw(e,s,o,a){if(this._drawParameters.componentDataTextureBuffer=s.components.buffer.textureBuffer,h(s.transform)){const{origin:r}=s.transform,t=r.origin.id;this._lastOriginId!==t&&(e.setUniformMatrix4fv("localView",r.viewMatrix),this._lastOriginId=t),e.setUniformMatrix4fv("model",s.transform.modelMatrix),this._drawParameters.slicePlaneLocalOrigin=r.origin.vec3}else{const o=new n(s.transform.position),l=r(u,t(u,s.transform.rotationScale));e.setUniform3fv("transformWorldFromModelTL",o.low),e.setUniform3fv("transformWorldFromModelTH",o.high),e.setUniformMatrix3fv("transformWorldFromModelRS",s.transform.rotationScale),e.setUniformMatrix3fv("transformNormalGlobalFromModel",l);const d=a.camera.viewInverseTransposeMatrix;i(this._drawParameters.slicePlaneLocalOrigin,d[3],d[7],d[11])}e.bindDraw(a,o,this._drawParameters)}_sortRenderables(){this._renderablesDirty=!1,this._sortedRenderables[0][0].clear(),this._sortedRenderables[0][1].clear(),this._sortedRenderables[1][0].clear(),this._sortedRenderables[1][1].clear(),this._renderables.forEach(e=>this._sortedRenderables[e.objectTransparency][e.edgeTransparency].push(e));const e=(e,r)=>h(e.transform)?h(r.transform)?e.transform.origin.origin.id<r.transform.origin.origin.id?-1:e.transform.origin.origin.id>r.transform.origin.origin.id?1:0:1:0;this._sortedRenderables[0][0].sort(e),this._sortedRenderables[0][1].sort(e),this._sortedRenderables[1][0].sort(e),this._sortedRenderables[1][1].sort(e)}static getKey(e,r,t){return`edges-t:${e}:${r}:${t}`}}const u=s();export{_ as EdgeRenderer,f as extensionLengthOffset,m as lineWidthFractionFactor};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../core/shaderLibrary/Slice.glsl.js";import"../../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../../core/shaderModules/Float2BindUniform.js";import"../../core/shaderModules/Float4BindUniform.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/glsl.js";import"../../shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js";import"../../shaders/sources/edgeRenderer/DiscardNonSilhouetteEdges.glsl.js";import"../../shaders/sources/edgeRenderer/DistanceFalloff.glsl.js";import"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import"../../shaders/sources/edgeRenderer/LineAmplitude.glsl.js";import"../../shaders/sources/edgeRenderer/LineOffset.glsl.js";import"../../shaders/sources/edgeRenderer/UnpackAttributes.glsl.js";import"../../../../webgl/ShaderBuilder.js";import"../../../../webgl/Uniform.js";export{b as build}from"../../../../../chunks/EdgeShader.glsl.js";
2
+ import"../../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../core/shaderLibrary/Slice.glsl.js";import"../../core/shaderModules/Float2BindUniform.js";import"../../core/shaderModules/Float4BindUniform.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/glsl.js";import"../../shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js";import"../../shaders/sources/edgeRenderer/DiscardNonSilhouetteEdges.glsl.js";import"../../shaders/sources/edgeRenderer/DistanceFalloff.glsl.js";import"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import"../../shaders/sources/edgeRenderer/LineAmplitude.glsl.js";import"../../shaders/sources/edgeRenderer/LineOffset.glsl.js";import"../../shaders/sources/edgeRenderer/UnpackAttributes.glsl.js";import"../../../../webgl/ShaderBuilder.js";import"../../../../webgl/Uniform.js";export{b as build}from"../../../../../chunks/EdgeShader.glsl.js";
@@ -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 e}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../../materials/DefaultTechniqueConfiguration.js";class i extends o{constructor(){super(...arguments),this.type=0,this.silhouette=!1,this.legacy=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.spherical=!1,this.occlusionPass=!1,this.normalType=1}}t([e({count:3})],i.prototype,"type",void 0),t([e()],i.prototype,"silhouette",void 0),t([e()],i.prototype,"legacy",void 0),t([e()],i.prototype,"terrainDepthTest",void 0),t([e()],i.prototype,"cullAboveTerrain",void 0),t([e()],i.prototype,"spherical",void 0);export{i as EdgeShaderTechniqueConfiguration};
2
+ import{__decorate as t}from"tslib";import{parameter as o}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as e}from"../../materials/DefaultTechniqueConfiguration.js";class i extends e{constructor(){super(...arguments),this.type=0,this.silhouette=!1,this.legacy=!1,this.spherical=!1,this.occlusionPass=!1,this.normalType=1}}t([o({count:3})],i.prototype,"type",void 0),t([o()],i.prototype,"silhouette",void 0),t([o()],i.prototype,"legacy",void 0),t([o()],i.prototype,"spherical",void 0);export{i as EdgeShaderTechniqueConfiguration};
@@ -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 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=4}}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],[8,r=>e(r)&&this.transparent&&!this.parameters.writeDepth]])}updateConfiguration(r){super.updateConfiguration(r),this._configuration.writeDepth=this.parameters.writeDepth}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=4}}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{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrOLID as e,isDepth as r,is2DGeometryOutput as s,isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import a from"../lib/GLMaterial.js";import{DefaultBufferWriter as o}from"./DefaultBufferWriter.js";import{TriangleMaterial as n}from"./TriangleMaterial.js";import{VisualVariablePassParameters as h}from"./VisualVariablePassParameters.js";import{getLayout as p,ColorMaterialTechnique as u}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as c}from"../shaders/ColorMaterialTechniqueConfiguration.js";import{alphaCutoff as l}from"../../../../webscene/support/AlphaCutoff.js";class m extends n{constructor(t){super(t,g),this._configuration=new c,this.supportsEdges=!0,this.produces=new Map([[2,t=>this._isOpaqueMaterialPass(t)],[3,t=>this._isOpaqueNoSSAODepthPass(t)],[4,t=>e(t)&&this.transparent&&this.parameters.writeDepth],[5,t=>r(t)&&this.transparent&&this.parameters.writeDepth],[9,t=>e(t)&&this.transparent&&!this.parameters.writeDepth],[19,t=>s(t)]])}updateConfiguration(t){super.updateConfiguration(t),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.discardInvisibleFragments=this.transparent&&!this._isOpaquePass(t.output)&&this.parameters.discardInvisibleFragments,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=t.hasOccludees,this._configuration.terrainDepthTest=t.terrainDepthTest&&i(t.output),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.draped=this.parameters.draped,this._configuration.emissionSource=this.hasEmissions?1:0}get visible(){return this.parameters.color[3]>=l}get transparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}get hasEmissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}_isOpaquePass(t){return i(t)||this._isOpaqueMaterialPass(t)||this._isOpaqueNoSSAODepthPass(t)}_isOpaqueMaterialPass(t){return 10===t||e(t)&&!this.transparent}_isOpaqueNoSSAODepthPass(t){return r(t)&&this.parameters.writeDepth&&!this.transparent}createGLMaterial(t){return new f(t)}createBufferWriter(){return new o(p(this.parameters))}}class f extends a{beginSlot(t){return this.getTechnique(u,t)}}class g extends h{constructor(){super(...arguments),this.color=t,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasVertexColors=!1,this.polygonOffset=0,this.hasSlicePlane=!1,this.cullFace=0,this.draped=!1,this.discardInvisibleFragments=!1,this.emissiveStrength=0,this.useIndexing=!1}}export{m as ColorMaterial,g as Parameters};
2
+ import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColorOrOLID as s,isDepth as e,is2DGeometryOutput as r,isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import a from"../lib/GLMaterial.js";import{DefaultBufferWriter as o}from"./DefaultBufferWriter.js";import{TriangleMaterial as n}from"./TriangleMaterial.js";import{VisualVariablePassParameters as h}from"./VisualVariablePassParameters.js";import{getLayout as p,ColorMaterialTechnique as u}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as c}from"../shaders/ColorMaterialTechniqueConfiguration.js";import{alphaCutoff as l}from"../../../../webscene/support/AlphaCutoff.js";class m extends n{constructor(t){super(t,d),this._configuration=new c,this.supportsEdges=!0,this.produces=new Map([[2,t=>this._isOpaqueMaterialPass(t)],[3,t=>this._isOpaqueNoSSAODepthPass(t)],[4,t=>s(t)&&this.transparent&&this.parameters.writeDepth],[5,t=>e(t)&&this.transparent&&this.parameters.writeDepth],[8,t=>s(t)&&this.transparent&&!this.parameters.writeDepth],[18,t=>r(t)]])}updateConfiguration(t){super.updateConfiguration(t),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.discardInvisibleFragments=this.transparent&&!this._isOpaquePass(t.output)&&this.parameters.discardInvisibleFragments,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=t.hasOccludees,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.draped=this.parameters.draped,this._configuration.emissionSource=this.hasEmissions?1:0}get visible(){return this.parameters.color[3]>=l}get transparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}get hasEmissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}_isOpaquePass(t){return i(t)||this._isOpaqueMaterialPass(t)||this._isOpaqueNoSSAODepthPass(t)}_isOpaqueMaterialPass(t){return 10===t||s(t)&&!this.transparent}_isOpaqueNoSSAODepthPass(t){return e(t)&&this.parameters.writeDepth&&!this.transparent}createGLMaterial(t){return new f(t)}createBufferWriter(){return new o(p(this.parameters))}}class f extends a{beginSlot(t){return this.getTechnique(u,t)}}class d extends h{constructor(){super(...arguments),this.color=t,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasVertexColors=!1,this.polygonOffset=0,this.hasSlicePlane=!1,this.cullFace=0,this.draped=!1,this.discardInvisibleFragments=!1,this.emissiveStrength=0,this.useIndexing=!1}}export{m as ColorMaterial,d 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 h,fromValues as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOrShadowLike as m,isColor as p}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as d}from"../lib/GLTextureMaterial.js";import{Material as f}from"../lib/Material.js";import{intersectTriangleGeometry as T}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as x}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as g}from"./DefaultBufferWriter.js";import{intersectWithPolygonOffset as v}from"./PolygonOffset.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 w}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as C}from"../shaders/RealisticTreeTechnique.js";import{hasShadowHighlights as y}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class D extends f{constructor(e,t){super(e,j),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>m(e)&&!this.transparent],[4,e=>m(e)&&this.transparent&&this.parameters.writeDepth],[9,e=>m(e)&&this.transparent&&!this.parameters.writeDepth]]),this._layout=b(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)?this.transparent?2:1:0}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,p(e.output)?(r.terrainDepthTest=e.terrainDepthTest,r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=y(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&null!=e.globalIllumination):(r.terrainDepthTest=!1,r.receiveShadows=r.hasShadowHighlights=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,h,c,m,p){if(null!=this.parameters.verticalOffset){const e=h.camera;t(z,u[12],u[13],u[14]);let p=null;switch(h.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=S(e,f,this.parameters.verticalOffset,x??0,this.parameters.screenSizePerspective,null);o(p,p,g),l(N,p,h.transform.inverseRotation),c=i(A,c,N),m=i(V,m,N)}p=v(p,this._configuration,c,m),T(e,h,c,m,x(h.verticalOffset),p)}createGLMaterial(e){return new P(e)}createBufferWriter(){return new g(this._layout)}get transparent(){return I(this.parameters)}}class P extends d{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?C:O,e)}}class j 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 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=h(),V=h(),_=c(0,0,1),B=h(),N=h(),z=h(),F=h();export{P as DefaultGLMaterial,D as DefaultMaterial,j as DefaultMaterialParameters,I 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 h,fromValues as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOrShadowLike as m,isColor as p}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as d}from"../lib/GLTextureMaterial.js";import{Material as f}from"../lib/Material.js";import{intersectTriangleGeometry as x}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as T}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as g}from"./DefaultBufferWriter.js";import{intersectWithPolygonOffset as v}from"./PolygonOffset.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 w}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as C}from"../shaders/RealisticTreeTechnique.js";import{hasShadowHighlights as y}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class P extends f{constructor(e,t){super(e,I),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>m(e)&&!this.transparent],[4,e=>m(e)&&this.transparent&&this.parameters.writeDepth],[8,e=>m(e)&&this.transparent&&!this.parameters.writeDepth]]),this._layout=b(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)?this.transparent?2:1:0}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.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,p(e.output)?(r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=y(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&null!=e.globalIllumination):r.receiveShadows=r.hasShadowHighlights=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,h,c,m,p){if(null!=this.parameters.verticalOffset){const e=h.camera;t(z,u[12],u[13],u[14]);let p=null;switch(h.viewingMode){case 1:p=s(B,z);break;case 2:p=r(B,_)}const d=i(F,z,e.eye),f=a(d),x=o(d,d,1/f);let T=null;this.parameters.screenSizePerspective&&(T=n(p,x));const g=S(e,f,this.parameters.verticalOffset,T??0,this.parameters.screenSizePerspective,null);o(p,p,g),l(N,p,h.transform.inverseRotation),c=i(A,c,N),m=i(V,m,N)}p=v(p,this._configuration,c,m),x(e,h,c,m,T(h.verticalOffset),p)}createGLMaterial(e){return new j(e)}createBufferWriter(){return new g(this._layout)}get transparent(){return D(this.parameters)}}class j extends d{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?C:O,e)}}class I 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 D(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=h(),V=h(),_=c(0,0,1),B=h(),N=h(),z=h(),F=h();export{j as DefaultGLMaterial,P as DefaultMaterial,I as DefaultMaterialParameters,D as isTransparent};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ONES as l,fromValues as c,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as u,transformMat4 as f,normalize as h,subtract as m,scale as d,transformMat3 as g,scaleAndAdd as b,copy as v,length as x,distance as S,sub as O,dot as z}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y,fromValues as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as P,ONES as C,create as j}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as D}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as A}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as R}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as w}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as M,isColor as T,isOIT as F}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as U}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as _,GLTextureMaterial as L}from"../lib/GLTextureMaterial.js";import{Material as B}from"../lib/Material.js";import{SeparateScreenSizePerspectiveEvaluators as I}from"../lib/screenSizePerspectiveUtils.js";import{assert as E}from"../lib/Util.js";import{writePosition as W,writeNormal as H,writeColor as N,writeBufferVec2 as G,writeBufferFloat as q,writeBufferVec3 as X,writeBufferZeros as Y,writeBufferVec4 as k,writeOlidColor as J}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as K}from"./internal/MaterialUtil.js";import{a as Q}from"../../../../chunks/HUDMaterial.glsl.js";import{baseLayout as Z,getInstanceLayout as $,HUDMaterialTechnique as ee}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as te}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as se}from"../../../../webscene/support/AlphaCutoff.js";class re extends B{constructor(e,t,s=!1){super(e,Ce),this.produces=new Map([[13,e=>M(e)&&!this.parameters.drawAsLabel&&!this._configuration.transparentOccluded],[14,e=>M(e)&&!this.parameters.drawAsLabel&&this._configuration.transparentOccluded],[15,e=>M(e)&&this.parameters.drawAsLabel],[19,e=>this.parameters.draped&&M(e)]]),this._visible=!0,this._configuration=new te(t,s)}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:s}=this,r=t.draped;s.enableOITOffset=e.enableOITOffset,s.hasSlicePlane=this.parameters.hasSlicePlane,s.hasVerticalOffset=!!this.parameters.verticalOffset,s.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,s.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,s.polygonOffset=this.parameters.polygonOffset,s.draped=r,s.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,s.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,s.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,s.hasRotation=this.parameters.hasRotation,s.hasVVSize=!!this.parameters.vvSize,s.hasVVColor=!!this.parameters.vvColor,s.occludedFragmentFade=!r&&!!this.parameters.occludedFragmentOpacity,s.hasFocusAreaStyle=null!=this.parameters.focusAreaStyle,s.depthTestEnabled=this.parameters.depthEnabled,s.hasVertexColor=this.parameters.hasVertexColor,s.hasVertexSize=this.parameters.hasVertexSize,s.hasVertexRotation=this.parameters.hasVertexRotation,s.hasVertexUVi=this.parameters.hasVertexUVi,s.hasVertexCenterOffset=this.parameters.hasVertexCenterOffset,T(e.output)&&(s.debugDrawLabelBorder=!!w.LABELS_SHOW_BORDER),s.terrainDepthTest=e.terrainDepthTest,s.cullAboveTerrain=e.cullAboveTerrain,s.hasOcclusionTexture=!t.drawAsLabel&&s.transparentOccluded&&F(e.output)}intersect(e,t,r,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:p},point:O,camera:z}=r,{parameters:V}=this;if(!l||!c||p&&V.isLabel||!e.visible||!O||!z)return;const C=e.attributes.get("featureAttribute"),j=null==C?null:P(C.data,Se),{scaleX:D,scaleY:A}=De(j,V,z.pixelRatio),R=e.attributes.get("position"),w=e.attributes.get("size"),M=e.attributes.get("normal"),T=e.attributes.get("rotation"),F=e.attributes.get("centerOffset"),U=this.parameters.size;E(R.size>=3);const _="screen"===this.parameters.centerOffsetUnits;for(let P=0;P<R.data.length/R.size;P++){const e=P*R.size;if(u(ce,R.data[e],R.data[e+1],R.data[e+2]),f(ce,ce,t),f(ce,ce,z.viewMatrix),F){const e=P*F.size;u(ve,F.data[e],F.data[e+1],F.data[e+2])}else u(ve,0,0,0);if(!_&&(ce[0]+=ve[0],ce[1]+=ve[1],0!==ve[2])){const e=ve[2];h(ve,ce),m(ce,ce,d(ve,ve,e))}const a=P*M.size;u(pe,M.data[a],M.data[a+1],M.data[a+2]),g(pe,pe,s(ge,t));const{normal:n,cosAngle:l}=ne(pe,z,Oe),c=Re(this.parameters,ce,l,z,le);if(b(ce,ce,n,c),z.applyProjection(ce,ue),ue[0]>-1){if(_&&(ve[0]||ve[1])&&(ue[0]+=ve[0]*z.pixelRatio,0!==ve[1]&&(ue[1]+=le.alignmentEvaluator.apply(ve[1])*z.pixelRatio),z.unapplyProjection(ue,ce)),ue[0]+=this.parameters.screenOffset[0]*z.pixelRatio,ue[1]+=this.parameters.screenOffset[1]*z.pixelRatio,ue[0]=Math.floor(ue[0]),ue[1]=Math.floor(ue[1]),Ve[0]=U[0],Ve[1]=U[1],null!=w){const e=P*w.size;Ve[0]*=w.data[e],Ve[1]*=w.data[e+1]}le.evaluator.applyVec2(Ve,Ve);const e=ze*z.pixelRatio;let t=0;if(V.textureIsSignedDistanceField){t=Math.min(V.outlineSize,.5*Ve[0])*z.pixelRatio/2}Ve[0]*=D,Ve[1]*=A;const s=V.rotation+(null!=T?T.data[P*T.size]:0),a=Q(V);if(oe(O,ue[0],ue[1],Ve,e,t,s,V,a)){const e=r.ray;if(f(he,ce,i(be,z.viewMatrix)),ue[0]=O[0],ue[1]=O[1],z.unprojectFromRenderScreen(ue,ce)){const t=y();v(t,e.direction);const s=1/x(t);d(t,t,s);o(S(e.origin,ce)*s,t,-1,he)}}}}}intersectDraped(e,t,s,r,i){const a=e.attributes.get("position"),n=e.attributes.get("size"),o=e.attributes.get("rotation"),l=this.parameters,c=l.size,p=e.attributes.get("featureAttribute"),u=null==p?null:P(p.data,Se),{scaleX:f,scaleY:h}=De(u,l,e.screenToWorldRatio),m=ye*e.screenToWorldRatio;for(let d=0;d<a.data.length/a.size;d++){const t=d*a.size,p=a.data[t],u=a.data[t+1];if(Ve[0]=c[0],Ve[1]=c[1],null!=n){const e=d*n.size;Ve[0]*=n.data[e],Ve[1]*=n.data[e+1]}let g=0;if(l.textureIsSignedDistanceField){g=Math.min(l.outlineSize,.5*Ve[0])*e.screenToWorldRatio/2}Ve[0]*=f,Ve[1]*=h;const b=l.rotation+(null!=o?o.data[d*o.size]:0),v=Q(l);oe(s,p,u,Ve,m,g,b,l,v)&&r(i.distance,i.normal,-1)}}createBufferWriter(){return new je(this.parameters)}applyShaderOffsets(e,t,r,i,a,n,o,l){g(fe,r,s(ge,i));const c=ne(fe,o,Oe),p=Ae(x(t),o),u=Re(this.parameters,t,c.cosAngle,o,l);b(t,t,c.normal,u+p),b(e,e,fe,u+p);const f=n+u;this._applyPolygonOffsetView(t,c,f,o,t),this._applyCenterOffsetView(t,a,t)}applyShaderOffsetsNDC(e,t,s,r,i,a){return this._applyCenterOffsetNDC(e,t,r,i),null!=a&&v(a,i),this._applyPolygonOffsetNDC(i,s,r,i),i}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return v(a,t);const c=e(Math.abs(s.cosAngle),.01,1),p=1-Math.sqrt(1-c*c)/c/i.viewport[2];return d(a,t,l>0?p:1/p),a}_applyCenterOffsetView(e,t,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&v(s,e),r&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(h(pe,s),O(s,s,d(pe,pe,t[2])))),s}_applyCenterOffsetNDC(e,t,s,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&v(r,e),i||(r[0]+=t[0]/s.fullWidth*2,r[1]+=t[1]/s.fullHeight*2),r}_applyPolygonOffsetNDC(e,t,s,r){const i=this.parameters.shaderPolygonOffset;if(e!==r&&v(r,e),i){const e=s.aboveGround?1:-1,a=e*Math.sign(t);r[2]-=(a||e)*i}return r}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:s}=this.parameters,r=e[3]>=se||t>=se&&s[3]>=se;return this._visible&&r}createGLMaterial(e){return new ie(e)}calculateRelativeScreenBounds(e,t,s=D()){return ae(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}}class ie extends L{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(ee,e)}}function ae(e,t,s,r){r[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*s,r[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*s}function ne(e,t,s){return f(s.normal,e,t.viewInverseTransposeMatrix),s.cosAngle=z(s.normal,Pe),s}function oe(e,s,r,i,a,l,c,p,u){let f=s-a-i[0]*u[0],h=f+i[0]+2*a,m=r-a-i[1]*u[1],d=m+i[1]+2*a;const g=p.distanceFieldBoundingBox;return p.textureIsSignedDistanceField&&null!=g&&(f+=i[0]*g[0],m+=i[1]*g[1],h-=i[0]*(1-g[2]),d-=i[1]*(1-g[3]),f-=l,h+=l,m-=l,d+=l),n(de,s,r),o(me,e,de,t(c)),me[0]>f&&me[0]<h&&me[1]>m&&me[1]<d}const le=new I,ce=y(),pe=y(),ue=j(),fe=y(),he=y(),me=p(),de=p(),ge=r(),be=a(),ve=y(),xe=y(),Se=j(),Oe={normal:y(),cosAngle:0},ze=1,ye=2,Ve=c(0,0),Pe=V(0,0,1);class Ce extends _{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=C,this.size=l,this.polygonOffset=0,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=C,this.outlineSize=0,this.distanceFieldBoundingBox=j(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.hasVertexColor=!1,this.hasVertexSize=!1,this.hasVertexRotation=!1,this.hasVertexUVi=!1,this.hasVertexCenterOffset=!1,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.focusAreaStyle=null,this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class je{constructor(e){this.baseInstanceLayout=Z,this.layout=$(e)}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,s,r,i,a){const{position:n,normal:o,color:l,size:c,rotation:p,centerOffset:u,groundDistance:f,featureAttribute:h,uvi:m}=i;W(s.get("position"),e,n,a),H(s.get("normal"),t,o,a);const d=s.get("position").indices.length;if(m){const e=s.get("uvi")?.data;if(e&&e.length>=4){const[t,s,r,i]=e;for(let e=0;e<d;++e){const n=a+e;m.setValues(n,t,s,r,i)}}}if(l&&N(s.get("color"),4,l,a),c&&G(s.get("size"),c,a),p&&q(s.get("rotation"),p,a),u&&(s.get("centerOffset")?X(s.get("centerOffset"),u,a):Y(u,a,d)),s.get("groundDistance")?q(s.get("groundDistance"),f,a):Y(f,a,d),h&&(s.get("featureAttribute")?k(s.get("featureAttribute"),h,a):Y(h,a,d)),null!=r){const e=s.get("position")?.indices;if(e){const t=e.length,s=i.getField("olidColor",A);J(r,s,t,a)}}return{numVerticesPerItem:1,numItems:d}}writeBaseInstance(e,t){const{uv0:s}=t;G(e.get("uv0"),s,0)}}function De(e,t,s){return null==e||null==t.vvSize?{scaleX:s,scaleY:s}:(R(xe,t,e),{scaleX:xe[0]*s,scaleY:xe[1]*s})}function Ae(e,t){const s=t.computeRenderPixelSizeAtDist(e)*U;return(t.aboveGround?1:-1)*s}function Re(e,t,s,r,i){if(!e.verticalOffset?.screenLength){const r=x(t);return i.update(s,r,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const a=x(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=K(r,a,e.verticalOffset,s,n,e.screenSizePerspectiveMinPixelReferenceSize);return i.update(s,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),o}export{re as HUDMaterial,Ce as Parameters};
2
+ import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as i}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{ONES as l,fromValues as c,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as f,transformMat4 as u,normalize as h,subtract as m,scale as d,transformMat3 as g,scaleAndAdd as b,copy as v,length as x,distance as S,sub as O,dot as z}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y,fromValues as V}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as P,ONES as C,create as j}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as D}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as R}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as w}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as A}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as M,isColor as F,isOIT as U}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as _}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as L,GLTextureMaterial as T}from"../lib/GLTextureMaterial.js";import{Material as B}from"../lib/Material.js";import{SeparateScreenSizePerspectiveEvaluators as I}from"../lib/screenSizePerspectiveUtils.js";import{assert as E}from"../lib/Util.js";import{writePosition as W,writeNormal as H,writeColor as N,writeBufferVec2 as G,writeBufferFloat as q,writeBufferVec3 as X,writeBufferZeros as Y,writeBufferVec4 as k,writeOlidColor as J}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as K}from"./internal/MaterialUtil.js";import{a as Q}from"../../../../chunks/HUDMaterial.glsl.js";import{baseLayout as Z,getInstanceLayout as $,HUDMaterialTechnique as ee}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as te}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as se}from"../../../../webscene/support/AlphaCutoff.js";class re extends B{constructor(e,t,s=!1){super(e,Ce),this.produces=new Map([[12,e=>M(e)&&!this.parameters.drawAsLabel&&!this._configuration.transparentOccluded],[13,e=>M(e)&&!this.parameters.drawAsLabel&&this._configuration.transparentOccluded],[14,e=>M(e)&&this.parameters.drawAsLabel],[18,e=>this.parameters.draped&&M(e)]]),this._visible=!0,this._configuration=new te(t,s)}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:s}=this,r=t.draped;s.enableOITOffset=e.enableOITOffset,s.hasSlicePlane=this.parameters.hasSlicePlane,s.hasVerticalOffset=!!this.parameters.verticalOffset,s.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,s.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,s.polygonOffset=this.parameters.polygonOffset,s.draped=r,s.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,s.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,s.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,s.hasRotation=this.parameters.hasRotation,s.hasVVSize=!!this.parameters.vvSize,s.hasVVColor=!!this.parameters.vvColor,s.occludedFragmentFade=!r&&!!this.parameters.occludedFragmentOpacity,s.hasFocusAreaStyle=null!=this.parameters.focusAreaStyle,s.depthTestEnabled=this.parameters.depthEnabled,s.hasVertexColor=this.parameters.hasVertexColor,s.hasVertexSize=this.parameters.hasVertexSize,s.hasVertexRotation=this.parameters.hasVertexRotation,s.hasVertexUVi=this.parameters.hasVertexUVi,s.hasVertexCenterOffset=this.parameters.hasVertexCenterOffset,F(e.output)&&(s.debugDrawLabelBorder=!!A.LABELS_SHOW_BORDER),s.hasOcclusionTexture=!t.drawAsLabel&&s.transparentOccluded&&U(e.output)}intersect(e,t,r,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:p},point:O,camera:z}=r,{parameters:V}=this;if(!l||!c||p&&V.isLabel||!e.visible||!O||!z)return;const C=e.attributes.get("featureAttribute"),j=null==C?null:P(C.data,Se),{scaleX:D,scaleY:R}=De(j,V,z.pixelRatio),w=e.attributes.get("position"),A=e.attributes.get("size"),M=e.attributes.get("normal"),F=e.attributes.get("rotation"),U=e.attributes.get("centerOffset"),_=this.parameters.size;E(w.size>=3);const L="screen"===this.parameters.centerOffsetUnits;for(let P=0;P<w.data.length/w.size;P++){const e=P*w.size;if(f(ce,w.data[e],w.data[e+1],w.data[e+2]),u(ce,ce,t),u(ce,ce,z.viewMatrix),U){const e=P*U.size;f(ve,U.data[e],U.data[e+1],U.data[e+2])}else f(ve,0,0,0);if(!L&&(ce[0]+=ve[0],ce[1]+=ve[1],0!==ve[2])){const e=ve[2];h(ve,ce),m(ce,ce,d(ve,ve,e))}const a=P*M.size;f(pe,M.data[a],M.data[a+1],M.data[a+2]),g(pe,pe,s(ge,t));const{normal:n,cosAngle:l}=ne(pe,z,Oe),c=we(this.parameters,ce,l,z,le);if(b(ce,ce,n,c),z.applyProjection(ce,fe),fe[0]>-1){if(L&&(ve[0]||ve[1])&&(fe[0]+=ve[0]*z.pixelRatio,0!==ve[1]&&(fe[1]+=le.alignmentEvaluator.apply(ve[1])*z.pixelRatio),z.unapplyProjection(fe,ce)),fe[0]+=this.parameters.screenOffset[0]*z.pixelRatio,fe[1]+=this.parameters.screenOffset[1]*z.pixelRatio,fe[0]=Math.floor(fe[0]),fe[1]=Math.floor(fe[1]),Ve[0]=_[0],Ve[1]=_[1],null!=A){const e=P*A.size;Ve[0]*=A.data[e],Ve[1]*=A.data[e+1]}le.evaluator.applyVec2(Ve,Ve);const e=ze*z.pixelRatio;let t=0;if(V.textureIsSignedDistanceField){t=Math.min(V.outlineSize,.5*Ve[0])*z.pixelRatio/2}Ve[0]*=D,Ve[1]*=R;const s=V.rotation+(null!=F?F.data[P*F.size]:0),a=Q(V);if(oe(O,fe[0],fe[1],Ve,e,t,s,V,a)){const e=r.ray;if(u(he,ce,i(be,z.viewMatrix)),fe[0]=O[0],fe[1]=O[1],z.unprojectFromRenderScreen(fe,ce)){const t=y();v(t,e.direction);const s=1/x(t);d(t,t,s);o(S(e.origin,ce)*s,t,-1,he)}}}}}intersectDraped(e,t,s,r,i){const a=e.attributes.get("position"),n=e.attributes.get("size"),o=e.attributes.get("rotation"),l=this.parameters,c=l.size,p=e.attributes.get("featureAttribute"),f=null==p?null:P(p.data,Se),{scaleX:u,scaleY:h}=De(f,l,e.screenToWorldRatio),m=ye*e.screenToWorldRatio;for(let d=0;d<a.data.length/a.size;d++){const t=d*a.size,p=a.data[t],f=a.data[t+1];if(Ve[0]=c[0],Ve[1]=c[1],null!=n){const e=d*n.size;Ve[0]*=n.data[e],Ve[1]*=n.data[e+1]}let g=0;if(l.textureIsSignedDistanceField){g=Math.min(l.outlineSize,.5*Ve[0])*e.screenToWorldRatio/2}Ve[0]*=u,Ve[1]*=h;const b=l.rotation+(null!=o?o.data[d*o.size]:0),v=Q(l);oe(s,p,f,Ve,m,g,b,l,v)&&r(i.distance,i.normal,-1)}}createBufferWriter(){return new je(this.parameters)}applyShaderOffsets(e,t,r,i,a,n,o,l){g(ue,r,s(ge,i));const c=ne(ue,o,Oe),p=Re(x(t),o),f=we(this.parameters,t,c.cosAngle,o,l);b(t,t,c.normal,f+p),b(e,e,ue,f+p);const u=n+f;this._applyPolygonOffsetView(t,c,u,o,t),this._applyCenterOffsetView(t,a,t)}applyShaderOffsetsNDC(e,t,s,r,i,a){return this._applyCenterOffsetNDC(e,t,r,i),null!=a&&v(a,i),this._applyPolygonOffsetNDC(i,s,r,i),i}_applyPolygonOffsetView(t,s,r,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(r);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return v(a,t);const c=e(Math.abs(s.cosAngle),.01,1),p=1-Math.sqrt(1-c*c)/c/i.viewport[2];return d(a,t,l>0?p:1/p),a}_applyCenterOffsetView(e,t,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&v(s,e),r&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(h(pe,s),O(s,s,d(pe,pe,t[2])))),s}_applyCenterOffsetNDC(e,t,s,r){const i="screen"!==this.parameters.centerOffsetUnits;return r!==e&&v(r,e),i||(r[0]+=t[0]/s.fullWidth*2,r[1]+=t[1]/s.fullHeight*2),r}_applyPolygonOffsetNDC(e,t,s,r){const i=this.parameters.shaderPolygonOffset;if(e!==r&&v(r,e),i){const e=s.aboveGround?1:-1,a=e*Math.sign(t);r[2]-=(a||e)*i}return r}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:s}=this.parameters,r=e[3]>=se||t>=se&&s[3]>=se;return this._visible&&r}createGLMaterial(e){return new ie(e)}calculateRelativeScreenBounds(e,t,s=D()){return ae(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}}class ie extends T{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(ee,e)}}function ae(e,t,s,r){r[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*s,r[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*s}function ne(e,t,s){return u(s.normal,e,t.viewInverseTransposeMatrix),s.cosAngle=z(s.normal,Pe),s}function oe(e,s,r,i,a,l,c,p,f){let u=s-a-i[0]*f[0],h=u+i[0]+2*a,m=r-a-i[1]*f[1],d=m+i[1]+2*a;const g=p.distanceFieldBoundingBox;return p.textureIsSignedDistanceField&&null!=g&&(u+=i[0]*g[0],m+=i[1]*g[1],h-=i[0]*(1-g[2]),d-=i[1]*(1-g[3]),u-=l,h+=l,m-=l,d+=l),n(de,s,r),o(me,e,de,t(c)),me[0]>u&&me[0]<h&&me[1]>m&&me[1]<d}const le=new I,ce=y(),pe=y(),fe=j(),ue=y(),he=y(),me=p(),de=p(),ge=r(),be=a(),ve=y(),xe=y(),Se=j(),Oe={normal:y(),cosAngle:0},ze=1,ye=2,Ve=c(0,0),Pe=V(0,0,1);class Ce extends L{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1,this.color=C,this.size=l,this.polygonOffset=0,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=C,this.outlineSize=0,this.distanceFieldBoundingBox=j(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.hasVertexColor=!1,this.hasVertexSize=!1,this.hasVertexRotation=!1,this.hasVertexUVi=!1,this.hasVertexCenterOffset=!1,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.focusAreaStyle=null,this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class je{constructor(e){this.baseInstanceLayout=Z,this.layout=$(e)}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,s,r,i,a){const{position:n,normal:o,color:l,size:c,rotation:p,centerOffset:f,groundDistance:u,featureAttribute:h,uvi:m}=i;W(s.get("position"),e,n,a),H(s.get("normal"),t,o,a);const d=s.get("position").indices.length;if(m){const e=s.get("uvi")?.data;if(e&&e.length>=4){const[t,s,r,i]=e;for(let e=0;e<d;++e){const n=a+e;m.setValues(n,t,s,r,i)}}}if(l&&N(s.get("color"),4,l,a),c&&G(s.get("size"),c,a),p&&q(s.get("rotation"),p,a),f&&(s.get("centerOffset")?X(s.get("centerOffset"),f,a):Y(f,a,d)),s.get("groundDistance")?q(s.get("groundDistance"),u,a):Y(u,a,d),h&&(s.get("featureAttribute")?k(s.get("featureAttribute"),h,a):Y(h,a,d)),null!=r){const e=s.get("position")?.indices;if(e){const t=e.length,s=i.getField("olidColor",R);J(r,s,t,a)}}return{numVerticesPerItem:1,numItems:d}}writeBaseInstance(e,t){const{uv0:s}=t;G(e.get("uv0"),s,0)}}function De(e,t,s){return null==e||null==t.vvSize?{scaleX:s,scaleY:s}:(w(xe,t,e),{scaleX:xe[0]*s,scaleY:xe[1]*s})}function Re(e,t){const s=t.computeRenderPixelSizeAtDist(e)*_;return(t.aboveGround?1:-1)*s}function we(e,t,s,r,i){if(!e.verticalOffset?.screenLength){const r=x(t);return i.update(s,r,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),0}const a=x(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=K(r,a,e.verticalOffset,s,n,e.screenSizePerspectiveMinPixelReferenceSize);return i.update(s,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),o}export{re as HUDMaterial,Ce as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isColor as s}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as a}from"../lib/Material.js";import{writePosition as n,writeBufferFloat as o}from"./internal/bufferWriterUtils.js";import{attributeDrivenInstanceLayout as u,instanceLayout as c,HeatmapDensityPassParameters as l,HeatmapDensityTechnique as m,baseLayout as p}from"../shaders/HeatmapDensityTechnique.js";import{HeatmapDensityTechniqueConfiguration as f}from"../shaders/HeatmapDensityTechniqueConfiguration.js";const h=2;class d extends l{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class b extends a{constructor(t){super(t,d),this.visible=!0,this.produces=new Map([[19,t=>s(t)]]),this._configuration=new f}updateConfiguration(t){super.updateConfiguration(t),this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats}createGLMaterial(t){return new g(t)}intersect(){}intersectDraped(r,s,i,a,n){const o=r.attributes.get("position"),{parameters:u}=this,{searchRadius:c}=u,{screenToWorldRatio:l}=r,m=c*l+h*l,p=m*m,f=o.data.length/o.size;for(let h=0;h<f;h++){const r=h*o.size,s=t(v,o.data[r],o.data[r+1]);e(s,i)<p&&a(n.distance,n.normal,-1)}}createBufferWriter(){return new j(this.parameters.isAttributeDriven?u:c)}}class g extends i{beginSlot(t){return this.getTechnique(m,t)}}class j{constructor(t){this.layout=t,this.baseInstanceLayout=p}elementCount(t){return t.get("position").indices.length}elementCountBaseInstance(){return 4}write(t,e,r,s,i,a){n(r.get("position"),t,i.position,a);const u="featureAttribute"in i?i.featureAttribute:null;return u&&o(r.get("featureAttribute"),u,a),null}writeBaseInstance(t,e){const r=e.uv0;r.setValues(0,-1,-1),r.setValues(1,-1,1),r.setValues(2,1,-1),r.setValues(3,1,1)}}const v=r();export{b as HeatmapDensityMaterial,d as Parameters};
2
+ import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isColor as s}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as a}from"../lib/Material.js";import{writePosition as n,writeBufferFloat as o}from"./internal/bufferWriterUtils.js";import{attributeDrivenInstanceLayout as u,instanceLayout as c,HeatmapDensityPassParameters as l,HeatmapDensityTechnique as m,baseLayout as p}from"../shaders/HeatmapDensityTechnique.js";import{HeatmapDensityTechniqueConfiguration as f}from"../shaders/HeatmapDensityTechniqueConfiguration.js";const h=2;class d extends l{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class b extends a{constructor(t){super(t,d),this.visible=!0,this.produces=new Map([[18,t=>s(t)]]),this._configuration=new f}updateConfiguration(t){super.updateConfiguration(t),this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats}createGLMaterial(t){return new g(t)}intersect(){}intersectDraped(r,s,i,a,n){const o=r.attributes.get("position"),{parameters:u}=this,{searchRadius:c}=u,{screenToWorldRatio:l}=r,m=c*l+h*l,p=m*m,f=o.data.length/o.size;for(let h=0;h<f;h++){const r=h*o.size,s=t(v,o.data[r],o.data[r+1]);e(s,i)<p&&a(n.distance,n.normal,-1)}}createBufferWriter(){return new j(this.parameters.isAttributeDriven?u:c)}}class g extends i{beginSlot(t){return this.getTechnique(m,t)}}class j{constructor(t){this.layout=t,this.baseInstanceLayout=p}elementCount(t){return t.get("position").indices.length}elementCountBaseInstance(){return 4}write(t,e,r,s,i,a){n(r.get("position"),t,i.position,a);const u="featureAttribute"in i?i.featureAttribute:null;return u&&o(r.get("featureAttribute"),u,a),null}writeBaseInstance(t,e){const r=e.uv0;r.setValues(0,-1,-1),r.setValues(1,-1,1),r.setValues(2,1,-1),r.setValues(3,1,1)}}const v=r();export{b as HeatmapDensityMaterial,d as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as t,isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{isUpdatableTexture as s}from"../lib/IManagedTexture.js";import{assert as a}from"../lib/Util.js";import{DefaultBufferWriter as o}from"./DefaultBufferWriter.js";import{TriangleMaterialParameters as n,TriangleMaterial as p}from"./TriangleMaterial.js";import{writeBufferFloat as u,writeAttribute as h}from"./internal/bufferWriterUtils.js";import{getLayout as c,ImageMaterialTechnique as l}from"../shaders/ImageMaterialTechnique.js";import{ImageMaterialTechniqueConfiguration as m}from"../shaders/ImageMaterialTechniqueConfiguration.js";class f extends p{constructor(e){super(e,x),this.supportsEdges=!0,this.transparent=!0,this.visible=!0,this.produces=new Map([[2,e=>t(e)],[4,e=>r(e)&&this.parameters.writeDepth],[9,e=>r(e)&&!this.parameters.writeDepth],[19,e=>r(e)||t(e)]]),this._configuration=new m(e.draped)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=e.hasOccludees,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.perspectiveInterpolation=this.parameters.perspectiveInterpolation}createGLMaterial(e){return new d(e)}createBufferWriter(){return new g(c(this.parameters))}}class d extends i{constructor(e){super({...e,...e.material.parameters}),this.parameters=e;const t=this._material.parameters.managedTexture;s(t)&&e.textures.updater.add(t)}dispose(){this.parameters.textures.updater.remove(this._material.parameters.managedTexture)}beginSlot(e){return this.getTechnique(l,e)}}class g extends o{write(t,r,i,s,o,n){for(const p of this.layout.fields.keys()){const s=i.get(p);if(s)if("perspectiveDivide"===p){a(1===s.size);const t=o.getField(p,e);t&&u(s,t,n)}else h(p,s,t,r,o,n)}return null}}class x extends n{constructor(e,t){super(),this.managedTexture=e,this.draped=t,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=0,this.opacity=1,this.perspectiveInterpolation=!1}get texture(){return this.managedTexture.texture}}export{f as ImageMaterial,x as Parameters};
2
+ import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as t,isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{isUpdatableTexture as s}from"../lib/IManagedTexture.js";import{assert as a}from"../lib/Util.js";import{DefaultBufferWriter as o}from"./DefaultBufferWriter.js";import{TriangleMaterialParameters as n,TriangleMaterial as p}from"./TriangleMaterial.js";import{writeBufferFloat as u,writeAttribute as h}from"./internal/bufferWriterUtils.js";import{getLayout as c,ImageMaterialTechnique as l}from"../shaders/ImageMaterialTechnique.js";import{ImageMaterialTechniqueConfiguration as m}from"../shaders/ImageMaterialTechniqueConfiguration.js";class f extends p{constructor(e){super(e,x),this.supportsEdges=!0,this.transparent=!0,this.visible=!0,this.produces=new Map([[2,e=>t(e)],[4,e=>r(e)&&this.parameters.writeDepth],[8,e=>r(e)&&!this.parameters.writeDepth],[18,e=>r(e)||t(e)]]),this._configuration=new m(e.draped)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=e.hasOccludees,this._configuration.perspectiveInterpolation=this.parameters.perspectiveInterpolation}createGLMaterial(e){return new d(e)}createBufferWriter(){return new g(c(this.parameters))}}class d extends i{constructor(e){super({...e,...e.material.parameters}),this.parameters=e;const t=this._material.parameters.managedTexture;s(t)&&e.textures.updater.add(t)}dispose(){this.parameters.textures.updater.remove(this._material.parameters.managedTexture)}beginSlot(e){return this.getTechnique(l,e)}}class g extends o{write(t,r,i,s,o,n){for(const p of this.layout.fields.keys()){const s=i.get(p);if(s)if("perspectiveDivide"===p){a(1===s.size);const t=o.getField(p,e);t&&u(s,t,n)}else h(p,s,t,r,o,n)}return null}}class x extends n{constructor(e,t){super(),this.managedTexture=e,this.draped=t,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=0,this.opacity=1,this.perspectiveInterpolation=!1}get texture(){return this.managedTexture.texture}}export{f as ImageMaterial,x as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as s,MaterialParameters as n}from"../lib/Material.js";import{writeBufferVec2 as a,writePosition as o,writeNormal as c,writeBufferVec3 as l,writeBufferFloat as u}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h,layout as f,baseLayout as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class m extends s{constructor(e,t){super(e,$),this.intersectDraped=void 0,this.produces=new Map([[16,e=>r(e)],[17,e=>r(e)]]),this._configuration=new d(t),this._uniqueMaterialIdentifier=S(this.parameters)}passParameters(){return this.parameters}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=17===e.slot,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.terrainDepthTest=e.terrainDepthTest}get visible(){return this.parameters.color[3]>=g||(this.parameters.borderColor?.[3]??0)>=g}intersect(){}createGLMaterial(e){return new O(e)}createBufferWriter(){return new b}validateParameters(e){this._uniqueMaterialIdentifier=S(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function S({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,shaderPolygonOffset:a,hudDepthAlignStart:o,centerOffsetUnits:c,hasSlicePlane:l,screenSizePerspective:u,verticalOffset:h,borderColor:f}){return e`${t}:${r}:${i}:[${s}]:${n}:${a}:${o}:${c}:${l}:${null!=u}:{${h?.screenLength}:${h?.minWorldLength}:${h?.maxWorldLength}}:[${f}]`}class O extends i{beginSlot(e){return this.getTechnique(h,e)}}class $ extends n{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=t(0,0,0,1),this.size=1,this.shaderPolygonOffset=1e-5,this.hudDepthAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}class b{constructor(){this.layout=f,this.baseInstanceLayout=p}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}writeBaseInstance(e,t){const{uv0:r}=t;a(e.get("uv0"),r,0)}write(e,t,r,i,s,n){return o(r.get("position"),e,s.position,n),c(r.get("normal"),t,s.normal,n),l(r.get("centerOffset"),s.centerOffset,n),u(r.get("groundDistance"),s.groundDistance,n),null}}export{m as LineCalloutMaterial,$ as Parameters,S as uniqueMaterialIdentifier};
2
+ import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{Material as s,MaterialParameters as n}from"../lib/Material.js";import{writeBufferVec2 as a,writePosition as o,writeNormal as l,writeBufferVec3 as c,writeBufferFloat as u}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h,layout as f,baseLayout as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class m extends s{constructor(e,t){super(e,$),this.intersectDraped=void 0,this.produces=new Map([[15,e=>r(e)],[16,e=>r(e)]]),this._configuration=new d(t),this._uniqueMaterialIdentifier=S(this.parameters)}passParameters(){return this.parameters}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=16===e.slot,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane}get visible(){return this.parameters.color[3]>=g||(this.parameters.borderColor?.[3]??0)>=g}intersect(){}createGLMaterial(e){return new O(e)}createBufferWriter(){return new b}validateParameters(e){this._uniqueMaterialIdentifier=S(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function S({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,shaderPolygonOffset:a,hudDepthAlignStart:o,centerOffsetUnits:l,hasSlicePlane:c,screenSizePerspective:u,verticalOffset:h,borderColor:f}){return e`${t}:${r}:${i}:[${s}]:${n}:${a}:${o}:${l}:${c}:${null!=u}:{${h?.screenLength}:${h?.minWorldLength}:${h?.maxWorldLength}}:[${f}]`}class O extends i{beginSlot(e){return this.getTechnique(h,e)}}class $ extends n{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=t(0,0,0,1),this.size=1,this.shaderPolygonOffset=1e-5,this.hudDepthAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}class b{constructor(){this.layout=f,this.baseInstanceLayout=p}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}writeBaseInstance(e,t){const{uv0:r}=t;a(e.get("uv0"),r,0)}write(e,t,r,i,s,n){return o(r.get("position"),e,s.position,n),l(r.get("normal"),t,s.normal,n),c(r.get("centerOffset"),s.centerOffset,n),u(r.get("groundDistance"),s.groundDistance,n),null}}export{m as LineCalloutMaterial,$ as Parameters,S as uniqueMaterialIdentifier};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeFloat16Array as a}from"../../../../geometry/support/float16.js";import{isColor as s,isDepth as o,isColorHighlightOLIDOrDepth as h}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{Material as c}from"../lib/Material.js";import{VisualVariablePassParameters as p}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as l}from"./internal/bufferWriterUtils.js";import{getLayout as m,LineMarkerTechnique as u}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as d}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as f}from"../../../../webscene/support/AlphaCutoff.js";class g extends c{constructor(e,t){super(e,v),this.produces=new Map([[2,e=>10===e||s(e)&&8===this.parameters.renderOccluded],[3,e=>o(e)],[11,e=>h(e)&&8===this.parameters.renderOccluded],[12,e=>h(e)&&8===this.parameters.renderOccluded],[4,e=>s(e)&&this.parameters.writeDepth],[9,e=>s(e)&&!this.parameters.writeDepth],[19,e=>s(e)||10===e]]),this.intersectDraped=void 0,this._configuration=new d(t)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.space=19===e.slot?0:this.parameters.worldSpace?2:1,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=0!==this.parameters.cap,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=e.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.terrainDepthTest=e.terrainDepthTest&&s(e.output),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective}get visible(){return this.parameters.color[3]>=f}intersect(){}createBufferWriter(){return new S(m(this.parameters),this.parameters)}createGLMaterial(e){return new _(e)}}class _ extends n{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(u,e)}}class v extends p{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=0,this.anchor=0,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class S{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,s,o,h,n,c){const p=o.get("position").data,m=p.length/3;let u=[1,0,0];const d=o.get("normal");this._parameters.worldSpace&&null!=d&&(u=d.data);let f=1,g=0;this._parameters.vvSize?g=o.get("sizeFeatureAttribute").data[0]:o.has("size")&&(f=o.get("size").data[0]);let _=[1,1,1,1],v=0;this._parameters.vvColor?v=o.get("colorFeatureAttribute").data[0]:o.has("color")&&(_=o.get("color").data);let S=0;this._parameters.vvOpacity&&(S=o.get("opacityFeatureAttribute").data[0]);const P=new Float32Array(n.buffer),T=a(n.buffer),O=new Uint8Array(n.buffer);let V=c*(this.layout.stride/4);const k=P.BYTES_PER_ELEMENT/T.BYTES_PER_ELEMENT,j=4/k,y=(e,t,r,i)=>{P[V++]=e[0],P[V++]=e[1],P[V++]=e[2],l(t,e,T,V*k),V+=j;let a=V*k;if(T[a++]=r[0],T[a++]=r[1],V=Math.ceil(a/k),this._parameters.vvColor)P[V++]=v;else{const e=Math.min(4*i,_.length-4),t=4*V++;O[t]=255*_[e],O[t+1]=255*_[e+1],O[t+2]=255*_[e+2],O[t+3]=255*_[e+3]}this._parameters.vvOpacity&&(P[V++]=S),a=V*k,this._parameters.vvSize?(P[V++]=g,a+=2):T[a++]=f,this._parameters.worldSpace&&(T[a++]=u[0],T[a++]=u[1],T[a++]=u[2]),V=Math.ceil(a/k)},M=(a,s)=>{const o=e(b,p[3*a],p[3*a+1],p[3*a+2]),h=w;let n=a+s;do{e(h,p[3*n],p[3*n+1],p[3*n+2]),n+=s}while(t(o,h)&&n>=0&&n<m);i&&(r(o,o,i),r(h,h,i)),y(o,h,[-1,-1],a),y(o,h,[1,-1],a),y(o,h,[1,1],a),y(o,h,[-1,-1],a),y(o,h,[1,1],a),y(o,h,[-1,1],a)},x=this._parameters.placement;return"begin"!==x&&"begin-end"!==x||M(0,1),"end"!==x&&"begin-end"!==x||M(m-1,-1),null}}const b=i(),w=i();export{g as LineMarkerMaterial,v as Parameters};
2
+ import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeFloat16Array as s}from"../../../../geometry/support/float16.js";import{isColor as a,isDepth as o,isColorHighlightOLIDOrDepth as h}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{Material as c}from"../lib/Material.js";import{VisualVariablePassParameters as p}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as m}from"./internal/bufferWriterUtils.js";import{getLayout as l,LineMarkerTechnique as u}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as d}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as f}from"../../../../webscene/support/AlphaCutoff.js";class g extends c{constructor(e,t){super(e,v),this.produces=new Map([[2,e=>10===e||a(e)&&8===this.parameters.renderOccluded],[3,e=>o(e)],[10,e=>h(e)&&8===this.parameters.renderOccluded],[11,e=>h(e)&&8===this.parameters.renderOccluded],[4,e=>a(e)&&this.parameters.writeDepth],[8,e=>a(e)&&!this.parameters.writeDepth],[18,e=>a(e)||10===e]]),this.intersectDraped=void 0,this._configuration=new d(t)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.space=18===e.slot?0:this.parameters.worldSpace?2:1,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=0!==this.parameters.cap,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=e.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective}get visible(){return this.parameters.color[3]>=f}intersect(){}createBufferWriter(){return new S(l(this.parameters),this.parameters)}createGLMaterial(e){return new _(e)}}class _ extends n{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(u,e)}}class v extends p{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=0,this.anchor=0,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class S{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,a,o,h,n,c){const p=o.get("position").data,l=p.length/3;let u=[1,0,0];const d=o.get("normal");this._parameters.worldSpace&&null!=d&&(u=d.data);let f=1,g=0;this._parameters.vvSize?g=o.get("sizeFeatureAttribute").data[0]:o.has("size")&&(f=o.get("size").data[0]);let _=[1,1,1,1],v=0;this._parameters.vvColor?v=o.get("colorFeatureAttribute").data[0]:o.has("color")&&(_=o.get("color").data);let S=0;this._parameters.vvOpacity&&(S=o.get("opacityFeatureAttribute").data[0]);const P=new Float32Array(n.buffer),O=s(n.buffer),T=new Uint8Array(n.buffer);let V=c*(this.layout.stride/4);const k=P.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,j=4/k,y=(e,t,r,i)=>{P[V++]=e[0],P[V++]=e[1],P[V++]=e[2],m(t,e,O,V*k),V+=j;let s=V*k;if(O[s++]=r[0],O[s++]=r[1],V=Math.ceil(s/k),this._parameters.vvColor)P[V++]=v;else{const e=Math.min(4*i,_.length-4),t=4*V++;T[t]=255*_[e],T[t+1]=255*_[e+1],T[t+2]=255*_[e+2],T[t+3]=255*_[e+3]}this._parameters.vvOpacity&&(P[V++]=S),s=V*k,this._parameters.vvSize?(P[V++]=g,s+=2):O[s++]=f,this._parameters.worldSpace&&(O[s++]=u[0],O[s++]=u[1],O[s++]=u[2]),V=Math.ceil(s/k)},M=(s,a)=>{const o=e(w,p[3*s],p[3*s+1],p[3*s+2]),h=b;let n=s+a;do{e(h,p[3*n],p[3*n+1],p[3*n+2]),n+=a}while(t(o,h)&&n>=0&&n<l);i&&(r(o,o,i),r(h,h,i)),y(o,h,[-1,-1],s),y(o,h,[1,-1],s),y(o,h,[1,1],s),y(o,h,[-1,-1],s),y(o,h,[1,1],s),y(o,h,[-1,1],s)},x=this._parameters.placement;return"begin"!==x&&"begin-end"!==x||M(0,1),"end"!==x&&"begin-end"!==x||M(l-1,-1),null}}const w=i(),b=i();export{g as LineMarkerMaterial,v as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{set as t,normalize as e,subtract as r,cross as s,distance as o,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as c}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as u,MaterialParameters as p}from"../lib/Material.js";import{MeasurementArrowTechnique as h,layout as f}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as m}from"../shaders/MeasurementArrowTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class g extends u{constructor(t){super(t,b),this._configuration=new m,this.intersectDraped=void 0,this.produces=new Map([[2,t=>!this._transparent&&c(t)],[9,t=>this._transparent&&c(t)]])}updateConfiguration(t){super.updateConfiguration(t),this._configuration.enableOITOffset=t.enableOITOffset,this._configuration.transparent=this._transparent}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=d||e[3]>=d||r[3]>=d}intersect(){}createGLMaterial(t){return new C(t)}createBufferWriter(){return new x}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class C extends l{beginSlot(t){return this.getTechnique(h,t)}}class b extends p{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1}}const w=n(),j=n(),v=n(),M=n(),O=n();class x{constructor(){this.layout=f}elementCount(t){return 2*(t.get("position").indices.length/2+1)}write(n,a,c,l,u,p){const{data:h,indices:f}=c.get("position"),m=c.get("normal").data,d=h.length/3;f&&f.length!==2*(d-1)&&console.warn("MeasurementArrowMaterial does not support indices");const g=w,C=j,b=v,x=M,_=O,T=u.position,A=u.normal,L=u.uv0;let V=0;for(let w=0;w<d;++w){const c=3*w;if(t(g,h[c],h[c+1],h[c+2]),w<d-1){const o=3*(w+1);t(C,h[o],h[o+1],h[o+2]),t(_,m[o],m[o+1],m[o+2]),e(_,_),r(b,C,g),e(b,b),s(x,_,b),e(x,x)}const l=o(g,C);n&&a&&(i(g,g,n),i(C,C,n),i(x,x,a));const u=p+2*w,f=u+1;T.setVec(u,g),T.setVec(f,g),A.setVec(u,x),A.setVec(f,x),L.set(u,0,V),L.set(u,1,-1),L.set(f,0,V),L.set(f,1,1),w<d-1&&(V+=l)}const q=u.length;for(let t=0;t<2*d;++t)q.set(p+t,V);return null}}export{g as MeasurementArrowMaterial,b as Parameters};
2
+ import{set as t,normalize as e,subtract as r,cross as s,distance as o,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as c}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as u,MaterialParameters as p}from"../lib/Material.js";import{MeasurementArrowTechnique as h,layout as f}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as m}from"../shaders/MeasurementArrowTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class g extends u{constructor(t){super(t,b),this._configuration=new m,this.intersectDraped=void 0,this.produces=new Map([[2,t=>!this._transparent&&c(t)],[8,t=>this._transparent&&c(t)]])}updateConfiguration(t){super.updateConfiguration(t),this._configuration.enableOITOffset=t.enableOITOffset,this._configuration.transparent=this._transparent}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=d||e[3]>=d||r[3]>=d}intersect(){}createGLMaterial(t){return new C(t)}createBufferWriter(){return new x}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class C extends l{beginSlot(t){return this.getTechnique(h,t)}}class b extends p{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1}}const w=n(),j=n(),v=n(),M=n(),O=n();class x{constructor(){this.layout=f}elementCount(t){return 2*(t.get("position").indices.length/2+1)}write(n,a,c,l,u,p){const{data:h,indices:f}=c.get("position"),m=c.get("normal").data,d=h.length/3;f&&f.length!==2*(d-1)&&console.warn("MeasurementArrowMaterial does not support indices");const g=w,C=j,b=v,x=M,_=O,T=u.position,A=u.normal,L=u.uv0;let V=0;for(let w=0;w<d;++w){const c=3*w;if(t(g,h[c],h[c+1],h[c+2]),w<d-1){const o=3*(w+1);t(C,h[o],h[o+1],h[o+2]),t(_,m[o],m[o+1],m[o+2]),e(_,_),r(b,C,g),e(b,b),s(x,_,b),e(x,x)}const l=o(g,C);n&&a&&(i(g,g,n),i(C,C,n),i(x,x,a));const u=p+2*w,f=u+1;T.setVec(u,g),T.setVec(f,g),A.setVec(u,x),A.setVec(f,x),L.set(u,0,V),L.set(u,1,-1),L.set(f,0,V),L.set(f,1,1),w<d-1&&(V+=l)}const q=u.length;for(let t=0;t<2*d;++t)q.set(p+t,V);return null}}export{g as MeasurementArrowMaterial,b as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../effects/snowcover/SnowCover.glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/Path.glsl.js";
2
+ import"../core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/MainLighting.glsl.js";import"../core/shaderLibrary/shading/Normals.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../effects/snowcover/SnowCover.glsl.js";import"../shaders/OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/Path.glsl.js";