@arcgis/core 5.0.0-next.36 → 5.0.0-next.38

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 (270) hide show
  1. package/WebLinkChart.js +1 -1
  2. package/analysis/ShadowCast/types.d.ts +2 -0
  3. package/applications/Components/analysisUtils.d.ts +1 -0
  4. package/applications/Components/analysisUtils.js +1 -1
  5. package/applications/Components/testUtils.d.ts +4 -0
  6. package/applications/Components/testUtils.js +5 -0
  7. package/arcade/arcadeAsyncRuntime.js +1 -1
  8. package/arcade/arcadeCompiler.js +1 -1
  9. package/arcade/featureSetUtils.js +1 -1
  10. package/arcade/featureset/actions/Adapted.js +1 -1
  11. package/arcade/featureset/actions/AttributeFilter.js +1 -1
  12. package/arcade/featureset/actions/GroupBy.js +1 -1
  13. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  14. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  15. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  16. package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
  17. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  18. package/arcade/featureset/support/FeatureSet.js +1 -1
  19. package/arcade/featureset/support/FeatureSetIterator.js +1 -1
  20. package/assets/esri/core/workers/RemoteClient.js +1 -1
  21. package/assets/esri/core/workers/chunks/014dbe6fa93a277b08f7.js +1 -0
  22. package/assets/esri/core/workers/chunks/{51355866a0dcf41cfded.js → 0a5427127634738aa239.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{c7c721de93bc8688e13c.js → 1d4ea8db272655c0608c.js} +1 -1
  24. package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +1 -0
  25. package/assets/esri/core/workers/chunks/1de216d9850c39c1735d.js +1 -0
  26. package/assets/esri/core/workers/chunks/262232437d37a7460b11.js +1 -0
  27. package/assets/esri/core/workers/chunks/2795e491f803654413d2.js +1 -0
  28. package/assets/esri/core/workers/chunks/2f9129003f77bfeab2f9.js +1 -0
  29. package/assets/esri/core/workers/chunks/{1817cf11e85afca947d3.js → 328106e181e5957ceaa5.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{d3db7244fac7398cc700.js → 4b6a44c6265c8959abd8.js} +1 -1
  31. package/assets/esri/core/workers/chunks/50ffb22c48fadd36c748.js +1 -0
  32. package/assets/esri/core/workers/chunks/{f1ac1c8b1331ec79e898.js → 59ce992d3a5e7c32b9fb.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{8a946cbc816f373c136b.js → 5e30acfda04f7fc2b676.js} +1 -1
  34. package/assets/esri/core/workers/chunks/6330d8767ba1d5329daa.js +1 -0
  35. package/assets/esri/core/workers/chunks/{3f03165487c1c2340fff.js → 690a40d2eef52bfc149f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{dd34d56caafa38d4b8e4.js → 7aa730e5ac7b268e3c98.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{b451dc416eebd0931ef8.js → 7ab237d19b84d89ff483.js} +7 -7
  38. package/assets/esri/core/workers/chunks/{1fa55d4c4b092a98bdd7.js → b56c07c0b43cb1999070.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{bfb9cbe59d36d18f9157.js → cda5c95fd49b8901f7d4.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{c9e7cc5d853908ab5b2f.js → ce99abfdcd71ff9e4e36.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{726a797f5df7eeee0b3d.js → d786b17cc9062b1450ac.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{52c8687b473c9953c2f2.js → d9958654c6438f28237b.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{2e76fbd3c874300fc4a7.js → de3da4d31a7529761565.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{eb6218634a492667506a.js → e501d68a1464805c4b4e.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{33431e8131f6017de2f9.js → e7f4d135ef9665de1468.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{d8623f5f13a084e439c2.js → e9bc3c6482ba778c9349.js} +37 -37
  47. package/assets/esri/core/workers/chunks/{7420fa18ba12014b22ea.js → ee67c8a7c1f8b482cd99.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{abb05a903440d97a6a74.js → f441fc74451330384fb0.js} +1 -1
  49. package/assets/esri/core/workers/chunks/f609b256df9eb3803464.js +1 -0
  50. package/assets/esri/core/workers/chunks/f97a7cb367634353177d.js +1 -0
  51. package/chunks/CloudsComposition.glsl.js +1 -1
  52. package/chunks/ComponentShader.glsl.js +2 -2
  53. package/chunks/DefaultMaterial.glsl.js +1 -1
  54. package/chunks/GaussianSplat.glsl.js +2 -2
  55. package/chunks/Laserlines.glsl.js +1 -1
  56. package/chunks/Path.glsl.js +1 -1
  57. package/chunks/RealisticTree.glsl.js +1 -1
  58. package/chunks/Terrain.glsl.js +34 -36
  59. package/chunks/WaterSurface.glsl.js +1 -1
  60. package/chunks/boundedPlane.js +1 -1
  61. package/chunks/cameraUtilsSpherical.js +1 -1
  62. package/chunks/vec32.js +1 -1
  63. package/config.js +1 -1
  64. package/core/has.js +1 -1
  65. package/core/iteratorUtils.js +1 -1
  66. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  67. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  68. package/geometry/support/buffer/BufferView.js +1 -1
  69. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  70. package/geometry/support/lineSegment.js +1 -1
  71. package/geometry/support/meshUtils/merge.js +1 -1
  72. package/geometry/support/sphere.js +1 -1
  73. package/interfaces.d.ts +59 -5
  74. package/kernel.js +1 -1
  75. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  76. package/layers/VoxelWasmPerSceneView.js +1 -1
  77. package/layers/knowledgeGraph/layerUtils.js +1 -1
  78. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  79. package/layers/support/csvUtils.js +1 -1
  80. package/layers/video/VideoController.js +1 -1
  81. package/layers/voxel/VoxelVolume.js +1 -1
  82. package/package.json +5 -5
  83. package/support/revision.js +1 -1
  84. package/support/tests/meshUtils.js +5 -0
  85. package/support/tests/serviceMockDependencies.js +5 -0
  86. package/support/tests/setupServiceMocksMesh.js +5 -0
  87. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  88. package/views/2d/interactive/SegmentLabels2D.js +1 -1
  89. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  90. package/views/3d/FocusAreasView.js +1 -1
  91. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  92. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  93. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  94. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  95. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
  96. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
  97. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  98. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  99. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  100. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  101. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  102. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
  103. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  104. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
  105. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  106. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  107. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  108. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  109. package/views/3d/camera/constraintUtils/distance.js +1 -1
  110. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  111. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  112. package/views/3d/environment/CloudsParameters.js +1 -1
  113. package/views/3d/environment/EnvironmentManager.js +1 -1
  114. package/views/3d/environment/MarsAtmosphere.js +1 -1
  115. package/views/3d/interactive/SegmentLabels3D.js +1 -1
  116. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  117. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  118. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  119. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  120. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  121. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  122. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  123. package/views/3d/layers/FlowSubView3D.js +1 -1
  124. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  125. package/views/3d/layers/I3SMeshView3D.js +1 -1
  126. package/views/3d/layers/ImagerySubView3D.js +1 -1
  127. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  128. package/views/3d/layers/PointCloudWorker.js +1 -1
  129. package/views/3d/layers/RouteLayerView3D.js +1 -1
  130. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  132. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  133. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  134. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  135. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  136. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  137. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  138. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  139. package/views/3d/state/Frustum.js +1 -1
  140. package/views/3d/state/ViewStateManager.js +1 -1
  141. package/views/3d/state/controllers/FovController.js +1 -1
  142. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  143. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  144. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  145. package/views/3d/support/cameraUtils.js +1 -1
  146. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  147. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  148. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  149. package/views/3d/support/intersectionUtils.js +1 -1
  150. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  151. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  152. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  153. package/views/3d/support/viewpointUtils.js +1 -1
  154. package/views/3d/terrain/OverlayManager.js +1 -1
  155. package/views/3d/terrain/OverlayRenderer.js +1 -1
  156. package/views/3d/terrain/PatchRenderData.js +1 -1
  157. package/views/3d/terrain/SphericalPatch.js +1 -1
  158. package/views/3d/terrain/TerrainRenderer.js +1 -1
  159. package/views/3d/terrain/TerrainSurface.js +1 -1
  160. package/views/3d/terrain/Tile.js +1 -1
  161. package/views/3d/terrain/TileCompositor.js +1 -1
  162. package/views/3d/webgl/RenderCamera.js +1 -1
  163. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  164. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  165. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  166. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  167. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +4 -7
  168. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +4 -4
  169. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +1 -1
  170. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +6 -6
  171. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +4 -4
  172. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +19 -15
  173. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
  174. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  175. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +5 -5
  176. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +14 -14
  177. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +16 -37
  178. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +8 -8
  179. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  180. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  181. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  182. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  183. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  184. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  185. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  186. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  187. package/views/3d/webgl-engine/lib/Normals.js +1 -1
  188. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  189. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  190. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  191. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  192. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  193. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  194. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +5 -0
  195. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
  196. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
  197. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayoutField.js +5 -0
  198. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +5 -0
  199. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  200. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  201. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  202. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  203. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  204. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  205. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  206. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  207. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  208. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  209. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  210. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  211. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  212. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  213. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  214. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  215. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  216. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  217. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  218. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  219. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  220. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  221. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  222. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  223. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  224. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  225. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  226. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  227. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  228. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +9 -10
  229. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  230. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  231. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  232. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  233. package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
  234. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  235. package/views/BreakpointsOwner.js +1 -1
  236. package/views/GroundView.js +1 -1
  237. package/views/SceneView.js +1 -1
  238. package/views/ToolViewManager.js +1 -1
  239. package/views/analysis/ElevationProfile/elevationProfileVisualizationUtils.js +1 -1
  240. package/views/interactive/GraphicManipulator.js +1 -1
  241. package/views/interactive/InteractiveToolBase.js +1 -1
  242. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  243. package/views/interactive/coordinateHelper.js +1 -1
  244. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  245. package/views/interactive/sketch/constraints.js +1 -1
  246. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  247. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  248. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  249. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  250. package/views/layers/LayerView.js +1 -1
  251. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  252. package/views/support/LayerViewManager.js +1 -1
  253. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  254. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  255. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  256. package/views/support/geometry3dUtils.js +1 -1
  257. package/webmap/utils.js +1 -1
  258. package/widgets/Sketch/SketchViewModel.js +1 -1
  259. package/widgets/Slider.js +1 -1
  260. package/assets/esri/core/workers/chunks/11687718c8635eb7bf37.js +0 -1
  261. package/assets/esri/core/workers/chunks/15c1a48e8cd2a8882d85.js +0 -1
  262. package/assets/esri/core/workers/chunks/1b9e7d416c9f00e020bb.js +0 -1
  263. package/assets/esri/core/workers/chunks/24a3c6f0154787968724.js +0 -1
  264. package/assets/esri/core/workers/chunks/5000a37fba27464d10ca.js +0 -1
  265. package/assets/esri/core/workers/chunks/951a3442d4342539f2ea.js +0 -1
  266. package/assets/esri/core/workers/chunks/b075d3714fab0591d67c.js +0 -1
  267. package/assets/esri/core/workers/chunks/d8975dd7b85b5d065ee4.js +0 -1
  268. package/assets/esri/core/workers/chunks/e0a74250d22fa1d7dc18.js +0 -1
  269. package/assets/esri/core/workers/chunks/f43e1e1a1b2eb737e00c.js +0 -1
  270. package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +0 -26
@@ -2,17 +2,21 @@
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{glsl as c}from"../../shaderModules/glsl.js";function o(o,l){const b=l.blendMode;0!==b&&(30===b&&o.code.add(c`float reflectBlend(in float cb, in float cl) {
5
+ import"../../../../../../core/has.js";import{glsl as c}from"../../shaderModules/glsl.js";function o(o,e){const b=e.blendMode;switch(b){case 0:return;case 30:o.code.add(c`float reflectBlend(in float cb, in float cl) {
6
6
  return (cl == 1.0) ? cl : min(cb * cb / (1.0 - cl), 1.0);
7
- }`),6!==b&&13!==b||o.code.add(c`float colorDodge(in float cb, in float cl) {
7
+ }`);break;case 6:case 9:case 13:o.code.add(c`float colorDodge(in float cb, in float cl) {
8
8
  return (cb == 0.0) ? 0.0 : (cl == 1.0) ? 1.0 : min(1.0, cb / (1.0 - cl));
9
- }`),9!==b&&13!==b||o.code.add(c`float colorBurn(in float cb, in float cl) {
9
+ }
10
+ float colorBurn(in float cb, in float cl) {
10
11
  return (cb == 1.0) ? 1.0 : (cl == 0.0) ? 0.0 : 1.0 - min(1.0, (1.0 - cb) / cl);
11
- }`),10===b&&o.code.add(c`float overlay(in float cb, in float cl) {
12
+ }
13
+ float vividLight(in float cb, in float cl) {
14
+ return (1.0 - step(0.5, cl)) * colorBurn(cb, 2.0 * cl) + step(0.5, cl) * colorDodge(cb, (2.0 * (cl - 0.5)));
15
+ }`);break;case 10:o.code.add(c`float overlay(in float cb, in float cl) {
12
16
  return (1.0 - step(0.5, cl)) * (1.0 - 2.0 * (1.0 - cl ) * (1.0 - cb)) + step(0.5, cl) * (2.0 * cl * cb);
13
- }`),12===b&&o.code.add(c`float hardLight(in float cb, in float cl) {
17
+ }`);break;case 12:o.code.add(c`float hardLight(in float cb, in float cl) {
14
18
  return (1.0 - step(0.5, cl)) * (2.0 * cl * cb) + step(0.5, cl) * (1.0 - 2.0 * (1.0 - cl) * (1.0 - cb));
15
- }`),11===b&&o.code.add(c`float softLight(in float cb, in float cl) {
19
+ }`);break;case 11:o.code.add(c`float softLight(in float cb, in float cl) {
16
20
  if (cl <= 0.5) {
17
21
  return cb - (1.0 - 2.0 * cl) * cb * (1.0 - cb);
18
22
  }
@@ -20,9 +24,7 @@ if (cb <= 0.25) {
20
24
  return cb + (2.0 * cl - 1.0) * cb * ((16.0 * cb - 12.0) * cb + 3.0);
21
25
  }
22
26
  return cb + (2.0 * cl - 1.0) * (sqrt(cb) - cb);
23
- }`),13===b&&o.code.add(c`float vividLight(in float cb, in float cl) {
24
- return (1.0 - step(0.5, cl)) * colorBurn(cb, 2.0 * cl) + step(0.5, cl) * colorDodge(cb, (2.0 * (cl - 0.5)));
25
- }`),14!==b&&15!==b&&17!==b&&16!==b||(o.code.add(c`float minv3(in vec3 c) {
27
+ }`);break;case 14:case 15:case 17:case 16:o.code.add(c`float minv3(in vec3 c) {
26
28
  return min(min(c.r, c.g), c.b);
27
29
  }
28
30
  float maxv3(in vec3 c) {
@@ -45,7 +47,8 @@ return color;
45
47
  }
46
48
  vec3 setLum(vec3 cbase, vec3 clum) {
47
49
  return clipColor(cbase + vec3(lumv3(clum) - lumv3(cbase)));
48
- }`),14!==b&&15!==b||o.code.add(c`float satv3(vec3 c) {
50
+ }
51
+ float satv3(vec3 c) {
49
52
  return maxv3(c) - minv3(c);
50
53
  }
51
54
  vec3 setLumSat(vec3 cbase, vec3 csat, vec3 clum)
@@ -54,32 +57,8 @@ float minbase = minv3(cbase);
54
57
  float sbase = satv3(cbase);
55
58
  float ssat = satv3(csat);
56
59
  return setLum(sbase > 0.0 ? (cbase - minbase) * ssat / sbase : vec3(0.0), clum);
57
- }`)),o.code.add(c`
60
+ }`)}o.code.add(c`
58
61
  vec4 applyBlendMode(vec3 cl, float ol, vec3 cb, float ob) {
59
- ${8===b?c`return vec4(cl * ol * cb * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:1===b?c`return vec4((cb + cl) * 0.5 * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:2===b?c`return vec4(max(cb, cl) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:7===b?c`return vec4(min(cl, cb) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:3===b?c`return vec4(cl * ol + cb * ob, ol + ob);`:4===b?c`return clamp(vec4(cl.rgb + cb.rgb, ol + ob), 0.0, 1.0);`:28===b?c`return vec4(clamp(vec3(cb.rgb - cl.rgb), 0.0, 1.0), ob * ol);`:5===b?c`return vec4((cl + cb - cl * cb) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:26===b?c`return vec4(abs(cb - cl) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:29===b?c`return vec4((1.0 - cb) * ol * ob + cb * ob * (1.0 - ol), ob);`:18===b?c`return vec4(cl * ol * (1.0 - ob) + cb * ob, ol + ob - ol * ob);`:19===b?c`return vec4(cl * ol * (1.0 - ob) + cb * ob * ol, ol);`:21===b?c`return vec4(cb * ob * (1.0 - ol), ob * (1.0 - ol));`:22===b?c`return vec4(cl * ol * ob + cb * ob * (1.0 - ol), ob);`:24===b?c`return vec4(cl * ol * (1.0 - ob), ol * (1.0 - ob));`:25===b?c`return vec4(cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), ol * (1.0 - ob) + ob * (1.0 - ol));`:20===b?c`return vec4(cb * ob * ol, ol * ob);`:23===b?c`return vec4(cl * ol * ob, ol * ob);`:14===b?c`
60
- vec3 f = setLumSat(cl, cb, cb);
61
- return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:15===b?c`
62
- vec3 f = setLumSat(cb, cl, cb);
63
- return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:17===b?c`
64
- vec3 f = setLum(cl, cb);
65
- return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:16===b?c`
66
- vec3 f = setLum(cb, cl);
67
- return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:27===b?c`
68
- vec3 f = cl + cb - 2.0 * cl * cb;
69
- return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:30===b?c`
70
- vec3 f = vec3(reflectBlend(cb.r, cl.r), reflectBlend(cb.g, cl.g), reflectBlend(cb.b, cl.b));
71
- return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:6===b?c`
72
- vec3 f = vec3(colorDodge(cb.r, cl.r), colorDodge(cb.g, cl.g), colorDodge(cb.b, cl.b));
73
- return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:9===b?c`
74
- vec3 f = vec3(colorBurn(cb.r, cl.r), colorBurn(cb.g, cl.g), colorBurn(cb.b, cl.b));
75
- return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:10===b?c`
76
- vec3 f = vec3(overlay(cb.r, cl.r), overlay(cb.g, cl.g), overlay(cb.b, cl.b));
77
- return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:11===b?c`
78
- vec3 f = vec3(softLight(cb.r, cl.r), softLight(cb.g, cl.g), softLight(cb.b, cl.b));
79
- return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:12===b?c`
80
- vec3 f = vec3(hardLight(cb.r, cl.r), hardLight(cb.g, cl.g), hardLight(cb.b, cl.b));
81
- return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:13===b?c`
82
- vec3 f = vec3(vividLight(cb.r, cl.r), vividLight(cb.g, cl.g), vividLight(cb.b, cl.b));
83
- return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:c``}
62
+ ${l(b)}
84
63
  }
85
- `))}export{o as BlendModes};
64
+ `)}function l(c){switch(c){case 8:return"return vec4(cl * ol * cb * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 1:return"return vec4((cb + cl) * 0.5 * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 2:return"return vec4(max(cb, cl) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 7:return"return vec4(min(cl, cb) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 3:return"return vec4(cl * ol + cb * ob, ol + ob);";case 4:return"return clamp(vec4(cl.rgb + cb.rgb, ol + ob), 0.0, 1.0);";case 28:return"return vec4(clamp(vec3(cb.rgb - cl.rgb), 0.0, 1.0), ob * ol);";case 5:return"return vec4((cl + cb - cl * cb) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 26:return"return vec4(abs(cb - cl) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 29:return"return vec4((1.0 - cb) * ol * ob + cb * ob * (1.0 - ol), ob);";case 18:return"return vec4(cl * ol * (1.0 - ob) + cb * ob, ol + ob - ol * ob);";case 19:return"return vec4(cl * ol * (1.0 - ob) + cb * ob * ol, ol);";case 21:return"return vec4(cb * ob * (1.0 - ol), ob * (1.0 - ol));";case 22:return"return vec4(cl * ol * ob + cb * ob * (1.0 - ol), ob);";case 24:return"return vec4(cl * ol * (1.0 - ob), ol * (1.0 - ob));";case 25:return"return vec4(cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), ol * (1.0 - ob) + ob * (1.0 - ol));";case 20:return"return vec4(cb * ob * ol, ol * ob);";case 23:return"return vec4(cl * ol * ob, ol * ob);";case 14:return"\n vec3 f = setLumSat(cl, cb, cb);\n return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 15:return"\n vec3 f = setLumSat(cb, cl, cb);\n return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 17:return"\n vec3 f = setLum(cl, cb);\n return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 16:return"\n vec3 f = setLum(cb, cl);\n return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 27:return"\n vec3 f = cl + cb - 2.0 * cl * cb;\n return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 30:return"\n vec3 f = vec3(reflectBlend(cb.r, cl.r), reflectBlend(cb.g, cl.g), reflectBlend(cb.b, cl.b));\n return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 6:return"\n vec3 f = vec3(colorDodge(cb.r, cl.r), colorDodge(cb.g, cl.g), colorDodge(cb.b, cl.b));\n return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 9:return"\n vec3 f = vec3(colorBurn(cb.r, cl.r), colorBurn(cb.g, cl.g), colorBurn(cb.b, cl.b));\n return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 10:return"\n vec3 f = vec3(overlay(cb.r, cl.r), overlay(cb.g, cl.g), overlay(cb.b, cl.b));\n return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 11:return"\n vec3 f = vec3(softLight(cb.r, cl.r), softLight(cb.g, cl.g), softLight(cb.b, cl.b));\n return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 12:return"\n vec3 f = vec3(hardLight(cb.r, cl.r), hardLight(cb.g, cl.g), hardLight(cb.b, cl.b));\n return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));";case 13:return"\n vec3 f = vec3(vividLight(cb.r, cl.r), vividLight(cb.g, cl.g), vividLight(cb.b, cl.b));\n return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));"}return"return cl * ol + cb * ob"}export{o as BlendModes};
@@ -2,21 +2,21 @@
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{glsl as a}from"../../shaderModules/glsl.js";function e(e){e.code.add(a`vec4 unpackColor(uvec4 packedGaussian) {
5
+ import{create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Float3PassUniform as e}from"../../shaderModules/Float3PassUniform.js";import{glsl as i}from"../../shaderModules/glsl.js";import{NoParameters as t}from"../../../../../webgl/NoParameters.js";class o extends t{constructor(){super(...arguments),this.tileCameraPosition=a(),this.cameraDelta=a()}}function n(a){a.code.add(i`vec4 unpackColor(uvec4 packedGaussian) {
6
6
  vec4 color;
7
7
  color.r = float((packedGaussian.w >> 1u) & 0xfeu);
8
8
  color.g = float((packedGaussian.w >> 9u) & 0xffu);
9
9
  color.b = float((packedGaussian.w >> 16u) & 0xfeu);
10
10
  color.a = float((packedGaussian.w >> 24u) & 0xffu);
11
11
  return color / 255.0;
12
- }`),e.code.add(a`vec3 unpackScale(uvec4 packedGaussian) {
12
+ }`),a.code.add(i`vec3 unpackScale(uvec4 packedGaussian) {
13
13
  uint sx = (packedGaussian.z >> 10u) & 0xffu;
14
14
  uint sy = (packedGaussian.z >> 18u) & 0xffu;
15
15
  uint szLow = (packedGaussian.z >> 26u) & 0x3fu;
16
16
  uint szHigh = packedGaussian.a & 0x3u;
17
17
  uint sz = szLow | (szHigh << 6u);
18
18
  return exp(vec3(sx, sy, sz) / 16.0 - 10.0);
19
- }`),e.code.add(a`const uint MASK_9_BITS = 0x1FFu;
19
+ }`),a.code.add(i`const uint MASK_9_BITS = 0x1FFu;
20
20
  const float SQRT_HALF = 0.7071067811865476;
21
21
  const ivec3 COMPONENT_ORDER[4] = ivec3[4](
22
22
  ivec3(3, 2, 1),
@@ -41,7 +41,7 @@ sumSquares += value * value;
41
41
  }
42
42
  quaternion[int(largestComponent)] = sqrt(1.0 - sumSquares);
43
43
  return quaternion;
44
- }`),e.code.add(a`vec3 unpackTileOriginRelativePosition(uvec4 packedGaussian) {
44
+ }`),a.code.add(i`vec3 unpackTileOriginRelativePosition(uvec4 packedGaussian) {
45
45
  uint packedPositionLow = packedGaussian.y;
46
46
  uint packedPositionHigh = packedGaussian.z;
47
47
  uint x = packedPositionLow & 0x3FFFu;
@@ -50,10 +50,10 @@ uint zLow = (packedPositionLow >> 28u) & 0xFu;
50
50
  uint zHigh = packedPositionHigh & 0x3FFu;
51
51
  uint z = zLow | (zHigh << 4u);
52
52
  return vec3(float(x), float(y), float(z));
53
- }`),e.code.add(a`vec3 unpackCameraRelativeGaussianPosition(uvec4 packedHeader, highp vec3 position, vec3 cameraPosition, vec3 cameraPos8k, vec3 cameraDelta) {
53
+ }`),a.uniforms.add(new e("tileCameraPosition",a=>a.tileCameraPosition),new e("cameraDelta",a=>a.cameraDelta)).code.add(i`vec3 unpackCameraRelativeGaussianPosition(uvec4 packedHeader, highp vec3 position) {
54
54
  vec3 tileOrigin = uintBitsToFloat(packedHeader.xyz);
55
55
  float invPosScale = 1.0 / exp2(float(packedHeader.w & 0xfu));
56
- vec3 delta = tileOrigin.xyz - cameraPos8k;
57
- vec3 cameraRelativePosition = position.xyz * invPosScale + delta * 2.048 - cameraDelta;
56
+ vec3 delta = tileOrigin.xyz - tileCameraPosition;
57
+ vec3 cameraRelativePosition = position * invPosScale + delta * 2.048 - cameraDelta;
58
58
  return cameraRelativePosition;
59
- }`)}export{e as GaussianSplatUnpacking};
59
+ }`)}export{n as GaussianSplatUnpacking,o as GaussianSplatUnpackingPassParameters};
@@ -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{removeUnordered as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{isPromiseLike as t,createAbortError as r}from"../../../../core/promiseUtils.js";import{signal as s}from"../../../../core/signal.js";import{DepthRange as n}from"../lib/DepthRange.js";class i{constructor(e){this.context=e,this._renderPlugins=new Array,this._slots=new Array,this._version=s(0);for(let t=0;t<21;++t)this._slots[t]=[]}destroy(){this._renderPlugins.forEach(e=>e.destroy()),this._renderPlugins.length=0}get plugins(){return this._renderPlugins}add(e,s){const n=()=>{if(s?.aborted)throw e.uninitializeRenderContext(),r();this._renderPlugins.push(e),e.produces.forEach((t,r)=>this._slots[r].push(e)),this.context.requestRender(),this._version.value++},i=e.initializeRenderContext(this.context,s);if(t(i))return i.then(n);n()}remove(t){e(this._renderPlugins,t),t.uninitializeRenderContext();for(let e=0;e<this._slots.length;++e)this._slots[e]=this._slots[e].filter(e=>e!==t);this.context.requestRender(),this._version.value++}prepareRender(){this._renderPlugins.forEach(e=>{e.prepareRender&&e.prepareRender(this.context.renderContext)})}updateAnimation(e){let t=!1;return this._renderPlugins.forEach(r=>t=r.updateAnimation?.(e)||t),t}precompile(...e){++this.context.techniques.precompiling;const t=this.context.renderContext.bind.slot;for(const r of e)this.context.renderContext.bind.slot=r,this._forEachRender(()=>{});this.context.renderContext.bind.slot=t,--this.context.techniques.precompiling}render(...e){for(const t of e)this.context.renderContext.bind.slot=t,this._forEachRender((e,t)=>e.render(this.context.renderContext,t))}_forEachRender(e){const t=this.context.renderContext.bind.slot,r=this.context.renderContext.output;this._slots[t].forEach(s=>{const n=s.produces.get(t);if(!n?.(r)||s.isDecoration&&!this.context.renderContext.bind.decorations)return;const i=s.acquireTechniques(this.context.renderContext);i&&e(s,i)})}queryDepthRange(e){return this._renderPlugins.reduce((t,r)=>t.union(r.queryDepthRange?.(e)),new n)}get updating(){return this._version.value>=0&&this._renderPlugins.some(e=>e.readyToRun)}produces(e,...t){return t.some(t=>this._slots[t].some(r=>{const s=r.produces.get(t);return!!s&&s(e)}))}consumes(e){return this._renderPlugins.some(t=>t.consumes().required.includes(e))}hasHighlight(e){return o.some(t=>this._slots[t].some(t=>t.hasHighlight(e)))}get hasDecorations(){return this._renderPlugins.some(e=>e.isDecoration)}get hasOccludees(){return this._renderPlugins.some(e=>e.hasOccludees)}get hasEmitters(){return this._renderPlugins.some(e=>e.hasEmitters)}get renderOccludedFlags(){return this._renderPlugins.reduce((e,t)=>e|(t.renderOccludedFlags??0),0)}get usedMemory(){return this._renderPlugins.reduce((e,t)=>t.material?e:e+(t.usedMemory??0),0)}get test(){}}const o=[2,4,18,13,14];export{i as RenderPluginManager};
5
+ import{removeUnordered as e}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{isPromiseLike as t,createAbortError as r}from"../../../../core/promiseUtils.js";import{signal as s}from"../../../../core/signal.js";import{DepthRange as n}from"../lib/DepthRange.js";class i{constructor(e){this.context=e,this._renderPlugins=new Array,this._slots=new Array,this._version=s(0);for(let t=0;t<22;++t)this._slots[t]=[]}destroy(){this._renderPlugins.forEach(e=>e.destroy()),this._renderPlugins.length=0}get plugins(){return this._renderPlugins}add(e,s){const n=()=>{if(s?.aborted)throw e.uninitializeRenderContext(),r();this._renderPlugins.push(e),e.produces.forEach((t,r)=>this._slots[r].push(e)),this.context.requestRender(),this._version.value++},i=e.initializeRenderContext(this.context,s);if(t(i))return i.then(n);n()}remove(t){e(this._renderPlugins,t),t.uninitializeRenderContext();for(let e=0;e<this._slots.length;++e)this._slots[e]=this._slots[e].filter(e=>e!==t);this.context.requestRender(),this._version.value++}prepareRender(){this._renderPlugins.forEach(e=>{e.prepareRender&&e.prepareRender(this.context.renderContext)})}updateAnimation(e){let t=!1;return this._renderPlugins.forEach(r=>t=r.updateAnimation?.(e)||t),t}precompile(...e){++this.context.techniques.precompiling;const t=this.context.renderContext.bind.slot;for(const r of e)this.context.renderContext.bind.slot=r,this._forEachRender(()=>{});this.context.renderContext.bind.slot=t,--this.context.techniques.precompiling}render(...e){for(const t of e)this.context.renderContext.bind.slot=t,this._forEachRender((e,t)=>e.render(this.context.renderContext,t))}_forEachRender(e){const t=this.context.renderContext.bind.slot,r=this.context.renderContext.output;this._slots[t].forEach(s=>{const n=s.produces.get(t);if(!n?.(r)||s.isDecoration&&!this.context.renderContext.bind.decorations)return;const i=s.acquireTechniques(this.context.renderContext);i&&e(s,i)})}queryDepthRange(e){return this._renderPlugins.reduce((t,r)=>t.union(r.queryDepthRange?.(e)),new n)}get updating(){return this._version.value>=0&&this._renderPlugins.some(e=>e.readyToRun)}produces(e,...t){return t.some(t=>this._slots[t].some(r=>{const s=r.produces.get(t);return!!s&&s(e)}))}consumes(e){return this._renderPlugins.some(t=>t.consumes().required.includes(e))}hasHighlight(e){return o.some(t=>this._slots[t].some(t=>t.hasHighlight(e)))}get hasDecorations(){return this._renderPlugins.some(e=>e.isDecoration)}get hasOccludees(){return this._renderPlugins.some(e=>e.hasOccludees)}get hasEmitters(){return this._renderPlugins.some(e=>e.hasEmitters)}get renderOccludedFlags(){return this._renderPlugins.reduce((e,t)=>e|(t.renderOccludedFlags??0),0)}get usedMemory(){return this._renderPlugins.reduce((e,t)=>t.material?e:e+(t.usedMemory??0),0)}get test(){}}const o=[2,4,19,14,15];export{i as RenderPluginManager};
@@ -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{__decorate as e}from"tslib";import{property as r,subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderCategory as n}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{If as a,glsl as s}from"../../core/shaderModules/glsl.js";import{Pos2Locations as c}from"../../lib/DefaultVertexBufferLayouts.js";import{checkWebGLError as l}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as u,SizedPixelFormat as h,DataType as p}from"../../../../webgl/enums.js";let f=class extends i{constructor(e){super(e),this.destroyedCB=null,this.produces=n.FINAL,this.consumes={required:[n.FINAL]},this.clearColor=o,this._focusedFBOType=7,this._program=new Map}destroy(){this._program.forEach(e=>e.dispose()),this._program.clear(),this.destroyedCB()}render(e){const r=e.find(({name:e})=>e===n.FINAL);if(!this._focusedFBO)return r;const t=this.renderingContext;t.bindFramebuffer(r.fbo),t.setClearColor(0,0,0,0),t.clear(16384);const o=this._focusedFBO.getTexture(),i=[m(o)],a=this._ensureProgram(t,!1,i);return t.useProgram(a),t.bindTexture(o,0),a.setUniform1i("colorTex0",0),a.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&a.setUniform2fv("nearFar",this.camera.nearFar),t.screen.draw(),r}getDownscaledFBO(e,r,t,o,n){0===r&&(o=e.width,n=e.height);const i=e.colorAttachments.length,a=[],s=new Array;for(let l=0;l<i;++l){const r=e.getColorTexture(u+l);if(r){const e=m(r);a.push(e);const{descriptor:t}=r;"float"!==e||t.hasMipmap||t.isImmutable||(r.generateMipmap(),s[l]=!0)}}const c=this.renderingContext,{depthStencilTexture:p}=e,f=this._ensureProgram(c,null!=p,a),d=this.fboCache.acquire(o,n,"fbo visualizer");c.useProgram(f),c.bindFramebuffer(d.fbo);const g=[];for(let l=0;l<i;++l){const r=u+l,t=`colorTex${l.toFixed()}`;c.bindTexture(e.getColorTexture(r),l),f.setUniform1i(t,l),l>0&&d.acquireColor(r,5,"fbo visualizer"),g.push(r)}const v=p?.descriptor.linearFilterDepth??!1;if(p){const e=i;p.setShadowFiltering(!1),c.bindTexture(p,e),f.setUniform1i("depthTex",e);const r=u+e;r>u&&d.acquireColor(r,5,"fbo visualizer"),g.push(r)}c.gl.drawBuffers(g),l(c.gl);const x=c.getViewport();c.setViewport(0,0,o,n),c.setClearColor(0,0,0,0),c.clear(16384),c.setBlendingEnabled(!0),c.setBlendFunction(1,771);const F="linear depth"===t||t.includes("shadow"),T="overlay highlight"===t||"highlights"===t||"highlight mix"===t,b="highlight coverage"===t,C=e.colorTexture?.descriptor,R=C?.internalFormat,B=F?0:T?1:b?2:R===h.R16F||R===h.R32F||R===h.R8?3:R===h.RG8?4:R===h.RGBA16F?5:R===h.RG8UI?6:7;f.setUniform1i("inputType",B),f.setUniform2fv("nearFar",this.camera.nearFar),c.screen.draw(),l(c.gl),c.bindFramebuffer(null),c.setViewport(x.x,x.y,x.width,x.height),0===r&&(this._focusedFBO=d,this._focusedFBOType=B);for(let l=0;l<i;++l)if(s[l]){const r=e.getColorTexture(u+l);r?.clearMipmap()}return p&&p.setShadowFiltering(v),d}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,t,o){const n=this.renderingContext,i=o.includes("\ndepth"),a=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(a?.fbo),n.setViewport(0,0,e,r),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const s=t.attachment,c=this._ensureProgram(n,!1,[m(s)]);n.useProgram(c),n.bindTexture(s,0),c.setUniform1i("colorTex0",0),c.setUniform1i("inputType",i||s.descriptor.internalFormat!==h.RGBA16F?7:5),n.screen.draw();const u=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,6408,p.UNSIGNED_BYTE,new Uint8Array(u.data.buffer)),l(n.gl),n.bindFramebuffer(null),a?.release(),u}_ensureProgram(e,r,t){const o=g({hasDepthAttachment:r,colorAttachmentTypes:t}),n=this._program.get(o);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",l=e=>{let r="";for(let t=0;t<e.length;++t){const o=e[t];r+=`layout(location = ${s.int(t)}) out vec4 fragColor${s.int(t)};\n uniform ${d(o)} colorTex${s.int(t)};`}return r},u=e=>{let r="";for(let t=1;t<e.length;++t){const o=e[t],n="float"===o?`vec4(texture(colorTex${t.toFixed()}, uv).rgb, 1.0)`:`texture(colorTex${t.toFixed()}, uv)`,i="float"===o?n:`vec4(vec2(${n}), 0.0, 1.0)`;r+=`fragColor${t.toFixed()} = ${i};`}return r},h=t.length,p=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${l(t)}\n ${a(r,`layout(location = ${s.int(h)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaTofloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaTofloat(depth));\n }\n\n ${"float"===t[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${a(t.length>0,s`
5
+ import{__decorate as e}from"tslib";import{property as r,subclass as t}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderCategory as n}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{If as a,glsl as s}from"../../core/shaderModules/glsl.js";import{Pos2Locations as c}from"../../lib/DefaultVertexBufferLayouts.js";import{checkWebGLError as l}from"../../../../webgl/checkWebGLError.js";import{ColorAttachment0 as u,SizedPixelFormat as h,DataType as p}from"../../../../webgl/enums.js";let f=class extends i{constructor(e){super(e),this.destroyedCB=null,this.produces=n.FINAL,this.consumes={required:[n.FINAL]},this.clearColor=o,this._focusedFBOType=7,this._program=new Map}destroy(){this._program.forEach(e=>e.dispose()),this._program.clear(),this.destroyedCB()}render(e){const r=e.find(({name:e})=>e===n.FINAL);if(!this._focusedFBO)return r;const t=this.renderingContext;t.bindFramebuffer(r.fbo),t.setClearColor(0,0,0,0),t.clear(16384);const o=this._focusedFBO.getTexture(),i=[m(o)],a=this._ensureProgram(t,!1,i);return t.useProgram(a),t.bindTexture(o,0),a.setUniform1i("colorTex0",0),a.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&a.setUniform2fv("nearFar",this.camera.nearFar),t.screen.draw(),r}getDownscaledFBO(e,r,t,o,n){0===r&&(o=e.width,n=e.height);const i=e.colorAttachments.length,a=[],s=new Array;for(let l=0;l<i;++l){const r=e.getColorTexture(u+l);if(r){const e=m(r);a.push(e);const{descriptor:t}=r;"float"!==e||t.hasMipmap||t.isImmutable||(r.generateMipmap(),s[l]=!0)}}const c=this.renderingContext,{depthStencilTexture:p}=e,f=this._ensureProgram(c,null!=p,a),d=this.fboCache.acquire(o,n,"fbo visualizer");c.useProgram(f),c.bindFramebuffer(d.fbo);const g=[];for(let l=0;l<i;++l){const r=u+l,t=`colorTex${l.toFixed()}`;c.bindTexture(e.getColorTexture(r),l),f.setUniform1i(t,l),l>0&&d.acquireColor(r,5,"fbo visualizer"),g.push(r)}const v=p?.descriptor.linearFilterDepth??!1;if(p){const e=i;p.setShadowFiltering(!1),c.bindTexture(p,e),f.setUniform1i("depthTex",e);const r=u+e;r>u&&d.acquireColor(r,5,"fbo visualizer"),g.push(r)}c.gl.drawBuffers(g),l(c.gl);const x=c.getViewport();c.setViewport(0,0,o,n),c.setClearColor(0,0,0,0),c.clear(16384),c.setBlendingEnabled(!0),c.setBlendFunction(1,771);const F="linear depth"===t||t.includes("shadow"),T="overlay highlight"===t||"highlights"===t||"highlight mix"===t,b="highlight coverage"===t,C=e.colorTexture?.descriptor,R=C?.internalFormat,B=F?0:T?1:b?2:R===h.R16F||R===h.R32F||R===h.R8?3:R===h.RG8?4:R===h.RGBA16F?5:R===h.RG8UI?6:7;f.setUniform1i("inputType",B),f.setUniform2fv("nearFar",this.camera.nearFar),c.screen.draw(),l(c.gl),c.bindFramebuffer(null),c.setViewport(x.x,x.y,x.width,x.height),0===r&&(this._focusedFBO=d,this._focusedFBOType=B);for(let l=0;l<i;++l)if(s[l]){const r=e.getColorTexture(u+l);r?.clearMipmap()}return p&&p.setShadowFiltering(v),d}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,t,o){const n=this.renderingContext,i=o.includes("\ndepth"),a=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(a?.fbo);const s=n.getViewport();n.setViewport(0,0,e,r),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(16384),n.setBlendingEnabled(!0),n.setBlendFunction(1,771);const c=t.attachment,u=this._ensureProgram(n,!1,[m(c)]);n.useProgram(u),n.bindTexture(c,0),u.setUniform1i("colorTex0",0),u.setUniform1i("inputType",i||c.descriptor.internalFormat!==h.RGBA16F?7:5),n.screen.draw();const f=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,6408,p.UNSIGNED_BYTE,new Uint8Array(f.data.buffer)),l(n.gl),n.bindFramebuffer(null),n.setViewport(s.x,s.y,s.width,s.height),a?.release(),f}_ensureProgram(e,r,t){const o=g({hasDepthAttachment:r,colorAttachmentTypes:t}),n=this._program.get(o);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",l=e=>{let r="";for(let t=0;t<e.length;++t){const o=e[t];r+=`layout(location = ${s.int(t)}) out vec4 fragColor${s.int(t)};\n uniform ${d(o)} colorTex${s.int(t)};`}return r},u=e=>{let r="";for(let t=1;t<e.length;++t){const o=e[t],n="float"===o?`vec4(texture(colorTex${t.toFixed()}, uv).rgb, 1.0)`:`texture(colorTex${t.toFixed()}, uv)`,i="float"===o?n:`vec4(vec2(${n}), 0.0, 1.0)`;r+=`fragColor${t.toFixed()} = ${i};`}return r},h=t.length,p=`#version 300 es\n precision highp float;\n precision highp usampler2D;\n\n in vec2 uv;\n ${l(t)}\n ${a(r,`layout(location = ${s.int(h)}) out vec4 fragDepth;\n uniform sampler2D depthTex;`)}\n\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaTofloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaTofloat(depth));\n }\n\n ${"float"===t[0]?"float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }":"float linearDepthFromTexture(usampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(vec4(texelFetch(depthTex, iuv, 0)) * 255.0);\n }"}\n\n void main() {\n ${a(t.length>0,s`
6
6
  if (inputType == ${3..toFixed()}) {
7
7
  fragColor0 = vec4(vec3(texture(colorTex0, uv).r), 1.0);
8
8
  } else if (inputType == ${4..toFixed()}) {
@@ -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 t from"../../../../../core/PooledArray.js";import{property as r,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as n}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{Blit as c}from"../blit/Blit.js";import{DepthStencilAttachment as d}from"../../../../webgl/enums.js";let l=class extends i{constructor(e){super(e),this.consumes={required:[n.OCCLUDED]},this.produces=n.OCCLUDED,this._blit=new c(e.view.stage.renderView.techniques,2)}precompile(){const e=this.view.stage.renderer;e.plugins.plugins.forEach(t=>{e.precompileSlots(t,9,11),t.material&&e.precompileOccludedSlots(t,h)})}render(e){const t=e.find(({name:e})=>e===this.produces);return this._renderOccludedAndTransparentStencil(t),this._renderOccludedComposite(t),t}_renderOccludedAndTransparentStencil(e){const t=this.view.stage.renderer,r=a;r.clear();for(const s of t.plugins.plugins)8&s.renderOccludedFlags&&r.push(s);0!==r.length&&(t.renderSlots(r,10),this._renderAndComposite(e,e.getAttachment(d),.5,()=>t.renderSlots(r,11),!1,!1),r.clear())}_renderOccludedComposite(e){const t=this.view.stage.renderer,r=a;r.clear();let s=0;for(const i of t.plugins.plugins){const e=i.renderOccludedFlags&u;s|=e,e&&r.push(i)}if(!s)return void r.clear();const o=this._getDepthStencilAttachment(e);let n=o.clearStencil;for(const i of h)s&i&&(this._renderAndComposite(e,o.depth,16===i?1:.5,()=>t.renderOccludedSlots(r,i),!0,n),n=!1);o.release(),r.clear()}_renderAndComposite(e,t,r,s,n,i){const c=this.renderingContext,{width:d,height:l}=e.fbo,a=this.fboCache.acquire(d,l,"tmp color");a.attachDepth(t),c.bindFramebuffer(a.fbo),c.clearFramebuffer(o,n,i),s(),a.detachDepth(),this._blit.blend(c,a,e,this.bindParameters,r),a.release()}_getDepthStencilAttachment(e){const{width:t,height:r}=e.fbo;if(!this.view.stage.renderer.occludedRequiresIntegratedMeshStencil){const e=this.fboCache.acquireDepth(13,t,r,"retained stencil");return{depth:e,release:()=>e.release(),clearStencil:!0}}const s=this.fboCache.acquire(t,r,"retained stencil",13);return this.renderingContext.blitFramebuffer(e.fbo,s.fbo,1024),{depth:s.getAttachment(d),release:()=>s.release(),clearStencil:!1}}};e([r()],l.prototype,"consumes",void 0),e([r()],l.prototype,"produces",void 0),l=e([s("esri.views.3d.webgl-engine.effects.geometry.RenderOccludedRenderNode")],l);const a=new t;function p(){a.prune()}const h=[4,2,16],u=h.reduce((e,t)=>e|t,0);export{l as RenderOccludedRenderNode,p as cleanupRenderOccluded};
5
+ import{__decorate as e}from"tslib";import t from"../../../../../core/PooledArray.js";import{property as r,subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{ZEROS as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as n}from"../../../webgl.js";import i from"../../../webgl/RenderNode.js";import{Blit as c}from"../blit/Blit.js";import{DepthStencilAttachment as d}from"../../../../webgl/enums.js";let l=class extends i{constructor(e){super(e),this.consumes={required:[n.OCCLUDED]},this.produces=n.OCCLUDED,this._blit=new c(e.view.stage.renderView.techniques,2)}precompile(){const e=this.view.stage.renderer;e.plugins.plugins.forEach(t=>{e.precompileSlots(t,10,12),t.material&&e.precompileOccludedSlots(t,h)})}render(e){const t=e.find(({name:e})=>e===this.produces);return this._renderOccludedAndTransparentStencil(t),this._renderOccludedComposite(t),t}_renderOccludedAndTransparentStencil(e){const t=this.view.stage.renderer,r=a;r.clear();for(const s of t.plugins.plugins)8&s.renderOccludedFlags&&r.push(s);0!==r.length&&(t.renderSlots(r,11),this._renderAndComposite(e,e.getAttachment(d),.5,()=>t.renderSlots(r,12),!1,!1),r.clear())}_renderOccludedComposite(e){const t=this.view.stage.renderer,r=a;r.clear();let s=0;for(const i of t.plugins.plugins){const e=i.renderOccludedFlags&u;s|=e,e&&r.push(i)}if(!s)return void r.clear();const o=this._getDepthStencilAttachment(e);let n=o.clearStencil;for(const i of h)s&i&&(this._renderAndComposite(e,o.depth,16===i?1:.5,()=>t.renderOccludedSlots(r,i),!0,n),n=!1);o.release(),r.clear()}_renderAndComposite(e,t,r,s,n,i){const c=this.renderingContext,{width:d,height:l}=e.fbo,a=this.fboCache.acquire(d,l,"tmp color");a.attachDepth(t),c.bindFramebuffer(a.fbo),c.clearFramebuffer(o,n,i),s(),a.detachDepth(),this._blit.blend(c,a,e,this.bindParameters,r),a.release()}_getDepthStencilAttachment(e){const{width:t,height:r}=e.fbo;if(!this.view.stage.renderer.occludedRequiresIntegratedMeshStencil){const e=this.fboCache.acquireDepth(13,t,r,"retained stencil");return{depth:e,release:()=>e.release(),clearStencil:!0}}const s=this.fboCache.acquire(t,r,"retained stencil",13);return this.renderingContext.blitFramebuffer(e.fbo,s.fbo,1024),{depth:s.getAttachment(d),release:()=>s.release(),clearStencil:!1}}};e([r()],l.prototype,"consumes",void 0),e([r()],l.prototype,"produces",void 0),l=e([s("esri.views.3d.webgl-engine.effects.geometry.RenderOccludedRenderNode")],l);const a=new t;function p(){a.prune()}const h=[4,2,16],u=h.reduce((e,t)=>e|t,0);export{l as RenderOccludedRenderNode,p as cleanupRenderOccluded};
@@ -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{lerp as t,clamp as s,smoothstep as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{set as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{b as m,F as p}from"../../../../../chunks/vec32.js";import{c}from"../../../../../chunks/vec42.js";import{earth as d}from"../../../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as u}from"../../../webgl.js";import{TransparentEnvironment as f}from"../TransparentEnvironment.js";import{H as _}from"../../../../../chunks/HazeCompositing.glsl.js";import{HazeCompositingTechnique as l}from"./HazeCompositingTechnique.js";import{HazePassParameters as g,HazeTechnique as b}from"./HazeTechnique.js";import{HazeTechniqueConfiguration as w}from"./HazeTechniqueConfiguration.js";import{createQuadVAO as P}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as v}from"../../lib/textureUtils.js";import{DepthStencilAttachment as j,PrimitiveType as A}from"../../../../webgl/enums.js";let T=class extends f{constructor(e){super(e),this._compositingPassParameters=new _,this._passParameters=new g,this._hazeConfiguration=new w,this.requireGeometryDepth=!0,this._oldAmount=1,this._newAmount=1,this._amount=this._newAmount;const t=e.view.stage.renderView.techniques;t.precompile(b,new w);const s=new w;s.reduced=!0,t.precompile(b,s),t.precompile(l)}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o),a(()=>this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>this._fade(e),o),a(()=>this.view.environment.weather.type,e=>this._newAmount="rainy"===e?0:1,o),a(()=>this.view.stage.renderer?.highResolutionAtmosphere,e=>this._hazeConfiguration.reduced=!e,o)])}_fade(e){e>=1?(this._amount=this._newAmount,this._oldAmount=this._newAmount):this._amount=e<=0?this._oldAmount:t(this._oldAmount,this._newAmount,e)}destroy(){this._vao=r(this._vao)}render(e){const s=e.find(({name:e})=>e===u.TRANSPARENT_ENVIRONMENT);if(!this.bindParameters.mainDepth)return s;const i=this.renderingContext,r=this.techniques.get(b,this._hazeConfiguration);if(!r.compiled)return s;const a=s.getAttachment(j);if(this._update(),!this._hazeConfiguration.reduced)return s.detachDepth(),i.bindFramebuffer(s.fbo),i.bindTechnique(r,this.bindParameters,this._passParameters),this._renderCommon(i),s.attachDepth(a),s;const o=this.techniques.get(l);if(!o.compiled)return s;const n=i.getViewport(),h=this.camera,p=m(h.eye)-d.radius;let c;const f=d.atmosphereHeight;if(p<f){const e=Math.min(1,Math.max(0,p/f));c=t(.4,.5,e)}else{const e=Math.min(1,Math.max(0,(p-f)/(15*f)));c=t(.5,1,e)}const _=this.renderingContext.parameters.maxTextureSize,g=v(Math.round(c*h.fullViewport[2]),_),w=v(Math.round(c*h.fullViewport[3]),_);i.setViewport(0,0,g,w);const P=this.fboCache.acquire(g,w,"haze",5);return i.bindFramebuffer(P.fbo),i.clearFramebuffer([0,0,0,1],!0,!0),i.bindTechnique(r,this.bindParameters,this._passParameters),this._renderCommon(i),i.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=P.getTexture(),s.detachDepth(),i.bindFramebuffer(s.fbo),i.bindTechnique(o,this.bindParameters,this._compositingPassParameters),i.screen.draw(),s.attachDepth(a),P.release(),s}_renderCommon(e){this._vao??=P(e,1),e.bindVAO(this._vao),e.drawArrays(A.TRIANGLE_STRIP,0,4)}_update(){const e=this.bindParameters.camera,r=p(e.eye),a=Math.sqrt(r),o=r-this._passParameters.radii[1]*this._passParameters.radii[1],n=s((a-this._passParameters.radii[0])/d.atmosphereHeight,0,1);c(this._passParameters.heightParameters,a,r,o,n);const m=this.view.basemapTerrain?.getLowerBoundRadius()??0;h(this._passParameters.radii,m,m+d.atmosphereHeight),this._passParameters.hazeStrength=t(t(.6,1,i(9500,10500,a-d.radius)),1,this._amount)}};T=e([n("esri.views.3d.webgl-engine.effects.haze.Haze")],T);export{T as Haze};
5
+ import{__decorate as e}from"tslib";import{lerp as t,clamp as s,smoothstep as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{set as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{b as m,E as p}from"../../../../../chunks/vec32.js";import{c}from"../../../../../chunks/vec42.js";import{earth as d}from"../../../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as u}from"../../../webgl.js";import{TransparentEnvironment as f}from"../TransparentEnvironment.js";import{H as _}from"../../../../../chunks/HazeCompositing.glsl.js";import{HazeCompositingTechnique as l}from"./HazeCompositingTechnique.js";import{HazePassParameters as g,HazeTechnique as b}from"./HazeTechnique.js";import{HazeTechniqueConfiguration as w}from"./HazeTechniqueConfiguration.js";import{createQuadVAO as P}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as v}from"../../lib/textureUtils.js";import{DepthStencilAttachment as j,PrimitiveType as A}from"../../../../webgl/enums.js";let T=class extends f{constructor(e){super(e),this._compositingPassParameters=new _,this._passParameters=new g,this._hazeConfiguration=new w,this.requireGeometryDepth=!0,this._oldAmount=1,this._newAmount=1,this._amount=this._newAmount;const t=e.view.stage.renderView.techniques;t.precompile(b,new w);const s=new w;s.reduced=!0,t.precompile(b,s),t.precompile(l)}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o),a(()=>this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>this._fade(e),o),a(()=>this.view.environment.weather.type,e=>this._newAmount="rainy"===e?0:1,o),a(()=>this.view.stage.renderer?.highResolutionAtmosphere,e=>this._hazeConfiguration.reduced=!e,o)])}_fade(e){e>=1?(this._amount=this._newAmount,this._oldAmount=this._newAmount):this._amount=e<=0?this._oldAmount:t(this._oldAmount,this._newAmount,e)}destroy(){this._vao=r(this._vao)}render(e){const s=e.find(({name:e})=>e===u.TRANSPARENT_ENVIRONMENT);if(!this.bindParameters.mainDepth)return s;const i=this.renderingContext,r=this.techniques.get(b,this._hazeConfiguration);if(!r.compiled)return s;const a=s.getAttachment(j);if(this._update(),!this._hazeConfiguration.reduced)return s.detachDepth(),i.bindFramebuffer(s.fbo),i.bindTechnique(r,this.bindParameters,this._passParameters),this._renderCommon(i),s.attachDepth(a),s;const o=this.techniques.get(l);if(!o.compiled)return s;const n=i.getViewport(),h=this.camera,p=m(h.eye)-d.radius;let c;const f=d.atmosphereHeight;if(p<f){const e=Math.min(1,Math.max(0,p/f));c=t(.4,.5,e)}else{const e=Math.min(1,Math.max(0,(p-f)/(15*f)));c=t(.5,1,e)}const _=this.renderingContext.parameters.maxTextureSize,g=v(Math.round(c*h.fullViewport[2]),_),w=v(Math.round(c*h.fullViewport[3]),_);i.setViewport(0,0,g,w);const P=this.fboCache.acquire(g,w,"haze",5);return i.bindFramebuffer(P.fbo),i.clearFramebuffer([0,0,0,1],!0,!0),i.bindTechnique(r,this.bindParameters,this._passParameters),this._renderCommon(i),i.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=P.getTexture(),s.detachDepth(),i.bindFramebuffer(s.fbo),i.bindTechnique(o,this.bindParameters,this._compositingPassParameters),i.screen.draw(),s.attachDepth(a),P.release(),s}_renderCommon(e){this._vao??=P(e,1),e.bindVAO(this._vao),e.drawArrays(A.TRIANGLE_STRIP,0,4)}_update(){const e=this.bindParameters.camera,r=p(e.eye),a=Math.sqrt(r),o=r-this._passParameters.radii[1]*this._passParameters.radii[1],n=s((a-this._passParameters.radii[0])/d.atmosphereHeight,0,1);c(this._passParameters.heightParameters,a,r,o,n);const m=this.view.basemapTerrain?.getLowerBoundRadius()??0;h(this._passParameters.radii,m,m+d.atmosphereHeight),this._passParameters.hazeStrength=t(t(.6,1,i(9500,10500,a-d.radius)),1,this._amount)}};T=e([n("esri.views.3d.webgl-engine.effects.haze.Haze")],T);export{T as Haze};
@@ -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{O as i}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as e}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as t}from"./OITBlendTechniqueConfiguration.js";import{ColorAttachment2 as s,ColorAttachment1 as r}from"../../../../webgl/enums.js";class n{constructor(s){this._techniques=s,this._parameters=new i,this._configuration=new t,s.precompile(e,this._configuration),this._configuration.hasEmitters=!0,s.precompile(e,this._configuration),this._configuration.dimEmissive=!0,s.precompile(e,this._configuration),this._configuration.dimEmissive=!1,this._configuration.hasEmitters=!1}blend(i,t,n,o,a,h){if(this._parameters.colorTexture=t.getTexture(),this._parameters.alphaTexture=t.getTexture(a?s:r),this._parameters.frontFaceTexture=n.getTexture(),this._configuration.hasEmitters=a,a&&h){this._configuration.dimEmissive=!0;const t=this._techniques.get(e,this._configuration);i.bindTechnique(t,o,this._parameters),i.screen.draw(),this._configuration.dimEmissive=!1}a&&(this._parameters.emissionTexture=t.getTexture(r),this._parameters.emissionFrontFaceTexture=n.getTexture(r));const c=this._techniques.get(e,this._configuration);i.bindTechnique(c,o,this._parameters),i.screen.draw()}}export{n as OITBlend};
5
+ import{O as i}from"../../../../../chunks/OITBlend.glsl.js";import{OITBlendTechnique as e}from"./OITBlendTechnique.js";import{OITBlendTechniqueConfiguration as t}from"./OITBlendTechniqueConfiguration.js";import{ColorAttachment2 as s,ColorAttachment1 as r}from"../../../../webgl/enums.js";class n{constructor(s){this._techniques=s,this._parameters=new i,this._configuration=new t,s.precompile(e,this._configuration),this._configuration.hasEmitters=!0,s.precompile(e,this._configuration),this._configuration.dimEmissive=!0,s.precompile(e,this._configuration),this._configuration.dimEmissive=!1,this._configuration.hasEmitters=!1}blend(i,t,n,o,a,h){if(this._configuration.hasEmitters=a,this._parameters.colorTexture=t.getTexture(),this._parameters.alphaTexture=t.getTexture(a?s:r),this._parameters.frontFaceTexture=n.getTexture(),a){if(h){this._configuration.dimEmissive=!0;const t=this._techniques.get(e,this._configuration);i.bindTechnique(t,o,this._parameters),i.screen.draw(),this._configuration.dimEmissive=!1}this._parameters.emissionTexture=t.getTexture(r),this._parameters.emissionFrontFaceTexture=n.getTexture(r)}const c=this._techniques.get(e,this._configuration);i.bindTechnique(c,o,this._parameters),i.screen.draw()}}export{n as OITBlend};
@@ -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 i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{CloudsParameters as e}from"../../environment/CloudsParameters.js";import h from"../../webgl/RenderCamera.js";import{OITPolygonOffsetLimit as s}from"./OrderIndependentTransparency.js";import{SceneLighting as n}from"../lighting/SceneLighting.js";class r{constructor(i,t){this.width=i,this.height=t}}class g{constructor(i){this.shadowMap=i,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.hasEmission=!1,this.enableFillLights=!0,this.oitPass=0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillEnabled=!1,this._camera=new h,this._inverseViewport=t(),this._oldLighting=new n,this._newLighting=new n,this._fadedLighting=new n,this._lighting=this._newLighting,this.ssr=new l,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.highlights=new Array,this.highlightOrderMap=new Map,this.highlightMixOrigin=t(),this.highlightMixTexture=null,this.hudRenderStyle=0,this.hudOccludedFragmentOpacity=1,this.snowCover=0,this.clouds=new e,this.shadowHighlightsVisible=!1}destroy(){this._camera=null,this.contentCamera=null,this.depth=null,this.geometryDepth=null,this.mainDepth=null,this.overlay=null,this.ssao=null,this.terrainDepth=null}get camera(){return this._camera}set camera(i){this._camera=i,this._inverseViewport[0]=1/i.fullViewport[2],this._inverseViewport[1]=1/i.fullViewport[3]}get enableOffset(){return 1===this.oitPass&&this.camera.relativeElevation<s}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(i,t,e,h){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=e,this._newLighting.set(i),this._oldLighting.updateLegacy(),1===h&&this.clouds.requestFade(),this.fadeLighting()}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}}class l{constructor(){this.fadeFactor=1,this.reprojectionMatrix=i()}}export{g as BindParameters,r as ViewportSize};
5
+ import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{CloudsParameters as e}from"../../environment/CloudsParameters.js";import h from"../../webgl/RenderCamera.js";import{OITPolygonOffsetLimit as s}from"./OrderIndependentTransparency.js";import{SceneLighting as n}from"../lighting/SceneLighting.js";class r{constructor(i,t){this.width=i,this.height=t}}class l{constructor(i){this.shadowMap=i,this.slot=2,this.slicePlane=null,this.hasOccludees=!1,this.hasEmission=!1,this.enableFillLights=!0,this.oitPass=0,this.alignPixelEnabled=!1,this.decorations=!0,this.overlayStretch=1,this.viewshedEnabled=!1,this.cutFillEnabled=!1,this._camera=new h,this._inverseViewport=t(),this._oldLighting=new n,this._newLighting=new n,this._fadedLighting=new n,this._lighting=this._newLighting,this.ssr=new g,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.highlights=new Array,this.highlightOrderMap=new Map,this.highlightMixOrigin=t(),this.highlightMixTexture=null,this.hudRenderStyle=0,this.hudOccludedFragmentOpacity=1,this.snowCover=0,this.clouds=new e,this.shadowHighlightsVisible=!1}destroy(){this._camera=null,this.contentCamera=null,this.depth=null,this.geometryDepth=null,this.mainDepth=null,this.overlay=null,this.ssao=null,this.terrainDepth=null}get camera(){return this._camera}set camera(i){this._camera=i,this._inverseViewport[0]=1/i.fullViewport[2],this._inverseViewport[1]=1/i.fullViewport[3]}get enableOffset(){return 1===this.oitPass&&this.camera.relativeElevation<s}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(i,t,e,h){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=e,this._newLighting.set(i),this._oldLighting.updateLegacy(),1===h&&this.clouds.requestFade(),this.fadeLighting()}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get occluder(){return 11===this.slot||12===this.slot?this.slot:null}}class g{constructor(){this.fadeFactor=1,this.reprojectionMatrix=i()}}export{l as BindParameters,r as ViewportSize};
@@ -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 t from"../../../../Color.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{watch as s,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as r,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{d as a}from"../../../../chunks/vec32.js";import{RenderCategory as n,InternalRenderCategory as u}from"../../webgl.js";import{glLayout as h}from"../../support/buffer/glUtil.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import m from"../../webgl/RenderNode.js";import{VertexArrayObject as d}from"./VertexArrayObject.js";import{C as f}from"../../../../chunks/CutFillComposition.glsl.js";import{CutFillCompositionTechnique as p}from"../shaders/CutFillCompositionTechnique.js";import{C}from"../../../../chunks/CutFillMask.glsl.js";import{CutFillMaskTechnique as _}from"../shaders/CutFillMaskTechnique.js";import{DefaultMaterialPassParameters as g,DefaultMaterialDrawParameters as b,DefaultMaterialTechnique as q}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as v}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{DepthStencilAttachment as T,PrimitiveType as F}from"../../../webgl/enums.js";import{noParameters as w}from"../../../webgl/NoParameters.js";import{VertexBuffer as V}from"../../../webgl/VertexBuffer.js";let P=class extends m{constructor(e){super(e),this.consumes={required:[n.OPAQUE]},this.produces=u.CUTFILL_COLOR,this._vaoCut=null,this._vaoFill=null,this._countCut=0,this._countFill=0,this._maskParameters=new C,this._cutVolumeParameters=new g,this._fillVolumeParameters=new g,this._compositeParameters=new f,this._drawParameters=new b;const t=1===e.view.state.viewingMode;this._cutVolumeTechniqueConfiguration=new v(t),this._cutVolumeTechniqueConfiguration.customDepthTest=2,this._cutVolumeTechniqueConfiguration.writeDepth=!1,this._cutVolumeTechniqueConfiguration.cullFace=1,this._cutVolumeTechniqueConfiguration.doubleSidedMode=1,this._fillVolumeTechniqueConfiguration=new v(t),this._fillVolumeTechniqueConfiguration.cullFace=2}initialize(){this.addHandles([s(()=>[this.cutColor,this.fillColor],()=>this._updateColors(),o)])}destroy(){this._vaoCut=i(this._vaoCut),this._vaoFill=i(this._vaoFill)}precompile(){this.techniques.precompile(q,this._cutVolumeTechniqueConfiguration),this.techniques.precompile(q,this._fillVolumeTechniqueConfiguration),this.techniques.precompile(_),this.techniques.precompile(p)}render(e){const i=this.techniques.get(q,this._cutVolumeTechniqueConfiguration),s=this.techniques.get(q,this._fillVolumeTechniqueConfiguration),o=this.techniques.get(_),r=this.techniques.get(p),l=e.find(({name:e})=>e===this.produces);if(!this._vaoCut||!this._vaoFill)return l;if(!(i&&s&&o.compiled&&r.compiled))return this.requestRender(1),l;const a=this.bindParameters,n=a.camera,u=n.fullViewport[2],h=n.fullViewport[3],c=this.renderingContext,m=this.fboCache,d=m.acquire(u,h,"cutfill color mask",2);d.attachDepth(l.getAttachment(T)),c.bindFramebuffer(d.fbo),c.setClearColor(0,0,0,1),c.clear(17408),c.setViewport(0,0,u,h),c.bindTechnique(o,a,w,this._maskParameters),c.setFaceCullingEnabled(!1),c.setStencilTestEnabled(!0),c.setStencilOpSeparate(1028,7680,34055,7680),c.setStencilOpSeparate(1029,7680,34056,7680),c.setDepthWriteEnabled(!1),c.bindVAO(this._vaoCut),c.setDepthTestEnabled(!0),c.setStencilWriteMask(255),c.setStencilFunction(519,0,255),c.setColorMask(!1,!1,!1,!1),c.drawArrays(F.TRIANGLES,0,this._countCut),c.setDepthTestEnabled(!1),c.setStencilWriteMask(0),c.setStencilFunction(517,0,255),c.setColorMask(!0,!1,!1,!1),c.drawArrays(F.TRIANGLES,0,this._countCut),c.bindVAO(this._vaoFill),c.setDepthTestEnabled(!0),c.setStencilWriteMask(255),c.setStencilFunction(519,0,255),c.setColorMask(!1,!0,!1,!1),c.drawArrays(F.TRIANGLES,0,this._countFill);const f=m.acquire(u,h,"cutfill color volumes",5);f.attachDepth(l.getAttachment(T)),c.bindFramebuffer(f.fbo),c.setClearColor(0,0,0,0),c.clear(16384),c.setColorMask(!0,!0,!0,!0),c.bindTechnique(i,this.bindParameters,this._cutVolumeParameters,this._drawParameters),c.setPolygonOffset(1,1),c.setPolygonOffsetFillEnabled(!0),c.bindVAO(this._vaoCut),c.drawArrays(F.TRIANGLES,0,this._countCut),c.bindTechnique(s,this.bindParameters,this._fillVolumeParameters,this._drawParameters),c.setPolygonOffset(0,0),c.setPolygonOffsetFillEnabled(!1),c.bindVAO(this._vaoFill),c.drawArrays(F.TRIANGLES,0,this._countFill);const C=this.fboCache.acquire(u,h,this.produces);return c.bindFramebuffer(C.fbo),this._compositeParameters.color=l.getTexture(),this._compositeParameters.cutFillVolumes=f.getTexture(),this._compositeParameters.cutFillMask=d.getTexture(),t.toUnitRGBA(this.borderColor,this._compositeParameters.borderColor),c.bindTechnique(r,a,this._compositeParameters),c.screen.draw(),d.release(),f.release(),C.attachDepth(l.getAttachment(T)),C}enable(){this.produces=u.CUTFILL_COLOR,this.requestRender(1)}disable(){this.produces="disabled",this.requestRender(1)}updateGeometries(e,t,s){this._vaoCut=i(this._vaoCut),this._vaoCut=this._createVao(e),this._countCut=e.indicesBottom.length+e.indicesExtruded.length,this._vaoFill=i(this._vaoFill),this._vaoFill=this._createVao(t),this._countFill=t.indicesBottom.length+t.indicesExtruded.length,this._maskParameters.origin=s,a(this._drawParameters.origin,s),this.requestRender(1)}_updateColors(){this._cutVolumeParameters.diffuse=t.toUnitRGB(this.cutColor),this._cutVolumeParameters.opacity=this.cutColor.a,this._fillVolumeParameters.diffuse=t.toUnitRGB(this.fillColor),this._fillVolumeParameters.opacity=this.fillColor.a,this.requestRender(1)}_createVao(e){const t=this.renderingContext,{vertices:i,normals:s,indicesBottom:o,indicesExtruded:r}=e,l=j.createBuffer(o.length+r.length),{position:a,normal:n}=l;for(let h=0;h<o.length;h++){const e=3*o[h];a.set(h,0,i[e]),a.set(h,1,i[e+1]),a.set(h,2,i[e+2]),n.set(h,0,s[e]),n.set(h,1,s[e+1]),n.set(h,2,s[e+2])}for(let h=0;h<r.length;h++){const e=h+o.length,t=3*r[h];a.set(e,0,i[t]),a.set(e,1,i[t+1]),a.set(e,2,i[t+2]),n.set(e,0,s[t]),n.set(e,1,s[t+1]),n.set(e,2,s[t+2])}const u=new V(t,h(j),l.buffer);return new d(t,u)}};e([r()],P.prototype,"consumes",void 0),e([r()],P.prototype,"produces",void 0),e([r()],P.prototype,"cutColor",void 0),e([r()],P.prototype,"fillColor",void 0),e([r()],P.prototype,"borderColor",void 0),P=e([l("esri.views.3d.webgl-engine.lib.CutFillColor")],P);const j=c().vec3f("position").vec3f("normal").freeze();class y{constructor(e,t,i,s){this.vertices=e,this.indicesBottom=t,this.indicesExtruded=i,this.normals=s}}export{P as CutFillColor,y as VolumeGeometry};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{watch as s,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as r,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{d as a}from"../../../../chunks/vec32.js";import{RenderCategory as n,InternalRenderCategory as u}from"../../webgl.js";import{glLayout as c}from"../../support/buffer/glUtil.js";import{newLayout as h}from"../../support/buffer/InterleavedLayout.js";import m from"../../webgl/RenderNode.js";import{VertexArrayObject as d}from"./VertexArrayObject.js";import{C as f}from"../../../../chunks/CutFillComposition.glsl.js";import{CutFillCompositionTechnique as p}from"../shaders/CutFillCompositionTechnique.js";import{C}from"../../../../chunks/CutFillMask.glsl.js";import{CutFillMaskTechnique as _}from"../shaders/CutFillMaskTechnique.js";import{DefaultMaterialPassParameters as g,DefaultMaterialDrawParameters as b,DefaultMaterialTechnique as T}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as q}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{DepthStencilAttachment as V,PrimitiveType as v}from"../../../webgl/enums.js";import{noParameters as F}from"../../../webgl/NoParameters.js";import{VertexBuffer as w}from"../../../webgl/VertexBuffer.js";let P=class extends m{constructor(e){super(e),this.consumes={required:[n.OPAQUE]},this.produces=u.CUTFILL_COLOR,this.measureType="cut-fill",this._vaoCut=null,this._vaoFill=null,this._countCut=0,this._countFill=0,this._maskParameters=new C,this._cutVolumeParameters=new g,this._fillVolumeParameters=new g,this._compositeParameters=new f,this._drawParameters=new b;const t=1===e.view.state.viewingMode;this._cutVolumeTechniqueConfiguration=new q(t),this._cutVolumeTechniqueConfiguration.customDepthTest=2,this._cutVolumeTechniqueConfiguration.writeDepth=!1,this._cutVolumeTechniqueConfiguration.cullFace=1,this._cutVolumeTechniqueConfiguration.doubleSidedMode=2,this._fillVolumeTechniqueConfiguration=new q(t),this._fillVolumeTechniqueConfiguration.cullFace=2}initialize(){this.addHandles([s(()=>[this.cutColor,this.fillColor],()=>this._updateColors(),o),s(()=>this.measureType,()=>{this.precompile(),this.requestRender(1)},o)])}destroy(){this._vaoCut=i(this._vaoCut),this._vaoFill=i(this._vaoFill)}precompile(){"cut-fill"===this.measureType?(this._cutVolumeTechniqueConfiguration.cullFace=1,this._cutVolumeTechniqueConfiguration.doubleSidedMode=2):(this._cutVolumeTechniqueConfiguration.cullFace=0,this._cutVolumeTechniqueConfiguration.doubleSidedMode=0),this.techniques.precompile(T,this._cutVolumeTechniqueConfiguration),this.techniques.precompile(T,this._fillVolumeTechniqueConfiguration),this.techniques.precompile(_),this.techniques.precompile(p)}render(e){const i=this.techniques.get(T,this._cutVolumeTechniqueConfiguration),s=this.techniques.get(T,this._fillVolumeTechniqueConfiguration),o=this.techniques.get(_),r=this.techniques.get(p),l=e.find(({name:e})=>e===this.produces);if(!this._vaoCut||!this._vaoFill)return l;if(!(i&&s&&o.compiled&&r.compiled))return this.requestRender(1),l;const a=this.bindParameters,n=a.camera,u=n.fullViewport[2],c=n.fullViewport[3],h=this.renderingContext,m=this.fboCache,d=m.acquire(u,c,"cutfill color mask",2);d.attachDepth(l.getAttachment(V)),h.bindFramebuffer(d.fbo),h.setClearColor(0,0,0,1),h.clear(17408),h.setViewport(0,0,u,c),h.bindTechnique(o,a,F,this._maskParameters),h.setFaceCullingEnabled(!1),h.setStencilTestEnabled(!0),h.setStencilOpSeparate(1028,7680,34055,7680),h.setStencilOpSeparate(1029,7680,34056,7680),h.setDepthWriteEnabled(!1),h.bindVAO(this._vaoCut),h.setDepthTestEnabled(!0),h.setStencilWriteMask(255),h.setStencilFunction(519,0,255),h.setColorMask(!1,!1,!1,!1),h.drawArrays(v.TRIANGLES,0,this._countCut),h.setDepthTestEnabled(!1),h.setStencilWriteMask(0),h.setStencilFunction(517,0,255),h.setColorMask(!0,!1,!1,!1),h.drawArrays(v.TRIANGLES,0,this._countCut),h.bindVAO(this._vaoFill),h.setDepthTestEnabled(!0),h.setStencilWriteMask(255),h.setStencilFunction(519,0,255),h.setColorMask(!1,!0,!1,!1),h.drawArrays(v.TRIANGLES,0,this._countFill);const f=m.acquire(u,c,"cutfill color volumes",5);f.attachDepth(l.getAttachment(V)),h.bindFramebuffer(f.fbo),h.setClearColor(0,0,0,0),h.clear(16384),h.setColorMask(!0,!0,!0,!0),h.bindTechnique(i,this.bindParameters,this._cutVolumeParameters,this._drawParameters),h.setPolygonOffset(1,1),h.setPolygonOffsetFillEnabled(!0),h.bindVAO(this._vaoCut),h.drawArrays(v.TRIANGLES,0,this._countCut),h.bindTechnique(s,this.bindParameters,this._fillVolumeParameters,this._drawParameters),h.setPolygonOffset(0,0),h.setPolygonOffsetFillEnabled(!1),h.bindVAO(this._vaoFill),h.drawArrays(v.TRIANGLES,0,this._countFill);const C=this.fboCache.acquire(u,c,this.produces);return h.bindFramebuffer(C.fbo),this._compositeParameters.color=l.getTexture(),this._compositeParameters.cutFillVolumes=f.getTexture(),this._compositeParameters.cutFillMask=d.getTexture(),t.toUnitRGBA(this.borderColor,this._compositeParameters.borderColor),h.bindTechnique(r,a,this._compositeParameters),h.screen.draw(),d.release(),f.release(),C.attachDepth(l.getAttachment(V)),C}enable(){this.produces=u.CUTFILL_COLOR,this.requestRender(1)}disable(){this.produces="disabled",this.requestRender(1)}updateGeometries(e,t,s){this._vaoCut=i(this._vaoCut),this._vaoCut=this._createVao(e),this._countCut=e.indicesBottom.length+e.indicesExtruded.length,this._vaoFill=i(this._vaoFill),this._vaoFill=this._createVao(t),this._countFill=t.indicesBottom.length+t.indicesExtruded.length,this._maskParameters.origin=s,a(this._drawParameters.origin,s),this.requestRender(1)}_updateColors(){this._cutVolumeParameters.diffuse=t.toUnitRGB(this.cutColor),this._cutVolumeParameters.opacity=this.cutColor.a,this._fillVolumeParameters.diffuse=t.toUnitRGB(this.fillColor),this._fillVolumeParameters.opacity=this.fillColor.a,this.requestRender(1)}_createVao(e){const t=this.renderingContext,{vertices:i,normals:s,indicesBottom:o,indicesExtruded:r}=e,l=y.createBuffer(o.length+r.length),{position:a,normal:n}=l;for(let c=0;c<o.length;c++){const e=3*o[c];a.set(c,0,i[e]),a.set(c,1,i[e+1]),a.set(c,2,i[e+2]),n.set(c,0,s[e]),n.set(c,1,s[e+1]),n.set(c,2,s[e+2])}for(let c=0;c<r.length;c++){const e=c+o.length,t=3*r[c];a.set(e,0,i[t]),a.set(e,1,i[t+1]),a.set(e,2,i[t+2]),n.set(e,0,s[t]),n.set(e,1,s[t+1]),n.set(e,2,s[t+2])}const u=new w(t,c(y),l.buffer);return new d(t,u)}};e([r()],P.prototype,"consumes",void 0),e([r()],P.prototype,"produces",void 0),e([r()],P.prototype,"cutColor",void 0),e([r()],P.prototype,"fillColor",void 0),e([r()],P.prototype,"borderColor",void 0),e([r()],P.prototype,"measureType",void 0),P=e([l("esri.views.3d.webgl-engine.lib.CutFillColor")],P);const y=h().vec3f("position").vec3f("normal").freeze();class j{constructor(e,t,i,s){this.vertices=e,this.indicesBottom=t,this.indicesExtruded=i,this.normals=s}}export{P as CutFillColor,j as VolumeGeometry};
@@ -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 t}from"tslib";import{watch as e}from"../../../../core/reactiveUtils.js";import{property as s,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as n,b as o,j as h,q as l,g as u,F as p,J as c,d as m}from"../../../../chunks/vec32.js";import{create as d,clone as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as f}from"../../../../chunks/vec42.js";import{create as _}from"../../../../geometry/support/plane.js";import{fromPoints as b}from"../../../../geometry/support/ray.js";import{Sphere as C}from"../../../../geometry/support/sphere.js";import{RenderCategory as P}from"../../webgl.js";import{GaussianSplatTarget as S}from"../../layers/i3s/Intersector.js";import{GaussianSplatDataStore as v}from"../../support/gaussianSplatting/GaussianSplatDataStore.js";import q from"../../webgl/RenderNode.js";import{IntersectorResult as T}from"./IntersectorResult.js";import{G as w}from"../../../../chunks/GaussianSplat.glsl.js";import{G as x}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as y}from"../shaders/GaussianSplatCompositionTechnique.js";import{G as D}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as j}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatDepthTechnique as G}from"../shaders/GaussianSplatDepthTechnique.js";import{GaussianSplatTechnique as F}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as A}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{DepthStencilAttachment as R,PrimitiveType as E}from"../../../webgl/enums.js";var V;let H=class extends q{static{V=this}constructor(t){super(t),this.gaussianPosition=d(),this.intersectionRayDir=d(),this.intersectionPlane=_(),this._slicePlaneEnabled=!1,this._data=null,this.produces=P.OPAQUE,this.type=0,this.isGround=!1,this.layerViewUid="",this._gaussianSplatParameters=new w,this._gaussianSplatCompositionParameters=new x,this._gaussianSplatDepthCompositionParameters=new D,this._splatTechniqueConfiguration=new A,this._splatDepthTechniqueConfiguration=new A(!0),this._previousCameraPosition=d(),this._previousCameraDirection=d(),this._tanFov=r(),this._tempVec=d(),this._cameraDelta=d(),this._coarseCameraPosition=d(),this.fadeHelper=null}async initialize(){this._data=new v(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this),this.addHandles([e(()=>this.view.state.camera,()=>this._onCameraChange())])}precompile(){this._splatTechniqueConfiguration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._splatTechniqueConfiguration.terrainDepthTest=this.bindParameters.terrainDepthTest,this._splatTechniqueConfiguration.fadingEnabled=this.fadeHelper.fadingEnabled,this.techniques.precompile(F,this._splatTechniqueConfiguration),this._splatDepthTechniqueConfiguration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._splatDepthTechniqueConfiguration.terrainDepthTest=this.bindParameters.terrainDepthTest,this.techniques.precompile(G,this._splatDepthTechniqueConfiguration),this.techniques.precompile(y),this.techniques.precompile(j)}render(t){const e=t.find(({name:t})=>t===P.OPAQUE);if(this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return e;const s=this.techniques.get(F,this._splatTechniqueConfiguration),i=this.techniques.get(G,this._splatDepthTechniqueConfiguration),r=this.techniques.get(y),n=this.techniques.get(j);if(!(s.compiled&&i.compiled&&n.compiled&&r.compiled))return this.requestRender(1),e;const{fullWidth:o,fullHeight:h}=this.bindParameters.camera,l=this.fboCache,u=l.acquire(o,h,"gaussian color output");u.attachDepth(e.getAttachment(R));const p=this.renderingContext;p.bindFramebuffer(u.fbo),p.setClearColor(0,0,0,0),p.clear(16384),this._gaussianSplatParameters.totalGaussians=this._data.visibleGaussians,this._gaussianSplatParameters.splatOrder=this._data.orderTexture.texture,this._gaussianSplatParameters.splatFading=this._data.fadingTexture.texture,this._gaussianSplatParameters.splatAtlas=this._data.textureAtlas.texture;const c=Math.tan(.5*this.camera.fovY),m=c/h*o;a(this._tanFov,m,c);const d=h/(2*c);this._gaussianSplatParameters.focalLength=d,this._gaussianSplatParameters.tanFov=this._tanFov;const g=this.view.qualitySettings.gaussianSplat.minimumSplatPixelRadius*Math.sqrt(o*h)/Math.sqrt(2073600);this._gaussianSplatParameters.minSplatRadius=g,this._prepareHighPrecisionCameraPosition(),this.renderingContext.bindTechnique(s,this.bindParameters,this._gaussianSplatParameters),this.renderingContext.drawArraysInstanced(E.TRIANGLE_STRIP,0,4,this._data.visibleGaussians);const f=l.acquire(o,h,"splat depth",8);f.attachDepth(e.getAttachment(R)),p.bindFramebuffer(f.fbo),p.setClearColor(0,0,0,0),p.clear(16384),this.renderingContext.bindTechnique(i,this.bindParameters,this._gaussianSplatParameters),this.renderingContext.drawArraysInstanced(E.TRIANGLE_STRIP,0,4,this._data.visibleGaussians);const _=l.acquire(o,h,this.produces);return this._gaussianSplatDepthCompositionParameters.splatDepth=f.getTexture(),_.attachDepth(e.getAttachment(R)),p.bindFramebuffer(_.fbo),p.bindTechnique(n,this.bindParameters,this._gaussianSplatDepthCompositionParameters),p.screen.draw(),this._gaussianSplatCompositionParameters.color=e.getTexture(),this._gaussianSplatCompositionParameters.splatColor=u.getTexture(),p.bindFramebuffer(_.fbo),p.bindTechnique(r,this.bindParameters,this._gaussianSplatCompositionParameters),p.screen.draw(),u.release(),f.release(),_}intersect(t,e,s,i){const{gaussianPosition:a,intersectionRayDir:r,intersectionPlane:c,layerViewUid:m}=this,_=b(s,i);n(r,i,s);const P=1/o(r);h(r,r,P);const v=d();l(v,r),f(c,r[0],r[1],r[2],-u(r,s));const q=new M,w=new M,x=new Array;this._data.visibleGaussianTiles.forEach(n=>{const{maxScale:o}=n,h=n.obb.minimumDistancePlane(c),l=n.obb.maximumDistancePlane(c),d=l<0,f=null!=q.dist&&null!=w.dist&&q.dist<h*P&&w.dist>l*P;if(d||f)return;if(!new C(n.obb.center,n.obb.radius+o).intersectRay(_,null))return;if(!n.obb.intersectRay(s,r,o))return;const{positions:b,squaredScales:S,gaussianAtlasIndices:T}=n,y=T.length;for(let c=0;c<y;c++){const n=3*c;a[0]=b[n]-s[0],a[1]=b[n+1]-s[1],a[2]=b[n+2]-s[2];const o=S[c],h=u(a,r),l=h*h;if(p(a)-l>o)continue;const d=h*P,f=t=>(t.point=t.point?t.point.fill(a[0],a[1],a[2]):g(a),t.dist=d,t.normal=v,t.layerViewUid=m,t);if((null==q.dist||d<q.dist)&&(null==e||e(s,i,d))&&f(q),0!==t.options.store&&(null==w.dist||d>w.dist)&&(null==e||e(s,i,d))&&f(w),2===t.options.store&&(null==e||e(s,i,d))){const t=new M;x.push(f(t))}}});const y=(t,e)=>{const{layerViewUid:s}=e,i=new S(e.point,s);t.set(0,i,e.dist,e.normal)};if(I(q)){const e=t.results.min;(null==e.distance||q.dist<e.distance)&&y(e,q)}if(I(w)&&0!==t.options.store){const e=t.results.max;(null==e.distance||w.dist>e.distance)&&y(e,w)}if(2===t.options.store)for(const n of x){const e=new T(_);y(e,n),t.results.all.push(e)}}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(t){this._slicePlaneEnabled!==t&&(this._slicePlaneEnabled=t,this.requestRender(1))}get data(){return this._data}destroy(){this._data.destroy(),super.destroy()}_onCameraChange(){const t=this.view.state.camera.eye,e=this.view.state.camera.ray.direction,s=.001;(Math.abs(t[0]-this._previousCameraPosition[0])>s||Math.abs(t[1]-this._previousCameraPosition[1])>s||Math.abs(t[2]-this._previousCameraPosition[2])>s||Math.abs(e[0]-this._previousCameraDirection[0])>s||Math.abs(e[1]-this._previousCameraDirection[1])>s||Math.abs(e[2]-this._previousCameraDirection[2])>s)&&this._data.requestSort()}_prepareHighPrecisionCameraPosition(){h(this._tempVec,this.camera.eye,1/V.tileSize),c(this._tempVec,this._tempVec),m(this._coarseCameraPosition,this._tempVec),this._gaussianSplatParameters.cameraPos8k=this._coarseCameraPosition,h(this._tempVec,this._tempVec,V.tileSize),n(this._cameraDelta,this.camera.eye,this._tempVec),this._gaussianSplatParameters.cameraDelta=this._cameraDelta}_handleFading(){if(0===this.fadeHelper.numFadingTiles)return void(this._previousFrameStart=null);this._previousFrameStart??=this.view.stage.renderer.renderContext.time;const t=this.view.stage?.renderer.renderContext.time-this._previousFrameStart;this.fadeHelper.updateAllTileFading(t),this._previousFrameStart=this.view.stage.renderer.renderContext.time,this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}static{this.tileSize=2.048}};function I(t){return null!=t.dist&&null!=t.point}t([s({constructOnly:!0})],H.prototype,"fadeHelper",void 0),H=V=t([i("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],H);class M{constructor(){this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}export{H as GaussianSplatRenderNode};
5
+ import{__decorate as t}from"tslib";import{watch as e}from"../../../../core/reactiveUtils.js";import{property as s,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{e as r,b as n,j as o,q as h,g as l,E as p,d as m,J as u}from"../../../../chunks/vec32.js";import{create as c,clone as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as f}from"../../../../chunks/vec42.js";import{create as _}from"../../../../geometry/support/plane.js";import{fromPoints as g}from"../../../../geometry/support/ray.js";import{Sphere as P}from"../../../../geometry/support/sphere.js";import{RenderCategory as b}from"../../webgl.js";import{GaussianSplatTarget as C}from"../../layers/i3s/Intersector.js";import{GaussianSplatDataStore as v}from"../../support/gaussianSplatting/GaussianSplatDataStore.js";import w from"../../webgl/RenderNode.js";import{IntersectorResult as y}from"./IntersectorResult.js";import{G as S}from"../../../../chunks/GaussianSplat.glsl.js";import{G as x}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as q}from"../shaders/GaussianSplatCompositionTechnique.js";import{G as T}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as j}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatDepthTechnique as D}from"../shaders/GaussianSplatDepthTechnique.js";import{GaussianSplatTechnique as G}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as A}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{DepthStencilAttachment as R,PrimitiveType as E}from"../../../webgl/enums.js";var F;let H=class extends w{static{F=this}constructor(t){super(t),this.gaussianPosition=c(),this.intersectionRayDir=c(),this.intersectionPlane=_(),this._slicePlaneEnabled=!1,this._data=null,this.produces=b.OPAQUE,this.type=0,this.isGround=!1,this.layerViewUid="",this._passParameters=new S,this._compositionPassParameters=new x,this._depthCompositionPassParameters=new T,this._previousCameraPosition=c(),this._previousCameraDirection=c(),this.fadeHelper=null,this._configuration=new A(t.view.state.isGlobal),this._depthConfiguration=new A(t.view.state.isGlobal,!0)}async initialize(){this._data=new v(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this),this.addHandles([e(()=>this.view.state.camera,()=>this._onCameraChange())])}precompile(){this._configuration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._configuration.terrainDepthTest=this.bindParameters.terrainDepthTest,this._configuration.fadingEnabled=this.fadeHelper.fadingEnabled,this.techniques.precompile(G,this._configuration),this._depthConfiguration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._depthConfiguration.terrainDepthTest=this.bindParameters.terrainDepthTest,this.techniques.precompile(D,this._depthConfiguration),this.techniques.precompile(q),this.techniques.precompile(j)}render(t){const e=t.find(({name:t})=>t===b.OPAQUE);if(this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return e;const s=this.techniques.get(G,this._configuration),i=this.techniques.get(D,this._depthConfiguration),r=this.techniques.get(q),n=this.techniques.get(j);if(!(s.compiled&&i.compiled&&n.compiled&&r.compiled))return this.requestRender(1),e;const{fullWidth:o,fullHeight:h}=this.bindParameters.camera,l=this.fboCache,p=l.acquire(o,h,"gaussian color output");p.attachDepth(e.getAttachment(R));const m=this.renderingContext;m.bindFramebuffer(p.fbo),m.setClearColor(0,0,0,0),m.clear(16384),this._passParameters.totalGaussians=this._data.visibleGaussians,this._passParameters.splatOrder=this._data.orderTexture.texture,this._passParameters.splatFading=this._data.fadingTexture.texture,this._passParameters.splatAtlas=this._data.textureAtlas.texture;const u=Math.tan(.5*this.camera.fovY),c=u/h*o;a(this._passParameters.tanFov,c,u),this._passParameters.focalLength=h/(2*u);const d=this.view.qualitySettings.gaussianSplat.minimumSplatPixelRadius;this._passParameters.minSplatRadius=d*Math.sqrt(o*h)/Math.sqrt(2073600),this._prepareHighPrecisionCameraPosition(),this.renderingContext.bindTechnique(s,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(E.TRIANGLE_STRIP,0,4,this._data.visibleGaussians);const f=l.acquire(o,h,"splat depth",8);f.attachDepth(e.getAttachment(R)),m.bindFramebuffer(f.fbo),m.setClearColor(0,0,0,0),m.clear(16384),this.renderingContext.bindTechnique(i,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(E.TRIANGLE_STRIP,0,4,this._data.visibleGaussians);const _=l.acquire(o,h,this.produces);return this._depthCompositionPassParameters.splatDepth=f.getTexture(),_.attachDepth(e.getAttachment(R)),m.bindFramebuffer(_.fbo),m.bindTechnique(n,this.bindParameters,this._depthCompositionPassParameters),m.screen.draw(),this._compositionPassParameters.color=e.getTexture(),this._compositionPassParameters.splatColor=p.getTexture(),m.bindFramebuffer(_.fbo),m.bindTechnique(r,this.bindParameters,this._compositionPassParameters),m.screen.draw(),p.release(),f.release(),_}intersect(t,e,s,i){const{gaussianPosition:a,intersectionRayDir:m,intersectionPlane:u,layerViewUid:_}=this,b=g(s,i);r(m,i,s);const v=1/n(m);o(m,m,v);const w=c();h(w,m),f(u,m[0],m[1],m[2],-l(m,s));const S=new M,x=new M,q=new Array;this._data.visibleGaussianTiles.forEach(r=>{const{maxScale:n}=r,o=r.obb.minimumDistancePlane(u),h=r.obb.maximumDistancePlane(u),c=h<0,f=null!=S.dist&&null!=x.dist&&S.dist<o*v&&x.dist>h*v;if(c||f)return;if(!new P(r.obb.center,r.obb.radius+n).intersectRay(b,null))return;if(!r.obb.intersectRay(s,m,n))return;const{positions:g,squaredScales:C,gaussianAtlasIndices:y}=r,T=y.length;for(let u=0;u<T;u++){const r=3*u;a[0]=g[r]-s[0],a[1]=g[r+1]-s[1],a[2]=g[r+2]-s[2];const n=C[u],o=l(a,m),h=o*o;if(p(a)-h>n)continue;const c=o*v,f=t=>(t.point=t.point?t.point.fill(a[0],a[1],a[2]):d(a),t.dist=c,t.normal=w,t.layerViewUid=_,t);if((null==S.dist||c<S.dist)&&(null==e||e(s,i,c))&&f(S),0!==t.options.store&&(null==x.dist||c>x.dist)&&(null==e||e(s,i,c))&&f(x),2===t.options.store&&(null==e||e(s,i,c))){const t=new M;q.push(f(t))}}});const T=(t,e)=>{const{layerViewUid:s}=e,i=new C(e.point,s);t.set(0,i,e.dist,e.normal)};if(I(S)){const e=t.results.min;(null==e.distance||S.dist<e.distance)&&T(e,S)}if(I(x)&&0!==t.options.store){const e=t.results.max;(null==e.distance||x.dist>e.distance)&&T(e,x)}if(2===t.options.store)for(const r of q){const e=new y(b);T(e,r),t.results.all.push(e)}}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(t){this._slicePlaneEnabled!==t&&(this._slicePlaneEnabled=t,this.requestRender(1))}get data(){return this._data}destroy(){this._data.destroy(),super.destroy()}_onCameraChange(){const t=this.view.state.camera.eye,e=this.view.state.camera.ray.direction,s=.001;(Math.abs(t[0]-this._previousCameraPosition[0])>s||Math.abs(t[1]-this._previousCameraPosition[1])>s||Math.abs(t[2]-this._previousCameraPosition[2])>s||Math.abs(e[0]-this._previousCameraDirection[0])>s||Math.abs(e[1]-this._previousCameraDirection[1])>s||Math.abs(e[2]-this._previousCameraDirection[2])>s)&&(m(this._previousCameraPosition,t),m(this._previousCameraDirection,e),this._data.requestSort())}_prepareHighPrecisionCameraPosition(){o(this._passParameters.tileCameraPosition,this.camera.eye,1/F.tileSize),u(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),o(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,F.tileSize),r(this._passParameters.cameraDelta,this.camera.eye,this._passParameters.cameraDelta)}_handleFading(){if(0===this.fadeHelper.numFadingTiles)return void(this._previousFrameStart=null);this._previousFrameStart??=this.view.stage.renderer.renderContext.time;const t=this.view.stage?.renderer.renderContext.time-this._previousFrameStart;this.fadeHelper.updateAllTileFading(t),this._previousFrameStart=this.view.stage.renderer.renderContext.time,this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}static{this.tileSize=2.048}};function I(t){return null!=t.dist&&null!=t.point}t([s({constructOnly:!0})],H.prototype,"fadeHelper",void 0),H=F=t([i("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],H);class M{constructor(){this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}export{H as GaussianSplatRenderNode};
@@ -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{clamp as t}from"../../../../core/mathUtils.js";import{n as r,t as o}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newFloatArray as a}from"../../../../geometry/support/FloatArray.js";import{newShortArray as s}from"../../../../geometry/support/ShortArray.js";function e(t,r,o,n,a,s=2){const e=1/(Math.abs(o)+Math.abs(n)+Math.abs(a)),c=o*e,f=n*e,u=a<=0?(c>=0?1:-1)*(1-Math.abs(f)):c,h=a<=0?(f>=0?1:-1)*(1-Math.abs(c)):f,m=r*s;t[m]=i(u),t[m+1]=i(h)}function c(t){const r=t.length/3,o=s(2*r);let n=0;for(let a=0;a<r;++a)e(o,a,t[n++],t[n++],t[n++]);return o}function f(t,r){const a=t.length/3,s=new Int16Array(2*a);let c=0;const f=n();for(let n=0;n<a;++n)f[0]=t[c++],f[1]=t[c++],f[2]=t[c++],o(f,f,r),e(s,n,f[0],f[1],f[2]);return s}function u(t,o,n,a=2){const s=n*a,e=m(o[s]),c=m(o[s+1]),f=1-Math.abs(e)-Math.abs(c);return t[2]=f,f<0?(t[0]=(e>=0?1:-1)*(1-Math.abs(c)),t[1]=(c>=0?1:-1)*(1-Math.abs(e))):(t[0]=e,t[1]=c),r(t,t)}function h(t,r=2){const o=t.length/r,s=a(3*o),e=n();let c=0;for(let n=0;n<o;++n)u(e,t,n,r),s[c++]=e[0],s[c++]=e[1],s[c++]=e[2];return s}function i(r){return t(Math.round(32767*r),-32767,32767)}function m(r){return t(r/32767,-1,1)}export{f as compressAndTransformNormals,e as compressNormal,c as compressNormals,m as decodeInt16,u as decompressNormal,h as decompressNormals,i as encodeInt16};
5
+ import{clamp as t}from"../../../../core/mathUtils.js";import{t as r,n as o}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newFloatArray as a}from"../../../../geometry/support/FloatArray.js";import{newShortArray as s}from"../../../../geometry/support/ShortArray.js";function e(t,r,o,n,a,s=2){const e=1/(Math.abs(o)+Math.abs(n)+Math.abs(a)),c=o*e,f=n*e,u=a<=0?(c>=0?1:-1)*(1-Math.abs(f)):c,h=a<=0?(f>=0?1:-1)*(1-Math.abs(c)):f,m=r*s;t[m]=i(u),t[m+1]=i(h)}function c(t){const r=t.length/3,o=s(2*r);let n=0;for(let a=0;a<r;++a)e(o,a,t[n++],t[n++],t[n++]);return o}function f(t,o){const a=t.length/3,s=new Int16Array(2*a);let c=0;const f=n();for(let n=0;n<a;++n)f[0]=t[c++],f[1]=t[c++],f[2]=t[c++],r(f,f,o),e(s,n,f[0],f[1],f[2]);return s}function u(t,r,n,a=2){const s=n*a,e=m(r[s]),c=m(r[s+1]),f=1-Math.abs(e)-Math.abs(c);return t[2]=f,f<0?(t[0]=(e>=0?1:-1)*(1-Math.abs(c)),t[1]=(c>=0?1:-1)*(1-Math.abs(e))):(t[0]=e,t[1]=c),o(t,t)}function h(t,r=2){const o=t.length/r,s=a(3*o),e=n();let c=0;for(let n=0;n<o;++n)u(e,t,n,r),s[c++]=e[0],s[c++]=e[1],s[c++]=e[2];return s}function i(r){return t(Math.round(32767*r),-32767,32767)}function m(r){return t(r/32767,-1,1)}export{f as compressAndTransformNormals,e as compressNormal,c as compressNormals,m as decodeInt16,u as decompressNormal,h as decompressNormals,i as encodeInt16};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{generateUID as t}from"../../../../core/uid.js";import{multiply as i,copy as e,hasIdentityRotation as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o,IDENTITY as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as a,p as h,D as n,h as m,i as d,m as l,d as c}from"../../../../chunks/vec32.js";import{create as g,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Sphere as u}from"../../../../geometry/support/sphere.js";import{maxScale as f}from"../../support/mathUtils.js";import{Object3DOccludeeStateID as b,Object3DHighlightStateID as v}from"./Object3DStateID.js";import{assert as p}from"./Util.js";import{affectsGeometry as y}from"./VertexAttribute.js";import{addObject3DStateID as j,removeObject3DStateID as V}from"../materials/renderers/utils.js";class S{constructor(i={}){this.id=t(),this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=i.castShadow??!0,this.usesVerticalDistanceToGround=i.usesVerticalDistanceToGround??!1,this.graphicUid=i.graphicUid,this.layerViewUid=i.layerViewUid,i.isElevationSource&&(this.lastValidElevationBB=new x),this._geometries=i.geometries?Array.from(i.geometries):[]}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(t){p(null==this._layer||null==t,"Object3D can only be added to a single Layer"),this._layer=t}addGeometry(t){t.visible=this._visible,this._geometries.push(t);for(const i of this._highlightIds)t.addHighlight(i);this._emit("geometryAdded",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(t){const i=this._geometries.splice(t,1)[0];if(i){for(const t of this._highlightIds)i.removeHighlight(t);this._emit("geometryRemoved",{object:this,geometry:i}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(t,i,e=!1){this._emit("attributesChanged",{object:this,geometry:t,attribute:i,sync:e}),y(i)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometries)t.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new b;for(const i of this._geometries)i.occludees=j(i.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const i of this._geometries)i.occludees=V(i.occludees,t);this._emit("occlusionChanged",this)}highlight(t){const i=new v(t);for(const e of this._geometries)e.addHighlight(i);return this._emit("highlightChanged",this),this._highlightIds.add(i),i}removeHighlight(t){this._highlightIds.delete(t);for(const i of this._geometries)i.removeHighlight(t);this._emit("highlightChanged",this)}removeStateID(t){0===t.channel?this.removeHighlight(t):this.removeOcclude(t)}getCombinedStaticTransformation(t,e){return i(e,this.transformation,t.transformation)}getCombinedShaderTransformation(t,e=o()){return i(e,this.effectiveTransformation,t.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=new W,this._validateBoundingVolume(this._bvWorldSpace,0)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=new W,this._validateBoundingVolume(this._bvObjectSpace,1)),this._bvObjectSpace}_validateBoundingVolume(t,i){const e=1===i;for(const s of this._geometries){const i=s.boundingInfo;i&&A(i,t,e?s.transformation:this.getCombinedShaderTransformation(s))}a(t.bounds.center,t.min,t.max,.5);for(const s of this._geometries){const i=s.boundingInfo;if(null==i)continue;const o=e?s.transformation:this.getCombinedShaderTransformation(s),r=f(o);h(B,i.center,o);const a=n(B,t.bounds.center),m=i.radius*r;t.bounds.radius=Math.max(t.bounds.radius,a+m)}}_invalidateBoundingVolume(){const t=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&t&&this.layer.notifyObjectBBChanged(this,t)}_emit(t,i){this.layer?.events.emit(t,i)}get geometries(){return this._geometries}get transformation(){return this._transformation??r}set transformation(t){this._transformation=e(this._transformation??o(),t),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(t){this._shaderTransformation=t?e(this._shaderTransformation??o(),t):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}class x{constructor(){this._data=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]}get min(){return _(this._data[0],this._data[1],this._data[2])}get max(){return _(this._data[3],this._data[4],this._data[5])}minWith(t){const{_data:i}=this;i[0]=Math.min(i[0],t[0]),i[1]=Math.min(i[1],t[1]),i[2]=Math.min(i[2],t[2])}maxWith(t){const{_data:i}=this;i[3]=Math.max(i[3],t[0]),i[4]=Math.max(i[4],t[1]),i[5]=Math.max(i[5],t[2])}assignMinMax(t,i){for(let e=0;e<3;++e)this._data[0+e]=t[e],this._data[3+e]=i[e]}isEmpty(){return this._data[3]<this._data[0]&&this._data[4]<this._data[1]&&this._data[5]<this._data[2]}}class W extends x{constructor(){super(...arguments),this.bounds=new u}}function A(t,i,e){const o=t.bbMin,r=t.bbMax;if(s(e)){const t=m(M,e[12],e[13],e[14]);return d(T,o,t),d(C,r,t),i.minWith(T),void i.maxWith(C)}if(h(T,o,e),l(o,r))return i.minWith(T),void i.maxWith(T);h(C,r,e),i.minWith(T),i.minWith(C),i.maxWith(T),i.maxWith(C);for(let s=0;s<3;++s)c(T,o),c(C,r),T[s]=r[s],C[s]=o[s],h(T,T,e),h(C,C,e),i.minWith(T),i.minWith(C),i.maxWith(T),i.maxWith(C)}const M=g(),T=g(),C=g(),B=g();export{W as BoundingVolume,S as Object3D};
5
+ import"../../../../core/has.js";import{generateUID as t}from"../../../../core/uid.js";import{multiply as i,copy as e,hasIdentityRotation as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o,IDENTITY as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as a,p as h,C as n,h as m,i as d,m as l,d as c}from"../../../../chunks/vec32.js";import{create as g,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Sphere as u}from"../../../../geometry/support/sphere.js";import{maxScale as f}from"../../support/mathUtils.js";import{Object3DOccludeeStateID as b,Object3DHighlightStateID as v}from"./Object3DStateID.js";import{assert as p}from"./Util.js";import{affectsGeometry as y}from"./VertexAttribute.js";import{addObject3DStateID as j,removeObject3DStateID as V}from"../materials/renderers/utils.js";class S{constructor(i={}){this.id=t(),this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=i.castShadow??!0,this.usesVerticalDistanceToGround=i.usesVerticalDistanceToGround??!1,this.graphicUid=i.graphicUid,this.layerViewUid=i.layerViewUid,i.isElevationSource&&(this.lastValidElevationBB=new x),this._geometries=i.geometries?Array.from(i.geometries):[]}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(t){p(null==this._layer||null==t,"Object3D can only be added to a single Layer"),this._layer=t}addGeometry(t){t.visible=this._visible,this._geometries.push(t);for(const i of this._highlightIds)t.addHighlight(i);this._emit("geometryAdded",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(t){const i=this._geometries.splice(t,1)[0];if(i){for(const t of this._highlightIds)i.removeHighlight(t);this._emit("geometryRemoved",{object:this,geometry:i}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(t,i,e=!1){this._emit("attributesChanged",{object:this,geometry:t,attribute:i,sync:e}),y(i)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometries)t.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new b;for(const i of this._geometries)i.occludees=j(i.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const i of this._geometries)i.occludees=V(i.occludees,t);this._emit("occlusionChanged",this)}highlight(t){const i=new v(t);for(const e of this._geometries)e.addHighlight(i);return this._emit("highlightChanged",this),this._highlightIds.add(i),i}removeHighlight(t){this._highlightIds.delete(t);for(const i of this._geometries)i.removeHighlight(t);this._emit("highlightChanged",this)}removeStateID(t){0===t.channel?this.removeHighlight(t):this.removeOcclude(t)}getCombinedStaticTransformation(t,e){return i(e,this.transformation,t.transformation)}getCombinedShaderTransformation(t,e=o()){return i(e,this.effectiveTransformation,t.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=new W,this._validateBoundingVolume(this._bvWorldSpace,0)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=new W,this._validateBoundingVolume(this._bvObjectSpace,1)),this._bvObjectSpace}_validateBoundingVolume(t,i){const e=1===i;for(const s of this._geometries){const i=s.boundingInfo;i&&A(i,t,e?s.transformation:this.getCombinedShaderTransformation(s))}a(t.bounds.center,t.min,t.max,.5);for(const s of this._geometries){const i=s.boundingInfo;if(null==i)continue;const o=e?s.transformation:this.getCombinedShaderTransformation(s),r=f(o);h(B,i.center,o);const a=n(B,t.bounds.center),m=i.radius*r;t.bounds.radius=Math.max(t.bounds.radius,a+m)}}_invalidateBoundingVolume(){const t=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&t&&this.layer.notifyObjectBBChanged(this,t)}_emit(t,i){this.layer?.events.emit(t,i)}get geometries(){return this._geometries}get transformation(){return this._transformation??r}set transformation(t){this._transformation=e(this._transformation??o(),t),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(t){this._shaderTransformation=t?e(this._shaderTransformation??o(),t):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}class x{constructor(){this._data=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]}get min(){return _(this._data[0],this._data[1],this._data[2])}get max(){return _(this._data[3],this._data[4],this._data[5])}minWith(t){const{_data:i}=this;i[0]=Math.min(i[0],t[0]),i[1]=Math.min(i[1],t[1]),i[2]=Math.min(i[2],t[2])}maxWith(t){const{_data:i}=this;i[3]=Math.max(i[3],t[0]),i[4]=Math.max(i[4],t[1]),i[5]=Math.max(i[5],t[2])}assignMinMax(t,i){for(let e=0;e<3;++e)this._data[0+e]=t[e],this._data[3+e]=i[e]}isEmpty(){return this._data[3]<this._data[0]&&this._data[4]<this._data[1]&&this._data[5]<this._data[2]}}class W extends x{constructor(){super(...arguments),this.bounds=new u}}function A(t,i,e){const o=t.bbMin,r=t.bbMax;if(s(e)){const t=m(M,e[12],e[13],e[14]);return d(C,o,t),d(T,r,t),i.minWith(C),void i.maxWith(T)}if(h(C,o,e),l(o,r))return i.minWith(C),void i.maxWith(C);h(T,r,e),i.minWith(C),i.minWith(T),i.maxWith(C),i.maxWith(T);for(let s=0;s<3;++s)c(C,o),c(T,r),C[s]=r[s],T[s]=o[s],h(C,C,e),h(T,T,e),i.minWith(C),i.minWith(T),i.maxWith(C),i.maxWith(T)}const M=g(),C=g(),T=g(),B=g();export{W as BoundingVolume,S as Object3D};