@arcgis/core 4.27.0-next.20230321 → 4.27.0-next.20230323

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 (267) hide show
  1. package/analysis/LineOfSightAnalysisObserver.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/02b6227c156ee0d8eb66.js +1 -0
  4. package/assets/esri/core/workers/chunks/{7e0c65aa61c2ff0c3504.js → 1c98b92933a48cf96c1e.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{a27951dbe83c63f9d01a.js → 26bc91a9d9d7345a3eba.js} +1 -1
  6. package/assets/esri/core/workers/chunks/321f272d4c7ed6b0cb46.js +1 -0
  7. package/assets/esri/core/workers/chunks/{a09cc8e2ff43fe4afa04.js → 375628de4cfc71cb41c1.js} +1 -1
  8. package/assets/esri/core/workers/chunks/47bd558e2ce89f47f908.js +1 -0
  9. package/assets/esri/core/workers/chunks/4cb62855bb1ae608bfde.js +1 -0
  10. package/assets/esri/core/workers/chunks/4f0c2b6b200bf8222fd7.js +1 -0
  11. package/assets/esri/core/workers/chunks/5252f3cc244204edc299.js +1 -0
  12. package/assets/esri/core/workers/chunks/6f952a6464cf9e62dbac.js +1098 -0
  13. package/assets/esri/core/workers/chunks/76d6c1fc25f02bcf258e.js +1 -0
  14. package/assets/esri/core/workers/chunks/{d6ec7682de8fad9718e9.js → 77dccfaf1f9e778973b3.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{c5d872adce711ec61ede.js → 8980c5dc389c27368b73.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{6acaf28cba5d49a98fb6.js → 91b292f310f06a0cbf72.js} +1 -1
  17. package/assets/esri/core/workers/chunks/9bac27976e7a71268b7b.js +1 -0
  18. package/assets/esri/core/workers/chunks/{ff9efa829497557ec26a.js → aa4640a0207e0be224e2.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{81a6f4b43e047c3395c0.js → aebc5091bd4159197ce0.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{c8cd3fde6d8d43ddb954.js → b6cdf4daf07d9e55f61e.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{6b14673a4afd6ef81487.js → c76cabd2d2510a653dff.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{4be7647605300e07e843.js → c90fff7e28ba5b443b11.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{e637e47000f4dc48054d.js → cc7f4fd20443a2acf0f1.js} +1 -1
  24. package/assets/esri/core/workers/chunks/d19e9fab4f4fb765c6a3.js +1 -0
  25. package/assets/esri/core/workers/chunks/d9ef4891c8b0bdd90f5b.js +1 -0
  26. package/assets/esri/core/workers/chunks/{d92d6a43270fb0d366b4.js → de4f5c48efbcee82c3c1.js} +1 -1
  27. package/assets/esri/core/workers/chunks/f6e7948075b3742b4ef9.js +1 -0
  28. package/assets/esri/core/workers/chunks/{32f9b488915a4a8864e5.js → f8b9e0c1671e55b61904.js} +1 -1
  29. package/assets/esri/views/3d/analysis/Slice/images/heading-rotate.ts.svg +7 -28
  30. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.svg +11 -0
  31. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList.json +1 -1
  32. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ar.json +1 -1
  33. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bg.json +1 -1
  34. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bs.json +1 -1
  35. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ca.json +1 -1
  36. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_cs.json +1 -1
  37. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_da.json +1 -1
  38. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_de.json +1 -1
  39. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_el.json +1 -1
  40. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_en.json +1 -1
  41. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_es.json +1 -1
  42. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_et.json +1 -1
  43. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fi.json +1 -1
  44. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fr.json +1 -1
  45. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_he.json +1 -1
  46. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hr.json +1 -1
  47. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hu.json +1 -1
  48. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_id.json +1 -1
  49. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_it.json +1 -1
  50. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ja.json +1 -1
  51. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ko.json +1 -1
  52. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lt.json +1 -1
  53. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lv.json +1 -1
  54. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nb.json +1 -1
  55. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.json +1 -1
  56. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pl.json +1 -1
  57. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-BR.json +1 -1
  58. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-PT.json +1 -1
  59. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ro.json +1 -1
  60. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ru.json +1 -1
  61. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sk.json +1 -1
  62. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sl.json +1 -1
  63. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sr.json +1 -1
  64. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sv.json +1 -1
  65. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_th.json +1 -1
  66. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_tr.json +1 -1
  67. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_uk.json +1 -1
  68. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_vi.json +1 -1
  69. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-CN.json +1 -1
  70. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-HK.json +1 -1
  71. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-TW.json +1 -1
  72. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  73. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  74. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  75. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  76. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  77. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  78. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  79. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  80. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  81. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  82. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  83. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  84. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  85. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  86. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  87. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  88. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  89. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  90. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  91. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  92. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  93. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  94. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  95. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  96. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  97. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  98. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  99. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  100. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  101. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  102. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  103. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  104. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  105. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  106. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  107. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  108. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  109. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  110. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  111. package/assets/esri/widgets/LayerList/t9n/LayerList.json +1 -1
  112. package/assets/esri/widgets/LayerList/t9n/LayerList_ar.json +1 -1
  113. package/assets/esri/widgets/LayerList/t9n/LayerList_bg.json +1 -1
  114. package/assets/esri/widgets/LayerList/t9n/LayerList_bs.json +1 -1
  115. package/assets/esri/widgets/LayerList/t9n/LayerList_ca.json +1 -1
  116. package/assets/esri/widgets/LayerList/t9n/LayerList_cs.json +1 -1
  117. package/assets/esri/widgets/LayerList/t9n/LayerList_da.json +1 -1
  118. package/assets/esri/widgets/LayerList/t9n/LayerList_de.json +1 -1
  119. package/assets/esri/widgets/LayerList/t9n/LayerList_el.json +1 -1
  120. package/assets/esri/widgets/LayerList/t9n/LayerList_en.json +1 -1
  121. package/assets/esri/widgets/LayerList/t9n/LayerList_es.json +1 -1
  122. package/assets/esri/widgets/LayerList/t9n/LayerList_et.json +1 -1
  123. package/assets/esri/widgets/LayerList/t9n/LayerList_fi.json +1 -1
  124. package/assets/esri/widgets/LayerList/t9n/LayerList_fr.json +1 -1
  125. package/assets/esri/widgets/LayerList/t9n/LayerList_he.json +1 -1
  126. package/assets/esri/widgets/LayerList/t9n/LayerList_hr.json +1 -1
  127. package/assets/esri/widgets/LayerList/t9n/LayerList_hu.json +1 -1
  128. package/assets/esri/widgets/LayerList/t9n/LayerList_id.json +1 -1
  129. package/assets/esri/widgets/LayerList/t9n/LayerList_it.json +1 -1
  130. package/assets/esri/widgets/LayerList/t9n/LayerList_ja.json +1 -1
  131. package/assets/esri/widgets/LayerList/t9n/LayerList_ko.json +1 -1
  132. package/assets/esri/widgets/LayerList/t9n/LayerList_lt.json +1 -1
  133. package/assets/esri/widgets/LayerList/t9n/LayerList_lv.json +1 -1
  134. package/assets/esri/widgets/LayerList/t9n/LayerList_nb.json +1 -1
  135. package/assets/esri/widgets/LayerList/t9n/LayerList_nl.json +1 -1
  136. package/assets/esri/widgets/LayerList/t9n/LayerList_pl.json +1 -1
  137. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-BR.json +1 -1
  138. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-PT.json +1 -1
  139. package/assets/esri/widgets/LayerList/t9n/LayerList_ro.json +1 -1
  140. package/assets/esri/widgets/LayerList/t9n/LayerList_ru.json +1 -1
  141. package/assets/esri/widgets/LayerList/t9n/LayerList_sk.json +1 -1
  142. package/assets/esri/widgets/LayerList/t9n/LayerList_sl.json +1 -1
  143. package/assets/esri/widgets/LayerList/t9n/LayerList_sr.json +1 -1
  144. package/assets/esri/widgets/LayerList/t9n/LayerList_sv.json +1 -1
  145. package/assets/esri/widgets/LayerList/t9n/LayerList_th.json +1 -1
  146. package/assets/esri/widgets/LayerList/t9n/LayerList_tr.json +1 -1
  147. package/assets/esri/widgets/LayerList/t9n/LayerList_uk.json +1 -1
  148. package/assets/esri/widgets/LayerList/t9n/LayerList_vi.json +1 -1
  149. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-CN.json +1 -1
  150. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-HK.json +1 -1
  151. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-TW.json +1 -1
  152. package/chunks/ComponentShader.glsl.js +1 -1
  153. package/chunks/DefaultMaterial.glsl.js +4 -4
  154. package/chunks/vec42.js +1 -1
  155. package/core/Loadable.js +1 -1
  156. package/core/accessorSupport/Property.js +1 -1
  157. package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
  158. package/core/analysisThemeUtils.js +1 -1
  159. package/core/maybe.js +1 -1
  160. package/geometry/support/buffer/math/vec4.js +1 -1
  161. package/interfaces.d.ts +1 -1
  162. package/layers/IntegratedMeshLayer.js +1 -1
  163. package/layers/LineOfSightLayer.js +1 -1
  164. package/layers/SceneLayer.js +1 -1
  165. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  166. package/layers/mixins/ImageryTileMixin.js +1 -1
  167. package/layers/mixins/RefreshableLayer.js +1 -1
  168. package/layers/support/SceneFilter.js +1 -1
  169. package/layers/support/SceneModifications.js +1 -1
  170. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  171. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  172. package/package.json +1 -1
  173. package/portal/PortalItemResource.js +1 -1
  174. package/portal/support/resourceUtils.js +1 -1
  175. package/support/revision.js +1 -1
  176. package/symbols/support/utils.js +1 -1
  177. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  178. package/views/2d/viewpointUtils.js +1 -1
  179. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  180. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  181. package/views/3d/analysis/Dimension/settings.js +1 -1
  182. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  183. package/views/3d/analysis/Slice/SliceVisualization.js +1 -1
  184. package/views/3d/analysis/Slice/images/Factory.js +1 -1
  185. package/views/3d/analysis/Slice/images/generateTextures.js +1 -1
  186. package/views/3d/analysis/Slice/images/heading-rotate-svg.js +1 -1
  187. package/views/3d/analysis/Slice/images/tilt-rotate-svg.js +5 -0
  188. package/views/3d/analysis/Slice/settings.js +5 -0
  189. package/views/3d/analysis/Slice/sliceToolConfig.js +1 -1
  190. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  191. package/views/3d/environment/Stars.js +1 -1
  192. package/views/3d/interactive/Manipulator3D.js +1 -1
  193. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  194. package/views/3d/interactive/manipulatorUtils.js +1 -1
  195. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  196. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  197. package/views/3d/layers/PointCloudWorker.js +1 -1
  198. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  199. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  200. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  201. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  202. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  203. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  204. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  205. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  206. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  207. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  208. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  209. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  210. package/views/3d/layers/i3s/PointCloudRendererUtil.js +1 -1
  211. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  212. package/views/3d/layers/i3s/PointGraphic.js +1 -1
  213. package/views/3d/state/ViewState.js +1 -1
  214. package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
  215. package/views/3d/terrain/GeometryState.js +1 -1
  216. package/views/3d/terrain/PatchGeometry.js +1 -1
  217. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  218. package/views/3d/terrain/TileAgent.js +1 -1
  219. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  220. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  221. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  222. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +6 -5
  223. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +1 -1
  224. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +11 -11
  225. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +1 -1
  226. package/views/3d/webgl-engine/lib/AnimationTimeStep.js +1 -1
  227. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  228. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  229. package/views/3d/webgl-engine/lib/Normals.js +5 -0
  230. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  231. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  232. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  233. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  234. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  235. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  236. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  237. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  238. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  239. package/views/LayerViewManager.js +1 -1
  240. package/views/SceneView.js +1 -1
  241. package/views/draw/support/Reshape.js +1 -1
  242. package/views/layers/SceneLayerView.js +1 -1
  243. package/views/support/colorUtils.js +1 -1
  244. package/views/webgl/ShaderTranspiler.js +1 -1
  245. package/widgets/BasemapLayerList.js +1 -1
  246. package/widgets/Daylight/DaylightViewModel.js +1 -1
  247. package/widgets/Expand.js +1 -1
  248. package/widgets/FeatureForm/FieldInput.js +1 -1
  249. package/widgets/LayerList.js +1 -1
  250. package/widgets/Search.js +1 -1
  251. package/widgets/Sketch/SketchViewModel.js +1 -1
  252. package/assets/esri/core/workers/chunks/0487ab23a20ec356ab4c.js +0 -1
  253. package/assets/esri/core/workers/chunks/29ee4f14602caf6967e4.js +0 -1
  254. package/assets/esri/core/workers/chunks/2c0775541cfec9d43acb.js +0 -1
  255. package/assets/esri/core/workers/chunks/4879164b48da9ad4547a.js +0 -1
  256. package/assets/esri/core/workers/chunks/69060e5cffc19e76062a.js +0 -1
  257. package/assets/esri/core/workers/chunks/87edeb09a948122fa030.js +0 -1
  258. package/assets/esri/core/workers/chunks/92951b85676df776961f.js +0 -1100
  259. package/assets/esri/core/workers/chunks/a71a5c8a9aa302bf6f01.js +0 -1
  260. package/assets/esri/core/workers/chunks/ad5c61daaed286c74982.js +0 -1
  261. package/assets/esri/core/workers/chunks/bc002e4dff8859571a7a.js +0 -1
  262. package/assets/esri/core/workers/chunks/ef2d3e84cd58df5f80af.js +0 -1
  263. package/assets/esri/core/workers/chunks/fec5e55e0fbf1710e22d.js +0 -1
  264. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.svg +0 -80
  265. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.png +0 -0
  266. package/views/3d/analysis/Slice/images/tilt-rotate-png.js +0 -5
  267. package/views/3d/webgl-engine/core/shaderLibrary/util/DecodeNormal.glsl.js +0 -8
@@ -2,10 +2,11 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../../../core/compilerUtils.js";import{DecodeNormal as r}from"../util/DecodeNormal.glsl.js";import{glsl as t}from"../../shaderModules/interfaces.js";import{VertexAttribute as o}from"../../../lib/VertexAttribute.js";function i(i,d){switch(d.normalType){case a.CompressedAttribute:i.include(r),i.attributes.add(o.NORMALCOMPRESSED,"vec2"),i.vertex.code.add(t`vec3 normalModel() {
6
- return decodeNormal(normalCompressed);
7
- }`);break;case a.Attribute:i.attributes.add(o.NORMAL,"vec3"),i.vertex.code.add(t`vec3 normalModel() {
5
+ import{neverReached as e}from"../../../../../../core/compilerUtils.js";import{glsl as r}from"../../shaderModules/interfaces.js";import{VertexAttribute as t}from"../../../lib/VertexAttribute.js";function o(o,a){switch(a.normalType){case i.CompressedAttribute:o.attributes.add(t.NORMALCOMPRESSED,"vec2"),o.vertex.code.add(r`vec3 normalModel() {
6
+ float z = 1.0 - abs(normalCompressed.x) - abs(normalCompressed.y);
7
+ return vec3(normalCompressed + sign(normalCompressed) * min(z, 0.0), z);
8
+ }`);break;case i.Attribute:o.attributes.add(t.NORMAL,"vec3"),o.vertex.code.add(r`vec3 normalModel() {
8
9
  return normal;
9
- }`);break;case a.ScreenDerivative:i.fragment.code.add(t`vec3 screenDerivativeNormal(vec3 positionView) {
10
+ }`);break;case i.ScreenDerivative:o.fragment.code.add(r`vec3 screenDerivativeNormal(vec3 positionView) {
10
11
  return normalize(cross(dFdx(positionView), dFdy(positionView)));
11
- }`);break;default:e(d.normalType);case a.COUNT:case a.Ground:}}var a;!function(e){e[e.Attribute=0]="Attribute",e[e.CompressedAttribute=1]="CompressedAttribute",e[e.Ground=2]="Ground",e[e.ScreenDerivative=3]="ScreenDerivative",e[e.COUNT=4]="COUNT"}(a||(a={}));export{i as NormalAttribute,a as NormalAttributeType};
12
+ }`);break;default:e(a.normalType);case i.COUNT:case i.Ground:}}var i;!function(e){e[e.Attribute=0]="Attribute",e[e.CompressedAttribute=1]="CompressedAttribute",e[e.Ground=2]="Ground",e[e.ScreenDerivative=3]="ScreenDerivative",e[e.COUNT=4]="COUNT"}(i||(i={}));export{o as NormalAttribute,i as NormalType};
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as r}from"../../../../../../core/compilerUtils.js";import{c as o}from"../../../../../../chunks/mat3f64.js";import{c as a}from"../../../../../../chunks/vec4f64.js";import{NormalAttributeType as e,NormalAttribute as l}from"./NormalAttribute.glsl.js";import{VertexPosition as m,VertexPositionPassParameters as s,VertexPositionDrawParameters as t}from"./VertexPosition.glsl.js";import{glsl as d}from"../../shaderModules/interfaces.js";import{Matrix3DrawUniform as i}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as n}from"../../shaderModules/Matrix3PassUniform.js";function c(o,a){switch(a.normalType){case e.Attribute:case e.CompressedAttribute:o.include(l,a),o.varyings.add("vNormalWorld","vec3"),o.varyings.add("vNormalView","vec3"),o.vertex.uniforms.add([new i("transformNormalGlobalFromModel",(r=>r.transformNormalGlobalFromModel)),new n("transformNormalViewFromGlobal",(r=>r.transformNormalViewFromGlobal))]),o.vertex.code.add(d`void forwardNormal() {
5
+ import{neverReached as r}from"../../../../../../core/compilerUtils.js";import{c as o}from"../../../../../../chunks/mat3f64.js";import{c as a}from"../../../../../../chunks/vec4f64.js";import{NormalType as e,NormalAttribute as l}from"./NormalAttribute.glsl.js";import{VertexPosition as m,VertexPositionPassParameters as s,VertexPositionDrawParameters as t}from"./VertexPosition.glsl.js";import{glsl as d}from"../../shaderModules/interfaces.js";import{Matrix3DrawUniform as i}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as n}from"../../shaderModules/Matrix3PassUniform.js";function c(o,a){switch(a.normalType){case e.Attribute:case e.CompressedAttribute:o.include(l,a),o.varyings.add("vNormalWorld","vec3"),o.varyings.add("vNormalView","vec3"),o.vertex.uniforms.add([new i("transformNormalGlobalFromModel",(r=>r.transformNormalGlobalFromModel)),new n("transformNormalViewFromGlobal",(r=>r.transformNormalViewFromGlobal))]),o.vertex.code.add(d`void forwardNormal() {
6
6
  vNormalWorld = transformNormalGlobalFromModel * normalModel();
7
7
  vNormalView = transformNormalViewFromGlobal * vNormalWorld;
8
8
  }`);break;case e.Ground:o.include(m,a),o.varyings.add("vNormalWorld","vec3"),o.vertex.code.add(d`
@@ -2,16 +2,16 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{I as o}from"../../../../../../chunks/mat4f64.js";import{addNearFar as r}from"../ForwardLinearDepth.glsl.js";import{ShaderOutput as e}from"../ShaderOutput.js";import{SliceDraw as t}from"../Slice.glsl.js";import{Transform as i}from"../Transform.glsl.js";import{NormalAttribute as a,NormalAttributeType as s}from"../attributes/NormalAttribute.glsl.js";import{ObjectAndLayerIdColor as l}from"../attributes/ObjectAndLayerIdColor.glsl.js";import{TextureCoordinateAttribute as d}from"../attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormal as n}from"../attributes/VertexNormal.glsl.js";import{OutputDepth as c}from"../output/OutputDepth.glsl.js";import{OutputHighlight as u}from"../output/OutputHighlight.glsl.js";import{VisualVariables as m}from"../shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as p}from"../util/AlphaDiscard.glsl.js";import{addProjViewLocalOrigin as v}from"../util/View.glsl.js";import{glsl as f}from"../../shaderModules/interfaces.js";import{Matrix4PassUniform as h}from"../../shaderModules/Matrix4PassUniform.js";import{Texture2DPassUniform as g}from"../../shaderModules/Texture2DPassUniform.js";import{AlphaDiscardMode as x}from"../../../lib/basicInterfaces.js";function j(j,w){const{vertex:O,fragment:b}=j,C=w.hasModelTransformation;C&&O.uniforms.add(new h("model",(r=>null!=r.modelTransformation?r.modelTransformation:o)));const T=w.hasColorTexture&&w.alphaDiscardMode!==x.Opaque;switch(w.output){case e.Depth:case e.Shadow:case e.ShadowHighlight:case e.ShadowExcludeHighlight:case e.ObjectAndLayerIdColor:v(O,w),j.include(i,w),j.include(d,w),j.include(m,w),j.include(c,w),j.include(t,w),j.include(l,w),r(j),j.varyings.add("depth","float"),T&&b.uniforms.add(new g("tex",(o=>o.texture))),O.code.add(f`
5
+ import{I as o}from"../../../../../../chunks/mat4f64.js";import{addNearFar as r}from"../ForwardLinearDepth.glsl.js";import{ShaderOutput as e}from"../ShaderOutput.js";import{SliceDraw as t}from"../Slice.glsl.js";import{Transform as i}from"../Transform.glsl.js";import{NormalAttribute as a,NormalType as s}from"../attributes/NormalAttribute.glsl.js";import{ObjectAndLayerIdColor as l}from"../attributes/ObjectAndLayerIdColor.glsl.js";import{TextureCoordinateAttribute as d}from"../attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormal as n}from"../attributes/VertexNormal.glsl.js";import{OutputDepth as c}from"../output/OutputDepth.glsl.js";import{OutputHighlight as u}from"../output/OutputHighlight.glsl.js";import{VisualVariables as m}from"../shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as p}from"../util/AlphaDiscard.glsl.js";import{addProjViewLocalOrigin as v}from"../util/View.glsl.js";import{glsl as f}from"../../shaderModules/interfaces.js";import{Matrix4PassUniform as h}from"../../shaderModules/Matrix4PassUniform.js";import{Texture2DPassUniform as g}from"../../shaderModules/Texture2DPassUniform.js";import{AlphaDiscardMode as x}from"../../../lib/basicInterfaces.js";function j(j,w){const{vertex:b,fragment:C}=j,O=w.hasModelTransformation;O&&b.uniforms.add(new h("model",(r=>null!=r.modelTransformation?r.modelTransformation:o)));const T=w.hasColorTexture&&w.alphaDiscardMode!==x.Opaque;switch(w.output){case e.Depth:case e.Shadow:case e.ShadowHighlight:case e.ShadowExcludeHighlight:case e.ObjectAndLayerIdColor:v(b,w),j.include(i,w),j.include(d,w),j.include(m,w),j.include(c,w),j.include(t,w),j.include(l,w),r(j),j.varyings.add("depth","float"),T&&C.uniforms.add(new g("tex",(o=>o.texture))),b.code.add(f`
6
6
  void main(void) {
7
7
  vpos = calculateVPos();
8
8
  vpos = subtractOrigin(vpos);
9
9
  vpos = addVerticalOffset(vpos, localOrigin);
10
- gl_Position = transformPositionWithDepth(proj, view, ${C?"model,":""} vpos, nearFar, depth);
10
+ gl_Position = transformPositionWithDepth(proj, view, ${O?"model,":""} vpos, nearFar, depth);
11
11
  forwardTextureCoordinates();
12
12
  forwardObjectAndLayerIdColor();
13
13
  }
14
- `),j.include(p,w),b.code.add(f`
14
+ `),j.include(p,w),C.code.add(f`
15
15
  void main(void) {
16
16
  discardBySlice(vpos);
17
17
  ${T?f`
@@ -19,21 +19,21 @@ import{I as o}from"../../../../../../chunks/mat4f64.js";import{addNearFar as r}f
19
19
  discardOrAdjustAlpha(texColor);`:""}
20
20
  ${w.output===e.ObjectAndLayerIdColor?f`outputObjectAndLayerIdColor();`:f`outputDepth(depth);`}
21
21
  }
22
- `);break;case e.Normal:v(O,w),j.include(i,w),j.include(a,w),j.include(n,w),j.include(d,w),j.include(m,w),T&&b.uniforms.add(new g("tex",(o=>o.texture))),w.normalType===s.ScreenDerivative&&j.varyings.add("vPositionView","vec3"),O.code.add(f`
22
+ `);break;case e.Normal:{v(b,w),j.include(i,w),j.include(a,w),j.include(n,w),j.include(d,w),j.include(m,w),T&&C.uniforms.add(new g("tex",(o=>o.texture))),w.normalType===s.ScreenDerivative&&j.varyings.add("vPositionView","vec3");const o=w.normalType===s.Attribute||w.normalType===s.CompressedAttribute;b.code.add(f`
23
23
  void main(void) {
24
24
  vpos = calculateVPos();
25
25
 
26
- ${w.normalType===s.Attribute?f`
26
+ ${o?f`
27
27
  vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:f`
28
28
  // Get vertex position in camera space for screen-space derivative normals
29
- vPositionView = (view * (${C?"model *":""} vec4(vpos, 1.0))).xyz;
29
+ vPositionView = (view * (${O?"model *":""} vec4(vpos, 1.0))).xyz;
30
30
  `}
31
31
  vpos = subtractOrigin(vpos);
32
32
  vpos = addVerticalOffset(vpos, localOrigin);
33
- gl_Position = transformPosition(proj, view, ${C?"model,":""} vpos);
33
+ gl_Position = transformPosition(proj, view, ${O?"model,":""} vpos);
34
34
  forwardTextureCoordinates();
35
35
  }
36
- `),j.include(t,w),j.include(p,w),b.code.add(f`
36
+ `),j.include(t,w),j.include(p,w),C.code.add(f`
37
37
  void main() {
38
38
  discardBySlice(vpos);
39
39
  ${T?f`
@@ -47,15 +47,15 @@ import{I as o}from"../../../../../../chunks/mat4f64.js";import{addNearFar as r}f
47
47
  }`}
48
48
  fragColor = vec4(0.5 + 0.5 * normal, 1.0);
49
49
  }
50
- `);break;case e.Highlight:v(O,w),j.include(i,w),j.include(d,w),j.include(m,w),T&&b.uniforms.add(new g("tex",(o=>o.texture))),O.code.add(f`
50
+ `);break}case e.Highlight:v(b,w),j.include(i,w),j.include(d,w),j.include(m,w),T&&C.uniforms.add(new g("tex",(o=>o.texture))),b.code.add(f`
51
51
  void main(void) {
52
52
  vpos = calculateVPos();
53
53
  vpos = subtractOrigin(vpos);
54
54
  vpos = addVerticalOffset(vpos, localOrigin);
55
- gl_Position = transformPosition(proj, view, ${C?"model,":""} vpos);
55
+ gl_Position = transformPosition(proj, view, ${O?"model,":""} vpos);
56
56
  forwardTextureCoordinates();
57
57
  }
58
- `),j.include(t,w),j.include(p,w),j.include(u,w),b.code.add(f`
58
+ `),j.include(t,w),j.include(p,w),j.include(u,w),C.code.add(f`
59
59
  void main() {
60
60
  discardBySlice(vpos);
61
61
  ${T?f`
@@ -2,7 +2,7 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../../../../core/compilerUtils.js";import{NormalAttributeType as r}from"../attributes/NormalAttribute.glsl.js";import{VertexNormal as o}from"../attributes/VertexNormal.glsl.js";import{VertexPosition as a}from"../attributes/VertexPosition.glsl.js";import{NormalsDoubleSidedMode as d}from"./Normals.glsl.js";import{glsl as i}from"../../shaderModules/interfaces.js";function l(l,t){const n=l.fragment;switch(t.doubleSidedMode){case d.None:n.code.add(i`vec3 _adjustDoublesided(vec3 normal) {
5
+ import{neverReached as e}from"../../../../../../core/compilerUtils.js";import{NormalType as r}from"../attributes/NormalAttribute.glsl.js";import{VertexNormal as o}from"../attributes/VertexNormal.glsl.js";import{VertexPosition as a}from"../attributes/VertexPosition.glsl.js";import{NormalsDoubleSidedMode as d}from"./Normals.glsl.js";import{glsl as i}from"../../shaderModules/interfaces.js";function l(l,t){const n=l.fragment;switch(t.doubleSidedMode){case d.None:n.code.add(i`vec3 _adjustDoublesided(vec3 normal) {
6
6
  return normal;
7
7
  }`);break;case d.View:l.include(a,t),n.code.add(i`vec3 _adjustDoublesided(vec3 normal) {
8
8
  return dot(normal, vPositionWorldCameraRelative) > 0.0 ? -normal : normal;
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{clamp as t}from"../../../../core/mathUtils.js";import{Milliseconds as i}from"../../../../core/time.js";class e{constructor(){this._step=m,this._dilation=1,this._firstIdleTime=i(0)}frame(e,_){_?0===this._firstIdleTime&&(this._firstIdleTime=i(performance.now())):this._firstIdleTime=i(0);if(has("enable-feature:high-quality-idle")){const t=_?performance.now()-this._firstIdleTime:0;if(t>=r+o)return this._step=i(1/0),void(this._dilation=1);this._dilation=t>=r?h:1}else this._dilation=1;const a=t(e/s,m,n);this._step===1/0?this._step=i(a):this._step=i(this._step*l+a*(1-l))}get value(){return this._step}get timeDilation(){return this._dilation}clear(){this._step=this._firstIdleTime=i(0)}}const s=.5,r=i(6e4),o=i(5e3),h=10,l=.9,_=30,m=i(1e3/1),n=i(1e3/_);export{e as AnimationTimeStep};
5
+ import has from"../../../../core/has.js";import{clamp as t}from"../../../../core/mathUtils.js";import{Milliseconds as i}from"../../../../core/time.js";class e{constructor(){this._step=m,this._dilation=1,this._firstIdleTime=i(0)}frame(e,_){_?0===this._firstIdleTime&&(this._firstIdleTime=i(performance.now())):this._firstIdleTime=i(0);if(has("enable-feature:high-quality-idle")){const t=_?performance.now()-this._firstIdleTime:0;if(t>=r+o)return this._step=i(1/0),void(this._dilation=1);this._dilation=t>=r?h:1}else this._dilation=1;const a=t(e/s,m,n);this._step===1/0?this._step=i(a):this._step=i(this._step*l+a*(1-l))}get value(){return this._step}get timeDilation(){return this._dilation}clear(){this._step=this._firstIdleTime=i(0)}}const s=.5,r=i(12e4),o=i(1e4),h=10,l=.9,_=30,m=i(1e3/1),n=i(1e3/_);export{e as AnimationTimeStep};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{NATIVE_ARRAY_MAX_SIZE as r,isArray as t}from"../../../../core/typedArrayUtil.js";function a(a){if(a.length<r)return Array.from(a);if(t(a))return Float64Array.from(a);if(!("BYTES_PER_ELEMENT"in a))return Array.from(a);switch(a.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(a);case 2:return Uint16Array.from(a);case 4:return Float32Array.from(a);default:return Float64Array.from(a)}}export{a as cloneAttributeData};
5
+ import{NATIVE_ARRAY_MAX_SIZE as r,isArray as t,isUint16Array as a}from"../../../../core/typedArrayUtil.js";function o(o){if(o.length<r)return Array.from(o);if(t(o))return Float64Array.from(o);if(!("BYTES_PER_ELEMENT"in o))return Array.from(o);switch(o.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(o);case 2:return a(o)?Uint16Array.from(o):Int16Array.from(o);case 4:return Float32Array.from(o);default:return Float64Array.from(o)}}export{o as cloneAttributeData};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{VertexAttribute as O}from"./VertexAttribute.js";const E=new Map([[O.POSITION,0],[O.NORMAL,1],[O.UV0,2],[O.COLOR,3],[O.COLORFEATUREATTRIBUTE,3],[O.SIZE,4],[O.TANGENT,4],[O.AUXPOS1,5],[O.SYMBOLCOLOR,5],[O.AUXPOS2,6],[O.FEATUREATTRIBUTE,6],[O.INSTANCEFEATUREATTRIBUTE,6],[O.INSTANCECOLOR,7],[O.OBJECTANDLAYERIDCOLOR,7],[O.OBJECTANDLAYERIDCOLOR_INSTANCED,7],[O.MODEL,8],[O.MODELNORMAL,12],[O.MODELORIGINHI,11],[O.MODELORIGINLO,15]]);export{E as Default3D};
5
+ import{VertexAttribute as O}from"./VertexAttribute.js";const E=new Map([[O.POSITION,0],[O.NORMAL,1],[O.NORMALCOMPRESSED,1],[O.UV0,2],[O.COLOR,3],[O.COLORFEATUREATTRIBUTE,3],[O.SIZE,4],[O.TANGENT,4],[O.AUXPOS1,5],[O.SYMBOLCOLOR,5],[O.AUXPOS2,6],[O.FEATUREATTRIBUTE,6],[O.INSTANCEFEATUREATTRIBUTE,6],[O.INSTANCECOLOR,7],[O.OBJECTANDLAYERIDCOLOR,7],[O.OBJECTANDLAYERIDCOLOR_INSTANCED,7],[O.MODEL,8],[O.MODELNORMAL,12],[O.MODELORIGINHI,11],[O.MODELORIGINLO,15]]);export{E as Default3D};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
+ */
5
+ import{clamp as t}from"../../../../core/mathUtils.js";import{n as a}from"../../../../chunks/vec3.js";function n(t,a,n,s,o,h=2){const c=1/(Math.abs(n)+Math.abs(s)+Math.abs(o)),e=n*c,u=s*c,M=o<=0?(e>=0?1:-1)*(1-Math.abs(u)):e,b=o<=0?(u>=0?1:-1)*(1-Math.abs(e)):u,f=a*h;t[f]=r(M),t[f+1]=r(b)}function s(t){const a=t.length/3,s=new Int16Array(2*a);let o=0;for(let r=0;r<a;++r)n(s,r,t[o++],t[o++],t[o++]);return s}function o(t,n,s,o=2){const r=s*o,c=h(n[r]),e=h(n[r+1]),u=1-Math.abs(c)-Math.abs(e);t[2]=u,u<0?(t[0]=(c>=0?1:-1)*(1-Math.abs(e)),t[1]=(e>=0?1:-1)*(1-Math.abs(c))):(t[0]=c,t[1]=e),a(t,t)}function r(a){return t(Math.round(32767*a),-32767,32767)}function h(a){return t(a/32767,-1,1)}export{n as compressNormal,s as compressNormals,h as decodeInt16,o as decompressNormal,r as encodeInt16};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{RenderTargetHelper as e}from"./RenderTargetHelper.js";import{TransparencyPassType as t}from"./TransparencyPassType.js";import{AlphaMode as r}from"../shaders/CompositingTechniqueConfiguration.js";import{ContextType as i}from"../../../webgl/context-util.js";import{TextureSamplingMode as o,SizedPixelFormat as s,PixelFormat as a,PixelType as h,ClearBufferBit as n}from"../../../webgl/enums.js";class l{constructor(t,r){this._rctx=t,this._compositingHelper=r,this._mainColorTarget=0,this._dimensions={width:4,height:4},this._background={type:"color",color:[0,0,0,1]};const n=t.type===i.WEBGL2;this._renderTargetHelper=new e(t);const l=this._renderTargetHelper;this._mainColorTargets=[l.registerColorTarget({name:"mainColorTarget0"}),l.registerColorTarget({name:"mainColorTarget1"})],this.frontFaceTarget=l.registerColorTarget({name:"frontFaceTarget"});const g=e=>l.registerColorTarget({name:e,dataType:h.FLOAT,internalFormat:n?s.RGBA32F:a.RGBA,samplingMode:o.NEAREST});this.colorFloatTarget=g("colorFloatTarget"),this.alphaFloatTarget=g("alphaFloatTarget"),this.mainDepth=l.registerDepthTarget({name:"mainDepth"}),this.linearDepth=l.registerColorTarget({name:"linearDepth",samplingMode:o.NEAREST}),this.terrainLinearDepth=l.registerColorTarget({name:"terrainLinearDepth"}),this.geometryLinearDepth=l.registerColorTarget({name:"geometryLinearDepth"}),this.normal=l.registerColorTarget({name:"normal"}),this.highlight=l.registerColorTarget({name:"highlight",internalFormat:n?s.RGBA4:a.RGBA,dataType:h.UNSIGNED_SHORT_4_4_4_4}),this.hudVisibility=l.registerColorTarget({name:"hudVisibility",internalFormat:n?s.RGBA4:a.RGBA,dataType:h.UNSIGNED_SHORT_4_4_4_4}),this.tmpColor=l.registerColorTarget({name:"tmpColor"}),this.tmpDepth=l.registerDepthTarget({name:"tmpDepth"}),this.hudColor=l.registerColorTarget({name:"hudColor"})}dispose(){this._renderTargetHelper.dispose()}get width(){return this._dimensions.width}get height(){return this._dimensions.height}set background(e){this._background=e}get background(){return this._background}get currentColorTarget(){return this._mainColorTargets[this._mainColorTarget]}get previousColorTarget(){return this._mainColorTargets[1-this._mainColorTarget]}get framebuffer(){return this.getFramebuffer(this.currentColorTarget,this.mainDepth)}getFramebuffer(e,t){return this._renderTargetHelper.getFramebuffer(this._dimensions,e,t)}get colorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.currentColorTarget)}get depthTexture(){return this._renderTargetHelper.getAllocatedDepthTexture(this.mainDepth)}get linearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.linearDepth)}get terrainLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.terrainLinearDepth)}get geometryLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.geometryLinearDepth)}get lastFrameColorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.previousColorTarget)}get normalTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.normal)}get highlightTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.highlight)}get hudVisibilityTexture(){return this._getColorTexture(this.hudVisibility)}get tmpColorTexture(){return this._getColorTexture(this.tmpColor)}get hudColorTexture(){return this._getColorTexture(this.hudColor)}get mainColorTexture(){return this._getColorTexture(this.currentColorTarget)}setupRenderTarget(e){e||(this._mainColorTarget=0,this.disposeTarget(this._mainColorTargets[1])),this._mainColorTarget=0===this._mainColorTarget&&e?1:0}initializeFrame(e){const t=this._rctx;this._dimensions.width=e.fullWidth,this._dimensions.height=e.fullHeight,this.bindTarget(this.currentColorTarget,this.mainDepth),t.setClearStencil(0);const r=this._background.color;t.setClearColor(r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]),t.clearSafe(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT|n.STENCIL_BUFFER_BIT)}composite(e){null!=this.colorTexture&&this._compositingHelper.composite(e,this.colorTexture,r.None)}renderTmpAndCompositeToMain(e,t,r,i=!1){this.renderToTargets(e,this.tmpColor,i?this.tmpDepth:this.mainDepth,g),this._compositingHelper.composite(t,this._getColorTexture(this.tmpColor),r)}renderHUDVisibility(e,t=!1){this.renderToTargets(e,this.hudVisibility,t?this.tmpDepth:this.mainDepth,T)}compositeTransparentTerrainOntoHUDVisibility(e){this.renderToTargets((()=>this._compositingHelper.compositeHUD(e,this._getColorTexture(this.tmpColor))),this.hudVisibility,this.tmpDepth)}renderOITPass(e,r,i){let o,s;switch(r){case t.Color:o=this.colorFloatTarget,s=[0,0,0,0];break;case t.Alpha:o=this.alphaFloatTarget,s=[1,1,1,1];break;case t.FrontFace:o=this.frontFaceTarget,s=[0,0,0,0]}i?this.renderToTargets(e,o,this.tmpDepth,s,!0,!0):this.renderToTargets(e,o,this.mainDepth,s,!1)}compositeTransparentTerrainOntoMain(e){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),r.PremultipliedAlpha)}compositeOccludedOntoMain(e,t){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),r.PremultipliedAlpha,t)}compositeTransparentOntoOpaque(e,t){t?(this.bindTarget(this.hudColor,this.tmpDepth),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clearSafe(n.COLOR_BUFFER_BIT)):this.bindFramebuffer(),this._compositingHelper.compositeOIT(e,this._getColorTexture(this.colorFloatTarget),this._getColorTexture(this.alphaFloatTarget),this._getColorTexture(this.frontFaceTarget))}bindFramebuffer(){this._rctx.bindFramebuffer(this.framebuffer)}renderDepthDetached(e){this.bindTarget(this.currentColorTarget),e(),this.bindTarget(this.currentColorTarget,this.mainDepth)}disposeTarget(e){this._renderTargetHelper.disposeTargetResource(e)}renderToFBO(e,t,r=!1,i=!1){const o=this._rctx;let s=0;if(t){const e=1e-13,r=Math.max(e,t[3]);o.setClearColor(t[0],t[1],t[2],r),s|=n.COLOR_BUFFER_BIT}r&&(s|=n.DEPTH_BUFFER_BIT),!1===i?i=0:(!0===i&&(i=255),s|=n.STENCIL_BUFFER_BIT),s&&o.clearSafe(s,i),e(),o.gl.flush(),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderToTargets(e,t,r,i,o=!1,s=!1){const a=this.bindTarget(t,r);return this.renderToFBO(e,i,o,s),a}bindTarget(e,t){const r=this._renderTargetHelper.getFramebuffer(this._dimensions,e,t);return this._rctx.bindFramebuffer(r),r}_getColorTexture(e){return this._renderTargetHelper.getColorTexture(e,this._dimensions)}get gpuMemoryUsage(){let e=0;return this._renderTargetHelper&&(e+=this._renderTargetHelper.gpuMemoryUsage),e}}const g=[0,0,0,0],T=[0,1,0,1];export{l as OffscreenRendering};
5
+ import"../../../../core/has.js";import{RenderTargetHelper as e}from"./RenderTargetHelper.js";import{TransparencyPassType as t}from"./TransparencyPassType.js";import{AlphaMode as r}from"../shaders/CompositingTechniqueConfiguration.js";import{ContextType as i}from"../../../webgl/context-util.js";import{TextureSamplingMode as o,SizedPixelFormat as s,PixelFormat as a,PixelType as h,ClearBufferBit as n}from"../../../webgl/enums.js";class l{constructor(t,r){this._rctx=t,this._compositingHelper=r,this._mainColorTarget=0,this._dimensions={width:4,height:4},this._background={type:"color",color:[0,0,0,1]};const n=t.type===i.WEBGL2;this._renderTargetHelper=new e(t);const l=this._renderTargetHelper;this._mainColorTargets=[l.registerColorTarget({name:"mainColorTarget0"}),l.registerColorTarget({name:"mainColorTarget1"})],this.frontFaceTarget=l.registerColorTarget({name:"frontFaceTarget"});const g=e=>l.registerColorTarget({name:e,dataType:h.FLOAT,internalFormat:n?s.RGBA32F:a.RGBA,samplingMode:o.NEAREST});this.colorFloatTarget=g("colorFloatTarget"),this.alphaFloatTarget=g("alphaFloatTarget"),this.mainDepth=l.registerDepthTarget({name:"mainDepth"}),this.linearDepth=l.registerColorTarget({name:"linearDepth",samplingMode:o.NEAREST}),this.terrainLinearDepth=l.registerColorTarget({name:"terrainLinearDepth"}),this.geometryLinearDepth=l.registerColorTarget({name:"geometryLinearDepth"}),this.normal=l.registerColorTarget({name:"normal"}),this.highlight=l.registerColorTarget({name:"highlight",internalFormat:n?s.RGBA4:a.RGBA,dataType:h.UNSIGNED_SHORT_4_4_4_4}),this.hudVisibility=l.registerColorTarget({name:"hudVisibility",internalFormat:n?s.RGBA4:a.RGBA,dataType:h.UNSIGNED_SHORT_4_4_4_4}),this.tmpColor=l.registerColorTarget({name:"tmpColor"}),this.tmpDepth=l.registerDepthTarget({name:"tmpDepth"}),this.hudColor=l.registerColorTarget({name:"hudColor"})}dispose(){this._renderTargetHelper.dispose()}get width(){return this._dimensions.width}get height(){return this._dimensions.height}set background(e){this._background=e}get background(){return this._background}get currentColorTarget(){return this._mainColorTargets[this._mainColorTarget]}get previousColorTarget(){return this._mainColorTargets[1-this._mainColorTarget]}get framebuffer(){return this.getFramebuffer(this.currentColorTarget,this.mainDepth)}getFramebuffer(e,t){return this._renderTargetHelper.getFramebuffer(this._dimensions,e,t)}get colorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.currentColorTarget)}get depthTexture(){return this._renderTargetHelper.getAllocatedDepthTexture(this.mainDepth)}get linearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.linearDepth)}get terrainLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.terrainLinearDepth)}get geometryLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.geometryLinearDepth)}get lastFrameColorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.previousColorTarget)}get normalTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.normal)}get highlightTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.highlight)}get hudVisibilityTexture(){return this._getColorTexture(this.hudVisibility)}get tmpColorTexture(){return this._getColorTexture(this.tmpColor)}get hudColorTexture(){return this._getColorTexture(this.hudColor)}get mainColorTexture(){return this._getColorTexture(this.currentColorTarget)}setupRenderTarget(e){e||(this._mainColorTarget=0,this.disposeTarget(this._mainColorTargets[1])),this._mainColorTarget=0===this._mainColorTarget&&e?1:0}initializeFrame(e){const t=this._rctx;this._dimensions.width=e.fullWidth,this._dimensions.height=e.fullHeight,this.bindTarget(this.currentColorTarget,this.mainDepth),t.setClearStencil(0);const r=this._background.color;t.setClearColor(r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]),t.clearSafe(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT|n.STENCIL_BUFFER_BIT)}composite(e){null!=this.colorTexture&&this._compositingHelper.composite(e,this.colorTexture,r.None)}renderTmpAndCompositeToMain(e,t,r,i=!1){this.renderToTargets(e,this.tmpColor,i?this.tmpDepth:this.mainDepth,g),this._compositingHelper.composite(t,this._getColorTexture(this.tmpColor),r)}renderHUDVisibility(e,t=!1){this.renderToTargets(e,this.hudVisibility,t?this.tmpDepth:this.mainDepth,T)}compositeTransparentTerrainOntoHUDVisibility(e){this.renderToTargets((()=>this._compositingHelper.compositeHUD(e,this._getColorTexture(this.tmpColor))),this.hudVisibility,this.tmpDepth)}renderOITPass(e,r,i){let o,s;switch(r){case t.Color:o=this.colorFloatTarget,s=[0,0,0,0];break;case t.Alpha:o=this.alphaFloatTarget,s=[1,1,1,1];break;case t.FrontFace:o=this.frontFaceTarget,s=[0,0,0,0];break;case t.NONE:case t.COUNT:return}i?this.renderToTargets(e,o,this.tmpDepth,s,!0,!0):this.renderToTargets(e,o,this.mainDepth,s,!1)}compositeTransparentTerrainOntoMain(e){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),r.PremultipliedAlpha)}compositeOccludedOntoMain(e,t){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),r.PremultipliedAlpha,t)}compositeTransparentOntoOpaque(e,t){t?(this.bindTarget(this.hudColor,this.tmpDepth),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clearSafe(n.COLOR_BUFFER_BIT)):this.bindFramebuffer(),this._compositingHelper.compositeOIT(e,this._getColorTexture(this.colorFloatTarget),this._getColorTexture(this.alphaFloatTarget),this._getColorTexture(this.frontFaceTarget))}bindFramebuffer(){this._rctx.bindFramebuffer(this.framebuffer)}renderDepthDetached(e){this.bindTarget(this.currentColorTarget),e(),this.bindTarget(this.currentColorTarget,this.mainDepth)}disposeTarget(e){this._renderTargetHelper.disposeTargetResource(e)}renderToFBO(e,t,r=!1,i=!1){const o=this._rctx;let s=0;if(t){const e=1e-13,r=Math.max(e,t[3]);o.setClearColor(t[0],t[1],t[2],r),s|=n.COLOR_BUFFER_BIT}r&&(s|=n.DEPTH_BUFFER_BIT),!1===i?i=0:(!0===i&&(i=255),s|=n.STENCIL_BUFFER_BIT),s&&o.clearSafe(s,i),e(),o.gl.flush(),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderToTargets(e,t,r,i,o=!1,s=!1){const a=this.bindTarget(t,r);return this.renderToFBO(e,i,o,s),a}bindTarget(e,t){const r=this._renderTargetHelper.getFramebuffer(this._dimensions,e,t);return this._rctx.bindFramebuffer(r),r}_getColorTexture(e){return this._renderTargetHelper.getColorTexture(e,this._dimensions)}get gpuMemoryUsage(){let e=0;return this._renderTargetHelper&&(e+=this._renderTargetHelper.gpuMemoryUsage),e}}const g=[0,0,0,0],T=[0,1,0,1];export{l as OffscreenRendering};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import s from"../../../../core/Handles.js";import has from"../../../../core/has.js";import{removeMaybe as i,disposeMaybe as a,destroyMaybe as n,applySome as h}from"../../../../core/maybe.js";import o from"../../../../core/PooledArray.js";import{watch as d,syncAndInitial as l,initial as _,sync as p}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{h as u,a as f,m as T}from"../../../../chunks/mat4.js";import{I as g,c as R}from"../../../../chunks/mat4f64.js";import{a as E}from"../../../../chunks/boundedPlane.js";import A from"../../support/debugFlags.js";import{TransparencyMode as b}from"../../terrain/TerrainRenderer.js";import{RenderPassManager as S}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as P}from"../core/shaderLibrary/ShaderOutput.js";import{HUDTransparencyRenderStyle as y}from"../core/shaderLibrary/hud/HUDUniforms.js";import{AnimationTimeStep as I}from"./AnimationTimeStep.js";import{Decorations as O,RenderRequestType as w,StencilBits as C}from"./basicInterfaces.js";import{BoundingInfo as D}from"./BoundingInfo.js";import{ZERO as x,union as H}from"./depthRange.js";import{depthRangeFromScene as N}from"./depthRangeUtils.js";import{createEmptyDepthTexture as L}from"./glUtil3D.js";import{Highlight as M}from"./Highlight.js";import{RenderOccludedFlag as v}from"./Material.js";import{OffscreenRendering as U}from"./OffscreenRendering.js";import{RenderContext as F}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as j}from"./rendererUtils.js";import{RenderFeature as G,setupFeatureDefaults as q}from"./RenderFeature.js";import{RenderPluginManager as V}from"./RenderPluginManager.js";import{RenderSlot as B}from"./RenderSlot.js";import{ShadowAccumulator as W}from"./ShadowAccumulator.js";import{ShadowHighlight as Q}from"./ShadowHighlight.js";import{ShadowMap as k,SnapshotSlot as Y}from"./ShadowMap.js";import X from"./SliceHelper.js";import{SmaaRenderPass as z}from"./SmaaRenderPass.js";import{SSAOHelper as J}from"./SSAOHelper.js";import{TransparencyPassType as K}from"./TransparencyPassType.js";import{EdgeView as Z}from"./edgeRendering/EdgeView.js";import{Transparency as $}from"./edgeRendering/interfaces.js";import{MergedRenderer as ee}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as re}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as te,PerformanceCategory as se}from"../statistics/RendererPerformanceInfo.js";import{RenderState as ie}from"../../../support/RenderState.js";import{ClearBufferBit as ae,PixelFormat as ne,PixelType as he}from"../../../webgl/enums.js";let oe=class extends r{get _bindParameters(){return this._renderContext.bindParameters}isFeatureEnabled(e,r=this._state){return this._renderStateFeatures.get(r,e)??!1}setFeatureEnabled(e,r,t){this._renderStateFeatures.set(r,e,t),this.notifyChange("_renderStateFeatures"),this._requestRender()}get _antialiasing(){return this._antialiasingEnabled||this.isFeatureEnabled(G.Antialiasing)}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(G.HighQualityTransparency)}get hasWaterReflection(){return this.hasWater&&(this._waterReflectionEnabled||this.isFeatureEnabled(G.WaterReflection))}get hasWater(){return this._hasWater||this._hasOverlayWater}constructor(e,r,t,i,a,n,h,p){super({}),this._stage=e,this._materialRepository=r,this._shaderTechniqueRepository=i,this._rctx=a,this._compositingHelper=n,this._magnifierHelper=h,this._requestRender=p,this._materialRenderers=new o,this._needsTransparentPass=!1,this._hasHUDElements=!1,this._hasHighlights=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._renderOverlay=e=>{},this._isRendering=!1,this._fallbackDepthStencilTexture=null,this._sliceHelper=new X,this._state=ie.IDLE,this._renderStateFeatures=q(),this._antialiasingEnabled=!0,this._highQualityTransparencyEnabled=!0,this._terrainRenderingEnabled=!0,this._terrainTransparency=b.Opaque,this._waterReflectionEnabled=!1,this._ssaoEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new I,this._handles=new s,this._renderHiddenTransparentEdges=()=>{},this._oitUsed=!1,this._smaaPass=new z(this._rctx,i),p(),this._offscreen=new U(this._rctx,this._compositingHelper),this.performanceInfo=new te(this._rctx),this._shadowMap=new k(this._rctx,e.viewingMode),this._ssaoHelper=new J(e.view,i,this._rctx,p),this._highlight=new M(i,this._rctx),this._shadowHighlight=new Q(this._rctx,e.viewingMode),this._shadowAccumulator=new W(this._rctx,i,e,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._prepare(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t),this._renderShadowCascades(P.Shadow,e.shadowMap),e.camera.setGLViewport(this._rctx),this._prepare(e.camera,e.contentCamera)}),p),this._renderContext=new F(this._rctx,this._offscreen,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new V({renderContext:this._renderContext,techniqueRepository:i,textureRepository:t,materialRepository:this._materialRepository,requestRender:p,controller:e}),this.renderPassManager=new S(this._rctx,this._shaderTechniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([d((()=>this._stage.view.state.camera),(()=>p()),l),d((()=>A.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges($.TRANSPARENT):()=>{},p()}),_),d((()=>this._ssaoEnabled||this.isFeatureEnabled(G.SSAO)),(e=>this._ssaoHelper.enabled=e),l)])}normalizeCtorArgs(){return{}}destroy(){this._handles.destroy(),this._smaaPass.dispose(),this._gpuTimerHandle=i(this._gpuTimerHandle),this._materialRenderers.forAll((e=>e.dispose())),this._materialRenderers.clear(),this._offscreen.dispose(),this._fallbackDepthStencilTexture=a(this._fallbackDepthStencilTexture),this._shadowMap.dispose(),this._ssaoHelper.destroy(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),this._edgeView=n(this._edgeView),this.renderPassManager.destroy(),D.prune()}disposeOffscreenBuffers(){this._offscreen.dispose(),this._shadowMap.disposeOffscreenBuffers(),this._smaaPass.disable(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._antialiasing&&this._smaaPass.updating||null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||!this.isCameraFinal}ensureEdgeView(){if(null==this._edgeView){const e=this._stage.view.resourceController;this._edgeView=new Z({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniqueRepository:this._shaderTechniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:ue(e)}),this._handles.add(d((()=>h(this._edgeView,(e=>e.updating))),(()=>this._requestRender()),p)),this._requestRender()}return this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return u(this._bindParameters.ssr.reprojectionMatrix,g)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:r,_bindParameters:t}=this;if(void 0!==e.screenSpaceReflectionsEnabled&&t.ssr.enabled!==e.screenSpaceReflectionsEnabled&&(t.ssr.enabled=e.screenSpaceReflectionsEnabled,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible),void 0!==e.environment.lighting.ambientOcclusionEnabled&&this._ssaoEnabled!==e.environment.lighting.ambientOcclusionEnabled&&(this._ssaoEnabled=e.environment.lighting.ambientOcclusionEnabled,this._requestRender()),void 0!==e.environment.lighting.waterReflectionEnabled&&this._waterReflectionEnabled!==e.environment.lighting.waterReflectionEnabled&&(this._waterReflectionEnabled=e.environment.lighting.waterReflectionEnabled,this._requestRender());const r="virtual"!==e.environment.lighting.type;t.enableFillLights!==r&&(t.enableFillLights=r,this._requestRender())}e.background&&this._offscreen.background!==e.background&&(this._offscreen.background=e.background,this._requestRender()),void 0!==e.antialiasingEnabled&&this._antialiasingEnabled!==e.antialiasingEnabled&&(this._antialiasingEnabled=e.antialiasingEnabled,this._requestRender()),void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlight.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.overlays&&this._bindParameters.overlays!==e.overlays&&(this._bindParameters.overlays=e.overlays,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.renderOverlay&&this._renderOverlay!==e.renderOverlay&&(this._renderOverlay=e.renderOverlay,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=e.slicePlane,this._requestRender()),void 0!==e.terrainRenderingEnabled&&this._terrainRenderingEnabled!==e.terrainRenderingEnabled&&(this._terrainRenderingEnabled=e.terrainRenderingEnabled,this._requestRender()),void 0!==e.terrainTransparency&&this._terrainTransparency!==e.terrainTransparency&&(this._terrainTransparency=e.terrainTransparency,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,r){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:t,removes:s,updates:i}=e;if(0===t.length&&0===s.length&&0===i.length)return;const a=j(e);let n=!1;a.forEach(((t,s)=>{if(r.done)return;let i=this._materialRenderers.find((e=>e.material===s));null==i&&t.adds.length>0&&(i=new ee(this._rctx,this._materialRepository,s),this._materialRenderers.push(i)),i&&(i.modify(t),i.isEmpty&&(n=!0)),t.removes.forEach((r=>e.removes.removeUnordered(r))),t.adds.forEach((r=>e.adds.removeUnordered(r))),t.updates.forEach((r=>e.updates.removeUnordered(r))),r.madeProgress()})),n&&this._materialRenderers.filterInPlace((e=>!e.isEmpty||(e.dispose(),!1))),this._hasHighlights=this._materialRenderers.some((e=>e.hasHighlights)),this._bindParameters.hasOccludees=this._materialRenderers.some((e=>e.hasOccludees)),this._hasWater=this._materialRenderers.some((e=>e.hasWater)),this._hasHUDElements=this._materialRenderers.some((e=>e.requiresSlot(B.LINE_CALLOUTS_HUD_DEPTH,P.Color)||e.requiresSlot(B.HUD_MATERIAL,P.Color)||e.requiresSlot(B.LABEL_MATERIAL,P.Color))),this._requestRender()}updateAnimation(e){const r=this._hasAnimations;return this._hasAnimations=!1,this._materialRenderers.forAll((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}render(e,r,t,s,i){this._isRendering=!0,this.performanceInfo.startFrame();const{camera:a,contentCamera:n,mode:h}=t;this._state=h,this._renderOverlay(i),this.performanceInfo.advance(se.OVERLAY),this._renderContext.time=i,this._bindParameters.transparencyPassType=K.NONE;const o=this._offscreen;o.setupRenderTarget(this.hasWaterReflection);const d=E(this._sliceHelper.plane);s===O.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),a.setGLViewport(this._rctx),this._prepare(a,n),this._renderPlugins.prepareRender(),this.performanceInfo.advance(se.PREPARE);const l=this._computeDepthRange(a);this._renderShadowMap(e,a,this._bindParameters.lighting.mainLight.direction,l),this.performanceInfo.advance(se.SHADOW_MAP),o.initializeFrame(a),this._ensureBindParameters(a,n),this._renderLinearDepth(),this.performanceInfo.advance(se.LINEAR_DEPTH),this._accumulateShadows(l,a,n),this.performanceInfo.advance(se.ACCUMULATED_SHADOWS),this._renderNormal(),this.performanceInfo.advance(se.NORMALS),this._ensureBindParametersSSR(i),this._renderSSAO(i),this.performanceInfo.advance(se.SSAO),this._renderContext.output=P.Color,o.bindFramebuffer();const _=this._terrainRenderingEnabled&&(this._terrainTransparency===b.Semitransparent||this._terrainTransparency===b.TransparentWithDraped),p=this._highQualityTransparency&&_;this._prepareOpaqueGeometrySlots(),this._setMultipassTerrain(p),this._prepareSlots(B.TRANSPARENT_TERRAIN),this._setMultipassTerrain(!1),p||this._prepareInternalSlots(this._materialRenderers,B.LINE_CALLOUTS),this._renderOpaqueGeometry(),this.performanceInfo.advance(se.OPAQUE),this._renderTerrainLinearDepth(p),this._setMultipassTerrain(p),this._renderEdges($.OPAQUE),this.performanceInfo.advance(se.OPAQUE_EDGES),this._offscreen.bindTarget(this._offscreen.currentColorTarget,this._offscreen.mainDepth),this._renderSlot(B.VOXEL),this.performanceInfo.advance(se.VOXEL),this._renderHiddenTransparentEdges();const c=this._needsTransparentPass||this._renderPlugins.needsTransparentPass;c&&(this._oitEnabled?this._renderOrderIndependentTransparency(de.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(se.TRANSPARENT),this._renderGeometryLinearDepth(p);const m=this._renderHUDVisibility(p);p||this._renderInternalSlot(B.LINE_CALLOUTS),this.performanceInfo.advance(se.HUD_VISIBILITY),this._renderObjectAndLayerIdColor(r),this.performanceInfo.advance(se.OBJECT_AND_LAYER_ID_COLOR),this._renderEdges($.TRANSPARENT,p),this.performanceInfo.advance(se.TRANSPARENT_EDGES),this._renderTransparentTerrain(),_&&m&&(p?this._renderLineCallouts(y.Occluded):o.compositeTransparentTerrainOntoHUDVisibility(this._bindParameters),this._renderHUD(y.Occluded,o.framebuffer),this.performanceInfo.advance(se.HUD_OCCLUDED)),this.performanceInfo.advance(se.TRANSPARENT_TERRAIN),this._setTerrainCulling(!1),_&&(o.compositeTransparentTerrainOntoMain(this._bindParameters),p&&(this._renderEdges($.OPAQUE),this.performanceInfo.advance(se.OPAQUE_EDGES),c&&(this._oitEnabled?this._renderOrderIndependentTransparency(de.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(se.TRANSPARENT),this._renderEdges($.TRANSPARENT),this.performanceInfo.advance(se.TRANSPARENT_EDGES))),p&&this._renderLineCallouts(y.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),o.renderToTargets((()=>{this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._prepareSlots(B.POSTPROCESSING_ENVIRONMENT_TRANSPARENT,B.LASERLINES),this._renderInternalSlot(B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(B.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(B.LASERLINES)}),o.currentColorTarget,o.mainDepth),this.performanceInfo.advance(se.ENVIRONMENT),this._renderPlugins.needsLaserlineWithContrastControl&&o.renderTmpAndCompositeToMain((()=>this._renderSlot(B.LASERLINES_CONTRAST_CONTROL)),this._bindParameters,re.PremultipliedAlpha),this.performanceInfo.advance(se.LASER_LINE),this._renderOccluded(),this.performanceInfo.advance(se.OCCLUDED);const u=s===O.ON&&this._magnifierHelper.enabled,f=u&&null==e?this._offscreen.getFramebuffer(this._offscreen.tmpColor,this._offscreen.tmpDepth):e;this._rctx.bindFramebuffer(f);const T=this._offscreen.colorTexture;this._renderAntiAliasing(T)||null==T||this._compositingHelper.composite(this._bindParameters,T,re.None),this.performanceInfo.advance(se.ANTIALIASING),this._renderHUD(y.NotOccluded,f),this.performanceInfo.advance(se.HUD),this._renderHighlights(f,this._bindParameters),this.performanceInfo.advance(se.HIGHLIGHTS),u&&this._magnifierHelper.render(this._rctx,this._bindParameters),f!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,this._offscreen.tmpColorTexture,re.None)),this._disposeOITBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=d,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.finishFrame()}_renderObjectAndLayerIdColor(e){if(null!=e&&has("enable-feature:objectAndLayerId-rendering")){const r=this._renderContext.output;this._rctx.bindFramebuffer(e),this._offscreen.renderToFBO((()=>this._renderGeometryAndTransparentTerrainPass(P.ObjectAndLayerIdColor)),[0,0,0,0],!0,!0),this._rctx.bindFramebuffer(e),this._offscreen.renderToFBO((()=>{this._bindParameters.renderTransparentlyOccludedHUD=y.NotOccluded,this._renderInternalSlot(B.HUD_MATERIAL)}),void 0,!0,!0),this._renderContext.output=r}}finish(e){this._hasAnimations||this._animationTimestep.clear();const r=this.performanceInfo.gpuSamplingEnabled,t=e===w.BACKGROUND;if(t||r){const e=t?this.performanceInfo.elapsedTime:0,s=r?this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError(),i=Math.max(e,s);this._animationTimestep.frame(i,t)}}readDepthPixels(e,r,t){const s=this._offscreen.bindTarget(this._offscreen.linearDepth,this._offscreen.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const r=ae.COLOR_BUFFER_BIT|ae.DEPTH_BUFFER_BIT|ae.STENCIL_BUFFER_BIT;this._rctx.clearSafe(r),this._renderGeometryAndTransparentTerrainPass(P.Depth)}s.readPixels(r[0],r[1],r[2],r[3],ne.RGBA,he.UNSIGNED_BYTE,t)}readHUDVisibility(e,r,t,s,i){this._offscreen.bindTarget(this._offscreen.hudVisibility).readPixels(e,r,t,s,ne.RGBA,he.UNSIGNED_BYTE,i)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_setMultipassTerrain(e){this._setMultipassEnabled(e),this._setTerrainCulling(e)}_setMultipassEnabled(e){this._bindParameters.multipassTerrain.enabled=this._bindParameters.multipassGeometry.enabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_prepareSlots(...e){this._renderPlugins.prepareSlots(e)}_renderSlot(e){this._bindParameters.slot=e,this._renderPlugins.render()}_renderEdges(e,r=!1){const t=this._edgeView;null!=t&&t.shouldRender()&&this._offscreen.renderTmpAndCompositeToMain((()=>t.render(this._bindParameters,e)),this._bindParameters,re.Alpha,r)}_renderShadowMap(e,r,t,s){const i=this._shadowMap;i.enabled&&this.isFeatureEnabled(G.ShadowMapUpdate)&&(i.start(r,t,s),this._shadowHighlight.updateParameters(r,t),this._needsShadowHighlight?(this._renderShadowCascades(P.ShadowHighlight,this._shadowMap,(e=>i.takeCascadeSnapshotTo(e,Y.Highlight))),i.clear(),this._renderShadowCascades(P.ShadowExcludeHighlight,this._shadowMap,(e=>{i.takeCascadeSnapshotTo(e,Y.Default),this._renderGeometryAndTransparentTerrainPass(P.ShadowHighlight)}))):this._renderShadowCascades(P.Shadow),i.finish(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap,t=(e=>{})){for(const s of r.cascades)s.camera.setGLViewport(this._rctx),this._prepare(s.camera,s.camera),this._renderGeometryAndTransparentTerrainPass(e),t(s)}get _needsLinearDepth(){return this._ssaoHelper.active||this._renderPlugins.needsLinearDepth||this.hasWaterReflection||this._needsShadowHighlight||this._needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreen.renderToTargets((()=>this._renderGeometryAndTransparentTerrainPass(P.Depth)),this._offscreen.linearDepth,this._offscreen.tmpDepth,[0,0,0,0],!0,!0):this._offscreen.disposeTarget(this._offscreen.linearDepth),this._bindParameters.linearDepthTexture=this._offscreen.linearDepthTexture}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.output;this._renderContext.output=P.Depth,this._offscreen.renderToTargets((()=>this._renderTransparentTerrain()),this._offscreen.terrainLinearDepth,this._offscreen.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.output=e}else this._offscreen.disposeTarget(this._offscreen.terrainLinearDepth);this._bindParameters.multipassTerrain.linearDepthTexture=this._offscreen.terrainLinearDepthTexture}_renderGeometryLinearDepth(e){if(e){const e=this._renderContext.output;this._offscreen.renderToTargets((()=>this._renderGeometryPass(P.Depth)),this._offscreen.geometryLinearDepth,this._offscreen.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.output=e}else this._offscreen.disposeTarget(this._offscreen.geometryLinearDepth);this._bindParameters.multipassGeometry.linearDepthTexture=this._offscreen.geometryLinearDepthTexture}get _needsNormal(){return this._ssaoHelper.active}_renderNormal(){this._needsNormal?this._offscreen.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(P.Normal)}),this._offscreen.normal,this._offscreen.tmpDepth,[0,0,0,0],!0,!0):this._offscreen.disposeTarget(this._offscreen.normal)}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return x;const r=N(e,this._materialRenderers,this._stage.layers);return H(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.output=e,this._prepareSlots(B.TRANSPARENT_TERRAIN),this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.output=e,this._prepareSlots(B.TRANSPARENT_MATERIAL),this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderSSAO(e){this._ssaoHelper.render(this._bindParameters,e,this._offscreen.linearDepthTexture,this._offscreen.normalTexture)}_prepareOpaqueGeometrySlots(){this._prepareSlots(B.INTEGRATED_MESH,B.OPAQUE_TERRAIN,B.OPAQUE_MATERIAL,B.POSTPROCESSING_ENVIRONMENT_OPAQUE),this._prepareInternalSlots(this._materialRenderers,B.OPAQUE_MATERIAL)}_renderOpaqueGeometry(){this._renderSlot(B.INTEGRATED_MESH),this._renderSlot(B.OPAQUE_TERRAIN),this._renderInternalSlot(B.OPAQUE_MATERIAL),this._renderSlot(B.OPAQUE_MATERIAL),this._renderSlot(B.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(B.TRANSPARENT_MATERIAL),this._renderSlot(B.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){this._renderSlot(B.TRANSPARENT_TERRAIN)}_renderHUDVisibility(e){let r=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility((()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper.hudVisibilityTexture,r=this._renderInternalSlot(B.OCCLUSION_PIXELS)}),e),r}_renderLineCallouts(e){this._bindParameters.renderTransparentlyOccludedHUD=e,e===y.Occluded?this._offscreen.renderToTargets((()=>this._renderInternalSlot(B.LINE_CALLOUTS)),this._offscreen.currentColorTarget,this._offscreen.tmpDepth,void 0,!0,!0):this._renderInternalSlot(B.LINE_CALLOUTS)}_renderHUD(e,r){this._hasHUDElements&&(this._oitEnabled?(this._renderOrderIndependentTransparency(de.HUD,e),this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._bindParameters,this._offscreen.hudColorTexture,re.PremultipliedAlpha)):e===y.Occluded?this._offscreen.renderToTargets((()=>this._renderHUDElements(y.Occluded)),this._offscreen.currentColorTarget,this._offscreen.tmpDepth,void 0,!0,!0):this._renderHUDElements(e))}_renderHUDElements(e){this._bindParameters.renderTransparentlyOccludedHUD=e,this._prepareInternalSlots(this._materialRenderers,B.LINE_CALLOUTS_HUD_DEPTH,B.HUD_MATERIAL,B.LABEL_MATERIAL),this._renderInternalSlot(B.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(B.HUD_MATERIAL),this._renderInternalSlot(B.LABEL_MATERIAL)}get _needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this._needsHighlight}_renderHighlights(e,r){if(!this._needsHighlight)return void this._offscreen.disposeTarget(this._offscreen.highlight);const t=this._highlight,s=this._offscreen.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(P.Highlight),this._rctx.clearSafe(ae.DEPTH_BUFFER_BIT),this._renderHUDElements(y.Both)}),this._offscreen.highlight,this._offscreen.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=s.colorTexture,this._needsShadowHighlight&&this._shadowHighlight.render(r,e),t.render(this._bindParameters,s,e)}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this._needsShadowCast&&null!=this._offscreen.linearDepthTexture&&this._shadowAccumulator.renderAccumulation(this._offscreen.linearDepthTexture,e,r,t)}_renderOrderIndependentTransparency(e,r=y.Both){const t=e===de.HUD,s=t?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),i=e=>{this._bindParameters.transparencyPassType=e,this._offscreen.renderOITPass((()=>s()),e,t)},a=this._renderContext.output;t||(this._renderContext.output=P.Alpha,this._bindParameters.transparencyPassType=K.Alpha,this._prepareSlots(B.TRANSPARENT_MATERIAL),this._renderContext.output=P.Color,this._bindParameters.transparencyPassType=K.Color,this._prepareSlots(B.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=K.FrontFace,this._prepareSlots(B.TRANSPARENT_MATERIAL)),this._renderContext.output=P.Alpha,i(K.Alpha),this._renderContext.output=P.Color,i(K.Color),i(K.FrontFace),this._offscreen.compositeTransparentOntoOpaque(this._bindParameters,t),this._bindParameters.transparencyPassType=K.NONE,this._renderContext.output=a,this._oitUsed=!0}_disposeOITBuffers(){this._oitUsed||(this._offscreen.disposeTarget(this._offscreen.alphaFloatTarget),this._offscreen.disposeTarget(this._offscreen.colorFloatTarget),this._offscreen.disposeTarget(this._offscreen.frontFaceTarget)),this._oitUsed=!1}_renderOccluded(){let e=0;_e.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&r.material.renderOccluded===v.OccludeAndTransparentStencil&&(e|=r.material.renderOccluded,_e.push(r))}));const r=this._offscreen,t=(t,s,i,a,n)=>{0!=(e&s)&&(r.renderToTargets(i,r.tmpColor,r.mainDepth,[0,0,0,0],a,n),r.compositeOccludedOntoMain(this._bindParameters,t))};0!==_e.length&&(this._prepareInternalSlots(_e,B.OCCLUDER_MATERIAL,B.TRANSPARENT_OCCLUDER_MATERIAL),this._renderInternalSlot(B.OCCLUDER_MATERIAL,_e),t(.5,v.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(B.TRANSPARENT_OCCLUDER_MATERIAL,_e)),!1,!1)),_e.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&(r.material.renderOccluded===v.OccludeAndTransparent||r.material.renderOccluded===v.Transparent||r.material.renderOccluded===v.Opaque)&&(e|=r.material.renderOccluded,_e.push(r))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,this._prepareInternalSlots(_e,B.OPAQUE_MATERIAL,B.TRANSPARENT_MATERIAL,B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),s>v.Occlude&&this._renderSlot(B.OCCLUDED_TERRAIN),this._renderInternalSlot(B.OPAQUE_MATERIAL,_e),this._renderInternalSlot(B.TRANSPARENT_MATERIAL,_e),this._renderInternalSlot(B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,_e),this._renderContext.resetRenderOccludedMask()};this._renderContext.output=P.Color,t(.5,v.OccludeAndTransparent,(()=>i(v.OccludeAndTransparent)),!0,C.OutlineVisualElementMask),t(.5,v.Transparent,(()=>i(v.Transparent)),!0,C.OutlineVisualElementMask),t(1,v.Opaque,(()=>i(v.Opaque)),!0,C.OutlineVisualElementMask),_e.clear()}_renderAntiAliasing(e){if(this._antialiasing){if(this._smaaPass.enable((()=>this._requestRender()))&&null!=e)return this._smaaPass.render(e),!0}else this._smaaPass.disable();return!1}_prepare(e,r){this._needsTransparentPass=this._materialRenderers.some((e=>e.requiresSlot(B.TRANSPARENT_MATERIAL,P.Color))),this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r;const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibilityTexture=t.hudVisibilityTexture,this._bindParameters.mainColorTexture=t.mainColorTexture,this._bindParameters.highlightDepthTexture=t.depthTexture??this._getFallbackDepthTexture()}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.enabled=this.hasWaterReflection,this._bindParameters.ssr.enabled){null==this._waterReflectionEnableTime&&(this._waterReflectionEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=g:(f(ce,this._bindParameters.camera.viewMatrix),f(pe,this._bindParameters.camera.projectionMatrix),T(me,ce,pe),T(me,this._renderContext.lastFrameCamera.viewMatrix,me),T(me,this._renderContext.lastFrameCamera.projectionMatrix,me),this._reprojectionMatrix=me),this._bindParameters.ssr.lastFrameColorTexture=this._offscreen.lastFrameColorTexture;const r=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=r>0?Math.min(r,e-this._waterReflectionEnableTime)/r:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._bindParameters.ssr.lastFrameColorTexture=null,this._waterReflectionEnableTime=null}_prepareInternalSlots(e,...r){for(const t of r)this._bindParameters.slot=t,e.forAll((e=>{e.material.shouldRender(this._renderContext)&&e.prepareTechnique(this._renderContext)}))}_renderInternalSlot(e,r=this._materialRenderers){let t=!1;return this._bindParameters.slot=e,r.forAll((e=>{if(e.material.shouldRender(this._renderContext)){const r=e.prepareTechnique(this._renderContext);null!=r&&(e.render(this._renderContext,r),t=!0)}})),t}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=L(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){return{offscreen:this._offscreen?.gpuMemoryUsage??0,highlights:(this._highlight?.gpuMemoryUsage??0)+(this._shadowHighlight?.gpuMemoryUsage??0),shadows:this._shadowMap?.gpuMemoryUsage??0,ssao:this._ssaoHelper?.gpuMemoryUsage??0}}get test(){const e=this;return{offscreen:this._offscreen,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,weatherIsFading:this._bindParameters.cloudsFade.isFading,resetRenderStateFeatures:()=>{e._renderStateFeatures=q()},getFramebufferTexture:r=>{switch(r){case le.Color:return e._offscreen.colorTexture;case le.LinearDepth:return e._offscreen.linearDepthTexture;case le.Normals:return e._offscreen.normalTexture;case le.ShadowMap:return e._shadowMap.depthTexture;case le.HudVisibility:return e._offscreen.hudVisibilityTexture;case le.Highlight:return e._offscreen.highlightTexture}}}}};var de,le;e([c()],oe.prototype,"_shadowAccumulator",void 0),e([c()],oe.prototype,"_state",void 0),e([c()],oe.prototype,"_renderStateFeatures",void 0),e([c()],oe.prototype,"_antialiasingEnabled",void 0),e([c({readOnly:!0})],oe.prototype,"_antialiasing",null),e([c()],oe.prototype,"_ssaoEnabled",void 0),e([c()],oe.prototype,"_smaaPass",void 0),e([c({autoDestroy:!0})],oe.prototype,"_edgeView",void 0),e([c()],oe.prototype,"updating",null),e([c()],oe.prototype,"isCameraFinal",null),oe=e([m("esri.views.3d.webgl-engine.lib.Renderer")],oe),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(de||(de={})),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Normals=2]="Normals",e[e.ShadowMap=3]="ShadowMap",e[e.HudVisibility=4]="HudVisibility",e[e.Highlight=5]="Highlight"}(le||(le={}));const _e=new o,pe=R(),ce=R(),me=R();function ue(e){return r=>e.immediate.schedule(r)}export{le as FramebufferId,oe as Renderer};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{update as t}from"../../../../core/arrayUtils.js";import s from"../../../../core/Handles.js";import has from"../../../../core/has.js";import{removeMaybe as i,disposeMaybe as a,destroyMaybe as n,applySome as h}from"../../../../core/maybe.js";import o from"../../../../core/PooledArray.js";import{watch as d,syncAndInitial as l,initial as _,sync as p}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{h as u,a as f,m as T}from"../../../../chunks/mat4.js";import{I as g,c as R}from"../../../../chunks/mat4f64.js";import{a as E}from"../../../../chunks/boundedPlane.js";import A from"../../support/debugFlags.js";import{TransparencyMode as S}from"../../terrain/TerrainRenderer.js";import{RenderPassManager as P}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as b}from"../core/shaderLibrary/ShaderOutput.js";import{HUDTransparencyRenderStyle as y}from"../core/shaderLibrary/hud/HUDUniforms.js";import{AnimationTimeStep as I}from"./AnimationTimeStep.js";import{Decorations as O,RenderRequestType as w,StencilBits as C}from"./basicInterfaces.js";import{BoundingInfo as D}from"./BoundingInfo.js";import{ZERO as N,union as x}from"./depthRange.js";import{depthRangeFromScene as L}from"./depthRangeUtils.js";import{createEmptyDepthTexture as H}from"./glUtil3D.js";import{Highlight as M}from"./Highlight.js";import{RenderOccludedFlag as v}from"./Material.js";import{OffscreenRendering as U}from"./OffscreenRendering.js";import{RenderContext as F}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as j}from"./rendererUtils.js";import{RenderFeature as G,setupFeatureDefaults as q}from"./RenderFeature.js";import{RenderPluginManager as V}from"./RenderPluginManager.js";import{RenderSlot as B}from"./RenderSlot.js";import{ShadowAccumulator as W}from"./ShadowAccumulator.js";import{ShadowHighlight as Q}from"./ShadowHighlight.js";import{ShadowMap as k,SnapshotSlot as Y}from"./ShadowMap.js";import X from"./SliceHelper.js";import{SmaaRenderPass as z}from"./SmaaRenderPass.js";import{SSAOHelper as J}from"./SSAOHelper.js";import{TransparencyPassType as K}from"./TransparencyPassType.js";import{EdgeView as Z}from"./edgeRendering/EdgeView.js";import{Transparency as $}from"./edgeRendering/interfaces.js";import{MergedRenderer as ee}from"../materials/renderers/MergedRenderer.js";import{AlphaMode as re}from"../shaders/CompositingTechniqueConfiguration.js";import{RendererPerformanceInfo as te,PerformanceCategory as se}from"../statistics/RendererPerformanceInfo.js";import{RenderState as ie}from"../../../support/RenderState.js";import{ClearBufferBit as ae,PixelFormat as ne,PixelType as he}from"../../../webgl/enums.js";let oe=class extends r{get _bindParameters(){return this._renderContext.bindParameters}isFeatureEnabled(e,r=this._state){return this._renderStateFeatures.get(r,e)??!1}setFeatureEnabled(e,r,t){this._renderStateFeatures.set(r,e,t),this.notifyChange("_renderStateFeatures"),this._requestRender()}get _antialiasing(){return this._antialiasingEnabled||this.isFeatureEnabled(G.Antialiasing)}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(G.HighQualityTransparency)}get hasWaterReflection(){return this.hasWater&&(this._waterReflectionEnabled||this.isFeatureEnabled(G.WaterReflection))}get hasWater(){return this._hasWater||this._hasOverlayWater}constructor(e,r,t,i,a,n,h,p){super({}),this._stage=e,this._materialRepository=r,this._shaderTechniqueRepository=i,this._rctx=a,this._compositingHelper=n,this._magnifierHelper=h,this._requestRender=p,this._materialRenderers=new o,this._needsTransparentPass=!1,this._hasHUDElements=!1,this._hasHighlights=!1,this._hasWater=!1,this._hasOverlayWater=!1,this._renderOverlay=e=>{},this._isRendering=!1,this._fallbackDepthStencilTexture=null,this._sliceHelper=new X,this._state=ie.IDLE,this._renderStateFeatures=q(),this._antialiasingEnabled=!0,this._highQualityTransparencyEnabled=!0,this._terrainRenderingEnabled=!0,this._terrainTransparency=S.Opaque,this._waterReflectionEnabled=!1,this._ssaoEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new I,this._handles=new s,this._renderHiddenTransparentEdges=()=>{},this._oitUsed=!1,this._smaaPass=new z(this._rctx,i),p(),this._offscreen=new U(this._rctx,this._compositingHelper),this.performanceInfo=new te(this._rctx),this._shadowMap=new k(this._rctx,e.viewingMode),this._ssaoHelper=new J(e.view,i,this._rctx,p),this._highlight=new M(i,this._rctx),this._shadowHighlight=new Q(this._rctx,e.viewingMode),this._shadowAccumulator=new W(this._rctx,i,e,(e=>{const r=this.shadowsEnabled;this._shadowMap.enabled=!0,this._prepare(e.camera,e.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=r}),((e,r,t)=>{e.shadowMap.start(e.camera,r,t),this._renderShadowCascades(b.Shadow,e.shadowMap),e.camera.setGLViewport(this._rctx),this._prepare(e.camera,e.contentCamera)}),p),this._renderContext=new F(this._rctx,this._offscreen,this._shadowMap,this._ssaoHelper,this._sliceHelper),this._renderPlugins=new V({renderContext:this._renderContext,techniqueRepository:i,textureRepository:t,materialRepository:this._materialRepository,requestRender:p,controller:e}),this.renderPassManager=new P(this._rctx,this._shaderTechniqueRepository),this._renderPlugins.add(this.renderPassManager.slots(),this.renderPassManager),this._handles.add([d((()=>this._stage.view.state.camera),(()=>p()),l),d((()=>A.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges($.TRANSPARENT):()=>{},p()}),_),d((()=>this._ssaoEnabled||this.isFeatureEnabled(G.SSAO)),(e=>this._ssaoHelper.enabled=e),l)])}normalizeCtorArgs(){return{}}destroy(){this._handles.destroy(),this._smaaPass.dispose(),this._gpuTimerHandle=i(this._gpuTimerHandle),this._materialRenderers.forAll((e=>e.dispose())),this._materialRenderers.clear(),this._offscreen.dispose(),this._fallbackDepthStencilTexture=a(this._fallbackDepthStencilTexture),this._shadowMap.dispose(),this._ssaoHelper.destroy(),this._highlight.dispose(),this._shadowHighlight.dispose(),this._shadowAccumulator.dispose(),this._edgeView=n(this._edgeView),this.renderPassManager.destroy(),D.prune()}disposeOffscreenBuffers(){this._offscreen.dispose(),this._shadowMap.disposeOffscreenBuffers(),this._smaaPass.disable(),this._ssaoHelper.disposeOffscreenBuffers()}get updating(){return this._antialiasing&&this._smaaPass.updating||null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||!this.isCameraFinal}ensureEdgeView(){if(null==this._edgeView){const e=this._stage.view.resourceController;this._edgeView=new Z({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniqueRepository:this._shaderTechniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:ue(e)}),this._handles.add(d((()=>h(this._edgeView,(e=>e.updating))),(()=>this._requestRender()),p)),this._requestRender()}return this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return u(this._bindParameters.ssr.reprojectionMatrix,g)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:r,_bindParameters:t}=this;if(void 0!==e.screenSpaceReflectionsEnabled&&t.ssr.enabled!==e.screenSpaceReflectionsEnabled&&(t.ssr.enabled=e.screenSpaceReflectionsEnabled,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&r.maxCascades!==e.shadowMapMaxCascades&&(r.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible),void 0!==e.environment.lighting.ambientOcclusionEnabled&&this._ssaoEnabled!==e.environment.lighting.ambientOcclusionEnabled&&(this._ssaoEnabled=e.environment.lighting.ambientOcclusionEnabled,this._requestRender()),void 0!==e.environment.lighting.waterReflectionEnabled&&this._waterReflectionEnabled!==e.environment.lighting.waterReflectionEnabled&&(this._waterReflectionEnabled=e.environment.lighting.waterReflectionEnabled,this._requestRender());const r="virtual"!==e.environment.lighting.type;t.enableFillLights!==r&&(t.enableFillLights=r,this._requestRender())}e.background&&this._offscreen.background!==e.background&&(this._offscreen.background=e.background,this._requestRender()),void 0!==e.antialiasingEnabled&&this._antialiasingEnabled!==e.antialiasingEnabled&&(this._antialiasingEnabled=e.antialiasingEnabled,this._requestRender()),void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.defaultHighlightOptions&&(this._highlight.setDefaultOptions(e.defaultHighlightOptions),this._shadowHighlight.setDefaultOptions(e.defaultHighlightOptions),this._requestRender()),void 0!==e.overlays&&this._bindParameters.overlays!==e.overlays&&(this._bindParameters.overlays=e.overlays,this._requestRender()),void 0!==e.hasOverlayWater&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),void 0!==e.renderOverlay&&this._renderOverlay!==e.renderOverlay&&(this._renderOverlay=e.renderOverlay,this._requestRender()),void 0!==e.slicePlane&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=e.slicePlane,this._requestRender()),void 0!==e.terrainRenderingEnabled&&this._terrainRenderingEnabled!==e.terrainRenderingEnabled&&(this._terrainRenderingEnabled=e.terrainRenderingEnabled,this._requestRender()),void 0!==e.terrainTransparency&&this._terrainTransparency!==e.terrainTransparency&&(this._terrainTransparency=e.terrainTransparency,this._requestRender()),void 0!==e.shadowCastOptions&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,r){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:t,removes:s,updates:i}=e;if(0===t.length&&0===s.length&&0===i.length)return;const a=j(e);let n=!1;a.forEach(((t,s)=>{if(r.done)return;let i=this._materialRenderers.find((e=>e.material===s));null==i&&t.adds.length>0&&(i=new ee(this._rctx,this._materialRepository,s),this._materialRenderers.push(i)),i&&(i.modify(t),i.isEmpty&&(n=!0)),t.removes.forEach((r=>e.removes.removeUnordered(r))),t.adds.forEach((r=>e.adds.removeUnordered(r))),t.updates.forEach((r=>e.updates.removeUnordered(r))),r.madeProgress()})),n&&this._materialRenderers.filterInPlace((e=>!e.isEmpty||(e.dispose(),!1))),this._hasHighlights=this._materialRenderers.some((e=>e.hasHighlights)),this._bindParameters.hasOccludees=this._materialRenderers.some((e=>e.hasOccludees)),this._hasWater=this._materialRenderers.some((e=>e.hasWater)),this._hasHUDElements=this._materialRenderers.some((e=>e.requiresSlot(B.LINE_CALLOUTS_HUD_DEPTH,b.Color)||e.requiresSlot(B.HUD_MATERIAL,b.Color)||e.requiresSlot(B.LABEL_MATERIAL,b.Color))),this._requestRender()}updateAnimation(e){const r=this._hasAnimations;return this._hasAnimations=!1,this._materialRenderers.forAll((r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations)),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}render(e,r,t,s,i){this._isRendering=!0,this.performanceInfo.startFrame();const{camera:a,contentCamera:n,mode:h}=t;this._state=h,this._renderOverlay(i),this.performanceInfo.advance(se.OVERLAY),this._renderContext.time=i,this._bindParameters.transparencyPassType=K.NONE;const o=this._offscreen;o.setupRenderTarget(this.hasWaterReflection);const d=E(this._sliceHelper.plane);s===O.OFF&&(this._sliceHelper.plane=null),this._rctx.bindFramebuffer(e),a.setGLViewport(this._rctx),this._prepare(a,n),this._renderPlugins.prepareRender(),this.performanceInfo.advance(se.PREPARE);const l=this._computeDepthRange(a);this._renderShadowMap(e,a,this._bindParameters.lighting.mainLight.direction,l),this.performanceInfo.advance(se.SHADOW_MAP),o.initializeFrame(a),this._ensureBindParameters(a,n),this._renderLinearDepth(),this.performanceInfo.advance(se.LINEAR_DEPTH),this._accumulateShadows(l,a,n),this.performanceInfo.advance(se.ACCUMULATED_SHADOWS),this._renderNormal(),this.performanceInfo.advance(se.NORMALS),this._ensureBindParametersSSR(i),this._renderSSAO(i),this.performanceInfo.advance(se.SSAO),this._renderContext.output=b.Color,o.bindFramebuffer();const _=this._terrainRenderingEnabled&&(this._terrainTransparency===S.Semitransparent||this._terrainTransparency===S.TransparentWithDraped),p=this._highQualityTransparency&&_;this._prepareOpaqueGeometrySlots(),this._setMultipassTerrain(p),this._prepareSlots(B.TRANSPARENT_TERRAIN),this._setMultipassTerrain(!1),p||this._prepareInternalSlots(this._materialRenderers,B.LINE_CALLOUTS);const c=this._needsTransparentPass||this._renderPlugins.needsTransparentPass;c&&this._prepareTransparencySlots(),this._renderOpaqueGeometry(),this.performanceInfo.advance(se.OPAQUE),this._renderTerrainLinearDepth(p),this._setMultipassTerrain(p),this._renderEdges($.OPAQUE),this.performanceInfo.advance(se.OPAQUE_EDGES),this._offscreen.bindTarget(this._offscreen.currentColorTarget,this._offscreen.mainDepth),this._renderSlot(B.VOXEL),this.performanceInfo.advance(se.VOXEL),this._renderHiddenTransparentEdges(),c&&(this._oitEnabled?this._renderOITPass(de.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(se.TRANSPARENT),this._renderGeometryLinearDepth(p);const m=this._renderHUDVisibility(p);p||this._renderInternalSlot(B.LINE_CALLOUTS),this.performanceInfo.advance(se.HUD_VISIBILITY),this._renderObjectAndLayerIdColor(r),this.performanceInfo.advance(se.OBJECT_AND_LAYER_ID_COLOR),this._renderEdges($.TRANSPARENT,p),this.performanceInfo.advance(se.TRANSPARENT_EDGES),this._renderTransparentTerrain(),_&&m&&(p?this._renderLineCallouts(y.Occluded):o.compositeTransparentTerrainOntoHUDVisibility(this._bindParameters),this._renderHUD(y.Occluded,o.framebuffer),this.performanceInfo.advance(se.HUD_OCCLUDED)),this.performanceInfo.advance(se.TRANSPARENT_TERRAIN),this._setTerrainCulling(!1),_&&(o.compositeTransparentTerrainOntoMain(this._bindParameters),p&&(this._renderEdges($.OPAQUE),this.performanceInfo.advance(se.OPAQUE_EDGES),c&&(this._oitEnabled?this._renderOITPass(de.Geometry):this._renderTransparentGeometry()),this.performanceInfo.advance(se.TRANSPARENT),this._renderEdges($.TRANSPARENT),this.performanceInfo.advance(se.TRANSPARENT_EDGES))),p&&this._renderLineCallouts(y.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),o.renderToTargets((()=>{this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._prepareSlots(B.POSTPROCESSING_ENVIRONMENT_TRANSPARENT,B.LASERLINES),this._renderInternalSlot(B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderSlot(B.POSTPROCESSING_ENVIRONMENT_TRANSPARENT),this._renderSlot(B.LASERLINES)}),o.currentColorTarget,o.mainDepth),this.performanceInfo.advance(se.ENVIRONMENT),this._renderPlugins.needsLaserlineWithContrastControl&&o.renderTmpAndCompositeToMain((()=>this._renderSlot(B.LASERLINES_CONTRAST_CONTROL)),this._bindParameters,re.PremultipliedAlpha),this.performanceInfo.advance(se.LASER_LINE),this._renderOccluded(),this.performanceInfo.advance(se.OCCLUDED);const u=s===O.ON&&this._magnifierHelper.enabled,f=u&&null==e?this._offscreen.getFramebuffer(this._offscreen.tmpColor,this._offscreen.tmpDepth):e;this._rctx.bindFramebuffer(f);const T=this._offscreen.colorTexture;this._renderAntiAliasing(T)||null==T||this._compositingHelper.composite(this._bindParameters,T,re.None),this.performanceInfo.advance(se.ANTIALIASING),this._renderHUD(y.NotOccluded,f),this.performanceInfo.advance(se.HUD),this._renderHighlights(f,this._bindParameters),this.performanceInfo.advance(se.HIGHLIGHTS),u&&this._magnifierHelper.render(this._rctx,this._bindParameters),f!==e&&(this._rctx.bindFramebuffer(e),this._compositingHelper.composite(this._bindParameters,this._offscreen.tmpColorTexture,re.None)),this._disposeOITBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=d,this._isRendering=!1,this.onPostRender&&this.onPostRender(),this.performanceInfo.finishFrame()}_renderObjectAndLayerIdColor(e){if(null!=e&&has("enable-feature:objectAndLayerId-rendering")){const r=this._renderContext.output;this._rctx.bindFramebuffer(e),this._offscreen.renderToFBO((()=>this._renderGeometryAndTransparentTerrainPass(b.ObjectAndLayerIdColor)),[0,0,0,0],!0,!0),this._rctx.bindFramebuffer(e),this._offscreen.renderToFBO((()=>{this._bindParameters.renderTransparentlyOccludedHUD=y.NotOccluded,this._renderInternalSlot(B.HUD_MATERIAL)}),void 0,!0,!0),this._renderContext.output=r}}finish(e){this._hasAnimations||this._animationTimestep.clear();const r=this.performanceInfo.gpuSamplingEnabled,t=e===w.BACKGROUND;if(t||r){const e=t?this.performanceInfo.elapsedTime:0,s=r?this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError(),i=Math.max(e,s);this._animationTimestep.frame(i,t)}}readDepthPixels(e,r,t){const s=this._offscreen.bindTarget(this._offscreen.linearDepth,this._offscreen.tmpDepth);if(!this._needsLinearDepth){this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const r=ae.COLOR_BUFFER_BIT|ae.DEPTH_BUFFER_BIT|ae.STENCIL_BUFFER_BIT;this._rctx.clearSafe(r),this._renderGeometryAndTransparentTerrainPass(b.Depth)}s.readPixels(r[0],r[1],r[2],r[3],ne.RGBA,he.UNSIGNED_BYTE,t)}readHUDVisibility(e,r,t,s,i){this._offscreen.bindTarget(this._offscreen.hudVisibility).readPixels(e,r,t,s,ne.RGBA,he.UNSIGNED_BYTE,i)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_setMultipassTerrain(e){this._setMultipassEnabled(e),this._setTerrainCulling(e)}_setMultipassEnabled(e){this._bindParameters.multipassTerrain.enabled=this._bindParameters.multipassGeometry.enabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_prepareSlots(...e){this._renderPlugins.prepareSlots(e)}_renderSlot(e){this._bindParameters.slot=e,this._renderPlugins.render()}_renderEdges(e,r=!1){const t=this._edgeView;null!=t&&t.shouldRender()&&this._offscreen.renderTmpAndCompositeToMain((()=>t.render(this._bindParameters,e)),this._bindParameters,re.Alpha,r)}_renderShadowMap(e,r,t,s){const i=this._shadowMap;i.enabled&&this.isFeatureEnabled(G.ShadowMapUpdate)&&(i.start(r,t,s),this._shadowHighlight.updateParameters(r,t),this._needsShadowHighlight?(this._renderShadowCascades(b.ShadowHighlight,this._shadowMap,(e=>i.takeCascadeSnapshotTo(e,Y.Highlight))),i.clear(),this._renderShadowCascades(b.ShadowExcludeHighlight,this._shadowMap,(e=>{i.takeCascadeSnapshotTo(e,Y.Default),this._renderGeometryAndTransparentTerrainPass(b.ShadowHighlight)}))):this._renderShadowCascades(b.Shadow),i.finish(e),r.setGLViewport(this._rctx))}_renderShadowCascades(e,r=this._shadowMap,t=(e=>{})){for(const s of r.cascades)s.camera.setGLViewport(this._rctx),this._prepare(s.camera,s.camera),this._renderGeometryAndTransparentTerrainPass(e),t(s)}get _needsLinearDepth(){return this._ssaoHelper.active||this._renderPlugins.needsLinearDepth||this.hasWaterReflection||this._needsShadowHighlight||this._needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?this._offscreen.renderToTargets((()=>this._renderGeometryAndTransparentTerrainPass(b.Depth)),this._offscreen.linearDepth,this._offscreen.tmpDepth,[0,0,0,0],!0,!0):this._offscreen.disposeTarget(this._offscreen.linearDepth),this._bindParameters.linearDepthTexture=this._offscreen.linearDepthTexture}_renderTerrainLinearDepth(e){if(e){const e=this._renderContext.output;this._renderContext.output=b.Depth,this._offscreen.renderToTargets((()=>this._renderTransparentTerrain()),this._offscreen.terrainLinearDepth,this._offscreen.tmpDepth,[-1e10,-1e10,-1e10,1],!0,!0),this._renderContext.output=e}else this._offscreen.disposeTarget(this._offscreen.terrainLinearDepth);this._bindParameters.multipassTerrain.linearDepthTexture=this._offscreen.terrainLinearDepthTexture}_renderGeometryLinearDepth(e){if(e){const e=this._renderContext.output;this._offscreen.renderToTargets((()=>this._renderGeometryPass(b.Depth)),this._offscreen.geometryLinearDepth,this._offscreen.tmpDepth,[1,1,1,1],!0,!0),this._renderContext.output=e}else this._offscreen.disposeTarget(this._offscreen.geometryLinearDepth);this._bindParameters.multipassGeometry.linearDepthTexture=this._offscreen.geometryLinearDepthTexture}get _needsNormal(){return this._ssaoHelper.active}_renderNormal(){this._needsNormal?this._offscreen.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(b.Normal)}),this._offscreen.normal,this._offscreen.tmpDepth,[0,0,0,0],!0,!0):this._offscreen.disposeTarget(this._offscreen.normal)}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return N;const r=L(e,this._materialRenderers,this._stage.layers);return x(r,this.renderPlugins.queryDepthRange(e)),r.near=Math.max(e.near,r.near),r.far=Math.min(e.far,r.far),r}_renderGeometryAndTransparentTerrainPass(e){this._renderContext.output=e,this._prepareSlots(B.TRANSPARENT_TERRAIN),this._renderGeometryPass(e),this._renderTransparentTerrain()}_renderGeometryPass(e){this._renderContext.output=e,this._prepareSlots(B.TRANSPARENT_MATERIAL),this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderSSAO(e){this._ssaoHelper.render(this._bindParameters,e,this._offscreen.linearDepthTexture,this._offscreen.normalTexture)}_prepareOpaqueGeometrySlots(){this._prepareSlots(B.INTEGRATED_MESH,B.OPAQUE_TERRAIN,B.OPAQUE_MATERIAL,B.POSTPROCESSING_ENVIRONMENT_OPAQUE),this._prepareInternalSlots(this._materialRenderers,B.OPAQUE_MATERIAL)}_renderOpaqueGeometry(){this._renderSlot(B.INTEGRATED_MESH),this._renderSlot(B.OPAQUE_TERRAIN),this._renderInternalSlot(B.OPAQUE_MATERIAL),this._renderSlot(B.OPAQUE_MATERIAL),this._renderSlot(B.POSTPROCESSING_ENVIRONMENT_OPAQUE)}_renderTransparentGeometry(){this._renderInternalSlot(B.TRANSPARENT_MATERIAL),this._renderSlot(B.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){this._renderSlot(B.TRANSPARENT_TERRAIN)}_renderHUDVisibility(e){let r=!1;return this._renderContext.offscreenRenderingHelper&&this._renderContext.offscreenRenderingHelper.renderHUDVisibility((()=>{this._bindParameters.hudVisibilityTexture=this._renderContext.offscreenRenderingHelper.hudVisibilityTexture,r=this._renderInternalSlot(B.OCCLUSION_PIXELS)}),e),r}_renderLineCallouts(e){this._bindParameters.renderTransparentlyOccludedHUD=e,e===y.Occluded?this._offscreen.renderToTargets((()=>this._renderInternalSlot(B.LINE_CALLOUTS)),this._offscreen.currentColorTarget,this._offscreen.tmpDepth,void 0,!0,!0):this._renderInternalSlot(B.LINE_CALLOUTS)}_renderHUD(e,r){this._hasHUDElements&&(this._oitEnabled?(this._renderOITPass(de.HUD,e),this._rctx.bindFramebuffer(r),this._compositingHelper.composite(this._bindParameters,this._offscreen.hudColorTexture,re.PremultipliedAlpha)):e===y.Occluded?this._offscreen.renderToTargets((()=>this._renderHUDElements(y.Occluded)),this._offscreen.currentColorTarget,this._offscreen.tmpDepth,void 0,!0,!0):this._renderHUDElements(e))}_renderHUDElements(e){this._bindParameters.renderTransparentlyOccludedHUD=e,this._prepareInternalSlots(this._materialRenderers,B.LINE_CALLOUTS_HUD_DEPTH,B.HUD_MATERIAL,B.LABEL_MATERIAL),this._renderInternalSlot(B.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(B.HUD_MATERIAL),this._renderInternalSlot(B.LABEL_MATERIAL)}get _needsHighlight(){return this._hasHighlights||this._renderPlugins.needsHighlight}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._shadowHighlight.isVisible&&this._needsHighlight}_renderHighlights(e,r){if(!this._needsHighlight)return void this._offscreen.disposeTarget(this._offscreen.highlight);const t=this._highlight,s=this._offscreen.renderToTargets((()=>{this._renderGeometryAndTransparentTerrainPass(b.Highlight),this._rctx.clearSafe(ae.DEPTH_BUFFER_BIT),this._renderHUDElements(y.Both)}),this._offscreen.highlight,this._offscreen.tmpDepth,[0,0,0,0],!0,!0);this._bindParameters.highlightColorTexture=s.colorTexture,this._needsShadowHighlight&&this._shadowHighlight.render(r,e),t.render(this._bindParameters,s,e)}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_accumulateShadows(e,r,t){this._needsShadowCast&&null!=this._offscreen.linearDepthTexture&&this._shadowAccumulator.renderAccumulation(this._offscreen.linearDepthTexture,e,r,t)}_prepareTransparencySlots(){this._renderContext.output=b.Alpha,this._bindParameters.transparencyPassType=K.Alpha,this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_MATERIAL),this._prepareSlots(B.TRANSPARENT_MATERIAL),this._renderContext.output=b.Color,this._bindParameters.transparencyPassType=K.Color,this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_MATERIAL),this._prepareSlots(B.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=K.FrontFace,this._prepareInternalSlots(this._materialRenderers,B.TRANSPARENT_MATERIAL),this._prepareSlots(B.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=K.NONE}_renderOITPass(e,r=y.Both){const t=e===de.HUD,s=t?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),i=e=>{this._bindParameters.transparencyPassType=e,this._offscreen.renderOITPass(s,e,t)},a=this._renderContext.output;this._renderContext.output=b.Alpha,i(K.Alpha),this._renderContext.output=b.Color,i(K.Color),i(K.FrontFace),this._offscreen.compositeTransparentOntoOpaque(this._bindParameters,t),this._bindParameters.transparencyPassType=K.NONE,this._renderContext.output=a,this._oitUsed=!0}_disposeOITBuffers(){this._oitUsed||(this._offscreen.disposeTarget(this._offscreen.alphaFloatTarget),this._offscreen.disposeTarget(this._offscreen.colorFloatTarget),this._offscreen.disposeTarget(this._offscreen.frontFaceTarget)),this._oitUsed=!1}_renderOccluded(){let e=0;_e.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&r.material.renderOccluded===v.OccludeAndTransparentStencil&&(e|=r.material.renderOccluded,_e.push(r))}));const r=this._offscreen,t=(t,s,i,a,n)=>{0!=(e&s)&&(r.renderToTargets(i,r.tmpColor,r.mainDepth,[0,0,0,0],a,n),r.compositeOccludedOntoMain(this._bindParameters,t))};0!==_e.length&&(this._prepareInternalSlots(_e,B.OCCLUDER_MATERIAL,B.TRANSPARENT_OCCLUDER_MATERIAL),this._renderInternalSlot(B.OCCLUDER_MATERIAL,_e),t(.5,v.OccludeAndTransparentStencil,(()=>this._renderInternalSlot(B.TRANSPARENT_OCCLUDER_MATERIAL,_e)),!1,!1)),_e.clear(),this._materialRenderers.forAll((r=>{r.material&&r.material.isVisible()&&(r.material.renderOccluded===v.OccludeAndTransparent||r.material.renderOccluded===v.Transparent||r.material.renderOccluded===v.Opaque)&&(e|=r.material.renderOccluded,_e.push(r))}));const s=this._renderPlugins.renderOccludedFlags;if(e|=s,!e)return;const i=e=>{this._renderContext.renderOccludedMask=e,this._prepareInternalSlots(_e,B.OPAQUE_MATERIAL,B.TRANSPARENT_MATERIAL,B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),s>v.Occlude&&this._renderSlot(B.OCCLUDED_TERRAIN),this._renderInternalSlot(B.OPAQUE_MATERIAL,_e),this._renderInternalSlot(B.TRANSPARENT_MATERIAL,_e),this._renderInternalSlot(B.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,_e),this._renderContext.resetRenderOccludedMask()};this._renderContext.output=b.Color,t(.5,v.OccludeAndTransparent,(()=>i(v.OccludeAndTransparent)),!0,C.OutlineVisualElementMask),t(.5,v.Transparent,(()=>i(v.Transparent)),!0,C.OutlineVisualElementMask),t(1,v.Opaque,(()=>i(v.Opaque)),!0,C.OutlineVisualElementMask),_e.clear()}_renderAntiAliasing(e){if(this._antialiasing){if(this._smaaPass.enable((()=>this._requestRender()))&&null!=e)return this._smaaPass.render(e),!0}else this._smaaPass.disable();return!1}_prepare(e,r){this._needsTransparentPass=this._materialRenderers.some((e=>e.requiresSlot(B.TRANSPARENT_MATERIAL,b.Color))),this._bindParameters.camera=e,this._bindParameters.contentCamera=r}_ensureBindParameters(e,r){this._bindParameters.camera=e,this._bindParameters.contentCamera=r;const t=this._renderContext.offscreenRenderingHelper;this._bindParameters.hudVisibilityTexture=t.hudVisibilityTexture,this._bindParameters.mainColorTexture=t.mainColorTexture,this._bindParameters.highlightDepthTexture=t.depthTexture??this._getFallbackDepthTexture()}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.enabled=this.hasWaterReflection,this._bindParameters.ssr.enabled){null==this._waterReflectionEnableTime&&(this._waterReflectionEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=g:(f(ce,this._bindParameters.camera.viewMatrix),f(pe,this._bindParameters.camera.projectionMatrix),T(me,ce,pe),T(me,this._renderContext.lastFrameCamera.viewMatrix,me),T(me,this._renderContext.lastFrameCamera.projectionMatrix,me),this._reprojectionMatrix=me),this._bindParameters.ssr.lastFrameColorTexture=this._offscreen.lastFrameColorTexture;const r=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=r>0?Math.min(r,e-this._waterReflectionEnableTime)/r:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._bindParameters.ssr.lastFrameColorTexture=null,this._waterReflectionEnableTime=null}_prepareInternalSlots(e,...r){for(const t of r)this._bindParameters.slot=t,e.forAll((e=>{e.material.shouldRender(this._renderContext)&&e.prepareTechnique(this._renderContext)}))}_renderInternalSlot(e,r=this._materialRenderers){let t=!1;return this._bindParameters.slot=e,r.forAll((e=>{if(e.material.shouldRender(this._renderContext)){const r=e.prepareTechnique(this._renderContext);null!=r&&(e.render(this._renderContext,r),t=!0)}})),t}_getFallbackDepthTexture(){return this._fallbackDepthStencilTexture||(this._fallbackDepthStencilTexture=H(this._rctx)),this._fallbackDepthStencilTexture}get gpuMemoryUsage(){return{offscreen:this._offscreen?.gpuMemoryUsage??0,highlights:(this._highlight?.gpuMemoryUsage??0)+(this._shadowHighlight?.gpuMemoryUsage??0),shadows:this._shadowMap?.gpuMemoryUsage??0,ssao:this._ssaoHelper?.gpuMemoryUsage??0}}get test(){const e=this;return{offscreen:this._offscreen,shadowMap:this._shadowMap,ssao:this._ssaoHelper,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,weatherIsFading:this._bindParameters.cloudsFade.isFading,resetRenderStateFeatures:()=>{e._renderStateFeatures=q()},getFramebufferTexture:r=>{switch(r){case le.Color:return e._offscreen.colorTexture;case le.LinearDepth:return e._offscreen.linearDepthTexture;case le.Normals:return e._offscreen.normalTexture;case le.ShadowMap:return e._shadowMap.depthTexture;case le.HudVisibility:return e._offscreen.hudVisibilityTexture;case le.Highlight:return e._offscreen.highlightTexture}}}}};var de,le;e([c()],oe.prototype,"_shadowAccumulator",void 0),e([c()],oe.prototype,"_state",void 0),e([c()],oe.prototype,"_renderStateFeatures",void 0),e([c()],oe.prototype,"_antialiasingEnabled",void 0),e([c({readOnly:!0})],oe.prototype,"_antialiasing",null),e([c()],oe.prototype,"_ssaoEnabled",void 0),e([c()],oe.prototype,"_smaaPass",void 0),e([c({autoDestroy:!0})],oe.prototype,"_edgeView",void 0),e([c()],oe.prototype,"updating",null),e([c()],oe.prototype,"isCameraFinal",null),oe=e([m("esri.views.3d.webgl-engine.lib.Renderer")],oe),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(de||(de={})),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Normals=2]="Normals",e[e.ShadowMap=3]="ShadowMap",e[e.HudVisibility=4]="HudVisibility",e[e.Highlight=5]="Highlight"}(le||(le={}));const _e=new o,pe=R(),ce=R(),me=R();function ue(e){return r=>e.immediate.schedule(r)}export{le as FramebufferId,oe as Renderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import o from"../../../../Color.js";import r from"../../../../core/Logger.js";import{get as t}from"../../../../core/maybe.js";import{pt2px as e}from"../../../../core/screenUtils.js";import{Z as n}from"../../../../chunks/vec4f64.js";class i{constructor(o){this.definition=o,this.key=JSON.stringify(o),this.haloSize=Math.round(o.halo.size),this.textStyle=this._colorToRGBA(o.color),this.haloStyle=this._colorToRGB(o.halo.color),this.backgroundStyle=0!==o.background.color[3]?this._colorToRGBA(o.background.color):null}fontString(o){const r=this.definition.font;return`${r.style} ${r.weight} ${o}px ${r.family}, sans-serif`}_colorToRGB(o){return`rgb(${o.slice(0,3).map((o=>Math.floor(255*o))).toString()})`}_colorToRGBA(o){return`rgba(${o.slice(0,3).map((o=>Math.floor(255*o))).toString()},${o[3]})`}static async fromSymbol(l,s){const a=t(l,"material","color"),c=o.toUnitRGBA(a)??n,g=null!=l.size?e(l.size):12,f=l.lineHeight,d=null!=l.background?o.toUnitRGBA(l.background.color):n,h={family:l.font?.family??"sans-serif",decoration:l.font?.decoration??"none",weight:l.font?.weight??"normal",style:l.font?.style??"normal"},m=l.halo,u=null!=m&&null!=m.color&&m.size>0?{size:e(m.size),color:o.toUnitRGBA(m.color)}:{size:0,color:n},b=new i({color:c,size:g,background:{color:d,padding:null!=l.background?[.65*g,.5*g]:[0,0],borderRadius:null!=l.background?g*(6/16):0},lineSpacingFactor:f,font:h,halo:u,pixelRatio:s}),y=b.fontString(g);try{await document.fonts.load(y)}catch(p){r.getLogger("esri.views.3d.webgl-engine.lib.TextRenderParameters").warnOnce(`Failed to preload font '${y}'. Some text symbology may be rendered using the default browser font.`)}return b}}export{i as TextRenderParameters};
5
+ import o from"../../../../Color.js";import t from"../../../../core/Logger.js";import{pt2px as r}from"../../../../core/screenUtils.js";import{Z as e}from"../../../../chunks/vec4f64.js";class n{constructor(o){this.definition=o,this.key=JSON.stringify(o),this.haloSize=Math.round(o.halo.size),this.textStyle=this._colorToRGBA(o.color),this.haloStyle=this._colorToRGB(o.halo.color),this.backgroundStyle=0!==o.background.color[3]?this._colorToRGBA(o.background.color):null}fontString(o){const t=this.definition.font;return`${t.style} ${t.weight} ${o}px ${t.family}, sans-serif`}_colorToRGB(o){return`rgb(${o.slice(0,3).map((o=>Math.floor(255*o))).toString()})`}_colorToRGBA(o){return`rgba(${o.slice(0,3).map((o=>Math.floor(255*o))).toString()},${o[3]})`}static async fromSymbol(i,l){const s=i?.material?.color,a=o.toUnitRGBA(s)??e,c=null!=i.size?r(i.size):12,g=i.lineHeight,f=null!=i.background?o.toUnitRGBA(i.background.color):e,d={family:i.font?.family??"sans-serif",decoration:i.font?.decoration??"none",weight:i.font?.weight??"normal",style:i.font?.style??"normal"},h=i.halo,u=null!=h&&null!=h.color&&h.size>0?{size:r(h.size),color:o.toUnitRGBA(h.color)}:{size:0,color:e},m=new n({color:a,size:c,background:{color:f,padding:null!=i.background?[.65*c,.5*c]:[0,0],borderRadius:null!=i.background?c*(6/16):0},lineSpacingFactor:g,font:d,halo:u,pixelRatio:l}),b=m.fontString(c);try{await document.fonts.load(b)}catch(y){t.getLogger("esri.views.3d.webgl-engine.lib.TextRenderParameters").warnOnce(`Failed to preload font '${b}'. Some text symbology may be rendered using the default browser font.`)}return m}}export{n as TextRenderParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{s as e,c as t,n as r,b as s,l as a,g as i,e as o,t as n}from"../../../../chunks/vec3.js";import{c as h,f as l}from"../../../../chunks/vec3f64.js";import{ViewingMode as c}from"../../../ViewingMode.js";import{newLayout as u}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as m}from"../core/shaderLibrary/ShaderOutput.js";import{NormalsDoubleSidedMode as p}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as d}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{CullFaceOptions as f}from"../lib/basicInterfaces.js";import{GLTextureMaterial as g}from"../lib/GLTextureMaterial.js";import{Material as T}from"../lib/Material.js";import{OITPolygonOffsetLimit as _}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as x}from"../lib/RenderSlot.js";import{VertexAttribute as S}from"../lib/VertexAttribute.js";import{getVerticalOffsetObject3D as v}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as b}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as w,intersectTriangleGeometry as O}from"./internal/MaterialUtil.js";import{DefaultMaterialTechnique as M,DefaultMaterialPassParameters as A}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as C}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as y}from"../shaders/RealisticTreeTechnique.js";class I extends T{constructor(e){super(e,E),this.supportsEdges=!0,this._configuration=new C,this._vertexBufferLayout=j(this.parameters)}isVisibleForOutput(e){return e!==m.Shadow&&e!==m.ShadowExcludeHighlight&&e!==m.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:s,vvColor:a}=e,i="replace"===e.colorMixMode,o=e.opacity>0,n=e.externalColor&&e.externalColor[3]>0,h=t||a||s;return r&&h?i||o:r?i?n:o:h?i||o:i?n:o}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?f.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==m.Color&&e!==m.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=p.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?p.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?p.WindingOrder:p.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.active&&this.parameters.receiveSSAO,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?d.Schematic:d.Normal:d.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<_,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(h,l,u,m,p,d){if(null!=this.parameters.verticalOffset){const h=u.camera;e(H,l[12],l[13],l[14]);let d=null;switch(u.viewingMode){case c.Global:d=r(N,H);break;case c.Local:d=t(N,V)}let f=0;const g=s(z,H,h.eye),T=a(g),_=i(g,g,1/T);let x=null;this.parameters.screenSizePerspective&&(x=o(d,_)),f+=w(h,T,this.parameters.verticalOffset,x??0,this.parameters.screenSizePerspective),i(d,d,f),n(B,d,u.transform.inverseRotation),m=s(L,m,B),p=s(D,p,B)}O(h,u,m,p,v(u.verticalOffset),d)}requiresSlot(e,t){if(t===m.Color||t===m.Alpha||t===m.Depth||t===m.Normal||t===m.Shadow||t===m.ShadowHighlight||t===m.ShadowExcludeHighlight||t===m.Highlight||t===m.ObjectAndLayerIdColor){return e===(this.parameters.transparent?this.parameters.writeDepth?x.TRANSPARENT_MATERIAL:x.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:x.OPAQUE_MATERIAL)||e===x.DRAPED_MATERIAL}return!1}createGLMaterial(e){return new R(e)}createBufferWriter(){return new b(this._vertexBufferLayout)}}class R extends g{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(t){this._output!==m.Color&&this._output!==m.Alpha||(this._updateShadowState(t),this._updateOccludeeState(t));const r=this._material.parameters;this.updateTexture(r.textureId);const s=t.camera.viewInverseTransposeMatrix;return e(r.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(r.treeRendering?y:M,t)}}class P extends A{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}}const E=new P;function j(e){const t=u().vec3f(S.POSITION).vec3f(S.NORMAL),r=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId;return e.hasVertexTangents&&t.vec4f(S.TANGENT),r&&t.vec2f(S.UV0),e.hasVertexColors&&t.vec4u8(S.COLOR),e.hasSymbolColors&&t.vec4u8(S.SYMBOLCOLOR),has("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(S.OBJECTANDLAYERIDCOLOR),t}const L=h(),D=h(),V=l(0,0,1),N=h(),B=h(),H=h(),z=h();export{R as DefaultGLMaterial,I as DefaultMaterial,P as DefaultMaterialParameters};
5
+ import has from"../../../../core/has.js";import{s as e,c as t,n as r,b as s,l as a,g as i,e as o,t as n}from"../../../../chunks/vec3.js";import{c as h,f as l}from"../../../../chunks/vec3f64.js";import{ViewingMode as c}from"../../../ViewingMode.js";import{newLayout as u}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as m}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as p}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as d}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as f}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{CullFaceOptions as g}from"../lib/basicInterfaces.js";import{GLTextureMaterial as T}from"../lib/GLTextureMaterial.js";import{Material as _}from"../lib/Material.js";import{OITPolygonOffsetLimit as x}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{getVerticalOffsetObject3D as v}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as O}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as w,intersectTriangleGeometry as M}from"./internal/MaterialUtil.js";import{DefaultMaterialTechnique as A,DefaultMaterialPassParameters as C}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as y}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as R}from"../shaders/RealisticTreeTechnique.js";class I extends _{constructor(e){super(e,L),this.supportsEdges=!0,this._configuration=new y,this._vertexBufferLayout=j(this.parameters)}isVisibleForOutput(e){return e!==m.Shadow&&e!==m.ShadowExcludeHighlight&&e!==m.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:s,vvColor:a}=e,i="replace"===e.colorMixMode,o=e.opacity>0,n=e.externalColor&&e.externalColor[3]>0,h=t||a||s;return r&&h?i||o:r?i?n:o:h?i||o:i?n:o}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?g.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==m.Color&&e!==m.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=d.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?d.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?d.WindingOrder:d.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.active&&this.parameters.receiveSSAO,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?f.Schematic:f.Normal:f.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<x,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(h,l,u,m,p,d){if(null!=this.parameters.verticalOffset){const h=u.camera;e(z,l[12],l[13],l[14]);let d=null;switch(u.viewingMode){case c.Global:d=r(B,z);break;case c.Local:d=t(B,V)}let f=0;const g=s(G,z,h.eye),T=a(g),_=i(g,g,1/T);let x=null;this.parameters.screenSizePerspective&&(x=o(d,_)),f+=w(h,T,this.parameters.verticalOffset,x??0,this.parameters.screenSizePerspective),i(d,d,f),n(H,d,u.transform.inverseRotation),m=s(D,m,H),p=s(N,p,H)}M(h,u,m,p,v(u.verticalOffset),d)}requiresSlot(e,t){if(t===m.Color||t===m.Alpha||t===m.Depth||t===m.Normal||t===m.Shadow||t===m.ShadowHighlight||t===m.ShadowExcludeHighlight||t===m.Highlight||t===m.ObjectAndLayerIdColor){return e===(this.parameters.transparent?this.parameters.writeDepth?S.TRANSPARENT_MATERIAL:S.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:S.OPAQUE_MATERIAL)||e===S.DRAPED_MATERIAL}return!1}createGLMaterial(e){return new P(e)}createBufferWriter(){return new O(this._vertexBufferLayout)}}class P extends T{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(t){this._output!==m.Color&&this._output!==m.Alpha||(this._updateShadowState(t),this._updateOccludeeState(t));const r=this._material.parameters;this.updateTexture(r.textureId);const s=t.camera.viewInverseTransposeMatrix;return e(r.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(r.treeRendering?R:A,t)}}class E extends C{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}}const L=new E;function j(e){const t=u().vec3f(b.POSITION);e.normalType===p.CompressedAttribute?t.vec2i16(b.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(b.NORMAL),e.hasVertexTangents&&t.vec4f(b.TANGENT);return(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(b.UV0),e.hasVertexColors&&t.vec4u8(b.COLOR),e.hasSymbolColors&&t.vec4u8(b.SYMBOLCOLOR),has("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(b.OBJECTANDLAYERIDCOLOR),t}const D=h(),N=h(),V=l(0,0,1),B=h(),H=h(),z=h(),G=h();export{P as DefaultGLMaterial,I as DefaultMaterial,E as DefaultMaterialParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{y as e,z as t}from"../../../../../chunks/mat4.js";import{BufferViewVec4f as f,BufferViewFloat as o,BufferViewVec4u8 as r,BufferViewVec2f as s,BufferViewVec3f as n}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as i}from"../../lib/Util.js";import{VertexAttribute as l}from"../../lib/VertexAttribute.js";function c(e,t,f,o,r=1){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,1===r)for(let l=0;l<i;++l)s[o]=t[e[l]],o+=n;else for(let l=0;l<i;++l){const f=t[e[l]];for(let e=0;e<r;e++)s[o]=f,o+=n}}function d(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=2*e[i];r[o]=t[f],r[o+1]=t[f+1],o+=s}}function u(e,t,f,o,r){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,null==r||1===r)for(let l=0;l<i;++l){const f=3*e[l];s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],o+=n}else for(let l=0;l<i;++l){const f=3*e[l];for(let e=0;e<r;++e)s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],o+=n}}function a(e,t,f,o,r=1){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,1===r)for(let l=0;l<i;++l){const f=4*e[l];s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],s[o+3]=t[f+3],o+=n}else for(let l=0;l<i;++l){const f=4*e[l];for(let e=0;e<r;++e)s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],s[o+3]=t[f+3],o+=n}}function p(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride;t*=r;for(let s=0;s<f;++s)o[t]=0,o[t+1]=0,o[t+2]=0,o[t+3]=0,t+=r}function y(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=9*e[i];for(let e=0;e<9;++e)r[o+e]=t[f+e];o+=s}}function B(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=16*e[i];for(let e=0;e<16;++e)r[o+e]=t[f+e];o+=s}}function g(t,f,o,r,s,n=1){if(!o)return void u(t,f,r,s,n);const i=r.typedBuffer,l=r.typedBufferStride,c=t.length,d=o[0],a=o[1],p=o[2],y=o[4],B=o[5],g=o[6],b=o[8],h=o[9],O=o[10],N=o[12],S=o[13],A=o[14];s*=l;let R=0,E=0,L=0;const z=e(o)?e=>{R=f[e]+N,E=f[e+1]+S,L=f[e+2]+A}:e=>{const t=f[e],o=f[e+1],r=f[e+2];R=d*t+y*o+b*r+N,E=a*t+B*o+h*r+S,L=p*t+g*o+O*r+A};if(1===n)for(let e=0;e<c;++e)z(3*t[e]),i[s]=R,i[s+1]=E,i[s+2]=L,s+=l;else for(let e=0;e<c;++e){z(3*t[e]);for(let e=0;e<n;++e)i[s]=R,i[s+1]=E,i[s+2]=L,s+=l}}function b(f,o,r,s,n,i=1){if(!r)return void u(f,o,s,n,i);const l=r,c=s.typedBuffer,d=s.typedBufferStride,a=f.length,p=l[0],y=l[1],B=l[2],g=l[4],b=l[5],h=l[6],O=l[8],N=l[9],S=l[10],A=!t(l),R=1e-6,E=1-R;n*=d;let L=0,z=0,F=0;const v=e(l)?e=>{L=o[e],z=o[e+1],F=o[e+2]}:e=>{const t=o[e],f=o[e+1],r=o[e+2];L=p*t+g*f+O*r,z=y*t+b*f+N*r,F=B*t+h*f+S*r};if(1===i)if(A)for(let e=0;e<a;++e){v(3*f[e]);const t=L*L+z*z+F*F;if(t<E&&t>R){const e=1/Math.sqrt(t);c[n]=L*e,c[n+1]=z*e,c[n+2]=F*e}else c[n]=L,c[n+1]=z,c[n+2]=F;n+=d}else for(let e=0;e<a;++e)v(3*f[e]),c[n]=L,c[n+1]=z,c[n+2]=F,n+=d;else for(let e=0;e<a;++e){if(v(3*f[e]),A){const e=L*L+z*z+F*F;if(e<E&&e>R){const t=1/Math.sqrt(e);L*=t,z*=t,F*=t}}for(let e=0;e<i;++e)c[n]=L,c[n+1]=z,c[n+2]=F,n+=d}}function h(e,f,o,r,s,n=1){if(!o)return void a(e,f,r,s,n);const i=o,l=r.typedBuffer,c=r.typedBufferStride,d=e.length,u=i[0],p=i[1],y=i[2],B=i[4],g=i[5],b=i[6],h=i[8],O=i[9],N=i[10],S=!t(i),A=1e-6,R=1-A;if(s*=c,1===n)for(let t=0;t<d;++t){const o=4*e[t],r=f[o],n=f[o+1],i=f[o+2],d=f[o+3];let a=u*r+B*n+h*i,E=p*r+g*n+O*i,L=y*r+b*n+N*i;if(S){const e=a*a+E*E+L*L;if(e<R&&e>A){const t=1/Math.sqrt(e);a*=t,E*=t,L*=t}}l[s]=a,l[s+1]=E,l[s+2]=L,l[s+3]=d,s+=c}else for(let t=0;t<d;++t){const o=4*e[t],r=f[o],i=f[o+1],d=f[o+2],a=f[o+3];let E=u*r+B*i+h*d,L=p*r+g*i+O*d,z=y*r+b*i+N*d;if(S){const e=E*E+L*L+z*z;if(e<R&&e>A){const t=1/Math.sqrt(e);E*=t,L*=t,z*=t}}for(let e=0;e<n;++e)l[s]=E,l[s+1]=L,l[s+2]=z,l[s+3]=a,s+=c}}function O(e,t,f,o,r,s=1){const n=o.typedBuffer,i=o.typedBufferStride,l=e.length;if(r*=i,f!==t.length||4!==f)if(1!==s)if(4!==f)for(let c=0;c<l;++c){const f=3*e[c];for(let e=0;e<s;++e)n[r]=t[f],n[r+1]=t[f+1],n[r+2]=t[f+2],n[r+3]=255,r+=i}else for(let c=0;c<l;++c){const f=4*e[c];for(let e=0;e<s;++e)n[r]=t[f],n[r+1]=t[f+1],n[r+2]=t[f+2],n[r+3]=t[f+3],r+=i}else{if(4===f){for(let f=0;f<l;++f){const o=4*e[f];n[r]=t[o],n[r+1]=t[o+1],n[r+2]=t[o+2],n[r+3]=t[o+3],r+=i}return}for(let f=0;f<l;++f){const o=3*e[f];n[r]=t[o],n[r+1]=t[o+1],n[r+2]=t[o+2],n[r+3]=255,r+=i}}else{n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3];const e=new Uint32Array(o.typedBuffer.buffer,o.start),f=i/4,c=e[r/=4];r+=f;const d=l*s;for(let t=1;t<d;++t)e[r]=c,r+=f}}function N(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length,i=t[0];o*=s;for(let l=0;l<n;++l)r[o]=i,o+=s}function S(e,t,f,o,r=1){const s=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===r)for(let i=0;i<f;++i)s[o]=e[0],s[o+1]=e[1],s[o+2]=e[2],s[o+3]=e[3],o+=n;else for(let i=0;i<f;++i)for(let t=0;t<r;++t)s[o]=e[0],s[o+1]=e[1],s[o+2]=e[2],s[o+3]=e[3],o+=n}function A(e,t,c,u,p,y){for(const B of t.fields.keys()){const t=e.vertexAttributes.get(B),A=e.indices.get(B);if(t&&A)switch(B){case l.POSITION:{i(3===t.size);const e=p.getField(B,n);i(!!e,`No buffer view for ${B}`),e&&g(A,t.data,c,e,y);break}case l.NORMAL:{i(3===t.size);const e=p.getField(B,n);i(!!e,`No buffer view for ${B}`),e&&b(A,t.data,u,e,y);break}case l.UV0:{i(2===t.size);const e=p.getField(B,s);i(!!e,`No buffer view for ${B}`),e&&d(A,t.data,e,y);break}case l.COLOR:case l.SYMBOLCOLOR:{const e=p.getField(B,r);i(!!e,`No buffer view for ${B}`),i(3===t.size||4===t.size),!e||3!==t.size&&4!==t.size||O(A,t.data,t.size,e,y);break}case l.COLORFEATUREATTRIBUTE:{const e=p.getField(B,o);i(!!e,`No buffer view for ${B}`),i(1===t.size),e&&1===t.size&&N(A,t.data,e,y);break}case l.TANGENT:{i(4===t.size);const e=p.getField(B,f);i(!!e,`No buffer view for ${B}`),e&&h(A,t.data,u,e,y);break}case l.PROFILERIGHT:case l.PROFILEUP:case l.PROFILEVERTEXANDNORMAL:case l.FEATUREVALUE:{i(4===t.size);const e=p.getField(B,f);i(!!e,`No buffer view for ${B}`),e&&a(A,t.data,e,y)}}else if(B===l.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(l.POSITION);if(i(!!t,`No buffer view for ${B}`),t){const f=t.length,o=p.getField(B,r);S(e.objectAndLayerIdColor,o,f,y)}}}}export{c as writeBufferFloat,y as writeBufferMat3f,B as writeBufferMat4f,d as writeBufferVec2,u as writeBufferVec3,a as writeBufferVec4,p as writeBufferVec4Zeros,O as writeColor,N as writeColorFeatureAttribute,A as writeDefaultAttributes,b as writeNormal,S as writeObjectAndLayerIdColor,g as writePosition,h as writeTangent};
5
+ import{y as e,z as t}from"../../../../../chunks/mat4.js";import{BufferViewVec4f as f,BufferViewFloat as o,BufferViewVec4u8 as r,BufferViewVec2f as s,BufferViewVec2i16 as n,BufferViewVec3f as i}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as c}from"../../lib/Util.js";import{VertexAttribute as l}from"../../lib/VertexAttribute.js";function d(e,t,f,o,r=1){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,1===r)for(let c=0;c<i;++c)s[o]=t[e[c]],o+=n;else for(let c=0;c<i;++c){const f=t[e[c]];for(let e=0;e<r;e++)s[o]=f,o+=n}}function u(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=2*e[i];r[o]=t[f],r[o+1]=t[f+1],o+=s}}function a(e,t,f,o,r){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,null==r||1===r)for(let c=0;c<i;++c){const f=3*e[c];s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],o+=n}else for(let c=0;c<i;++c){const f=3*e[c];for(let e=0;e<r;++e)s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],o+=n}}function p(e,t,f,o,r=1){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,1===r)for(let c=0;c<i;++c){const f=4*e[c];s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],s[o+3]=t[f+3],o+=n}else for(let c=0;c<i;++c){const f=4*e[c];for(let e=0;e<r;++e)s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],s[o+3]=t[f+3],o+=n}}function y(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride;t*=r;for(let s=0;s<f;++s)o[t]=0,o[t+1]=0,o[t+2]=0,o[t+3]=0,t+=r}function B(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=9*e[i];for(let e=0;e<9;++e)r[o+e]=t[f+e];o+=s}}function g(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=16*e[i];for(let e=0;e<16;++e)r[o+e]=t[f+e];o+=s}}function b(t,f,o,r,s,n=1){if(!o)return void a(t,f,r,s,n);const i=r.typedBuffer,c=r.typedBufferStride,l=t.length,d=o[0],u=o[1],p=o[2],y=o[4],B=o[5],g=o[6],b=o[8],O=o[9],h=o[10],N=o[12],S=o[13],R=o[14];s*=c;let A=0,E=0,L=0;const z=e(o)?e=>{A=f[e]+N,E=f[e+1]+S,L=f[e+2]+R}:e=>{const t=f[e],o=f[e+1],r=f[e+2];A=d*t+y*o+b*r+N,E=u*t+B*o+O*r+S,L=p*t+g*o+h*r+R};if(1===n)for(let e=0;e<l;++e)z(3*t[e]),i[s]=A,i[s+1]=E,i[s+2]=L,s+=c;else for(let e=0;e<l;++e){z(3*t[e]);for(let e=0;e<n;++e)i[s]=A,i[s+1]=E,i[s+2]=L,s+=c}}function O(f,o,r,s,n,i=1){if(!r)return void a(f,o,s,n,i);const c=r,l=s.typedBuffer,d=s.typedBufferStride,u=f.length,p=c[0],y=c[1],B=c[2],g=c[4],b=c[5],O=c[6],h=c[8],N=c[9],S=c[10],R=!t(c),A=1e-6,E=1-A;n*=d;let L=0,z=0,F=0;const v=e(c)?e=>{L=o[e],z=o[e+1],F=o[e+2]}:e=>{const t=o[e],f=o[e+1],r=o[e+2];L=p*t+g*f+h*r,z=y*t+b*f+N*r,F=B*t+O*f+S*r};if(1===i)if(R)for(let e=0;e<u;++e){v(3*f[e]);const t=L*L+z*z+F*F;if(t<E&&t>A){const e=1/Math.sqrt(t);l[n]=L*e,l[n+1]=z*e,l[n+2]=F*e}else l[n]=L,l[n+1]=z,l[n+2]=F;n+=d}else for(let e=0;e<u;++e)v(3*f[e]),l[n]=L,l[n+1]=z,l[n+2]=F,n+=d;else for(let e=0;e<u;++e){if(v(3*f[e]),R){const e=L*L+z*z+F*F;if(e<E&&e>A){const t=1/Math.sqrt(e);L*=t,z*=t,F*=t}}for(let e=0;e<i;++e)l[n]=L,l[n+1]=z,l[n+2]=F,n+=d}}function h(e,f,o,r,s,n=1){if(!o)return void p(e,f,r,s,n);const i=o,c=r.typedBuffer,l=r.typedBufferStride,d=e.length,u=i[0],a=i[1],y=i[2],B=i[4],g=i[5],b=i[6],O=i[8],h=i[9],N=i[10],S=!t(i),R=1e-6,A=1-R;if(s*=l,1===n)for(let t=0;t<d;++t){const o=4*e[t],r=f[o],n=f[o+1],i=f[o+2],d=f[o+3];let p=u*r+B*n+O*i,E=a*r+g*n+h*i,L=y*r+b*n+N*i;if(S){const e=p*p+E*E+L*L;if(e<A&&e>R){const t=1/Math.sqrt(e);p*=t,E*=t,L*=t}}c[s]=p,c[s+1]=E,c[s+2]=L,c[s+3]=d,s+=l}else for(let t=0;t<d;++t){const o=4*e[t],r=f[o],i=f[o+1],d=f[o+2],p=f[o+3];let E=u*r+B*i+O*d,L=a*r+g*i+h*d,z=y*r+b*i+N*d;if(S){const e=E*E+L*L+z*z;if(e<A&&e>R){const t=1/Math.sqrt(e);E*=t,L*=t,z*=t}}for(let e=0;e<n;++e)c[s]=E,c[s+1]=L,c[s+2]=z,c[s+3]=p,s+=l}}function N(e,t,f,o,r,s=1){const n=o.typedBuffer,i=o.typedBufferStride,c=e.length;if(r*=i,f!==t.length||4!==f)if(1!==s)if(4!==f)for(let l=0;l<c;++l){const f=3*e[l];for(let e=0;e<s;++e)n[r]=t[f],n[r+1]=t[f+1],n[r+2]=t[f+2],n[r+3]=255,r+=i}else for(let l=0;l<c;++l){const f=4*e[l];for(let e=0;e<s;++e)n[r]=t[f],n[r+1]=t[f+1],n[r+2]=t[f+2],n[r+3]=t[f+3],r+=i}else{if(4===f){for(let f=0;f<c;++f){const o=4*e[f];n[r]=t[o],n[r+1]=t[o+1],n[r+2]=t[o+2],n[r+3]=t[o+3],r+=i}return}for(let f=0;f<c;++f){const o=3*e[f];n[r]=t[o],n[r+1]=t[o+1],n[r+2]=t[o+2],n[r+3]=255,r+=i}}else{n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3];const e=new Uint32Array(o.typedBuffer.buffer,o.start),f=i/4,l=e[r/=4];r+=f;const d=c*s;for(let t=1;t<d;++t)e[r]=l,r+=f}}function S(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length,i=t[0];o*=s;for(let c=0;c<n;++c)r[o]=i,o+=s}function R(e,t,f,o,r=1){const s=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===r)for(let i=0;i<f;++i)s[o]=e[0],s[o+1]=e[1],s[o+2]=e[2],s[o+3]=e[3],o+=n;else for(let i=0;i<f;++i)for(let t=0;t<r;++t)s[o]=e[0],s[o+1]=e[1],s[o+2]=e[2],s[o+3]=e[3],o+=n}function A(e,t,d,a,y,B){for(const g of t.fields.keys()){const t=e.vertexAttributes.get(g),A=e.indices.get(g);if(t&&A)switch(g){case l.POSITION:{c(3===t.size);const e=y.getField(g,i);c(!!e,`No buffer view for ${g}`),e&&b(A,t.data,d,e,B);break}case l.NORMAL:{c(3===t.size);const e=y.getField(g,i);c(!!e,`No buffer view for ${g}`),e&&O(A,t.data,a,e,B);break}case l.NORMALCOMPRESSED:{c(2===t.size);const e=y.getField(g,n);c(!!e,`No buffer view for ${g}`),e&&u(A,t.data,e,B);break}case l.UV0:{c(2===t.size);const e=y.getField(g,s);c(!!e,`No buffer view for ${g}`),e&&u(A,t.data,e,B);break}case l.COLOR:case l.SYMBOLCOLOR:{const e=y.getField(g,r);c(!!e,`No buffer view for ${g}`),c(3===t.size||4===t.size),!e||3!==t.size&&4!==t.size||N(A,t.data,t.size,e,B);break}case l.COLORFEATUREATTRIBUTE:{const e=y.getField(g,o);c(!!e,`No buffer view for ${g}`),c(1===t.size),e&&1===t.size&&S(A,t.data,e,B);break}case l.TANGENT:{c(4===t.size);const e=y.getField(g,f);c(!!e,`No buffer view for ${g}`),e&&h(A,t.data,a,e,B);break}case l.PROFILERIGHT:case l.PROFILEUP:case l.PROFILEVERTEXANDNORMAL:case l.FEATUREVALUE:{c(4===t.size);const e=y.getField(g,f);c(!!e,`No buffer view for ${g}`),e&&p(A,t.data,e,B)}}else if(g===l.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(l.POSITION);if(c(!!t,`No buffer view for ${g}`),t){const f=t.length,o=y.getField(g,r);R(e.objectAndLayerIdColor,o,f,B)}}}}export{d as writeBufferFloat,B as writeBufferMat3f,g as writeBufferMat4f,u as writeBufferVec2,a as writeBufferVec3,p as writeBufferVec4,y as writeBufferVec4Zeros,N as writeColor,S as writeColorFeatureAttribute,A as writeDefaultAttributes,O as writeNormal,R as writeObjectAndLayerIdColor,b as writePosition,h as writeTangent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{f as e,c as t}from"../../../../chunks/vec3f64.js";import{f as i}from"../../../../chunks/vec4f64.js";import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as o}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as a}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as l,VertexNormalDrawParameters as n}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{defaultMaskAlphaCutoff as h}from"../core/shaderLibrary/util/AlphaCutoff.js";import{ReloadableShaderModule as c}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as p,DepthTestFunction as d,AlphaDiscardMode as m}from"../lib/basicInterfaces.js";import{Default3D as f}from"../lib/DefaultVertexAttributeLocations.js";import{RenderOccludedFlag as b}from"../lib/Material.js";import{blendingDefault as g,oitBlending as S,oitDepthTest as y,getOITPolygonOffset as T}from"../lib/OrderIndependentTransparency.js";import{Program as P}from"../lib/Program.js";import{stencilWriteMaskOn as j,stencilToolMaskBaseParams as x,stencilBaseAllZerosParams as v}from"../lib/StencilUtils.js";import{TransparencyPassType as O}from"../lib/TransparencyPassType.js";import{D as A}from"../../../../chunks/DefaultMaterial.glsl.js";import{CompareFunction as C}from"../../../webgl/enums.js";import{makePipelineState as L,cullingParams as M,defaultDepthWriteParams as D,defaultColorWriteParams as w}from"../../../webgl/renderState.js";class F extends l{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=e(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=p.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=e(0,0,0),this.instancedDoublePrecision=!1,this.normalType=o.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=e(.2,.2,.2),this.diffuse=e(.8,.8,.8),this.externalColor=i(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=t(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=d.Less,this.textureAlphaMode=m.Blend,this.textureAlphaCutoff=h,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=b.Occlude}}class _ extends n{constructor(){super(...arguments),this.origin=t(),this.slicePlaneLocalOrigin=this.origin}}class k extends u{initializeConfiguration(e,t){t.spherical=e.viewingMode===r.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?a.Default:a.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,k.shader)}_initializeProgram(e,t){return new P(e.rctx,t.get().build(this.configuration),f)}_convertDepthTestFunction(e){return e===d.Lequal?C.LEQUAL:C.LESS}_makePipeline(e,t){const i=this.configuration,r=e===O.NONE,o=e===O.FrontFace;return L({blending:i.output!==s.Color&&i.output!==s.Alpha||!i.transparent?null:r?g:S(e),culling:N(i)?M(i.cullFace):null,depthTest:{func:y(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:(r||o)&&i.writeDepth?D:null,colorWrite:w,stencilWrite:i.hasOccludees?j:null,stencilTest:i.hasOccludees?t?x:v:null,polygonOffset:r||o?null:T(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function N(e){return e.cullFace!==p.None||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}k.shader=new c(A,(()=>import("./DefaultMaterial.glsl.js")));export{_ as DefaultMaterialDrawParameters,F as DefaultMaterialPassParameters,k as DefaultMaterialTechnique};
5
+ import{f as e,c as t}from"../../../../chunks/vec3f64.js";import{f as i}from"../../../../chunks/vec4f64.js";import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as o}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as a}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as l,VertexNormalDrawParameters as n}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{defaultMaskAlphaCutoff as h}from"../core/shaderLibrary/util/AlphaCutoff.js";import{ReloadableShaderModule as c}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as p,DepthTestFunction as d,AlphaDiscardMode as m}from"../lib/basicInterfaces.js";import{Default3D as f}from"../lib/DefaultVertexAttributeLocations.js";import{RenderOccludedFlag as b}from"../lib/Material.js";import{blendingDefault as g,oitBlending as S,oitDepthTest as y,getOITPolygonOffset as T}from"../lib/OrderIndependentTransparency.js";import{Program as P}from"../lib/Program.js";import{stencilWriteMaskOn as j,stencilToolMaskBaseParams as x,stencilBaseAllZerosParams as v}from"../lib/StencilUtils.js";import{TransparencyPassType as O}from"../lib/TransparencyPassType.js";import{D as A}from"../../../../chunks/DefaultMaterial.glsl.js";import{CompareFunction as C}from"../../../webgl/enums.js";import{makePipelineState as L,cullingParams as M,defaultDepthWriteParams as D,defaultColorWriteParams as w}from"../../../webgl/renderState.js";class F extends l{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=e(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=p.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=e(0,0,0),this.instancedDoublePrecision=!1,this.normalType=o.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=e(.2,.2,.2),this.diffuse=e(.8,.8,.8),this.externalColor=i(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=t(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=d.Less,this.textureAlphaMode=m.Blend,this.textureAlphaCutoff=h,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=b.Occlude}}class _ extends n{constructor(){super(...arguments),this.origin=t(),this.slicePlaneLocalOrigin=this.origin}}class k extends u{initializeConfiguration(e,t){t.spherical=e.viewingMode===r.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?a.Default:a.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,k.shader)}_initializeProgram(e,t){return new P(e.rctx,t.get().build(this.configuration),f)}_convertDepthTestFunction(e){return e===d.Lequal?C.LEQUAL:C.LESS}_makePipeline(e,t){const i=this.configuration,r=e===O.NONE,o=e===O.FrontFace;return L({blending:i.output!==s.Color&&i.output!==s.Alpha||!i.transparent?null:r?g:S(e),culling:N(i)?M(i.cullFace):null,depthTest:{func:y(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:(r||o)&&i.writeDepth?D:null,colorWrite:w,stencilWrite:i.hasOccludees?j:null,stencilTest:i.hasOccludees?t?x:v:null,polygonOffset:r||o?null:T(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function N(e){return e.cullFace!==p.None||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}k.shader=new c(A,(()=>import("./DefaultMaterial.glsl.js")));export{_ as DefaultMaterialDrawParameters,F as DefaultMaterialPassParameters,k as DefaultMaterialTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as r}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as s}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{AlphaDiscardMode as p,CullFaceOptions as h,DepthTestFunction as n}from"../lib/basicInterfaces.js";import{TransparencyPassType as d}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as l}from"../materials/DefaultTechniqueConfiguration.js";class c extends l{constructor(){super(...arguments),this.output=t.Color,this.alphaDiscardMode=p.Opaque,this.doubleSidedMode=s.None,this.pbrMode=i.Disabled,this.cullFace=h.None,this.transparencyPassType=d.NONE,this.normalType=e.Attribute,this.textureCoordinateType=r.None,this.customDepthTest=n.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}o([a({count:t.COUNT})],c.prototype,"output",void 0),o([a({count:p.COUNT})],c.prototype,"alphaDiscardMode",void 0),o([a({count:s.COUNT})],c.prototype,"doubleSidedMode",void 0),o([a({count:i.COUNT})],c.prototype,"pbrMode",void 0),o([a({count:h.COUNT})],c.prototype,"cullFace",void 0),o([a({count:d.COUNT})],c.prototype,"transparencyPassType",void 0),o([a({count:e.COUNT})],c.prototype,"normalType",void 0),o([a({count:r.COUNT})],c.prototype,"textureCoordinateType",void 0),o([a({count:n.COUNT})],c.prototype,"customDepthTest",void 0),o([a()],c.prototype,"spherical",void 0),o([a()],c.prototype,"hasVertexColors",void 0),o([a()],c.prototype,"hasSymbolColors",void 0),o([a()],c.prototype,"hasVerticalOffset",void 0),o([a()],c.prototype,"hasSlicePlane",void 0),o([a()],c.prototype,"hasSliceHighlight",void 0),o([a()],c.prototype,"hasColorTexture",void 0),o([a()],c.prototype,"hasMetallicRoughnessTexture",void 0),o([a()],c.prototype,"hasEmissionTexture",void 0),o([a()],c.prototype,"hasOcclusionTexture",void 0),o([a()],c.prototype,"hasNormalTexture",void 0),o([a()],c.prototype,"hasScreenSizePerspective",void 0),o([a()],c.prototype,"hasVertexTangents",void 0),o([a()],c.prototype,"hasOccludees",void 0),o([a()],c.prototype,"hasMultipassTerrain",void 0),o([a()],c.prototype,"hasModelTransformation",void 0),o([a()],c.prototype,"offsetBackfaces",void 0),o([a()],c.prototype,"vvSize",void 0),o([a()],c.prototype,"vvColor",void 0),o([a()],c.prototype,"receiveShadows",void 0),o([a()],c.prototype,"receiveAmbientOcclusion",void 0),o([a()],c.prototype,"textureAlphaPremultiplied",void 0),o([a()],c.prototype,"instanced",void 0),o([a()],c.prototype,"instancedColor",void 0),o([a()],c.prototype,"objectAndLayerIdColorInstanced",void 0),o([a()],c.prototype,"instancedDoublePrecision",void 0),o([a()],c.prototype,"doublePrecisionRequiresObfuscation",void 0),o([a()],c.prototype,"writeDepth",void 0),o([a()],c.prototype,"transparent",void 0),o([a()],c.prototype,"enableOffset",void 0),o([a()],c.prototype,"cullAboveGround",void 0),o([a()],c.prototype,"snowCover",void 0),o([a()],c.prototype,"hasColorTextureTransform",void 0),o([a()],c.prototype,"hasEmissionTextureTransform",void 0),o([a()],c.prototype,"hasNormalTextureTransform",void 0),o([a()],c.prototype,"hasOcclusionTextureTransform",void 0),o([a()],c.prototype,"hasMetallicRoughnessTextureTransform",void 0),o([a({constValue:!0})],c.prototype,"hasVvInstancing",void 0),o([a({constValue:!1})],c.prototype,"useCustomDTRExponentForWater",void 0),o([a({constValue:!1})],c.prototype,"supportsTextureAtlas",void 0),o([a({constValue:!0})],c.prototype,"useFillLights",void 0);export{c as DefaultMaterialTechniqueConfiguration};
5
+ import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as r}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as s}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{AlphaDiscardMode as p,CullFaceOptions as h,DepthTestFunction as n}from"../lib/basicInterfaces.js";import{TransparencyPassType as d}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as l}from"../materials/DefaultTechniqueConfiguration.js";class c extends l{constructor(){super(...arguments),this.output=t.Color,this.alphaDiscardMode=p.Opaque,this.doubleSidedMode=s.None,this.pbrMode=i.Disabled,this.cullFace=h.None,this.transparencyPassType=d.NONE,this.normalType=e.Attribute,this.textureCoordinateType=r.None,this.customDepthTest=n.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}o([a({count:t.COUNT})],c.prototype,"output",void 0),o([a({count:p.COUNT})],c.prototype,"alphaDiscardMode",void 0),o([a({count:s.COUNT})],c.prototype,"doubleSidedMode",void 0),o([a({count:i.COUNT})],c.prototype,"pbrMode",void 0),o([a({count:h.COUNT})],c.prototype,"cullFace",void 0),o([a({count:d.COUNT})],c.prototype,"transparencyPassType",void 0),o([a({count:e.COUNT})],c.prototype,"normalType",void 0),o([a({count:r.COUNT})],c.prototype,"textureCoordinateType",void 0),o([a({count:n.COUNT})],c.prototype,"customDepthTest",void 0),o([a()],c.prototype,"spherical",void 0),o([a()],c.prototype,"hasVertexColors",void 0),o([a()],c.prototype,"hasSymbolColors",void 0),o([a()],c.prototype,"hasVerticalOffset",void 0),o([a()],c.prototype,"hasSlicePlane",void 0),o([a()],c.prototype,"hasSliceHighlight",void 0),o([a()],c.prototype,"hasColorTexture",void 0),o([a()],c.prototype,"hasMetallicRoughnessTexture",void 0),o([a()],c.prototype,"hasEmissionTexture",void 0),o([a()],c.prototype,"hasOcclusionTexture",void 0),o([a()],c.prototype,"hasNormalTexture",void 0),o([a()],c.prototype,"hasScreenSizePerspective",void 0),o([a()],c.prototype,"hasVertexTangents",void 0),o([a()],c.prototype,"hasOccludees",void 0),o([a()],c.prototype,"hasMultipassTerrain",void 0),o([a()],c.prototype,"hasModelTransformation",void 0),o([a()],c.prototype,"offsetBackfaces",void 0),o([a()],c.prototype,"vvSize",void 0),o([a()],c.prototype,"vvColor",void 0),o([a()],c.prototype,"receiveShadows",void 0),o([a()],c.prototype,"receiveAmbientOcclusion",void 0),o([a()],c.prototype,"textureAlphaPremultiplied",void 0),o([a()],c.prototype,"instanced",void 0),o([a()],c.prototype,"instancedColor",void 0),o([a()],c.prototype,"objectAndLayerIdColorInstanced",void 0),o([a()],c.prototype,"instancedDoublePrecision",void 0),o([a()],c.prototype,"doublePrecisionRequiresObfuscation",void 0),o([a()],c.prototype,"writeDepth",void 0),o([a()],c.prototype,"transparent",void 0),o([a()],c.prototype,"enableOffset",void 0),o([a()],c.prototype,"cullAboveGround",void 0),o([a()],c.prototype,"snowCover",void 0),o([a()],c.prototype,"hasColorTextureTransform",void 0),o([a()],c.prototype,"hasEmissionTextureTransform",void 0),o([a()],c.prototype,"hasNormalTextureTransform",void 0),o([a()],c.prototype,"hasOcclusionTextureTransform",void 0),o([a()],c.prototype,"hasMetallicRoughnessTextureTransform",void 0),o([a({constValue:!0})],c.prototype,"hasVvInstancing",void 0),o([a({constValue:!1})],c.prototype,"useCustomDTRExponentForWater",void 0),o([a({constValue:!1})],c.prototype,"supportsTextureAtlas",void 0),o([a({constValue:!0})],c.prototype,"useFillLights",void 0);export{c as DefaultMaterialTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{NormalAttributeType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as r}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{DefaultMaterialTechnique as a}from"./DefaultMaterialTechnique.js";import{R as s}from"../../../../chunks/RealisticTree.glsl.js";class t extends a{initializeConfiguration(i,a){super.initializeConfiguration(i,a),a.hasMetallicRoughnessTexture=!1,a.hasEmissionTexture=!1,a.hasOcclusionTexture=!1,a.hasNormalTexture=!1,a.hasModelTransformation=!1,a.normalType=e.Attribute,a.doubleSidedMode=r.WindingOrder,a.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,t.shader)}}t.shader=new i(s,(()=>import("./RealisticTree.glsl.js")));export{t as RealisticTreeTechnique};
5
+ import{NormalType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as r}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{DefaultMaterialTechnique as a}from"./DefaultMaterialTechnique.js";import{R as s}from"../../../../chunks/RealisticTree.glsl.js";class t extends a{initializeConfiguration(i,a){super.initializeConfiguration(i,a),a.hasMetallicRoughnessTexture=!1,a.hasEmissionTexture=!1,a.hasOcclusionTexture=!1,a.hasNormalTexture=!1,a.hasModelTransformation=!1,a.normalType=e.Attribute,a.doubleSidedMode=r.WindingOrder,a.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,t.shader)}}t.shader=new i(s,(()=>import("./RealisticTree.glsl.js")));export{t as RealisticTreeTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as t}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as r}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OverlayMode as s}from"../core/shaderLibrary/terrain/Overlay.glsl.js";import{TileBlendInput as p}from"../core/shaderLibrary/terrain/TileBlendInput.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as d}from"../materials/DefaultTechniqueConfiguration.js";class l extends d{constructor(){super(...arguments),this.output=o.Color,this.overlayMode=s.Disabled,this.tileBlendInput=p.LayerOnly,this.spherical=!1,this.doublePrecisionRequiresObfuscation=!1,this.atmosphere=!1,this.receiveShadows=!1,this.hasSlicePlane=!1,this.backfaceCullingEnabled=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.hasScreenSpaceReflections=!1,this.hasCloudsReflections=!1,this.invisible=!1,this.tileBorders=!1,this.visualizeNormals=!1,this.screenSizePerspective=!1,this.receiveAmbientOcclusion=!1,this.pbrMode=i.Terrain}}e([a({count:o.COUNT})],l.prototype,"output",void 0),e([a({count:s.COUNT})],l.prototype,"overlayMode",void 0),e([a({count:p.COUNT})],l.prototype,"tileBlendInput",void 0),e([a()],l.prototype,"spherical",void 0),e([a()],l.prototype,"doublePrecisionRequiresObfuscation",void 0),e([a()],l.prototype,"atmosphere",void 0),e([a()],l.prototype,"receiveShadows",void 0),e([a()],l.prototype,"hasSlicePlane",void 0),e([a()],l.prototype,"backfaceCullingEnabled",void 0),e([a()],l.prototype,"textureFadingEnabled",void 0),e([a()],l.prototype,"renderOccluded",void 0),e([a()],l.prototype,"hasScreenSpaceReflections",void 0),e([a()],l.prototype,"hasCloudsReflections",void 0),e([a()],l.prototype,"invisible",void 0),e([a()],l.prototype,"tileBorders",void 0),e([a()],l.prototype,"visualizeNormals",void 0),e([a()],l.prototype,"screenSizePerspective",void 0),e([a()],l.prototype,"receiveAmbientOcclusion",void 0),e([a({count:i.COUNT})],l.prototype,"pbrMode",void 0),e([a({constValue:t.CompressedAttribute})],l.prototype,"normalType",void 0),e([a({constValue:r.Compressed})],l.prototype,"textureCoordinateType",void 0),e([a({constValue:!1})],l.prototype,"highStepCount",void 0),e([a({constValue:!1})],l.prototype,"useCustomDTRExponentForWater",void 0),e([a({constValue:!1})],l.prototype,"useFillLights",void 0);export{l as TerrainTechniqueConfiguration};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as t}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as r}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OverlayMode as s}from"../core/shaderLibrary/terrain/Overlay.glsl.js";import{TileBlendInput as p}from"../core/shaderLibrary/terrain/TileBlendInput.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as d}from"../materials/DefaultTechniqueConfiguration.js";class l extends d{constructor(){super(...arguments),this.output=o.Color,this.overlayMode=s.Disabled,this.tileBlendInput=p.LayerOnly,this.spherical=!1,this.doublePrecisionRequiresObfuscation=!1,this.atmosphere=!1,this.receiveShadows=!1,this.hasSlicePlane=!1,this.backfaceCullingEnabled=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.hasScreenSpaceReflections=!1,this.hasCloudsReflections=!1,this.invisible=!1,this.tileBorders=!1,this.visualizeNormals=!1,this.screenSizePerspective=!1,this.receiveAmbientOcclusion=!1,this.pbrMode=i.Terrain}}e([a({count:o.COUNT})],l.prototype,"output",void 0),e([a({count:s.COUNT})],l.prototype,"overlayMode",void 0),e([a({count:p.COUNT})],l.prototype,"tileBlendInput",void 0),e([a()],l.prototype,"spherical",void 0),e([a()],l.prototype,"doublePrecisionRequiresObfuscation",void 0),e([a()],l.prototype,"atmosphere",void 0),e([a()],l.prototype,"receiveShadows",void 0),e([a()],l.prototype,"hasSlicePlane",void 0),e([a()],l.prototype,"backfaceCullingEnabled",void 0),e([a()],l.prototype,"textureFadingEnabled",void 0),e([a()],l.prototype,"renderOccluded",void 0),e([a()],l.prototype,"hasScreenSpaceReflections",void 0),e([a()],l.prototype,"hasCloudsReflections",void 0),e([a()],l.prototype,"invisible",void 0),e([a()],l.prototype,"tileBorders",void 0),e([a()],l.prototype,"visualizeNormals",void 0),e([a()],l.prototype,"screenSizePerspective",void 0),e([a()],l.prototype,"receiveAmbientOcclusion",void 0),e([a({count:i.COUNT})],l.prototype,"pbrMode",void 0),e([a({constValue:t.CompressedAttribute})],l.prototype,"normalType",void 0),e([a({constValue:r.Compressed})],l.prototype,"textureCoordinateType",void 0),e([a({constValue:!1})],l.prototype,"highStepCount",void 0),e([a({constValue:!1})],l.prototype,"useCustomDTRExponentForWater",void 0),e([a({constValue:!1})],l.prototype,"useFillLights",void 0);export{l as TerrainTechniqueConfiguration};