@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,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 i from"../../../core/Accessor.js";import e from"../../../core/Logger.js";import{lerp as r}from"../../../core/mathUtils.js";import{createScreenPointArray as s,createRenderScreenPointArray3 as o}from"../../../core/screenUtils.js";import{property as n,subclass as h}from"../../../core/accessorSupport/decorators.js";import{copy as a,multiply as p,invert as u,transpose as l,frustum as _,equals as v,lookAt as c}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as d,exactEquals as y}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as g}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as m,h as f,D as x,d as M,m as D,a as j,g as R,w as P,v as V,j as F,b as C,f as b,n as S,E as T}from"../../../chunks/vec32.js";import{create as I,UNIT_Z as A}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as E,e as O,a as U,f as H,g as k,t as z}from"../../../chunks/vec42.js";import{fromValues as W,create as Y}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as L,copy as X,fromMatrix as q}from"../../../geometry/support/frustum.js";import{create as G}from"../../../geometry/support/ray.js";import{projectPointSignedLength as N}from"../../../geometry/support/vector.js";import{viewAngle as B}from"../state/utils/viewUtils.js";import{fovd2fovx as J,fovx2fovd as K,fovd2fovy as Q,fovy2fovd as Z}from"../webgl-engine/lib/fov.js";var $;let tt=$=class extends i{constructor(t){super(t),this._ray=G(),this._viewport=W(0,0,1,1),this._padding=W(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=g(1,1e3),this._viewDirty=!0,this._viewMatrix=w(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=w(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=w(),this._frustumDirty=!0,this._frustum=L(),this._fullViewport=Y(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=I(),this._up=I(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return m(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){a(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),f(I(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),f(I(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),f(I(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=E(Y(),this._viewport,1/this.pixelRatio),i=this._get("screenViewport");return i&&O(t,i)?i:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=E(Y(),this._padding,1/this.pixelRatio),i=this._get("screenPadding");return i&&O(t,i)?i:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){U(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),H(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(p(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return u(w(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||w()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return J(this._fov,this.width,this.height)}set fovX(t){this._fov=K(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return Q(this._fov,this.width,this.height)}set fovY(t){this._fov=Z(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return x(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(u(this._viewInverseTransposeMatrix,this.viewMatrix),l(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:i,far:e}=this;return 2*i*e/(e+i-t*(e-i))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,i=this.height,e=this.near*Math.tan(this.fovY/2)*2,r=e*this._aspect,s=e/this.rows,o=r/this.columns,n=-r/2+this.column*o,h=n+o,a=-e/2+this.row*s,p=a+s,u=_(w(),n*(1+2*this._padding[3]/t),h*(1+2*this._padding[1]/t),a*(1+2*this._padding[2]/i),p*(1+2*this._padding[0]/i),this.near,this.far),l=this._get("projectionMatrix");return l&&v(l,u)?l:u}copyFrom(t){M(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,H(this._viewport,t.viewport),this.notifyChange("_viewport"),H(this._padding,t.padding),this.notifyChange("_padding"),d(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const i=t;return this._viewDirty=i._viewDirty,this._viewDirty||(a(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=i._frustumDirty,this._frustumDirty||(X(this._frustum,t.frustum),this._frustumDirty=!1),i._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(a(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),H(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new $).copyFrom(this)}equals(t){return D(this.eye,t.eye)&&D(this.center,t.center)&&D(this.up,t.up)&&U(this._viewport,t.viewport)&&U(this._padding,t.padding)&&y(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}almostEquals(t){const i=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||k(t.screenPadding,this.screenPadding)>=i||k(this.screenViewport,t.screenViewport)>=i||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;j(st,t.eye,t.center),j(ot,this.eye,this.center);const e=R(st,ot),r=P(st),s=P(ot),o=5e-4;return e*e>=(1-1e-10)*r*s&&V(t.eye,this.eye)<Math.max(r,s)*o*o}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs(N(this.viewForward,m(st,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,i){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(i||1)))}getScreenCenter(t=s()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,i=.5,e=.5){return t[0]=this.padding[3]+this.width*i,t[1]=this.padding[2]+this.height*e,t[2]=.5,t}setGLViewport(t){const i=this.viewport,e=this.padding;t.setViewport(i[0]-e[3],i[1]-e[2],i[2]+e[1]+e[3],i[3]+e[0]+e[2])}applyProjection(t,i){t!==et&&M(et,t),et[3]=1,z(et,et,this.projectionMatrix);const e=Math.abs(et[3]);F(et,et,1/e);const s=this.fullViewport;i[0]=r(0,s[0]+s[2],.5+.5*et[0]),i[1]=r(0,s[1]+s[3],.5+.5*et[1]),i[2]=.5*(et[2]+1),i[3]=e}unapplyProjection(t,i){const e=this.fullViewport;et[0]=(t[0]/(e[0]+e[2])*2-1)*t[3],et[1]=(t[1]/(e[1]+e[3])*2-1)*t[3],et[2]=(2*t[2]-1)*t[3],et[3]=t[3],null!=this.inverseProjectionMatrix&&(z(et,et,this.inverseProjectionMatrix),i[0]=et[0],i[1]=et[1],i[2]=et[2])}projectToScreen(t,i){return this.projectToRenderScreen(t,nt),this.renderToScreen(nt,i),i}projectToRenderScreen(t,i){if(et[0]=t[0],et[1]=t[1],et[2]=t[2],et[3]=1,z(et,et,this.viewProjectionMatrix),0===et[3])return null;const e=et;F(e,e,1/Math.abs(et[3]));const s=this.fullViewport,o=r(0,s[0]+s[2],.5+.5*e[0]),n=r(0,s[1]+s[3],.5+.5*e[1]);return"x"in i?(i.x=o,i.y=n):(i[0]=o,i[1]=n,i.length>2&&(i[2]=.5*(e[2]+1))),i}unprojectFromScreen(t,i){return this.unprojectFromRenderScreen(this.screenToRender(t,nt),i)}unprojectFromRenderScreen(t,i){if(p(rt,this.projectionMatrix,this.viewMatrix),!u(rt,rt))return null;const e=this.fullViewport;return et[0]=2*(t[0]-e[0])/e[2]-1,et[1]=2*(t[1]-e[1])/e[3]-1,et[2]=2*t[2]-1,et[3]=1,z(et,et,rt),0===et[3]?null:(i[0]=et[0]/et[3],i[1]=et[1]/et[3],i[2]=et[2]/et[3],i)}constrainWindowSize(t,i,e,r){const s=t*this.pixelRatio,o=i*this.pixelRatio,n=Math.max(s-e/2,0),h=Math.max(this.fullHeight-o-r/2,0),a=-Math.min(s-e/2,0),p=-Math.min(this.fullHeight-o-r/2,0),u=e-a- -Math.min(this.fullWidth-s-e/2,0),l=r-p- -Math.min(o-r/2,0);return[Math.round(n),Math.round(h),Math.round(u),Math.round(l)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,i){const e=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return i[0]=e,i[1]=r,i}renderToScreen(t,i){const e=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;i[0]=e,i[1]=r}sphereFrustumCoverage(t,i){const{center:e,eye:r,distance:s,fovY:o}=this,n=Math.abs(Math.PI/2-B(i,e,r));return t.frustumCoverage(n,s,o)}_computeUpGlobal(){m(st,this.center,this.eye);const t=C(this.center);t<1?D(this._up,A)&&(M(this._up,A),this._markViewDirty(),this.notifyChange("_up")):Math.abs(R(st,this.center))>.9999*C(st)*t||(b(ot,st,this.center),b(ot,ot,st),S(ot,ot),D(this._up,ot)||(M(this._up,ot),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){T(st,this.eye,this.center),Math.abs(st[2])<=.9999&&(F(st,st,st[2]),f(st,-st[0],-st[1],1-st[2]),S(st,st),D(this._up,st)||(M(this._up,st),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,i,r=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?D(t,i)||(M(i,t),this._markViewDirty(),r.length&&this.notifyChange(r)):e.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(q(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(c(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};t([n()],tt.prototype,"_viewport",void 0),t([n()],tt.prototype,"_padding",void 0),t([n()],tt.prototype,"_fov",void 0),t([n()],tt.prototype,"_nearFar",void 0),t([n()],tt.prototype,"_viewDirty",void 0),t([n()],tt.prototype,"_viewMatrix",void 0),t([n()],tt.prototype,"_pixelRatio",void 0),t([n()],tt.prototype,"pixelRatio",null),t([n()],tt.prototype,"row",void 0),t([n()],tt.prototype,"column",void 0),t([n()],tt.prototype,"_rows",void 0),t([n()],tt.prototype,"rows",null),t([n()],tt.prototype,"_columns",void 0),t([n()],tt.prototype,"columns",null),t([n()],tt.prototype,"eye",null),t([n()],tt.prototype,"center",null),t([n()],tt.prototype,"_center",void 0),t([n()],tt.prototype,"up",null),t([n()],tt.prototype,"_up",void 0),t([n()],tt.prototype,"viewMatrix",null),t([n({readOnly:!0})],tt.prototype,"viewForward",null),t([n({readOnly:!0})],tt.prototype,"viewUp",null),t([n({readOnly:!0})],tt.prototype,"viewRight",null),t([n({readOnly:!0})],tt.prototype,"nearFar",null),t([n()],tt.prototype,"near",null),t([n()],tt.prototype,"far",null),t([n()],tt.prototype,"viewport",null),t([n({readOnly:!0})],tt.prototype,"screenViewport",null),t([n({readOnly:!0})],tt.prototype,"screenPadding",null),t([n()],tt.prototype,"x",null),t([n()],tt.prototype,"y",null),t([n()],tt.prototype,"width",null),t([n()],tt.prototype,"height",null),t([n()],tt.prototype,"fullWidth",null),t([n()],tt.prototype,"fullHeight",null),t([n({readOnly:!0})],tt.prototype,"_aspect",null),t([n()],tt.prototype,"padding",null),t([n({readOnly:!0})],tt.prototype,"projectionMatrix",null),t([n({readOnly:!0})],tt.prototype,"inverseProjectionMatrix",null),t([n()],tt.prototype,"fov",null),t([n()],tt.prototype,"fovX",null),t([n()],tt.prototype,"fovY",null),t([n()],tt.prototype,"viewInverseTransposeMatrix",null),t([n({readOnly:!0})],tt.prototype,"_projectionMatrixInternal",null),t([n()],tt.prototype,"relativeElevation",void 0),tt=$=t([h("esri.views.3d.webgl.RenderCamera")],tt);const it=tt,et=Y(),rt=w(),st=I(),ot=I(),nt=o();export{it as default};
5
+ import{__decorate as t}from"tslib";import i from"../../../core/Accessor.js";import e from"../../../core/Logger.js";import{lerp as r}from"../../../core/mathUtils.js";import{createScreenPointArray as s,createRenderScreenPointArray3 as o}from"../../../core/screenUtils.js";import{property as n,subclass as h}from"../../../core/accessorSupport/decorators.js";import{copy as a,multiply as p,invert as u,transpose as l,frustum as _,equals as v,lookAt as c}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as d,exactEquals as y}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as g}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as m,h as f,C as x,d as M,m as D,a as j,g as R,w as P,v as V,j as F,b as C,f as b,n as S,D as T}from"../../../chunks/vec32.js";import{create as I,UNIT_Z as A}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as E,e as O,a as U,f as H,g as k,t as z}from"../../../chunks/vec42.js";import{fromValues as W,create as Y}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as L,copy as X,fromMatrix as q}from"../../../geometry/support/frustum.js";import{create as G}from"../../../geometry/support/ray.js";import{projectPointSignedLength as N}from"../../../geometry/support/vector.js";import{viewAngle as B}from"../state/utils/viewUtils.js";import{fovd2fovx as J,fovx2fovd as K,fovd2fovy as Q,fovy2fovd as Z}from"../webgl-engine/lib/fov.js";var $;let tt=$=class extends i{constructor(t){super(t),this._ray=G(),this._viewport=W(0,0,1,1),this._padding=W(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=g(1,1e3),this._viewDirty=!0,this._viewMatrix=w(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=w(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=w(),this._frustumDirty=!0,this._frustum=L(),this._fullViewport=Y(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=I(),this._up=I(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return m(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){a(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),f(I(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),f(I(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),f(I(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=E(Y(),this._viewport,1/this.pixelRatio),i=this._get("screenViewport");return i&&O(t,i)?i:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=E(Y(),this._padding,1/this.pixelRatio),i=this._get("screenPadding");return i&&O(t,i)?i:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){U(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),H(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(p(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return u(w(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||w()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return J(this._fov,this.width,this.height)}set fovX(t){this._fov=K(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return Q(this._fov,this.width,this.height)}set fovY(t){this._fov=Z(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return x(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(u(this._viewInverseTransposeMatrix,this.viewMatrix),l(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:i,far:e}=this;return 2*i*e/(e+i-t*(e-i))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const t=this.width,i=this.height,e=this.near*Math.tan(this.fovY/2)*2,r=e*this._aspect,s=e/this.rows,o=r/this.columns,n=-r/2+this.column*o,h=n+o,a=-e/2+this.row*s,p=a+s,u=_(w(),n*(1+2*this._padding[3]/t),h*(1+2*this._padding[1]/t),a*(1+2*this._padding[2]/i),p*(1+2*this._padding[0]/i),this.near,this.far),l=this._get("projectionMatrix");return l&&v(l,u)?l:u}copyFrom(t){M(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,H(this._viewport,t.viewport),this.notifyChange("_viewport"),H(this._padding,t.padding),this.notifyChange("_padding"),d(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const i=t;return this._viewDirty=i._viewDirty,this._viewDirty||(a(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=i._frustumDirty,this._frustumDirty||(X(this._frustum,t.frustum),this._frustumDirty=!1),i._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(a(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),H(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new $).copyFrom(this)}equals(t){return D(this.eye,t.eye)&&D(this.center,t.center)&&D(this.up,t.up)&&U(this._viewport,t.viewport)&&U(this._padding,t.padding)&&y(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}almostEquals(t){const i=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||k(t.screenPadding,this.screenPadding)>=i||k(this.screenViewport,t.screenViewport)>=i||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;j(st,t.eye,t.center),j(ot,this.eye,this.center);const e=R(st,ot),r=P(st),s=P(ot),o=5e-4;return e*e>=(1-1e-10)*r*s&&V(t.eye,this.eye)<Math.max(r,s)*o*o}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs(N(this.viewForward,m(st,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,i){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(i||1)))}getScreenCenter(t=s()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,i=.5,e=.5){return t[0]=this.padding[3]+this.width*i,t[1]=this.padding[2]+this.height*e,t[2]=.5,t}setGLViewport(t){const i=this.viewport,e=this.padding;t.setViewport(i[0]-e[3],i[1]-e[2],i[2]+e[1]+e[3],i[3]+e[0]+e[2])}applyProjection(t,i){t!==et&&M(et,t),et[3]=1,z(et,et,this.projectionMatrix);const e=Math.abs(et[3]);F(et,et,1/e);const s=this.fullViewport;i[0]=r(0,s[0]+s[2],.5+.5*et[0]),i[1]=r(0,s[1]+s[3],.5+.5*et[1]),i[2]=.5*(et[2]+1),i[3]=e}unapplyProjection(t,i){const e=this.fullViewport;et[0]=(t[0]/(e[0]+e[2])*2-1)*t[3],et[1]=(t[1]/(e[1]+e[3])*2-1)*t[3],et[2]=(2*t[2]-1)*t[3],et[3]=t[3],null!=this.inverseProjectionMatrix&&(z(et,et,this.inverseProjectionMatrix),i[0]=et[0],i[1]=et[1],i[2]=et[2])}projectToScreen(t,i){return this.projectToRenderScreen(t,nt),this.renderToScreen(nt,i),i}projectToRenderScreen(t,i){if(et[0]=t[0],et[1]=t[1],et[2]=t[2],et[3]=1,z(et,et,this.viewProjectionMatrix),0===et[3])return null;const e=et;F(e,e,1/Math.abs(et[3]));const s=this.fullViewport,o=r(0,s[0]+s[2],.5+.5*e[0]),n=r(0,s[1]+s[3],.5+.5*e[1]);return"x"in i?(i.x=o,i.y=n):(i[0]=o,i[1]=n,i.length>2&&(i[2]=.5*(e[2]+1))),i}unprojectFromScreen(t,i){return this.unprojectFromRenderScreen(this.screenToRender(t,nt),i)}unprojectFromRenderScreen(t,i){if(p(rt,this.projectionMatrix,this.viewMatrix),!u(rt,rt))return null;const e=this.fullViewport;return et[0]=2*(t[0]-e[0])/e[2]-1,et[1]=2*(t[1]-e[1])/e[3]-1,et[2]=2*t[2]-1,et[3]=1,z(et,et,rt),0===et[3]?null:(i[0]=et[0]/et[3],i[1]=et[1]/et[3],i[2]=et[2]/et[3],i)}constrainWindowSize(t,i,e,r){const s=t*this.pixelRatio,o=i*this.pixelRatio,n=Math.max(s-e/2,0),h=Math.max(this.fullHeight-o-r/2,0),a=-Math.min(s-e/2,0),p=-Math.min(this.fullHeight-o-r/2,0),u=e-a- -Math.min(this.fullWidth-s-e/2,0),l=r-p- -Math.min(o-r/2,0);return[Math.round(n),Math.round(h),Math.round(u),Math.round(l)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,i){const e=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return i[0]=e,i[1]=r,i}renderToScreen(t,i){const e=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;i[0]=e,i[1]=r}sphereFrustumCoverage(t,i){const{center:e,eye:r,distance:s,fovY:o}=this,n=Math.abs(Math.PI/2-B(i,e,r));return t.frustumCoverage(n,s,o)}_computeUpGlobal(){m(st,this.center,this.eye);const t=C(this.center);t<1?D(this._up,A)&&(M(this._up,A),this._markViewDirty(),this.notifyChange("_up")):Math.abs(R(st,this.center))>.9999*C(st)*t||(b(ot,st,this.center),b(ot,ot,st),S(ot,ot),D(this._up,ot)||(M(this._up,ot),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){T(st,this.eye,this.center),Math.abs(st[2])<=.9999&&(F(st,st,st[2]),f(st,-st[0],-st[1],1-st[2]),S(st,st),D(this._up,st)||(M(this._up,st),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,i,r=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?D(t,i)||(M(i,t),this._markViewDirty(),r.length&&this.notifyChange(r)):e.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(q(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(c(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};t([n()],tt.prototype,"_viewport",void 0),t([n()],tt.prototype,"_padding",void 0),t([n()],tt.prototype,"_fov",void 0),t([n()],tt.prototype,"_nearFar",void 0),t([n()],tt.prototype,"_viewDirty",void 0),t([n()],tt.prototype,"_viewMatrix",void 0),t([n()],tt.prototype,"_pixelRatio",void 0),t([n()],tt.prototype,"pixelRatio",null),t([n()],tt.prototype,"row",void 0),t([n()],tt.prototype,"column",void 0),t([n()],tt.prototype,"_rows",void 0),t([n()],tt.prototype,"rows",null),t([n()],tt.prototype,"_columns",void 0),t([n()],tt.prototype,"columns",null),t([n()],tt.prototype,"eye",null),t([n()],tt.prototype,"center",null),t([n()],tt.prototype,"_center",void 0),t([n()],tt.prototype,"up",null),t([n()],tt.prototype,"_up",void 0),t([n()],tt.prototype,"viewMatrix",null),t([n({readOnly:!0})],tt.prototype,"viewForward",null),t([n({readOnly:!0})],tt.prototype,"viewUp",null),t([n({readOnly:!0})],tt.prototype,"viewRight",null),t([n({readOnly:!0})],tt.prototype,"nearFar",null),t([n()],tt.prototype,"near",null),t([n()],tt.prototype,"far",null),t([n()],tt.prototype,"viewport",null),t([n({readOnly:!0})],tt.prototype,"screenViewport",null),t([n({readOnly:!0})],tt.prototype,"screenPadding",null),t([n()],tt.prototype,"x",null),t([n()],tt.prototype,"y",null),t([n()],tt.prototype,"width",null),t([n()],tt.prototype,"height",null),t([n()],tt.prototype,"fullWidth",null),t([n()],tt.prototype,"fullHeight",null),t([n({readOnly:!0})],tt.prototype,"_aspect",null),t([n()],tt.prototype,"padding",null),t([n({readOnly:!0})],tt.prototype,"projectionMatrix",null),t([n({readOnly:!0})],tt.prototype,"inverseProjectionMatrix",null),t([n()],tt.prototype,"fov",null),t([n()],tt.prototype,"fovX",null),t([n()],tt.prototype,"fovY",null),t([n()],tt.prototype,"viewInverseTransposeMatrix",null),t([n({readOnly:!0})],tt.prototype,"_projectionMatrixInternal",null),t([n()],tt.prototype,"relativeElevation",void 0),tt=$=t([h("esri.views.3d.webgl.RenderCamera")],tt);const it=tt,et=Y(),rt=w(),st=I(),ot=I(),nt=o();export{it as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as s}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{m as o,I as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as n}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as l}from"../../../../../../chunks/vec42.js";import{freeze as u,fromValues as h}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ComponentTechnique as p}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as c}from"./ComponentTechniqueConfiguration.js";import{parameter as d,parameterBlock as m,MaterialBase as v,MaterialParameterBlock as g}from"../../../core/material/MaterialBase.js";import{isColor as x}from"../../../core/shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as f}from"../../../core/util/TwoVectorPosition.js";import{advancedMRRFactors as y}from"../../../materials/pbrUtils.js";import{defaultHighlightName as M}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as b}from"../../../../../../webscene/support/AlphaCutoff.js";class T extends v{constructor(e,o,i,n){super(),this.toMapSpace=o,this.useENUForGlobalOverlayUV=i,this.baseColor=u(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.sphereDepthInterpolate=!1,this.mrrFactors=y,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=0,this.commonMaterialParameters=new S,this.componentParameters=new C,this.textureBackedBuffer=null,this.objectOpacity=1,this.textureAlphaCutoff=b,this.alphaDiscardMode=1,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=1,this.hasOccludees=!1;const l=s(e.rotationScale);t(l,l),r(l,l),this.transformNormalGlobalFromModel=l;const h=new f(e.position);this.transformWorldFromModelTL=h.low,this.transformWorldFromModelTH=h.high,this.transformWorldFromModelRS=e.rotationScale,this._configuration=new c(n),this._updateMaterialConfiguration()}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get _hasEmissiveBase(){return null!=this.emissionTexture||!o(this.emissiveBaseColor,n)}get _hasEmissiveStrength(){return 2!==this.componentParameters.emissiveOverride}get hasEmissions(){return this._hasEmissiveStrength&&(this._hasEmissiveBase||2!==this.componentParameters.emissiveSourceOverride)}get texture(){return this.baseColorTexture?.texture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.texture}get textureEmissive(){return this.emissionTexture?.texture}get textureOcclusion(){return this.occlusionTexture?.texture}get textureNormal(){return this.normalTexture?.texture}update(e){e(this)}acquireTechnique(e,t,r,s){const o=this._updateConfiguration(t,r,s);return e.get(p,o)}_updateConfiguration(e,t,r){return this._updateMaterialConfiguration(),this._updateDrawConfiguration(e,t,r)}_updateMaterialConfiguration(){if(!this.dirty)return;const e=this._configuration;e.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,e.hasOcclusionTexture=null!=this.occlusionTexture,e.hasNormalTexture=null!=this.normalTexture,e.sphereDepthInterpolate=this.sphereDepthInterpolate&&e.spherical,e.ellipsoidMode=this.ellipsoidMode,e.componentData=this.componentParameters.type,e.cullFace=this.commonMaterialParameters.cullFace,e.doubleSidedMode=this.commonMaterialParameters.doubleSided?1:0,e.hasColorTexture=null!=this.baseColorTexture,e.alphaDiscardMode=this.alphaDiscardMode,e.hasPolygonOffset=this.polygonOffsetEnabled,this._setClean()}_updateDrawConfiguration(e,t,r){const s=this._configuration,o=e.identifier,i=0===o;s.hasEmission=t.hasEmission&&i,s.renderOccluded=9===t.slot,s.hasVertexColors=r.hasVertexColors,s.hasNormals=r.hasNormals,s.textureCoordinateType=r.textureCoordinateType,s.oitPass=i?t.oitPass:0,s.terrainDepthTest=i&&t.terrainDepthTest,s.cullAboveTerrain=!!i&&t.cullAboveTerrain,s.integratedMeshMode=this.isIntegratedMesh?D(t)?w(t)?3:2:1:0,s.pbrMode=3===s.integratedMeshMode?4:this.usePBR?this.hasParametersFromSource?r.shadeNormals&&this.isIntegratedMesh?0:2:1:0;const a=1===this.componentParameters.emissiveSourceOverride,n=2===this.componentParameters.emissiveSourceOverride,l=null!=this.emissionTexture;s.emissionSource=this.hasEmissions?this._hasEmissiveBase&&1===s.pbrMode?n?l?4:2:a?l?5:7:6:a?7:6:0,s.shadeNormals=r.shadeNormals,s.normalType=s.hasNormals?1:2;const u=null!=t.slicePlane&&this.commonMaterialParameters.hasSlicePlane;s.hasSlicePlane=u,s.isGroundSlice=u&&this.commonMaterialParameters.isGround;const h=this._computeMaterialPass();s.blendingEnabled=1===h||2===h||s.isGroundSlice,s.hasHighlightMixTexture=2===o&&null!=t.highlightMixTexture,s.output=e.output,s.snowCover=i&&t.snowCover>0,s.vertexDiscardMode=i&&2===h?e.transparent?2:1:0,s.olidColor=i&&9===e.output;const p=i&&x(e.output);return s.receiveAmbientOcclusion=p&&r.applySSAO&&null!=t.ssao?.getTexture(),s.hasOccludees=p&&t.hasOccludees,s.receiveShadows=p&&t.shadowMap.ready,s.screenSpaceReflections=p&&null!=t.ssr.lastFrameColor,s.cloudReflections=p&&null!=t.clouds.data?.cubeMap?.colorTexture,s}submit(e,t,r){if(this.objectOpacity<=0)return;const{componentData:s,renderable:o}=r,{geometry:i}=o,a=o.meta.cameraDepthSquared;s.updateHighlights(t.highlights);const{geometryRanges:n,highlightRangesMap:l,shadowmapRanges:u}=s,h=e=>e.submitDraw(this,i,n,a);switch(this._computeMaterialPass()){case 0:h(e.opaque);break;case 1:h(e.transparent);break;case 2:h(e.opaque),h(e.transparent);break;case 3:h(e.integratedMesh),j(t)&&h(e.occludedGround),P(t)&&h(e.highlightIntegratedMesh);break;case 4:h(e.transparentIntegratedMesh)}if(2!==this.componentParameters.castShadows){if(null!=l)for(const t of l)t[0]===M&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=u&&e.defaultShadowMap.submitDraw(this,i,u,a),h(e.shadowMap)}if(null!=l)for(const p of l)e.highlight.submitDraw(this,i,p[1],a,p[0]);t.viewshedEnabled&&h(e.viewshedShadowMap)}_computeMaterialPass(){if(this.isIntegratedMesh&&this.objectOpacity>=1)return 3;if(this.isIntegratedMesh&&this.objectOpacity<1)return 4;if(this.objectOpacity<1)return 1;if(0===this.componentParameters.opaqueOverride)return 0;if(this.baseColor[3]<1||0===this.alphaDiscardMode||3===this.alphaDiscardMode)return 1;switch(this.componentParameters.transparent){case 2:return 0;case 0:return 1;case 1:return 2}}}e([d({vectorOps:l})],T.prototype,"baseColor",void 0),e([d()],T.prototype,"usePBR",void 0),e([d()],T.prototype,"hasParametersFromSource",void 0),e([d()],T.prototype,"sphereDepthInterpolate",void 0),e([d({vectorOps:i})],T.prototype,"mrrFactors",void 0),e([d({dispose:!0})],T.prototype,"baseColorTexture",void 0),e([d({dispose:!0})],T.prototype,"metallicRoughnessTexture",void 0),e([d({dispose:!0})],T.prototype,"normalTexture",void 0),e([d({dispose:!0})],T.prototype,"occlusionTexture",void 0),e([d({dispose:!0})],T.prototype,"emissionTexture",void 0),e([d({vectorOps:i})],T.prototype,"emissiveBaseColor",void 0),e([d()],T.prototype,"emissiveStrength",void 0),e([m()],T.prototype,"commonMaterialParameters",void 0),e([m()],T.prototype,"componentParameters",void 0),e([d()],T.prototype,"textureBackedBuffer",void 0),e([d()],T.prototype,"objectOpacity",void 0),e([d()],T.prototype,"textureAlphaCutoff",void 0),e([d()],T.prototype,"alphaDiscardMode",void 0),e([d()],T.prototype,"isIntegratedMesh",void 0),e([d()],T.prototype,"polygonOffsetEnabled",void 0),e([d()],T.prototype,"ellipsoidMode",void 0),e([d()],T.prototype,"hasOccludees",void 0);class S extends g{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=2,this.isGround=!1,this.hasSlicePlane=!0}}e([d()],S.prototype,"doubleSided",void 0),e([d()],S.prototype,"cullFace",void 0),e([d()],S.prototype,"isGround",void 0),e([d()],S.prototype,"hasSlicePlane",void 0);class C extends g{constructor(){super(...arguments),this.externalColor=h(1,1,1,1),this.externalColorMixMode=1,this.emissiveStrength=0,this.emissiveSource=0,this.castShadows=0}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}get visible(){return this.externalColor[3]>0?0:2}get type(){return 0}}e([d({vectorOps:l})],C.prototype,"externalColor",void 0),e([d()],C.prototype,"externalColorMixMode",void 0),e([d()],C.prototype,"emissiveStrength",void 0),e([d()],C.prototype,"emissiveSource",void 0),e([d()],C.prototype,"castShadows",void 0);class O extends g{constructor(){super(...arguments),this.transparent=2,this.opaqueOverride=2,this.emissiveOverride=2,this.emissiveSourceOverride=2,this.castShadows=2}get type(){return 1}}function P(e){return null!=e.overlay?.getTexture(2)}function w(e){return null!=e.overlay?.getTexture(3)}function D(e){return null!=e.overlay?.getTexture(1)}function j(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}e([d()],O.prototype,"transparent",void 0),e([d()],O.prototype,"opaqueOverride",void 0),e([d()],O.prototype,"emissiveOverride",void 0),e([d()],O.prototype,"emissiveSourceOverride",void 0),e([d()],O.prototype,"castShadows",void 0);export{S as CommonMaterialParameters,T as ComponentMaterial,C as ComponentParametersUniform,O as ComponentParametersVarying};
5
+ import{__decorate as e}from"tslib";import{invert as t,transpose as r}from"../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as s}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{m as o,I as i}from"../../../../../../chunks/vec32.js";import{freeze as a,ZEROS as n}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{v as l}from"../../../../../../chunks/vec42.js";import{freeze as u,fromValues as h}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{ComponentTechnique as p}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as c}from"./ComponentTechniqueConfiguration.js";import{parameter as d,parameterBlock as m,MaterialBase as v,MaterialParameterBlock as g}from"../../../core/material/MaterialBase.js";import{isColor as x}from"../../../core/shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as f}from"../../../core/util/TwoVectorPosition.js";import{advancedMRRFactors as y}from"../../../materials/pbrUtils.js";import{defaultHighlightName as M}from"../../../../../support/HighlightDefaults.js";import{alphaCutoff as T}from"../../../../../../webscene/support/AlphaCutoff.js";class b extends v{constructor(e,o,i,n){super(),this.toMapSpace=o,this.useENUForGlobalOverlayUV=i,this.baseColor=u(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.sphereDepthInterpolate=!1,this.mrrFactors=y,this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.normalTexture=null,this.occlusionTexture=null,this.emissionTexture=null,this.emissiveBaseColor=a(0,0,0),this.emissiveStrength=0,this.commonMaterialParameters=new S,this.componentParameters=new C,this.textureBackedBuffer=null,this.objectOpacity=1,this.textureAlphaCutoff=T,this.alphaDiscardMode=1,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=1,this.hasOccludees=!1;const l=s(e.rotationScale);t(l,l),r(l,l),this.transformNormalGlobalFromModel=l;const h=new f(e.position);this.transformWorldFromModelTL=h.low,this.transformWorldFromModelTH=h.high,this.transformWorldFromModelRS=e.rotationScale,this._configuration=new c(n),this._updateMaterialConfiguration()}dispose(){this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get _hasEmissiveBase(){return null!=this.emissionTexture||!o(this.emissiveBaseColor,n)}get _hasEmissiveStrength(){return 2!==this.componentParameters.emissiveOverride}get hasEmissions(){return this._hasEmissiveStrength&&(this._hasEmissiveBase||2!==this.componentParameters.emissiveSourceOverride)}get texture(){return this.baseColorTexture?.texture}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.texture}get textureEmissive(){return this.emissionTexture?.texture}get textureOcclusion(){return this.occlusionTexture?.texture}get textureNormal(){return this.normalTexture?.texture}update(e){e(this)}acquireTechnique(e,t,r,s){const o=this._updateConfiguration(t,r,s);return e.get(p,o)}_updateConfiguration(e,t,r){return this._updateMaterialConfiguration(),this._updateDrawConfiguration(e,t,r)}_updateMaterialConfiguration(){if(!this.dirty)return;const e=this._configuration;e.hasMetallicRoughnessTexture=null!=this.metallicRoughnessTexture,e.hasOcclusionTexture=null!=this.occlusionTexture,e.hasNormalTexture=null!=this.normalTexture,e.sphereDepthInterpolate=this.sphereDepthInterpolate&&e.spherical,e.ellipsoidMode=this.ellipsoidMode,e.componentData=this.componentParameters.type,e.cullFace=this.commonMaterialParameters.cullFace,e.doubleSidedMode=this.commonMaterialParameters.doubleSided?1:0,e.hasColorTexture=null!=this.baseColorTexture,e.alphaDiscardMode=this.alphaDiscardMode,e.hasPolygonOffset=this.polygonOffsetEnabled,this._setClean()}_updateDrawConfiguration(e,t,r){const s=this._configuration,o=e.identifier,i=0===o;s.hasEmission=t.hasEmission&&i,s.renderOccluded=10===t.slot,s.hasVertexColors=r.hasVertexColors,s.hasNormals=r.hasNormals,s.textureCoordinateType=r.textureCoordinateType,s.oitPass=i?t.oitPass:0,s.terrainDepthTest=i&&t.terrainDepthTest,s.cullAboveTerrain=!!i&&t.cullAboveTerrain,s.integratedMeshMode=this.isIntegratedMesh?D(t)?w(t)?3:2:1:0,s.pbrMode=3===s.integratedMeshMode?4:this.usePBR?this.hasParametersFromSource?r.shadeNormals&&this.isIntegratedMesh?0:2:1:0;const a=1===this.componentParameters.emissiveSourceOverride,n=2===this.componentParameters.emissiveSourceOverride,l=null!=this.emissionTexture;s.emissionSource=this.hasEmissions?this._hasEmissiveBase&&1===s.pbrMode?n?l?4:2:a?l?5:7:6:a?7:6:0,s.shadeNormals=r.shadeNormals,s.normalType=s.hasNormals?1:2;const u=null!=t.slicePlane&&this.commonMaterialParameters.hasSlicePlane;s.hasSlicePlane=u,s.isGroundSlice=u&&this.commonMaterialParameters.isGround;const h=this._computeMaterialPass();s.blendingEnabled=1===h||2===h||4===h||s.isGroundSlice,s.hasHighlightMixTexture=2===o&&null!=t.highlightMixTexture,s.output=e.output,s.snowCover=i&&t.snowCover>0,s.vertexDiscardMode=i&&2===h?e.transparent?2:1:0,s.olidColor=i&&9===e.output;const p=i&&x(e.output);return s.receiveAmbientOcclusion=p&&r.applySSAO&&null!=t.ssao?.getTexture(),s.hasOccludees=p&&t.hasOccludees,s.receiveShadows=p&&t.shadowMap.ready,s.screenSpaceReflections=p&&null!=t.ssr.lastFrameColor,s.cloudReflections=p&&null!=t.clouds.data?.cubeMap?.colorTexture,s}submit(e,t,r){if(this.objectOpacity<=0)return;const{componentData:s,renderable:o}=r,{geometry:i}=o,a=o.meta.cameraDepthSquared;s.updateHighlights(t.highlights);const{geometryRanges:n,highlightRangesMap:l,shadowmapRanges:u}=s,h=e=>e.submitDraw(this,i,n,a);switch(this._computeMaterialPass()){case 0:h(e.opaque);break;case 1:h(e.transparent);break;case 2:h(e.opaque),h(e.transparent);break;case 3:h(e.integratedMesh),j(t)&&h(e.occludedGround),P(t)&&h(e.highlightIntegratedMesh);break;case 4:h(e.transparentIntegratedMesh)}if(2!==this.componentParameters.castShadows){if(null!=l)for(const t of l)t[0]===M&&e.highlightShadowMap.submitDraw(this,i,t[1],a,t[0]);null!=u&&e.defaultShadowMap.submitDraw(this,i,u,a),h(e.shadowMap)}if(null!=l)for(const p of l)e.highlight.submitDraw(this,i,p[1],a,p[0]);t.viewshedEnabled&&h(e.viewshedShadowMap)}_computeMaterialPass(){if(this.isIntegratedMesh)return this.objectOpacity<1?4:3;if(this.objectOpacity<1)return this.isIntegratedMesh?4:1;if(0===this.componentParameters.opaqueOverride)return 0;if(this.baseColor[3]<1||0===this.alphaDiscardMode||3===this.alphaDiscardMode)return 1;switch(this.componentParameters.transparent){case 2:return 0;case 0:return 1;case 1:return 2}}}e([d({vectorOps:l})],b.prototype,"baseColor",void 0),e([d()],b.prototype,"usePBR",void 0),e([d()],b.prototype,"hasParametersFromSource",void 0),e([d()],b.prototype,"sphereDepthInterpolate",void 0),e([d({vectorOps:i})],b.prototype,"mrrFactors",void 0),e([d({dispose:!0})],b.prototype,"baseColorTexture",void 0),e([d({dispose:!0})],b.prototype,"metallicRoughnessTexture",void 0),e([d({dispose:!0})],b.prototype,"normalTexture",void 0),e([d({dispose:!0})],b.prototype,"occlusionTexture",void 0),e([d({dispose:!0})],b.prototype,"emissionTexture",void 0),e([d({vectorOps:i})],b.prototype,"emissiveBaseColor",void 0),e([d()],b.prototype,"emissiveStrength",void 0),e([m()],b.prototype,"commonMaterialParameters",void 0),e([m()],b.prototype,"componentParameters",void 0),e([d()],b.prototype,"textureBackedBuffer",void 0),e([d()],b.prototype,"objectOpacity",void 0),e([d()],b.prototype,"textureAlphaCutoff",void 0),e([d()],b.prototype,"alphaDiscardMode",void 0),e([d()],b.prototype,"isIntegratedMesh",void 0),e([d()],b.prototype,"polygonOffsetEnabled",void 0),e([d()],b.prototype,"ellipsoidMode",void 0),e([d()],b.prototype,"hasOccludees",void 0);class S extends g{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=2,this.isGround=!1,this.hasSlicePlane=!0}}e([d()],S.prototype,"doubleSided",void 0),e([d()],S.prototype,"cullFace",void 0),e([d()],S.prototype,"isGround",void 0),e([d()],S.prototype,"hasSlicePlane",void 0);class C extends g{constructor(){super(...arguments),this.externalColor=h(1,1,1,1),this.externalColorMixMode=1,this.emissiveStrength=0,this.emissiveSource=0,this.castShadows=0}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}get visible(){return this.externalColor[3]>0?0:2}get type(){return 0}}e([d({vectorOps:l})],C.prototype,"externalColor",void 0),e([d()],C.prototype,"externalColorMixMode",void 0),e([d()],C.prototype,"emissiveStrength",void 0),e([d()],C.prototype,"emissiveSource",void 0),e([d()],C.prototype,"castShadows",void 0);class O extends g{constructor(){super(...arguments),this.transparent=2,this.opaqueOverride=2,this.emissiveOverride=2,this.emissiveSourceOverride=2,this.castShadows=2}get type(){return 1}}function P(e){return null!=e.overlay?.getTexture(2)}function w(e){return null!=e.overlay?.getTexture(3)}function D(e){return null!=e.overlay?.getTexture(1)}function j(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}e([d()],O.prototype,"transparent",void 0),e([d()],O.prototype,"opaqueOverride",void 0),e([d()],O.prototype,"emissiveOverride",void 0),e([d()],O.prototype,"emissiveSourceOverride",void 0),e([d()],O.prototype,"castShadows",void 0);export{S as CommonMaterialParameters,b as ComponentMaterial,C as ComponentParametersUniform,O as ComponentParametersVarying};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../../../support/buffer/glUtil.js";import{createVertexBufferLayout as o}from"../SourceGeometry.js";import{C as s}from"../../../../../../chunks/ComponentShader.glsl.js";import{isColor as i}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as l}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as n,depthOnlyOutputBuffersOr as a}from"../../../core/shaderTechnique/ShaderTechnique.js";import{OITPolygonOffset as m,depthTest as c,blending as p,drawBuffers as u}from"../../../lib/OrderIndependentTransparency.js";import{replaceBitWhenDepthTestPasses as d,stencilBaseAllZerosParams as f,stencilWriteMaskOn as h}from"../../../lib/StencilUtils.js";import{indexGlLayout as b}from"../../../materials/DefaultLayouts.js";import{makePipelineState as g,defaultColorWrite as j,defaultDepthWrite as S,cullingParams as T,premultipliedAlpha as w}from"../../../../../webgl/renderState.js";import{fromLayouts as y}from"../../../../../webgl/VertexAttributeLocations.js";let O=class extends n{constructor(e,r){super(e,r,y([t(o(r)),b])),this.shader=new l(s,()=>import("./ComponentShader.glsl.js"))}initializePipeline(e){const{integratedMeshMode:r,output:t,blendingEnabled:o,cullFace:s,hasEmission:l,hasOccludees:n,hasPolygonOffset:b,oitPass:y,renderOccluded:O}=e,C=0!==r,q=0===y,x=2===y;return g({blending:O?w:i(t)&&o?p(y):null,culling:T(s),depthTest:O?null:c(y),depthWrite:O||!q&&!x?null:S,drawBuffers:a(t,u(y,l)),colorWrite:j,stencilWrite:!O&&C||n?h:null,stencilTest:C?d(1):n?f:null,polygonOffset:q||x?b?{factor:2,units:2}:null:m})}};O=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],O);export{O as ComponentTechnique};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{glLayout as t}from"../../../../support/buffer/glUtil.js";import{createVertexBufferLayout as o}from"../SourceGeometry.js";import{C as i}from"../../../../../../chunks/ComponentShader.glsl.js";import{isColor as n}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as l}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s,depthOnlyOutputBuffersOr as a}from"../../../core/shaderTechnique/ShaderTechnique.js";import{OITPolygonOffset as p,depthTest as u,blending as m,drawBuffers as d}from"../../../lib/OrderIndependentTransparency.js";import{replaceBitWhenDepthTestPasses as c,stencilBaseAllZerosParams as h,stencilWriteMaskOn as f}from"../../../lib/StencilUtils.js";import{indexGlLayout as b}from"../../../materials/DefaultLayouts.js";import{cullingParams as g,makePipelineState as j,defaultColorWrite as P,defaultDepthWrite as w,premultipliedAlpha as S}from"../../../../../webgl/renderState.js";import{fromLayouts as T}from"../../../../../webgl/VertexAttributeLocations.js";let y=class extends s{constructor(e,r){super(e,r,T([t(o(r)),b])),this.shader=new l(i,()=>import("./ComponentShader.glsl.js"))}getPipeline(e){return e.camera.aboveGround||null==this._belowGroundPipeline?super.getPipeline(e):this._belowGroundPipeline}initializePipeline(e){return this._belowGroundPipeline=0===e.integratedMeshMode?null:this._makePipeline(e,!0),this._makePipeline(e,!1)}_makePipeline(e,r){const{integratedMeshMode:t,output:o,blendingEnabled:i,cullFace:l,hasEmission:s,hasOccludees:b,hasPolygonOffset:T,oitPass:y,renderOccluded:O}=e,_=0!==t,C=0===y,G=2===y;let M=g(l);return r&&M&&(M={...M,mode:2304}),j({blending:O?S:n(o)&&i?m(y):null,culling:M,depthTest:O?null:u(y),depthWrite:O||!C&&!G?null:w,drawBuffers:a(o,d(y,s)),colorWrite:P,stencilWrite:!O&&_||b?f:null,stencilTest:_?c(1):b?h:null,polygonOffset:C||G?T?{factor:2,units:2}:null:p})}};y=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],y);export{y as ComponentTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import{isColorHighlightOrOID as e}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as t,ShaderTechniqueConfiguration as i}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class s extends i{constructor(o){super(),this.sphericalSR=o,this.output=0,this.textureCoordinateType=0,this.componentData=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.oitPass=0,this.ellipsoidMode=1,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.hasEmission=!1,this.hasVertexColors=!1,this.hasNormals=!1,this.shadeNormals=!0,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.olidColor=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.discardInvisibleFragments=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&e(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}o([t({count:10})],s.prototype,"output",void 0),o([t({count:3})],s.prototype,"textureCoordinateType",void 0),o([t({count:2})],s.prototype,"componentData",void 0),o([t({count:3})],s.prototype,"cullFace",void 0),o([t({count:3})],s.prototype,"vertexDiscardMode",void 0),o([t({count:3})],s.prototype,"doubleSidedMode",void 0),o([t({count:4})],s.prototype,"alphaDiscardMode",void 0),o([t({count:4})],s.prototype,"integratedMeshMode",void 0),o([t({count:3})],s.prototype,"oitPass",void 0),o([t({count:4})],s.prototype,"ellipsoidMode",void 0),o([t({count:7})],s.prototype,"pbrMode",void 0),o([t({count:3})],s.prototype,"normalType",void 0),o([t({count:8})],s.prototype,"emissionSource",void 0),o([t()],s.prototype,"hasEmission",void 0),o([t()],s.prototype,"hasVertexColors",void 0),o([t()],s.prototype,"hasNormals",void 0),o([t()],s.prototype,"shadeNormals",void 0),o([t()],s.prototype,"hasSlicePlane",void 0),o([t()],s.prototype,"isGroundSlice",void 0),o([t()],s.prototype,"hasColorTexture",void 0),o([t()],s.prototype,"hasHighlightMixTexture",void 0),o([t()],s.prototype,"receiveAmbientOcclusion",void 0),o([t()],s.prototype,"receiveShadows",void 0),o([t()],s.prototype,"blendingEnabled",void 0),o([t()],s.prototype,"screenSpaceReflections",void 0),o([t()],s.prototype,"hasPolygonOffset",void 0),o([t()],s.prototype,"hasMetallicRoughnessTexture",void 0),o([t()],s.prototype,"hasOcclusionTexture",void 0),o([t()],s.prototype,"hasNormalTexture",void 0),o([t()],s.prototype,"hasOccludees",void 0),o([t()],s.prototype,"terrainDepthTest",void 0),o([t()],s.prototype,"cullAboveTerrain",void 0),o([t()],s.prototype,"hasNormalTextureTransform",void 0),o([t()],s.prototype,"cloudReflections",void 0),o([t()],s.prototype,"snowCover",void 0),o([t()],s.prototype,"olidColor",void 0),o([t()],s.prototype,"renderOccluded",void 0),o([t()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
5
+ import{__decorate as o}from"tslib";import{isColorHighlightOrOID as e}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as t,ShaderTechniqueConfiguration as i}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class s extends i{constructor(o){super(),this.sphericalSR=o,this.output=0,this.textureCoordinateType=0,this.componentData=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.oitPass=0,this.ellipsoidMode=1,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.hasEmission=!1,this.hasVertexColors=!1,this.hasNormals=!1,this.shadeNormals=!0,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.screenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.olidColor=!1,this.renderOccluded=!1,this.sphereDepthInterpolate=!1,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&e(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}o([t({count:10})],s.prototype,"output",void 0),o([t({count:3})],s.prototype,"textureCoordinateType",void 0),o([t({count:2})],s.prototype,"componentData",void 0),o([t({count:3})],s.prototype,"cullFace",void 0),o([t({count:3})],s.prototype,"vertexDiscardMode",void 0),o([t({count:3})],s.prototype,"doubleSidedMode",void 0),o([t({count:4})],s.prototype,"alphaDiscardMode",void 0),o([t({count:4})],s.prototype,"integratedMeshMode",void 0),o([t({count:3})],s.prototype,"oitPass",void 0),o([t({count:4})],s.prototype,"ellipsoidMode",void 0),o([t({count:7})],s.prototype,"pbrMode",void 0),o([t({count:3})],s.prototype,"normalType",void 0),o([t({count:8})],s.prototype,"emissionSource",void 0),o([t()],s.prototype,"hasEmission",void 0),o([t()],s.prototype,"hasVertexColors",void 0),o([t()],s.prototype,"hasNormals",void 0),o([t()],s.prototype,"shadeNormals",void 0),o([t()],s.prototype,"hasSlicePlane",void 0),o([t()],s.prototype,"isGroundSlice",void 0),o([t()],s.prototype,"hasColorTexture",void 0),o([t()],s.prototype,"hasHighlightMixTexture",void 0),o([t()],s.prototype,"receiveAmbientOcclusion",void 0),o([t()],s.prototype,"receiveShadows",void 0),o([t()],s.prototype,"blendingEnabled",void 0),o([t()],s.prototype,"screenSpaceReflections",void 0),o([t()],s.prototype,"hasPolygonOffset",void 0),o([t()],s.prototype,"hasMetallicRoughnessTexture",void 0),o([t()],s.prototype,"hasOcclusionTexture",void 0),o([t()],s.prototype,"hasNormalTexture",void 0),o([t()],s.prototype,"hasOccludees",void 0),o([t()],s.prototype,"terrainDepthTest",void 0),o([t()],s.prototype,"cullAboveTerrain",void 0),o([t()],s.prototype,"hasNormalTextureTransform",void 0),o([t()],s.prototype,"cloudReflections",void 0),o([t()],s.prototype,"snowCover",void 0),o([t()],s.prototype,"olidColor",void 0),o([t()],s.prototype,"renderOccluded",void 0),o([t()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as s}from"tslib";import{subclass as e}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as t,transpose as r,invert as a}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{h,d as o}from"../../../../../chunks/vec32.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as c,ShadowMapPassParameters as m,HighlightPassParameters as u,ViewshedShadowMapPassParameters as l,AllRenderPasses as p}from"./AllRenderPasses.js";import{TwoVectorPosition as _}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as d}from"../../effects/RenderPlugin.js";import{DepthRange as P}from"../../lib/DepthRange.js";let f=class extends d{constructor(){super(...arguments),this.produces=new Map([[2,s=>this._produces(s,2)],[4,s=>this._produces(s,4)],[0,s=>this._produces(s,0)],[7,s=>this._produces(s,7)],[9,s=>this._produces(s,9)]]),this._materialPassParameters=new c,this._shadowPassParameters=new m,this._highlightPassParameters=new u,this._viewshedPassParameters=new l,this._systems=new Set}initializeRenderContext(s){this._context=s,this._passes=new p(s)}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.clear(),this._passes=null}register(s){this._systems.add(s)}_produces(s,e){return!!this._invoke(s,e,s=>s.count>0)}prepareRender(s){const{_systems:e,_passes:t}=this;if(0!==e.size&&null!=t){for(const s of Object.values(t))s.prepareSubmit();e.forEach(e=>e.submit(t,s.bind));for(const s of Object.values(t))s.finishSubmit()}}acquireTechniques(s){if(0===this._systems.size)return null;const e=3===s.output||4===s.output||5===s.output?this._shadowPassParameters:6===s.output?this._viewshedPassParameters:8===s.output?this._highlightPassParameters:this._materialPassParameters,t=s.bind;return this._updateParameters(t.camera,e,t.slot),this._materialPassParameters.output=s.output,this._invoke(s.output,s.bind.slot,(e,t)=>e.acquire(t,s.bind))}render(s,e){this._invoke(s.output,s.bind.slot,(t,r)=>t.dispatch(r,s.bind,e))}_invoke(s,e,t){if(null==this._passes)return null;switch(e){case 2:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.opaque,this._materialPassParameters);case 8:return t(this._passes.highlight,this._highlightPassParameters);case 3:return t(this._passes.shadowMap,this._shadowPassParameters);case 4:return t(this._passes.highlightShadowMap,this._shadowPassParameters);case 5:return t(this._passes.defaultShadowMap,this._shadowPassParameters);case 6:return t(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;case 4:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.transparent,this._materialPassParameters)}break;case 0:switch(s){case 0:case 1:case 2:case 9:case 7:return t(this._passes.integratedMesh,this._materialPassParameters);case 8:return t(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}break;case 7:if(0===s)return t(this._passes.transparentIntegratedMesh,this._materialPassParameters);break;case 9:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.occludedGround,this._materialPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(s){const e=new P;return this._systems.forEach(t=>e.union(t.queryDepthRange(s))),e}get hasEmitters(){let s=!1;return this._systems.forEach(e=>s=e.hasEmissions||s),s}_updateParameters(s,e,i){const n=s.viewInverseTransposeMatrix,c=4===i,m=9===i;h(w,n[3],n[7],n[11]),b.set(w),o(e.transformWorldFromViewTH,b.high),o(e.transformWorldFromViewTL,b.low),o(e.slicePlaneLocalOrigin,w),t(e.transformViewFromCameraRelativeRS,s.viewMatrix),0===e.identifier&&(this._materialPassParameters.transparent=c,this._materialPassParameters.occludedGround=m,r(g,e.transformViewFromCameraRelativeRS),a(e.transformNormalViewFromGlobal,g))}hasHighlight(s){for(const e of this._systems)if(e.hasHighlight(s))return!0;return!1}};f=s([e("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],f);const w=n(),g=i(),b=new _;export{f as RenderPassManager};
5
+ import{__decorate as s}from"tslib";import{subclass as e}from"../../../../../core/accessorSupport/decorators.js";import{fromMat4 as t,transpose as r,invert as a}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{h,d as o}from"../../../../../chunks/vec32.js";import{create as n}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{MaterialPassParameters as c,ShadowMapPassParameters as m,HighlightPassParameters as u,ViewshedShadowMapPassParameters as l,AllRenderPasses as p}from"./AllRenderPasses.js";import{TwoVectorPosition as _}from"../util/TwoVectorPosition.js";import{SyncRenderPlugin as d}from"../../effects/RenderPlugin.js";import{DepthRange as P}from"../../lib/DepthRange.js";let f=class extends d{constructor(){super(...arguments),this.produces=new Map([[2,s=>this._produces(s,2)],[4,s=>this._produces(s,4)],[0,s=>this._produces(s,0)],[8,s=>this._produces(s,8)],[10,s=>this._produces(s,10)]]),this._materialPassParameters=new c,this._shadowPassParameters=new m,this._highlightPassParameters=new u,this._viewshedPassParameters=new l,this._systems=new Set}initializeRenderContext(s){this._context=s,this._passes=new p(s)}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.clear(),this._passes=null}register(s){this._systems.add(s)}_produces(s,e){return!!this._invoke(s,e,s=>s.count>0)}prepareRender(s){const{_systems:e,_passes:t}=this;if(0!==e.size&&null!=t){for(const s of Object.values(t))s.prepareSubmit();e.forEach(e=>e.submit(t,s.bind));for(const s of Object.values(t))s.finishSubmit()}}acquireTechniques(s){if(0===this._systems.size)return null;const e=3===s.output||4===s.output||5===s.output?this._shadowPassParameters:6===s.output?this._viewshedPassParameters:8===s.output?this._highlightPassParameters:this._materialPassParameters,t=s.bind;return this._updateParameters(t.camera,e,t.slot),this._materialPassParameters.output=s.output,this._invoke(s.output,s.bind.slot,(e,t)=>e.acquire(t,s.bind))}render(s,e){this._invoke(s.output,s.bind.slot,(t,r)=>t.dispatch(r,s.bind,e))}_invoke(s,e,t){if(null==this._passes)return null;switch(e){case 2:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.opaque,this._materialPassParameters);case 8:return t(this._passes.highlight,this._highlightPassParameters);case 3:return t(this._passes.shadowMap,this._shadowPassParameters);case 4:return t(this._passes.highlightShadowMap,this._shadowPassParameters);case 5:return t(this._passes.defaultShadowMap,this._shadowPassParameters);case 6:return t(this._passes.viewshedShadowMap,this._viewshedPassParameters)}break;case 4:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.transparent,this._materialPassParameters)}break;case 0:switch(s){case 0:case 1:case 2:case 9:case 7:return t(this._passes.integratedMesh,this._materialPassParameters);case 8:return t(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}break;case 8:if(0===s)return t(this._passes.transparentIntegratedMesh,this._materialPassParameters);break;case 10:switch(s){case 0:case 1:case 2:case 9:return t(this._passes.occludedGround,this._materialPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(s){const e=new P;return this._systems.forEach(t=>e.union(t.queryDepthRange(s))),e}get hasEmitters(){let s=!1;return this._systems.forEach(e=>s=e.hasEmissions||s),s}_updateParameters(s,e,i){const n=s.viewInverseTransposeMatrix,c=4===i,m=10===i;h(w,n[3],n[7],n[11]),b.set(w),o(e.transformWorldFromViewTH,b.high),o(e.transformWorldFromViewTL,b.low),o(e.slicePlaneLocalOrigin,w),t(e.transformViewFromCameraRelativeRS,s.viewMatrix),0===e.identifier&&(this._materialPassParameters.transparent=c,this._materialPassParameters.occludedGround=m,r(g,e.transformViewFromCameraRelativeRS),a(e.transformNormalViewFromGlobal,g))}hasHighlight(s){for(const e of this._systems)if(e.hasHighlight(s))return!0;return!1}};f=s([e("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],f);const w=n(),g=i(),b=new _;export{f as RenderPassManager};
@@ -2,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{translate as e}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i,p as a,e as l,h as c}from"../../../../../chunks/vec32.js";import{ZEROS as n,create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Float3DrawUniform as r}from"../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as t}from"../shaderModules/Float3PassUniform.js";import{glsl as f}from"../shaderModules/glsl.js";import{NoParameters as d}from"../../../../webgl/NoParameters.js";class u extends d{constructor(e){super(),this.slicePlaneLocalOrigin=e}}function P(e,s){B(e,s,new t("slicePlaneOrigin",(e,i)=>g(s,e,i)),new t("slicePlaneBasis1",(e,i)=>y(s,e,i,i.slicePlane?.basis1)),new t("slicePlaneBasis2",(e,i)=>y(s,e,i,i.slicePlane?.basis2)))}function p(e,s){B(e,s,new r("slicePlaneOrigin",(e,i)=>g(s,e,i)),new r("slicePlaneBasis1",(e,i)=>y(s,e,i,i.slicePlane?.basis1)),new r("slicePlaneBasis2",(e,i)=>y(s,e,i,i.slicePlane?.basis2)))}function m(e,s){v(e,s,new r("slicePlaneOrigin",(e,i)=>g(s,e,i)),new r("slicePlaneBasis1",(e,i)=>y(s,e,i,i.slicePlane?.basis1)),new r("slicePlaneBasis2",(e,i)=>y(s,e,i,i.slicePlane?.basis2)))}const b=f`struct SliceFactors {
5
+ import{translate as e}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i,p as a,e as l,h as c}from"../../../../../chunks/vec32.js";import{ZEROS as n,create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Float3DrawUniform as r}from"../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as t}from"../shaderModules/Float3PassUniform.js";import{glsl as f}from"../shaderModules/glsl.js";import{NoParameters as d}from"../../../../webgl/NoParameters.js";class u extends d{constructor(e){super(),this.slicePlaneLocalOrigin=e}}function p(e,s){w(e,s,new t("slicePlaneOrigin",(e,i)=>g(s,e,i)),new t("slicePlaneBasis1",(e,i)=>F(s,e,i,i.slicePlane?.basis1)),new t("slicePlaneBasis2",(e,i)=>F(s,e,i,i.slicePlane?.basis2)))}function P(e,s){w(e,s,new r("slicePlaneOrigin",(e,i)=>g(s,e,i)),new r("slicePlaneBasis1",(e,i)=>F(s,e,i,i.slicePlane?.basis1)),new r("slicePlaneBasis2",(e,i)=>F(s,e,i,i.slicePlane?.basis2)))}function m(e,s){v(e,s,new r("slicePlaneOrigin",(e,i)=>g(s,e,i)),new r("slicePlaneBasis1",(e,i)=>F(s,e,i,i.slicePlane?.basis1)),new r("slicePlaneBasis2",(e,i)=>F(s,e,i,i.slicePlane?.basis2)))}const b=f`struct SliceFactors {
6
6
  float front;
7
7
  float side0;
8
8
  float side1;
@@ -35,10 +35,7 @@ return factors.front < 0.0
35
35
  bool sliceEnabled() {
36
36
  return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
37
37
  }
38
- bool sliceByPlane(vec3 pos) {
39
- return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
40
- }
41
38
  bool rejectBySlice(vec3 pos) {
42
- return sliceByPlane(pos);
43
- }`;function v(e,s,...i){s.hasSlicePlane?(e.uniforms.add(...i),e.code.add(b)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function B(e,s,...i){e.constants.add("groundSliceOpacity","float",.2),v(e,s,...i),s.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(f`void discardBySlice(vec3 pos) { }
44
- vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}function w(e,s,i){return e.instancedDoublePrecision?c(F,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]):s.slicePlaneLocalOrigin}function S(e,s){return null!=e?l(x,s.origin,e):s.origin}function h(s,i,a){return s.hasSliceTranslatedView?null!=i?e(O,a.camera.viewMatrix,i):a.camera.viewMatrix:null}function g(e,s,i){if(null==i.slicePlane)return n;const l=w(e,s,i),c=S(l,i.slicePlane),o=h(e,l,i);return null!=o?a(x,c,o):c}function y(e,s,c,o){if(null==o||null==c.slicePlane)return n;const r=w(e,s,c),t=S(r,c.slicePlane),f=h(e,r,c);return null!=f?(i(j,o,t),a(x,t,f),a(j,j,f),l(j,j,x)):o}const F=o(),x=o(),j=o(),O=s();export{m as RejectBySlice,p as SliceDraw,P as SlicePass,u as SlicePlaneParameters};
39
+ return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
40
+ }`;function v(e,s,...i){s.hasSlicePlane?(e.uniforms.add(...i),e.code.add(b)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function w(e,s,...i){e.constants.add("groundSliceOpacity","float",.2),v(e,s,...i),s.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (rejectBySlice(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(f`void discardBySlice(vec3 pos) { }
41
+ vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}function B(e,s,i){return e.instancedDoublePrecision?c(y,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]):s.slicePlaneLocalOrigin}function S(e,s){return null!=e?l(j,s.origin,e):s.origin}function h(s,i,a){return s.hasSliceTranslatedView?null!=i?e(O,a.camera.viewMatrix,i):a.camera.viewMatrix:null}function g(e,s,i){if(null==i.slicePlane)return n;const l=B(e,s,i),c=S(l,i.slicePlane),o=h(e,l,i);return null!=o?a(j,c,o):c}function F(e,s,c,o){if(null==o||null==c.slicePlane)return n;const r=B(e,s,c),t=S(r,c.slicePlane),f=h(e,r,c);return null!=f?(i(x,o,t),a(j,t,f),a(x,x,f),l(x,x,j)):o}const y=o(),j=o(),x=o(),O=s();export{m as RejectBySlice,P as SliceDraw,p as SlicePass,u as SlicePlaneParameters};
@@ -2,13 +2,13 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{generateUID as e}from"../../../../../core/uid.js";import{unpackFloat4x8 as t,unpackHalf2x8 as o,glslType as d,glslDecodeField as a}from"./TextureBackedBufferFields.glsl.js";import{glsl as r}from"../shaderModules/glsl.js";import{assert as n}from"../../lib/Util.js";class i{constructor(t,o,d,a=()=>!0){this.moduleId=e(),this.namespace=`_tbb_${this.moduleId}_`,this.TextureBackedBufferModule=(e,r)=>c(this.namespace,e,r,o,d,t,a),this.getTextureAttribute=s(this.namespace)}}function c(e,i,c,s,l,u,m){const{vertex:$}=i;$.include(t),$.include(o);const x=`${e}tbbStride`,h=`${e}TextureBackedBufferItemData`,p=`${e}fetchTextureBackedBufferItemData`,T=f(e);for(const t of[x,h,p,T])n(t.length<1024,"Identifiers do not have a valid length");$.constants.add(x,"float",u.numTexels),$.uniforms.add(l);const B=u.fields.filter(e=>m(e.name,c));if(0===B.length)return;const I=[];for(let t=0;t<u.numTexels;++t)I.push(!1);for(const t of B)for(let e=0;e<t.numTexels;++e)I[t.startTexel+e]=!0;$.code.add(r`
6
- struct ${h} {`);for(const t of B)$.code.add(r`\t${d(t)} ${t.name};`);$.code.add(r`};`),$.code.add(r`
5
+ import{generateUID as e}from"../../../../../core/uid.js";import{unpackFloat4x8 as t,unpackHalf2x8 as o,glslType as d,glslDecodeField as a}from"./TextureBackedBufferFields.glsl.js";import{glsl as r}from"../shaderModules/glsl.js";import{assert as n}from"../../lib/Util.js";class i{constructor(t,o,d,a=()=>!0){this.moduleId=e(),this.namespace=`_tbb_${this.moduleId}_`,this.TextureBackedBufferModule=(e,r)=>c(this.namespace,e,r,o,d,t,a),this.getTextureAttribute=s(this.namespace)}}function c(e,i,c,s,l,u,m){const{vertex:$}=i;$.include(t),$.include(o);const x=`${e}tbbStride`,h=`${e}TextureBackedBufferItemData`,p=`${e}fetchTextureBackedBufferItemData`,B=f(e);for(const t of[x,h,p,B])n(t.length<1024,"Identifiers do not have a valid length");$.constants.add(x,"float",u.texelStride),$.uniforms.add(l);const I=new Array;for(const t of u.fields.values())m(t.name,c)&&I.push(t);if(0===I.length)return;const g=[];for(let t=0;t<u.texelStride;++t)g.push(!1);for(const t of I)for(let e=0;e<t.numTexels;++e)g[t.startTexel+e]=!0;$.code.add(r`
6
+ struct ${h} {`);for(const t of I)$.code.add(r`\t${d(t)} ${t.name};`);$.code.add(r`};`),$.code.add(r`
7
7
  ${h} ${p}(float itemIndex) {
8
8
  ${h} itemData;
9
9
  float index = itemIndex * ${x};
10
10
  float texSize = float(textureSize(${l.name}, 0).x);
11
11
  float coordX = mod(index, texSize) + 0.5;
12
12
  float coordY = floor(index / texSize) + 0.5;
13
- `);for(let t=0;t<I.length;++t)!1!==I[t]&&$.code.add(r`lowp uvec4 texel${r.int(t)} = texelFetch(${l.name}, ivec2(coordX + ${r.float(t)}, coordY), 0);`);for(const t of B)$.code.add(r`itemData.${t.name} = ${a(t)};`);$.code.add(r`return itemData;
14
- }`),$.code.add(r`${h} ${T};`),$.main.add(r`${T} = ${p}(${s});`)}function s(e){const t=f(e);return e=>r`${t}.${e}`}function f(e){return`${e}ItemData`}export{i as TextureBackedBufferModule};
13
+ `);for(let t=0;t<g.length;++t)!1!==g[t]&&$.code.add(r`lowp uvec4 texel${r.int(t)} = texelFetch(${l.name}, ivec2(coordX + ${r.float(t)}, coordY), 0);`);for(const t of I)$.code.add(r`itemData.${t.name} = ${a(t)};`);$.code.add(r`return itemData;
14
+ }`),$.code.add(r`${h} ${B};`),$.main.add(r`${B} = ${p}(${s});`)}function s(e){const t=f(e);return e=>r`${t}.${e}`}function f(e){return`${e}ItemData`}export{i as TextureBackedBufferModule};
@@ -8,4 +8,4 @@ return unpackHalf2x16(halfBits).x;
8
8
  }`)}function r(t){t.code.add(n`highp float unpackFloat4x8(highp uint bits0, highp uint bits1, highp uint bits2, highp uint bits3) {
9
9
  highp uint floatBits = (bits3 << 24u) |(bits2 << 16u) | (bits1 << 8u) | bits0;
10
10
  return uintBitsToFloat(floatBits);
11
- }`)}function a(t){const{declaration:e,glslDecodeArgumentString:n}=t;return`${(0,c[e.type])(n)}`}const c={u8:t=>n`${t}`,unorm8:t=>n`float(${t})/255.0`,vec4unorm8:t=>n`vec4(${t})/255.0`,f16:e?t=>n`unpackHalf2x8(${t})`:t=>n`unpackFloat4x8(${t})`,f32:t=>n`unpackFloat4x8(${t})`,vec4u8:t=>n`uvec4(${t})`};export{a as glslDecodeField,u as glslType,r as unpackFloat4x8,i as unpackHalf2x8};
11
+ }`)}function c(t){const{fieldType:e,glslDecodeArgumentString:n}=t;return`${(0,a[e])(n)}`}const a={u8:t=>n`${t}`,unorm8:t=>n`float(${t})/255.0`,vec4unorm8:t=>n`vec4(${t})/255.0`,f16:e?t=>n`unpackHalf2x8(${t})`:t=>n`unpackFloat4x8(${t})`,f32:t=>n`unpackFloat4x8(${t})`,vec4u8:t=>n`uvec4(${t})`};export{c as glslDecodeField,u as glslType,r as unpackFloat4x8,i as unpackHalf2x8};
@@ -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{addVerticalOffset as e}from"../attributes/VerticalOffset.glsl.js";import{ScreenSizePerspective as t,addScreenSizePerspectiveAlignment as o}from"../util/ScreenSizePerspective.glsl.js";import{addProjViewLocalOrigin as a,addCameraPosition as s,addViewNormal as i,addPixelRatio as n}from"../util/View.glsl.js";import{Float4BindUniform as r}from"../../shaderModules/Float4BindUniform.js";import{FloatBindUniform as l}from"../../shaderModules/FloatBindUniform.js";import{FloatPassUniform as f}from"../../shaderModules/FloatPassUniform.js";import{glsl as c}from"../../shaderModules/glsl.js";const p=.5;function d(d,u){d.include(t),d.attributes.add("position","vec3"),d.attributes.add("normal","vec3"),d.attributes.add("centerOffsetAndDistance","vec4");const v=d.vertex;a(v,u),s(v,u),v.uniforms.add(new r("viewport",e=>e.camera.fullViewport),new f("polygonOffset",e=>e.shaderPolygonOffset),new l("cameraGroundRelative",e=>e.camera.aboveGround?1:-1)),u.hasVerticalOffset&&e(v),v.code.add(c`struct ProjectHUDAux {
5
+ import{addVerticalOffset as e}from"../attributes/VerticalOffset.glsl.js";import{ScreenSizePerspective as t,addScreenSizePerspectiveAlignment as o}from"../util/ScreenSizePerspective.glsl.js";import{addProjViewLocalOrigin as a,addCameraPosition as s,addViewNormal as i,addPixelRatio as n}from"../util/View.glsl.js";import{Float4BindUniform as r}from"../../shaderModules/Float4BindUniform.js";import{FloatBindUniform as f}from"../../shaderModules/FloatBindUniform.js";import{FloatPassUniform as l}from"../../shaderModules/FloatPassUniform.js";import{glsl as c}from"../../shaderModules/glsl.js";const p=.5;function d(d,u){d.include(t),d.attributes.add("position","vec3"),d.attributes.add("normal","vec3"),d.attributes.add("centerOffsetAndDistance","vec4");const v=d.vertex;a(v,u),s(v,u),v.uniforms.add(new r("viewport",e=>e.camera.fullViewport),new l("polygonOffset",e=>e.shaderPolygonOffset),new f("aboveGround",e=>e.camera.aboveGround?1:-1)),u.hasVerticalOffset&&e(v),v.code.add(c`struct ProjectHUDAux {
6
6
  vec3 posModel;
7
7
  vec3 posView;
8
8
  vec3 vnormal;
@@ -12,12 +12,12 @@ float absCosAngle;
12
12
  float applyHUDViewDependentPolygonOffset(float pointGroundDistance, float absCosAngle, inout vec3 posView) {
13
13
  float pointGroundSign = ${u.terrainDepthTest?c.float(0):c`sign(pointGroundDistance)`};
14
14
  if (pointGroundSign == 0.0) {
15
- pointGroundSign = cameraGroundRelative;
15
+ pointGroundSign = aboveGround;
16
16
  }
17
17
 
18
- // cameraGroundRelative is -1 if camera is below ground, 1 if above ground
18
+ // aboveGround is -1 if camera is below ground, 1 if above ground
19
19
  // groundRelative is 1 if both camera and symbol are on the same side of the ground, -1 otherwise
20
- float groundRelative = cameraGroundRelative * pointGroundSign;
20
+ float groundRelative = aboveGround * pointGroundSign;
21
21
 
22
22
  // view angle dependent part of polygon offset emulation: we take the absolute value because the sign that is
23
23
  // dropped is instead introduced using the ground-relative position of the symbol and the camera
@@ -38,7 +38,7 @@ float absCosAngle;
38
38
 
39
39
  return groundRelative;
40
40
  }
41
- `),u.draped&&!u.hasVerticalOffset||i(v),u.draped||(v.uniforms.add(new l("perDistancePixelRatio",e=>Math.tan(e.camera.fovY/2)/(e.camera.fullViewport[2]/2))),v.code.add(c`
41
+ `),u.draped&&!u.hasVerticalOffset||i(v),u.draped||(v.uniforms.add(new f("perDistancePixelRatio",e=>Math.tan(e.camera.fovY/2)/(e.camera.fullViewport[2]/2))),v.code.add(c`
42
42
  void applyHUDVerticalGroundOffset(vec3 normalModel, inout vec3 posModel, inout vec3 posView) {
43
43
  float distanceToCamera = length(posView);
44
44
 
@@ -46,7 +46,7 @@ float absCosAngle;
46
46
  float pixelOffset = distanceToCamera * perDistancePixelRatio * ${c.float(p)};
47
47
 
48
48
  // Apply offset along normal in the direction away from the ground surface
49
- vec3 modelOffset = normalModel * cameraGroundRelative * pixelOffset;
49
+ vec3 modelOffset = normalModel * aboveGround * pixelOffset;
50
50
 
51
51
  // Apply the same offset also on the view space position
52
52
  vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz;
@@ -2,10 +2,10 @@
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{h as i}from"../../../../../../chunks/vec32.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as t}from"../../../../../../chunks/vec42.js";import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{Float3BindUniform as h}from"../../shaderModules/Float3BindUniform.js";import{Float4BindUniform as g}from"../../shaderModules/Float4BindUniform.js";import{glsl as s}from"../../shaderModules/glsl.js";function m(n,e){const m=n.fragment,a=void 0!==e.lightingSphericalHarmonicsOrder?e.lightingSphericalHarmonicsOrder:2;0===a?(m.uniforms.add(new h("lightingAmbientSH0",({lighting:n})=>i(r,n.sh.r[0],n.sh.g[0],n.sh.b[0]))),m.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
5
+ import{h as i}from"../../../../../../chunks/vec32.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as t}from"../../../../../../chunks/vec42.js";import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{Float3BindUniform as h}from"../../shaderModules/Float3BindUniform.js";import{Float4BindUniform as g}from"../../shaderModules/Float4BindUniform.js";import{glsl as s}from"../../shaderModules/glsl.js";function m(n,e){const m=void 0!==e.lightingSphericalHarmonicsOrder?e.lightingSphericalHarmonicsOrder:2;0===m?(n.uniforms.add(new h("lightingAmbientSH0",({lighting:n})=>i(r,n.sh.r[0],n.sh.g[0],n.sh.b[0]))),n.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
6
6
  vec3 ambientLight = 0.282095 * lightingAmbientSH0;
7
7
  return ambientLight * (1.0 - ambientOcclusion);
8
- }`)):1===a?(m.uniforms.add(new g("lightingAmbientSH_R",({lighting:i})=>t(l,i.sh.r[0],i.sh.r[1],i.sh.r[2],i.sh.r[3])),new g("lightingAmbientSH_G",({lighting:i})=>t(l,i.sh.g[0],i.sh.g[1],i.sh.g[2],i.sh.g[3])),new g("lightingAmbientSH_B",({lighting:i})=>t(l,i.sh.b[0],i.sh.b[1],i.sh.b[2],i.sh.b[3]))),m.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
8
+ }`)):1===m?(n.uniforms.add(new g("lightingAmbientSH_R",({lighting:i})=>t(l,i.sh.r[0],i.sh.r[1],i.sh.r[2],i.sh.r[3])),new g("lightingAmbientSH_G",({lighting:i})=>t(l,i.sh.g[0],i.sh.g[1],i.sh.g[2],i.sh.g[3])),new g("lightingAmbientSH_B",({lighting:i})=>t(l,i.sh.b[0],i.sh.b[1],i.sh.b[2],i.sh.b[3]))),n.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
9
9
  vec4 sh0 = vec4(
10
10
  0.282095,
11
11
  0.488603 * normal.x,
@@ -18,7 +18,7 @@ dot(lightingAmbientSH_G, sh0),
18
18
  dot(lightingAmbientSH_B, sh0)
19
19
  );
20
20
  return ambientLight * (1.0 - ambientOcclusion);
21
- }`)):2===a&&(m.uniforms.add(new h("lightingAmbientSH0",({lighting:n})=>i(r,n.sh.r[0],n.sh.g[0],n.sh.b[0])),new g("lightingAmbientSH_R1",({lighting:i})=>t(l,i.sh.r[1],i.sh.r[2],i.sh.r[3],i.sh.r[4])),new g("lightingAmbientSH_G1",({lighting:i})=>t(l,i.sh.g[1],i.sh.g[2],i.sh.g[3],i.sh.g[4])),new g("lightingAmbientSH_B1",({lighting:i})=>t(l,i.sh.b[1],i.sh.b[2],i.sh.b[3],i.sh.b[4])),new g("lightingAmbientSH_R2",({lighting:i})=>t(l,i.sh.r[5],i.sh.r[6],i.sh.r[7],i.sh.r[8])),new g("lightingAmbientSH_G2",({lighting:i})=>t(l,i.sh.g[5],i.sh.g[6],i.sh.g[7],i.sh.g[8])),new g("lightingAmbientSH_B2",({lighting:i})=>t(l,i.sh.b[5],i.sh.b[6],i.sh.b[7],i.sh.b[8]))),m.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
21
+ }`)):2===m&&(n.uniforms.add(new h("lightingAmbientSH0",({lighting:n})=>i(r,n.sh.r[0],n.sh.g[0],n.sh.b[0])),new g("lightingAmbientSH_R1",({lighting:i})=>t(l,i.sh.r[1],i.sh.r[2],i.sh.r[3],i.sh.r[4])),new g("lightingAmbientSH_G1",({lighting:i})=>t(l,i.sh.g[1],i.sh.g[2],i.sh.g[3],i.sh.g[4])),new g("lightingAmbientSH_B1",({lighting:i})=>t(l,i.sh.b[1],i.sh.b[2],i.sh.b[3],i.sh.b[4])),new g("lightingAmbientSH_R2",({lighting:i})=>t(l,i.sh.r[5],i.sh.r[6],i.sh.r[7],i.sh.r[8])),new g("lightingAmbientSH_G2",({lighting:i})=>t(l,i.sh.g[5],i.sh.g[6],i.sh.g[7],i.sh.g[8])),new g("lightingAmbientSH_B2",({lighting:i})=>t(l,i.sh.b[5],i.sh.b[6],i.sh.b[7],i.sh.b[8]))),n.code.add(s`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
22
22
  vec3 ambientLight = 0.282095 * lightingAmbientSH0;
23
23
  vec4 sh1 = vec4(
24
24
  0.488603 * normal.x,
@@ -43,7 +43,7 @@ dot(lightingAmbientSH_G2, sh2),
43
43
  dot(lightingAmbientSH_B2, sh2)
44
44
  );
45
45
  return ambientLight * (1.0 - ambientOcclusion);
46
- }`),1!==e.pbrMode&&2!==e.pbrMode||m.code.add(s`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
46
+ }`),1!==e.pbrMode&&2!==e.pbrMode||n.code.add(s`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
47
47
  vec3 calculateAmbientRadiance(float ambientOcclusion)
48
48
  {
49
49
  vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
@@ -2,19 +2,23 @@
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{colorGamma as i}from"../../../../../../colorUtils.js";import"../../../../../../core/has.js";import{EvaluateAmbientLighting as n}from"./EvaluateAmbientLighting.glsl.js";import{EvaluateAmbientOcclusion as o}from"./EvaluateAmbientOcclusion.glsl.js";import{addMainLightDirection as e,addMainLightIntensity as t,applyShading as a}from"./MainLighting.glsl.js";import{PhysicallyBasedRendering as r}from"./PhysicallyBasedRendering.glsl.js";import{PiUtils as l}from"./PiUtils.glsl.js";import{BooleanBindUniform as c}from"../../shaderModules/BooleanBindUniform.js";import{FloatBindUniform as d}from"../../shaderModules/FloatBindUniform.js";import{glsl as s,If as m}from"../../shaderModules/glsl.js";import{ambientBoost as g}from"../../../lighting/SceneLighting.js";import{BlackLevelLightSoftCompression as h}from"../../../shaders/BlackLevelLightSoftCompression.glsl.js";import{ToneMapping as u}from"../../../shaders/ToneMapping.glsl.js";function p(i){i.constants.add("ambientBoostFactor","float",g)}function v(i){i.uniforms.add(new d("lightingGlobalFactor",i=>i.lighting.globalFactor))}function f(g,f){const L=g.fragment,{pbrMode:b,spherical:C,hasColorTexture:N}=f;L.include(o,f),0!==b&&L.include(r,f),g.include(n,f),L.include(l),L.include(u,f);const R=!(2===b&&!N);switch(R&&L.include(h),L.code.add(s`
6
- const float GAMMA_SRGB = ${s.float(i)};
5
+ import{colorGamma as i}from"../../../../../../colorUtils.js";import"../../../../../../core/has.js";import{EvaluateAmbientLighting as n}from"./EvaluateAmbientLighting.glsl.js";import{EvaluateAmbientOcclusion as o}from"./EvaluateAmbientOcclusion.glsl.js";import{addMainLightDirection as e,addMainLightIntensity as t,applyShading as a}from"./MainLighting.glsl.js";import{PhysicallyBasedRendering as r}from"./PhysicallyBasedRendering.glsl.js";import{PiUtils as l}from"./PiUtils.glsl.js";import{BooleanBindUniform as c}from"../../shaderModules/BooleanBindUniform.js";import{FloatBindUniform as d}from"../../shaderModules/FloatBindUniform.js";import{glsl as m,If as s}from"../../shaderModules/glsl.js";import{ambientBoost as g}from"../../../lighting/SceneLighting.js";import{BlackLevelLightSoftCompression as h}from"../../../shaders/BlackLevelLightSoftCompression.glsl.js";import{ToneMapping as u}from"../../../shaders/ToneMapping.glsl.js";function p(i){i.constants.add("ambientBoostFactor","float",g)}function v(i){i.uniforms.add(new d("lightingGlobalFactor",i=>i.lighting.globalFactor))}function f(g,f){const{pbrMode:L,spherical:b,hasColorTexture:C}=f;g.include(o,f),0!==L&&g.include(r,f),g.include(n,f),g.include(l),g.include(u,f);const N=!(2===L&&!C);switch(N&&g.include(h),g.code.add(m`
6
+ const float GAMMA_SRGB = ${m.float(i)};
7
7
  const float INV_GAMMA_SRGB = 0.4761904;
8
- ${m(0!==b,"const float GROUND_REFLECTANCE = 0.2;")}
9
- `),p(L),v(L),e(L),L.code.add(s`
8
+ ${s(0!==L,"const float GROUND_REFLECTANCE = 0.2;")}
9
+ `),p(g),v(g),e(g),g.code.add(m`
10
+ float additionalDirectedAmbientLight(float lightAlignment) {
11
+ return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
12
+ }
13
+
10
14
  float additionalDirectedAmbientLight(vec3 vPosWorld) {
11
- float vndl = dot(${C?s`normalize(vPosWorld)`:s`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
12
- return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
15
+ float lightAlignment = dot(${b?m`normalize(vPosWorld)`:m`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
16
+ return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
13
17
  }
14
- `),t(L),L.code.add(s`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
18
+ `),t(g),g.code.add(m`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
15
19
  float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
16
20
  return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
17
- }`),b){case 0:case 4:case 3:g.include(a),L.code.add(s`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) {
21
+ }`),L){case 0:case 4:case 3:g.include(a),g.code.add(m`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) {
18
22
  vec3 mainLighting = applyShading(normalWorld, shadow);
19
23
  vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
20
24
  vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
@@ -22,7 +26,7 @@ vec3 totalLight = mainLighting + ambientLighting + additionalLight;
22
26
  totalLight = min(totalLight, vec3(PI));
23
27
  vec3 outColor = vec3((albedoLinear / PI) * totalLight);
24
28
  return pow(outColor, vec3(INV_GAMMA_SRGB));
25
- }`);break;case 1:case 2:L.code.add(s`const float fillLightIntensity = 0.25;
29
+ }`);break;case 1:case 2:g.code.add(m`const float fillLightIntensity = 0.25;
26
30
  const float horizonLightDiffusion = 0.4;
27
31
  const float additionalAmbientIrradianceFactor = 0.02;
28
32
  vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
@@ -37,9 +41,9 @@ inputs.RdotNG = clamp(dot(reflectedView, groundNormal), -1.0, 1.0);
37
41
  inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
38
42
  inputs.ssao = ssao;
39
43
  inputs.metalness = mrr[0];
40
- inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),L.code.add(s`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
44
+ inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),g.code.add(m`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
41
45
  inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
42
- inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),f.useFillLights?L.uniforms.add(new c("hasFillLights",i=>i.enableFillLights)):L.constants.add("hasFillLights","bool",!1),L.code.add(s`vec3 ambientDir = vec3(5.0 * groundNormal[1] - groundNormal[0] * groundNormal[2], - 5.0 * groundNormal[0] - groundNormal[2] * groundNormal[1], groundNormal[1] * groundNormal[1] + groundNormal[0] * groundNormal[0]);
46
+ inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),f.useFillLights?g.uniforms.add(new c("hasFillLights",i=>i.enableFillLights)):g.constants.add("hasFillLights","bool",!1),g.code.add(m`vec3 ambientDir = vec3(5.0 * groundNormal[1] - groundNormal[0] * groundNormal[2], - 5.0 * groundNormal[0] - groundNormal[2] * groundNormal[1], groundNormal[1] * groundNormal[1] + groundNormal[0] * groundNormal[0]);
43
47
  ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
44
48
  inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
45
49
  float NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
@@ -47,7 +51,7 @@ vec3 mainLightIrradianceComponent = NdotL * (1.0 - shadow) * mainLightIntensity;
47
51
  vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
48
52
  vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
49
53
  inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
50
- inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),L.uniforms.add(new d("lightingSpecularStrength",i=>i.lighting.mainLight.specularStrength),new d("lightingEnvironmentStrength",i=>i.lighting.mainLight.environmentStrength)).code.add(s`vec3 horizonRingDir = inputs.RdotNG * groundNormal - reflectedView;
54
+ inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),g.uniforms.add(new d("lightingSpecularStrength",i=>i.lighting.mainLight.specularStrength),new d("lightingEnvironmentStrength",i=>i.lighting.mainLight.environmentStrength)).code.add(m`vec3 horizonRingDir = inputs.RdotNG * groundNormal - reflectedView;
51
55
  vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
52
56
  inputs.NdotH_Horizon = dot(normal, horizonRingH);
53
57
  float NdotH = clamp(dot(normal, h), 0.0, 1.0);
@@ -57,14 +61,14 @@ vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbi
57
61
  float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0));
58
62
  inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
59
63
  inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
60
- inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE);`),L.code.add(s`
64
+ inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE);`),g.code.add(m`
61
65
  vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
62
66
  vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
63
67
  vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent;
64
- ${R?s`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:s`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
68
+ ${N?m`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:m`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
65
69
  return outColor;
66
70
  }
67
- `);break;case 5:case 6:e(L),t(L),L.code.add(s`const float roughnessTerrain = 0.5;
71
+ `);break;case 5:case 6:e(g),t(g),g.code.add(m`const float roughnessTerrain = 0.5;
68
72
  const float specularityTerrain = 0.5;
69
73
  const vec3 fresnelReflectionTerrain = vec3(0.04);
70
74
  vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) {
@@ -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{Float3BindUniform as i}from"../../shaderModules/Float3BindUniform.js";import{glsl as n}from"../../shaderModules/glsl.js";function t(n){n.uniforms.add(new i("mainLightDirection",i=>i.lighting.mainLight.direction))}function a(n){n.uniforms.add(new i("mainLightIntensity",i=>i.lighting.mainLight.intensity))}function o(i){t(i.fragment),a(i.fragment),i.fragment.code.add(n`vec3 applyShading(vec3 shadingNormal, float shadow) {
5
+ import{Float3BindUniform as i}from"../../shaderModules/Float3BindUniform.js";import{glsl as n}from"../../shaderModules/glsl.js";function t(n){n.uniforms.add(new i("mainLightDirection",i=>i.lighting.mainLight.direction))}function o(n){n.uniforms.add(new i("mainLightIntensity",i=>i.lighting.mainLight.intensity))}function a(i){t(i),o(i),i.code.add(n`vec3 applyShading(vec3 shadingNormal, float shadow) {
6
6
  float dotVal = clamp(dot(shadingNormal, mainLightDirection), 0.0, 1.0);
7
7
  return mainLightIntensity * ((1.0 - shadow) * dotVal);
8
- }`)}export{t as addMainLightDirection,a as addMainLightIntensity,o as applyShading};
8
+ }`)}export{t as addMainLightDirection,o as addMainLightIntensity,a as applyShading};
@@ -2,7 +2,7 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasArea as o,width as r,height as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{isColor as l}from"../ShaderOutput.js";import{addMainLightDirection as a,addMainLightIntensity as i}from"../shading/MainLighting.glsl.js";import{Water as c}from"../shading/Water.glsl.js";import{Float4DrawUniform as s}from"../../shaderModules/Float4DrawUniform.js";import{FloatPassUniform as n}from"../../shaderModules/FloatPassUniform.js";import{glsl as v}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as d}from"../../shaderModules/Texture2DPassUniform.js";import{Texture2DUintPassUniform as u}from"../../shaderModules/Texture2DUintPassUniform.js";import{Uniform as x}from"../../../../../webgl/Uniform.js";function y(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new s("overlayTexOffset",(e,r)=>h(o.spherical,e,r)),new s("overlayTexScale",(e,r)=>O(o.spherical,e,r))),t.uniforms.add(new s("overlayTexOffset",(e,r)=>h(o.spherical,e,r)),new s("overlayTexScale",(e,r)=>O(o.spherical,e,r))),t.constants.add("overlayOpacity","float",1),t.uniforms.add(new d("ovColorTex",(e,o)=>f(e,o))),g(e,o)}function f(e,o){return 0===e.identifier&&l(e.output)?e.occludedGround?o.overlay?.allSourcesOccluders?o.overlay?.getTexture(1):o.overlay?.getTexture(4):o.overlay?.getTexture(1):0===e.identifier&&9===e.output?o.overlay?.getTexture(5):2===e.identifier?o.overlay?.getTexture(2):null}function m(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new V("overlayTexOffset"),new V("overlayTexScale")),t.uniforms.add(new n("overlayOpacity",e=>e.overlayOpacity)),8!==o.output&&t.uniforms.add(new d("ovColorTex",(e,o)=>o.overlay?.getTexture(e.overlayContent))),g(e,o)}function p(e,o){switch(e){case 0:return 9!==o.slot||o.overlay?.allSourcesOccluders?0:4;case 1:case 2:return 0;case 8:return 2;case 3:case 5:case 6:case 7:return null;case 9:return 5}return null}function g(e,o){const{hasWater:r,output:t}=o;r&&e.include(c,o);const{vertex:l,fragment:s,varyings:n}=e;n.add("vtcOverlay","vec4");const d=8===t;l.code.add(v`void setOverlayVTC(in vec2 uv) {
5
+ import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasArea as o,width as r,height as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{isColor as l}from"../ShaderOutput.js";import{addMainLightDirection as a,addMainLightIntensity as i}from"../shading/MainLighting.glsl.js";import{Water as c}from"../shading/Water.glsl.js";import{Float4DrawUniform as s}from"../../shaderModules/Float4DrawUniform.js";import{FloatPassUniform as n}from"../../shaderModules/FloatPassUniform.js";import{glsl as v}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as d}from"../../shaderModules/Texture2DPassUniform.js";import{Texture2DUintPassUniform as u}from"../../shaderModules/Texture2DUintPassUniform.js";import{Uniform as x}from"../../../../../webgl/Uniform.js";function y(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new s("overlayTexOffset",(e,r)=>h(o.spherical,e,r)),new s("overlayTexScale",(e,r)=>O(o.spherical,e,r))),t.uniforms.add(new s("overlayTexOffset",(e,r)=>h(o.spherical,e,r)),new s("overlayTexScale",(e,r)=>O(o.spherical,e,r))),t.constants.add("overlayOpacity","float",1),t.uniforms.add(new d("ovColorTex",(e,o)=>f(e,o))),g(e,o)}function f(e,o){return 0===e.identifier&&l(e.output)?e.occludedGround?o.overlay?.allSourcesOccluders?o.overlay?.getTexture(1):o.overlay?.getTexture(4):o.overlay?.getTexture(1):0===e.identifier&&9===e.output?o.overlay?.getTexture(5):2===e.identifier?o.overlay?.getTexture(2):null}function m(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new V("overlayTexOffset"),new V("overlayTexScale")),t.uniforms.add(new n("overlayOpacity",e=>e.overlayOpacity)),8!==o.output&&t.uniforms.add(new d("ovColorTex",(e,o)=>o.overlay?.getTexture(e.overlayContent))),g(e,o)}function p(e,o){switch(e){case 0:return 10!==o.slot||o.overlay?.allSourcesOccluders?0:4;case 1:case 2:return 0;case 8:return 2;case 3:case 5:case 6:case 7:return null;case 9:return 5}return null}function g(e,o){const{hasWater:r,output:t}=o;r&&e.include(c,o);const{vertex:l,fragment:s,varyings:n}=e;n.add("vtcOverlay","vec4");const d=8===t;l.code.add(v`void setOverlayVTC(in vec2 uv) {
6
6
  vtcOverlay = vec4(uv, uv) * overlayTexScale + overlayTexOffset;
7
7
  }`),s.code.add(v`bool isValid(vec2 uv, vec2 dxdy) {
8
8
  return (uv.x >= 0.0 + dxdy.x) && (uv.x <= 1.0 - dxdy.x) && (uv.y >= 0.0 + dxdy.y) && (uv.y <= 1.0 - dxdy.y);
@@ -2,19 +2,19 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ReadShadowMapPassParameters as e}from"../shading/ReadShadowMap.glsl.js";import{BackgroundGrid as t}from"./BackgroundGrid.glsl.js";import{If as o,glsl as r}from"../../shaderModules/glsl.js";import{Uniform as c}from"../../../../../webgl/Uniform.js";class n extends e{constructor(){super(...arguments),this.overlayOpacity=1}}function s(e,c){const{vertex:n,fragment:s,varyings:u}=e;u.add("vtc","vec2"),n.uniforms.add(new i("texOffsetAndScale")),s.uniforms.add(new l("tex")),s.uniforms.add(new d("textureOpacities"));const x=c.textureFadingEnabled&&!c.renderOccluded;x&&(n.uniforms.add(new i("nextTexOffsetAndScale")),u.add("nvtc","vec2"),s.uniforms.add(new l("texNext")),s.uniforms.add(new d("nextTexOpacities")),s.uniforms.add(new a("fadeFactor")));const f=1===c.tileBlendInput,v=2===c.tileBlendInput;v&&s.include(t),f&&s.uniforms.add(new d("backgroundColor")),n.code.add(r`
5
+ import{ReadShadowMapPassParameters as e}from"../shading/ReadShadowMap.glsl.js";import{BackgroundGrid as t}from"./BackgroundGrid.glsl.js";import{If as o,glsl as r}from"../../shaderModules/glsl.js";import{Uniform as c}from"../../../../../webgl/Uniform.js";class n extends e{constructor(){super(...arguments),this.overlayOpacity=1}}function s(e,c){const{vertex:n,fragment:s,varyings:u}=e;u.add("vtc","vec2"),n.uniforms.add(new i("texOffsetAndScale")),s.uniforms.add(new l("tex")),s.uniforms.add(new d("textureOpacities"));const{textureFadingEnabled:x,renderOccluded:f,tileBlendInput:v}=c,p=x&&!f;p&&(n.uniforms.add(new i("nextTexOffsetAndScale")),u.add("nvtc","vec2"),s.uniforms.add(new l("texNext")),s.uniforms.add(new d("nextTexOpacities")),s.uniforms.add(new a("fadeFactor")));const m=2===v;m&&s.include(t);const g=1===v;g&&s.uniforms.add(new d("backgroundColor")),n.code.add(r`
6
6
  void forwardTextureCoordinatesWithTransform(in vec2 uv) {
7
7
  vtc = texOffsetAndScale.xy + uv * texOffsetAndScale.zw;
8
- ${o(x,"nvtc = nextTexOffsetAndScale.xy + uv * nextTexOffsetAndScale.zw;")}
8
+ ${o(p,"nvtc = nextTexOffsetAndScale.xy + uv * nextTexOffsetAndScale.zw;")}
9
9
  }`),s.code.add(r`
10
10
  vec4 getColor(vec4 color, vec2 uv, vec3 opacities) {
11
- ${o(v||f,r`if (opacities.y <= 0.0) {
11
+ ${o(m||g,r`if (opacities.y <= 0.0) {
12
12
  return color * opacities.z * opacities.x;
13
13
  }
14
- vec4 bg = vec4(${f?r`backgroundColor`:r`gridColor(uv)`} * opacities.y, opacities.y);
14
+ vec4 bg = vec4(${g?r`backgroundColor`:r`gridColor(uv)`} * opacities.y, opacities.y);
15
15
  vec4 layer = color * opacities.z;
16
16
  return (bg * (1.0 - layer.a) + layer) * opacities.x;`,"return color;")}
17
- }`),x?s.code.add(r`vec4 getTileColor() {
17
+ }`),p?s.code.add(r`vec4 getTileColor() {
18
18
  vec4 color = getColor(texture(tex, vtc), vtc, textureOpacities);
19
19
  if (fadeFactor >= 1.0) {
20
20
  return color;
@@ -2,19 +2,19 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../../core/has.js";import{ZEROS as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BackgroundGrid as r}from"./BackgroundGrid.glsl.js";import{BlendModes as e}from"../util/BlendModes.glsl.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{FloatPassUniform as c}from"../../shaderModules/FloatPassUniform.js";import{glsl as l,If as s}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as t}from"../../shaderModules/Texture2DPassUniform.js";import{NoParameters as i}from"../../../../../webgl/NoParameters.js";class d extends i{constructor(){super(...arguments),this.baseOpacity=1,this.backgroundColor=o,this.fboTexture=null}}function b(o,i){const{output:d,blendMode:b,applyBaseOpacity:g,premultipliedAlphaSource:n}=i,u=o.fragment;g&&u.uniforms.add(new c("baseOpacity",o=>o.baseOpacity));const p=0!==b,m=!p&&!n&&(1===d&&!g||4===d);u.include(e,i);let f="";switch(d){case 4:case 0:f=l`vec4(0.0)`;break;case 2:u.uniforms.add(new a("backgroundColor",o=>o.backgroundColor)),f=l`vec4(backgroundColor, 1.0)`;break;case 3:u.include(r),f=l`vec4(gridColor(uv), 1.0)`;break;case 1:u.uniforms.add(new t("fboColor",o=>o.fboTexture)),f=l`texelFetch(fboColor, ivec2(gl_FragCoord.xy), 0)`}u.code.add(l`
5
+ import"../../../../../../core/has.js";import{ZEROS as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BackgroundGrid as r}from"./BackgroundGrid.glsl.js";import{BlendModes as e}from"../util/BlendModes.glsl.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{FloatPassUniform as c}from"../../shaderModules/FloatPassUniform.js";import{glsl as l,If as s}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as t}from"../../shaderModules/Texture2DPassUniform.js";import{NoParameters as d}from"../../../../../webgl/NoParameters.js";class i extends d{constructor(){super(...arguments),this.baseOpacity=1,this.backgroundColor=o,this.fboTexture=null}}function b(o,d){const{output:i,blendMode:b,applyBaseOpacity:g,premultipliedAlphaSource:n}=d,p=o.fragment;g&&p.uniforms.add(new c("baseOpacity",o=>o.baseOpacity));const u=0!==b,m=!u&&!n&&(1===i&&!g||4===i);p.include(e,d);let y="";switch(i){case 4:case 0:y=l`vec4(0.0)`;break;case 2:p.uniforms.add(new a("backgroundColor",o=>o.backgroundColor)),y=l`vec4(backgroundColor, 1.0)`;break;case 3:p.include(r),y=l`vec4(gridColor(uv), 1.0)`;break;case 1:p.uniforms.add(new t("fboColor",o=>o.fboTexture)),y=l`texelFetch(fboColor, ivec2(gl_FragCoord.xy), 0)`}p.code.add(l`
6
6
  vec4 getBackground(vec2 uv) {
7
- return ${s(g,l`baseOpacity *`)} ${f};
8
- }
9
-
10
- vec4 blendLayers(vec2 bgUV, vec4 colorLayer, float opacity) {
11
- ${p?l`
12
- vec3 cl = colorLayer.a == 0.0 ? colorLayer.rgb : colorLayer.rgb / colorLayer.a;
13
- vec4 bgColor = getBackground(bgUV);
14
- vec3 cb = bgColor.a == 0.0 ? bgColor.rgb : bgColor.rgb / bgColor.a;
15
- return applyBlendMode(clamp(cl, vec3(0.0), vec3(1.0)), colorLayer.a * opacity, cb, bgColor.a);`:l`
16
- float composeAlpha = colorLayer.a * opacity;
17
- ${m?l`return colorLayer * opacity;`:l`
7
+ return ${s(g,l`baseOpacity *`)} ${y};
8
+ }`),u?p.code.add(l`vec4 blendLayers(vec2 bgUV, vec4 colorLayer, float opacity) {
9
+ vec3 cl = colorLayer.a == 0.0 ? colorLayer.rgb : colorLayer.rgb / colorLayer.a;
10
+ vec4 bgColor = getBackground(bgUV);
11
+ vec3 cb = bgColor.a == 0.0 ? bgColor.rgb : bgColor.rgb / bgColor.a;
12
+ return applyBlendMode(clamp(cl, vec3(0.0), vec3(1.0)), colorLayer.a * opacity, cb, bgColor.a);
13
+ }`):p.code.add(l`
14
+ vec4 blendLayers(vec2 bgUV, vec4 colorLayer, float opacity) {
15
+ float composeAlpha = colorLayer.a * opacity;
16
+ ${s(m,l`return colorLayer * opacity;`,l`
18
17
  vec4 bgColor = getBackground(bgUV);
19
- return bgColor * (1.0 - composeAlpha) + colorLayer * opacity;`}`}
20
- }`)}export{b as TileBackground,d as TileBackgroundPassParameters};
18
+ return bgColor * (1.0 - composeAlpha) + colorLayer * opacity;
19
+ `)}
20
+ }`)}export{b as TileBackground,i as TileBackgroundPassParameters};