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

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 (262) hide show
  1. package/applications/Components/imageryUtils.d.ts +6 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/001492854799c35b53bb.js +1 -0
  4. package/assets/esri/core/workers/chunks/004f991251f09b36fb09.js +1 -0
  5. package/assets/esri/core/workers/chunks/027d733a99f50cadcf22.js +1 -0
  6. package/assets/esri/core/workers/chunks/03d85a706669aaf24d49.js +1 -0
  7. package/assets/esri/core/workers/chunks/0450133e81bce4b48b84.js +1 -0
  8. package/assets/esri/core/workers/chunks/07e791530677f7e70f32.js +30 -0
  9. package/assets/esri/core/workers/chunks/085778ecd39f46324a6b.js +1 -0
  10. package/assets/esri/core/workers/chunks/08dce0019b52042b01fa.js +1 -0
  11. package/assets/esri/core/workers/chunks/0d8294982853308225da.js +1 -0
  12. package/assets/esri/core/workers/chunks/156aecac067213642aae.js +1 -0
  13. package/assets/esri/core/workers/chunks/{942e4d69b140bc2f97c9.js → 15a45e26964c2eb381a6.js} +1 -1
  14. package/assets/esri/core/workers/chunks/184e9147f7a2f0ae5915.js +1 -0
  15. package/assets/esri/core/workers/chunks/19f59a2a97c33ff92650.js +1 -0
  16. package/assets/esri/core/workers/chunks/{54420b66fd53d6e19ba5.js → 278eecd729bed2832702.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{74814678942a47fd48fb.js → 28ac3a75130fe2b57ac7.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{a3174b23aabcef2fa98c.js → 29c91b5c9ddcea85f39a.js} +1 -1
  19. package/assets/esri/core/workers/chunks/2b7d020367cb4ebb3c3d.js +1 -0
  20. package/assets/esri/core/workers/chunks/30654845ca1334f1c206.js +1 -0
  21. package/assets/esri/core/workers/chunks/3104b10770903c265626.js +1 -0
  22. package/assets/esri/core/workers/chunks/33f00633131581e06328.js +1 -0
  23. package/assets/esri/core/workers/chunks/{32a51ce8e1a362115c89.js → 354b309c8225336bc1e5.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{569e4479707bc6881d97.js → 35dbe1eeb6932b03aea2.js} +1 -1
  25. package/assets/esri/core/workers/chunks/386435341e949f5573b4.js +2 -0
  26. package/assets/esri/core/workers/chunks/3874362bf7d43adc41bb.js +1 -0
  27. package/assets/esri/core/workers/chunks/38dc1c4b8721efd4a165.js +1 -0
  28. package/assets/esri/core/workers/chunks/39f3bea123f20c816ab2.js +1 -0
  29. package/assets/esri/core/workers/chunks/3fa5f102b6f77c523a76.js +1 -0
  30. package/assets/esri/core/workers/chunks/{a422cfe1e2afe0722acd.js → 3fcc8c455af56ae89030.js} +1 -1
  31. package/assets/esri/core/workers/chunks/42f3fdad1728433b3510.js +1 -0
  32. package/assets/esri/core/workers/chunks/436941ec88439667022e.js +1 -0
  33. package/assets/esri/core/workers/chunks/{25946077568ab14c7bfc.js → 440f76c397a813b0dcf9.js} +1 -1
  34. package/assets/esri/core/workers/chunks/4812482f28f7205b0938.js +1 -0
  35. package/assets/esri/core/workers/chunks/5317cbef0aac29761575.js +1 -0
  36. package/assets/esri/core/workers/chunks/54a9e17d6c0fef6a9146.js +1 -0
  37. package/assets/esri/core/workers/chunks/55985c9c48b8e1d1c634.js +1 -0
  38. package/assets/esri/core/workers/chunks/55edd712c6d2d044e550.js +1 -0
  39. package/assets/esri/core/workers/chunks/5a573fa1012092328b88.js +1 -0
  40. package/assets/esri/core/workers/chunks/5f06a57b4f7d7de16bbf.js +1 -0
  41. package/assets/esri/core/workers/chunks/60ad54e5707d4414d8b9.js +1 -0
  42. package/assets/esri/core/workers/chunks/{55070344f08ef0ed2a30.js → 60cee9a44929decd2474.js} +1 -1
  43. package/assets/esri/core/workers/chunks/63b9e4a7dad358605c38.js +1 -0
  44. package/assets/esri/core/workers/chunks/{d0adf059085ddf7151dd.js → 64845b1f53eca9db1229.js} +1 -1
  45. package/assets/esri/core/workers/chunks/66d4cbb35d0c290150bf.js +1 -0
  46. package/assets/esri/core/workers/chunks/677d3674cb2c0c05fb7e.js +1 -0
  47. package/assets/esri/core/workers/chunks/7100c9038739121c2c4b.js +1 -0
  48. package/assets/esri/core/workers/chunks/{6c49ac7888679b9f7823.js → 720a33a7f118d2769133.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{9f7b5749f3ceca8d5978.js → 7480bd6f892abf444cac.js} +31 -31
  50. package/assets/esri/core/workers/chunks/{3a7c02616d942c81257d.js → 792219a079c28bcdc003.js} +1 -1
  51. package/assets/esri/core/workers/chunks/794f604d4267e374f7dd.js +1 -0
  52. package/assets/esri/core/workers/chunks/7ae8f73c8e2afae98ecb.js +1 -0
  53. package/assets/esri/core/workers/chunks/7d4af7e2cb2f234e12eb.js +1 -0
  54. package/assets/esri/core/workers/chunks/807b12ace0099300b9b9.js +1 -0
  55. package/assets/esri/core/workers/chunks/{b98dd9fc9a7e3ff6bd49.js → 816a4b03f2ea49238a6c.js} +1 -1
  56. package/assets/esri/core/workers/chunks/842b442cc012d0797333.js +1 -0
  57. package/assets/esri/core/workers/chunks/8903ff28896bd6f34b0d.js +1 -0
  58. package/assets/esri/core/workers/chunks/89e9bc8789b100316136.js +1 -0
  59. package/assets/esri/core/workers/chunks/8afe32d3db9669f972bc.js +1 -0
  60. package/assets/esri/core/workers/chunks/91fd28f50477d16e294e.js +1 -0
  61. package/assets/esri/core/workers/chunks/{278409028bc5af45b507.js → 93ceb74ac88ef460fe5f.js} +1 -1
  62. package/assets/esri/core/workers/chunks/98011b93acf3d5f0b5a2.js +1 -0
  63. package/assets/esri/core/workers/chunks/{cd491c37ba1ac381178c.js → 987dc23fdc0a8c7150b9.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{25509953f19fbc4949a1.js → 992e74570b76f3f9e52e.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{b1c5f69bd1400e66c635.js → 9ae90a4b281d4103e8bb.js} +1 -1
  66. package/assets/esri/core/workers/chunks/9c7fd5db0813bdc38582.js +1 -0
  67. package/assets/esri/core/workers/chunks/9f272445c285ee9abb7b.js +1 -0
  68. package/assets/esri/core/workers/chunks/a2fee1611319665e6aed.js +1 -0
  69. package/assets/esri/core/workers/chunks/a644e30f65347ce846ed.js +1 -0
  70. package/assets/esri/core/workers/chunks/a64daa4945923a178fe5.js +1 -0
  71. package/assets/esri/core/workers/chunks/a85575a8d1da09280cd7.js +1 -0
  72. package/assets/esri/core/workers/chunks/ac4f7309a249132c22da.js +1 -0
  73. package/assets/esri/core/workers/chunks/aeb1900cfdd0e51cc5f8.js +1 -0
  74. package/assets/esri/core/workers/chunks/ba62f3aa811430787863.js +1 -0
  75. package/assets/esri/core/workers/chunks/{7b48c102a44606291f82.js → bb659dcd297b895830df.js} +1 -1
  76. package/assets/esri/core/workers/chunks/c03d0091a6f385b9ce8d.js +1 -0
  77. package/assets/esri/core/workers/chunks/c48d1ee37c207bfb0aac.js +1 -0
  78. package/assets/esri/core/workers/chunks/c4a9006cc6d2938570e0.js +1 -0
  79. package/assets/esri/core/workers/chunks/c692ea68509bddbf7b42.js +1 -0
  80. package/assets/esri/core/workers/chunks/{a4a4ce33de6432ba4dc3.js → c6a0e770c1a89d3b5913.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{b49b608c0d58a9b55fa2.js → cc1f3a2f281a2f6e0f94.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{73e384fd93cf22503d84.js → cdf6ad970dc1893dac58.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{b45fdc04d399d2849d63.js → daf65bccc45dc5c400ae.js} +1 -1
  84. package/assets/esri/core/workers/chunks/df3e79b56c37156e7895.js +1 -0
  85. package/assets/esri/core/workers/chunks/df8b80b17e371c9be4e6.js +1 -0
  86. package/assets/esri/core/workers/chunks/e77198f8ab47441423c5.js +1 -0
  87. package/assets/esri/core/workers/chunks/e786da40a1c87bed64ca.js +1 -0
  88. package/assets/esri/core/workers/chunks/e8aafef6342c50340a27.js +1 -0
  89. package/assets/esri/core/workers/chunks/ec00348d74e29f48613a.js +1 -0
  90. package/assets/esri/core/workers/chunks/{284ce99af7bdd73dc7e9.js → ec65c9c72507ef9a9cf9.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{cdec811b66d98e76be9e.js → eedeff8b344ff699b0b9.js} +1 -1
  92. package/assets/esri/core/workers/chunks/f4201e7dcae224d0caf0.js +1 -0
  93. package/assets/esri/core/workers/chunks/f4d31d96681b649ddc95.js +1 -0
  94. package/assets/esri/core/workers/chunks/{08d76c600926d7642a8b.js → f5fd59291cb161fdc05b.js} +1 -1
  95. package/assets/esri/core/workers/chunks/f7cc05fbfc97b4d36eba.js +1 -0
  96. package/assets/esri/core/workers/chunks/{6aba8c3bce5f68568e3a.js → f7fb121169b7e5a5adbc.js} +1 -1
  97. package/assets/esri/core/workers/chunks/f9d369a4683f88ee9d76.js +1 -0
  98. package/assets/esri/core/workers/chunks/fc534c94d55331578195.js +1 -0
  99. package/assets/esri/core/workers/chunks/{3e61e7805dc6ff284831.js → fdf8fe0f50a9ae548c16.js} +1 -1
  100. package/chunks/Fog.glsl.js +1 -1
  101. package/chunks/GlowBlur.glsl.js +2 -2
  102. package/chunks/GlowComposition.glsl.js +6 -6
  103. package/chunks/HUDMaterial.glsl.js +1 -1
  104. package/chunks/OITBlend.glsl.js +9 -9
  105. package/config.js +1 -1
  106. package/core/timeUtils.d.ts +68 -0
  107. package/geometry/support/aaBoundingBox.js +1 -1
  108. package/geometry/support/sphere.js +1 -1
  109. package/kernel.js +1 -1
  110. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  111. package/layers/raster/datasets/pixelReader.js +1 -1
  112. package/layers/support/Sublayer.d.ts +15 -0
  113. package/layers/support/Sublayer.js +1 -1
  114. package/package.json +3 -3
  115. package/support/revision.js +1 -1
  116. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  117. package/symbols/cim/utils.js +1 -1
  118. package/views/2d/engine/Stage.js +1 -1
  119. package/views/2d/engine/brushes.js +1 -1
  120. package/views/2d/engine/webgl/TileContainer.js +1 -1
  121. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  122. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js +2 -0
  123. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js +2 -0
  124. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +2 -0
  125. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTexture.js +2 -0
  126. package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileStencilTechnique.js +2 -0
  127. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
  128. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
  129. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  130. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
  131. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
  132. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  133. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  134. package/views/2d/layers/MediaLayerView2D.js +1 -1
  135. package/views/2d/layers/TileLayerView2D.js +1 -1
  136. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  137. package/views/3d/layers/support/Tiles3DBVH.js +2 -0
  138. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  139. package/views/3d/support/ElevationRange.js +1 -1
  140. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  141. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
  142. package/views/3d/support/orientedBoundingBox.js +1 -1
  143. package/views/3d/terrain/TerrainRenderer.js +1 -1
  144. package/views/3d/terrain/TileCompositor.js +1 -1
  145. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  146. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialGlobalParameters.js +1 -1
  147. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  148. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  149. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputConfiguration.js +1 -1
  150. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
  151. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  152. package/views/3d/webgl-engine/effects/fboFormatUtils.js +2 -0
  153. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  154. package/views/3d/webgl-engine/effects/fog/FogTechniqueConfiguration.js +1 -1
  155. package/views/3d/webgl-engine/effects/glow/GlowBlurTechniqueConfiguration.js +1 -1
  156. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +1 -1
  157. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  158. package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
  159. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  160. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  161. package/views/3d/webgl-engine/effects/transparency/OITBlendTechniqueConfiguration.js +1 -1
  162. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  163. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  164. package/views/3d/webgl-engine/lib/Material.js +1 -1
  165. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  166. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  167. package/views/3d/webgl-engine/shaders/Dithering.glsl.js +1 -1
  168. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +3 -3
  169. package/views/3d/webgl-engine/shaders/oitResolution.glsl.js +1 -1
  170. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  171. package/views/3d/webgl.js +1 -1
  172. package/views/SceneView.js +1 -1
  173. package/views/SelectionManager.js +1 -1
  174. package/views/VideoView.js +1 -1
  175. package/views/selection/types.d.ts +92 -1
  176. package/views/support/selectionUtils.js +1 -1
  177. package/views/support/waitForResources.js +1 -1
  178. package/views/webgl/FramebufferObject.js +1 -1
  179. package/views/webgl/InstanceCounter.js +1 -1
  180. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  181. package/widgets/Editor/EditorViewModel.js +1 -1
  182. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  183. package/widgets/Editor/UpdateFeaturesWorkflowData.d.ts +2 -2
  184. package/widgets/Editor/workflowUtils.js +1 -1
  185. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  186. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  187. package/widgets/LayerList/ListItemPanel.js +1 -1
  188. package/widgets/Legend/LegendViewModel.js +1 -1
  189. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  190. package/widgets/Sketch/SketchViewModel.js +1 -1
  191. package/widgets/support/SelectionList/FeatureItem.js +1 -1
  192. package/widgets/support/SelectionList/LayerItem.js +1 -1
  193. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  194. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  195. package/assets/esri/core/workers/chunks/04b04548d4eb0941a01e.js +0 -1
  196. package/assets/esri/core/workers/chunks/06223d5d8281e5af14c5.js +0 -1
  197. package/assets/esri/core/workers/chunks/07bdcb622ea59fdbb3a6.js +0 -1
  198. package/assets/esri/core/workers/chunks/0d59f5cd3fdd7d6fd693.js +0 -1
  199. package/assets/esri/core/workers/chunks/0eb57ef4a1b387c951d6.js +0 -1
  200. package/assets/esri/core/workers/chunks/136859ef29a3269c4128.js +0 -1
  201. package/assets/esri/core/workers/chunks/1e018de43becf66cceaa.js +0 -1
  202. package/assets/esri/core/workers/chunks/236b4ab3da0bc8f788a2.js +0 -1
  203. package/assets/esri/core/workers/chunks/2379c64b0ca30814a815.js +0 -1
  204. package/assets/esri/core/workers/chunks/35d115bde474c380c791.js +0 -1
  205. package/assets/esri/core/workers/chunks/3f6ebd82551c2000912e.js +0 -1
  206. package/assets/esri/core/workers/chunks/4577df99c92c7ec0f9de.js +0 -1
  207. package/assets/esri/core/workers/chunks/4869e2f35aaf6b058281.js +0 -1
  208. package/assets/esri/core/workers/chunks/4b3545965b11a54184d4.js +0 -2
  209. package/assets/esri/core/workers/chunks/4c6fc6d19fe519ce7bfc.js +0 -1
  210. package/assets/esri/core/workers/chunks/58f47dea6d8665611eff.js +0 -1
  211. package/assets/esri/core/workers/chunks/5b2fe488a461bc433f59.js +0 -1
  212. package/assets/esri/core/workers/chunks/5c0b3c76a7bc971c61dc.js +0 -1
  213. package/assets/esri/core/workers/chunks/5df9d2a255c9d63ae7df.js +0 -1
  214. package/assets/esri/core/workers/chunks/5f53d7d6bc9b67b2f357.js +0 -1
  215. package/assets/esri/core/workers/chunks/5ffe664eda334ad73175.js +0 -1
  216. package/assets/esri/core/workers/chunks/64fd3561bc94570ee954.js +0 -1
  217. package/assets/esri/core/workers/chunks/650614a9e4871714c42e.js +0 -1
  218. package/assets/esri/core/workers/chunks/66e35e38aea978f91a0c.js +0 -1
  219. package/assets/esri/core/workers/chunks/696f645349249f26090c.js +0 -1
  220. package/assets/esri/core/workers/chunks/6d5bb00157e20ad90fc0.js +0 -1
  221. package/assets/esri/core/workers/chunks/70f0d66e5e6d5d2163f3.js +0 -1
  222. package/assets/esri/core/workers/chunks/768bbc910be6c65ac107.js +0 -1
  223. package/assets/esri/core/workers/chunks/76effcc35b3962cd5535.js +0 -1
  224. package/assets/esri/core/workers/chunks/777390e820b3824dc265.js +0 -1
  225. package/assets/esri/core/workers/chunks/7948d6f14ae44d346d88.js +0 -1
  226. package/assets/esri/core/workers/chunks/797bf402489b3677a5f7.js +0 -1
  227. package/assets/esri/core/workers/chunks/7a4cc1133e4410271b00.js +0 -1
  228. package/assets/esri/core/workers/chunks/7dba4b04c148f03fdf21.js +0 -1
  229. package/assets/esri/core/workers/chunks/87c9a1fc9f2a392b78f5.js +0 -1
  230. package/assets/esri/core/workers/chunks/88426877d625ea333143.js +0 -1
  231. package/assets/esri/core/workers/chunks/8967a02f394a63f11030.js +0 -1
  232. package/assets/esri/core/workers/chunks/8c210529a28addb94ea0.js +0 -1
  233. package/assets/esri/core/workers/chunks/8d3c508995253cbe083f.js +0 -1
  234. package/assets/esri/core/workers/chunks/8e18ac7b22d8dca1e1e2.js +0 -1
  235. package/assets/esri/core/workers/chunks/8e3cb1c584951c3d1eb7.js +0 -1
  236. package/assets/esri/core/workers/chunks/908f171b9c512d738dea.js +0 -1
  237. package/assets/esri/core/workers/chunks/922484b43803ab4e4319.js +0 -1
  238. package/assets/esri/core/workers/chunks/947a715b608c8affd812.js +0 -1
  239. package/assets/esri/core/workers/chunks/9bd68abc6b5b07b2add3.js +0 -1
  240. package/assets/esri/core/workers/chunks/9e55f97291062985560b.js +0 -1
  241. package/assets/esri/core/workers/chunks/a90883ff02c0cc6450c2.js +0 -1
  242. package/assets/esri/core/workers/chunks/ac9722a7897c994f11ab.js +0 -1
  243. package/assets/esri/core/workers/chunks/b1ac09d8fa340d194aa2.js +0 -1
  244. package/assets/esri/core/workers/chunks/c04c457f5295febb3c39.js +0 -1
  245. package/assets/esri/core/workers/chunks/cb2fbe585c0827eecf70.js +0 -1
  246. package/assets/esri/core/workers/chunks/cf74d1605ad2f21699e7.js +0 -1
  247. package/assets/esri/core/workers/chunks/d50e6681ecb9612e4528.js +0 -1
  248. package/assets/esri/core/workers/chunks/d6eddb94f5f2e9759bd0.js +0 -1
  249. package/assets/esri/core/workers/chunks/dcc3285e4ab2c38709bd.js +0 -1
  250. package/assets/esri/core/workers/chunks/e25bbd7cc553b1d2e208.js +0 -1
  251. package/assets/esri/core/workers/chunks/e72ca52d930afb5650af.js +0 -30
  252. package/assets/esri/core/workers/chunks/e96529e144c3268a04f7.js +0 -1
  253. package/assets/esri/core/workers/chunks/f379f94adbe79dc305a2.js +0 -1
  254. package/assets/esri/core/workers/chunks/f4e5163efa2a0567ee19.js +0 -1
  255. package/assets/esri/core/workers/chunks/f76833254f842fb0cd9a.js +0 -1
  256. package/assets/esri/core/workers/chunks/f9abae8d07002fe04a08.js +0 -1
  257. package/assets/esri/core/workers/chunks/ff6c4f8420140b9f9577.js +0 -1
  258. package/assets/esri/core/workers/chunks/ff75fb0fce51ac12e656.js +0 -1
  259. package/assets/esri/core/workers/chunks/ffe9fa5111c149ddef49.js +0 -1
  260. package/views/2d/engine/webgl/brushes/WGLBrushStencil.js +0 -2
  261. package/views/2d/engine/webgl/brushes/WGLBrushTileDebugInfo.js +0 -2
  262. /package/assets/esri/core/workers/chunks/{4b3545965b11a54184d4.js.LICENSE.txt → 386435341e949f5573b4.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{ComponentMaterial as e,computeMaterialPass as t,calculateHasEmissions as r,calculateEmissionSource as o}from"./ComponentMaterial.js";import{ComponentMaterialGlobalParameters as s}from"./ComponentMaterialGlobalParameters.js";class a{constructor(e,t){this._store=new Map,this.globals=new s(e,t)}destroy(){this._store.forEach(({material:e})=>e.destroy()),this._store.clear()}acquire(t,r,o){const s=this.globals,a=l(t,r,o,s),n=this._store.get(a);if(n)return n.refCount++,n.material.key,n.material;const i=new e(t,r,o,s,a);return this._store.set(a,{material:i,refCount:1}),i}release(e){const{key:t}=e,r=this._store.get(t);if(!r||r.refCount<1)throw new Error("Internal error in material repository");1===r.refCount?this._store.delete(t):r.refCount--}}function l(e,s,a,l){const n=t(e,a),i=r(e,a,l),u=o(e,a,l);return"|"+ +l.hasFloatOit+`|${+e.usePBR}|${+e.hasParametersFromSource}|${+e.isGround}`+`|${+e.slicePlaneEnabled}|${+e.isIntegratedMesh}|${+e.applySSAO}`+`|${+n}|${+a.componentDataType}|${+i}|${+u}`+`|${+e.sphereDepthInterpolate}|${+e.ellipsoidMode}|${+e.doubleSided}`+`|${+e.cullFace}|${+e.alphaDiscardMode}`+`|${+s.hasVertexColors}|${+s.textureCoordinateType}`+`|${+s.shadeNormals}|${+s.hasNormals}`+`|${+e.polygonOffsetEnabled}|${+s.vertexPositionRotationType}|${+s.vertexNormalRotationType}|`+ +(null!=e.baseColorTexture)+"|"+ +(null!=e.emissionTexture)+"|"+ +(null!=e.metallicRoughnessTexture)+"|"+ +(null!=e.occlusionTexture)+"|"+ +(null!=e.normalTexture)+"|"+ +a.emissiveOverride}export{a as ComponentMaterialRepository,l as makeMaterialKey};
2
+ import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{ComponentMaterial as e,computeMaterialPass as r,calculateHasEmissions as t,calculateEmissionSource as o}from"./ComponentMaterial.js";import{ComponentMaterialGlobalParameters as s}from"./ComponentMaterialGlobalParameters.js";class a{constructor(e,r){this._store=new Map,this.globals=new s(e,r)}destroy(){this._store.forEach(({material:e})=>e.destroy()),this._store.clear()}acquire(r,t,o){const s=this.globals,a=l(r,t,o,s),n=this._store.get(a);if(n)return n.refCount++,n.material.key,n.material;const i=new e(r,t,o,s,a);return this._store.set(a,{material:i,refCount:1}),i}release(e){const{key:r}=e,t=this._store.get(r);if(!t||t.refCount<1)throw new Error("Internal error in material repository");1===t.refCount?this._store.delete(r):t.refCount--}}function l(e,s,a,l){const n=r(e,a),i=t(e,a,l),u=o(e,a,l);return"|"+ +l.useFloatBlend+`|${+e.usePBR}|${+e.hasParametersFromSource}|${+e.isGround}`+`|${+e.slicePlaneEnabled}|${+e.isIntegratedMesh}|${+e.applySSAO}`+`|${+n}|${+a.componentDataType}|${+i}|${+u}`+`|${+e.sphereDepthInterpolate}|${+e.ellipsoidMode}|${+e.doubleSided}`+`|${+e.cullFace}|${+e.alphaDiscardMode}`+`|${+s.hasVertexColors}|${+s.textureCoordinateType}`+`|${+s.shadeNormals}|${+s.hasNormals}`+`|${+e.polygonOffsetEnabled}|${+s.vertexPositionRotationType}|${+s.vertexNormalRotationType}|`+ +(null!=e.baseColorTexture)+"|"+ +(null!=e.emissionTexture)+"|"+ +(null!=e.metallicRoughnessTexture)+"|"+ +(null!=e.occlusionTexture)+"|"+ +(null!=e.normalTexture)+"|"+ +a.emissiveOverride}export{a as ComponentMaterialRepository,l as makeMaterialKey};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{isColorHighlightOrOLID as e}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(t){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.vertexPositionRotationType=1,this.vertexNormalRotationType=0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=t.sphericalSR,this.hasFloatOit=t.hasFloatOit}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&e(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}t([o()],s.prototype,"hasFloatOit",void 0),t([o({count:12})],s.prototype,"output",void 0),t([o({count:3})],s.prototype,"textureCoordinateType",void 0),t([o({count:2})],s.prototype,"componentDataType",void 0),t([o({count:3})],s.prototype,"cullFace",void 0),t([o({count:3})],s.prototype,"vertexDiscardMode",void 0),t([o({count:3})],s.prototype,"doubleSidedMode",void 0),t([o({count:4})],s.prototype,"alphaDiscardMode",void 0),t([o({count:4})],s.prototype,"integratedMeshMode",void 0),t([o({count:7})],s.prototype,"pbrMode",void 0),t([o({count:3})],s.prototype,"normalType",void 0),t([o({count:8})],s.prototype,"emissionSource",void 0),t([o({count:3})],s.prototype,"shadeNormals",void 0),t([o()],s.prototype,"hasEmission",void 0),t([o()],s.prototype,"hasVertexColors",void 0),t([o()],s.prototype,"hasSlicePlane",void 0),t([o()],s.prototype,"isGroundSlice",void 0),t([o()],s.prototype,"hasColorTexture",void 0),t([o()],s.prototype,"hasHighlightMixTexture",void 0),t([o()],s.prototype,"receiveAmbientOcclusion",void 0),t([o()],s.prototype,"receiveShadows",void 0),t([o()],s.prototype,"blendingEnabled",void 0),t([o()],s.prototype,"screenSpaceReflections",void 0),t([o()],s.prototype,"hasPolygonOffset",void 0),t([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),t([o()],s.prototype,"hasOcclusionTexture",void 0),t([o()],s.prototype,"hasNormalTexture",void 0),t([o()],s.prototype,"hasOccludees",void 0),t([o()],s.prototype,"terrainDepthTest",void 0),t([o()],s.prototype,"cullAboveTerrain",void 0),t([o()],s.prototype,"hasNormalTextureTransform",void 0),t([o()],s.prototype,"cloudReflections",void 0),t([o()],s.prototype,"snowCover",void 0),t([o()],s.prototype,"renderOccluded",void 0),t([o()],s.prototype,"sphereDepthInterpolate",void 0),t([o({count:2})],s.prototype,"vertexPositionRotationType",void 0),t([o({count:2})],s.prototype,"vertexNormalRotationType",void 0);export{s as ComponentTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.vertexPositionRotationType=1,this.vertexNormalRotationType=0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=e.sphericalSR,this.useFloatBlend=e.useFloatBlend}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o()],s.prototype,"useFloatBlend",void 0),e([o({count:12})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:7})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"blendingEnabled",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasPolygonOffset",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0),e([o({count:2})],s.prototype,"vertexPositionRotationType",void 0),e([o({count:2})],s.prototype,"vertexNormalRotationType",void 0);export{s as ComponentTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import{ShaderTechniqueConfiguration as t,parameter as s}from"../shaderTechnique/ShaderTechniqueConfiguration.js";class i extends t{constructor(){super(...arguments),this.output=0,this.hasEmission=!1}}o([s({count:12})],i.prototype,"output",void 0),o([s()],i.prototype,"hasEmission",void 0);export{i as ShaderOutputConfiguration};
2
+ import{__decorate as o}from"tslib";import{ShaderTechniqueConfiguration as t,parameter as s}from"../shaderTechnique/ShaderTechniqueConfiguration.js";class e extends t{constructor(){super(...arguments),this.output=0,this.hasEmission=!1,this.useFloatBlend=!0}}o([s({count:12})],e.prototype,"output",void 0),o([s()],e.prototype,"hasEmission",void 0),o([s()],e.prototype,"useFloatBlend",void 0);export{e as ShaderOutputConfiguration};
@@ -1,9 +1,9 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isColor as e}from"../ShaderOutput.js";import{VertexTextureCoordinates as s}from"../attributes/VertexTextureCoordinates.glsl.js";import{Gamma as i}from"../shading/Gamma.glsl.js";import{Float3DrawUniform as o}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as r}from"../../shaderModules/Float3PassUniform.js";import{FloatDrawUniform as m}from"../../shaderModules/FloatDrawUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{If as n,glsl as a}from"../../shaderModules/glsl.js";import{Texture2DDrawUniform as v}from"../../shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as l}from"../../shaderModules/Texture2DPassUniform.js";const u=1,d=1;function f(u,f){if(!e(f.output))return;u.fragment.include(i);const{emissionSource:c,hasEmissiveTextureTransform:x,bindType:g}=f,p=3===c||4===c||5===c;p&&(u.include(s,f),u.fragment.uniforms.add(1===g?new l("texEmission",e=>e.textureEmissive):new v("texEmission",e=>e.textureEmissive)));const h=2===c||p;h&&u.fragment.uniforms.add(1===g?new r("emissiveBaseColor",e=>e.emissiveBaseColor):new o("emissiveBaseColor",e=>e.emissiveBaseColor));const T=0!==c;T&&!(7===c||6===c||4===c||5===c)&&u.fragment.uniforms.add(1===g?new t("emissiveStrength",e=>e.emissiveStrength??0):new m("emissiveStrength",e=>e.emissiveStrength??0));const w=7===c,C=5===c,b=1===c||6===c||w;u.fragment.code.add(a`
2
+ import{clamp as e}from"../../../../../../core/mathUtils.js";import{isColor as s}from"../ShaderOutput.js";import{VertexTextureCoordinates as i}from"../attributes/VertexTextureCoordinates.glsl.js";import{Gamma as o}from"../shading/Gamma.glsl.js";import{Float3DrawUniform as r}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as m}from"../../shaderModules/Float3PassUniform.js";import{FloatDrawUniform as t}from"../../shaderModules/FloatDrawUniform.js";import{FloatPassUniform as n}from"../../shaderModules/FloatPassUniform.js";import{If as a,glsl as l}from"../../shaderModules/glsl.js";import{Texture2DDrawUniform as v}from"../../shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as u}from"../../shaderModules/Texture2DPassUniform.js";import{floatBlendReductionFactor as f}from"../../../shaders/oitResolution.glsl.js";const d=1,c=1;function g(d,g){if(!s(g.output))return;d.fragment.include(o);const{emissionSource:x,hasEmissiveTextureTransform:p,bindType:h,useFloatBlend:j}=g,T=3===x||4===x||5===x;T&&(d.include(i,g),d.fragment.uniforms.add(1===h?new u("texEmission",e=>e.textureEmissive):new v("texEmission",e=>e.textureEmissive)));const w=2===x||T;w&&d.fragment.uniforms.add(1===h?new m("emissiveBaseColor",e=>e.emissiveBaseColor):new r("emissiveBaseColor",e=>e.emissiveBaseColor));const C=0!==x;if(C&&!(7===x||6===x||4===x||5===x)){const s=s=>null!=s?j?s:e(s,0,f):0;d.fragment.uniforms.add(1===h?new n("emissiveStrength",e=>s(e.emissiveStrength)):new t("emissiveStrength",e=>s(e.emissiveStrength)))}const F=7===x,b=5===x,S=1===x||6===x||F;d.fragment.code.add(l`
3
3
  vec4 getEmissions(vec3 symbolColor) {
4
- vec4 emissions = ${h?C?"emissiveSource == 0 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(emissiveBaseColor, 1.0)":b?w?"emissiveSource == 0 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(linearizeGamma(symbolColor), 1.0)":"vec4(0.0)"};
5
- ${n(p,`${n(C,`if(emissiveSource == 0) {\n vec4 emissiveFromTex = textureLookup(texEmission, ${x?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);\n }`,`vec4 emissiveFromTex = textureLookup(texEmission, ${x?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);`)}\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
6
- ${n(T,`emissions.rgb *= emissiveStrength * ${a.float(d)};`)}
4
+ vec4 emissions = ${w?b?"emissiveSource == 0 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(emissiveBaseColor, 1.0)":S?F?"emissiveSource == 0 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(linearizeGamma(symbolColor), 1.0)":"vec4(0.0)"};
5
+ ${a(T,`${a(b,`if(emissiveSource == 0) {\n vec4 emissiveFromTex = textureLookup(texEmission, ${p?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);\n }`,`vec4 emissiveFromTex = textureLookup(texEmission, ${p?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);`)}\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
6
+ ${a(C,`emissions.rgb *= emissiveStrength * ${l.float(c)};`)}
7
7
  return emissions;
8
8
  }
9
- `)}export{f as Emissions,d as emissiveStrengthBoost,u as emissiveStrengthDefault};
9
+ `)}export{g as Emissions,c as emissiveStrengthBoost,d as emissiveStrengthDefault};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../../core/maybe.js";import{property as r,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeOutput as i}from"../../../webgl.js";import s from"../../../webgl/RenderNode.js";import{If as a,glsl as c}from"../../core/shaderModules/glsl.js";import{Pos2Locations as l}from"../../lib/DefaultVertexBufferLayouts.js";import{oitReductionFactor as u}from"../../shaders/oitResolution.glsl.js";import{checkWebGLError as h}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as p,SizedPixelFormat as d,DataType as f}from"../../../../webgl/enums.js";let m=class extends s{constructor(e){super(e),this.destroyedCB=null,this.produces=i.FINAL,this.consumes={required:[i.FINAL]},this.clearColor=n,this._focusedFBOType=7,this._programs=new Map}destroy(){this._programs.clear(),this.destroyedCB()}render(e){const t=e.find(({name:e})=>e===i.FINAL);if(!this._focusedTexture)return t;const r=this.renderingContext;r.bindFramebuffer(t.fbo),r.setClearColor(0,0,0,0),r.clear(16384);const o=this._focusedTexture.attachment,n=[v(o)],s=this._ensureProgram(r,!1,n);return r.useProgram(s),r.bindTexture(o,0),s.setUniform1i("colorTex0",0),s.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&s.setUniform2fv("nearFar",this.camera.nearFar),r.screen.draw(),t}getDownscaledFBO(e,t,r,o,n){t&&(o=e.width,n=e.height);const i="linear depth"===r||r.includes("shadow"),s="overlay highlight"===r||"highlights"===r||"highlight mix"===r,a="highlight coverage"===r,c=e.colorTexture?.descriptor,l=c?.internalFormat,u=[],d=new Array,f=new Array;e.colorAttachments.forEach((t,r)=>{const o=e.getColorTexture(t);if(o){const e=v(o);u.push(e);const{descriptor:t}=o;"float"!==e||t.hasMipmap||t.isImmutable||(o.generateMipmap(),d[r]=!0)}if(r>0){const r=e.getColorTexture(t)?.descriptor.internalFormat;return void f.push(F(r))}f.push(i?0:s?1:a?2:F(l))});const m=this.renderingContext,{depthStencilTexture:g}=e,x=this._ensureProgram(m,null!=g,u),T=this.fboCache.acquire(o,n,"fbo visualizer");m.useProgram(x),m.bindFramebuffer(T.fbo);const b=[];e.colorAttachments.forEach((t,r)=>{const o=`colorTex${r.toFixed()}`;m.bindTexture(e.getColorTexture(t),r),x.setUniform1i(o,r),r>0&&T.acquireColor(p+r,5,"fbo visualizer"),b.push(t)});const C=g?.descriptor.linearFilterDepth??!1;if(g){const t=e.colorAttachments.length;g.setShadowFiltering(!1),m.bindTexture(g,t),x.setUniform1i("depthTex",t);const r=p+t;r>p&&T.acquireColor(r,5,"fbo visualizer"),b.push(r)}m.gl.drawBuffers(b),h(m.gl);const R=m.getViewport();return m.setViewport(0,0,o,n),m.setClearColor(0,0,0,0),m.clear(16384),m.setBlendingEnabled(!0),m.setBlendFunction(1,771),x.setUniform1iv("inputTypes",f.length>0?f:[7]),x.setUniform2fv("nearFar",this.camera.nearFar),m.screen.draw(),h(m.gl),m.bindFramebuffer(null),m.setViewport(R.x,R.y,R.width,R.height),t&&(this._focusedTexture?.release(),this._focusedTexture=T.getAttachment(p),this._focusedTexture?.retain(),this._focusedFBOType=f[0]),e.colorAttachments.forEach((t,r)=>{if(d[r]){const r=e.getColorTexture(t);r?.clearMipmap()}}),g&&g.setShadowFiltering(C),T}clearFocusedFBO(){this._focusedTexture=t(this._focusedTexture)}getPreviewContent(e,t,r,o){const n=this.renderingContext,i=o.includes("\ndepth"),s=this.fboCache.acquire(e,t,"fbo visualizer");n.bindFramebuffer(s?.fbo);const a=n.getViewport();n.setViewport(0,0,e,t),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const c=r.attachment,l=this._ensureProgram(n,!1,[v(c)]);n.useProgram(l),n.bindTexture(c,0),l.setUniform1i("colorTex0",0),l.setUniform1iv("inputTypes",[i||c.descriptor.internalFormat!==d.RGBA16F?7:5]),n.screen.draw();const u=new ImageData(new Uint8ClampedArray(e*t*4),e,t);return n.gl.readPixels(0,0,e,t,6408,f.UNSIGNED_BYTE,new Uint8Array(u.data.buffer)),h(n.gl),n.bindFramebuffer(null),n.setViewport(a.x,a.y,a.width,a.height),s?.release(),u}_ensureProgram(e,t,r){const o=x({hasDepthAttachment:t,colorSamplerTypes:r}),n=this._programs.get(o);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",s=e=>{let t="";for(let r=0;r<e.length;++r){const o=e[r];t+=`layout(location = ${c.int(r)}) out vec4 fragColor${c.int(r)};\n uniform ${g(o)} colorTex${c.int(r)};`}return t},h=e=>e.reduce((e,t,r)=>e+`{\n int inputType = inputTypes[${r}];\n if (inputType == ${3..toFixed()}) {\n fragColor${r} = vec4(vec3(texture(colorTex${r}, uv).r), 1.0);\n } else if (inputType == ${4..toFixed()}) {\n fragColor${r} = vec4(texture(colorTex${r}, uv).rg, 0.0, 1.0);\n } else if (inputType == ${(0).toFixed()}) {\n float depth = 1.0 - ((-linearDepthFromTexture(colorTex${r}, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]));\n fragColor${r} = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if (inputType == ${5..toFixed()}) {\n // Divide F16 by oitOutputScale to get similar previews as in the OIT8 pipeline\n fragColor${r} = vec4(texture(colorTex${r}, uv).rgb, 1.0) / ${u.toFixed(1)};\n } else if (inputType == ${1..toFixed()}) {\n fragColor${r} = vec4(texture(colorTex${r}, uv)) * 255.0;\n fragColor${r} = vec4(fragColor${r}.rgb / fragColor${r}.a, fragColor${r}.a);\n } else if(inputType == ${2..toFixed()}) {\n vec2 texDim = vec2(textureSize(colorTex${r}, 0));\n ivec2 iuv = ivec2(uv*texDim);\n uvec2 hh = uvec2(texelFetch(colorTex${r},iuv,0).rg);\n fragColor${r} = vec4(\n ((hh & uvec2(0x55u)) != uvec2(0u)) ? 1.0 : 0.0,\n ((hh & uvec2(0xaau)) != uvec2(0u)) ? 1.0 : 0.0,\n 0.0,\n 1.0);\n } else {\n fragColor${r} = vec4(texture(colorTex${r}, uv));\n }\n }`,""),p=r.length,d=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${s(r)}\n ${a(t,`layout(location = ${c.int(p)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputTypes[${r.length||1}];\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaToFloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaToFloat(depth));\n }\n\n ${"float"===r[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${h(r)}\n ${a(t,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n }`,f=e.programCache.get(i,d,l);return this._programs.set(o,f),f}};function g(e){switch(e){case"float":return"sampler2D";case"uint":return"usampler2D";case"int":return"isampler2D"}}function v(e){if(!e)return"float";const{internalFormat:t}=e.descriptor;switch(t){case d.R8I:case d.R16I:case d.R32I:case d.RG8I:case d.RG16I:case d.RG32I:case d.RGB8I:case d.RGB16I:case d.RGB32I:case d.RGBA8I:case d.RGBA16I:case d.RGBA32I:return"int";case d.R8UI:case d.R16UI:case d.R32UI:case d.RG8UI:case d.RG16UI:case d.RG32UI:case d.RGB8UI:case d.RGB16UI:case d.RGB32UI:case d.RGBA8UI:case d.RGBA16UI:case d.RGBA32UI:return"uint";default:return"float"}}function x(e){const{hasDepthAttachment:t,colorSamplerTypes:r}=e;return`${t?"Depth":""}${r.reduceRight((e,t)=>e+`|C${t}`,"")}`}function F(e){switch(e){case d.R16F:case d.R32F:case d.R8:return 3;case d.RG8:return 4;case d.RGBA16F:return 5;case d.RG8UI:return 6;default:return 7}}e([r()],m.prototype,"destroyedCB",void 0),e([r()],m.prototype,"produces",void 0),e([r()],m.prototype,"consumes",void 0),e([r()],m.prototype,"clearColor",void 0),m=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],m);export{m as RenderNodeVisualizerNode};
2
+ import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../../core/maybe.js";import{property as r,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderNodeOutput as i}from"../../../webgl.js";import s from"../../../webgl/RenderNode.js";import{If as a,glsl as c}from"../../core/shaderModules/glsl.js";import{Pos2Locations as l}from"../../lib/DefaultVertexBufferLayouts.js";import{floatBlendReductionFactor as u}from"../../shaders/oitResolution.glsl.js";import{checkWebGLError as h}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as p,SizedPixelFormat as d,DataType as f}from"../../../../webgl/enums.js";let m=class extends s{constructor(e){super(e),this.destroyedCB=null,this.produces=i.FINAL,this.consumes={required:[i.FINAL]},this.clearColor=n,this._focusedFBOType=7,this._programs=new Map}destroy(){this._programs.clear(),this.destroyedCB()}render(e){const t=e.find(({name:e})=>e===i.FINAL);if(!this._focusedTexture)return t;const r=this.renderingContext;r.bindFramebuffer(t.fbo),r.setClearColor(0,0,0,0),r.clear(16384);const o=this._focusedTexture.attachment,n=[v(o)],s=this._ensureProgram(r,!1,n);return r.useProgram(s),r.bindTexture(o,0),s.setUniform1i("colorTex0",0),s.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&s.setUniform2fv("nearFar",this.camera.nearFar),r.screen.draw(),t}getDownscaledFBO(e,t,r,o,n){t&&(o=e.width,n=e.height);const i="linear depth"===r||r.includes("shadow"),s="overlay highlight"===r||"highlights"===r||"highlight mix"===r,a="highlight coverage"===r,c=e.colorTexture?.descriptor,l=c?.internalFormat,u=[],d=new Array,f=new Array;e.colorAttachments.forEach((t,r)=>{const o=e.getColorTexture(t);if(o){const e=v(o);u.push(e);const{descriptor:t}=o;"float"!==e||t.hasMipmap||t.isImmutable||(o.generateMipmap(),d[r]=!0)}if(r>0){const r=e.getColorTexture(t)?.descriptor.internalFormat;return void f.push(F(r))}f.push(i?0:s?1:a?2:F(l))});const m=this.renderingContext,{depthStencilTexture:g}=e,x=this._ensureProgram(m,null!=g,u),T=this.fboCache.acquire(o,n,"fbo visualizer");m.useProgram(x),m.bindFramebuffer(T.fbo);const b=[];e.colorAttachments.forEach((t,r)=>{const o=`colorTex${r.toFixed()}`;m.bindTexture(e.getColorTexture(t),r),x.setUniform1i(o,r),r>0&&T.acquireColor(p+r,5,"fbo visualizer"),b.push(t)});const C=g?.descriptor.linearFilterDepth??!1;if(g){const t=e.colorAttachments.length;g.setShadowFiltering(!1),m.bindTexture(g,t),x.setUniform1i("depthTex",t);const r=p+t;r>p&&T.acquireColor(r,5,"fbo visualizer"),b.push(r)}m.gl.drawBuffers(b),h(m.gl);const R=m.getViewport();return m.setViewport(0,0,o,n),m.setClearColor(0,0,0,0),m.clear(16384),m.setBlendingEnabled(!0),m.setBlendFunction(1,771),x.setUniform1iv("inputTypes",f.length>0?f:[7]),x.setUniform2fv("nearFar",this.camera.nearFar),m.screen.draw(),h(m.gl),m.bindFramebuffer(null),m.setViewport(R.x,R.y,R.width,R.height),t&&(this._focusedTexture?.release(),this._focusedTexture=T.getAttachment(p),this._focusedTexture?.retain(),this._focusedFBOType=f[0]),e.colorAttachments.forEach((t,r)=>{if(d[r]){const r=e.getColorTexture(t);r?.clearMipmap()}}),g&&g.setShadowFiltering(C),T}clearFocusedFBO(){this._focusedTexture=t(this._focusedTexture)}getPreviewContent(e,t,r,o){const n=this.renderingContext,i=o.includes("\ndepth"),s=this.fboCache.acquire(e,t,"fbo visualizer");n.bindFramebuffer(s?.fbo);const a=n.getViewport();n.setViewport(0,0,e,t),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const c=r.attachment,l=this._ensureProgram(n,!1,[v(c)]);n.useProgram(l),n.bindTexture(c,0),l.setUniform1i("colorTex0",0),l.setUniform1iv("inputTypes",[i||c.descriptor.internalFormat!==d.RGBA16F?7:5]),n.screen.draw();const u=new ImageData(new Uint8ClampedArray(e*t*4),e,t);return n.gl.readPixels(0,0,e,t,6408,f.UNSIGNED_BYTE,new Uint8Array(u.data.buffer)),h(n.gl),n.bindFramebuffer(null),n.setViewport(a.x,a.y,a.width,a.height),s?.release(),u}_ensureProgram(e,t,r){const o=x({hasDepthAttachment:t,colorSamplerTypes:r}),n=this._programs.get(o);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",s=e=>{let t="";for(let r=0;r<e.length;++r){const o=e[r];t+=`layout(location = ${c.int(r)}) out vec4 fragColor${c.int(r)};\n uniform ${g(o)} colorTex${c.int(r)};`}return t},h=e=>e.reduce((e,t,r)=>e+`{\n int inputType = inputTypes[${r}];\n if (inputType == ${3..toFixed()}) {\n fragColor${r} = vec4(vec3(texture(colorTex${r}, uv).r), 1.0);\n } else if (inputType == ${4..toFixed()}) {\n fragColor${r} = vec4(texture(colorTex${r}, uv).rg, 0.0, 1.0);\n } else if (inputType == ${(0).toFixed()}) {\n float depth = 1.0 - ((-linearDepthFromTexture(colorTex${r}, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]));\n fragColor${r} = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if (inputType == ${5..toFixed()}) {\n // Divide F16 by floatBlendOutputScale to get similar previews as in the OIT8 pipeline\n fragColor${r} = vec4(texture(colorTex${r}, uv).rgb, 1.0) / ${u.toFixed(1)};\n } else if (inputType == ${1..toFixed()}) {\n fragColor${r} = vec4(texture(colorTex${r}, uv)) * 255.0;\n fragColor${r} = vec4(fragColor${r}.rgb / fragColor${r}.a, fragColor${r}.a);\n } else if(inputType == ${2..toFixed()}) {\n vec2 texDim = vec2(textureSize(colorTex${r}, 0));\n ivec2 iuv = ivec2(uv*texDim);\n uvec2 hh = uvec2(texelFetch(colorTex${r},iuv,0).rg);\n fragColor${r} = vec4(\n ((hh & uvec2(0x55u)) != uvec2(0u)) ? 1.0 : 0.0,\n ((hh & uvec2(0xaau)) != uvec2(0u)) ? 1.0 : 0.0,\n 0.0,\n 1.0);\n } else {\n fragColor${r} = vec4(texture(colorTex${r}, uv));\n }\n }`,""),p=r.length,d=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${s(r)}\n ${a(t,`layout(location = ${c.int(p)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputTypes[${r.length||1}];\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaToFloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaToFloat(depth));\n }\n\n ${"float"===r[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${h(r)}\n ${a(t,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n }`,f=e.programCache.get(i,d,l);return this._programs.set(o,f),f}};function g(e){switch(e){case"float":return"sampler2D";case"uint":return"usampler2D";case"int":return"isampler2D"}}function v(e){if(!e)return"float";const{internalFormat:t}=e.descriptor;switch(t){case d.R8I:case d.R16I:case d.R32I:case d.RG8I:case d.RG16I:case d.RG32I:case d.RGB8I:case d.RGB16I:case d.RGB32I:case d.RGBA8I:case d.RGBA16I:case d.RGBA32I:return"int";case d.R8UI:case d.R16UI:case d.R32UI:case d.RG8UI:case d.RG16UI:case d.RG32UI:case d.RGB8UI:case d.RGB16UI:case d.RGB32UI:case d.RGBA8UI:case d.RGBA16UI:case d.RGBA32UI:return"uint";default:return"float"}}function x(e){const{hasDepthAttachment:t,colorSamplerTypes:r}=e;return`${t?"Depth":""}${r.reduceRight((e,t)=>e+`|C${t}`,"")}`}function F(e){switch(e){case d.R16F:case d.R32F:case d.R8:return 3;case d.RG8:return 4;case d.RGBA16F:return 5;case d.RG8UI:return 6;default:return 7}}e([r()],m.prototype,"destroyedCB",void 0),e([r()],m.prototype,"produces",void 0),e([r()],m.prototype,"consumes",void 0),e([r()],m.prototype,"clearColor",void 0),m=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],m);export{m as RenderNodeVisualizerNode};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import has from"../../../../core/has.js";function e(){return!has("disable-feature:oit8")}function r(){return e()&&!has("disable-feature:emissive-8bit")}export{r as hasEmissive8Bit,e as hasOit8Bit};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{lerp as e,smoothstep as s}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{copy as n,normalize as h,dot as m,scale as p,lerp as c,length as l}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d,fromValues as _}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as f}from"../../../webgl.js";import{heightLimit as g}from"../../../environment/weather.js";import{TransparentEnvironment as P}from"../TransparentEnvironment.js";import{Blit as w}from"../blit/Blit.js";import{F as b}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as y}from"./FogTechnique.js";import{FogTechniqueConfiguration as v}from"./FogTechniqueConfiguration.js";import{ColorAttachment1 as F,DepthStencilAttachment as j,ColorAttachment0 as E}from"../../../../webgl/enums.js";const R=.95,q=1;let x=class extends P{constructor(t){super(t),this._configuration=new v,this._newParameters=new T,this._oldParameters=new T,this._fadedParameters=new T,this._parameters=this._newParameters,this._passParameters=new b,this._blit=null;const e=u(t.view.spatialReference);this._planetRadius=e.radius,this._atmosphereRadius=e.radius+e.atmosphereHeight}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),i),a(()=>this.view.environment.weather,()=>this._updateEnabled(),i),a(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(a(()=>this._fadeFactor,t=>this._fade(t),i))}_updateEnabled(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(t){const{_newParameters:e,_oldParameters:s}=this;t>=1?(this._parameters=e,this._oldParameters.copyFrom(this._newParameters)):t<=0?this._parameters=s:(this._fadedParameters.lerp(s,e,t),this._parameters=this._fadedParameters)}_updateFogParameters(){const t=this.view.environment.weather,s="foggy"===t.type||"snowy"===t.type||"rainy"===t.type;this._newParameters.strength="foggy"===t.type?e(3e-5,.005,t.fogStrength**3):"snowy"===t.type||"rainy"===t.type?e(4e-6,2e-4,(t.precipitation??0)**3):0,this._newParameters.amount=s?1:0,"foggy"!==t.type&&"snowy"!==t.type||n(this._newParameters.color,H),"rainy"===t.type&&n(this._newParameters.color,A),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(2)}precompile(){this._configuration.hasFloatOit=this.bindParameters.hasFloatOit.value,this._parameters.amount>0&&(this._configuration.hasEmissive=this.bindParameters.hasEmission,this.techniques.precompile(y,this._configuration))}render(t){const e=t.find(({name:t})=>t===f.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return e;if(this._update(),this._passParameters.amount<=0)return e;const s=e.getAttachment(F);this._configuration.hasEmissive=null!=s;const a=this.techniques.getCompiled(y,this._configuration);if(!a)return this.requestRender(1),e;const i=e.getAttachment(j),o=this.renderingContext,{fullWidth:n,fullHeight:h}=this.bindParameters.camera,m=n,p=h;if(s){const t=this.bindParameters.hasFloatOit.value?8:5;this._passParameters.emission=this.fboCache.acquire(m,p,"glow horizontal",t),this._blit??=new w(this.techniques),this._blit.blitTexture(o,s?.attachment,this.bindParameters,this._passParameters.emission)}return e.attachDepth(null),o.bindFramebuffer(e.fbo),o.bindTechnique(a,this.bindParameters,this._passParameters),o.setDrawBuffers([E]),o.screen.draw(),e.attachDepth(i),this._passParameters.emission=r(this._passParameters.emission),e}_update(){const t=this.bindParameters.camera;h(C,t.eye);const e=Math.max(0,m(C,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;p(N,r,.1),c(this._passParameters.color,N,r,e);const a=l(t.eye);this._passParameters.atmosphereC=a**2-this._atmosphereRadius**2,this._passParameters.amount=(1-s(R*g,q*g,Math.abs(a-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}get test(){return{parameters:this._passParameters}}};x=t([o("esri.views.3d.webgl-engine.effects.fog.Fog")],x);class T{constructor(){this.color=d(),this.strength=0,this.amount=0}copyFrom(t){this.amount=t.amount,this.strength=t.strength,n(this.color,t.color)}lerp(t,s,r){this.amount=e(t.amount,s.amount,r),this.strength=e(t.strength,s.strength,r),c(this.color,t.color,s.color,r)}}const C=d(),N=d(),A=_(.5,.5,.5),H=_(1.5,1.5,1.5);export{x as Fog,T as FogParameters};
2
+ import{__decorate as e}from"tslib";import{lerp as t,smoothstep as s}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{copy as n,normalize as h,dot as m,scale as p,lerp as c,length as l}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as d,fromValues as u}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as f}from"../../../webgl.js";import{heightLimit as g}from"../../../environment/weather.js";import{TransparentEnvironment as P}from"../TransparentEnvironment.js";import{Blit as w}from"../blit/Blit.js";import{F as b}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as y}from"./FogTechnique.js";import{FogTechniqueConfiguration as v}from"./FogTechniqueConfiguration.js";import{ColorAttachment1 as F,DepthStencilAttachment as j,ColorAttachment0 as E}from"../../../../webgl/enums.js";const R=.95,q=1;let x=class extends P{constructor(e){super(e),this._configuration=new v,this._newParameters=new T,this._oldParameters=new T,this._fadedParameters=new T,this._parameters=this._newParameters,this._passParameters=new b,this._blit=null;const t=_(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),i),a(()=>this.view.environment.weather,()=>this._updateEnabled(),i),a(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(a(()=>this._fadeFactor,e=>this._fade(e),i))}_updateEnabled(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copyFrom(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const e=this.view.environment.weather,s="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength="foggy"===e.type?t(3e-5,.005,e.fogStrength**3):"snowy"===e.type||"rainy"===e.type?t(4e-6,2e-4,(e.precipitation??0)**3):0,this._newParameters.amount=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||n(this._newParameters.color,A),"rainy"===e.type&&n(this._newParameters.color,N),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(2)}precompile(){this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._parameters.amount>0&&(this._configuration.hasEmissive=this.bindParameters.hasEmission,this.techniques.precompile(y,this._configuration))}render(e){const t=e.find(({name:e})=>e===f.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;const s=t.getAttachment(F);this._configuration.hasEmissive=null!=s;const a=this.techniques.getCompiled(y,this._configuration);if(!a)return this.requestRender(1),t;const i=t.getAttachment(j),o=this.renderingContext,{fullWidth:n,fullHeight:h}=this.bindParameters.camera,m=n,p=h;if(s){const e=this.bindParameters.useFloatBlend.value?8:5;this._passParameters.emission=this.fboCache.acquire(m,p,"glow horizontal",e),this._blit??=new w(this.techniques),this._blit.blitTexture(o,s?.attachment,this.bindParameters,this._passParameters.emission)}return t.attachDepth(null),o.bindFramebuffer(t.fbo),o.bindTechnique(a,this.bindParameters,this._passParameters),o.setDrawBuffers([E]),o.screen.draw(),t.attachDepth(i),this._passParameters.emission=r(this._passParameters.emission),t}_update(){const e=this.bindParameters.camera;h(C,e.eye);const t=Math.max(0,m(C,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;p(B,r,.1),c(this._passParameters.color,B,r,t);const a=l(e.eye);this._passParameters.atmosphereC=a**2-this._atmosphereRadius**2,this._passParameters.amount=(1-s(R*g,q*g,Math.abs(a-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}get test(){return{parameters:this._passParameters}}};x=e([o("esri.views.3d.webgl-engine.effects.fog.Fog")],x);class T{constructor(){this.color=d(),this.strength=0,this.amount=0}copyFrom(e){this.amount=e.amount,this.strength=e.strength,n(this.color,e.color)}lerp(e,s,r){this.amount=t(e.amount,s.amount,r),this.strength=t(e.strength,s.strength,r),c(this.color,e.color,s.color,r)}}const C=d(),B=d(),N=u(.5,.5,.5),A=u(1.5,1.5,1.5);export{x as Fog,T as FogParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import{parameter as s,ShaderTechniqueConfiguration as t}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class i extends t{constructor(){super(...arguments),this.hasFloatOit=!0,this.hasEmissive=!1}}o([s()],i.prototype,"hasFloatOit",void 0),o([s()],i.prototype,"hasEmissive",void 0);export{i as FogTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as s}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class t extends s{constructor(){super(...arguments),this.useFloatBlend=!0,this.hasEmissive=!1}}e([o()],t.prototype,"useFloatBlend",void 0),e([o()],t.prototype,"hasEmissive",void 0);export{t as FogTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import{parameter as t,ShaderTechniqueConfiguration as e}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends e{constructor(){super(...arguments),this.hasFloatOit=!0,this.glowStage=0}}o([t()],r.prototype,"hasFloatOit",void 0),o([t({count:2})],r.prototype,"glowStage",void 0);export{r as GlowBlurTechniqueConfiguration};
2
+ import{__decorate as o}from"tslib";import{parameter as e,ShaderTechniqueConfiguration as t}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends t{constructor(){super(...arguments),this.useFloatBlend=!0,this.glowStage=0}}o([e()],r.prototype,"useFloatBlend",void 0),o([e({count:2})],r.prototype,"glowStage",void 0);export{r as GlowBlurTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import{parameter as t,ShaderTechniqueConfiguration as e}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class i extends e{constructor(){super(...arguments),this.hasFloatOit=!0,this.blurEnabled=!1,this.tonemappingEnabled=!0}}o([t()],i.prototype,"hasFloatOit",void 0),o([t()],i.prototype,"blurEnabled",void 0),o([t()],i.prototype,"tonemappingEnabled",void 0);export{i as GlowCompositionTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as t}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends t{constructor(){super(...arguments),this.useFloatBlend=!0,this.blurEnabled=!1,this.tonemappingEnabled=!0}}e([o()],r.prototype,"useFloatBlend",void 0),e([o()],r.prototype,"blurEnabled",void 0),e([o()],r.prototype,"tonemappingEnabled",void 0);export{r as GlowCompositionTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{lerp as e}from"../../../../../core/mathUtils.js";import{watch as i,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as r,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{length as a}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as h}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as c}from"../../../webgl.js";import{TransparentEnvironment as m}from"../TransparentEnvironment.js";import{G as l}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as u}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as p}from"./GlowBlurTechniqueConfiguration.js";import{G as g,a as _,m as d}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as f}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as b}from"./GlowCompositionTechniqueConfiguration.js";import{oitReductionFactor as P}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as w,DepthStencilAttachment as C}from"../../../../webgl/enums.js";let T=class extends m{constructor(t){super(t),this.consumes={required:[c.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=c.TRANSPARENT_ENVIRONMENT,this._blurHorizontalConfiguration=new p,this._blurVerticalConfiguration=new p,this._compositionConfiguration=new b,this._compositionParameters=new g,this._blurParameters=new l,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037,this._mode=0,this._intensity=.5,this._scatteringFactors={realistic:new _([.8,.12,.05,.02,.01,0]),maximumFog:new _([0,.27,.6,1.05,1.58,2.1],!1),cartographicMin:new _([.4,.18,.25,.12,.05,0],!1),cartographicDefault:new _([1.17,1.08,.78,.4,.26,.11],!1),cartographicMax:new _([3.59,3.9,2.46,1.4,.93,.44],!1)},this._glowResults=new Array;const e=h(t.view.spatialReference);this._atmosphereRadius=e.radius+e.atmosphereHeight}initialize(){this.addHandles([i(()=>this._updateFogParameters(),()=>{},s),i(()=>this._updateParameters(),()=>{},s)])}_updateParameters(){const t=this.view.environment.lighting.glow;this._mode=null==t?this.view.environment.atmosphereEnabled?0:2:1,t&&(this._intensity=t.intensity),this._compositionParameters.minDisperse.presets=this.getPreset(this._mode),this.requestRender(1)}_updateFogParameters(){const t=this.view.environment.weather;"sunny"===t.type||"cloudy"===t.type?this._compositionParameters.distanceModifier=0:this._compositionParameters.distanceModifier="foggy"===t.type?e(3e-5,.005,t.fogStrength**3):e(4e-6,2e-4,(t.precipitation??0)**3),this._compositionParameters.maxDisperse=this._scatteringFactors.maximumFog,this.requestRender(1)}precompile(){this._compositionConfiguration.hasFloatOit=this._blurHorizontalConfiguration.hasFloatOit=this._blurVerticalConfiguration.hasFloatOit=this.bindParameters.hasFloatOit.value,this._compositionConfiguration.blurEnabled=2!==this._mode,this._compositionConfiguration.blurEnabled&&(this.techniques.precompile(u,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.glowStage=1,this.techniques.precompile(u,this._blurVerticalConfiguration)),this.techniques.precompile(f,this._compositionConfiguration)}render(t){const e=t.find(({name:t})=>t===c.TRANSPARENT_ENVIRONMENT),i=e.getAttachment(w);if(!i?.attachment)return e;const s=e.getTexture(),r=e.getAttachment(C);if(2===this._mode){this._compositionConfiguration.blurEnabled=!1;const t=this.techniques.getCompiled(f,this._compositionConfiguration);if(!t)return this.requestRender(1),e;const o=this.fboCache,{fullWidth:a,fullHeight:n}=this.bindParameters.camera,h=this.renderingContext,c=o.acquire(s.descriptor.width,s.descriptor.height,this.produces);return this._prepareFBO(c,a,n),this._compositionParameters.color=s,this._compositionParameters.emission=i.attachment,h.bindTechnique(t,this.bindParameters,this._compositionParameters),h.screen.draw(),c.attachDepth(r),c.attachColor(i,w),c}this._compositionConfiguration.blurEnabled=!0;const o=this.techniques.getCompiled(u,this._blurHorizontalConfiguration),n=this.techniques.getCompiled(u,this._blurVerticalConfiguration),h=this.techniques.getCompiled(f,this._compositionConfiguration);if(!o||!n||!h)return this.requestRender(1),e;const m=this.fboCache,{fullWidth:l,fullHeight:p}=this.bindParameters.camera,g=this.renderingContext;let _=Math.ceil(l/2),d=Math.ceil(p/2);const b=5;this._blurParameters.emissionsToDownsample=i.attachment,this._blurParameters.inputScale=P,this._blurParameters.blurRadius=this._logicalBlurRadius;for(let a=0;a<b;a++){const t=m.acquire(_,d,"glow horizontal",8);this._prepareFBO(t,_,d),g.bindTechnique(o,this.bindParameters,this._blurParameters),g.screen.draw();const e=m.acquire(_,d,"glow vertical",8);this._blurParameters.inputScale=1,this._blurParameters.emissionsToDownsample=t.getTexture(),this._prepareFBO(e,_,d),g.bindTechnique(n,this.bindParameters,this._blurParameters),g.screen.draw(),t.release(),this._glowResults[a]=e,_=Math.ceil(_/2),d=Math.ceil(d/2),this._blurParameters.emissionsToDownsample=e.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod}const T=this.bindParameters.camera,R=a(T.eye);this._compositionParameters.atmosphereC=R**2-this._atmosphereRadius**2,this._compositionParameters.color=s,this._compositionParameters.emission=i.attachment,this._compositionParameters.lodTexture0=this._glowResults[0].getTexture(),this._compositionParameters.lodTexture1=this._glowResults[1].getTexture(),this._compositionParameters.lodTexture2=this._glowResults[2].getTexture(),this._compositionParameters.lodTexture3=this._glowResults[3].getTexture(),this._compositionParameters.lodTexture4=this._glowResults[4].getTexture();const q=m.acquire(s.descriptor.width,s.descriptor.height,this.produces);return q.acquireColor(w,this.bindParameters.hasFloatOit?8:5,"emissive glow"),this._prepareFBO(q,l,p,!0),g.bindTechnique(h,this.bindParameters,this._compositionParameters),g.screen.draw(),this._glowResults.forEach(t=>t.release()),q.attachDepth(r),q}getPreset(t){return 0===t?this._scatteringFactors.realistic.presets:this._intensity<=.5?d(this._scatteringFactors.cartographicMin.presets,this._scatteringFactors.cartographicDefault.presets,2*this._intensity):d(this._scatteringFactors.cartographicDefault.presets,this._scatteringFactors.cartographicMax.presets,2*(this._intensity-.5))}_prepareFBO(t,e,i,s=!1){const r=this.renderingContext;r.bindFramebuffer(t.fbo),r.setViewport(0,0,e,i),r.setClearColor(0,0,0,0),r.clear(16384),s&&r.clearBuffer(1,n)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setBlurLodCombination:t=>{this._compositionParameters.dispersionWeight=t},getPresets:this.getPreset(this._mode),setMinDisperse:(t,e)=>{0===this._mode?this._scatteringFactors.realistic.presets[t]=e:(this._scatteringFactors.cartographicMin.presets[t]=e,this._scatteringFactors.cartographicMax.presets[t]=e)},toggleTonemapping:t=>{this._compositionConfiguration.tonemappingEnabled=t,this.requestRender(1)}}}};t([r()],T.prototype,"consumes",void 0),t([r()],T.prototype,"produces",void 0),T=t([o("esri.views.3d.webgl-engine.effects.glow.GlowRenderNode")],T);export{T as GlowRenderNode};
2
+ import{__decorate as t}from"tslib";import{lerp as e}from"../../../../../core/mathUtils.js";import{watch as i,syncAndInitial as s}from"../../../../../core/reactiveUtils.js";import{property as r,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{length as a}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as n}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as h}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as c}from"../../../webgl.js";import{TransparentEnvironment as m}from"../TransparentEnvironment.js";import{G as l}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as u}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as p}from"./GlowBlurTechniqueConfiguration.js";import{G as g,a as d,m as _}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as f}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as b}from"./GlowCompositionTechniqueConfiguration.js";import{floatBlendReductionFactor as P}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as w,DepthStencilAttachment as C}from"../../../../webgl/enums.js";let T=class extends m{constructor(t){super(t),this.consumes={required:[c.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=c.TRANSPARENT_ENVIRONMENT,this._blurHorizontalConfiguration=new p,this._blurVerticalConfiguration=new p,this._compositionConfiguration=new b,this._compositionParameters=new g,this._blurParameters=new l,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037,this._mode=0,this._intensity=.5,this._scatteringFactors={realistic:new d([.8,.12,.05,.02,.01,0]),maximumFog:new d([0,.27,.6,1.05,1.58,2.1],!1),cartographicMin:new d([.4,.18,.25,.12,.05,0],!1),cartographicDefault:new d([1.17,1.08,.78,.4,.26,.11],!1),cartographicMax:new d([3.59,3.9,2.46,1.4,.93,.44],!1)},this._glowResults=new Array;const e=h(t.view.spatialReference);this._atmosphereRadius=e.radius+e.atmosphereHeight}initialize(){this.addHandles([i(()=>this._updateFogParameters(),()=>{},s),i(()=>this._updateParameters(),()=>{},s)])}_updateParameters(){const t=this.view.environment.lighting.glow;this._mode=null==t?this.view.environment.atmosphereEnabled?0:2:1,t&&(this._intensity=t.intensity),this._compositionParameters.minDisperse.presets=this.getPreset(this._mode),this.requestRender(1)}_updateFogParameters(){const t=this.view.environment.weather;"sunny"===t.type||"cloudy"===t.type?this._compositionParameters.distanceModifier=0:this._compositionParameters.distanceModifier="foggy"===t.type?e(3e-5,.005,t.fogStrength**3):e(4e-6,2e-4,(t.precipitation??0)**3),this._compositionParameters.maxDisperse=this._scatteringFactors.maximumFog,this.requestRender(1)}precompile(){this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionConfiguration.blurEnabled=2!==this._mode,this._compositionConfiguration.blurEnabled&&(this.techniques.precompile(u,this._blurHorizontalConfiguration),this._blurVerticalConfiguration.glowStage=1,this.techniques.precompile(u,this._blurVerticalConfiguration)),this.techniques.precompile(f,this._compositionConfiguration)}render(t){const e=t.find(({name:t})=>t===c.TRANSPARENT_ENVIRONMENT),i=e.getAttachment(w);if(!i?.attachment)return e;const s=e.getTexture(),r=e.getAttachment(C);if(2===this._mode){this._compositionConfiguration.blurEnabled=!1;const t=this.techniques.getCompiled(f,this._compositionConfiguration);if(!t)return this.requestRender(1),e;const o=this.fboCache,{fullWidth:a,fullHeight:n}=this.bindParameters.camera,h=this.renderingContext,c=o.acquire(s.descriptor.width,s.descriptor.height,this.produces);return this._prepareFBO(c,a,n),this._compositionParameters.color=s,this._compositionParameters.emission=i.attachment,h.bindTechnique(t,this.bindParameters,this._compositionParameters),h.screen.draw(),c.attachDepth(r),c.attachColor(i,w),c}this._compositionConfiguration.blurEnabled=!0;const o=this.techniques.getCompiled(u,this._blurHorizontalConfiguration),n=this.techniques.getCompiled(u,this._blurVerticalConfiguration),h=this.techniques.getCompiled(f,this._compositionConfiguration);if(!o||!n||!h)return this.requestRender(1),e;const m=this.fboCache,{fullWidth:l,fullHeight:p}=this.bindParameters.camera,g=this.renderingContext;let d=Math.ceil(l/2),_=Math.ceil(p/2);const b=5;this._blurParameters.emissionsToDownsample=i.attachment,this._blurParameters.inputScale=P,this._blurParameters.blurRadius=this._logicalBlurRadius;for(let a=0;a<b;a++){const t=m.acquire(d,_,"glow horizontal",8);this._prepareFBO(t,d,_),g.bindTechnique(o,this.bindParameters,this._blurParameters),g.screen.draw();const e=m.acquire(d,_,"glow vertical",8);this._blurParameters.inputScale=1,this._blurParameters.emissionsToDownsample=t.getTexture(),this._prepareFBO(e,d,_),g.bindTechnique(n,this.bindParameters,this._blurParameters),g.screen.draw(),t.release(),this._glowResults[a]=e,d=Math.ceil(d/2),_=Math.ceil(_/2),this._blurParameters.emissionsToDownsample=e.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod}const T=this.bindParameters.camera,R=a(T.eye);this._compositionParameters.atmosphereC=R**2-this._atmosphereRadius**2,this._compositionParameters.color=s,this._compositionParameters.emission=i.attachment,this._compositionParameters.lodTexture0=this._glowResults[0].getTexture(),this._compositionParameters.lodTexture1=this._glowResults[1].getTexture(),this._compositionParameters.lodTexture2=this._glowResults[2].getTexture(),this._compositionParameters.lodTexture3=this._glowResults[3].getTexture(),this._compositionParameters.lodTexture4=this._glowResults[4].getTexture();const q=m.acquire(s.descriptor.width,s.descriptor.height,this.produces);return q.acquireColor(w,this.bindParameters.useFloatBlend?8:5,"emissive glow"),this._prepareFBO(q,l,p,!0),g.bindTechnique(h,this.bindParameters,this._compositionParameters),g.screen.draw(),this._glowResults.forEach(t=>t.release()),q.attachDepth(r),q}getPreset(t){return 0===t?this._scatteringFactors.realistic.presets:this._intensity<=.5?_(this._scatteringFactors.cartographicMin.presets,this._scatteringFactors.cartographicDefault.presets,2*this._intensity):_(this._scatteringFactors.cartographicDefault.presets,this._scatteringFactors.cartographicMax.presets,2*(this._intensity-.5))}_prepareFBO(t,e,i,s=!1){const r=this.renderingContext;r.bindFramebuffer(t.fbo),r.setViewport(0,0,e,i),r.setClearColor(0,0,0,0),r.clear(16384),s&&r.clearBuffer(1,n)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setBlurLodCombination:t=>{this._compositionParameters.dispersionWeight=t},getPresets:this.getPreset(this._mode),setMinDisperse:(t,e)=>{0===this._mode?this._scatteringFactors.realistic.presets[t]=e:(this._scatteringFactors.cartographicMin.presets[t]=e,this._scatteringFactors.cartographicMax.presets[t]=e)},toggleTonemapping:t=>{this._compositionConfiguration.tonemappingEnabled=t,this.requestRender(1)}}}};t([r()],T.prototype,"consumes",void 0),t([r()],T.prototype,"produces",void 0),T=t([o("esri.views.3d.webgl-engine.effects.glow.GlowRenderNode")],T);export{T as GlowRenderNode};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{lerp as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r,sync as n}from"../../../../../core/reactiveUtils.js";import{secondsFromMilliseconds as o}from"../../../../../core/time.js";import{property as a,subclass as d}from"../../../../../core/accessorSupport/decorators.js";import{getReferenceEllipsoid as p}from"../../../../../geometry/ellipsoidUtils.js";import{getContinuousIndexArray as c}from"../../../../../geometry/support/Indices.js";import{InternalRenderCategory as m}from"../../../webgl.js";import{glLayout as h}from"../../../support/buffer/glUtil.js";import{newLayout as f}from"../../../support/buffer/InterleavedLayout.js";import{TransparentEnvironment as u}from"../TransparentEnvironment.js";import{PrecipitationPassParameters as l,PrecipitationTechnique as _}from"./PrecipitationTechnique.js";import{PrecipitationTechniqueConfiguration as b}from"./PrecipitationTechniqueConfiguration.js";import{VertexArrayObject as y}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as w,PrimitiveType as v}from"../../../../webgl/enums.js";import{bindVertexBufferLayout as g}from"../../../../webgl/Util.js";import{fromLayout as P}from"../../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as j}from"../../../../webgl/VertexBuffer.js";let I=class extends u{constructor(e){super(e),this._hasSnowCover=!1,this._rainSpeed=.1,this._snowSpeed=.01,this._numParticles=0,this._passParameters=new l,this._configuration=new b;const{view:t,type:s}=e;this._configuration.type="rainy"===s?0:1,this._passParameters.time=0,this._passParameters.radius=p(t.spatialReference).radius,this.addHandles([i(()=>t.environment.weather,e=>{e.type===s&&this.addHandles([i(()=>e.precipitation,e=>this._adjustParticles(e),r),i(()=>"snowy"===e.type&&"enabled"===e.snowCover,e=>this._hasSnowCover=e,r)])},r)]),this.addHandles(i(()=>t.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>{this._passParameters.opacity=e,1===e&&(this.removeHandles("opacity"),this.addHandles(i(()=>t.stage?.renderer.renderContext.bind.clouds.opacity??1,e=>this._passParameters.opacity=e,r),"opacity"))},n),"opacity")}initialize(){this.addHandles([i(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),r)])}_adjustParticles(e){const s=.35,i=e<.5?t(0,s,2*e):t(s,1,2*(e-.5));this._numParticles=C*i}destroy(){this._numParticles=0,this._vao=s(this._vao),this._instanceIdBuffer=s(this._instanceIdBuffer)}fadeOut(e){this.removeAllHandles(),this.addHandles(i(()=>this.renderContext?.bind.clouds.fadeFactor??1,t=>{this._passParameters.opacity=1-t,1===t&&(this.removeAllHandles(),e())}),"opacity")}get snowCover(){return this._hasSnowCover?this._passParameters.opacity:null}updateAnimation(e){const t=("rainy"===this.type?this._rainSpeed:this._snowSpeed)*o(e.time)%1e5;return this._passParameters.time!==t&&(this._passParameters.time=t,!0)}precompile(){this.view.stage.renderView.techniques.precompile(_,this._configuration)}render(e){const t=e.find(({name:e})=>e===m.TRANSPARENT_ENVIRONMENT),s=this.techniques.getCompiled(_,this._configuration);if(!s)return this.requestRender(1),t;const i=Math.round(this._numParticles*this._passParameters.opacity);if(i<1)return t;const r=this.renderingContext,n=r.bindTechnique(s,this.bindParameters,this._passParameters);return r.setDrawBuffers([w]),this._vao??=A(r),r.bindVAO(this._vao),this._bindInstanceIdBuffer(n.locations),n.assertCompatibleVertexAttributeLocations(this._vao,P(x)),r.drawArraysInstanced(v.TRIANGLES,0,3,i),r.unbindBuffer(34962),t}_bindInstanceIdBuffer(e){const t=this.renderingContext;if(this._instanceIdBuffer)return void t.bindBuffer(this._instanceIdBuffer);const s=c(C);this._instanceIdBuffer=new j(t,x,new Float32Array(s)),g(t,e,this._instanceIdBuffer,0)}};function A(e){const t=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new y(e,new j(e,h(B),t))}e([a({constructOnly:!0})],I.prototype,"type",void 0),I=e([d("esri.views.3d.webgl-engine.effects.precipitation.Precipitation")],I);const C=25e4,B=f().vec3f("position").freeze(),x=h(f().f32("instanceFeatureAttribute"),1);export{I as Precipitation};
2
+ import{__decorate as e}from"tslib";import"../../../../../core/has.js";import{lerp as t}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r,sync as n}from"../../../../../core/reactiveUtils.js";import{secondsFromMilliseconds as o}from"../../../../../core/time.js";import{property as a,subclass as c}from"../../../../../core/accessorSupport/decorators.js";import{getReferenceEllipsoid as d}from"../../../../../geometry/ellipsoidUtils.js";import{getContinuousIndexArray as p}from"../../../../../geometry/support/Indices.js";import{InternalRenderCategory as m}from"../../../webgl.js";import{glLayout as h}from"../../../support/buffer/glUtil.js";import{newLayout as f}from"../../../support/buffer/InterleavedLayout.js";import{TransparentEnvironment as u}from"../TransparentEnvironment.js";import{PrecipitationPassParameters as l,PrecipitationTechnique as _}from"./PrecipitationTechnique.js";import{PrecipitationTechniqueConfiguration as b}from"./PrecipitationTechniqueConfiguration.js";import{VertexArrayObject as y}from"../../lib/VertexArrayObject.js";import{ColorAttachment0 as w,PrimitiveType as v}from"../../../../webgl/enums.js";import{bindVertexBufferLayout as g}from"../../../../webgl/Util.js";import{fromLayout as j}from"../../../../webgl/VertexAttributeLocations.js";import{VertexBuffer as P}from"../../../../webgl/VertexBuffer.js";let I=class extends u{constructor(e){super(e),this._hasSnowCover=!1,this._rainSpeed=.1,this._snowSpeed=.01,this._numParticles=0,this._passParameters=new l,this._configuration=new b,this._forcedTime=null;const{view:t,type:s}=e;this._configuration.type="rainy"===s?0:1,this._passParameters.time=0,this._passParameters.radius=d(t.spatialReference).radius,this.addHandles([i(()=>t.environment.weather,e=>{e.type===s&&this.addHandles([i(()=>e.precipitation,e=>this._adjustParticles(e),r),i(()=>"snowy"===e.type&&"enabled"===e.snowCover,e=>this._hasSnowCover=e,r)])},r)]),this.addHandles(i(()=>t.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>{this._passParameters.opacity=e,1===e&&(this.removeHandles("opacity"),this.addHandles(i(()=>t.stage?.renderer.renderContext.bind.clouds.opacity??1,e=>this._passParameters.opacity=e,r),"opacity"))},n),"opacity")}initialize(){this.addHandles([i(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),r)])}_adjustParticles(e){const s=.35,i=e<.5?t(0,s,2*e):t(s,1,2*(e-.5));this._numParticles=C*i}destroy(){this._numParticles=0,this._vao=s(this._vao),this._instanceIdBuffer=s(this._instanceIdBuffer)}fadeOut(e){this.removeAllHandles(),this.addHandles(i(()=>this.renderContext?.bind.clouds.fadeFactor??1,t=>{this._passParameters.opacity=1-t,1===t&&(this.removeAllHandles(),e())}),"opacity")}get snowCover(){return this._hasSnowCover?this._passParameters.opacity:null}updateAnimation(e){const t=("rainy"===this.type?this._rainSpeed:this._snowSpeed)*o(this._forcedTime??e.time)%1e5;return this._passParameters.time!==t&&(this._passParameters.time=t,!0)}precompile(){this.view.stage.renderView.techniques.precompile(_,this._configuration)}render(e){const t=e.find(({name:e})=>e===m.TRANSPARENT_ENVIRONMENT),s=this.techniques.getCompiled(_,this._configuration);if(!s)return this.requestRender(1),t;const i=Math.round(this._numParticles*this._passParameters.opacity);if(i<1)return t;const r=this.renderingContext,n=r.bindTechnique(s,this.bindParameters,this._passParameters);return r.setDrawBuffers([w]),this._vao??=A(r),r.bindVAO(this._vao),this._bindInstanceIdBuffer(n.locations),n.assertCompatibleVertexAttributeLocations(this._vao,j(x)),r.drawArraysInstanced(v.TRIANGLES,0,3,i),r.unbindBuffer(34962),t}_bindInstanceIdBuffer(e){const t=this.renderingContext;if(this._instanceIdBuffer)return void t.bindBuffer(this._instanceIdBuffer);const s=p(C);this._instanceIdBuffer=new P(t,x,new Float32Array(s)),g(t,e,this._instanceIdBuffer,0)}get test(){}};function A(e){const t=new Float32Array([-1,0,1,1,0,-1,1,0,1]);return new y(e,new P(e,h(B),t))}e([a({constructOnly:!0})],I.prototype,"type",void 0),I=e([c("esri.views.3d.webgl-engine.effects.precipitation.Precipitation")],I);const C=25e4,B=f().vec3f("position").freeze(),x=h(f().f32("instanceFeatureAttribute"),1);export{I as Precipitation};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as s}from"../../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../../core/time.js";import{property as a,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as m}from"../../../webgl.js";import p from"../../../webgl/RenderNode.js";import{distanceFadeEnd as c,distanceFadeStart as h}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{g as l}from"../../../../../chunks/SSAO.glsl.js";import{SSAOBlurTechnique as u}from"./SSAOBlurTechnique.js";import{noiseData as d}from"./SSAONoiseData.js";import{SSAOPassParameters as f,BlurDrawParameters as b}from"./SSAOParameters.js";import{SSAOTechnique as w}from"./SSAOTechnique.js";import{DepthStencilAttachment as S}from"../../../../webgl/enums.js";import _ from"../../../../webgl/Texture.js";import{TextureDescriptor as T}from"../../../../webgl/TextureDescriptor.js";const P=2;let g=class extends p{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=m.SSAO,this.isEnabled=()=>!1,this._enableTime=i(0),this._passParameters=new f,this._drawParameters=new b}initialize(){const e=Uint8Array.from(atob(d),e=>e.charCodeAt(0)),r=new T(32);r.wrapMode=33071,r.pixelFormat=6407,r.wrapMode=10497,r.hasMipmap=!0,this._passParameters.noiseTexture=new _(this.renderingContext,r,e),this.addHandles(s(()=>this.isEnabled(),()=>this._enableTime=i(0)))}destroy(){this._passParameters.noiseTexture=t(this._passParameters.noiseTexture)}precompile(){this.techniques.precompile(w),this.techniques.precompile(u)}render(e){const t=e.find(({name:e})=>"normals"===e),s=t?.getTexture(),a=t?.getTexture(S);if(!s||!a)return;const o=this.techniques.getCompiled(w),p=this.techniques.getCompiled(u);if(!o||!p)return this._enableTime=i(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=i(performance.now()));const d=this.renderingContext,f=this.view.qualitySettings.fadeDuration,b=this.bindParameters,_=b.camera,T=_.relativeElevation,g=r((c-T)/(c-h),0,1),j=f>0?Math.min(f,performance.now()-this._enableTime)/f:1,q=j*g;this._passParameters.normalTexture=s,this._passParameters.depthTexture=a,this._passParameters.projScale=1/_.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*x/l(_)**6*q;const v=_.fullViewport[2],A=_.fullViewport[3],C=this.fboCache.acquire(v,A,"ssao input",2);d.bindFramebuffer(C.fbo),d.setViewport(0,0,v,A),d.bindTechnique(o,b,this._passParameters,this._drawParameters),d.screen.draw();const y=Math.round(v/P),O=Math.round(A/P),V=this.fboCache.acquire(y,O,"ssao blur",0);d.bindFramebuffer(V.fbo),this._drawParameters.colorTexture=C.getTexture(),n(this._drawParameters.blurSize,0,P/A),d.bindTechnique(p,b,this._passParameters,this._drawParameters),d.setViewport(0,0,y,O),d.screen.draw(),C.release();const M=this.fboCache.acquire(y,O,m.SSAO,0);return d.bindFramebuffer(M.fbo),d.setViewport(0,0,v,A),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParameters.colorTexture=V.getTexture(),n(this._drawParameters.blurSize,P/v,0),d.bindTechnique(p,b,this._passParameters,this._drawParameters),d.setViewport(0,0,y,O),d.screen.draw(),d.setViewport4fv(_.fullViewport),V.release(),j<1&&this.requestRender(2),M}};e([a()],g.prototype,"consumes",void 0),e([a()],g.prototype,"produces",void 0),e([a({constructOnly:!0})],g.prototype,"isEnabled",void 0),g=e([o("esri.views.3d.webgl-engine.effects.ssao.SSAO")],g);const x=.5;export{g as SSAO,P as blurSizePixels};
2
+ import{__decorate as e}from"tslib";import{clamp as r}from"../../../../../core/mathUtils.js";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as s}from"../../../../../core/reactiveUtils.js";import{Milliseconds as i}from"../../../../../core/time.js";import{property as a,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as n}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{InternalRenderCategory as m}from"../../../webgl.js";import p from"../../../webgl/RenderNode.js";import{distanceFadeEnd as c,distanceFadeStart as h}from"../../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{g as l}from"../../../../../chunks/SSAO.glsl.js";import{SSAOBlurTechnique as u}from"./SSAOBlurTechnique.js";import{noiseData as d}from"./SSAONoiseData.js";import{SSAOPassParameters as f,BlurDrawParameters as b}from"./SSAOParameters.js";import{SSAOTechnique as w}from"./SSAOTechnique.js";import{DepthStencilAttachment as T}from"../../../../webgl/enums.js";import _ from"../../../../webgl/Texture.js";import{TextureDescriptor as P}from"../../../../webgl/TextureDescriptor.js";const S=2;let g=class extends p{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=m.AMBIENT_ILLUMINATION,this.isEnabled=()=>!1,this._enableTime=i(0),this._passParameters=new f,this._drawParameters=new b}initialize(){const e=Uint8Array.from(atob(d),e=>e.charCodeAt(0)),r=new P(32);r.wrapMode=33071,r.pixelFormat=6407,r.wrapMode=10497,r.hasMipmap=!0,this._passParameters.noiseTexture=new _(this.renderingContext,r,e),this.addHandles(s(()=>this.isEnabled(),()=>this._enableTime=i(0)))}destroy(){this._passParameters.noiseTexture=t(this._passParameters.noiseTexture)}precompile(){this.techniques.precompile(w),this.techniques.precompile(u)}render(e){const t=e.find(({name:e})=>"normals"===e),s=t?.getTexture(),a=t?.getTexture(T);if(!s||!a)return;const o=this.techniques.getCompiled(w),p=this.techniques.getCompiled(u);if(!o||!p)return this._enableTime=i(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=i(performance.now()));const d=this.renderingContext,f=this.view.qualitySettings.fadeDuration,b=this.bindParameters,_=b.camera,P=_.relativeElevation,g=r((c-P)/(c-h),0,1),j=f>0?Math.min(f,performance.now()-this._enableTime)/f:1,q=j*g;this._passParameters.normalTexture=s,this._passParameters.depthTexture=a,this._passParameters.projScale=1/_.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*x/l(_)**6*q;const A=_.fullViewport[2],v=_.fullViewport[3],C=this.fboCache.acquire(A,v,"ssao input",2);d.bindFramebuffer(C.fbo),d.setViewport(0,0,A,v),d.bindTechnique(o,b,this._passParameters,this._drawParameters),d.screen.draw();const y=Math.round(A/S),M=Math.round(v/S),O=this.fboCache.acquire(y,M,"ssao blur",0);d.bindFramebuffer(O.fbo),this._drawParameters.colorTexture=C.getTexture(),n(this._drawParameters.blurSize,0,S/v),d.bindTechnique(p,b,this._passParameters,this._drawParameters),d.setViewport(0,0,y,M),d.screen.draw(),C.release();const I=this.fboCache.acquire(y,M,m.AMBIENT_ILLUMINATION,0);return d.bindFramebuffer(I.fbo),d.setViewport(0,0,A,v),d.setClearColor(1,1,1,0),d.clear(16384),this._drawParameters.colorTexture=O.getTexture(),n(this._drawParameters.blurSize,S/A,0),d.bindTechnique(p,b,this._passParameters,this._drawParameters),d.setViewport(0,0,y,M),d.screen.draw(),d.setViewport4fv(_.fullViewport),O.release(),j<1&&this.requestRender(2),I}};e([a()],g.prototype,"consumes",void 0),e([a()],g.prototype,"produces",void 0),e([a({constructOnly:!0})],g.prototype,"isEnabled",void 0),g=e([o("esri.views.3d.webgl-engine.effects.ssao.SSAO")],g);const x=.5;export{g as SSAO,S as blurSizePixels};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{O as e}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as t}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as i}from"./OITBlendTechniqueConfiguration.js";import{OITDimTechnique as s}from"./OITDimTechnique.js";import{ColorAttachment2 as r,ColorAttachment1 as o,DrawBufferNone as n}from"../../../../webgl/enums.js";class a{constructor(t){this._techniques=t,this._parameters=new e,this._configuration=new i}precompile({hasFloatOit:e,hasEmission:i},r,o){this._configuration.hasFloatOit=e.value,this._configuration.hasEmission=i,this._configuration.computeHudOcclusion=r,this._configuration.frontFaceMask=1===o,this._techniques.precompile(t,this._configuration),i&&1!==o&&this._techniques.precompile(s)}blend(e,i,a,u,c,h,m){if(this._configuration.hasFloatOit=u.hasFloatOit.value,this._configuration.hasEmission=c,this._configuration.computeHudOcclusion=h,this._configuration.frontFaceMask=1===m,this._parameters.colorTexture=i.getTexture(),this._parameters.alphaTexture=i.getTexture(c?r:o),this._parameters.frontFaceTexture=a.getTexture(),c){if(1!==m){const t=this._techniques.get(s);e.bindTechnique(t,u,this._parameters);const i=e.setDrawBuffers([n,o]);e.screen.draw(),e.setDrawBuffers(i)}this._parameters.emissionTexture=i.getTexture(o),this._parameters.emissionFrontFaceTexture=a.getTexture(o)}const f=this._techniques.get(t,this._configuration);e.bindTechnique(f,u,this._parameters),e.screen.draw()}}export{a as OITBlend};
2
+ import{O as e}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as t}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as i}from"./OITBlendTechniqueConfiguration.js";import{OITDimTechnique as s}from"./OITDimTechnique.js";import{ColorAttachment2 as r,ColorAttachment1 as n,DrawBufferNone as o}from"../../../../webgl/enums.js";class a{constructor(t){this._techniques=t,this._parameters=new e,this._configuration=new i}precompile({useFloatBlend:e,hasEmission:i},r,n){this._configuration.useFloatBlend=e.value,this._configuration.hasEmission=i,this._configuration.computeHudOcclusion=r,this._configuration.frontFaceMask=1===n,this._techniques.precompile(t,this._configuration),i&&1!==n&&this._techniques.precompile(s)}blend(e,i,a,u,c,h,m){if(this._configuration.useFloatBlend=u.useFloatBlend.value,this._configuration.hasEmission=c,this._configuration.computeHudOcclusion=h,this._configuration.frontFaceMask=1===m,this._parameters.colorTexture=i.getTexture(),this._parameters.alphaTexture=i.getTexture(c?r:n),this._parameters.frontFaceTexture=a.getTexture(),c){if(1!==m){const t=this._techniques.get(s);e.bindTechnique(t,u,this._parameters);const i=e.setDrawBuffers([o,n]);e.screen.draw(),e.setDrawBuffers(i)}this._parameters.emissionTexture=i.getTexture(n),this._parameters.emissionFrontFaceTexture=a.getTexture(n)}const f=this._techniques.get(t,this._configuration);e.bindTechnique(f,u,this._parameters),e.screen.draw()}}export{a as OITBlend};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as o}from"tslib";import{parameter as t,ShaderTechniqueConfiguration as s}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class i extends s{constructor(){super(...arguments),this.hasFloatOit=!0,this.hasEmission=!1,this.computeHudOcclusion=!1,this.frontFaceMask=!1}}o([t()],i.prototype,"hasFloatOit",void 0),o([t()],i.prototype,"hasEmission",void 0),o([t()],i.prototype,"computeHudOcclusion",void 0),o([t()],i.prototype,"frontFaceMask",void 0);export{i as OITBlendTechniqueConfiguration};
2
+ import{__decorate as o}from"tslib";import{parameter as t,ShaderTechniqueConfiguration as s}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class e extends s{constructor(){super(...arguments),this.useFloatBlend=!0,this.hasEmission=!1,this.computeHudOcclusion=!1,this.frontFaceMask=!1}}o([t()],e.prototype,"useFloatBlend",void 0),o([t()],e.prototype,"hasEmission",void 0),o([t()],e.prototype,"computeHudOcclusion",void 0),o([t()],e.prototype,"frontFaceMask",void 0);export{e as OITBlendTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{releaseMaybe as t}from"../../../../core/maybe.js";import{signal as i}from"../../../../core/signal.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import s from"../../webgl/RenderCamera.js";import{CloudsParameters as r}from"../effects/clouds/CloudsParameters.js";import{OITPolygonOffsetLimit as n}from"./OrderIndependentTransparency.js";import{SceneLighting as l}from"../lighting/SceneLighting.js";class g{constructor(t,i){this.width=t,this.height=i}}class o{constructor(t,e){this._rctx=t,this.shadowMap=e,this._output=0,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.hasEmission=!1,this.hasFloatOit=i(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillEnabled=!1,this._camera=new s,this._inverseViewport=h(),this._oldLighting=new l,this._newLighting=new l,this._fadedLighting=new l,this._lighting=this._newLighting,this.ssr=new a,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.highlights=new Array,this.highlightOrderMap=new Map,this.highlightMixOrigin=h(),this.highlightMixTexture=null,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new r,this.shadowHighlightsVisible=!1}destroy(){this._camera=null,this.contentCamera=null,this.depth=t(this.depth),this.geometryDepth=null,this.mainDepth=null,this.overlay=null,this.ssao=null,this.terrainDepth=null,this.shadowMap?.dispose()}get output(){return this._output}set output(t){this._output!==t&&(this._output=t,this._rctx.resetDrawBuffers(t))}get camera(){return this._camera}set camera(t){this._camera=t,this._inverseViewport[0]=1/t.fullViewport[2],this._inverseViewport[1]=1/t.fullViewport[3]}get enableOITOffset(){return 1===this.output&&this.camera.relativeElevation<n}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(t,i,e,h){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=i,this._newLighting.globalFactor=e,this._newLighting.set(t),this._oldLighting.updateLegacy(),1===h&&this.clouds.requestFade(),this.fadeLighting()}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(t){t&&(t.name="geometry depth"),this._depth=t}get occluder(){return 11===this.slot||12===this.slot?this.slot:null}}class a{constructor(){this.fadeFactor=1,this.reprojectionMatrix=e()}}export{o as BindParameters,g as ViewportSize};
2
+ import{releaseMaybe as t}from"../../../../core/maybe.js";import{signal as i}from"../../../../core/signal.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import s from"../../webgl/RenderCamera.js";import{CloudsParameters as r}from"../effects/clouds/CloudsParameters.js";import{OITPolygonOffsetLimit as n}from"./OrderIndependentTransparency.js";import{SceneLighting as l}from"../lighting/SceneLighting.js";class g{constructor(t,i){this.width=t,this.height=i}}class o{constructor(t,e){this._rctx=t,this.shadowMap=e,this._output=0,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.hasEmission=!1,this.useFloatBlend=i(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillEnabled=!1,this._camera=new s,this._inverseViewport=h(),this._oldLighting=new l,this._newLighting=new l,this._fadedLighting=new l,this._lighting=this._newLighting,this.ssr=new a,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.highlights=new Array,this.highlightOrderMap=new Map,this.highlightMixOrigin=h(),this.highlightMixTexture=null,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new r,this.shadowHighlightsVisible=!1}destroy(){this._camera=null,this.contentCamera=null,this.depth=t(this.depth),this.geometryDepth=null,this.mainDepth=null,this.overlay=null,this.ssao=null,this.terrainDepth=null,this.shadowMap?.dispose()}get output(){return this._output}set output(t){this._output!==t&&(this._output=t,this._rctx.resetDrawBuffers(t))}get camera(){return this._camera}set camera(t){this._camera=t,this._inverseViewport[0]=1/t.fullViewport[2],this._inverseViewport[1]=1/t.fullViewport[3]}get enableOITOffset(){return 1===this.output&&this.camera.relativeElevation<n}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(t,i,e,h){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=i,this._newLighting.globalFactor=e,this._newLighting.set(t),this._oldLighting.updateLegacy(),1===h&&this.clouds.requestFade(),this.fadeLighting()}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(t){t&&(t.name="geometry depth"),this._depth=t}get occluder(){return 11===this.slot||12===this.slot?this.slot:null}}class a{constructor(){this.fadeFactor=1,this.reprojectionMatrix=e()}}export{o as BindParameters,g as ViewportSize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{releaseMaybe as t}from"../../../../core/maybe.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as s,ZEROS as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ViewportSize as r}from"./BindParameters.js";import{ColorAttachment1 as o}from"../../../webgl/enums.js";import{ensureAttachmentMaxSize as h}from"../../../webgl/FramebufferObject.js";class l{constructor(t,i){this._fbos=t,this._bind=i,this._size=new r(0,0),this._clearColor=s()}dispose(){this._color=t(this._color),this.releaseDepth()}initialize(t,s,e){const r=this._color;return this._color=null,this.releaseDepth(),this._size.width=t,this._size.height=s,h(this._size,this._fbos.rctx.parameters.maxTextureSize),i(this._clearColor,e),r}releaseDepth(){this._color?.detachDepth(),this._depth=t(this._depth)}update(t){return this.bind(),this._color=t(this.color),this._color}bind(){const{rctx:t}=this._fbos,i=null==this._color;this.color.attachDepth(this.depth),t.bindFramebuffer(this.color.fbo),i&&(t.setClearStencil(0),t.setClearColor(this._clearColor[0],this._clearColor[1],this._clearColor[2],this._clearColor[3]),t.clear(17664),this._bind.hasEmission&&t.clearBuffer(1,e))}get size(){return this._size}get color(){return this._ensureColor()}get depth(){return this._depth??=this._fbos.acquireDepth(13,this._size.width,this._size.height,"main depth"),this._depth}_ensureColor(){return this._color??=this._bind.hasEmission?this._fbos.acquire(this._size.width,this._size.height,"main color").acquireColor(o,this._bind.hasFloatOit.value?8:5,"emissive"):this._fbos.acquire(this._size.width,this._size.height,"main color"),this._color}}export{l as MainFramebuffer};
2
+ import{releaseMaybe as t}from"../../../../core/maybe.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as e,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ViewportSize as r}from"./BindParameters.js";import{ColorAttachment1 as o}from"../../../webgl/enums.js";import{ensureAttachmentMaxSize as h}from"../../../webgl/FramebufferObject.js";class l{constructor(t,i){this._fbos=t,this._bind=i,this._size=new r(0,0),this._clearColor=e()}dispose(){this._color=t(this._color),this.releaseDepth()}initialize(t,e,s){const r=this._color;return this._color=null,this.releaseDepth(),this._size.width=t,this._size.height=e,h(this._size,this._fbos.rctx.parameters.maxTextureSize),i(this._clearColor,s),r}releaseDepth(){this._color?.detachDepth(),this._depth=t(this._depth)}update(t){return this.bind(),this._color=t(this.color),this._color}bind(){const{rctx:t}=this._fbos,i=null==this._color;this.color.attachDepth(this.depth),t.bindFramebuffer(this.color.fbo),i&&(t.setClearStencil(0),t.setClearColor(this._clearColor[0],this._clearColor[1],this._clearColor[2],this._clearColor[3]),t.clear(17664),this._bind.hasEmission&&t.clearBuffer(1,s))}get size(){return this._size}get color(){return this._ensureColor()}get depth(){return this._depth??=this._fbos.acquireDepth(13,this._size.width,this._size.height,"main depth"),this._depth}_ensureColor(){return this._color??=this._bind.hasEmission?this._fbos.acquire(this._size.width,this._size.height,"main color").acquireColor(o,this._bind.useFloatBlend.value?8:5,"emissive"):this._fbos.acquire(this._size.width,this._size.height,"main color"),this._color}}export{l as MainFramebuffer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{generateUID as r}from"../../../../core/uid.js";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import{updateParameters as e}from"../materials/internal/MaterialUtil.js";import{NoParameters as i}from"../../../webgl/NoParameters.js";class s{constructor(t,i){this.id=r(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new i,e(this._parameters,t),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(r){return!1}setParameters(r,t=!0){e(this._parameters,r)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(r){}shouldRender(r){return this.visible&&this.isVisibleForOutput(r.output)&&(!this.parameters.isDecoration||r.bind.decorations)&&0!==(this.parameters.renderOccluded&r.renderOccludedMask)}isVisibleForOutput(r){return!0}get renderPriority(){return this._renderPriority}set renderPriority(r){r!==this._renderPriority&&(this._renderPriority=r,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return!1}getConfiguration(r){return this.updateConfiguration(r),this._configuration}updateConfiguration(r){this._configuration.output=r.output,this._configuration.hasEmission=r.hasEmission&&t(r.output),this._configuration.hasHighlightMixTexture=10===r.output&&null!=r.highlightMixTexture,this._configuration.hasFloatOit=r.hasFloatOit.value}}class a extends i{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}export{s as Material,a as MaterialParameters};
2
+ import{generateUID as r}from"../../../../core/uid.js";import{isColor as e}from"../core/shaderLibrary/ShaderOutput.js";import{updateParameters as t}from"../materials/internal/MaterialUtil.js";import{NoParameters as s}from"../../../webgl/NoParameters.js";class i{constructor(e,s){this.id=r(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new s,t(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(r){return!1}setParameters(r,e=!0){t(this._parameters,r)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(r){}shouldRender(r){return this.visible&&this.isVisibleForOutput(r.output)&&(!this.parameters.isDecoration||r.bind.decorations)&&0!==(this.parameters.renderOccluded&r.renderOccludedMask)}isVisibleForOutput(r){return!0}get renderPriority(){return this._renderPriority}set renderPriority(r){r!==this._renderPriority&&(this._renderPriority=r,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return!1}getConfiguration(r){return this.updateConfiguration(r),this._configuration}updateConfiguration(r){this._configuration.output=r.output,this._configuration.hasEmission=r.hasEmission&&e(r.output),this._configuration.hasHighlightMixTexture=10===r.output&&null!=r.highlightMixTexture,this._configuration.useFloatBlend=r.useFloatBlend.value}}class a extends s{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}export{i as Material,a as MaterialParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as s,abortMaybe as i,destroyMaybe as a,releaseMaybe as n}from"../../../../core/maybe.js";import{throwIfAborted as h}from"../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as d,initial as _,sync as u}from"../../../../core/reactiveUtils.js";import{signal as l}from"../../../../core/signal.js";import{property as m,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{equals as c,invert as f,multiply as g}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as T}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as w,ZEROS as E}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as C}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as A,InternalRenderCategory as S,AllRenderNodeOutputs as R,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{minNearDistanceInMeters as O}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import"../../webgl/ManagedDepthAttachment.js";import{FBOCache as I}from"../core/FBOCache.js";import{RenderPassManager as y}from"../core/renderPasses/RenderPassManager.js";import{isColor as F}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as v}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as H}from"../effects/RenderNodes.js";import{RenderPluginManager as N}from"../effects/RenderPluginManager.js";import{WeatherFader as q}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as G}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as M}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as L,renderHighlightBuffer as U}from"../effects/highlight/Highlight.js";import{OITBlend as j}from"../effects/transparency/OITBlend.js";import{AnimationTimer as V}from"./AnimationTimer.js";import{AnimationTimeStep as B}from"./AnimationTimeStep.js";import{BoundingInfo as k}from"./BoundingInfo.js";import{Compositor as W}from"./Compositor.js";import{DepthRange as z}from"./DepthRange.js";import{depthRangeFromScene as Q}from"./depthRangeUtils.js";import{MainFramebuffer as Y}from"./MainFramebuffer.js";import{RenderContext as $,defaultRenderOccludedMask as J}from"./RenderContext.js";import{RendererBase as K}from"./RendererBase.js";import{setupFeatureDefaults as Z}from"./RenderFeature.js";import{RenderPluginInput as X}from"./RenderPluginInput.js";import{ShadowAccumulator as ee}from"./ShadowAccumulator.js";import{ShadowMap as te}from"./ShadowMap.js";import re from"./SliceHelper.js";import{MergedRenderer as se}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ie}from"../parts/renderUtils.js";import{RendererPerformanceInfo as ae,PerformanceCategory as ne}from"../statistics/RendererPerformanceInfo.js";import{PixelType as he,ColorAttachment1 as oe,ColorAttachment2 as de,ColorAttachment0 as _e}from"../../../webgl/enums.js";let ue=class extends K{constructor(e,t,r,s,i){super({stage:e}),this._techniques=r,this._rctx=s,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new y,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=w(0,0,0,1),this._sliceHelper=new re,this.sceneDepthRange=l(z.Infinite),this._state=l(2),this._hasAnimations=!1,this._animationTimestep=new B,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=l(0),this._hasOIT8=!has("disable-feature:oit8"),this._hasIOSEmission=this._hasOIT8&&!has("disable-feature:oit8-emissive"),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new X,this._hasTransparentGeometry=!1,this._oitCallouts=!1,this._releaseNodeInputs=e=>{for(const t of Ce)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._debugNeedsDepth=!1,this._fboCache=new I(s),this._compositor=new W(s,r),this._renderStateFeatures=l(Z(e.view.qualityProfile));const a=new te(this._fboCache,e.viewingMode);this._renderContext=new $(this._rctx,a,r),this._framebuffer=new Y(this._fboCache,this._bindParameters),this._performanceInfo=new ae(this._rctx),this._blit=new M(r),this._shadowAccumulator=new ee(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,r,s)=>{const i=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,s,!0,i),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},i),this._nodes=new H(this._renderContext),this._plugins=new N({renderContext:this._renderContext,techniques:r,materials:t,requestRender:i,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new q({view:e.view,context:this._renderContext}),this.addHandles([o(()=>e.view.state.camera,()=>i(),d),o(()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},_),o(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():E;T(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},d),o(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=v,d),o(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),o(()=>this._bindParameters.clouds.data?.state,()=>i(),u),o(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},_),o(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},d)])}destroy(){this._gpuTimerHandle=s(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,k.prune(),se.prune(),C()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new j(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=Z(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(s=>s.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&this.isFeatureEnabled(5)}get _hasHighlights(){return this._plugins.produces(10,2,4,19,13,14,15)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,13,14,15)}get hasSSAO(){return this.isFeatureEnabled(4)&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmission(){return this._plugins.hasEmitters&&(this._hasIOSEmission||this.hasFloatOit)}get highResolutionAtmosphere(){return this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=n(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=n(this._bindParameters.depth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");h(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:De(this.stage.view.resourceController)});return this.addHandles(o(()=>r.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&c(this._bindParameters.ssr.reprojectionMatrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){void 0!==e.shadowMap&&this._bindParameters.shadowMap.enabled!==e.shadowMap&&(this._bindParameters.shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get hasFloatOit(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(10)}get oitEnabled(){return this.hasFloatOit||this._hasOIT8}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,...be),has.water=this._plugins.produces(4,20),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new V(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?s(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r,s=!1){try{return this._isRendering=!0,this._render(e,t,r,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new ie(this._pluginInput.get(A.FINAL),null)}_render(e,t,r,s){const i=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=e;this._state.value=h,this._renderContext.time=t,this._bindParameters.output=0,this._bindParameters.hasEmission=this._hasEmission,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.hasFloatOit.value=this.hasFloatOit;const d=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=d?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(S.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(S.CUTFILL_COMPUTATION),this._renderOverlay(),a.setGLViewport(this._rctx);const _=this._framebuffer,u=_.initialize(a.fullWidth,a.fullHeight,this._backgroundColor);this.hasReflections?(u?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=u):u?.release(),this._ensureBindParametersCamera(a,n),this._ensureBindParametersWeatherFader(this._renderContext.time),this._plugins.sortTestsTransparentOrderedSlots(Te),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!s,this._hasTransparentGeometry=this._plugins.produces(0,...me),this._precompilePrepasses(),this.performanceInfo.advance(ne.PREPARE);const l=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,l),this._pluginInput.set("normals",this._renderNormals()),this._renderSSAOAndDepth(),this._renderShadowAccumulation(l,!i),this._oitCallouts=this._hasTransparentGeometry&&this.oitEnabled,this._ensureBindParametersSSR(t),this._precompileShaders(),this._bindParameters.output=0,_.bind(),this._bindParameters.mainDepth=_.depth.attachment,this._renderOpaque(),this._renderTransparent(),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(S.FOCUSAREA,this._renderFocusAreaGeometry()),_.update(e=>this._renderNodes(S.TRANSPARENT_ENVIRONMENT,e)),_.update(e=>this._renderNodes(S.VIEWSHED,e)),_.update(e=>this._renderNodes(S.LASERLINES,e)),_.update(e=>this._renderNodes(S.FOCUSAREA_COLOR,e)),this._pluginInput.release(S.FOCUSAREA),_.update(e=>this._renderNodes(S.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const m=2===r?this._renderObjectAndLayerIdColor():null;_.update(e=>this._renderNodes(A.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),_.update(e=>this._renderNodes(S.ANTIALIASING,e));const p=this._hasPhotoshopTerrain||!this._hasTransparentGeometry?1:2;let c;return this._bindParameters.hasEmission=!1,this._hasHUDHighlights&&_.update(e=>this._renderHUD(p,e)),_.update(e=>this._renderNodes(S.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||_.update(e=>this._renderHUD(p,e)),this._bindParameters.hasEmission=this._hasEmission,_.update(e=>this._renderNodes(S.MAGNIFIER,e)),_.update(e=>this._renderNodes(A.FINAL,e)),i&&this._blit.toFramebuffer(this._rctx,_.color,this._bindParameters),this.onPostRender?.(),this._releaseFBOs(),_.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(c=_.color,c.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ie(c,m)}_precompileShaders(){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const e=this._bindParameters.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(e,S.OPAQUE_ENVIRONMENT,S.PRE_TRANSPARENT);const t=this._bindParameters;if(t.terrainDepthTest=t.cullAboveTerrain=this._needsTerrainDepth,this._bindParameters.output=3,this._plugins.precompile(...pe),this._needsDepth&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._bindParameters.output=0,this._plugins.precompile(...pe),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,S.FOCUSAREA);const r=this._hasPhotoshopTerrain&&!this._needsTerrainDepth;this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,r,e),this._oitCallouts||this._plugins.precompile(16),t.terrainDepthTest=t.cullAboveTerrain=!1,this._nodes.precompile(e,S.TRANSPARENT_ENVIRONMENT,S.VIEWSHED,S.CUTFILL_COMPUTATION,S.LASERLINES,S.FOCUSAREA_COLOR,S.OCCLUDED,S.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.hasEmission=!1,this._precompileHUD(0),this._precompileHUD(1),t.hasEmission=this._hasEmission,this._hasHighlights&&(t.highlights.forEach((e,r)=>{t.highlightLevel=r,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(14,13)}),t.highlightLevel=null,this._nodes.precompile(e,S.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(e,A.COMPOSITE,S.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(S.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(ne.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:r}=this._framebuffer.size;let s=this.fboCache.acquire(t,r,"olid");return s.acquireDepth(13),s=this._nodes.render(s,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(ne.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,s}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let s=0;t?s=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const i=Math.max(e,s);this._animationTimestep.frame(i,r)}}readMainDepth(e,t){const{mainDepth:r,camera:s}=this._bindParameters;if(!r)return;const i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(i.fbo),s.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(E),this._compositor.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,he.UNSIGNED_BYTE,t),i.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquire(r,s,"edges"),a=this._bindParameters.geometryDepth,n=()=>t.render(this._bindParameters,e);this._renderToTargets(n,i,a??this._framebuffer.depth,E),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?ne.OPAQUE_EDGES:ne.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(ne.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const s=this._bindParameters.shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(7,s),s.clear(),this._renderShadowCascades(6,s)):this._renderShadowCascades(5),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(ne.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(S.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const r=this._bindParameters.output;t.bindFramebuffer();for(const s of t.cascades)s.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(s.camera,s.camera),this.renderAllGeometry(e);t.finish(e),this._bindParameters.output=r}get _needsDepth(){return this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements&&this.oitEnabled||this._hasPhotoshopTerrain}_renderSSAOAndDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(S.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth?.release(),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(ne.DEPTH)):(e.detachDepth(),this._bindParameters.depth=n(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(this._bindParameters.depth=n(this._bindParameters.depth),!this._needsDepth)return;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"geometry depth",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(ne.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._bindParameters.output;this._bindParameters.output=3;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"terrain depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=s.obtainDepthTexture(),s.release(),this._bindParameters.output=e}_renderGeometryDepth(){if(this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),!this._needsTerrainDepth)return;const e=this._bindParameters.output,{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"geometry depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(3),this._bindParameters.output=e,this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return z.Zero;const t=Q(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=z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<G)return void(this.sceneDepthRange.value=z.Infinite);const t=e.clone();t.near=O,t.far=1e10;const r=Q(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",...R,S.VIEWSHED,S.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(4),this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&this._precompileAllGeometry(5),this.hasSSAO&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,S.SSAO)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"normals",5);s.acquireDepth(13),this._rctx.bindFramebuffer(s.fbo),this._rctx.clearFramebuffer(E,!0,!0),this._bindParameters.output=4,this._plugins.render(...ce);const i=this._nodes.optional("normals",...R,S.VIEWSHED);return s.retain(e+i-1),this.performanceInfo.advance(ne.NORMALS),s}_renderSSAO(){const e=this._pluginInput.get("normals");if(this.hasSSAO&&e)return this._bindParameters.ssao=this._nodes.produce(S.SSAO,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(ne.SSAO),this._bindParameters.ssao}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...pe),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...ge);this._renderContext.renderOccludedMask=J}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(10),this.renderSlots(e,...ge),this._renderContext.renderOccludedMask=J}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...we[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(17),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(15)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillReferenceDepth(){const e=this._bindParameters.output;this._bindParameters.output=9,this._plugins.precompile(...Ee),this._bindParameters.output=e}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=s}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Ee),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._bindParameters.output=s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...fe)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...le),this._nodes.precompile(this._bindParameters.hasEmission,S.CUTFILL_COLOR,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...le)}_renderTransparentGeometry(){this._plugins.render(...me),this._oitCallouts&&this._plugins.render(16)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"transparent terrain"),s=()=>this._plugins.render(6);return this._renderToTargets(s,r,this._framebuffer.depth,E),this.performanceInfo.advance(ne.TRANSPARENT_TERRAIN),r}_renderTransparentGround(){this._plugins.render(...pe)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquireDepth(this._hudDepthFormat,t,r,"line callouts");this._renderToTargets(e,this._framebuffer.color,s,void 0,!0,!0),s.release()}else this._plugins.render(16)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,r=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this.oitEnabled?(this._bindParameters.output=1,this._plugins.precompile(...be),this._bindParameters.output=2,this._plugins.precompile(...be),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1)):(this._bindParameters.output=0,this._plugins.precompile(...be)),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...be)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=r}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;if(this.oitEnabled){const r=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const s=!!t.getTexture(oe);this._compositor.compositePreMultipliedAlpha(this._bindParameters,r.getTexture(),s),r.release()}else if(this._bindParameters.output=0,0===e){const t=()=>this._renderHUDElements(e),{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquireDepth(this._hudDepthFormat,r,s,"hud");this._renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(this._hudDepthFormat),this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(256),this._renderHUDElements(e),t.detachDepth();return this.performanceInfo.advance(0===e?ne.HUD_OCCLUDED:ne.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,{width:s,height:i}=this._framebuffer.size,{highlights:a}=r,n=a.length>L?3:1,h=e.acquire(s,i,"highlights",n);h.acquireDepth(13);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),U(t,e,s,i,r,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(ne.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...Pe),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(ne.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this.oitEnabled&&F(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...me),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=2,this._plugins.precompile(...me),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=0):this._plugins.precompile(...me)}_renderOIT(e,t=2){const r=1===e,{width:s,height:i}=this._framebuffer.size,a=r?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.hasFloatOit.value?8:5,d=h.output;h.output=1;const _=r?"oit hud":"oit",u=this.fboCache.acquire(s,i,_,o),l=h.hasEmission&&(0===e||1!==t);l&&u.acquireColor(oe,o,"oit emissive");const m=l?de:oe;u.acquireColor(m,this.hasFloatOit?7:0,"oit alpha"),r||u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer([0,0,0,1]),l&&this._rctx.clearBuffer(1,E),a(),u.detachDepth(),h.output=2;const p=this.fboCache.acquire(s,i,r?"oit hud front":"oit front");l&&p.acquireColor(oe,o,"oit emissive front"),r?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(E,r),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!r;let f;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,r?(f=this.fboCache.acquire(s,i,"oit hud composite"),this._rctx.bindFramebuffer(f.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(m,0,"hud occlusion"),this._rctx.clearBuffer(m-_e,E)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,u,p,h,l,c,e),f?.detachDepth(),r||(this._rctx.bindFramebuffer(p.fbo),this._framebuffer.bind(),c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(m))),p.release(),u.release(),h.output=d,f}get _hudDepthFormat(){return this.isFeatureEnabled(8)?13:12}get _needsOpaquePass(){return this.plugins.produces(0,...le)||this.plugins.produces(5,...le)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._framebuffer.update(e=>this._renderNodes(S.CUTFILL_COLOR,e)),this._plugins.render(2,3));const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(A.OPAQUE,t,e)),this.fboCache.debugCallback?.(A.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(S.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(S.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderTransparent(){const e=this._framebuffer;e.bind(),e.update(e=>this._renderNodes(S.PRE_TRANSPARENT,e)),this.fboCache.debugCallback?.(S.PRE_TRANSPARENT,e.color.fbo),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),e.update(e=>this._renderNodes(A.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(A.TRANSPARENT,e.color.fbo),this._renderGeometryDepth(),this._needsTerrainDepth||this._oitCallouts||this._plugins.render(16),this._renderEdges(0);const t=this._renderPhotoshopTerrain(),r=t?.getTexture();r&&this._renderHUD(0,e.color),this._bindParameters.cullAboveTerrain=!1,r&&(e.bind(),this._compositor.compositePreMultipliedAlpha(this._bindParameters,r),t?.release(),this._needsTerrainDepth&&(this._renderEdges(1),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(ne.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(ne.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(ne.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,r=!1){const s=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(s,t.fbo);const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),i}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(e){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,e,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=b:(f(Se,this._bindParameters.camera.viewMatrix),f(Ae,this._bindParameters.camera.projectionMatrix),g(Re,Se,Ae),g(Re,this._renderContext.lastFrameCamera.viewMatrix,Re),g(Re,this._renderContext.lastFrameCamera.projectionMatrix,Re),this._reprojectionMatrix=Re);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=b,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,s){this._bindParameters.updateLighting(e,t,r,s),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}_renderToTargets(e,t,r,s,i=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(s,i,a),e(),t.detachDepth()}get test(){}};e([m({readOnly:!0})],ue.prototype,"highResolutionAtmosphere",null),e([m()],ue.prototype,"_edgeView",void 0),e([m()],ue.prototype,"updating",null),ue=e([p("esri.views.3d.webgl-engine.lib.Renderer")],ue);const le=[0,1,2,3],me=[8,7,4,5],pe=[6,8,7],ce=[0,1,2,4,...pe],fe=[3,5],ge=[2,4,9],be=[17,13,15,14],Pe=[4,5,2,3,0,1,...pe],Te=[4,9,5,12],we={0:[14],1:[13],2:[14,13],3:[14,13]},Ee=[0,1,...pe],Ce=["normals","highlights"],Ae=P(),Se=P(),Re=P();function De(e){return t=>e.immediate.schedule(t)}export{ue as Renderer};
2
+ import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{removeMaybe as s,abortMaybe as i,destroyMaybe as a,releaseMaybe as n}from"../../../../core/maybe.js";import{throwIfAborted as h}from"../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as d,initial as _,sync as l}from"../../../../core/reactiveUtils.js";import{signal as u}from"../../../../core/signal.js";import{property as m,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{equals as c,invert as f,multiply as g}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as b,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as T}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as w,ZEROS as E}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as C}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as A,InternalRenderCategory as R,AllRenderNodeOutputs as D,AllInternalRenderNodeOutputs as S}from"../../webgl.js";import{minNearDistanceInMeters as I}from"../../state/NearFarHeuristic.js";import{debugFlags as x}from"../../support/debugFlags.js";import"../../webgl/ManagedDepthAttachment.js";import{FBOCache as O}from"../core/FBOCache.js";import{RenderPassManager as y}from"../core/renderPasses/RenderPassManager.js";import{isColor as F}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as N}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{hasOit8Bit as v,hasEmissive8Bit as H}from"../effects/fboFormatUtils.js";import{RenderNodes as M}from"../effects/RenderNodes.js";import{RenderPluginManager as q}from"../effects/RenderPluginManager.js";import{WeatherFader as G}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as L}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as j}from"../effects/highlight/Highlight.js";import{OITBlend as V}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as z}from"./BoundingInfo.js";import{Compositor as Q}from"./Compositor.js";import{DepthRange as Y}from"./DepthRange.js";import{depthRangeFromScene as $}from"./depthRangeUtils.js";import{MainFramebuffer as J}from"./MainFramebuffer.js";import{RenderContext as K,defaultRenderOccludedMask as Z}from"./RenderContext.js";import{RendererBase as X}from"./RendererBase.js";import{setupFeatureDefaults as ee}from"./RenderFeature.js";import{RenderPluginInput as te}from"./RenderPluginInput.js";import{ShadowAccumulator as re}from"./ShadowAccumulator.js";import{ShadowMap as se}from"./ShadowMap.js";import ie from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{PixelType as de,ColorAttachment1 as _e,ColorAttachment2 as le,ColorAttachment0 as ue}from"../../../webgl/enums.js";let me=class extends X{constructor(e,t,r,s,i){super({stage:e}),this._techniques=r,this._rctx=s,this._requestRender=i,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new y,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=w(0,0,0,1),this._sliceHelper=new ie,this.sceneDepthRange=u(Y.Infinite),this._state=u(2),this._hasOit8Bit=v(),this._hasEmissive8Bit=H(),this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=u(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new te,this._hasTransparentGeometry=!1,this._oitCallouts=!1,this._releaseNodeInputs=e=>{for(const t of Re)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._debugNeedsDepth=!1,this._fboCache=new O(s),this._compositor=new Q(s,r),this._renderStateFeatures=u(ee(e.view.qualityProfile));const a=new se(this._fboCache,e.viewingMode);this._renderContext=new K(this._rctx,a,r),this._framebuffer=new J(this._fboCache,this._bindParameters),this._performanceInfo=new he(this._rctx),this._blit=new U(r),this._shadowAccumulator=new re(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,r,s)=>{const i=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,s,!0,i),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},i),this._nodes=new M(this._renderContext),this._plugins=new q({renderContext:this._renderContext,techniques:r,materials:t,requestRender:i,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new G({view:e.view,context:this._renderContext}),this.addHandles([o(()=>e.view.state.camera,()=>i(),d),o(()=>x.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},i()},_),o(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():E;T(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),i()},d),o(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=N,d),o(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},l),o(()=>this._bindParameters.clouds.data?.state,()=>i(),l),o(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,i()},_),o(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},d)])}destroy(){this._gpuTimerHandle=s(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=i(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,z.prune(),ae.prune(),C()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new V(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=ee(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(s=>s.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&this.isFeatureEnabled(5)}get _hasHighlights(){return this._plugins.produces(10,2,4,19,13,14,15)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,13,14,15)}get hasSSAO(){return this.isFeatureEnabled(4)&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmission(){return this._plugins.hasEmitters&&(this._hasEmissive8Bit||this.hasFloatBlend)}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(10)}get oitEnabled(){return this.hasFloatBlend||this._hasOit8Bit}get highResolutionAtmosphere(){return this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=n(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");h(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:xe(this.stage.view.resourceController)});return this.addHandles(o(()=>r.updating,()=>this._requestRender(),l)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&c(this._bindParameters.ssr.reprojectionMatrix,b)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){void 0!==e.shadowMap&&this._bindParameters.shadowMap.enabled!==e.shadowMap&&(this._bindParameters.shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,10)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,14),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...Te),has.water=this._plugins.produces(4,20),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new k(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?s(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r,s=!1){try{return this._isRendering=!0,this._render(e,t,r,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(A.FINAL),null)}_render(e,t,r,s){const i=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:a,contentCamera:h,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._renderContext.time=t,this._bindParameters.output=0,this._bindParameters.hasEmission=this._hasEmission,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const _=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=_?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(R.CUTFILL_COMPUTATION),this._renderOverlay(),a.setGLViewport(this._rctx);const l=this._framebuffer,u=l.initialize(a.fullWidth,a.fullHeight,this._backgroundColor);this.hasReflections?(u?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=u):u?.release(),this._ensureBindParametersCamera(a,h),this._ensureBindParametersWeatherFader(this._renderContext.time),this._plugins.sortTestsTransparentOrderedSlots(Ee),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!s,this._hasTransparentGeometry=this._plugins.produces(0,...ce),this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const m=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,m),this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowAccumulation(m,!i),this._oitCallouts=this._hasTransparentGeometry&&this.oitEnabled,this._ensureBindParametersSSR(t),this._precompileShaders(),this._bindParameters.output=0,l.bind(),this._bindParameters.mainDepth=l.depth.attachment,this._renderOpaque(),this._renderTransparent(),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),l.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),l.update(e=>this._renderNodes(R.VIEWSHED,e)),l.update(e=>this._renderNodes(R.LASERLINES,e)),l.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),l.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const p=2===r?this._renderObjectAndLayerIdColor():null;l.update(e=>this._renderNodes(A.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.depth=n(this._bindParameters.depth),l.update(e=>this._renderNodes(R.ANTIALIASING,e));const c=this._hasPhotoshopTerrain||!this._hasTransparentGeometry?1:2;let f;return this._bindParameters.hasEmission=!1,this._hasHUDHighlights&&l.update(e=>this._renderHUD(c,e)),l.update(e=>this._renderNodes(R.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||l.update(e=>this._renderHUD(c,e)),this._bindParameters.hasEmission=this._hasEmission,l.update(e=>this._renderNodes(R.MAGNIFIER,e)),l.update(e=>this._renderNodes(A.FINAL,e)),i&&this._blit.toFramebuffer(this._rctx,l.color,this._bindParameters),this.onPostRender?.(),this._releaseFBOs(),l.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(f=l.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ne(f,p)}_precompileShaders(){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const e=this._bindParameters.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(e,R.OPAQUE_ENVIRONMENT,R.PRE_TRANSPARENT);const t=this._bindParameters;if(t.terrainDepthTest=t.cullAboveTerrain=this._needsTerrainDepth,this._bindParameters.output=3,this._plugins.precompile(...fe),this._needsDepth&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._bindParameters.output=0,this._plugins.precompile(...fe),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1)}this._hasTransparentGeometry&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(t.cullAboveTerrain=!1,this._precompileTransparentGeometry(),t.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(e,R.FOCUSAREA);const r=this._hasPhotoshopTerrain&&!this._needsTerrainDepth;this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,r,e),this._oitCallouts||this._plugins.precompile(16),t.terrainDepthTest=t.cullAboveTerrain=!1,this._nodes.precompile(e,R.TRANSPARENT_ENVIRONMENT,R.VIEWSHED,R.CUTFILL_COMPUTATION,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.hasEmission=!1,this._precompileHUD(0),this._precompileHUD(1),t.hasEmission=this._hasEmission,this._hasHighlights&&(t.highlights.forEach((e,r)=>{t.highlightLevel=r,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(14,13)}),t.highlightLevel=null,this._nodes.precompile(e,R.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(e,A.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:r}=this._framebuffer.size;let s=this.fboCache.acquire(t,r,"olid");return s.acquireDepth(13),s=this._nodes.render(s,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(oe.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,s}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let s=0;t?s=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const i=Math.max(e,s);this._animationTimestep.frame(i,r)}}readMainDepth(e,t){const{mainDepth:r,camera:s}=this._bindParameters;if(!r)return;const i=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(i.fbo),s.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(E),this._compositor.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),i.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,de.UNSIGNED_BYTE,t),i.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquire(r,s,"edges"),a=this._bindParameters.geometryDepth,n=()=>t.render(this._bindParameters,e);this._renderToTargets(n,i,a??this._framebuffer.depth,E),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const s=this._bindParameters.shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(7,s),s.clear(),this._renderShadowCascades(6,s)):this._renderShadowCascades(5),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(oe.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(R.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const r=this._bindParameters.output;t.bindFramebuffer();for(const s of t.cascades)s.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(s.camera,s.camera),this.renderAllGeometry(e);t.finish(e),this._bindParameters.output=r}get _needsDepth(){return this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements&&this.oitEnabled||this._hasPhotoshopTerrain}_renderAmbientIlluminationAndDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(R.AMBIENT_ILLUMINATION,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth?.release(),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(oe.DEPTH)):(e.detachDepth(),this._bindParameters.depth=n(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(this._bindParameters.depth=n(this._bindParameters.depth),!this._needsDepth)return;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"geometry depth",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(oe.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=n(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._bindParameters.output;this._bindParameters.output=3;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"terrain depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=s.obtainDepthTexture(),s.release(),this._bindParameters.output=e}_renderGeometryDepth(){if(this._bindParameters.geometryDepth=n(this._bindParameters.geometryDepth),!this._needsTerrainDepth)return;const e=this._bindParameters.output,{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"geometry depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(3),this._bindParameters.output=e,this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Y.Zero;const t=$(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Y.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<L)return void(this.sceneDepthRange.value=Y.Infinite);const t=e.clone();t.near=I,t.far=1e10;const r=$(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",...D,R.VIEWSHED,R.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(4),this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&this._precompileAllGeometry(5),this.hasSSAO&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,R.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquire(t,r,"normals",5);s.acquireDepth(13),this._rctx.bindFramebuffer(s.fbo),this._rctx.clearFramebuffer(E,!0,!0),this._bindParameters.output=4,this._plugins.render(...ge);const i=this._nodes.optional("normals",...D,R.VIEWSHED);return s.retain(e+i-1),this.performanceInfo.advance(oe.NORMALS),s}_renderSSAO(){const e=this._pluginInput.get("normals");if(this.hasSSAO&&e)return this._bindParameters.ssao=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(oe.AMBIENT_ILLUMINATION),this._bindParameters.ssao}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...fe),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Pe);this._renderContext.renderOccludedMask=Z}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(10),this.renderSlots(e,...Pe),this._renderContext.renderOccludedMask=Z}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(17),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(15)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillReferenceDepth(){const e=this._bindParameters.output;this._bindParameters.output=9,this._plugins.precompile(...Ae),this._bindParameters.output=e}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=s}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,s=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Ae),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._bindParameters.output=s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...be)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...pe),this._nodes.precompile(this._bindParameters.hasEmission,R.CUTFILL_COLOR,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...pe)}_renderTransparentGeometry(){this._plugins.render(...ce),this._oitCallouts&&this._plugins.render(16)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const{width:e,height:t}=this._framebuffer.size,r=this.fboCache.acquire(e,t,"transparent terrain"),s=()=>this._plugins.render(6);return this._renderToTargets(s,r,this._framebuffer.depth,E),this.performanceInfo.advance(oe.TRANSPARENT_TERRAIN),r}_renderTransparentGround(){this._plugins.render(...fe)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),{width:t,height:r}=this._framebuffer.size,s=this.fboCache.acquireDepth(this._hudDepthFormat,t,r,"line callouts");this._renderToTargets(e,this._framebuffer.color,s,void 0,!0,!0),s.release()}else this._plugins.render(16)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,r=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this.oitEnabled?(this._bindParameters.output=1,this._plugins.precompile(...Te),this._bindParameters.output=2,this._plugins.precompile(...Te),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1)):(this._bindParameters.output=0,this._plugins.precompile(...Te)),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...Te)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=r}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;if(this.oitEnabled){const r=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const s=!!t.getTexture(_e);this._compositor.compositePreMultipliedAlpha(this._bindParameters,r.getTexture(),s),r.release()}else if(this._bindParameters.output=0,0===e){const t=()=>this._renderHUDElements(e),{width:r,height:s}=this._framebuffer.size,i=this.fboCache.acquireDepth(this._hudDepthFormat,r,s,"hud");this._renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(this._hudDepthFormat),this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(256),this._renderHUDElements(e),t.detachDepth();return this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,{width:s,height:i}=this._framebuffer.size,{highlights:a}=r,n=a.length>B?3:1,h=e.acquire(s,i,"highlights",n);h.acquireDepth(13);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),j(t,e,s,i,r,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...S)+this._nodes.optional("highlights",...S)-1),h}_renderHighlightGeometries(){this._plugins.render(...we),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this.oitEnabled&&F(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...ce),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=2,this._plugins.precompile(...ce),this._oitCallouts&&this._plugins.precompile(16),this._bindParameters.output=0):this._plugins.precompile(...ce)}_renderOIT(e,t=2){const r=1===e,{width:s,height:i}=this._framebuffer.size,a=r?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const _=r?"oit hud":"oit",l=this.fboCache.acquire(s,i,_,o),u=h.hasEmission&&(0===e||1!==t);u&&l.acquireColor(_e,o,"oit emissive");const m=u?le:_e;l.acquireColor(m,this.hasFloatBlend?7:0,"oit alpha"),r||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,E),a(),l.detachDepth(),h.output=2;const p=this.fboCache.acquire(s,i,r?"oit hud front":"oit front");u&&p.acquireColor(_e,o,"oit emissive front"),r?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(E,r),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!r;let f;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,r?(f=this.fboCache.acquire(s,i,"oit hud composite"),this._rctx.bindFramebuffer(f.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(m,0,"hud occlusion"),this._rctx.clearBuffer(m-ue,E)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,l,p,h,u,c,e),f?.detachDepth(),r||(this._rctx.bindFramebuffer(p.fbo),this._framebuffer.bind(),c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(m))),p.release(),l.release(),h.output=d,f}get _hudDepthFormat(){return this.isFeatureEnabled(8)?13:12}get _needsOpaquePass(){return this.plugins.produces(0,...pe)||this.plugins.produces(5,...pe)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._framebuffer.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),this._plugins.render(2,3));const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(A.OPAQUE,t,e)),this.fboCache.debugCallback?.(A.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderTransparent(){const e=this._framebuffer;e.bind(),e.update(e=>this._renderNodes(R.PRE_TRANSPARENT,e)),this.fboCache.debugCallback?.(R.PRE_TRANSPARENT,e.color.fbo),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),e.update(e=>this._renderNodes(A.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(A.TRANSPARENT,e.color.fbo),this._renderGeometryDepth(),this._needsTerrainDepth||this._oitCallouts||this._plugins.render(16),this._renderEdges(0);const t=this._renderPhotoshopTerrain(),r=t?.getTexture();r&&this._renderHUD(0,e.color),this._bindParameters.cullAboveTerrain=!1,r&&(e.bind(),this._compositor.compositePreMultipliedAlpha(this._bindParameters,r),t?.release(),this._needsTerrainDepth&&(this._renderEdges(1),this._hasTransparentGeometry&&(this.oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(oe.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=n(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(oe.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,r=!1){const s=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(s,t.fbo);const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),i}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(e){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,e,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=b:(f(Se,this._bindParameters.camera.viewMatrix),f(De,this._bindParameters.camera.projectionMatrix),g(Ie,Se,De),g(Ie,this._renderContext.lastFrameCamera.viewMatrix,Ie),g(Ie,this._renderContext.lastFrameCamera.projectionMatrix,Ie),this._reprojectionMatrix=Ie);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=b,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,s){this._bindParameters.updateLighting(e,t,r,s),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}_renderToTargets(e,t,r,s,i=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(s,i,a),e(),t.detachDepth()}get test(){}};e([m({readOnly:!0})],me.prototype,"highResolutionAtmosphere",null),e([m()],me.prototype,"_edgeView",void 0),e([m()],me.prototype,"updating",null),me=e([p("esri.views.3d.webgl-engine.lib.Renderer")],me);const pe=[0,1,2,3],ce=[8,7,4,5],fe=[6,8,7],ge=[0,1,2,4,...fe],be=[3,5],Pe=[2,4,9],Te=[17,13,15,14],we=[4,5,2,3,0,1,...fe],Ee=[4,9,5,12],Ce={0:[14],1:[13],2:[14,13],3:[14,13]},Ae=[0,1,...fe],Re=["normals","highlights"],De=P(),Se=P(),Ie=P();function xe(e){return t=>e.immediate.schedule(t)}export{me as Renderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as i}from"tslib";import{SliceConfiguration as t}from"../core/shaderLibrary/Slice.glsl.js";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends t{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.hasFloatOit=!0,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}i([e()],r.prototype,"hasHighlightMixTexture",void 0),i([e()],r.prototype,"hasFloatOit",void 0);export{r as DefaultTechniqueConfiguration};
2
+ import{__decorate as i}from"tslib";import{SliceConfiguration as e}from"../core/shaderLibrary/Slice.glsl.js";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends e{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}i([t()],r.prototype,"hasHighlightMixTexture",void 0);export{r as DefaultTechniqueConfiguration};
@@ -1,4 +1,4 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{glsl as o}from"../core/shaderModules/glsl.js";function r(r,t){t.hasFloatOit?r.code.add(o`float ditherNoise() { return 0.0; }`):r.code.add(o`float ditherNoise() {
2
+ import{glsl as o}from"../core/shaderModules/glsl.js";function r(r,e){e.useFloatBlend?r.code.add(o`float ditherNoise() { return 0.0; }`):r.code.add(o`float ditherNoise() {
3
3
  return (1.0 / 255.0) * (fract(52.9829189 * fract(dot(gl_FragCoord.xy + gl_FragCoord.z, vec2(0.06711056, 0.00583715)))) - 0.5);
4
4
  }`)}export{r as Dithering};
@@ -1,14 +1,14 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isColor as o,isOITColor as r,isOITFrontFace as i}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as l}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as a}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as s}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{If as t,glsl as e}from"../core/shaderModules/glsl.js";import{alphaCutoff as n}from"./alphaCutoff.glsl.js";import{Dithering as f}from"./Dithering.glsl.js";import{oitResolution as u}from"./oitResolution.glsl.js";function m(m,g){m.include(a,g),m.include(l,g);const{fragment:c,outputs:d}=m;c.include(s);const{output:p,hasEmission:C,discardInvisibleFragments:h,oitPremultipliedAlpha:v,snowCover:b}=g,$=11===p,j=r(p),y=i(p),E=o(p)&&!j;let O=0;(E||j)&&d.add("fragColor","vec4",O++),C&&d.add("fragEmission","vec4",O++),j&&d.add("fragAlpha","float",O++),c.include(n),c.include(u,g),c.include(f,g),c.code.add(e`
2
+ import{isColor as o,isOITColor as l,isOITFrontFace as r}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as i}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as a}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as s}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{If as t,glsl as e}from"../core/shaderModules/glsl.js";import{alphaCutoff as n}from"./alphaCutoff.glsl.js";import{Dithering as f}from"./Dithering.glsl.js";import{oitResolution as u}from"./oitResolution.glsl.js";function m(m,d){m.include(a,d),m.include(i,d);const{fragment:g,outputs:c}=m;g.include(s);const{output:p,hasEmission:C,discardInvisibleFragments:h,oitPremultipliedAlpha:v,snowCover:b}=d,$=11===p,j=l(p),y=r(p),E=o(p)&&!j;let O=0;(E||j)&&c.add("fragColor","vec4",O++),C&&c.add("fragEmission","vec4",O++),j&&c.add("fragAlpha","float",O++),g.include(n),g.include(u,d),g.include(f,d),g.code.add(e`
3
3
  void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${t(b,", float snow")}) {
4
4
  ${t($,"finalColor.a = 1.0;")}
5
5
  ${t(h,"if (finalColor.a < alphaCutoff) { discard; }")}
6
6
  ${t(j||C,"float noise = ditherNoise();")}
7
7
 
8
- ${t(j,`${t(v,"fragColor = finalColor;","fragColor = premultiplyAlpha(finalColor);")}\n fragColor = vec4(fragColor.rgb * oitOutputScale + noise, fragColor.a);\n fragAlpha = finalColor.a * oitOutputScale + noise;`)}
8
+ ${t(j,`${t(v,"fragColor = finalColor;","fragColor = premultiplyAlpha(finalColor);")}\n fragColor = vec4(fragColor.rgb * floatBlendOutputScale + noise, fragColor.a);\n fragAlpha = finalColor.a * floatBlendOutputScale + noise;`)}
9
9
  ${t(y&&v&&h,"finalColor.rgb /= finalColor.a;")}
10
10
  ${t(E,"fragColor = finalColor;")}
11
- ${t(C,`fragEmission = ${t(b,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}\n fragEmission = vec4(fragEmission.rgb * oitOutputScale + noise, fragEmission.a);`)}
11
+ ${t(C,`fragEmission = ${t(b,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}\n fragEmission = vec4(fragEmission.rgb * floatBlendOutputScale + noise, fragEmission.a);`)}
12
12
  calculateOcclusionAndOutputHighlight();
13
13
  ${t($,"outputObjectAndLayerIdColor();")}
14
14
  }