@arcgis/core 5.0.0-next.31 → 5.0.0-next.33

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 (241) hide show
  1. package/applications/SceneViewer/sceneViewerUtils.d.ts +3 -0
  2. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/1dd867fa7c58c06b79ea.js +1 -0
  5. package/assets/esri/core/workers/chunks/22d66d1c8dfccdbbcf30.js +1 -0
  6. package/assets/esri/core/workers/chunks/22f745539ca54d8cd30d.js +1 -0
  7. package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +1 -0
  8. package/assets/esri/core/workers/chunks/27bd88e1101873d4ce12.js +1 -0
  9. package/assets/esri/core/workers/chunks/{1dfca37f95f2b968aa54.js → 39d2b540738431adec98.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{5f2cf73fb2944f82661d.js → 433d249c35c56bf15806.js} +34 -34
  11. package/assets/esri/core/workers/chunks/446f76356fc116204ec3.js +1 -0
  12. package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +1 -0
  13. package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +1 -0
  14. package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +1 -0
  15. package/assets/esri/core/workers/chunks/52ecbaa2d32692d6d8df.js +1 -0
  16. package/assets/esri/core/workers/chunks/{3777b41b4fa2f1418402.js → 55818fe7a7aa1e5c8bbd.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{7e6fae3660e7a6a0fa16.js → 5f781ef46ce7c4048c2f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/63933cbcb5c12df09715.js +1 -0
  19. package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +1 -0
  20. package/assets/esri/core/workers/chunks/{e6df4327ac1d9b65b80d.js → 71dd80231ea656a6380c.js} +1 -1
  21. package/assets/esri/core/workers/chunks/725819839434c59102f3.js +1 -0
  22. package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +1 -0
  23. package/assets/esri/core/workers/chunks/{bd58c027408dc858f23c.js → 77b45957cfe42523c1c8.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{b2fbb44e219232e61cbd.js → 794960ec36e11f4416c2.js} +1 -1
  25. package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +1 -0
  26. package/assets/esri/core/workers/chunks/{25fd0884dd14973c89f5.js → 866a608d489bf56bc371.js} +1 -1
  27. package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +1 -0
  28. package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +1 -0
  29. package/assets/esri/core/workers/chunks/{0bfb7db0a151a5e85dd1.js → 8ad6595ad44c2d60c1ce.js} +1 -1
  30. package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +1 -0
  31. package/assets/esri/core/workers/chunks/{11bb437437272d8f3e2c.js → 9252854b512237b6a0ef.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{e615983fab688d515205.js → 944dfa9309da8f49a616.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{f2f4e34247882eceb50d.js → a2cee5ac0d4df0108425.js} +3 -3
  34. package/assets/esri/core/workers/chunks/a4b7ba8aec109beb5b4d.js +1 -0
  35. package/assets/esri/core/workers/chunks/{3bacd904cd93c8013f6a.js → ae793d814cf32db9fbde.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{e0b70652da4a7f672cfc.js → b21cf62652ca772108c8.js} +1 -1
  37. package/assets/esri/core/workers/chunks/c2596f48b37092dd566c.js +1 -0
  38. package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +1 -0
  39. package/assets/esri/core/workers/chunks/c9c2e00fed979c21e2f0.js +1 -0
  40. package/assets/esri/core/workers/chunks/{94005916d321c879bea1.js → cb500d673ca7ec1ef945.js} +1 -1
  41. package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +1 -0
  42. package/assets/esri/core/workers/chunks/d6d03f22c91f528b97e5.js +1 -0
  43. package/assets/esri/core/workers/chunks/{4ab89c990a82c745c0fd.js → d764b6273974f4bca31b.js} +1 -1
  44. package/assets/esri/core/workers/chunks/d86e59da76eea888ba86.js +1 -0
  45. package/assets/esri/core/workers/chunks/da517b4b07d4d27ce94c.js +1 -0
  46. package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +1 -0
  47. package/assets/esri/core/workers/chunks/defc6b50df5018bd9e86.js +1 -0
  48. package/assets/esri/core/workers/chunks/df458ad51be27df3d79d.js +1 -0
  49. package/assets/esri/core/workers/chunks/{01b8e680befff83e7d3e.js → e093e745708f722bc1b9.js} +1 -1
  50. package/assets/esri/core/workers/chunks/e32fc0b2c6530d28ce85.js +1 -0
  51. package/assets/esri/core/workers/chunks/e3a994587f9b2e88db85.js +1 -0
  52. package/assets/esri/core/workers/chunks/ea5bf896acfcc3106bf5.js +1 -0
  53. package/assets/esri/core/workers/chunks/ed1dabed10ff9f4e0369.js +1 -0
  54. package/assets/esri/core/workers/chunks/{a74e6d505a55ed27f004.js → f11453f24c0b728669d2.js} +1 -1
  55. package/assets/esri/core/workers/chunks/f2ebd6471e1259a6eac0.js +1 -0
  56. package/assets/esri/core/workers/chunks/{14dc21fe66c7b98fb456.js → f3127bdf28a1d9b8db27.js} +1 -1
  57. package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +1 -0
  58. package/assets/esri/core/workers/chunks/fee942ef802a162e0248.js +1 -0
  59. package/assets/esri/themes/base/widgets/_Attribution.scss +8 -0
  60. package/assets/esri/themes/dark/main.css +1 -1
  61. package/assets/esri/themes/light/main.css +1 -1
  62. package/assets/esri/themes/light/view.css +1 -1
  63. package/chunks/BlendLayers.glsl.js +1 -1
  64. package/chunks/Envelope.js +1 -1
  65. package/chunks/GaussianSplat.glsl.js +2 -2
  66. package/chunks/Geometry.js +1 -1
  67. package/chunks/GlowComposition.glsl.js +5 -5
  68. package/chunks/MultiPathImpl.js +1 -1
  69. package/chunks/Point2D.js +1 -1
  70. package/chunks/UnitFactory.js +1 -1
  71. package/config.js +1 -1
  72. package/core/deprecate.js +1 -1
  73. package/core/keyboard.js +5 -0
  74. package/geometry/SpatialReference.js +1 -1
  75. package/geometry/operators/support/apiConverter.js +1 -1
  76. package/geometry/operators/support/jsonConverter.js +1 -1
  77. package/geometry/support/spatialReferenceUtils.js +1 -1
  78. package/interfaces.d.ts +552 -3
  79. package/kernel.js +1 -1
  80. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  81. package/layers/catalog/CatalogDynamicGroupLayer.js +1 -1
  82. package/layers/graphics/data/AttributesBuilder.js +1 -1
  83. package/layers/graphics/data/QueryEngineResult.js +1 -1
  84. package/layers/mixins/ArcGISImageService.js +1 -1
  85. package/package.json +1 -1
  86. package/portal/schemas/definitions.js +1 -1
  87. package/rest/query/operations/query.js +1 -1
  88. package/rest/support/LocateSetting.d.ts +4 -0
  89. package/rest/support/LocateSetting.js +5 -0
  90. package/rest/support/LocateSettingBase.d.ts +4 -0
  91. package/rest/support/LocateSettingBase.js +5 -0
  92. package/rest/support/LocateSettingSource.d.ts +4 -0
  93. package/rest/support/LocateSettingSource.js +5 -0
  94. package/rest/support/LocateSettings.d.ts +4 -0
  95. package/rest/support/LocateSettings.js +5 -0
  96. package/rest/support/LocateSettingsOverrides.d.ts +4 -0
  97. package/rest/support/LocateSettingsOverrides.js +5 -0
  98. package/rest/support/RouteParameters.js +1 -1
  99. package/statistics/utils.js +1 -1
  100. package/support/revision.js +1 -1
  101. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  102. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  103. package/views/3d/GroundView3D.js +1 -1
  104. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  105. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  106. package/views/3d/layers/I3SMeshView3D.js +1 -1
  107. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  108. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  109. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  110. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  111. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  112. package/views/3d/state/ConstraintsManager.js +1 -1
  113. package/views/3d/state/NearFarHeuristic.js +1 -1
  114. package/views/3d/support/Attribution3D.js +5 -0
  115. package/views/3d/support/CombinedElevationProvider.js +1 -1
  116. package/views/3d/support/ElevationRange.js +1 -1
  117. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  118. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +5 -0
  119. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +5 -0
  120. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  121. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  122. package/views/3d/terrain/ElevationBounds.js +1 -1
  123. package/views/3d/terrain/ElevationData.js +1 -1
  124. package/views/3d/terrain/TerrainSurface.js +1 -1
  125. package/views/3d/terrain/Tile.js +1 -1
  126. package/views/3d/terrain/TileBlendTechniqueConfiguration.js +1 -1
  127. package/views/3d/terrain/TileCompositor.js +1 -1
  128. package/views/3d/terrain/TileRenderer.js +1 -1
  129. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  130. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  131. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  132. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  133. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  134. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +12 -12
  135. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentDataConstants.js +5 -0
  136. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  137. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  138. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  139. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +10 -13
  140. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +7 -1
  141. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +6 -6
  142. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +4 -4
  143. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +1 -1
  144. package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
  145. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
  146. package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
  147. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  148. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  149. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  150. package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
  151. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  152. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
  153. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
  154. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  155. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  156. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  157. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  158. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  159. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  160. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  161. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  162. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  163. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  164. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  165. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  166. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  167. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  168. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  169. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  170. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  171. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +4 -4
  172. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +24 -31
  173. package/views/Attribution.js +5 -0
  174. package/views/DOMContainer.js +1 -1
  175. package/views/SceneView.js +1 -1
  176. package/views/View.js +1 -1
  177. package/views/draw/support/managers/DrawTooltipManager.js +5 -0
  178. package/views/interactive/tooltip/content/TooltipContentDynamic.js +5 -0
  179. package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
  180. package/views/interactive/tooltip/fields/TooltipField.js +1 -1
  181. package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +5 -0
  182. package/views/layers/LayerView.js +1 -1
  183. package/views/support/AttributionItem.d.ts +4 -0
  184. package/views/support/AttributionItem.js +5 -0
  185. package/views/support/GroundElevationSampler.js +1 -1
  186. package/views/support/LayerViewManager.js +1 -1
  187. package/views/support/attributionUtils.js +5 -0
  188. package/views/support/geodesicAreaMeasurementUtils.js +1 -1
  189. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  190. package/views/ui/2d/DefaultUI2D.js +1 -1
  191. package/views/ui/3d/DefaultUI3D.js +1 -1
  192. package/widgets/Attribution/AttributionViewModel.js +1 -1
  193. package/widgets/Attribution.js +1 -1
  194. package/widgets/ElevationProfile/ElevationProfileLine.js +1 -1
  195. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  196. package/widgets/ElevationProfile.js +1 -1
  197. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  198. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  199. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  200. package/widgets/Widget.js +1 -1
  201. package/widgets/support/decorators/accessibleHandler.js +1 -1
  202. package/widgets/support/jsxWidgetSupport.js +1 -1
  203. package/widgets/support/widget.js +1 -1
  204. package/widgets/support/widgetUtils.js +1 -1
  205. package/assets/esri/core/workers/chunks/0a1df5a724fe253b3866.js +0 -1
  206. package/assets/esri/core/workers/chunks/155d74b9c0ef31dc2316.js +0 -1
  207. package/assets/esri/core/workers/chunks/25143b919e75d5d2da05.js +0 -1
  208. package/assets/esri/core/workers/chunks/2c8c48433b380da59831.js +0 -1
  209. package/assets/esri/core/workers/chunks/2d17ed5321ca05acb8e3.js +0 -1
  210. package/assets/esri/core/workers/chunks/31b5747a254d13acc58e.js +0 -1
  211. package/assets/esri/core/workers/chunks/3ac84e324d212815e252.js +0 -1
  212. package/assets/esri/core/workers/chunks/41a00c77e6f7ce61e476.js +0 -1
  213. package/assets/esri/core/workers/chunks/447b53a9280b2b19b7a6.js +0 -1
  214. package/assets/esri/core/workers/chunks/45729d006db6a569715f.js +0 -1
  215. package/assets/esri/core/workers/chunks/50cf3cbcad2be1c1e210.js +0 -1
  216. package/assets/esri/core/workers/chunks/565358ea8d1bdc4d1ebc.js +0 -1
  217. package/assets/esri/core/workers/chunks/592afe1a41bed3b0cc31.js +0 -1
  218. package/assets/esri/core/workers/chunks/5aeda8a1f2ccabfdf40f.js +0 -1
  219. package/assets/esri/core/workers/chunks/657d9e5145da1306ace8.js +0 -1
  220. package/assets/esri/core/workers/chunks/6ce7ca6bebdc61d8eada.js +0 -1
  221. package/assets/esri/core/workers/chunks/7f7a81ed8893ab649af7.js +0 -1
  222. package/assets/esri/core/workers/chunks/7ffef8a19166f6b564d8.js +0 -1
  223. package/assets/esri/core/workers/chunks/819781a209608dcdd678.js +0 -1
  224. package/assets/esri/core/workers/chunks/8d57e3a0e5687ce15557.js +0 -1
  225. package/assets/esri/core/workers/chunks/8e9a5d38da40702def80.js +0 -1
  226. package/assets/esri/core/workers/chunks/8fbda0b85731ac77e1d8.js +0 -1
  227. package/assets/esri/core/workers/chunks/98c32d10a2344cd7a50b.js +0 -1
  228. package/assets/esri/core/workers/chunks/aac313257a8b1ae75b75.js +0 -1
  229. package/assets/esri/core/workers/chunks/be06c8a58c217a17451b.js +0 -1
  230. package/assets/esri/core/workers/chunks/d56548a994753b08403c.js +0 -1
  231. package/assets/esri/core/workers/chunks/d5b464ff83ce29b51968.js +0 -1
  232. package/assets/esri/core/workers/chunks/d777d7cb8df3f21ac97e.js +0 -1
  233. package/assets/esri/core/workers/chunks/dd95e679618b7b21a7b1.js +0 -1
  234. package/assets/esri/core/workers/chunks/e08a1934d98e7324776d.js +0 -1
  235. package/assets/esri/core/workers/chunks/e5deb72df8b2505fd325.js +0 -1
  236. package/assets/esri/core/workers/chunks/e689a4849f5af3f2f641.js +0 -1
  237. package/assets/esri/core/workers/chunks/f259ad785ce3aa970792.js +0 -1
  238. package/assets/esri/core/workers/chunks/f4919950a9a3703d9da3.js +0 -1
  239. package/assets/esri/core/workers/chunks/f6ce485c082d0d640b01.js +0 -1
  240. package/assets/esri/core/workers/chunks/fd9ef4b8c969962cf72b.js +0 -1
  241. package/layers/support/attributionUtils.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import{BlendModeTechniqueConfiguration as e}from"./BlendModeTechniqueConfiguration.js";import{parameter as t}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";class i extends e{constructor(){super(...arguments),this.output=1,this.baseOpacityMode=0,this.premultipliedSource=0}}o([t({count:5})],i.prototype,"output",void 0),o([t({count:2})],i.prototype,"baseOpacityMode",void 0),o([t({count:2})],i.prototype,"premultipliedSource",void 0);export{i as TileBlendTechniqueConfiguration};
5
+ import{__decorate as e}from"tslib";import{BlendModeTechniqueConfiguration as o}from"./BlendModeTechniqueConfiguration.js";import{parameter as t}from"../webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js";class p extends o{constructor(){super(...arguments),this.output=1,this.premultipliedAlphaSource=!1,this.applyBaseOpacity=!1}}e([t({count:5})],p.prototype,"output",void 0),e([t()],p.prototype,"premultipliedAlphaSource",void 0),e([t()],p.prototype,"applyBaseOpacity",void 0);export{p as TileBlendTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Logger.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{ZEROS as r}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{VectorTileRendererHelper3D as i}from"../../2d/engine/vectorTiles/VectorTileRendererHelper3D.js";import{BlendLayersTechnique as s}from"./BlendLayersTechnique.js";import{BlendLayersTechniqueConfiguration as o}from"./BlendLayersTechniqueConfiguration.js";import{RasterColorizerTechnique as n}from"./RasterColorizerTechnique.js";import{RasterColorizerTechniqueConfiguration as a}from"./RasterColorizerTechniqueConfiguration.js";import{MultiSizeFramebuffer as h}from"./support/MultiSizeFramebuffer.js";import{BindParameters as c}from"../webgl-engine/lib/BindParameters.js";import{createQuadVAO as l}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as u}from"../../webgl/enums.js";import{Texture as d}from"../../webgl/Texture.js";const _=()=>e.getLogger("esri.views.3d.terrain");class f{constructor(e,t){this._rctx=e,this._techniques=t,this._fbos=[],this._vectorTileHelper=new i,this._bindParameters=new c(null),this._blendConfiguration=new o,this._current=0,this._lastUsedIds=new Array,this._lastCreatedBufferId=0,this._onHoldIds=new Array,this._vao=l(this._rctx,1)}dispose(){this._fbos.forEach(t),this._fbos=null,this._vtFBO=t(this._vtFBO),this._vao=t(this._vao),this._vectorTileHelper=t(this._vectorTileHelper)}updateHeading(e){this._vectorTileHelper?.updateHeading(e)}_acquireBlendTechnique(e,t,r,i=0,o=0){return this._blendConfiguration.output=t,this._blendConfiguration.blendMode=e,this._blendConfiguration.baseOpacityMode=r,this._blendConfiguration.premultipliedSource=i,this._blendConfiguration.background=o,this._techniques.precompile(s,this._blendConfiguration),this._techniques.get(s,this._blendConfiguration)}drawBackground(e,t){const r=this._acquireBlendTechnique(0,t?2:3,0,0,1),i=this._rctx.bindTechnique(r,this._bindParameters,e);this._render(i)}_render(e){this._rctx.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),this._rctx.drawArrays(u.TRIANGLE_STRIP,0,this._vao.vertexCount("geometry"))}drawGroup(e,t,r,i,s=1){1===t&&(e.fboTexture=this._fbos[this.getLastOnHoldId()].get(r).colorTexture,null==e.fboTexture&&(e.fboTexture=this._rctx.emptyTexture)),e.texture=this.currentFBO(r).colorTexture,this.closeGroup(r);const o=e.baseOpacity<1?1:0,n=this._acquireBlendTechnique(i,t,o,s),a=this._rctx.bindTechnique(n,this._bindParameters,e);this._render(a)}drawImageData(e,t,r,i,s=0){if(null==e.texture)return;const o=e.baseOpacity<1?1:0;e.fboTexture=4===t||0===i&&0===o&&0===s?null:this.switch(r).colorTexture,null==e.fboTexture&&(e.fboTexture=this._rctx.emptyTexture);const n=this._acquireBlendTechnique(i,t,o,s),a=this._rctx.bindTechnique(n,this._bindParameters,e);this._render(a)}drawRasterData(e,t,r,i,s){const o=s.sourceLayerInfo.data;if(!o.source)return;if(s.tile.surface.layerViewByIndex(s.layerIndex,1).ensureSymbolizerParameters(o),!o.bind(this._rctx))return;const n=e.baseOpacity<1?1:0;e.fboTexture=0===i&&0===n?null:this.switch(r).colorTexture;const a=this._acquireRasterTechnique(o,t,i,n);if(!a)return;o.opacity=e.opacity;const h=o.getUniforms(this._rctx);h.scale=s.scale,h.offset=s.offset,h.backgroundColor=e.backgroundColor,h.fboTexture=e.fboTexture,h.baseOpacity=e.baseOpacity;const c=this._rctx.bindTechnique(a,this._bindParameters,h);this._render(c)}_acquireRasterTechnique(e,t,r,i){if(!this._rctx.capabilities.colorBufferFloat)return null;const s=e.symbolizerParameters,o=["stretch","lut","hillshade"].indexOf(s.type);return this._rasterConfiguration??=new a,this._rasterConfiguration.output=t,this._rasterConfiguration.blendMode=r,this._rasterConfiguration.baseOpacityMode=i,this._rasterConfiguration.colorizerType=o,this._rasterConfiguration.applyColormap=!!s.colormap,this._rasterConfiguration.requireBilinearWithNN=e.isBilinearWithStretchColorRamp,this._rasterConfiguration.stretchType=e.hasStretchTypeNone()?0:1,this._techniques.precompile(n,this._rasterConfiguration),this._techniques.get(n,this._rasterConfiguration)}drawVectorData(e,t,i,s,o,n,a,c){const l=this._rctx,u=o.sourceLayerInfo.data,d=o.tile.surface.layerViewByIndex(o.layerIndex,1),f=e.baseOpacity<1?1:0,p=1===f||e.opacity<1||0!==s||1!==t,b=p?1:0,g=this._acquireBlendTechnique(s,t,f,b);l.setPipelineState(g.getPipeline());let m=null,x=null;p?(x=this.currentFBO(i),null==this._vtFBO&&(this._vtFBO=new h(this._rctx)),m=this._vtFBO.get(i),l.bindFramebuffer(m),this._clearCurrentFBO()):c&&l.clear(256);try{this._vectorTileHelper.renderBackground(l,o.sourceLod,d.painter,d.layer.styleRepository,d.schemaHelper,Math.round(1/o.scale),o.offset,a,n,d.contentZoom),u&&this._vectorTileHelper.renderContent(l,o.sourceLod,u,o.vtlNeighborInfos,d.painter,d.layer.styleRepository,d.schemaHelper,Math.round(1/o.scale),o.offset,a,n,d.contentZoom)}catch(T){_().warnOnce("A render call containing vector tiles did not resolve correctly.",T)}return!m||(l.bindFramebuffer(x),e.texture=m.colorTexture,e.offset=r,e.scale=1,this.drawImageData(e,t,i,s,b),c)}copyFBOToTexture(e){const t=this._rctx,r=t.bindTexture(e.texture,d.TEXTURE_UNIT_FOR_UPDATES),i=e.descriptor;t.gl.copyTexImage2D(3553,0,i.pixelFormat,0,0,i.width,i.height,0),e.generateMipmap(),t.bindTexture(r,d.TEXTURE_UNIT_FOR_UPDATES)}_clearCurrentFBO(){this._rctx.setStencilWriteMask(255),this._rctx.setClearColor(0,0,0,0),this._rctx.setClearDepth(1),this._rctx.setClearStencil(0),this._rctx.clear(17664)}_initFBO(e,t,r){this._rctx.bindFramebuffer(e),r&&(this._rctx.setViewport(0,0,t,t),this._clearCurrentFBO())}ensureBuffer(e){this._lastUsedIds.length=0,this._lastUsedIds.push(1),this._lastCreatedBufferId=1,this._onHoldIds.length=0,this.bind(e)}bind(e,t=0,r=!0){if(this._current=t,t>=this._fbos.length)for(let i=this._fbos.length;i<=t;i++)this._fbos.push(new h(this._rctx));this._initFBO(this._fbos[t].get(e),e,r)}_bindNextFreeBuffer(e){this._lastUsedIds.length>0?this.bind(e,this._lastUsedIds.pop()):(this._lastCreatedBufferId++,this.bind(e,this._lastCreatedBufferId))}openGroup(e){this._onHoldIds.push(this._current),this._bindNextFreeBuffer(e)}switch(e){const t=this.currentFBO(e),r=this._current;return this._bindNextFreeBuffer(e),this._lastUsedIds.push(r),t}getLastOnHoldId(){return this._onHoldIds[this._onHoldIds.length-1]}closeGroup(e){const t=this._current;this._bindNextFreeBuffer(e),this._lastUsedIds.push(t),this._lastUsedIds.push(this._onHoldIds.pop())}unbind(){this._rctx.bindFramebuffer(null)}currentFBO(e){return this._fbos[this._current].get(e)}}export{f as TileCompositor};
5
+ import e from"../../../core/Logger.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{ZEROS as r}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{VectorTileRendererHelper3D as i}from"../../2d/engine/vectorTiles/VectorTileRendererHelper3D.js";import{BlendLayersTechnique as s}from"./BlendLayersTechnique.js";import{BlendLayersTechniqueConfiguration as o}from"./BlendLayersTechniqueConfiguration.js";import{RasterColorizerTechnique as n}from"./RasterColorizerTechnique.js";import{RasterColorizerTechniqueConfiguration as a}from"./RasterColorizerTechniqueConfiguration.js";import{MultiSizeFramebuffer as h}from"./support/MultiSizeFramebuffer.js";import{BindParameters as l}from"../webgl-engine/lib/BindParameters.js";import{createQuadVAO as c}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as u}from"../../webgl/enums.js";import{Texture as d}from"../../webgl/Texture.js";const _=()=>e.getLogger("esri.views.3d.terrain");class f{constructor(e,t){this._rctx=e,this._techniques=t,this._fbos=[],this._vectorTileHelper=new i,this._bindParameters=new l(null),this._blendConfiguration=new o,this._current=0,this._lastUsedIds=new Array,this._lastCreatedBufferId=0,this._onHoldIds=new Array,this._vao=c(this._rctx,1)}dispose(){this._fbos.forEach(t),this._fbos=null,this._vtFBO=t(this._vtFBO),this._vao=t(this._vao),this._vectorTileHelper=t(this._vectorTileHelper)}updateHeading(e){this._vectorTileHelper?.updateHeading(e)}_acquireBlendTechnique(e,t,r,i=!1,o=0){return this._blendConfiguration.output=t,this._blendConfiguration.blendMode=e,this._blendConfiguration.applyBaseOpacity=r,this._blendConfiguration.premultipliedAlphaSource=i,this._blendConfiguration.background=o,this._techniques.precompile(s,this._blendConfiguration),this._techniques.get(s,this._blendConfiguration)}drawBackground(e,t){const r=this._acquireBlendTechnique(0,t?2:3,!1,!1,1),i=this._rctx.bindTechnique(r,this._bindParameters,e);this._render(i)}_render(e){this._rctx.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),this._rctx.drawArrays(u.TRIANGLE_STRIP,0,this._vao.vertexCount("geometry"))}drawGroup(e,t,r,i,s=!0){1===t&&(e.fboTexture=this._fbos[this.getLastOnHoldId()].get(r).colorTexture,null==e.fboTexture&&(e.fboTexture=this._rctx.emptyTexture)),e.texture=this.currentFBO(r).colorTexture,this.closeGroup(r);const o=e.baseOpacity<1,n=this._acquireBlendTechnique(i,t,o,s),a=this._rctx.bindTechnique(n,this._bindParameters,e);this._render(a)}drawImageData(e,t,r,i,s=!1){if(null==e.texture)return;const o=e.baseOpacity<1;e.fboTexture=4===t||0===i&&!o&&!s?null:this.switch(r).colorTexture,null==e.fboTexture&&(e.fboTexture=this._rctx.emptyTexture);const n=this._acquireBlendTechnique(i,t,o,s),a=this._rctx.bindTechnique(n,this._bindParameters,e);this._render(a)}drawRasterData(e,t,r,i,s){const o=s.sourceLayerInfo.data;if(!o.source)return;if(s.tile.surface.layerViewByIndex(s.layerIndex,1).ensureSymbolizerParameters(o),!o.bind(this._rctx))return;const n=e.baseOpacity<1;e.fboTexture=0!==i||n?this.switch(r).colorTexture:null;const a=this._acquireRasterTechnique(o,t,i,n);if(!a)return;o.opacity=e.opacity;const h=o.getUniforms(this._rctx);h.scale=s.scale,h.offset=s.offset,h.backgroundColor=e.backgroundColor,h.fboTexture=e.fboTexture,h.baseOpacity=e.baseOpacity;const l=this._rctx.bindTechnique(a,this._bindParameters,h);this._render(l)}_acquireRasterTechnique(e,t,r,i){if(!this._rctx.capabilities.colorBufferFloat)return null;const s=e.symbolizerParameters,o=["stretch","lut","hillshade"].indexOf(s.type);return this._rasterConfiguration??=new a,this._rasterConfiguration.output=t,this._rasterConfiguration.blendMode=r,this._rasterConfiguration.applyBaseOpacity=i,this._rasterConfiguration.colorizerType=o,this._rasterConfiguration.applyColormap=!!s.colormap,this._rasterConfiguration.requireBilinearWithNN=e.isBilinearWithStretchColorRamp,this._rasterConfiguration.stretchType=e.hasStretchTypeNone()?0:1,this._techniques.precompile(n,this._rasterConfiguration),this._techniques.get(n,this._rasterConfiguration)}drawVectorData(e,t,i,s,o,n,a,l){const c=this._rctx,u=o.sourceLayerInfo.data,d=o.tile.surface.layerViewByIndex(o.layerIndex,1),f=e.baseOpacity<1,p=f||e.opacity<1||0!==s||1!==t,b=p,g=this._acquireBlendTechnique(s,t,f,b);c.setPipelineState(g.getPipeline());let m=null,x=null;p?(x=this.currentFBO(i),null==this._vtFBO&&(this._vtFBO=new h(this._rctx)),m=this._vtFBO.get(i),c.bindFramebuffer(m),this._clearCurrentFBO()):l&&c.clear(256);try{this._vectorTileHelper.renderBackground(c,o.sourceLod,d.painter,d.layer.styleRepository,d.schemaHelper,Math.round(1/o.scale),o.offset,a,n,d.contentZoom),u&&this._vectorTileHelper.renderContent(c,o.sourceLod,u,o.vtlNeighborInfos,d.painter,d.layer.styleRepository,d.schemaHelper,Math.round(1/o.scale),o.offset,a,n,d.contentZoom)}catch(T){_().warnOnce("A render call containing vector tiles did not resolve correctly.",T)}return!m||(c.bindFramebuffer(x),e.texture=m.colorTexture,e.offset=r,e.scale=1,this.drawImageData(e,t,i,s,b),l)}copyFBOToTexture(e){const t=this._rctx,r=t.bindTexture(e.texture,d.TEXTURE_UNIT_FOR_UPDATES),i=e.descriptor;t.gl.copyTexImage2D(3553,0,i.pixelFormat,0,0,i.width,i.height,0),e.generateMipmap(),t.bindTexture(r,d.TEXTURE_UNIT_FOR_UPDATES)}_clearCurrentFBO(){this._rctx.setStencilWriteMask(255),this._rctx.setClearColor(0,0,0,0),this._rctx.setClearDepth(1),this._rctx.setClearStencil(0),this._rctx.clear(17664)}_initFBO(e,t,r){this._rctx.bindFramebuffer(e),r&&(this._rctx.setViewport(0,0,t,t),this._clearCurrentFBO())}ensureBuffer(e){this._lastUsedIds.length=0,this._lastUsedIds.push(1),this._lastCreatedBufferId=1,this._onHoldIds.length=0,this.bind(e)}bind(e,t=0,r=!0){if(this._current=t,t>=this._fbos.length)for(let i=this._fbos.length;i<=t;i++)this._fbos.push(new h(this._rctx));this._initFBO(this._fbos[t].get(e),e,r)}_bindNextFreeBuffer(e){this._lastUsedIds.length>0?this.bind(e,this._lastUsedIds.pop()):(this._lastCreatedBufferId++,this.bind(e,this._lastCreatedBufferId))}openGroup(e){this._onHoldIds.push(this._current),this._bindNextFreeBuffer(e)}switch(e){const t=this.currentFBO(e),r=this._current;return this._bindNextFreeBuffer(e),this._lastUsedIds.push(r),t}getLastOnHoldId(){return this._onHoldIds[this._onHoldIds.length-1]}closeGroup(e){const t=this._current;this._bindNextFreeBuffer(e),this._lastUsedIds.push(t),this._lastUsedIds.push(this._onHoldIds.pop())}unbind(){this._rctx.bindFramebuffer(null)}currentFBO(e){return this._fbos[this._current].get(e)}}export{f as TileCompositor};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../core/has.js";import{disposeMaybe as e,releaseMaybe as t}from"../../../core/maybe.js";import{set as r,copy as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as o}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isBaseLayer as a,isGroupLayer as n,isReferenceLayer as c}from"../../../layers/support/layerUtils.js";import{isLayerViewWithFlowRenderer as u}from"../support/flowUtils.js";import{BlendLayersPassParameters as l}from"./BlendLayersTechnique.js";import{isImageWithType as p}from"./TerrainData.js";import{isBlendableLayerView as h,isVectorTileLayerView as d,isVectorTileRenderInfo as m,isImageryTileRenderInfo as f,isImageSourceRenderInfo as _,isTextureTileRenderInfo as x,isVectorTilePerLayerInfo as T}from"./terrainUtils.js";import{TextureReference as b}from"./TextureReference.js";import{TileCompositor as y}from"./TileCompositor.js";import{TileRenderInfo as g}from"./TileRenderInfo.js";import{TileTexture as w,getCacheKey as k}from"./TileTexture.js";import{fallsWithinLayerView as I}from"./tileUtils.js";import{blendModeFromString as j}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{createEmptyTexture as O}from"../webgl-engine/lib/glUtil3D.js";import{isCompressible as P}from"../../support/TextureCompressionWorkerHandle.js";import{Texture as L}from"../../webgl/Texture.js";import{TextureDescriptor as B}from"../../webgl/TextureDescriptor.js";class C{constructor(e,t,r,s,o,i){this.start=e,this.end=t,this.blendMode=r,this.opacity=s,this.output=o,this.baseOpacity=i}}class M{constructor(e,t,r,s,o){this._rctx=e,this.tileSize=t,this._techniques=r,this._cache=s,this._compressionTracker=o,this._passParameters=new l,this._backgroundColor=null,this._maxAnisotropy=this._rctx.parameters.maxMaxAnisotropy,this._compositor=new y(this._rctx,this._techniques)}dispose(){this._compositor=e(this._compositor),this._backgroundTexture=t(this._backgroundTexture)}get backgroundIsGrid(){return null==this._backgroundColor}get backgroundColor(){return this._backgroundColor}updateHeading(e){this._compositor?.updateHeading(e)}updateTileTexture(e,t){if(!e.renderData)return;const r=e.surface,s=r.baseOpacity;let o=0,i=0,l=this.tileSize,p=!1,m=!1;const f=r.view.state.contentPixelRatio;let _=!1;A.clear(),S.length=0;const x=e.layerInfo[1];let T=0,b=null;for(;T<x.length;T++){const t=r.layerViewByIndex(T,1),y=t.layer,g=!I(e,t),w=y.opacity,k=t.fullOpacity;if(m=m||a(y),u(t))continue;if(h(t)){let e="normal"!==t.layer.blendMode;if(n(y.parent)){const t=y.parent.uid;null!=t&&""!==t&&(e=U(y.parent)||e)}e&&(_=e,p=!1)}if((g||0===w)&&!_){x[T].pendingUpdates&=-1;continue}++i;const j=d(t),O=D(e,T,j);if(O){if(x[T].pendingUpdates&=-1,n(y.parent)){const e=y.parent.uid;null!=e&&""!==e&&v(y.parent,T)}j?l=Math.max(l,this.tileSize*f):1===s&&1===k&&(t.isOpaque||this._dataToTexture(O,c(y))&&O.sourceLayerInfo.data.descriptor.isOpaque)&&(p=!0),++o,null===b&&(b=T)}}const y=l/this.tileSize;0!==o&&null!==b?1===o&&!_&&this._useLayerTexture(e,b)||this._composeLayers(e,t,T-1,m,l,y,!p||_,A,_):this._useBackgroundTexture(e,i,0!==t)}setBackground(e){this._backgroundColor!==e&&(this._backgroundColor=e,this._backgroundTexture&&this._drawBackgroundTexture(this._backgroundTexture))}_ensureBackgroundTexture(){return null==this._backgroundTexture&&(this._backgroundTexture=this._buildTexture(this.tileSize,!1),this._drawBackgroundTexture(this._backgroundTexture)),this._backgroundTexture}_drawBackgroundTexture(e){this._compositor.bind(this.tileSize),this._passParameters.offset=o,this._passParameters.scale=1,this._passParameters.opacity=1,this.backgroundColor&&(this._passParameters.backgroundColor=this.backgroundColor),this._compositor.drawBackground(this._passParameters,null!=this.backgroundColor),this._compositor.copyFBOToTexture(e),this._compositor.unbind()}_useBackgroundTexture(e,t,r){const s=e.renderData,o=!r&&null!=s.textureReference&&(e.surface.view.layerViewManager.updating||t>0)?5e3:0,i=this._ensureBackgroundTexture();s.setTextureReference(new b(i,0,E,e.surface.baseOpacity,0,1),o)}_useLayerTexture(e,t){const r=e.surface.layerViewByIndex(t,1),s=a(r.layer),o=s?e.surface.baseOpacity:1,n=s?1:e.surface.baseOpacity,u=r.fullOpacity,l=D(e,t,!1);return!!this._dataToTexture(l,c(r.layer))&&(e.renderData.setTextureReference(new b(l.sourceLayerInfo.data,0,i(l.offset[0],l.offset[1],l.scale,l.scale),o,n,u)),!0)}_composeLayers(e,t,r,s,i,n,l,p,_){this._compositor.ensureBuffer(i);const x=e.surface.baseOpacity;let T=!1,y=9987,g=!1,w=0;for(let b=r;b>=0;b--){const t=e.surface.layerViewByIndex(b,1),r=t.layer,k=d(t),O=D(e,b,k),P=r.opacity,L=!I(e,t);if(!O||(0===P||L)&&!_)continue;if(u(t))continue;const B=!a(r)&&!T;B&&(T=!0);let C=!1;p.forEach(e=>{e.start===b&&(e.output=s?1:l&&B?this.backgroundIsGrid?3:2:1,e.baseOpacity=B?x:1,S.push(e),this._compositor.openGroup(i),C=!0)});const M=C?4:l&&0===w?this.backgroundIsGrid?3:2:1,U=j[h(t)?t.layer.blendMode:"normal"];for(this._passParameters.baseOpacity=B&&!C&&x<1?x:1,this._passParameters.opacity=P,m(O)?g=this._compositor.drawVectorData(this._passParameters,M,i,U,O,n,this.tileSize,g):f(O)?(this._compositor.drawRasterData(this._passParameters,M,i,U,O),R(O)&&(y=9728)):this._dataToTexture(O,c(r))&&(this._passParameters.texture=O.sourceLayerInfo.data.texture,this._passParameters.offset=O.offset,this._passParameters.scale=O.scale,this._compositor.drawImageData(this._passParameters,M,i,U));S.length>0&&S[S.length-1].end===b;){const e=S.pop();this._passParameters.baseOpacity=e.baseOpacity,this._passParameters.opacity=e.opacity,this._passParameters.offset=o,this._passParameters.scale=1,this._compositor.drawGroup(this._passParameters,e.output,i,j[e.blendMode])}w++}const k=e.renderData,O=_||T&&x<1,P=k.ensureTexture(i,O,t,()=>this._buildTexture(i,O,y));this._compositor.copyFBOToTexture(P),this._compositor.unbind(),k.setTextureReference(new b(P,t,E,T?1:x,0,1))}_dataToTexture(e,t){if(_(e)){const r=e.sourceLayerInfo,s=1===e.scale&&!t;r.data=this._buildTexture(r.data,!0,s,e.tile.onCompressionFinished),e.tile.setMemoryDirty()}return x(e)}_buildTexture(e,t,r=9987,s=()=>{}){if(null==e)return null;const o=new B;o.wrapMode=33071,o.samplingMode="boolean"==typeof r?9987:r,o.maxAnisotropy=this._maxAnisotropy,o.preMultiplyAlpha=!0,o.flipped=!0,o.hasMipmap=!0,t||(o.pixelFormat=6407);const i=this._rctx,a="boolean"==typeof r&&r;let n;if("number"==typeof e)o.width=o.height=e,n=this._buildTileTexture(o);else if(p(e))o.isOpaque=e.isOpaque,o.isOpaque&&(o.pixelFormat=6407),o.width=e.element.width,o.height=e.element.height,n=this._buildTileTexture(o,a,s,e.element);else try{o.width=e.width,o.height=e.height,n=this._buildTileTexture(o,a,s,e)}catch(u){n=new w(O(i)),console.warn("TileRenderer: failed to execute 'texImage2D', cross-origin image may not be loaded.")}const c=i.bindTexture(n.texture,L.TEXTURE_UNIT_FOR_UPDATES);return n.generateMipmap(),i.bindTexture(c,L.TEXTURE_UNIT_FOR_UPDATES),n}_buildTileTexture(e,t=!1,r=()=>{},s){const o=this._cache.pop(k(e,!1))??this._cache.pop(k(e,!0));if(t&&=P(s,e),o)return o.retain(),t?o.texture.enableCompression({compressionTracker:this._compressionTracker,compressionCallback:r}):o.texture.disableCompression(),o.texture.setData(s),o;e.compress=t?{compressionTracker:this._compressionTracker,compressionCallback:r}:void 0;const i=new L(this._rctx,e,s);return new w(i,this._cache)}get test(){}}function D(e,t,o){q.layerIndex=t,q.vtlNeighborInfos.clear();const i=e.layerInfo[1][t];if(r(q.offset,0,0),q.tile=e,q.scale=1,q.sourceLod=e.lij,q.sourceLayerInfo=i,q.isVTLBackground=o,i.data)return o&&e.forEachLoadedNeighbor((r,s)=>{if(r.level!==e.level)return;const o=r.layerInfo[1][t];if(!T(o)||i.data===o.data)return;const a=q.vtlNeighborInfos.pushNew();a.offset=z[s],a.sourceLod=r.lij,a.sourceLayerInfo=o}),q;const a=i.upsampleInfo,n=a?.tile?.layerInfo[1][t];return n&&a.tile?(q.tile=a.tile,s(q.offset,a.offset),q.scale=a.scale,q.sourceLod=a.tile.lij,q.sourceLayerInfo=n,q):o?q:null}function R(e){const t=e.sourceLayerInfo.data;return!!t.source&&"nearest"===t.interpolation}function U(e){let t="normal"!==e.blendMode;return n(e.parent)&&(t=U(e.parent)||t),t}function v(e,t){n(e.parent)&&v(e.parent,t);const r=e.uid;if(null!=r&&""!==r){const s=A.get(r);s?s.start=t:A.set(r,new C(t,t,e.blendMode,e.opacity,1,1))}}const A=new Map,S=new Array,q=new g,E=i(0,0,1,1),z=new Array;function F(){q.sourceLayerInfo=null,q.tile=null,q.vtlNeighborInfos.prune()}z[0]=[0,-1],z[1]=[-1,-1],z[2]=[-1,0],z[3]=[-1,1],z[4]=[0,1],z[5]=[1,1],z[6]=[1,0],z[7]=[1,-1];export{C as GroupInfo,M as TileRenderer,F as cleanupTileRenderer};
5
+ import"../../../core/has.js";import{disposeMaybe as e,releaseMaybe as t}from"../../../core/maybe.js";import{set as r,copy as s}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{ZEROS as o}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isBaseLayer as a,isGroupLayer as n,isReferenceLayer as c}from"../../../layers/support/layerUtils.js";import{isLayerViewWithFlowRenderer as u}from"../support/flowUtils.js";import{BlendLayersPassParameters as l}from"./BlendLayersTechnique.js";import{isImageWithType as p}from"./TerrainData.js";import{isBlendableLayerView as h,isVectorTileLayerView as d,isVectorTileRenderInfo as m,isImageryTileRenderInfo as f,isImageSourceRenderInfo as _,isTextureTileRenderInfo as x,isVectorTilePerLayerInfo as T}from"./terrainUtils.js";import{TextureReference as b}from"./TextureReference.js";import{TileCompositor as y}from"./TileCompositor.js";import{TileRenderInfo as g}from"./TileRenderInfo.js";import{TileTexture as w,getCacheKey as k}from"./TileTexture.js";import{fallsWithinLayerView as I}from"./tileUtils.js";import{blendModeFromString as j}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{createEmptyTexture as O}from"../webgl-engine/lib/glUtil3D.js";import{isCompressible as P}from"../../support/TextureCompressionWorkerHandle.js";import{Texture as L}from"../../webgl/Texture.js";import{TextureDescriptor as B}from"../../webgl/TextureDescriptor.js";class C{constructor(e,t,r,s,o,i){this.start=e,this.end=t,this.blendMode=r,this.opacity=s,this.output=o,this.baseOpacity=i}}class M{constructor(e,t,r,s,o){this._rctx=e,this.tileSize=t,this._techniques=r,this._cache=s,this._compressionTracker=o,this._passParameters=new l,this._backgroundColor=null,this._maxAnisotropy=this._rctx.parameters.maxMaxAnisotropy,this._compositor=new y(this._rctx,this._techniques)}dispose(){this._compositor=e(this._compositor),this._backgroundTexture=t(this._backgroundTexture)}get backgroundIsGrid(){return null==this._backgroundColor}get backgroundColor(){return this._backgroundColor}updateHeading(e){this._compositor?.updateHeading(e)}updateTileTexture(e,t){if(!e.renderData)return;const r=e.surface,s=r.baseOpacity;let o=0,i=0,l=this.tileSize,p=!1,m=!1;const f=r.view.state.contentPixelRatio;let _=!1;A.clear(),S.length=0;const x=e.layerInfo[1];let T=0,b=null;for(;T<x.length;T++){const t=r.layerViewByIndex(T,1),y=t.layer,g=!I(e,t),w=y.opacity,k=t.fullOpacity;if(m=m||a(y),u(t))continue;if(h(t)){let e="normal"!==t.layer.blendMode;if(n(y.parent)){const t=y.parent.uid;null!=t&&""!==t&&(e=U(y.parent)||e)}e&&(_=e,p=!1)}if((g||0===w)&&!_){x[T].pendingUpdates&=-1;continue}++i;const j=d(t),O=D(e,T,j);if(O){if(x[T].pendingUpdates&=-1,n(y.parent)){const e=y.parent.uid;null!=e&&""!==e&&v(y.parent,T)}j?l=Math.max(l,this.tileSize*f):1===s&&1===k&&(t.isOpaque||this._dataToTexture(O,c(y))&&O.sourceLayerInfo.data.descriptor.isOpaque)&&(p=!0),++o,null===b&&(b=T)}}const y=l/this.tileSize;0!==o&&null!==b?1===o&&!_&&this._useLayerTexture(e,b)||this._composeLayers(e,t,T-1,m,l,y,!p||_,A,_):this._useBackgroundTexture(e,i,0!==t)}setBackground(e){this._backgroundColor!==e&&(this._backgroundColor=e,this._backgroundTexture&&this._drawBackgroundTexture(this._backgroundTexture))}_ensureBackgroundTexture(){return null==this._backgroundTexture&&(this._backgroundTexture=this._buildTexture(this.tileSize,!1),this._drawBackgroundTexture(this._backgroundTexture)),this._backgroundTexture}_drawBackgroundTexture(e){this._compositor.bind(this.tileSize),this._passParameters.offset=o,this._passParameters.scale=1,this._passParameters.opacity=1,this.backgroundColor&&(this._passParameters.backgroundColor=this.backgroundColor),this._compositor.drawBackground(this._passParameters,null!=this.backgroundColor),this._compositor.copyFBOToTexture(e),this._compositor.unbind()}_useBackgroundTexture(e,t,r){const s=e.renderData,o=!r&&null!=s.textureReference&&(e.surface.view.layerViewManager.updating||t>0)?5e3:0,i=this._ensureBackgroundTexture();s.setTextureReference(new b(i,0,E,e.surface.baseOpacity,0,1),o)}_useLayerTexture(e,t){const r=e.surface.layerViewByIndex(t,1),s=a(r.layer),o=s?e.surface.baseOpacity:1,n=s?1:e.surface.baseOpacity,u=r.fullOpacity,l=D(e,t,!1);return!!this._dataToTexture(l,c(r.layer))&&(e.renderData.setTextureReference(new b(l.sourceLayerInfo.data,0,i(l.offset[0],l.offset[1],l.scale,l.scale),o,n,u)),!0)}_composeLayers(e,t,r,s,i,n,l,p,_){this._compositor.ensureBuffer(i);const x=e.surface.baseOpacity;let T=!1,y=9987,g=!1,w=0;for(let b=r;b>=0;b--){const t=e.surface.layerViewByIndex(b,1),r=t.layer,k=d(t),O=D(e,b,k),P=r.opacity,L=!I(e,t);if(!O||(0===P||L)&&!_)continue;if(u(t))continue;const B=!a(r)&&!T;T||=B;let C=!1;p.forEach(e=>{e.start===b&&(e.output=s?1:l&&B?this.backgroundIsGrid?3:2:1,e.baseOpacity=B?x:1,S.push(e),this._compositor.openGroup(i),C=!0)});const M=C?4:l&&0===w?this.backgroundIsGrid?3:2:1,U=j[h(t)?t.layer.blendMode:"normal"];for(this._passParameters.baseOpacity=B&&!C&&x<1?x:1,this._passParameters.opacity=P,m(O)?g=this._compositor.drawVectorData(this._passParameters,M,i,U,O,n,this.tileSize,g):f(O)?(this._compositor.drawRasterData(this._passParameters,M,i,U,O),R(O)&&(y=9728)):this._dataToTexture(O,c(r))&&(this._passParameters.texture=O.sourceLayerInfo.data.texture,this._passParameters.offset=O.offset,this._passParameters.scale=O.scale,this._compositor.drawImageData(this._passParameters,M,i,U));S.length>0&&S[S.length-1].end===b;){const e=S.pop();this._passParameters.baseOpacity=e.baseOpacity,this._passParameters.opacity=e.opacity,this._passParameters.offset=o,this._passParameters.scale=1,this._compositor.drawGroup(this._passParameters,e.output,i,j[e.blendMode])}w++}const k=e.renderData,O=_||T&&x<1,P=k.ensureTexture(i,O,t,()=>this._buildTexture(i,O,y));this._compositor.copyFBOToTexture(P),this._compositor.unbind(),k.setTextureReference(new b(P,t,E,T?1:x,0,1))}_dataToTexture(e,t){if(_(e)){const r=e.sourceLayerInfo,s=1===e.scale&&!t;r.data=this._buildTexture(r.data,!0,s,e.tile.onCompressionFinished),e.tile.setMemoryDirty()}return x(e)}_buildTexture(e,t,r=9987,s=()=>{}){if(null==e)return null;const o=new B;o.wrapMode=33071,o.samplingMode="boolean"==typeof r?9987:r,o.maxAnisotropy=this._maxAnisotropy,o.preMultiplyAlpha=!0,o.flipped=!0,o.hasMipmap=!0,t||(o.pixelFormat=6407);const i=this._rctx,a="boolean"==typeof r&&r;let n;if("number"==typeof e)o.width=o.height=e,n=this._buildTileTexture(o);else if(p(e))o.isOpaque=e.isOpaque,o.isOpaque&&(o.pixelFormat=6407),o.width=e.element.width,o.height=e.element.height,n=this._buildTileTexture(o,a,s,e.element);else try{o.width=e.width,o.height=e.height,n=this._buildTileTexture(o,a,s,e)}catch(u){n=new w(O(i)),console.warn("TileRenderer: failed to execute 'texImage2D', cross-origin image may not be loaded.")}const c=i.bindTexture(n.texture,L.TEXTURE_UNIT_FOR_UPDATES);return n.generateMipmap(),i.bindTexture(c,L.TEXTURE_UNIT_FOR_UPDATES),n}_buildTileTexture(e,t=!1,r=()=>{},s){const o=this._cache.pop(k(e,!1))??this._cache.pop(k(e,!0));if(t&&=P(s,e),o)return o.retain(),t?o.texture.enableCompression({compressionTracker:this._compressionTracker,compressionCallback:r}):o.texture.disableCompression(),o.texture.setData(s),o;e.compress=t?{compressionTracker:this._compressionTracker,compressionCallback:r}:void 0;const i=new L(this._rctx,e,s);return new w(i,this._cache)}get test(){}}function D(e,t,o){q.layerIndex=t,q.vtlNeighborInfos.clear();const i=e.layerInfo[1][t];if(r(q.offset,0,0),q.tile=e,q.scale=1,q.sourceLod=e.lij,q.sourceLayerInfo=i,q.isVTLBackground=o,i.data)return o&&e.forEachLoadedNeighbor((r,s)=>{if(r.level!==e.level)return;const o=r.layerInfo[1][t];if(!T(o)||i.data===o.data)return;const a=q.vtlNeighborInfos.pushNew();a.offset=z[s],a.sourceLod=r.lij,a.sourceLayerInfo=o}),q;const a=i.upsampleInfo,n=a?.tile?.layerInfo[1][t];return n&&a.tile?(q.tile=a.tile,s(q.offset,a.offset),q.scale=a.scale,q.sourceLod=a.tile.lij,q.sourceLayerInfo=n,q):o?q:null}function R(e){const t=e.sourceLayerInfo.data;return!!t.source&&"nearest"===t.interpolation}function U(e){let t="normal"!==e.blendMode;return n(e.parent)&&(t=U(e.parent)||t),t}function v(e,t){n(e.parent)&&v(e.parent,t);const r=e.uid;if(null!=r&&""!==r){const s=A.get(r);s?s.start=t:A.set(r,new C(t,t,e.blendMode,e.opacity,1,1))}}const A=new Map,S=new Array,q=new g,E=i(0,0,1,1),z=new Array;function F(){q.sourceLayerInfo=null,q.tile=null,q.vtlNeighborInfos.prune()}z[0]=[0,-1],z[1]=[-1,-1],z[2]=[-1,0],z[3]=[-1,1],z[4]=[0,1],z[5]=[1,1],z[6]=[1,0],z[7]=[1,-1];export{C as GroupInfo,M as TileRenderer,F as cleanupTileRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{destroyMaybe as e}from"../../../../../core/maybe.js";import{s as t,h as o,t as r,i as a}from"../../../../../chunks/vec32.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as s}from"../../../../../geometry/support/aaBoundingBox.js";import{encodeSymbolColor as n}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as l}from"../../../support/orientedBoundingBox.js";import{UniformComponentParameters as m}from"./UniformComponentParameters.js";import{ComponentParametersVarying as c,ComponentParametersUniform as h}from"./Material/ComponentMaterial.js";import{olidEnabled as d}from"../../effects/geometry/olidUtils.js";class u{constructor(e,t,o,r,a){this.transform=e,this.obb=t,this._componentData=o,this._renderable=r,this._intersectionGeometry=a,this.visible=!1,this.offsetObb=null,this._aabbInWorldCoordinates=null}get componentData(){return this._componentData}get renderable(){return this._renderable}get intersectionGeometry(){return this._intersectionGeometry}updateMaterial(e){e(this._renderable.material)}updateCameraDerivedParameters(e){const{eye:o}=e;this._renderable.meta.cameraDepthSquared=t(o,this.obb.center)}setComponentData(e,t){const o=this._componentData,{materialDataBuffer:r,materialDataIndices:a}=o,i=new m,s=r.textureBuffer,u=s.getVec5Field("colorAndCastShadows"),p=s.getScalarField("elevationOffset"),b=s.getScalarField("emissiveStrength"),g=s.getScalarField("emissiveSourceMode"),v=s.getVec4Field("oidColor"),C=new Uint8Array(4),x=new Uint32Array(C.buffer);let S=0,_=0,M=0,y=0,w=0,B=o.verticalOffsets,D=1/0,O=-1/0,j=!1,k=!1,P=!1,A=0,I=!1;for(let l=0;l<o.count;l++){e(l,i),S+=+(i.externalColor[3]<1),_+=+(3===i.externalColorMixMode&&1===i.externalColor[3]),y+=+(i.emissiveStrength>0),w+=+(1===i.emissiveSource),k||=1!==i.emissiveStrength,M+=+i.castShadows,n(i.externalColor,i.externalColorMixMode,C),u.setValues(a[l],C[0],C[1],C[2],C[3],+i.castShadows),j||=l>0&&(A!==x[0]||I!==i.castShadows),A=x[0],I=i.castShadows,P||=0!==i.elevationOffset,P&&null==B&&(B=new Array(l).fill(0)),null!=B&&(B[l]=i.elevationOffset),D=Math.min(D,i.elevationOffset),O=Math.max(O,i.elevationOffset),p.set(a[l],i.elevationOffset),b.set(a[l],i.emissiveStrength),g.set(a[l],0===i.emissiveSource?0:255);const t=i.olidColor;null!=t&&v.setArray(a[l],t),i.pickable!==o.isPickable(l)&&o.updatePickabilityWithCount(l,i.pickable)}o.verticalOffsets=P?B:null,this.offsetObb=P?l(this.obb,D,O,t,this.offsetObb??this.obb.clone()):null,this.updateMaterial(e=>{if(j||P||d()||(k||w>0)&&y>0){const t=new c;t.castShadows=f(M,o.count),t.transparent=f(S,o.count),t.opaqueOverride=f(_,o.count),t.emissiveOverride=f(y,o.count),t.emissiveSourceOverride=f(w,o.count),e.textureBackedBufferParameters.textureBackedBuffer=s,e.componentParameters=t,s.updateTexture()}else{const t=new h;t.castShadows=i.castShadows?0:2,t.externalColor=i.externalColor,t.externalColorMixMode=i.externalColorMixMode,t.emissiveStrength=i.emissiveStrength,t.emissiveSource=i.emissiveSource,e.textureBackedBufferParameters.textureBackedBuffer=null,e.componentParameters=t}})}addComponentHighlight(e,t){return this._componentData.addComponentHighlight(e,t)}removeComponentHighlight(e,t){return this._componentData.removeComponentHighlight(e,t)}clearHighlights(){this._componentData.clearHighlights()}destroy(){this._intersectionGeometry=e(this._intersectionGeometry),this._renderable=e(this._renderable),this._componentData=e(this._componentData)}get aabbInWorldCoordinates(){let e=this._aabbInWorldCoordinates;return e||(e=this._computeAabbInWorldCoordinates(),this._aabbInWorldCoordinates=e),e}_computeAabbInWorldCoordinates(){const e=s(),{positions:t}=this._intersectionGeometry;if(Math.floor(t.length/3)>0){const{rotationScale:s,position:n}=this.transform;let l=1/0,m=1/0,c=1/0,h=-1/0,d=-1/0,u=-1/0;const f=i();for(let e=0;e<t.length;e+=3)o(f,t[e+0],t[e+1],t[e+2]),r(f,f,s),a(f,f,n),l=Math.min(l,f[0]),m=Math.min(m,f[1]),c=Math.min(c,f[2]),h=Math.max(h,f[0]),d=Math.max(d,f[1]),u=Math.max(u,f[2]);e[0]=l,e[1]=m,e[2]=c,e[3]=h,e[4]=d,e[5]=u}return e}}function f(e,t){return e===t?0:0===e?2:1}export{u as ComponentObject};
5
+ import{destroyMaybe as e}from"../../../../../core/maybe.js";import{s as t,h as o,t as r,i as a}from"../../../../../chunks/vec32.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as s}from"../../../../../geometry/support/aaBoundingBox.js";import{encodeSymbolColor as n}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as l}from"../../../support/orientedBoundingBox.js";import{UniformComponentParameters as m}from"./UniformComponentParameters.js";import{ComponentParametersVarying as c,ComponentParametersUniform as h}from"./Material/ComponentMaterial.js";import{olidEnabled as d}from"../../effects/geometry/olidUtils.js";class u{constructor(e,t,o,r,a){this.transform=e,this.obb=t,this._componentData=o,this._renderable=r,this._intersectionGeometry=a,this.visible=!1,this.offsetObb=null,this._aabbInWorldCoordinates=null}get componentData(){return this._componentData}get renderable(){return this._renderable}get intersectionGeometry(){return this._intersectionGeometry}updateMaterial(e){e(this._renderable.material)}updateCameraDerivedParameters(e){const{eye:o}=e;this._renderable.meta.cameraDepthSquared=t(o,this.obb.center)}setComponentData(e,t){const o=this._componentData,{materialDataBuffer:r,materialDataIndices:a}=o,i=new m,s=r.textureBuffer,u=s.getVec5Field("colorAndCastShadows"),p=s.getScalarField("elevationOffset"),b=s.getScalarField("emissiveStrength"),g=s.getScalarField("emissiveSourceMode"),v=s.getVec4Field("olidColor"),C=new Uint8Array(4),x=new Uint32Array(C.buffer);let S=0,_=0,M=0,y=0,w=0,D=o.verticalOffsets,O=1/0,B=-1/0,j=!1,k=!1,A=!1,I=0,W=!1;for(let l=0;l<o.count;l++){e(l,i),S+=+(i.externalColor[3]<1),_+=+(3===i.externalColorMixMode&&1===i.externalColor[3]),y+=+(i.emissiveStrength>0),w+=+(1===i.emissiveSource),k||=1!==i.emissiveStrength,M+=+i.castShadows,n(i.externalColor,i.externalColorMixMode,C),u.setValues(a[l],C[0],C[1],C[2],C[3],+i.castShadows),j||=l>0&&(I!==x[0]||W!==i.castShadows),I=x[0],W=i.castShadows,A||=0!==i.elevationOffset,A&&null==D&&(D=new Array(l).fill(0)),null!=D&&(D[l]=i.elevationOffset),O=Math.min(O,i.elevationOffset),B=Math.max(B,i.elevationOffset),p.set(a[l],i.elevationOffset),b.set(a[l],i.emissiveStrength),g.set(a[l],0===i.emissiveSource?0:255);const t=i.olidColor;null!=t&&v.setArray(a[l],t),i.pickable!==o.isPickable(l)&&o.updatePickabilityWithCount(l,i.pickable)}o.verticalOffsets=A?D:null,this.offsetObb=A?l(this.obb,O,B,t,this.offsetObb??this.obb.clone()):null,this.updateMaterial(e=>{if(j||A||d()||(k||w>0)&&y>0){const t=new c;t.castShadows=f(M,o.count),t.transparent=f(S,o.count),t.opaqueOverride=f(_,o.count),t.emissiveOverride=f(y,o.count),t.emissiveSourceOverride=f(w,o.count),e.textureBackedBuffer=s,e.componentParameters=t,s.updateTexture()}else{const t=new h;t.castShadows=i.castShadows?0:2,t.externalColor=i.externalColor,t.externalColorMixMode=i.externalColorMixMode,t.emissiveStrength=i.emissiveStrength,t.emissiveSource=i.emissiveSource,e.textureBackedBuffer=null,e.componentParameters=t}})}addComponentHighlight(e,t){return this._componentData.addComponentHighlight(e,t)}removeComponentHighlight(e,t){return this._componentData.removeComponentHighlight(e,t)}clearHighlights(){this._componentData.clearHighlights()}destroy(){this._intersectionGeometry=e(this._intersectionGeometry),this._renderable=e(this._renderable),this._componentData=e(this._componentData)}get aabbInWorldCoordinates(){let e=this._aabbInWorldCoordinates;return e||(e=this._computeAabbInWorldCoordinates(),this._aabbInWorldCoordinates=e),e}_computeAabbInWorldCoordinates(){const e=s(),{positions:t}=this._intersectionGeometry;if(Math.floor(t.length/3)>0){const{rotationScale:s,position:n}=this.transform;let l=1/0,m=1/0,c=1/0,h=-1/0,d=-1/0,u=-1/0;const f=i();for(let e=0;e<t.length;e+=3)o(f,t[e+0],t[e+1],t[e+2]),r(f,f,s),a(f,f,n),l=Math.min(l,f[0]),m=Math.min(m,f[1]),c=Math.min(c,f[2]),h=Math.max(h,f[0]),d=Math.max(d,f[1]),u=Math.max(u,f[2]);e[0]=l,e[1]=m,e[2]=c,e[3]=h,e[4]=d,e[5]=u}return e}}function f(e,t){return e===t?0:0===e?2:1}export{u as ComponentObject};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import t from"../../../../../core/PooledArray.js";import{isTypedArray as i}from"../../../../../core/typedArrayUtil.js";import{clone as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as r}from"../../../../../geometry/support/Indices.js";import{c as s}from"../../../../../chunks/vec3.js";import{c as a}from"../../../../../chunks/vec33.js";import{glLayout as c}from"../../../support/buffer/glUtil.js";import{ComponentData as l}from"./ComponentData.js";import{ComponentObject as m}from"./ComponentObject.js";import{IntersectionGeometry as h}from"./IntersectionGeometry.js";import{Renderable as p}from"./Renderable.js";import{RenderGeometry as f}from"./RenderGeometry.js";import{RenderSubmitSystem as g}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as d}from"./SourceGeometry.js";import{ComponentMaterial as u}from"./Material/ComponentMaterial.js";import{indexGlLayout as b}from"./Material/ComponentTechnique.js";import{maxElevationOffset as y,maxPackedRGBEmission as v}from"./Material/shader/ComponentData.glsl.js";import{olidEnabled as _}from"../../effects/geometry/olidUtils.js";import{VertexArrayObject as C}from"../../lib/VertexArrayObject.js";import{getVerticalOffsetI3S as M}from"../../lib/verticalOffsetUtils.js";import{BufferManager as j}from"../../lib/TextureBackedBuffer/BufferManager.js";import{BufferObject as w}from"../../../../webgl/BufferObject.js";import{PrimitiveType as O}from"../../../../webgl/enums.js";import{VertexBuffer as D}from"../../../../webgl/VertexBuffer.js";const R=()=>e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class x{constructor(e,i,n){this._renderManager=e,this._viewingMode=i,this._sphericalSpatialReference=n,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._activeHighlightOptions=new Map,this._visible=new t,this._hidden=new t,this._renderSubmit=new g(this),this._renderManager.register(this._renderSubmit),this._componentBufferManager=new j(e.rctx,A())}destroy(){this._componentBufferManager.destroy(),this._componentBufferManager=null,this._visible.forAll(e=>e.destroy()),this._visible.prune(),this._hidden.forAll(e=>e.destroy()),this._hidden.prune(),this._renderSubmit.destroy()}createObject(e){const{geometry:t}=e,i=new l(this._componentBufferManager,r(t.componentOffsets)),n=this._createRenderable(e,i),o=new h(this._viewingMode,t.positionData,i,e.elevationAlignable),s=new m(e.transform,e.obb.clone(),i,n,o);return(s.visible?this._visible:this._hidden).push(s),s}destroyObject(e){const t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._notifyDirty()}setObjectVisibility(e,t){const i=e;t!==i.visible&&(t?(this._hidden.removeUnordered(i),this._visible.push(i)):(this._visible.removeUnordered(i),this._hidden.push(i)),i.visible=t,this._notifyDirty())}preSubmit(e){const{camera:t}=e;this._componentBufferManager.updateTextures(),this.visibleObjects.forAll(e=>e.updateCameraDerivedParameters(t))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const i=e;i.updateMaterial(t),i.renderable.material.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const i=e;i.componentData.visibility.reset(t),i.componentData.markVisibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){const t=e,{componentData:i}=t,n=i.visibility.componentCount;return{visible:n,invisible:i.count-n}}setComponentData(e,t){e.setComponentData(t,this._viewingMode),this._elevationRangeCacheVerticalOffset=NaN,this._notifyDirty()}getComponentAabb(e,t,i,n=!1){e.intersectionGeometry.getComponentAabb(t,i);const o=e,r=o.componentData.verticalOffsets;if(n||null==r)return i;const s=r[t];if(2===this._viewingMode||0===s)return i[2]+=s,i[5]+=s,i;const a=M(s);return a.localOrigin=o.transform.position,a.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,i){return e.intersectionGeometry.getComponentPositions(t,i)}expandRangeWithComponentObjectElevationRange(e,t,i,n){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==t||n.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);const o=e,{componentData:r}=o,s=r.count,{verticalOffsets:a}=r,{intersectionGeometry:c}=o,l=2===this._viewingMode,m=c.getComponentAabbs(),h=E;let p=1/0,f=-1/0;for(let g=0;g<s;g++){const e=6*g,r=a?.[g]??0;let s=1/0,c=-1/0;if(l)s=m[e+2]+r+t,c=m[e+5]+r+t;else{if(h[0]=m[e],h[1]=m[e+1],h[2]=m[e+2],h[3]=m[e+3],h[4]=m[e+4],h[5]=m[e+5],0!==r){const e=M(r);e.localOrigin=o.transform.position,e.applyToAabb(h)}const s=Math.max(Math.abs(h[3]),Math.abs(h[0])),a=Math.max(Math.abs(h[4]),Math.abs(h[1])),c=t+h[5]+i;n.expandElevationRangeValues(t+h[2],Math.sqrt(s*s+a*a+c*c)-i)}n.expandElevationRangeValues(s,c),p=Math.min(p,s),f=Math.max(f,c)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=p,this._elevationRangeCacheMax=f}intersect(e,t,i,n,o,r){const s=e,{transform:a,componentData:c,intersectionGeometry:l}=s;return null!=n&&(n.localOrigin=a.position),l.intersect(t,i,n,c.verticalOffsets,a,o,r)}addEdges(e,t,i,n,o){const r=e,{indices:s,positions:a}=r.intersectionGeometry,c=r.componentData.offsets;return t.addComponentObject(r,a,s,c,i,n,o)}async extractEdgeInformation(e,t,i){const o=e,r=o.componentData.visibility;if(r.allInvisible()){const{extractComponentsEdgeLocationsLayout:e}=await import("../../lib/edgeRendering/edgeProcessing.js");return{buffer:e.createBuffer(0),origin:[0,0,0]}}const{indices:c,positions:l}=o.intersectionGeometry,m=o.componentData.offsets,{EdgeInputBufferLayout:h}=await import("../../lib/edgeRendering/bufferLayouts.js"),p=h.createBuffer(l.length/3);a(p.position.typedBuffer,l,p.position.typedBufferStride,3),s(p.position,p.position,o.transform.rotationScale),this._setComponentIndices(p.componentIndex,c,m);const f=p.count,g=this._computeVisibilityIndices(c,r,m,f);return{origin:n(o.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:g,indicesLength:g.length,skipDeduplicate:!0,data:p,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,t,i){let n=0;for(let o=0;o<i.length-1;o++){const r=i[o],s=i[o+1];for(let i=r;i<s;i++){const o=t?t[i]:i;e.set(o,n)}n++}}_computeVisibilityIndices(e,t,n,o){if(e&&t.allVisible())return e;let r=0;t.forEachComponentRange((e,t)=>(r+=n[t]-n[e],!0));const s=i(e)?2===e?.BYTES_PER_ELEMENT||o<=65536?new Uint16Array(r):new Uint32Array(r):new Array(r);let a=0;return t.forEachComponentRange((t,i)=>{const o=n[t],r=n[i];for(let n=o;n<r;n++)s[a++]=e?e[n]:n;return!0}),s}addComponentHighlight(e,t,i){const n=e;{const e=this._activeHighlightOptions.get(i)??0;this._activeHighlightOptions.set(i,e+1)}n.addComponentHighlight(t,i)&&this._notifyDirty()}removeComponentHighlight(e,t,i){const n=e.removeComponentHighlight(t,i);"notfound"!==n&&(this._removeActiveHighlight(i),n&&this._notifyDirty())}_removeActiveHighlight(e,t=1){const i=this._activeHighlightOptions.get(e);if(void 0===i)R().warn(`Removing non-existing highlight "${e}".`);else{const n=i-t;n<0&&R().warn(`Removing non-existing highlight "${e}".`),n<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,n)}}clearHighlights(e){const t=e,{componentData:i}=t,{componentHighlights:n}=t.componentData;if(n.size>0){for(const e of n)this._removeActiveHighlight(e[0],e[1][i.count]);t.clearHighlights(),this._notifyDirty()}}hasHighlight(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t){const i=this._renderManager.rctx,n=e.geometry,o=n.vertices.layoutParameters,r=c(d(o)),s=new D(i,r,n.vertices.data),a=n.indices?w.createIndex(i,35044,n.indices):null,l=new Uint16Array(n.vertices.count);for(let c=0;c<t.count;c++){const e=t.offsets[c],i=t.offsets[c+1],o=t.materialDataIndices[c];if(null!=n.indices)for(let t=e;t<i;t++){l[n.indices[t]]=o}else for(let t=e;t<i;t++)l[t]=o}const m=new D(i,b,l.buffer),h=new u(e.transform,e.toMapSpace,e.obb.radius<S,this._sphericalSpatialReference),g=new C(i,new Map([["geometry",s],["componentIndices",m]]),a),y=new f(g,O.TRIANGLES,o,null!=a),v={cameraDepthSquared:.5,gpuMemoryEstimate:s.usedMemory+m.usedMemory+(null!=a?a.usedMemory:0)};return new p(h,y,v)}_notifyDirty(){this._renderManager.notifyDirty()}}function A(){const e=[{name:"colorAndCastShadows",type:"u8u8u7xu8"},{name:"elevationOffset",type:"packed-f32",maxValue:y},{name:"emissiveStrength",type:"packed-f24",maxValue:v},{name:"emissiveSourceMode",type:"u8"}];return _()&&e.push({name:"oidColor",type:"vec4u8"}),e}const E=o(),S=5e4;export{x as ComponentObjectCollection};
5
+ import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import t from"../../../../../core/PooledArray.js";import{isTypedArray as i}from"../../../../../core/typedArrayUtil.js";import{clone as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as r}from"../../../../../geometry/support/Indices.js";import{c as s}from"../../../../../chunks/vec3.js";import{c as a}from"../../../../../chunks/vec33.js";import{glLayout as c}from"../../../support/buffer/glUtil.js";import{ComponentData as l}from"./ComponentData.js";import{ComponentObject as m}from"./ComponentObject.js";import{IntersectionGeometry as h}from"./IntersectionGeometry.js";import{Renderable as f}from"./Renderable.js";import{RenderGeometry as p}from"./RenderGeometry.js";import{RenderSubmitSystem as g}from"./RenderSubmitSystem.js";import{createVertexBufferLayout as d}from"./SourceGeometry.js";import{ComponentMaterial as u}from"./Material/ComponentMaterial.js";import{VertexArrayObject as b}from"../../lib/VertexArrayObject.js";import{getVerticalOffsetI3S as v}from"../../lib/verticalOffsetUtils.js";import{BufferManager as y}from"../../lib/TextureBackedBuffer/BufferManager.js";import{getComponentDataLayout as _,indexGlLayout as M}from"../../materials/DefaultLayouts.js";import{BufferObject as C}from"../../../../webgl/BufferObject.js";import{PrimitiveType as j}from"../../../../webgl/enums.js";import{VertexBuffer as w}from"../../../../webgl/VertexBuffer.js";const O=()=>e.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");class D{constructor(e,i,n){this._renderManager=e,this._viewingMode=i,this._sphericalSpatialReference=n,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._activeHighlightOptions=new Map,this._visible=new t,this._hidden=new t,this._renderSubmit=new g(this),this._renderManager.register(this._renderSubmit),this._componentBufferManager=new y(e.rctx,_())}destroy(){this._componentBufferManager.destroy(),this._componentBufferManager=null,this._visible.forAll(e=>e.destroy()),this._visible.prune(),this._hidden.forAll(e=>e.destroy()),this._hidden.prune(),this._renderSubmit.destroy()}createObject(e){const{geometry:t}=e,i=new l(this._componentBufferManager,r(t.componentOffsets)),n=this._createRenderable(e,i),o=new h(this._viewingMode,t.positionData,i,e.elevationAlignable),s=new m(e.transform,e.obb.clone(),i,n,o);return(s.visible?this._visible:this._hidden).push(s),s}destroyObject(e){const t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._notifyDirty()}setObjectVisibility(e,t){const i=e;t!==i.visible&&(t?(this._hidden.removeUnordered(i),this._visible.push(i)):(this._visible.removeUnordered(i),this._hidden.push(i)),i.visible=t,this._notifyDirty())}preSubmit(e){const{camera:t}=e;this._componentBufferManager.updateTextures(),this.visibleObjects.forAll(e=>e.updateCameraDerivedParameters(t))}getMaterial(e){return e.renderable.material}updateMaterial(e,t){const i=e;i.updateMaterial(t),i.renderable.material.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,t){const i=e;i.componentData.visibility.reset(t),i.componentData.markVisibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){const t=e,{componentData:i}=t,n=i.visibility.componentCount;return{visible:n,invisible:i.count-n}}setComponentData(e,t){e.setComponentData(t,this._viewingMode),this._elevationRangeCacheVerticalOffset=NaN,this._notifyDirty()}getComponentAabb(e,t,i,n=!1){e.intersectionGeometry.getComponentAabb(t,i);const o=e,r=o.componentData.verticalOffsets;if(n||null==r)return i;const s=r[t];if(2===this._viewingMode||0===s)return i[2]+=s,i[5]+=s,i;const a=v(s);return a.localOrigin=o.transform.position,a.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,i){return e.intersectionGeometry.getComponentPositions(t,i)}expandRangeWithComponentObjectElevationRange(e,t,i,n){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==t||n.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);const o=e,{componentData:r}=o,s=r.count,{verticalOffsets:a}=r,{intersectionGeometry:c}=o,l=2===this._viewingMode,m=c.getComponentAabbs(),h=R;let f=1/0,p=-1/0;for(let g=0;g<s;g++){const e=6*g,r=a?.[g]??0;let s=1/0,c=-1/0;if(l)s=m[e+2]+r+t,c=m[e+5]+r+t;else{if(h[0]=m[e],h[1]=m[e+1],h[2]=m[e+2],h[3]=m[e+3],h[4]=m[e+4],h[5]=m[e+5],0!==r){const e=v(r);e.localOrigin=o.transform.position,e.applyToAabb(h)}const s=Math.max(Math.abs(h[3]),Math.abs(h[0])),a=Math.max(Math.abs(h[4]),Math.abs(h[1])),c=t+h[5]+i;n.expandElevationRangeValues(t+h[2],Math.sqrt(s*s+a*a+c*c)-i)}n.expandElevationRangeValues(s,c),f=Math.min(f,s),p=Math.max(p,c)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=f,this._elevationRangeCacheMax=p}intersect(e,t,i,n,o,r){const s=e,{transform:a,componentData:c,intersectionGeometry:l}=s;return null!=n&&(n.localOrigin=a.position),l.intersect(t,i,n,c.verticalOffsets,a,o,r)}addEdges(e,t,i,n,o){const r=e,{indices:s,positions:a}=r.intersectionGeometry,c=r.componentData.offsets;return t.addComponentObject(r,a,s,c,i,n,o)}async extractEdgeInformation(e,t,i){const o=e,r=o.componentData.visibility;if(r.allInvisible()){const{extractComponentsEdgeLocationsLayout:e}=await import("../../lib/edgeRendering/edgeProcessing.js");return{buffer:e.createBuffer(0),origin:[0,0,0]}}const{indices:c,positions:l}=o.intersectionGeometry,m=o.componentData.offsets,{EdgeInputBufferLayout:h}=await import("../../lib/edgeRendering/bufferLayouts.js"),f=h.createBuffer(l.length/3);a(f.position.typedBuffer,l,f.position.typedBufferStride,3),s(f.position,f.position,o.transform.rotationScale),this._setComponentIndices(f.componentIndex,c,m);const p=f.count,g=this._computeVisibilityIndices(c,r,m,p);return{origin:n(o.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:g,indicesLength:g.length,skipDeduplicate:!0,data:f,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,t,i){let n=0;for(let o=0;o<i.length-1;o++){const r=i[o],s=i[o+1];for(let i=r;i<s;i++){const o=t?t[i]:i;e.set(o,n)}n++}}_computeVisibilityIndices(e,t,n,o){if(e&&t.allVisible())return e;let r=0;t.forEachComponentRange((e,t)=>(r+=n[t]-n[e],!0));const s=i(e)?2===e?.BYTES_PER_ELEMENT||o<=65536?new Uint16Array(r):new Uint32Array(r):new Array(r);let a=0;return t.forEachComponentRange((t,i)=>{const o=n[t],r=n[i];for(let n=o;n<r;n++)s[a++]=e?e[n]:n;return!0}),s}addComponentHighlight(e,t,i){const n=e;{const e=this._activeHighlightOptions.get(i)??0;this._activeHighlightOptions.set(i,e+1)}n.addComponentHighlight(t,i)&&this._notifyDirty()}removeComponentHighlight(e,t,i){const n=e.removeComponentHighlight(t,i);"notfound"!==n&&(this._removeActiveHighlight(i),n&&this._notifyDirty())}_removeActiveHighlight(e,t=1){const i=this._activeHighlightOptions.get(e);if(void 0===i)O().warn(`Removing non-existing highlight "${e}".`);else{const n=i-t;n<0&&O().warn(`Removing non-existing highlight "${e}".`),n<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,n)}}clearHighlights(e){const t=e,{componentData:i}=t,{componentHighlights:n}=t.componentData;if(n.size>0){for(const e of n)this._removeActiveHighlight(e[0],e[1][i.count]);t.clearHighlights(),this._notifyDirty()}}hasHighlight(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t){const i=this._renderManager.rctx,n=e.geometry,o=n.vertices.layoutParameters,r=c(d(o)),s=new w(i,r,n.vertices.data),a=n.indices?C.createIndex(i,35044,n.indices):null,l=new Uint16Array(n.vertices.count);for(let c=0;c<t.count;c++){const e=t.offsets[c],i=t.offsets[c+1],o=t.materialDataIndices[c];if(null!=n.indices)for(let t=e;t<i;t++){l[n.indices[t]]=o}else for(let t=e;t<i;t++)l[t]=o}const m=new w(i,M,l.buffer),h=new u(e.transform,e.toMapSpace,e.obb.radius<x,this._sphericalSpatialReference),g=new b(i,new Map([["geometry",s],["componentIndices",m]]),a),v=new p(g,j.TRIANGLES,o,null!=a),y={cameraDepthSquared:.5,gpuMemoryEstimate:s.usedMemory+m.usedMemory+(null!=a?a.usedMemory:0)};return new f(h,v,y)}_notifyDirty(){this._renderManager.notifyDirty()}}const R=o(),x=5e4;export{D as ComponentObjectCollection};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as s}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{I as o,m as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as n}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as l}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ComponentTechnique as p}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as c}from"./ComponentTechniqueConfiguration.js";import{parameter as d,parameterBlock as m,MaterialBase as v,MaterialParameterBlock as g}from"../../../core/material/MaterialBase.js";import{isColor as f}from"../../../core/shaderLibrary/ShaderOutput.js";import{TextureBackedBufferParameters as x}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{TwoVectorPosition as y}from"../../../core/util/TwoVectorPosition.js";import{advancedMRRFactors as M}from"../../../materials/pbrUtils.js";import{defaultHighlightName as b}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as T}from"../../../../../../webscene/support/AlphaCutoff.js";class S extends v{constructor(e,o,i,n){super(),this.toMapSpace=o,this.useENUForGlobalOverlayUV=i,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.sphereDepthInterpolate=!1,this.mrrFactors=M,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=0,this.commonMaterialParameters=new C,this.componentParameters=new O,this.textureBackedBufferParameters=new x,this.objectOpacity=1,this.textureAlphaCutoff=T,this.alphaDiscardMode=1,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=1,this.hasOccludees=!1;const l=s(e.rotationScale);t(l,l),r(l,l),this.transformNormalGlobalFromModel=l;const u=new y(e.position);this.transformWorldFromModelTL=u.low,this.transformWorldFromModelTH=u.high,this.transformWorldFromModelRS=e.rotationScale,this._configuration=new c(n),this._updateMaterialConfiguration()}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get _hasEmissiveBase(){return null!=this.emissionTexture||!i(this.emissiveBaseColor,n)}get _hasEmissiveStrength(){return 2!==this.componentParameters.emissiveOverride}get hasEmissions(){return this._hasEmissiveStrength&&(this._hasEmissiveBase||2!==this.componentParameters.emissiveSourceOverride)}get texture(){return this.baseColorTexture?.texture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.texture}get textureEmissive(){return this.emissionTexture?.texture}get textureOcclusion(){return this.occlusionTexture?.texture}get textureNormal(){return this.normalTexture?.texture}update(e){e(this)}acquireTechnique(e,t,r,s){const o=this._updateConfiguration(t,r,s);return e.get(p,o)}_updateConfiguration(e,t,r){return this._updateMaterialConfiguration(),this._updateDrawConfiguration(e,t,r)}_updateMaterialConfiguration(){if(!this.dirty)return;const e=this._configuration;e.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,e.hasOcclusionTexture=null!=this.occlusionTexture,e.hasNormalTexture=null!=this.normalTexture,e.sphereDepthInterpolate=this.sphereDepthInterpolate&&e.spherical,e.ellipsoidMode=this.ellipsoidMode,e.componentData=this.componentParameters.type,e.textureBackedBufferLayout=this.textureBackedBufferParameters.textureBackedBuffer?.layout.hash??0,e.cullFace=this.commonMaterialParameters.cullFace,e.doubleSidedMode=this.commonMaterialParameters.doubleSided?1:0,e.hasColorTexture=null!=this.baseColorTexture;const t=this._computeWhichMaterialPass();e.blendingEnabled=1===t||2===t,e.alphaDiscardMode=this.alphaDiscardMode,e.hasPolygonOffset=this.polygonOffsetEnabled,this._setClean()}_updateDrawConfiguration(e,t,r){const s=this._configuration,o=e.identifier,i=0===o;s.hasEmission=t.hasEmission&&i,s.renderOccluded=9===t.slot,s.hasVertexColors=r.hasVertexColors,s.hasNormals=r.hasNormals,s.textureCoordinateType=r.textureCoordinateType,s.oitPass=i?t.oitPass:0,s.terrainDepthTest=i&&t.terrainDepthTest,s.cullAboveTerrain=!!i&&t.cullAboveTerrain,s.integratedMeshMode=this.isIntegratedMesh?B(t)?D(t)?3:2:1:0,s.pbrMode=3===s.integratedMeshMode?4:this.usePBR?this.hasParametersFromSource?r.shadeNormals&&this.isIntegratedMesh?0:2:1:0;const a=1===this.componentParameters.emissiveSourceOverride,n=2===this.componentParameters.emissiveSourceOverride,l=null!=this.emissionTexture;s.emissionSource=this.hasEmissions?this._hasEmissiveBase&&1===s.pbrMode?n?l?4:2:a?l?5:7:6:a?7:6:0,s.shadeNormals=r.shadeNormals,s.normalType=s.hasNormals?1:2,s.hasSlicePlane=null!=t.slicePlane&&this.commonMaterialParameters.hasSlicePlane,s.hasHighlightMixTexture=2===o&&null!=t.highlightMixTexture,s.output=1===o?3:3===o?6:2===o?8:e.output,s.snowCover=i&&t.snowCover>0;const h=this._computeWhichMaterialPass();s.vertexDiscardMode=i&&2===h?e.transparent?2:1:0,s.olidColor=i&&9===e.output;const u=i&&f(e.output);return s.receiveAmbientOcclusion=u&&r.applySSAO&&null!=t.ssao?.getTexture(),s.hasOccludees=u&&t.hasOccludees,s.receiveShadows=u&&t.shadowMap.ready,s.screenSpaceReflections=u&&null!=t.ssr.lastFrameColor,s.cloudReflections=u&&null!=t.clouds.data?.cubeMap?.colorTexture,s}submit(e,t,r){if(this.objectOpacity<=0)return;const{componentData:s,renderable:o}=r,{geometry:i}=o,a=o.meta.cameraDepthSquared;s.updateHighlights(t.highlights);const{geometryRanges:n,highlightRangesMap:l,shadowmapRanges:h}=s,u=e=>e.submitDraw(this,i,n,a);switch(this._computeWhichMaterialPass()){case 0:u(e.opaque);break;case 1:u(e.transparent);break;case 2:u(e.opaque),u(e.transparent);break;case 3:u(e.integratedMesh),j(t)&&u(e.occludedGround),w(t)&&u(e.highlightIntegratedMesh);break;case 4:u(e.transparentIntegratedMesh)}if(2!==this.componentParameters.castShadows){if(null!=l)for(const t of l)t[0]===b&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=h&&e.defaultShadowMap.submitDraw(this,i,h,a),u(e.shadowMap)}if(null!=l)for(const p of l)e.highlight.submitDraw(this,i,p[1],a,p[0]);t.viewshedEnabled&&u(e.viewshedShadowMap)}_computeWhichMaterialPass(){if(this.isIntegratedMesh&&this.objectOpacity>=1)return 3;if(this.isIntegratedMesh&&this.objectOpacity<1)return 4;if(this.objectOpacity<1)return 1;if(0===this.componentParameters.opaqueOverride)return 0;if(this.baseColor[3]<1||0===this.alphaDiscardMode||3===this.alphaDiscardMode)return 1;switch(this.componentParameters.transparent){case 2:return 0;case 0:return 1;case 1:return 2}}}e([d({vectorOps:l})],S.prototype,"baseColor",void 0),e([d()],S.prototype,"usePBR",void 0),e([d()],S.prototype,"hasParametersFromSource",void 0),e([d()],S.prototype,"sphereDepthInterpolate",void 0),e([d({vectorOps:o})],S.prototype,"mrrFactors",void 0),e([d({dispose:!0})],S.prototype,"baseColorTexture",void 0),e([d({dispose:!0})],S.prototype,"metallicRoughnessTexture",void 0),e([d({dispose:!0})],S.prototype,"normalTexture",void 0),e([d({dispose:!0})],S.prototype,"occlusionTexture",void 0),e([d({dispose:!0})],S.prototype,"emissionTexture",void 0),e([d({vectorOps:o})],S.prototype,"emissiveBaseColor",void 0),e([d()],S.prototype,"emissiveStrength",void 0),e([m()],S.prototype,"commonMaterialParameters",void 0),e([m()],S.prototype,"componentParameters",void 0),e([m()],S.prototype,"textureBackedBufferParameters",void 0),e([d()],S.prototype,"objectOpacity",void 0),e([d()],S.prototype,"textureAlphaCutoff",void 0),e([d()],S.prototype,"alphaDiscardMode",void 0),e([d()],S.prototype,"isIntegratedMesh",void 0),e([d()],S.prototype,"polygonOffsetEnabled",void 0),e([d()],S.prototype,"ellipsoidMode",void 0),e([d()],S.prototype,"hasOccludees",void 0);class C extends g{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=2,this.hasSlicePlane=!0}}e([d()],C.prototype,"doubleSided",void 0),e([d()],C.prototype,"cullFace",void 0),e([d()],C.prototype,"hasSlicePlane",void 0);class O extends g{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=1,this.emissiveStrength=0,this.emissiveSource=0,this.castShadows=0}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}get visible(){return this.externalColor[3]>0?0:2}get type(){return 0}}e([d({vectorOps:l})],O.prototype,"externalColor",void 0),e([d()],O.prototype,"externalColorMixMode",void 0),e([d()],O.prototype,"emissiveStrength",void 0),e([d()],O.prototype,"emissiveSource",void 0),e([d()],O.prototype,"castShadows",void 0);class P extends g{constructor(){super(...arguments),this.transparent=2,this.opaqueOverride=2,this.emissiveOverride=2,this.emissiveSourceOverride=2,this.castShadows=2}get type(){return 1}}function w(e){return null!=e.overlay?.getTexture(2)}function D(e){return null!=e.overlay?.getTexture(3)}function B(e){return null!=e.overlay?.getTexture(1)}function j(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}e([d()],P.prototype,"transparent",void 0),e([d()],P.prototype,"opaqueOverride",void 0),e([d()],P.prototype,"emissiveOverride",void 0),e([d()],P.prototype,"emissiveSourceOverride",void 0),e([d()],P.prototype,"castShadows",void 0);export{C as CommonMaterialParameters,S as ComponentMaterial,O as ComponentParametersUniform,P as ComponentParametersVarying};
5
+ import{__decorate as e}from"tslib";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as s}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{m as o,I as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as n}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as l}from"../../../../../../chunks/vec42.js";import{freeze as h,fromValues as u}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ComponentTechnique as p}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as c}from"./ComponentTechniqueConfiguration.js";import{parameter as d,parameterBlock as m,MaterialBase as v,MaterialParameterBlock as g}from"../../../core/material/MaterialBase.js";import{isColor as x}from"../../../core/shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as f}from"../../../core/util/TwoVectorPosition.js";import{advancedMRRFactors as y}from"../../../materials/pbrUtils.js";import{defaultHighlightName as M}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as b}from"../../../../../../webscene/support/AlphaCutoff.js";class T extends v{constructor(e,o,i,n){super(),this.toMapSpace=o,this.useENUForGlobalOverlayUV=i,this.baseColor=h(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.sphereDepthInterpolate=!1,this.mrrFactors=y,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=0,this.commonMaterialParameters=new S,this.componentParameters=new C,this.textureBackedBuffer=null,this.objectOpacity=1,this.textureAlphaCutoff=b,this.alphaDiscardMode=1,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=1,this.hasOccludees=!1;const l=s(e.rotationScale);t(l,l),r(l,l),this.transformNormalGlobalFromModel=l;const u=new f(e.position);this.transformWorldFromModelTL=u.low,this.transformWorldFromModelTH=u.high,this.transformWorldFromModelRS=e.rotationScale,this._configuration=new c(n),this._updateMaterialConfiguration()}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get _hasEmissiveBase(){return null!=this.emissionTexture||!o(this.emissiveBaseColor,n)}get _hasEmissiveStrength(){return 2!==this.componentParameters.emissiveOverride}get hasEmissions(){return this._hasEmissiveStrength&&(this._hasEmissiveBase||2!==this.componentParameters.emissiveSourceOverride)}get texture(){return this.baseColorTexture?.texture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.texture}get textureEmissive(){return this.emissionTexture?.texture}get textureOcclusion(){return this.occlusionTexture?.texture}get textureNormal(){return this.normalTexture?.texture}update(e){e(this)}acquireTechnique(e,t,r,s){const o=this._updateConfiguration(t,r,s);return e.get(p,o)}_updateConfiguration(e,t,r){return this._updateMaterialConfiguration(),this._updateDrawConfiguration(e,t,r)}_updateMaterialConfiguration(){if(!this.dirty)return;const e=this._configuration;e.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,e.hasOcclusionTexture=null!=this.occlusionTexture,e.hasNormalTexture=null!=this.normalTexture,e.sphereDepthInterpolate=this.sphereDepthInterpolate&&e.spherical,e.ellipsoidMode=this.ellipsoidMode,e.componentData=this.componentParameters.type,e.cullFace=this.commonMaterialParameters.cullFace,e.doubleSidedMode=this.commonMaterialParameters.doubleSided?1:0,e.hasColorTexture=null!=this.baseColorTexture;const t=this._computeWhichMaterialPass();e.blendingEnabled=1===t||2===t,e.alphaDiscardMode=this.alphaDiscardMode,e.hasPolygonOffset=this.polygonOffsetEnabled,this._setClean()}_updateDrawConfiguration(e,t,r){const s=this._configuration,o=e.identifier,i=0===o;s.hasEmission=t.hasEmission&&i,s.renderOccluded=9===t.slot,s.hasVertexColors=r.hasVertexColors,s.hasNormals=r.hasNormals,s.textureCoordinateType=r.textureCoordinateType,s.oitPass=i?t.oitPass:0,s.terrainDepthTest=i&&t.terrainDepthTest,s.cullAboveTerrain=!!i&&t.cullAboveTerrain,s.integratedMeshMode=this.isIntegratedMesh?D(t)?w(t)?3:2:1:0,s.pbrMode=3===s.integratedMeshMode?4:this.usePBR?this.hasParametersFromSource?r.shadeNormals&&this.isIntegratedMesh?0:2:1:0;const a=1===this.componentParameters.emissiveSourceOverride,n=2===this.componentParameters.emissiveSourceOverride,l=null!=this.emissionTexture;s.emissionSource=this.hasEmissions?this._hasEmissiveBase&&1===s.pbrMode?n?l?4:2:a?l?5:7:6:a?7:6:0,s.shadeNormals=r.shadeNormals,s.normalType=s.hasNormals?1:2,s.hasSlicePlane=null!=t.slicePlane&&this.commonMaterialParameters.hasSlicePlane,s.hasHighlightMixTexture=2===o&&null!=t.highlightMixTexture,s.output=e.output,s.snowCover=i&&t.snowCover>0;const h=this._computeWhichMaterialPass();s.vertexDiscardMode=i&&2===h?e.transparent?2:1:0,s.olidColor=i&&9===e.output;const u=i&&x(e.output);return s.receiveAmbientOcclusion=u&&r.applySSAO&&null!=t.ssao?.getTexture(),s.hasOccludees=u&&t.hasOccludees,s.receiveShadows=u&&t.shadowMap.ready,s.screenSpaceReflections=u&&null!=t.ssr.lastFrameColor,s.cloudReflections=u&&null!=t.clouds.data?.cubeMap?.colorTexture,s}submit(e,t,r){if(this.objectOpacity<=0)return;const{componentData:s,renderable:o}=r,{geometry:i}=o,a=o.meta.cameraDepthSquared;s.updateHighlights(t.highlights);const{geometryRanges:n,highlightRangesMap:l,shadowmapRanges:h}=s,u=e=>e.submitDraw(this,i,n,a);switch(this._computeWhichMaterialPass()){case 0:u(e.opaque);break;case 1:u(e.transparent);break;case 2:u(e.opaque),u(e.transparent);break;case 3:u(e.integratedMesh),j(t)&&u(e.occludedGround),P(t)&&u(e.highlightIntegratedMesh);break;case 4:u(e.transparentIntegratedMesh)}if(2!==this.componentParameters.castShadows){if(null!=l)for(const t of l)t[0]===M&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=h&&e.defaultShadowMap.submitDraw(this,i,h,a),u(e.shadowMap)}if(null!=l)for(const p of l)e.highlight.submitDraw(this,i,p[1],a,p[0]);t.viewshedEnabled&&u(e.viewshedShadowMap)}_computeWhichMaterialPass(){if(this.isIntegratedMesh&&this.objectOpacity>=1)return 3;if(this.isIntegratedMesh&&this.objectOpacity<1)return 4;if(this.objectOpacity<1)return 1;if(0===this.componentParameters.opaqueOverride)return 0;if(this.baseColor[3]<1||0===this.alphaDiscardMode||3===this.alphaDiscardMode)return 1;switch(this.componentParameters.transparent){case 2:return 0;case 0:return 1;case 1:return 2}}}e([d({vectorOps:l})],T.prototype,"baseColor",void 0),e([d()],T.prototype,"usePBR",void 0),e([d()],T.prototype,"hasParametersFromSource",void 0),e([d()],T.prototype,"sphereDepthInterpolate",void 0),e([d({vectorOps:i})],T.prototype,"mrrFactors",void 0),e([d({dispose:!0})],T.prototype,"baseColorTexture",void 0),e([d({dispose:!0})],T.prototype,"metallicRoughnessTexture",void 0),e([d({dispose:!0})],T.prototype,"normalTexture",void 0),e([d({dispose:!0})],T.prototype,"occlusionTexture",void 0),e([d({dispose:!0})],T.prototype,"emissionTexture",void 0),e([d({vectorOps:i})],T.prototype,"emissiveBaseColor",void 0),e([d()],T.prototype,"emissiveStrength",void 0),e([m()],T.prototype,"commonMaterialParameters",void 0),e([m()],T.prototype,"componentParameters",void 0),e([d()],T.prototype,"textureBackedBuffer",void 0),e([d()],T.prototype,"objectOpacity",void 0),e([d()],T.prototype,"textureAlphaCutoff",void 0),e([d()],T.prototype,"alphaDiscardMode",void 0),e([d()],T.prototype,"isIntegratedMesh",void 0),e([d()],T.prototype,"polygonOffsetEnabled",void 0),e([d()],T.prototype,"ellipsoidMode",void 0),e([d()],T.prototype,"hasOccludees",void 0);class S extends g{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=2,this.hasSlicePlane=!0}}e([d()],S.prototype,"doubleSided",void 0),e([d()],S.prototype,"cullFace",void 0),e([d()],S.prototype,"hasSlicePlane",void 0);class C extends g{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=1,this.emissiveStrength=0,this.emissiveSource=0,this.castShadows=0}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}get visible(){return this.externalColor[3]>0?0:2}get type(){return 0}}e([d({vectorOps:l})],C.prototype,"externalColor",void 0),e([d()],C.prototype,"externalColorMixMode",void 0),e([d()],C.prototype,"emissiveStrength",void 0),e([d()],C.prototype,"emissiveSource",void 0),e([d()],C.prototype,"castShadows",void 0);class O extends g{constructor(){super(...arguments),this.transparent=2,this.opaqueOverride=2,this.emissiveOverride=2,this.emissiveSourceOverride=2,this.castShadows=2}get type(){return 1}}function P(e){return null!=e.overlay?.getTexture(2)}function w(e){return null!=e.overlay?.getTexture(3)}function D(e){return null!=e.overlay?.getTexture(1)}function j(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}e([d()],O.prototype,"transparent",void 0),e([d()],O.prototype,"opaqueOverride",void 0),e([d()],O.prototype,"emissiveOverride",void 0),e([d()],O.prototype,"emissiveSourceOverride",void 0),e([d()],O.prototype,"castShadows",void 0);export{S as CommonMaterialParameters,T as ComponentMaterial,C as ComponentParametersUniform,O as ComponentParametersVarying};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{glLayout as o}from"../../../../support/buffer/glUtil.js";import{newLayout as t}from"../../../../support/buffer/InterleavedLayout.js";import{createVertexBufferLayout as s}from"../SourceGeometry.js";import{C as n}from"../../../../../../chunks/ComponentShader.glsl.js";import{isColor as i}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as l}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as c,depthOnlyOutputBuffersOr as a}from"../../../core/shaderTechnique/ShaderTechnique.js";import{OITPolygonOffset as p,oitDepthTest as m,blending as u,getDrawBuffers as d}from"../../../lib/OrderIndependentTransparency.js";import{replaceBitWhenDepthTestPasses as f,stencilBaseAllZerosParams as h,stencilWriteMaskOn as b}from"../../../lib/StencilUtils.js";import{makePipelineState as g,defaultColorWrite as j,defaultDepthWrite as S,cullingParams as T,premultipliedAlpha as w}from"../../../../../webgl/renderState.js";import{fromLayouts as y}from"../../../../../webgl/VertexAttributeLocations.js";let O=class extends c{constructor(e,r){super(e,r,y([o(s(r)),C])),this.shader=new l(n,()=>import("./shader/ComponentShader.glsl.js"))}initializePipeline(e){const{integratedMeshMode:r,output:o,blendingEnabled:t,cullFace:s,hasEmission:n,hasOccludees:l,hasPolygonOffset:c,oitPass:y,renderOccluded:O}=e,C=0!==r,q=0===y,x=2===y;return g({blending:O?w:i(o)&&t?u(y):null,culling:T(s),depthTest:O?null:{func:m(y)},depthWrite:O||!q&&!x?null:S,drawBuffers:a(o,d(y,n)),colorWrite:j,stencilWrite:!O&&C||l?b:null,stencilTest:C?f(1):l?h:null,polygonOffset:q||x?c?{factor:2,units:2}:null:p})}};O=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],O);const C=o(t().u16("componentIndex"));export{O as ComponentTechnique,C as indexGlLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../../../support/buffer/glUtil.js";import{createVertexBufferLayout as o}from"../SourceGeometry.js";import{C as s}from"../../../../../../chunks/ComponentShader.glsl.js";import{isColor as i}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as l}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as n,depthOnlyOutputBuffersOr as a}from"../../../core/shaderTechnique/ShaderTechnique.js";import{OITPolygonOffset as m,depthTest as c,blending as p,drawBuffers as u}from"../../../lib/OrderIndependentTransparency.js";import{replaceBitWhenDepthTestPasses as d,stencilBaseAllZerosParams as f,stencilWriteMaskOn as h}from"../../../lib/StencilUtils.js";import{indexGlLayout as b}from"../../../materials/DefaultLayouts.js";import{makePipelineState as g,defaultColorWrite as j,defaultDepthWrite as S,cullingParams as T,premultipliedAlpha as w}from"../../../../../webgl/renderState.js";import{fromLayouts as y}from"../../../../../webgl/VertexAttributeLocations.js";let O=class extends n{constructor(e,r){super(e,r,y([t(o(r)),b])),this.shader=new l(s,()=>import("./shader/ComponentShader.glsl.js"))}initializePipeline(e){const{integratedMeshMode:r,output:t,blendingEnabled:o,cullFace:s,hasEmission:l,hasOccludees:n,hasPolygonOffset:b,oitPass:y,renderOccluded:O}=e,C=0!==r,q=0===y,x=2===y;return g({blending:O?w:i(t)&&o?p(y):null,culling:T(s),depthTest:O?null:c(y),depthWrite:O||!q&&!x?null:S,drawBuffers:a(t,u(y,l)),colorWrite:j,stencilWrite:!O&&C||n?h:null,stencilTest:C?d(1):n?f:null,polygonOffset:q||x?b?{factor:2,units:2}:null:m})}};O=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],O);export{O as ComponentTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{isColorHighlightOrOID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o,ShaderTechniqueConfiguration as i}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{MAX_COUNT_TEXTURE_BACKED_BUFFER_LAYOUTS as s}from"../../../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";class r extends i{constructor(e){super(),this.sphericalSR=e,this.output=0,this.textureCoordinateType=0,this.componentData=0,this.textureBackedBufferLayout=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.oitPass=0,this.ellipsoidMode=1,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.hasEmission=!1,this.hasVertexColors=!1,this.hasNormals=!1,this.shadeNormals=!0,this.hasSlicePlane=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.olidColor=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.discardInvisibleFragments=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o({count:10})],r.prototype,"output",void 0),e([o({count:3})],r.prototype,"textureCoordinateType",void 0),e([o({count:2})],r.prototype,"componentData",void 0),e([o({count:s})],r.prototype,"textureBackedBufferLayout",void 0),e([o({count:3})],r.prototype,"cullFace",void 0),e([o({count:3})],r.prototype,"vertexDiscardMode",void 0),e([o({count:3})],r.prototype,"doubleSidedMode",void 0),e([o({count:4})],r.prototype,"alphaDiscardMode",void 0),e([o({count:4})],r.prototype,"integratedMeshMode",void 0),e([o({count:3})],r.prototype,"oitPass",void 0),e([o({count:4})],r.prototype,"ellipsoidMode",void 0),e([o({count:7})],r.prototype,"pbrMode",void 0),e([o({count:3})],r.prototype,"normalType",void 0),e([o({count:8})],r.prototype,"emissionSource",void 0),e([o()],r.prototype,"hasEmission",void 0),e([o()],r.prototype,"hasVertexColors",void 0),e([o()],r.prototype,"hasNormals",void 0),e([o()],r.prototype,"shadeNormals",void 0),e([o()],r.prototype,"hasSlicePlane",void 0),e([o()],r.prototype,"hasColorTexture",void 0),e([o()],r.prototype,"hasHighlightMixTexture",void 0),e([o()],r.prototype,"receiveAmbientOcclusion",void 0),e([o()],r.prototype,"receiveShadows",void 0),e([o()],r.prototype,"blendingEnabled",void 0),e([o()],r.prototype,"screenSpaceReflections",void 0),e([o()],r.prototype,"hasPolygonOffset",void 0),e([o()],r.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],r.prototype,"hasOcclusionTexture",void 0),e([o()],r.prototype,"hasNormalTexture",void 0),e([o()],r.prototype,"hasOccludees",void 0),e([o()],r.prototype,"terrainDepthTest",void 0),e([o()],r.prototype,"cullAboveTerrain",void 0),e([o()],r.prototype,"hasNormalTextureTransform",void 0),e([o()],r.prototype,"cloudReflections",void 0),e([o()],r.prototype,"snowCover",void 0),e([o()],r.prototype,"olidColor",void 0),e([o()],r.prototype,"renderOccluded",void 0),e([o()],r.prototype,"sphereDepthInterpolate",void 0);export{r as ComponentTechniqueConfiguration};
5
+ import{__decorate as e}from"tslib";import{isColorHighlightOrOID as o}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as t,ShaderTechniqueConfiguration as i}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class s extends i{constructor(e){super(),this.sphericalSR=e,this.output=0,this.textureCoordinateType=0,this.componentData=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.oitPass=0,this.ellipsoidMode=1,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.hasEmission=!1,this.hasVertexColors=!1,this.hasNormals=!1,this.shadeNormals=!0,this.hasSlicePlane=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.olidColor=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.discardInvisibleFragments=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&o(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([t({count:10})],s.prototype,"output",void 0),e([t({count:3})],s.prototype,"textureCoordinateType",void 0),e([t({count:2})],s.prototype,"componentData",void 0),e([t({count:3})],s.prototype,"cullFace",void 0),e([t({count:3})],s.prototype,"vertexDiscardMode",void 0),e([t({count:3})],s.prototype,"doubleSidedMode",void 0),e([t({count:4})],s.prototype,"alphaDiscardMode",void 0),e([t({count:4})],s.prototype,"integratedMeshMode",void 0),e([t({count:3})],s.prototype,"oitPass",void 0),e([t({count:4})],s.prototype,"ellipsoidMode",void 0),e([t({count:7})],s.prototype,"pbrMode",void 0),e([t({count:3})],s.prototype,"normalType",void 0),e([t({count:8})],s.prototype,"emissionSource",void 0),e([t()],s.prototype,"hasEmission",void 0),e([t()],s.prototype,"hasVertexColors",void 0),e([t()],s.prototype,"hasNormals",void 0),e([t()],s.prototype,"shadeNormals",void 0),e([t()],s.prototype,"hasSlicePlane",void 0),e([t()],s.prototype,"hasColorTexture",void 0),e([t()],s.prototype,"hasHighlightMixTexture",void 0),e([t()],s.prototype,"receiveAmbientOcclusion",void 0),e([t()],s.prototype,"receiveShadows",void 0),e([t()],s.prototype,"blendingEnabled",void 0),e([t()],s.prototype,"screenSpaceReflections",void 0),e([t()],s.prototype,"hasPolygonOffset",void 0),e([t()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([t()],s.prototype,"hasOcclusionTexture",void 0),e([t()],s.prototype,"hasNormalTexture",void 0),e([t()],s.prototype,"hasOccludees",void 0),e([t()],s.prototype,"terrainDepthTest",void 0),e([t()],s.prototype,"cullAboveTerrain",void 0),e([t()],s.prototype,"hasNormalTextureTransform",void 0),e([t()],s.prototype,"cloudReflections",void 0),e([t()],s.prototype,"snowCover",void 0),e([t()],s.prototype,"olidColor",void 0),e([t()],s.prototype,"renderOccluded",void 0),e([t()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
@@ -2,22 +2,22 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as o}from"../../../../../../../core/compilerUtils.js";import{packFloatRGBA as e,packFloatRGB as r}from"../../../../../../../core/floatRGBA.js";import{DecodeSymbolColor as t}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as a,itemData as d}from"../../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Float4DrawUniform as n}from"../../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as l}from"../../../../core/shaderModules/FloatDrawUniform.js";import{glsl as i,If as s}from"../../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as c}from"../../../../core/shaderModules/IntegerDrawUniform.js";import{getTextureBackedBufferLayout as u}from"../../../../lib/TextureBackedBuffer/TextureBackedBuffer.js";const f=429496.7296;function v(o,r){e(o/f*.5+.5,r)}const m=1e6;function x(o,e){r(o/m*.5+.5,e)}function C(e,r){switch(r.componentData){case 1:return M(e,r);case 0:return h(e,r);case 2:return;default:o(r.componentData)}}function M(o,e){const{vertex:r,fragment:n}=o,{output:l,hasEmission:c}=e;if(0===e.textureBackedBufferLayout)return;const f=u(e.textureBackedBufferLayout);if(null==f)throw new Error(`Invalid TextureBackedBufferLayout: ${e.textureBackedBufferLayout}. TextureBackedBuffer shader code generation only possible with valid buffer assigned.`);const v=9===l,m=o=>"emissiveSourceMode"===o||"emissiveStrength"===o?c:"oidColor"!==o||v;o.include(a(f,m,"componentIndex")),o.attributes.add("componentIndex","float"),o.varyings.add("vExternalColorMixMode","mediump float"),o.varyings.add("vExternalColor","vec4"),v&&o.varyings.add("vObjectAndLayerIdColor","vec4"),c&&(o.varyings.add("emissiveStrength","float"),o.varyings.add("emissiveSource","int")),o.include(t),r.code.add(i`
5
+ import{neverReached as o}from"../../../../../../../core/compilerUtils.js";import{DecodeSymbolColor as e}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as r}from"../../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Float4DrawUniform as t}from"../../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as a}from"../../../../core/shaderModules/FloatDrawUniform.js";import{glsl as d,If as n}from"../../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as l}from"../../../../core/shaderModules/IntegerDrawUniform.js";import{Texture2DDrawUniform as i}from"../../../../core/shaderModules/Texture2DDrawUniform.js";import{olidEnabled as s}from"../../../../effects/geometry/olidUtils.js";import{componentDataLayout as c,componentDataOlidLayout as m}from"../../../../materials/DefaultLayouts.js";function u(e,r){switch(r.componentData){case 1:return p(e,r);case 0:return w(e,r);case 2:return;default:o(r.componentData)}}const v=(o,e)=>"emissiveSourceMode"===o||"emissiveStrength"===o?e.hasEmission:"olidColor"!==o||9===e.output,f=new i("componentColorTex",o=>o.textureBackedBuffer.texture),x=new r(c,"componentIndex",f,v),C=new r(m,"componentIndex",f,v);function M(){return s()?C:x}function p(o,r){const{vertex:t,fragment:a}=o,{output:l,hasEmission:i}=r,s=9===l,{getTextureAttribute:c,TextureBackedBufferModule:m}=M();o.include(m,r),o.attributes.add("componentIndex","float"),o.varyings.add("vExternalColorMixMode","mediump float"),o.varyings.add("vExternalColor","vec4"),s&&o.varyings.add("vObjectAndLayerIdColor","vec4"),i&&(o.varyings.add("emissiveStrength","float"),o.varyings.add("emissiveSource","int")),o.include(e),t.code.add(d`
6
6
  float readElevationOffset() {
7
- return ${d("elevationOffset")};
7
+ return ${c("elevationOffset")};
8
8
  }
9
9
 
10
10
  void forwardEmissiveStrength() {
11
- ${s(c,i`emissiveStrength = ${d("emissiveStrength")};
12
- emissiveSource = ${d("emissiveSourceMode")} == 0.0 ? 0 : 1;`)}
11
+ ${n(i,d`emissiveStrength = ${c("emissiveStrength")};
12
+ emissiveSource = ${c("emissiveSourceMode")} == 0.0 ? 0 : 1;`)}
13
13
  }
14
14
 
15
15
  void forwardObjectAndLayerIdColor() {
16
- ${s(v,i`vObjectAndLayerIdColor = ${d("oidColor")};`)}
16
+ ${n(s,d`vObjectAndLayerIdColor = ${c("olidColor")};`)}
17
17
  }
18
18
 
19
19
  vec4 forwardExternalColor(out bool castShadows) {
20
- vec5 colorAndCastShadow = ${d("colorAndCastShadows")};
20
+ vec5 colorAndCastShadow = ${c("colorAndCastShadows")};
21
21
  vec4 componentColor = vec4(colorAndCastShadow.x, colorAndCastShadow.y, colorAndCastShadow.z, colorAndCastShadow.w);
22
22
  castShadows = colorAndCastShadow.v >= 1.0;
23
23
 
@@ -27,16 +27,16 @@ import{neverReached as o}from"../../../../../../../core/compilerUtils.js";import
27
27
 
28
28
  return vExternalColor;
29
29
  }
30
- `),n.code.add(i`
30
+ `),a.code.add(d`
31
31
  void readExternalColor(out vec4 externalColor, out int externalColorMixMode) {
32
32
  externalColor = vExternalColor;
33
33
  externalColorMixMode = int(vExternalColorMixMode);
34
34
  }
35
35
 
36
36
  void outputObjectAndLayerIdColor() {
37
- ${v?i`fragColor = vObjectAndLayerIdColor;`:""}
37
+ ${s?d`fragColor = vObjectAndLayerIdColor;`:""}
38
38
  }
39
- `)}function h(o,e){const{vertex:r,fragment:t}=o;o.varyings.add("vExternalColor","vec4"),t.uniforms.add(new l("emissiveStrength",o=>o.componentParameters.emissiveStrength)),r.uniforms.add(new n("externalColor",o=>o.componentParameters.externalColor)).code.add(i`float readElevationOffset() {
39
+ `)}function w(o,e){const{vertex:r,fragment:i}=o;o.varyings.add("vExternalColor","vec4"),i.uniforms.add(new a("emissiveStrength",o=>o.componentParameters.emissiveStrength)),r.uniforms.add(new t("externalColor",o=>o.componentParameters.externalColor)).code.add(d`float readElevationOffset() {
40
40
  return 0.0;
41
41
  }
42
42
  void forwardObjectAndLayerIdColor() {}
@@ -45,13 +45,13 @@ vec4 forwardExternalColor(out bool castShadows) {
45
45
  vExternalColor = externalColor;
46
46
  castShadows = true;
47
47
  return externalColor;
48
- }`);const a=9===e.output;t.uniforms.add(new c("externalColorMixMode",o=>o.componentParameters.externalColorMixMode)).code.add(i`
48
+ }`);const s=9===e.output;i.uniforms.add(new l("externalColorMixMode",o=>o.componentParameters.externalColorMixMode)).code.add(d`
49
49
  void readExternalColor(out vec4 color, out int colorMixMode) {
50
50
  color = vExternalColor;
51
51
  colorMixMode = externalColorMixMode;
52
52
  }
53
53
 
54
54
  void outputObjectAndLayerIdColor() {
55
- ${s(a,"fragColor = vec4(0, 0, 0, 0);")}
55
+ ${n(s,"fragColor = vec4(0, 0, 0, 0);")}
56
56
  }
57
- `)}export{C as ComponentData,v as encodeElevationOffset,x as encodeEmissiveStrength,f as maxElevationOffset,m as maxPackedRGBEmission};
57
+ `)}export{u as ComponentData,M as getTextureBackedBufferModule};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ const e=429496.7296,o=1e6;export{e as maxElevationOffset,o as maxPackedRGBEmission};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderPass as s}from"./RenderPass.js";import{VertexNormalPassParameters as e,VertexNormalDrawParameters as i}from"../shaderLibrary/attributes/VertexNormal.glsl.js";class r{constructor(t){const e=t.renderContext.rctx,i=t.techniques;this.opaque=new s(e,i),this.transparent=new s(e,i,1),this.integratedMesh=new s(e,i),this.transparentIntegratedMesh=new s(e,i),this.occludedGround=new s(e,i),this.shadowMap=new s(e,i),this.highlight=new s(e,i),this.highlightIntegratedMesh=new s(e,i),this.highlightShadowMap=new s(e,i),this.viewshedShadowMap=new s(e,i),this.defaultShadowMap=new s(e,i)}}class n extends e{constructor(){super(...arguments),this.slicePlaneLocalOrigin=t(),this.origin=this.slicePlaneLocalOrigin}}class h extends i{}class a extends n{constructor(){super(...arguments),this.identifier=0,this.output=0,this.transparent=!1,this.occludedGround=!1}}class o extends n{constructor(){super(...arguments),this.identifier=1}}class c extends n{constructor(){super(...arguments),this.identifier=2}}class d extends n{constructor(){super(...arguments),this.identifier=3}}export{r as AllRenderPasses,h as DrawParameters,c as HighlightPassParameters,a as MaterialPassParameters,n as PassParameters,o as ShadowMapPassParameters,d as ViewshedShadowMapPassParameters};
5
+ import{create as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderPass as s}from"./RenderPass.js";import{VertexNormalPassParameters as e,VertexNormalDrawParameters as i}from"../shaderLibrary/attributes/VertexNormal.glsl.js";class r{constructor(t){const e=t.renderContext.rctx,i=t.techniques;this.opaque=new s(e,i),this.transparent=new s(e,i,1),this.integratedMesh=new s(e,i),this.transparentIntegratedMesh=new s(e,i),this.occludedGround=new s(e,i),this.shadowMap=new s(e,i),this.highlight=new s(e,i),this.highlightIntegratedMesh=new s(e,i),this.highlightShadowMap=new s(e,i),this.viewshedShadowMap=new s(e,i),this.defaultShadowMap=new s(e,i)}}class n extends e{constructor(){super(...arguments),this.slicePlaneLocalOrigin=t(),this.origin=this.slicePlaneLocalOrigin}}class h extends i{}class o extends n{constructor(){super(...arguments),this.identifier=0,this.output=0,this.transparent=!1,this.occludedGround=!1}}class a extends n{constructor(){super(...arguments),this.identifier=1,this.output=3}}class c extends n{constructor(){super(...arguments),this.identifier=2,this.output=8}}class d extends n{constructor(){super(...arguments),this.identifier=3,this.output=6}}export{r as AllRenderPasses,h as DrawParameters,c as HighlightPassParameters,o as MaterialPassParameters,n as PassParameters,a as ShadowMapPassParameters,d as ViewshedShadowMapPassParameters};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/PooledArray.js";import{DataType as t}from"../../../../webgl/enums.js";class r{constructor(t,r,i=0){this._rctx=t,this._techniques=r,this._sorting=i,this._draws=new e({allocator:e=>e??{material:null,geometry:null,geometryRanges:null,bindDrawParams:null,depthSquaredHint:0,indexType:0}}),this._previouslyBoundDraw=new Map}submitDraw(e,t,r,i,s){const n=this._draws.pushNew();n.geometry=t,n.geometryRanges=r,n.material=e,n.depthSquaredHint=i,n.indexType=(t.indexed?t.vao.indexBuffer.indexType:null)??0,n.highlightName=s}acquire(e,t){return this._draws.map(r=>r.material.acquireTechnique(this._techniques,e,t,r.geometry.parameters))}dispatch(e,t,r){const s=this._rctx;this._previouslyBoundDraw.clear();let n=null;const a=this._draws.length,o=t.highlight?.name;for(let h=0;h<a;h++){const a=this._draws.data[h];if(2===e.identifier){const e=a.highlightName;if(e){if(e!==o)continue}else if(!o||!t.overlay?.hasHighlight(o))continue}const l=r[h];l===n&&0===t.oitPass||(s.bindTechnique(l,t,e),n=l);const{geometryRanges:d,indexType:u,geometry:m,material:c}=a;s.bindVAO(m.vao),this._previouslyBoundDraw.get(l)!==c&&(l.program.bindDraw(t,e,c),this._previouslyBoundDraw.set(l,c));const g=d.length,{primitiveType:p}=m;for(let e=0;e<g;e+=2){const t=d[e],r=d[e+1];if(0!==u){const e=i.get(u);s.drawElements(p,r,u,t*e)}else s.drawArrays(p,t,r)}}}prepareSubmit(){this._draws.clear()}finishSubmit(){const e=0===this._sorting?1:-1;this._draws.sort((t,r)=>e*(t.depthSquaredHint-r.depthSquaredHint)||t.geometry.vao.usedMemory-r.geometry.vao.usedMemory)}get count(){return this._draws.length}}const i=new Map;i.set(t.UNSIGNED_BYTE,1),i.set(t.UNSIGNED_SHORT,2),i.set(t.UNSIGNED_INT,4);export{r as RenderPass};
5
+ import{DataType as e}from"../../../../webgl/enums.js";class t{constructor(e,t,s=0){this._rctx=e,this._techniques=t,this._sorting=s,this._draws=new Array,this._previouslyBoundDraw=new Map}submitDraw(e,t,i,r,n){const a=(t.indexed?t.vao.indexBuffer.indexType:null)??0,o=new s(e,t,i,r,a,n);this._draws.push(o)}acquire(e,t){return this._draws.map(s=>s.material.acquireTechnique(this._techniques,e,t,s.geometry.parameters))}dispatch(e,t,s){const r=this._rctx;this._previouslyBoundDraw.clear();let n=null;const a=this._draws.length,o=t.highlight?.name;for(let h=0;h<a;h++){const a=this._draws[h];if(2===e.identifier){const e=a.highlightName;if(e){if(e!==o)continue}else if(!o||!t.overlay?.hasHighlight(o))continue}const u=s[h];u===n&&0===t.oitPass||(r.bindTechnique(u,t,e),n=u);const{geometryRanges:d,indexType:c,geometry:l,material:g}=a;r.bindVAO(l.vao),this._previouslyBoundDraw.get(u)!==g&&(u.program.bindDraw(t,e,g),this._previouslyBoundDraw.set(u,g));const m=d.length,{primitiveType:p}=l;for(let e=0;e<m;e+=2){const t=d[e],s=d[e+1];if(0!==c){const e=i.get(c);r.drawElements(p,s,c,t*e)}else r.drawArrays(p,t,s)}}}prepareSubmit(){this._draws.length=0}finishSubmit(){const e=0===this._sorting?1:-1;this._draws.sort((t,s)=>e*(t.depthSquaredHint-s.depthSquaredHint)||t.geometry.vao.usedMemory-s.geometry.vao.usedMemory)}get count(){return this._draws.length}}class s{constructor(e,t,s,i,r,n){this.material=e,this.geometry=t,this.geometryRanges=s,this.depthSquaredHint=i,this.indexType=r,this.highlightName=n}}const i=new Map;i.set(e.UNSIGNED_BYTE,1),i.set(e.UNSIGNED_SHORT,2),i.set(e.UNSIGNED_INT,4);export{t as RenderPass};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as s}from"tslib";import{subclass as e}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as t,transpose as r,invert as a}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as o}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{h,d as n}from"../../../../../chunks/vec32.js";import{create as c}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as m,ShadowMapPassParameters as u,HighlightPassParameters as l,ViewshedShadowMapPassParameters as p,AllRenderPasses as _}from"./AllRenderPasses.js";import{TwoVectorPosition as d}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as P}from"../../effects/RenderPlugin.js";import{DepthRange as f}from"../../lib/DepthRange.js";let w=class extends P{constructor(){super(...arguments),this.produces=new Map([[2,s=>this._produces(s,2)],[4,s=>this._produces(s,4)],[0,s=>this._produces(s,0)],[7,s=>this._produces(s,7)],[9,s=>this._produces(s,9)]]),this._materialPassParameters=new m,this._shadowPassParameters=new u,this._highlightPassParameters=new l,this._viewshedPassParameters=new p,this._systems=new Set}initializeRenderContext(s){this._context=s,this._passes=new _(s)}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.clear(),this._passes=null}register(s){this._systems.add(s)}_produces(s,e){return!!this._invoke(s,e,s=>s.count>0)}prepareRender(s){const{_systems:e,_passes:t}=this;if(0!==e.size&&null!=t){for(const s of Object.values(t))s.prepareSubmit();e.forEach(e=>e.submit(t,s.bind));for(const s of Object.values(t))s.finishSubmit()}}acquireTechniques(s){if(0===this._systems.size)return null;const e=3===s.output||4===s.output||5===s.output?this._shadowPassParameters:6===s.output?this._viewshedPassParameters:8===s.output?this._highlightPassParameters:this._materialPassParameters,t=s.bind;return this._updateParameters(t.camera,e,t.slot),this._materialPassParameters.output=s.output,this._invoke(s.output,s.bind.slot,(e,t)=>e.acquire(t,s.bind))}render(s,e){this._invoke(s.output,s.bind.slot,(t,r)=>t.dispatch(r,s.bind,e))}_invoke(s,e,t){if(null==this._passes)return null;switch(e){case 2:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.opaque,this._materialPassParameters);case 8:return t(this._passes.highlight,this._highlightPassParameters);case 3:return t(this._passes.shadowMap,this._shadowPassParameters);case 4:return t(this._passes.highlightShadowMap,this._shadowPassParameters);case 5:return t(this._passes.defaultShadowMap,this._shadowPassParameters);case 6:return t(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;case 4:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.transparent,this._materialPassParameters)}break;case 0:switch(s){case 0:case 1:case 2:case 9:case 7:return t(this._passes.integratedMesh,this._materialPassParameters);case 8:return t(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}break;case 7:if(0===s)return t(this._passes.transparentIntegratedMesh,this._materialPassParameters);break;case 9:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.occludedGround,this._materialPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(s){const e=new f;return this._systems.forEach(t=>e.union(t.queryDepthRange(s))),e}get hasEmitters(){let s=!1;return this._systems.forEach(e=>s=e.hasEmissions||s),s}_updateParameters(s,e,i){const c=s.viewInverseTransposeMatrix,m=4===i,u=9===i;h(g,c[3],c[7],c[11]),v.set(g),n(e.transformWorldFromViewTH,v.high),n(e.transformWorldFromViewTL,v.low),n(e.slicePlaneLocalOrigin,g),t(e.transformViewFromCameraRelativeRS,s.viewMatrix),o(e.transformProjFromView,s.projectionMatrix),0===e.identifier&&(this._materialPassParameters.transparent=m,this._materialPassParameters.occludedGround=u,r(b,e.transformViewFromCameraRelativeRS),a(e.transformNormalViewFromGlobal,b))}hasHighlight(s){for(const e of this._systems)if(e.hasHighlight(s))return!0;return!1}};w=s([e("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],w);const g=c(),b=i(),v=new d;export{w as RenderPassManager};
5
+ import{__decorate as s}from"tslib";import{subclass as e}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as t,transpose as r,invert as a}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{h,d as o}from"../../../../../chunks/vec32.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as c,ShadowMapPassParameters as m,HighlightPassParameters as u,ViewshedShadowMapPassParameters as l,AllRenderPasses as p}from"./AllRenderPasses.js";import{TwoVectorPosition as _}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as d}from"../../effects/RenderPlugin.js";import{DepthRange as P}from"../../lib/DepthRange.js";let f=class extends d{constructor(){super(...arguments),this.produces=new Map([[2,s=>this._produces(s,2)],[4,s=>this._produces(s,4)],[0,s=>this._produces(s,0)],[7,s=>this._produces(s,7)],[9,s=>this._produces(s,9)]]),this._materialPassParameters=new c,this._shadowPassParameters=new m,this._highlightPassParameters=new u,this._viewshedPassParameters=new l,this._systems=new Set}initializeRenderContext(s){this._context=s,this._passes=new p(s)}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.clear(),this._passes=null}register(s){this._systems.add(s)}_produces(s,e){return!!this._invoke(s,e,s=>s.count>0)}prepareRender(s){const{_systems:e,_passes:t}=this;if(0!==e.size&&null!=t){for(const s of Object.values(t))s.prepareSubmit();e.forEach(e=>e.submit(t,s.bind));for(const s of Object.values(t))s.finishSubmit()}}acquireTechniques(s){if(0===this._systems.size)return null;const e=3===s.output||4===s.output||5===s.output?this._shadowPassParameters:6===s.output?this._viewshedPassParameters:8===s.output?this._highlightPassParameters:this._materialPassParameters,t=s.bind;return this._updateParameters(t.camera,e,t.slot),this._materialPassParameters.output=s.output,this._invoke(s.output,s.bind.slot,(e,t)=>e.acquire(t,s.bind))}render(s,e){this._invoke(s.output,s.bind.slot,(t,r)=>t.dispatch(r,s.bind,e))}_invoke(s,e,t){if(null==this._passes)return null;switch(e){case 2:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.opaque,this._materialPassParameters);case 8:return t(this._passes.highlight,this._highlightPassParameters);case 3:return t(this._passes.shadowMap,this._shadowPassParameters);case 4:return t(this._passes.highlightShadowMap,this._shadowPassParameters);case 5:return t(this._passes.defaultShadowMap,this._shadowPassParameters);case 6:return t(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;case 4:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.transparent,this._materialPassParameters)}break;case 0:switch(s){case 0:case 1:case 2:case 9:case 7:return t(this._passes.integratedMesh,this._materialPassParameters);case 8:return t(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}break;case 7:if(0===s)return t(this._passes.transparentIntegratedMesh,this._materialPassParameters);break;case 9:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.occludedGround,this._materialPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(s){const e=new P;return this._systems.forEach(t=>e.union(t.queryDepthRange(s))),e}get hasEmitters(){let s=!1;return this._systems.forEach(e=>s=e.hasEmissions||s),s}_updateParameters(s,e,i){const n=s.viewInverseTransposeMatrix,c=4===i,m=9===i;h(w,n[3],n[7],n[11]),b.set(w),o(e.transformWorldFromViewTH,b.high),o(e.transformWorldFromViewTL,b.low),o(e.slicePlaneLocalOrigin,w),t(e.transformViewFromCameraRelativeRS,s.viewMatrix),0===e.identifier&&(this._materialPassParameters.transparent=c,this._materialPassParameters.occludedGround=m,r(g,e.transformViewFromCameraRelativeRS),a(e.transformNormalViewFromGlobal,g))}hasHighlight(s){for(const e of this._systems)if(e.hasHighlight(s))return!0;return!1}};f=s([e("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],f);const w=n(),g=i(),b=new _;export{f as RenderPassManager};
@@ -2,16 +2,13 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{parameter as t,MaterialParameterBlock as o}from"../material/MaterialBase.js";import{glslType as r,decode_u8u8u7xu8 as a,glslDecodeField as d}from"./TextureBackedBufferFields.glsl.js";import{RgbaFloatEncoding as f}from"./util/RgbaFloatEncoding.glsl.js";import{glsl as c}from"../shaderModules/glsl.js";import{Texture2DDrawUniform as l}from"../shaderModules/Texture2DDrawUniform.js";class n extends o{constructor(e=null){super(),this.textureBackedBuffer=e}}function u(e,t=()=>!0,o){return r=>i(r,o,e,t)}function i(e,t,o,n){const{vertex:u}=e;u.constants.add("tbbStride","float",o.numTexels),u.uniforms.add(new l("componentColorTex",e=>e.textureBackedBufferParameters.textureBackedBuffer.texture));const i=o.fields.filter(e=>n(e.name));if(0===i.length)return;const m=[];for(let r=0;r<o.numTexels;++r)m.push(!1);for(const r of i)for(let e=0;e<r.numTexels;++e)m[r.startTexel+e]=!0;u.code.add(c`struct vec5 {
6
- float x;
7
- float y;
8
- float z;
9
- float w;
10
- float v;
11
- };`),u.code.add(c`struct TextureBackedBufferItemData {`);for(const a of i)u.code.add(c`\t${r(a)} ${a.name};`);u.code.add(c`};`),u.include(f),u.include(a),u.code.add(c`TextureBackedBufferItemData fetchTextureBackedBufferItemData(float itemIndex) {
12
- TextureBackedBufferItemData itemData;
13
- float index = itemIndex * tbbStride;
14
- float texSize = float(textureSize(componentColorTex, 0).x);
15
- float coordX = mod(index, texSize) + 0.5;
16
- float coordY = floor(index / texSize) + 0.5;`);for(let r=0;r<m.length;++r)!1!==m[r]&&u.code.add(c`\tvec4 texel${c.int(r)} = texelFetch(componentColorTex, ivec2(coordX + ${c.float(r)}, coordY), 0);`);for(const r of i)u.code.add(c`\titemData.${r.name} = ${d(r)};`);u.code.add(c`return itemData;
17
- }`),u.code.add(c`TextureBackedBufferItemData tbbItemData;`),u.main.add(c`tbbItemData = fetchTextureBackedBufferItemData(${t});`)}function m(e){return c`tbbItemData.${e}`}e([t()],n.prototype,"textureBackedBuffer",void 0);export{u as TextureBackedBufferModule,n as TextureBackedBufferParameters,m as itemData};
5
+ import{generateUID as e}from"../../../../../core/uid.js";import{vec5Type as t,decode_u8u8u7xu8 as o,glslType as d,glslDecodeField as a}from"./TextureBackedBufferFields.glsl.js";import{RgbaFloatEncoding as r}from"./util/RgbaFloatEncoding.glsl.js";import{glsl as n}from"../shaderModules/glsl.js";import{assert as i}from"../../lib/Util.js";class c{constructor(t,o,d,a=()=>!0){this.moduleId=e(),this.namespace=`_tbb_${this.moduleId}_`,this.TextureBackedBufferModule=(e,r)=>l(this.namespace,e,r,o,d,t,a),this.getTextureAttribute=s(this.namespace)}}function l(e,c,l,s,m,u,$){const{vertex:x}=c,h=`${e}tbbStride`,g=`${e}TextureBackedBufferItemData`,p=`${e}fetchTextureBackedBufferItemData`,T=f(e);for(const t of[h,g,p,T])i(t.length<1024,"Identifiers do not have a valid length");x.constants.add(h,"float",u.numTexels),x.uniforms.add(m);const B=u.fields.filter(e=>$(e.name,l));if(0===B.length)return;const I=[];for(let t=0;t<u.numTexels;++t)I.push(!1);for(const t of B)for(let e=0;e<t.numTexels;++e)I[t.startTexel+e]=!0;x.include(r),x.include(t),x.include(o),x.code.add(n`
6
+ struct ${g} {`);for(const t of B)x.code.add(n`\t${d(t)} ${t.name};`);x.code.add(n`};`),x.code.add(n`
7
+ ${g} ${p}(float itemIndex) {
8
+ ${g} itemData;
9
+ float index = itemIndex * ${h};
10
+ float texSize = float(textureSize(${m.name}, 0).x);
11
+ float coordX = mod(index, texSize) + 0.5;
12
+ float coordY = floor(index / texSize) + 0.5;
13
+ `);for(let t=0;t<I.length;++t)!1!==I[t]&&x.code.add(n`\tvec4 texel${n.int(t)} = texelFetch(${m.name}, ivec2(coordX + ${n.float(t)}, coordY), 0);`);for(const t of B)x.code.add(n`\titemData.${t.name} = ${a(t)};`);x.code.add(n`return itemData;
14
+ }`),x.code.add(n`${g} ${T};`),x.main.add(n`${T} = ${p}(${s});`)}function s(e){const t=f(e);return e=>n`${t}.${e}`}function f(e){return`${e}ItemData`}export{c as TextureBackedBufferModule};
@@ -7,4 +7,10 @@ vec4 componentColor = vec4(r, g, b, a) * 255.0;
7
7
  float shadowFlag = mod(componentColor.b * 255.0, 2.0);
8
8
  componentColor.b -= shadowFlag;
9
9
  return vec5(componentColor.r, componentColor.g, componentColor.b, componentColor.a, shadowFlag);
10
- }`)}function t(e){switch(e.elementCount){case 1:return o`float`;case 2:return o`vec2`;case 3:return o`vec3`;case 4:return o`vec4`;case 5:return o`vec5`;default:throw new Error("unsupported elementCount")}}function n(o){const{declaration:e,glslDecodeArgumentString:t}=o;return`${(0,r[e.type])(t,e)}`}const r={u8:e=>o`${e}`,"packed-f24":(e,t)=>o`uninterpolatedRGBToFloat(vec3(${e})) * ${o.float(t.maxValue)}`,"packed-f32":(e,t)=>o`uninterpolatedRGBAToFloat(vec4(${e})) * ${o.float(t.maxValue)}`,vec4u8:e=>o`vec4(${e})`,u8u8u7xu8:e=>o`decode_u8u8u7xu8(${e})`};export{e as decode_u8u8u7xu8,n as glslDecodeField,t as glslType};
10
+ }`)}function t(e){e.code.add(o`struct vec5 {
11
+ float x;
12
+ float y;
13
+ float z;
14
+ float w;
15
+ float v;
16
+ };`)}function n(e){switch(e.elementCount){case 1:return o`float`;case 2:return o`vec2`;case 3:return o`vec3`;case 4:return o`vec4`;case 5:return o`vec5`;default:throw new Error("unsupported elementCount")}}function a(o){const{declaration:e,glslDecodeArgumentString:t}=o;return`${(0,c[e.type])(t,e)}`}const c={u8:e=>o`${e}`,"packed-f24":(e,t)=>o`uninterpolatedRGBToFloat(vec3(${e})) * ${o.float(t.maxValue)}`,"packed-f32":(e,t)=>o`uninterpolatedRGBAToFloat(vec4(${e})) * ${o.float(t.maxValue)}`,vec4u8:e=>o`vec4(${e})`,u8u8u7xu8:e=>o`decode_u8u8u7xu8(${e})`};export{e as decode_u8u8u7xu8,a as glslDecodeField,n as glslType,t as vec5Type};
@@ -2,7 +2,7 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{DoublePrecision as a}from"../util/DoublePrecision.glsl.js";import{Float3DrawUniform as t}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as i}from"../../shaderModules/Float3PassUniform.js";import{glsl as m}from"../../shaderModules/glsl.js";import{Matrix3DrawUniform as s}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as d}from"../../shaderModules/Matrix3PassUniform.js";import{Matrix4PassUniform as l}from"../../shaderModules/Matrix4PassUniform.js";import{NoParameters as n}from"../../../../../webgl/NoParameters.js";function f(r,o){const{attributes:e,vertex:n,varyings:f,fragment:v}=r;n.include(a,o),e.add("position","vec3"),f.add("vPositionWorldCameraRelative","vec3"),f.add("vPosition_view","vec3",{invariant:!0}),n.uniforms.add(new i("transformWorldFromViewTH",r=>r.transformWorldFromViewTH),new i("transformWorldFromViewTL",r=>r.transformWorldFromViewTL),new d("transformViewFromCameraRelativeRS",r=>r.transformViewFromCameraRelativeRS),new l("transformProjFromView",r=>r.transformProjFromView),new s("transformWorldFromModelRS",r=>r.transformWorldFromModelRS),new t("transformWorldFromModelTH",r=>r.transformWorldFromModelTH),new t("transformWorldFromModelTL",r=>r.transformWorldFromModelTL)),n.code.add(m`vec3 positionWorldCameraRelative() {
5
+ import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{DoublePrecision as e}from"../util/DoublePrecision.glsl.js";import{Float3DrawUniform as a}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as i}from"../../shaderModules/Float3PassUniform.js";import{glsl as t}from"../../shaderModules/glsl.js";import{Matrix3DrawUniform as m}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as s}from"../../shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as d}from"../../shaderModules/Matrix4BindUniform.js";import{NoParameters as l}from"../../../../../webgl/NoParameters.js";function n(r,o){const{attributes:l,vertex:n,varyings:f,fragment:v}=r;n.include(e,o),l.add("position","vec3"),f.add("vPositionWorldCameraRelative","vec3"),f.add("vPosition_view","vec3",{invariant:!0}),n.uniforms.add(new i("transformWorldFromViewTH",r=>r.transformWorldFromViewTH),new i("transformWorldFromViewTL",r=>r.transformWorldFromViewTL),new s("transformViewFromCameraRelativeRS",r=>r.transformViewFromCameraRelativeRS),new d("transformProjFromView",r=>r.camera.projectionMatrix),new m("transformWorldFromModelRS",r=>r.transformWorldFromModelRS),new a("transformWorldFromModelTH",r=>r.transformWorldFromModelTH),new a("transformWorldFromModelTL",r=>r.transformWorldFromModelTL)),n.code.add(t`vec3 positionWorldCameraRelative() {
6
6
  vec3 rotatedModelPosition = transformWorldFromModelRS * position;
7
7
  vec3 transform_CameraRelativeFromModel = dpAdd(
8
8
  transformWorldFromModelTL,
@@ -11,18 +11,18 @@ transformWorldFromModelTH,
11
11
  -transformWorldFromViewTH
12
12
  );
13
13
  return transform_CameraRelativeFromModel + rotatedModelPosition;
14
- }`),n.code.add(m`
14
+ }`),n.code.add(t`
15
15
  void forwardPosition(float fOffset) {
16
16
  vPositionWorldCameraRelative = positionWorldCameraRelative();
17
17
  if (fOffset != 0.0) {
18
- vPositionWorldCameraRelative += fOffset * ${o.spherical?m`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:m`vec3(0.0, 0.0, 1.0)`};
18
+ vPositionWorldCameraRelative += fOffset * ${o.spherical?t`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:t`vec3(0.0, 0.0, 1.0)`};
19
19
  }
20
20
 
21
21
  vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
22
22
  gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
23
23
  }
24
- `),v.uniforms.add(new i("transformWorldFromViewTL",r=>r.transformWorldFromViewTL)),n.code.add(m`vec3 positionWorld() {
24
+ `),v.uniforms.add(new i("transformWorldFromViewTL",r=>r.transformWorldFromViewTL)),n.code.add(t`vec3 positionWorld() {
25
25
  return transformWorldFromViewTL + vPositionWorldCameraRelative;
26
- }`),v.code.add(m`vec3 positionWorld() {
26
+ }`),v.code.add(t`vec3 positionWorld() {
27
27
  return transformWorldFromViewTL + vPositionWorldCameraRelative;
28
- }`)}class v extends n{constructor(){super(...arguments),this.transformWorldFromViewTH=e(),this.transformWorldFromViewTL=e(),this.transformViewFromCameraRelativeRS=r(),this.transformProjFromView=o()}}class F extends n{constructor(){super(...arguments),this.transformWorldFromModelRS=r(),this.transformWorldFromModelTH=e(),this.transformWorldFromModelTL=e()}}export{f as VertexPosition,F as VertexPositionDrawParameters,v as VertexPositionPassParameters};
28
+ }`)}class f extends l{constructor(){super(...arguments),this.transformWorldFromViewTH=o(),this.transformWorldFromViewTL=o(),this.transformViewFromCameraRelativeRS=r()}}class v extends l{constructor(){super(...arguments),this.transformWorldFromModelRS=r(),this.transformWorldFromModelTH=o(),this.transformWorldFromModelTL=o()}}export{n as VertexPosition,v as VertexPositionDrawParameters,f as VertexPositionPassParameters};
@@ -2,19 +2,19 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../../core/has.js";import{ZEROS as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BackgroundGrid as r}from"./BackgroundGrid.glsl.js";import{BlendModes as e}from"../util/BlendModes.glsl.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{FloatPassUniform as c}from"../../shaderModules/FloatPassUniform.js";import{glsl as l,If as s}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as t}from"../../shaderModules/Texture2DPassUniform.js";import{NoParameters as i}from"../../../../../webgl/NoParameters.js";class d extends i{constructor(){super(...arguments),this.baseOpacity=1,this.backgroundColor=o,this.fboTexture=null}}function b(o,i){const{output:d,blendMode:b,baseOpacityMode:g,premultipliedSource:n}=i,u=o.fragment,p=1===g;p&&u.uniforms.add(new c("baseOpacity",o=>o.baseOpacity));const m=0!==b,f=!m&&!(1===n)&&(1===d&&!p||4===d);u.include(e,i);let y="";switch(d){case 4:case 0:y=l`vec4(0.0)`;break;case 2:u.uniforms.add(new a("backgroundColor",o=>o.backgroundColor)),y=l`vec4(backgroundColor, 1.0)`;break;case 3:u.include(r),y=l`vec4(gridColor(uv), 1.0)`;break;case 1:u.uniforms.add(new t("fboColor",o=>o.fboTexture)),y=l`texelFetch(fboColor, ivec2(gl_FragCoord.xy), 0)`}u.code.add(l`
5
+ import"../../../../../../core/has.js";import{ZEROS as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BackgroundGrid as r}from"./BackgroundGrid.glsl.js";import{BlendModes as e}from"../util/BlendModes.glsl.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{FloatPassUniform as c}from"../../shaderModules/FloatPassUniform.js";import{glsl as l,If as s}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as t}from"../../shaderModules/Texture2DPassUniform.js";import{NoParameters as i}from"../../../../../webgl/NoParameters.js";class d extends i{constructor(){super(...arguments),this.baseOpacity=1,this.backgroundColor=o,this.fboTexture=null}}function b(o,i){const{output:d,blendMode:b,applyBaseOpacity:g,premultipliedAlphaSource:n}=i,u=o.fragment;g&&u.uniforms.add(new c("baseOpacity",o=>o.baseOpacity));const p=0!==b,m=!p&&!n&&(1===d&&!g||4===d);u.include(e,i);let f="";switch(d){case 4:case 0:f=l`vec4(0.0)`;break;case 2:u.uniforms.add(new a("backgroundColor",o=>o.backgroundColor)),f=l`vec4(backgroundColor, 1.0)`;break;case 3:u.include(r),f=l`vec4(gridColor(uv), 1.0)`;break;case 1:u.uniforms.add(new t("fboColor",o=>o.fboTexture)),f=l`texelFetch(fboColor, ivec2(gl_FragCoord.xy), 0)`}u.code.add(l`
6
6
  vec4 getBackground(vec2 uv) {
7
- return ${s(p,l`baseOpacity *`)} ${y};
7
+ return ${s(g,l`baseOpacity *`)} ${f};
8
8
  }
9
9
 
10
10
  vec4 blendLayers(vec2 bgUV, vec4 colorLayer, float opacity) {
11
- ${m?l`
11
+ ${p?l`
12
12
  vec3 cl = colorLayer.a == 0.0 ? colorLayer.rgb : colorLayer.rgb / colorLayer.a;
13
13
  vec4 bgColor = getBackground(bgUV);
14
14
  vec3 cb = bgColor.a == 0.0 ? bgColor.rgb : bgColor.rgb / bgColor.a;
15
15
  return applyBlendMode(clamp(cl, vec3(0.0), vec3(1.0)), colorLayer.a * opacity, cb, bgColor.a);`:l`
16
16
  float composeAlpha = colorLayer.a * opacity;
17
- ${f?l`return colorLayer * opacity;`:l`
17
+ ${m?l`return colorLayer * opacity;`:l`
18
18
  vec4 bgColor = getBackground(bgUV);
19
19
  return bgColor * (1.0 - composeAlpha) + colorLayer * opacity;`}`}
20
20
  }`)}export{b as TileBackground,d as TileBackgroundPassParameters};
@@ -52,7 +52,7 @@ uint z = zLow | (zHigh << 4u);
52
52
  return vec3(float(x), float(y), float(z));
53
53
  }`),e.code.add(a`vec3 unpackCameraRelativeGaussianPosition(uvec4 packedHeader, highp vec3 position, vec3 cameraPosition, vec3 cameraPos8k, vec3 cameraDelta) {
54
54
  vec3 tileOrigin = uintBitsToFloat(packedHeader.xyz);
55
- float invPosScale = 1.0 / exp2(float(packedHeader.w & 0xffu));
55
+ float invPosScale = 1.0 / exp2(float(packedHeader.w & 0xfu));
56
56
  vec3 delta = tileOrigin.xyz - cameraPos8k;
57
57
  vec3 cameraRelativePosition = position.xyz * invPosScale + delta * 2.048 - cameraDelta;
58
58
  return cameraRelativePosition;
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/shaderLibrary/output/ReadDepth.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/FloatsPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/IntegerPassUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./GlowPresets.glsl.js";import"../raymarching/RayDistanceFalloff.glsl.js";import"../../shaders/ScreenSpacePassAtmosphere.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlowCompositionPassParameters,b as build}from"../../../../../chunks/GlowComposition.glsl.js";
5
+ import"../../core/shaderLibrary/output/ReadDepth.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/FloatsPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/IntegerPassUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../raymarching/RayDistanceFalloff.glsl.js";import"../../shaders/ScreenSpacePassAtmosphere.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlowCompositionPassParameters,a as GlowLodFactors,c as build}from"../../../../../chunks/GlowComposition.glsl.js";