@arcgis/core 5.0.0-next.45 → 5.0.0-next.47
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.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/063045ac5553e91c0c4c.js +1 -0
- package/assets/esri/core/workers/chunks/{20ad34f9d45c64392022.js → 08c1ea29678da27136f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{5dc2f2e28c30386efadf.js → 10094eb2b94e98dd4a8a.js} +1 -1
- package/assets/esri/core/workers/chunks/108675a17e432a02cf66.js +1 -0
- package/assets/esri/core/workers/chunks/169be08394c5e7703628.js +1 -0
- package/assets/esri/core/workers/chunks/19270a2de33f2662005b.js +1 -0
- package/assets/esri/core/workers/chunks/1a6f3531ef3d671e0289.js +1 -0
- package/assets/esri/core/workers/chunks/{b809d499ff050976d9ed.js → 1c58064ea80e6a4a4a3b.js} +1 -1
- package/assets/esri/core/workers/chunks/1c816aff8613d1e4bf38.js +1 -0
- package/assets/esri/core/workers/chunks/{ee67c8a7c1f8b482cd99.js → 1ced78750c61600b2d4e.js} +1 -1
- package/assets/esri/core/workers/chunks/{c5d6b416baf24e74b9ba.js → 1dfa949cc4f4c18ed4cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{98175b454e807b1a3c5f.js → 1e152a34e368bd810a0f.js} +1 -1
- package/assets/esri/core/workers/chunks/1e17ad6cdffa5016a3db.js +1 -0
- package/assets/esri/core/workers/chunks/1e2d42e9984ed3437ba2.js +1 -0
- package/assets/esri/core/workers/chunks/2008b22f76071a2dde4e.js +1 -0
- package/assets/esri/core/workers/chunks/2107c93d1fe87f3b8dfa.js +1 -0
- package/assets/esri/core/workers/chunks/2209550b6510e25da375.js +1 -0
- package/assets/esri/core/workers/chunks/229e1ed4282005aa0b83.js +1 -0
- package/assets/esri/core/workers/chunks/22b8eaa6afab0e5ffc47.js +1 -0
- package/assets/esri/core/workers/chunks/{1c0fb4795a52204882a8.js → 2550d2ba935cfdf30236.js} +1 -1
- package/assets/esri/core/workers/chunks/{49e6219dd08cb6c27023.js → 273ac1066095d63d6a6f.js} +1 -1
- package/assets/esri/core/workers/chunks/2e2867bc66c94aba7dc7.js +1 -0
- package/assets/esri/core/workers/chunks/{cda5c95fd49b8901f7d4.js → 3298e96d3f2e49e338d2.js} +1 -1
- package/assets/esri/core/workers/chunks/34613b288cf174983f8b.js +1 -0
- package/assets/esri/core/workers/chunks/{e5baa30944061418cb13.js → 35f086a2ae0585348ae6.js} +1 -1
- package/assets/esri/core/workers/chunks/{f441fc74451330384fb0.js → 37ea150dec5e491f691e.js} +1 -1
- package/assets/esri/core/workers/chunks/3c94db7ecdcd38eeb1b1.js +1 -0
- package/assets/esri/core/workers/chunks/3f7749f06ae54a4437d9.js +1 -0
- package/assets/esri/core/workers/chunks/404229f10aef5ac23c87.js +1 -0
- package/assets/esri/core/workers/chunks/40a722933af28823953b.js +1 -0
- package/assets/esri/core/workers/chunks/{7aa730e5ac7b268e3c98.js → 424daef7b5dec1b99aba.js} +1 -1
- package/assets/esri/core/workers/chunks/456684b1c1417ed0e611.js +1 -0
- package/assets/esri/core/workers/chunks/{d14e75b160aa432233c6.js → 461093ce28ceadd7853d.js} +1 -1
- package/assets/esri/core/workers/chunks/46b63a65484b102e9ccb.js +1 -0
- package/assets/esri/core/workers/chunks/4a48b8ec5f3f2fd139b5.js +1 -0
- package/assets/esri/core/workers/chunks/4b084f985bc4100e7aec.js +1 -0
- package/assets/esri/core/workers/chunks/4b1de1fcd13677b615a8.js +1 -0
- package/assets/esri/core/workers/chunks/{31186e83fe009aa0fd36.js → 4d933de84afb2e3b7d18.js} +1 -1
- package/assets/esri/core/workers/chunks/{83aa39fbb1fad3b9d143.js → 4ff771942531fb2755c4.js} +1 -1
- package/assets/esri/core/workers/chunks/{e0017c6739d2532793e6.js → 513a4ef960e27500f986.js} +1 -1
- package/assets/esri/core/workers/chunks/56b693baa376bb990925.js +1 -0
- package/assets/esri/core/workers/chunks/{1d4ea8db272655c0608c.js → 57fd5e1260269002d18a.js} +1 -1
- package/assets/esri/core/workers/chunks/5fe40bb0e9ab333f6854.js +1 -0
- package/assets/esri/core/workers/chunks/{9f6c63a580b28ab715bd.js → 5ffeb8fb58d59bad68c3.js} +1 -1
- package/assets/esri/core/workers/chunks/{b56c07c0b43cb1999070.js → 60362c5651ef41fa7e5f.js} +1 -1
- package/assets/esri/core/workers/chunks/{e8a9971c8354569cb81d.js → 609919428305d8c8c243.js} +1 -1
- package/assets/esri/core/workers/chunks/{ab88577987cf2fe1cb32.js → 61373d2fa7e7638d3395.js} +1 -1
- package/assets/esri/core/workers/chunks/6202922b1c2637e9aaa5.js +1 -0
- package/assets/esri/core/workers/chunks/633368ae6fbb46373328.js +1 -0
- package/assets/esri/core/workers/chunks/657602e6a84e8b4576fb.js +1 -0
- package/assets/esri/core/workers/chunks/6d3ae7969ea86a2e0b13.js +1 -0
- package/assets/esri/core/workers/chunks/6d702cb26cef46a76963.js +1 -0
- package/assets/esri/core/workers/chunks/{35272810c2ed04eb403d.js → 6f3943bebe2d5f4994f7.js} +1 -1
- package/assets/esri/core/workers/chunks/708aba69a1870ea41a61.js +1 -0
- package/assets/esri/core/workers/chunks/{7ba13b52fce1060fbb2a.js → 7147fc7502b385b302b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ba8a2e1c0fb4e1efc7c.js → 7364fb5e99933533890d.js} +1 -1
- package/assets/esri/core/workers/chunks/74b1028e95f7cfff387b.js +1 -0
- package/assets/esri/core/workers/chunks/75d8244b725a2aee2003.js +1 -0
- package/assets/esri/core/workers/chunks/78fccea3445fb2f9120a.js +1 -0
- package/assets/esri/core/workers/chunks/7ba31425caa404f86424.js +1 -0
- package/assets/esri/core/workers/chunks/{a4f492aa5444e6381063.js → 7d631ebf8f79225cf0f6.js} +1 -1
- package/assets/esri/core/workers/chunks/{040f3d8e1099c4843390.js → 81a60dfa600b690098f9.js} +1 -1
- package/assets/esri/core/workers/chunks/833fd2bc42c5cb459084.js +1 -0
- package/assets/esri/core/workers/chunks/{75643711d9585ee26a15.js → 83c8e5a92d8d6193cb32.js} +1 -1
- package/assets/esri/core/workers/chunks/{e537e1d37f3fcb14fce2.js → 870022661376442411e4.js} +1 -1
- package/assets/esri/core/workers/chunks/898ab7db220e81e921c6.js +1 -0
- package/assets/esri/core/workers/chunks/{31b074ae2162a3508d2a.js → 8b578ffc3a83089aa782.js} +1 -1
- package/assets/esri/core/workers/chunks/{48c8ef4170e803a564d6.js → 8b75861196d1ce5cba63.js} +1 -1
- package/assets/esri/core/workers/chunks/8be61e13530fd0dc2fd1.js +1 -0
- package/assets/esri/core/workers/chunks/90b8ccee883738917a6d.js +1 -0
- package/assets/esri/core/workers/chunks/90bc9c299ae0e8b8b5e5.js +1 -0
- package/assets/esri/core/workers/chunks/91d9ade78854f40a962d.js +1 -0
- package/assets/esri/core/workers/chunks/9319d57494482668ab19.js +1 -0
- package/assets/esri/core/workers/chunks/{74881340e040bfd0580f.js → 934bc1028b287f8df4aa.js} +1 -1
- package/assets/esri/core/workers/chunks/96055de47831e59a28bf.js +1 -0
- package/assets/esri/core/workers/chunks/963ba863e0f87abfca25.js +1 -0
- package/assets/esri/core/workers/chunks/9aa8d60483ad905fe13b.js +1 -0
- package/assets/esri/core/workers/chunks/9fed9946241bb2a5cfa4.js +1 -0
- package/assets/esri/core/workers/chunks/a2662e98857f0abf8e82.js +1 -0
- package/assets/esri/core/workers/chunks/a5a9b0a35849b9f2e86d.js +1 -0
- package/assets/esri/core/workers/chunks/a60006c9ccf6817fc0d2.js +1 -0
- package/assets/esri/core/workers/chunks/a627b7eb94b7fca33210.js +1 -0
- package/assets/esri/core/workers/chunks/a651dc3b8f1fc1ab34cc.js +1 -0
- package/assets/esri/core/workers/chunks/{bf5f9da0837ed09729c6.js → aab93e885b6c7c6aa76e.js} +1 -1
- package/assets/esri/core/workers/chunks/adfe28c1c1619cdd3ca1.js +1019 -0
- package/assets/esri/core/workers/chunks/b88dc7d8ae105747e6a4.js +1 -0
- package/assets/esri/core/workers/chunks/b90c786dd474ea1a409c.js +1 -0
- package/assets/esri/core/workers/chunks/b92e9e5df8154a128982.js +1 -0
- package/assets/esri/core/workers/chunks/{9a855a10798348a21bab.js → bff814d34b38ec80c44d.js} +1 -1
- package/assets/esri/core/workers/chunks/c36d699a75b6e8fb93eb.js +1 -0
- package/assets/esri/core/workers/chunks/c50fdf723f2d4316862e.js +1 -0
- package/assets/esri/core/workers/chunks/{9461cc37ab3397265270.js → c5e8ff4721b15ac3c6eb.js} +1 -1
- package/assets/esri/core/workers/chunks/{4cda42b94e9cb58dd372.js → ca61077e0a598654f33f.js} +1 -1
- package/assets/esri/core/workers/chunks/{61a9ffd4cf07d8bb7a9b.js → ca81be5bdb88ef557bf3.js} +1 -1
- package/assets/esri/core/workers/chunks/{ca1c65eb7f5900c60170.js → cd8fec3500e6503ae020.js} +1 -1
- package/assets/esri/core/workers/chunks/ce90e8489143228262e7.js +1 -0
- package/assets/esri/core/workers/chunks/d0320ca67abca4f8b0d2.js +1 -0
- package/assets/esri/core/workers/chunks/{4b6a44c6265c8959abd8.js → d3db7244fac7398cc700.js} +1 -1
- package/assets/esri/core/workers/chunks/{19820cddba13a3585c0b.js → d561624ddb9388732b25.js} +1 -1
- package/assets/esri/core/workers/chunks/d65ca3b8fccae8c3c3fa.js +1 -0
- package/assets/esri/core/workers/chunks/{630eba99f48ea79a9560.js → d705410c369bd03b1875.js} +1 -1
- package/assets/esri/core/workers/chunks/{9c7682b300b877f60095.js → d76513a6260d9ec4ea25.js} +1 -1
- package/assets/esri/core/workers/chunks/d82e17522ed946c2d809.js +1 -0
- package/assets/esri/core/workers/chunks/d8dc130ea559be1f68c6.js +1 -0
- package/assets/esri/core/workers/chunks/dae715b2b0094641e42f.js +1 -0
- package/assets/esri/core/workers/chunks/{768ae52b4e5c3e571ef5.js → dc29cb16704e2e4d0a46.js} +1 -1
- package/assets/esri/core/workers/chunks/e8c2e2fbe9cef4c8a8c6.js +1 -0
- package/assets/esri/core/workers/chunks/ecb4c223c0278971cdc9.js +1 -0
- package/assets/esri/core/workers/chunks/{3f33708eb39c7169a226.js → f2ba50eb29f93df885d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{6e5d41f51572e3e7cf92.js → f7163048146ddaedfc36.js} +1 -1
- package/assets/esri/core/workers/chunks/f92a78ce5510e0d0d0f7.js +1 -0
- package/assets/esri/core/workers/chunks/fa92a7c11befbad8739f.js +1 -0
- package/assets/esri/core/workers/chunks/fdaa10a588db394e2f65.js +1 -0
- package/chunks/Laserlines.glsl.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/vec32.js +1 -1
- package/config.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/geometry/FlatGeometry.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/curves/circleUtils.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +179 -71
- package/kernel.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/{ParquetEncodingBase.js → ParquetGeometryEncodingBase.js} +1 -1
- package/layers/support/ParquetGeometryEncodingLocation.d.ts +4 -0
- package/layers/support/ParquetGeometryEncodingLocation.js +5 -0
- package/layers/support/ParquetGeometryEncodingWkb.d.ts +4 -0
- package/layers/support/ParquetGeometryEncodingWkb.js +5 -0
- package/layers/support/parquetEncodingUtils.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectSuppress.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/interactive/SegmentLabels2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsParameters.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/glTF/loader.js +1 -1
- package/views/3d/interactive/SegmentLabels3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/views/support/selectionUtils.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.d.ts +4 -0
- package/widgets/BatchAttributeForm/inputs/SingleFeatureInput.js +5 -0
- package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +4 -0
- package/widgets/BatchAttributeForm/inputs/TextElementInput.js +5 -0
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/templates/GroupElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/TextElementTemplate.js +5 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/FeatureForm/TextElementInput.d.ts +2 -2
- package/widgets/FeatureForm/TextElementInput.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMedia.js +5 -0
- package/widgets/PanoramicViewer/support/PanoramicMediaCollection.js +5 -0
- package/widgets/PanoramicViewer/support/PanoramicMediaError.js +5 -0
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/024104997daea0d74b38.js +0 -1
- package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +0 -1
- package/assets/esri/core/workers/chunks/08ef90e3fcfd4eda4301.js +0 -1
- package/assets/esri/core/workers/chunks/1e0e7cef7ef947894bbe.js +0 -1019
- package/assets/esri/core/workers/chunks/20988e116f3723228f36.js +0 -1
- package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +0 -1
- package/assets/esri/core/workers/chunks/274f2b5e6dbc58505142.js +0 -1
- package/assets/esri/core/workers/chunks/27dfbe3d903b95d4c67a.js +0 -1
- package/assets/esri/core/workers/chunks/28a5a7c6b3d6902146f6.js +0 -1
- package/assets/esri/core/workers/chunks/2c4218306747f5d15575.js +0 -1
- package/assets/esri/core/workers/chunks/2d3ae187f8aa3495d4ae.js +0 -1
- package/assets/esri/core/workers/chunks/2db7a7607657f1d669f7.js +0 -1
- package/assets/esri/core/workers/chunks/2f8cf7d9ff1f4de19a4c.js +0 -1
- package/assets/esri/core/workers/chunks/338570424337be05cef5.js +0 -1
- package/assets/esri/core/workers/chunks/36130910ba141f34531b.js +0 -1
- package/assets/esri/core/workers/chunks/3767617c0dfc7d801441.js +0 -1
- package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +0 -1
- package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +0 -1
- package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +0 -1
- package/assets/esri/core/workers/chunks/538ddb267aa328814865.js +0 -1
- package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +0 -1
- package/assets/esri/core/workers/chunks/55818fe7a7aa1e5c8bbd.js +0 -1
- package/assets/esri/core/workers/chunks/59889855d23baec1adf9.js +0 -1
- package/assets/esri/core/workers/chunks/5f781ef46ce7c4048c2f.js +0 -1
- package/assets/esri/core/workers/chunks/60f2de8dd8876bfd715a.js +0 -1
- package/assets/esri/core/workers/chunks/679088064420a906aa7f.js +0 -1
- package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +0 -1
- package/assets/esri/core/workers/chunks/71dd80231ea656a6380c.js +0 -1
- package/assets/esri/core/workers/chunks/725819839434c59102f3.js +0 -1
- package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +0 -1
- package/assets/esri/core/workers/chunks/768d9b6eaba7bfa18dde.js +0 -1
- package/assets/esri/core/workers/chunks/77b45957cfe42523c1c8.js +0 -1
- package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +0 -1
- package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +0 -1
- package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +0 -1
- package/assets/esri/core/workers/chunks/8d4cc5f1d07b4aa3aea0.js +0 -1
- package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +0 -1
- package/assets/esri/core/workers/chunks/93c5f097bb7b380bb175.js +0 -1
- package/assets/esri/core/workers/chunks/9f0172b83f25ef5f8d40.js +0 -1
- package/assets/esri/core/workers/chunks/a00bba1c7cbf8cd7892c.js +0 -1
- package/assets/esri/core/workers/chunks/a34a14fd989dbbd3c2d0.js +0 -1
- package/assets/esri/core/workers/chunks/ae793d814cf32db9fbde.js +0 -1
- package/assets/esri/core/workers/chunks/b21cf62652ca772108c8.js +0 -1
- package/assets/esri/core/workers/chunks/c5c02ace54fe4ab9214b.js +0 -1
- package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +0 -1
- package/assets/esri/core/workers/chunks/d0014b4a8c013f59b113.js +0 -1
- package/assets/esri/core/workers/chunks/d08ee45c501102deea20.js +0 -1
- package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +0 -1
- package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +0 -1
- package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +0 -1
- package/assets/esri/core/workers/chunks/e093e745708f722bc1b9.js +0 -1
- package/assets/esri/core/workers/chunks/e501d68a1464805c4b4e.js +0 -1
- package/assets/esri/core/workers/chunks/e6784251bbb8b71ead93.js +0 -1
- package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +0 -1
- package/layers/support/ParquetEncodingLocation.d.ts +0 -4
- package/layers/support/ParquetEncodingLocation.js +0 -5
- package/layers/support/ParquetEncodingWkb.d.ts +0 -4
- package/layers/support/ParquetEncodingWkb.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{lerp as t,clamp as s,smoothstep as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{set as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{b as m,
|
|
5
|
+
import{__decorate as e}from"tslib";import{lerp as t,clamp as s,smoothstep as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{set as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{b as m,F as p}from"../../../../../chunks/vec32.js";import{c}from"../../../../../chunks/vec42.js";import{earth as d}from"../../../../../geometry/support/Ellipsoid.js";import{InternalRenderCategory as u}from"../../../webgl.js";import{TransparentEnvironment as f}from"../TransparentEnvironment.js";import{H as _}from"../../../../../chunks/HazeCompositing.glsl.js";import{HazeCompositingTechnique as l}from"./HazeCompositingTechnique.js";import{HazePassParameters as g,HazeTechnique as b}from"./HazeTechnique.js";import{HazeTechniqueConfiguration as w}from"./HazeTechniqueConfiguration.js";import{createQuadVAO as P}from"../../lib/glUtil3D.js";import{applyTextureResizeModulo as v}from"../../lib/textureUtils.js";import{DepthStencilAttachment as j,PrimitiveType as A}from"../../../../webgl/enums.js";let T=class extends f{constructor(e){super(e),this._compositingPassParameters=new _,this._passParameters=new g,this._hazeConfiguration=new w,this.requireGeometryDepth=!0,this._oldAmount=1,this._newAmount=1,this._amount=this._newAmount;const t=e.view.stage.renderView.techniques;t.precompile(b,new w);const s=new w;s.reduced=!0,t.precompile(b,s),t.precompile(l)}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),o),a(()=>this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1,e=>this._fade(e),o),a(()=>this.view.environment.weather.type,e=>this._newAmount="rainy"===e?0:1,o),a(()=>this.view.stage.renderer?.highResolutionAtmosphere,e=>this._hazeConfiguration.reduced=!e,o)])}_fade(e){e>=1?(this._amount=this._newAmount,this._oldAmount=this._newAmount):this._amount=e<=0?this._oldAmount:t(this._oldAmount,this._newAmount,e)}destroy(){this._vao=r(this._vao)}render(e){const s=e.find(({name:e})=>e===u.TRANSPARENT_ENVIRONMENT);if(!this.bindParameters.mainDepth)return s;const i=this.renderingContext,r=this.techniques.get(b,this._hazeConfiguration);if(!r.compiled)return s;const a=s.getAttachment(j);if(this._update(),!this._hazeConfiguration.reduced)return s.detachDepth(),i.bindFramebuffer(s.fbo),i.bindTechnique(r,this.bindParameters,this._passParameters),this._renderCommon(i),s.attachDepth(a),s;const o=this.techniques.get(l);if(!o.compiled)return s;const n=i.getViewport(),h=this.camera,p=m(h.eye)-d.radius;let c;const f=d.atmosphereHeight;if(p<f){const e=Math.min(1,Math.max(0,p/f));c=t(.4,.5,e)}else{const e=Math.min(1,Math.max(0,(p-f)/(15*f)));c=t(.5,1,e)}const _=this.renderingContext.parameters.maxTextureSize,g=v(Math.round(c*h.fullViewport[2]),_),w=v(Math.round(c*h.fullViewport[3]),_);i.setViewport(0,0,g,w);const P=this.fboCache.acquire(g,w,"haze",5);return i.bindFramebuffer(P.fbo),i.clearFramebuffer([0,0,0,1],!0,!0),i.bindTechnique(r,this.bindParameters,this._passParameters),this._renderCommon(i),i.setViewport(n.x,n.y,n.width,n.height),this._compositingPassParameters.color=P.getTexture(),s.detachDepth(),i.bindFramebuffer(s.fbo),i.bindTechnique(o,this.bindParameters,this._compositingPassParameters),i.screen.draw(),s.attachDepth(a),P.release(),s}_renderCommon(e){this._vao??=P(e,1),e.bindVAO(this._vao),e.drawArrays(A.TRIANGLE_STRIP,0,4)}_update(){const e=this.bindParameters.camera,r=p(e.eye),a=Math.sqrt(r),o=r-this._passParameters.radii[1]*this._passParameters.radii[1],n=s((a-this._passParameters.radii[0])/d.atmosphereHeight,0,1);c(this._passParameters.heightParameters,a,r,o,n);const m=this.view.basemapTerrain?.getLowerBoundRadius()??0;h(this._passParameters.radii,m,m+d.atmosphereHeight),this._passParameters.hazeStrength=t(t(.6,1,i(9500,10500,a-d.radius)),1,this._amount)}};T=e([n("esri.views.3d.webgl-engine.effects.haze.Haze")],T);export{T as Haze};
|
|
@@ -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 has from"../../../../core/has.js";import{nextPowerOfTwo as t}from"../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{property as r,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{ortho as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderCategory as a,InternalRenderCategory as n}from"../../webgl.js";import{glLayout as c}from"../../support/buffer/glUtil.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import u from"../../webgl/RenderCamera.js";import d from"../../webgl/RenderNode.js";import{ShaderOutputConfiguration as p}from"../core/shaderLibrary/ShaderOutputConfiguration.js";import{VertexArrayObject as m}from"./VertexArrayObject.js";import{C as g}from"../../../../chunks/CutFillDepth.glsl.js";import{CutFillDepthTechnique as f}from"../shaders/CutFillDepthTechnique.js";import{C as _}from"../../../../chunks/CutFillReduction.glsl.js";import{CutFillReductionTechnique as b}from"../shaders/CutFillReductionTechnique.js";import{C as w}from"../../../../chunks/CutFillTargetDepth.glsl.js";import{CutFillTargetDepthTechnique as F}from"../shaders/CutFillTargetDepthTechnique.js";import{PrimitiveType as C,DataType as T}from"../../../webgl/enums.js";import{VertexBuffer as x}from"../../../webgl/VertexBuffer.js";let D=class extends d{constructor(e){super(e),this.consumes={required:[a.TRANSPARENT]},this.produces=n.CUTFILL_DEPTH,this._cutFillTargetDepthConfiguration=new p,this._cutFillTargetDepthParameters=new w,this._cutFillDepthParameters=new g,this._cutFillReductionParameters=new _,this.needsRender=!1,this.done=!0,this._localOrigin=o(),this._maxTextureSize=4096,this._width=0,this._height=0,this._reducedWidth=0,this._reducedHeight=0,this._depthFormat=13,this._colorFormat=10,this._targetVao=null}initialize(){this._maxTextureSize=Math.min(has("esri-mobile")?1024:this._maxTextureSize,this.fboCache.rctx.parameters.maxTextureSize),this._cutFillTargetDepthConfiguration.output=7}destroy(){this._targetVao=i(this._targetVao)}precompile(){this.techniques.precompile(F,this._cutFillTargetDepthConfiguration),this.techniques.precompile(f),this.techniques.precompile(b),this.view.stage.renderer.precompileCutFill()}render(e){const t=e.find(({name:e})=>e===n.CUTFILL_DEPTH);if(!this._orthographicCamera||!this._targetVao||!this.needsRender)return t;const i=this.techniques.get(F,this._cutFillTargetDepthConfiguration),r=this.techniques.get(f),s=this.techniques.get(b);if(!i.compiled||!r.compiled||!s.compiled)return this.requestRender(1),t;this.needsRender=!1;const h=this.renderingContext,o=this.fboCache,a=h.getViewport(),c=o.acquire(this._width,this._height,"cutfill reference depth",this._depthFormat);h.bindFramebuffer(c.fbo),h.setViewport(0,0,this._width,this._height),h.clear(1280),this.view.stage.renderer.renderCutFillReferenceDepth(this._orthographicCamera);const l=o.acquire(this._width,this._height,"cutfill target depth",this._depthFormat);h.bindFramebuffer(l.fbo),h.setViewport(0,0,this._width,this._height),h.setClearDepth(1),h.clear(256),this._cutFillTargetDepthParameters.origin=this._localOrigin,this._cutFillTargetDepthParameters.cutFillCamera=this._orthographicCamera,h.bindTechnique(i,this.bindParameters,this._cutFillTargetDepthParameters),h.bindVAO(this._targetVao),h.drawArrays(C.TRIANGLES,0,this._targetVao.vertexCount("geometry"));let u=o.acquire(this._width,this._height,"cutfill reduction even",this._colorFormat),d=o.acquire(this._width,this._height,"cutfill reduction odd",this._colorFormat);this._cutFillDepthParameters.referenceDepthTexture=c.depthTexture,this._cutFillDepthParameters.targetDepthTexture=l.depthTexture,h.bindFramebuffer(u.fbo),h.bindTechnique(r,this.bindParameters,this._cutFillDepthParameters),h.setClearColor(0,0,0,0),h.clear(16384),h.screen.draw(),c.release(),l.release();let p=this._width,m=this._height;const g=Math.ceil(Math.log2(Math.min(p,m)));for(let n=0;n<g;n++)p=Math.ceil(p/2),m=Math.ceil(m/2),this._cutFillReductionParameters.depthTexture=u.getTexture(),this._prepareFBO(d,p,m),h.bindTechnique(s,this.bindParameters,this._cutFillReductionParameters),h.screen.draw(),[u,d]=[d,u];return this._buffer=new Float32Array(p*m*2),u.fbo?.readPixels(0,0,p,m,33319,T.FLOAT,this._buffer),this._reducedWidth=p,this._reducedHeight=m,u.release(),d.release(),h.setViewport(a.x,a.y,a.width,a.height),this.done=!0,t}setup(e,r){const s=this.renderingContext,{cameraDimensions:{width:h,height:o},localOriginRenderSpace:a}=e,n=this._maxTextureSize,c=o/h,l=h>o?n:n/c,u=h>o?n*c:n;this._width=t(l),this._height=t(u);const d=[this._width,this._height];this._orthographicCamera=this._createCamera(e,d),this._targetVao=i(this._targetVao),this._targetVao=R(s,r),this._localOrigin=a,this.done=!1}start(){0!==this._width&&0!==this._height&&(this.needsRender=!0)}getDepth(){let e=0,t=0;for(let i=0;i<this._reducedWidth;i++)for(let r=0;r<this._reducedHeight;r++){const s=i+r*this.
|
|
5
|
+
import{__decorate as e}from"tslib";import has from"../../../../core/has.js";import{nextPowerOfTwo as t}from"../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{property as r,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{ortho as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{RenderCategory as a,InternalRenderCategory as n}from"../../webgl.js";import{glLayout as c}from"../../support/buffer/glUtil.js";import{newLayout as l}from"../../support/buffer/InterleavedLayout.js";import u from"../../webgl/RenderCamera.js";import d from"../../webgl/RenderNode.js";import{ShaderOutputConfiguration as p}from"../core/shaderLibrary/ShaderOutputConfiguration.js";import{VertexArrayObject as m}from"./VertexArrayObject.js";import{C as g}from"../../../../chunks/CutFillDepth.glsl.js";import{CutFillDepthTechnique as f}from"../shaders/CutFillDepthTechnique.js";import{C as _}from"../../../../chunks/CutFillReduction.glsl.js";import{CutFillReductionTechnique as b}from"../shaders/CutFillReductionTechnique.js";import{C as w}from"../../../../chunks/CutFillTargetDepth.glsl.js";import{CutFillTargetDepthTechnique as F}from"../shaders/CutFillTargetDepthTechnique.js";import{PrimitiveType as C,DataType as T}from"../../../webgl/enums.js";import{VertexBuffer as x}from"../../../webgl/VertexBuffer.js";let D=class extends d{constructor(e){super(e),this.consumes={required:[a.TRANSPARENT]},this.produces=n.CUTFILL_DEPTH,this._cutFillTargetDepthConfiguration=new p,this._cutFillTargetDepthParameters=new w,this._cutFillDepthParameters=new g,this._cutFillReductionParameters=new _,this.needsRender=!1,this.done=!0,this._localOrigin=o(),this._maxTextureSize=4096,this._width=0,this._height=0,this._reducedWidth=0,this._reducedHeight=0,this._depthFormat=13,this._colorFormat=10,this._targetVao=null}initialize(){this._maxTextureSize=Math.min(has("esri-mobile")?1024:this._maxTextureSize,this.fboCache.rctx.parameters.maxTextureSize),this._cutFillTargetDepthConfiguration.output=7}destroy(){this._targetVao=i(this._targetVao)}precompile(){this.techniques.precompile(F,this._cutFillTargetDepthConfiguration),this.techniques.precompile(f),this.techniques.precompile(b),this.view.stage.renderer.precompileCutFill()}render(e){const t=e.find(({name:e})=>e===n.CUTFILL_DEPTH);if(!this._orthographicCamera||!this._targetVao||!this.needsRender)return t;const i=this.techniques.get(F,this._cutFillTargetDepthConfiguration),r=this.techniques.get(f),s=this.techniques.get(b);if(!i.compiled||!r.compiled||!s.compiled)return this.requestRender(1),t;this.needsRender=!1;const h=this.renderingContext,o=this.fboCache,a=h.getViewport(),c=o.acquire(this._width,this._height,"cutfill reference depth",this._depthFormat);h.bindFramebuffer(c.fbo),h.setViewport(0,0,this._width,this._height),h.clear(1280),this.view.stage.renderer.renderCutFillReferenceDepth(this._orthographicCamera);const l=o.acquire(this._width,this._height,"cutfill target depth",this._depthFormat);h.bindFramebuffer(l.fbo),h.setViewport(0,0,this._width,this._height),h.setClearDepth(1),h.clear(256),this._cutFillTargetDepthParameters.origin=this._localOrigin,this._cutFillTargetDepthParameters.cutFillCamera=this._orthographicCamera,h.bindTechnique(i,this.bindParameters,this._cutFillTargetDepthParameters),h.bindVAO(this._targetVao),h.drawArrays(C.TRIANGLES,0,this._targetVao.vertexCount("geometry"));let u=o.acquire(this._width,this._height,"cutfill reduction even",this._colorFormat),d=o.acquire(this._width,this._height,"cutfill reduction odd",this._colorFormat);this._cutFillDepthParameters.referenceDepthTexture=c.depthTexture,this._cutFillDepthParameters.targetDepthTexture=l.depthTexture,h.bindFramebuffer(u.fbo),h.bindTechnique(r,this.bindParameters,this._cutFillDepthParameters),h.setClearColor(0,0,0,0),h.clear(16384),h.screen.draw(),c.release(),l.release();let p=this._width,m=this._height;const g=Math.ceil(Math.log2(Math.min(p,m)));for(let n=0;n<g;n++)p=Math.ceil(p/2),m=Math.ceil(m/2),this._cutFillReductionParameters.depthTexture=u.getTexture(),this._prepareFBO(d,p,m),h.bindTechnique(s,this.bindParameters,this._cutFillReductionParameters),h.screen.draw(),[u,d]=[d,u];return this._buffer=new Float32Array(p*m*2),u.fbo?.readPixels(0,0,p,m,33319,T.FLOAT,this._buffer),this._reducedWidth=p,this._reducedHeight=m,u.release(),d.release(),h.setViewport(a.x,a.y,a.width,a.height),this.done=!0,t}setup(e,r){const s=this.renderingContext,{cameraDimensions:{width:h,height:o},localOriginRenderSpace:a}=e,n=this._maxTextureSize,c=o/h,l=h>o?n:n/c,u=h>o?n*c:n;this._width=t(l),this._height=t(u);const d=[this._width,this._height];this._orthographicCamera=this._createCamera(e,d),this._targetVao=i(this._targetVao),this._targetVao=R(s,r),this._localOrigin=a,this.done=!1}start(){0!==this._width&&0!==this._height&&(this.needsRender=!0)}getDepth(){let e=0,t=0;for(let i=0;i<this._reducedWidth;i++)for(let r=0;r<this._reducedHeight;r++){const s=i+r*this._reducedWidth;e+=this._buffer?.[2*s]??0,t+=this._buffer?.[2*s+1]??0}return{cut:e,fill:t}}get width(){return this._width}get height(){return this._height}get updating(){return this.needsRender||!this.done}_prepareFBO(e,t,i){const r=this.renderingContext;r.bindFramebuffer(e.fbo),r.setViewport(0,0,t,i),r.setClearColor(0,0,0,0),r.clear(16384)}_createCamera(e,t){const{cameraPositionRenderSpace:i,localOriginRenderSpace:r,northVector:s,cameraDimensions:{width:o,height:a},cameraNearFar:{near:n,far:c}}=e,l=new u({eye:i,center:r,up:s,near:n,far:c});return l.viewport=[0,0,t[0],t[1]],h(l.projectionMatrix,-o/2,o/2,-a/2,a/2,n,c),l}};e([r()],D.prototype,"consumes",void 0),e([r()],D.prototype,"produces",void 0),e([r()],D.prototype,"needsRender",void 0),e([r()],D.prototype,"done",void 0),e([r()],D.prototype,"updating",null),D=e([s("esri.views.3d.webgl-engine.lib.CutFillDepth")],D);const j=l().vec3f("position").freeze();function R(e,t){const{positions:i,indices:r}=t,s=j.createBuffer(r.length),h=s.position;for(let a=0;a<r.length;++a){const e=3*r[a];h.set(a,0,i[e]),h.set(a,1,i[e+1]),h.set(a,2,i[e+2])}const o=new x(e,c(j),s.buffer);return new m(e,o)}class P{constructor(e,t){this.positions=e,this.indices=t}}export{D as CutFillDepth,P as TargetGeometryRenderInfo};
|
|
@@ -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{watch as t}from"../../../../core/reactiveUtils.js";import{property as s,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{e as r,b as n,j as o,q as l,g as h,
|
|
5
|
+
import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as s,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{e as r,b as n,j as o,q as l,g as h,F as u,d as c,J as p}from"../../../../chunks/vec32.js";import{create as d,clone as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as _}from"../../../../chunks/vec42.js";import{create as f}from"../../../../geometry/support/plane.js";import{fromPoints as g}from"../../../../geometry/support/ray.js";import{Sphere as b}from"../../../../geometry/support/sphere.js";import{RenderCategory as P}from"../../webgl.js";import{GaussianSplatTarget as C}from"../../layers/i3s/Intersector.js";import{GaussianSplatDataStore as S}from"../../support/gaussianSplatting/GaussianSplatDataStore.js";import w from"../../webgl/RenderNode.js";import{IntersectorResult as x}from"./IntersectorResult.js";import{G as v}from"../../../../chunks/GaussianSplat.glsl.js";import{GaussianSplatColorTechnique as y}from"../shaders/GaussianSplatColorTechnique.js";import{G as D}from"../../../../chunks/GaussianSplatComposition.glsl.js";import{GaussianSplatCompositionTechnique as q}from"../shaders/GaussianSplatCompositionTechnique.js";import{G as T}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as A}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{GaussianSplatDepthTechnique as E}from"../shaders/GaussianSplatDepthTechnique.js";import{GaussianSplatTechnique as G}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as O}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{DepthStencilAttachment as j,ColorAttachment1 as F,PrimitiveType as N}from"../../../webgl/enums.js";var I;let H=class extends w{static{I=this}constructor(e){super(e),this.gaussianPosition=d(),this.intersectionRayDir=d(),this.intersectionPlane=f(),this._slicePlaneEnabled=!1,this._data=null,this.produces=P.OPAQUE,this.type=0,this.isGround=!1,this.layerViewUid="",this._passParameters=new v,this._compositionPassParameters=new D,this._depthCompositionPassParameters=new T,this._previousCameraPosition=d(),this._previousCameraDirection=d(),this.fadeHelper=null,this._configuration=new O(e.view.state.isGlobal),this._colorOnlyConfiguration=new O(e.view.state.isGlobal,!0),this._depthOnlyConfiguration=new O(e.view.state.isGlobal,!1,!0)}async initialize(){this._data=new S(this),this.view.sceneIntersectionHelper.addIntersectionHandler(this),this.addHandles([t(()=>this.view.state.camera,()=>this._onCameraChange())])}precompile(){const e=this.view.qualitySettings.gaussianSplat.minimumOpacity,t=this.bindParameters.terrainDepthTest,s=this.fadeHelper.fadingEnabled,i=s=>{s.alphaCutoff=e,s.terrainDepthTest=t};this.renderingContext.capabilities.drawBuffersIndexed?(i(this._configuration),this._configuration.fadingEnabled=s,this.techniques.precompile(G,this._configuration)):(i(this._colorOnlyConfiguration),this._colorOnlyConfiguration.fadingEnabled=s,this.techniques.precompile(y,this._colorOnlyConfiguration),i(this._depthOnlyConfiguration),this.techniques.precompile(E,this._depthOnlyConfiguration)),this.techniques.precompile(q),this.techniques.precompile(A)}render(e){const t=e.find(({name:e})=>e===P.OPAQUE);if(this._handleFading(),!this._data.visibleGaussians||!this._data.orderTexture.texture||!this._data.textureAtlas.texture)return t;const s=!!this.renderingContext.capabilities.drawBuffersIndexed,i=s?this.techniques.get(G,this._configuration):null,a=s?null:this.techniques.get(y,this._colorOnlyConfiguration),r=s?null:this.techniques.get(E,this._depthOnlyConfiguration),n=this.techniques.get(q),o=this.techniques.get(A);if(!(i?.compiled||a?.compiled&&r?.compiled)||!o.compiled||!n.compiled)return this.requestRender(1),t;const{fullWidth:l,fullHeight:h}=this.bindParameters.camera;this._prepareParameters(h,l);const u=this.renderingContext,c=this.fboCache,p=c.acquire(l,h,"gaussian color output"),d=t.getAttachment(j);p.attachDepth(d);let m=null;s?this._singlePass(p,i):m=this._multiPass(p,d,a,r);const _=c.acquire(l,h,this.produces);return this._depthCompositionPassParameters.splatDepth=m?m.getTexture():p.getTexture(F),_.attachDepth(t.getAttachment(j)),u.bindFramebuffer(_.fbo),u.bindTechnique(o,this.bindParameters,this._depthCompositionPassParameters),u.screen.draw(),this._compositionPassParameters.color=t.getTexture(),this._compositionPassParameters.splatColor=p.getTexture(),u.bindFramebuffer(_.fbo),u.bindTechnique(n,this.bindParameters,this._compositionPassParameters),u.screen.draw(),p.release(),m?.release(),_}intersect(e,t,s,i){const{gaussianPosition:a,intersectionRayDir:c,intersectionPlane:p,layerViewUid:f}=this,P=g(s,i);r(c,i,s);const S=1/n(c);o(c,c,S);const w=d();l(w,c),_(p,c[0],c[1],c[2],-h(c,s));const v=new U,y=new U,D=new Array;this._data.visibleGaussianTiles.forEach(r=>{const{maxScale:n}=r,o=r.obb.minimumDistancePlane(p),l=r.obb.maximumDistancePlane(p),d=l<0,_=null!=v.dist&&null!=y.dist&&v.dist<o*S&&y.dist>l*S;if(d||_)return;if(!new b(r.obb.center,r.obb.radius+n).intersectRay(P,null))return;if(!r.obb.intersectRay(s,c,n))return;const{positions:g,squaredScales:C,gaussianAtlasIndices:x}=r,q=x.length;for(let p=0;p<q;p++){const r=3*p;a[0]=g[r]-s[0],a[1]=g[r+1]-s[1],a[2]=g[r+2]-s[2];const n=C[p],o=h(a,c),l=o*o;if(u(a)-l>n)continue;const d=o*S,_=e=>(e.point=e.point?e.point.fill(a[0],a[1],a[2]):m(a),e.dist=d,e.normal=w,e.layerViewUid=f,e);if((null==v.dist||d<v.dist)&&(null==t||t(s,i,d))&&_(v),0!==e.options.store&&(null==y.dist||d>y.dist)&&(null==t||t(s,i,d))&&_(y),2===e.options.store&&(null==t||t(s,i,d))){const e=new U;D.push(_(e))}}});const q=(e,t)=>{const{layerViewUid:s}=t,i=new C(t.point,s);e.set(0,i,t.dist,t.normal)};if(R(v)){const t=e.results.min;(null==t.distance||v.dist<t.distance)&&q(t,v)}if(R(y)&&0!==e.options.store){const t=e.results.max;(null==t.distance||y.dist>t.distance)&&q(t,y)}if(2===e.options.store)for(const r of D){const t=new x(P);q(t,r),e.results.all.push(t)}}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}get data(){return this._data}destroy(){this._data.destroy(),super.destroy()}_onCameraChange(){const e=this.view.state.camera.eye,t=this.view.state.camera.ray.direction,s=.001;(Math.abs(e[0]-this._previousCameraPosition[0])>s||Math.abs(e[1]-this._previousCameraPosition[1])>s||Math.abs(e[2]-this._previousCameraPosition[2])>s||Math.abs(t[0]-this._previousCameraDirection[0])>s||Math.abs(t[1]-this._previousCameraDirection[1])>s||Math.abs(t[2]-this._previousCameraDirection[2])>s)&&(c(this._previousCameraPosition,e),c(this._previousCameraDirection,t),this._data.requestSort())}_prepareParameters(e,t){this._passParameters.totalGaussians=this._data.visibleGaussians,this._passParameters.splatOrder=this._data.orderTexture.texture,this._passParameters.splatFading=this._data.fadingTexture.texture,this._passParameters.splatAtlas=this._data.textureAtlas.texture;const s=Math.tan(.5*this.camera.fovY),i=s/e*t;a(this._passParameters.tanFov,i,s),this._passParameters.focalLength=e/(2*s);const r=this.view.qualitySettings.gaussianSplat.minimumSplatPixelRadius;this._passParameters.minSplatRadius=r*Math.sqrt(t*e)/Math.sqrt(2073600),this._prepareHighPrecisionCameraPosition()}_singlePass(e,t){const s=this.renderingContext,i=this.renderingContext.gl,a=this.renderingContext.capabilities.drawBuffersIndexed;e.acquireColor(F,8,"gaussian depth output"),s.bindFramebuffer(e.fbo),s.setClearColor(0,0,0,0),s.clear(16384),this.renderingContext.bindTechnique(t,this.bindParameters,this._passParameters),a.enableiOES(i.BLEND,0),a.blendEquationSeparateiOES(0,i.FUNC_ADD,i.FUNC_ADD),a.blendFuncSeparateiOES(0,i.ONE_MINUS_DST_ALPHA,i.ONE,i.ONE_MINUS_DST_ALPHA,i.ONE),a.enableiOES(i.BLEND,1),a.blendEquationSeparateiOES(1,i.FUNC_ADD,i.FUNC_ADD),a.blendFuncSeparateiOES(1,i.ONE_MINUS_DST_ALPHA,i.DST_ALPHA,i.ONE_MINUS_DST_ALPHA,i.ONE),this.renderingContext.drawArraysInstanced(N.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}_multiPass(e,t,s,i){const{fullWidth:a,fullHeight:r}=this.bindParameters.camera,n=this.renderingContext;n.bindFramebuffer(e.fbo),n.setClearColor(0,0,0,0),n.clear(16384),this.renderingContext.bindTechnique(s,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(N.TRIANGLE_STRIP,0,4,this._data.visibleGaussians);const o=this.fboCache.acquire(a,r,"gaussian depth output",8);return o.attachDepth(t),n.bindFramebuffer(o.fbo),n.setClearColor(0,0,0,0),n.clear(16384),this.renderingContext.bindTechnique(i,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(N.TRIANGLE_STRIP,0,4,this._data.visibleGaussians),o}_prepareHighPrecisionCameraPosition(){o(this._passParameters.tileCameraPosition,this.camera.eye,1/I.tileSize),p(this._passParameters.tileCameraPosition,this._passParameters.tileCameraPosition),o(this._passParameters.cameraDelta,this._passParameters.tileCameraPosition,I.tileSize),r(this._passParameters.cameraDelta,this.camera.eye,this._passParameters.cameraDelta)}_handleFading(){if(0===this.fadeHelper.numFadingTiles)return void(this._previousFrameStart=null);this._previousFrameStart??=this.view.stage.renderer.renderContext.time;const e=this.view.stage?.renderer.renderContext.time-this._previousFrameStart;this.fadeHelper.updateAllTileFading(e),this._previousFrameStart=this.view.stage.renderer.renderContext.time,this._data.fadingTexture.updateTexture(this._data.textureAtlas.pageAllocator.pageCount)}static{this.tileSize=2.048}};function R(e){return null!=e.dist&&null!=e.point}e([s({constructOnly:!0})],H.prototype,"fadeHelper",void 0),H=I=e([i("esri.views.3d.webgl-engine.lib.GaussianSplatRenderNode")],H);class U{constructor(){this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}export{H as GaussianSplatRenderNode};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import{generateUID as t}from"../../../../core/uid.js";import{multiply as i,copy as e,hasIdentityRotation as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o,IDENTITY as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as a,p as h,
|
|
5
|
+
import"../../../../core/has.js";import{generateUID as t}from"../../../../core/uid.js";import{multiply as i,copy as e,hasIdentityRotation as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o,IDENTITY as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{l as a,p as h,D as n,h as m,i as d,m as l,d as c}from"../../../../chunks/vec32.js";import{create as g,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Sphere as u}from"../../../../geometry/support/sphere.js";import{maxScale as f}from"../../support/mathUtils.js";import{Object3DOccludeeStateID as b,Object3DHighlightStateID as v}from"./Object3DStateID.js";import{assert as p}from"./Util.js";import{affectsGeometry as y}from"./VertexAttribute.js";import{addObject3DStateID as j,removeObject3DStateID as V}from"../materials/renderers/utils.js";class S{constructor(i={}){this.id=t(),this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=i.castShadow??!0,this.usesVerticalDistanceToGround=i.usesVerticalDistanceToGround??!1,this.graphicUid=i.graphicUid,this.layerViewUid=i.layerViewUid,i.isElevationSource&&(this.lastValidElevationBB=new x),this._geometries=i.geometries?Array.from(i.geometries):[]}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(t){p(null==this._layer||null==t,"Object3D can only be added to a single Layer"),this._layer=t}addGeometry(t){t.visible=this._visible,this._geometries.push(t);for(const i of this._highlightIds)t.addHighlight(i);this._emit("geometryAdded",{object:this,geometry:t}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}removeGeometry(t){const i=this._geometries.splice(t,1)[0];if(i){for(const t of this._highlightIds)i.removeHighlight(t);this._emit("geometryRemoved",{object:this,geometry:i}),this._highlightIds.size&&this._emit("highlightChanged",this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(t,i,e=!1){this._emit("attributesChanged",{object:this,geometry:t,attribute:i,sync:e}),y(i)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(t){if(this._visible!==t){this._visible=t;for(const t of this._geometries)t.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const t=new b;for(const i of this._geometries)i.occludees=j(i.occludees,t);return this._emit("occlusionChanged",this),t}removeOcclude(t){for(const i of this._geometries)i.occludees=V(i.occludees,t);this._emit("occlusionChanged",this)}highlight(t){const i=new v(t);for(const e of this._geometries)e.addHighlight(i);return this._emit("highlightChanged",this),this._highlightIds.add(i),i}removeHighlight(t){this._highlightIds.delete(t);for(const i of this._geometries)i.removeHighlight(t);this._emit("highlightChanged",this)}removeStateID(t){0===t.channel?this.removeHighlight(t):this.removeOcclude(t)}getCombinedStaticTransformation(t,e){return i(e,this.transformation,t.transformation)}getCombinedShaderTransformation(t,e=o()){return i(e,this.effectiveTransformation,t.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=new W,this._validateBoundingVolume(this._bvWorldSpace,0)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=new W,this._validateBoundingVolume(this._bvObjectSpace,1)),this._bvObjectSpace}_validateBoundingVolume(t,i){const e=1===i;for(const s of this._geometries){const i=s.boundingInfo;i&&A(i,t,e?s.transformation:this.getCombinedShaderTransformation(s))}a(t.bounds.center,t.min,t.max,.5);for(const s of this._geometries){const i=s.boundingInfo;if(null==i)continue;const o=e?s.transformation:this.getCombinedShaderTransformation(s),r=f(o);h(B,i.center,o);const a=n(B,t.bounds.center),m=i.radius*r;t.bounds.radius=Math.max(t.bounds.radius,a+m)}}_invalidateBoundingVolume(){const t=this._bvWorldSpace?.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&t&&this.layer.notifyObjectBBChanged(this,t)}_emit(t,i){this.layer?.events.emit(t,i)}get geometries(){return this._geometries}get transformation(){return this._transformation??r}set transformation(t){this._transformation=e(this._transformation??o(),t),this._invalidateBoundingVolume(),this._emit("transformationChanged",this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(t){this._shaderTransformation=t?e(this._shaderTransformation??o(),t):null,this._invalidateBoundingVolume(),this._emit("shaderTransformationChanged",this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}class x{constructor(){this._data=[Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]}get min(){return _(this._data[0],this._data[1],this._data[2])}get max(){return _(this._data[3],this._data[4],this._data[5])}minWith(t){const{_data:i}=this;i[0]=Math.min(i[0],t[0]),i[1]=Math.min(i[1],t[1]),i[2]=Math.min(i[2],t[2])}maxWith(t){const{_data:i}=this;i[3]=Math.max(i[3],t[0]),i[4]=Math.max(i[4],t[1]),i[5]=Math.max(i[5],t[2])}assignMinMax(t,i){for(let e=0;e<3;++e)this._data[0+e]=t[e],this._data[3+e]=i[e]}isEmpty(){return this._data[3]<this._data[0]&&this._data[4]<this._data[1]&&this._data[5]<this._data[2]}}class W extends x{constructor(){super(...arguments),this.bounds=new u}}function A(t,i,e){const o=t.bbMin,r=t.bbMax;if(s(e)){const t=m(M,e[12],e[13],e[14]);return d(T,o,t),d(C,r,t),i.minWith(T),void i.maxWith(C)}if(h(T,o,e),l(o,r))return i.minWith(T),void i.maxWith(T);h(C,r,e),i.minWith(T),i.minWith(C),i.maxWith(T),i.maxWith(C);for(let s=0;s<3;++s)c(T,o),c(C,r),T[s]=r[s],C[s]=o[s],h(T,T,e),h(C,C,e),i.minWith(T),i.minWith(C),i.maxWith(T),i.maxWith(C)}const M=g(),T=g(),C=g(),B=g();export{W as BoundingVolume,S as Object3D};
|
|
@@ -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{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as _}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as u,initial as p,sync as m}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{Milliseconds as f}from"../../../../core/time.js";import{property as g,subclass as b}from"../../../../core/accessorSupport/decorators.js";import{equals as P,invert as C,multiply as w}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as T,create as S}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as E}from"../../../../chunks/vec42.js";import{ZEROS as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as A,ZEROS as D}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as I}from"../../../../geometry/support/Indices.js";import{RenderCategory as R,InternalRenderCategory as y}from"../../webgl.js";import{innerAtmosphereFadeStart as O}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as v}from"../../support/debugFlags.js";import{FBOCache as H,defaultWebGLFBO as M}from"../core/FBOCache.js";import{RenderPassManager as N}from"../core/renderPasses/RenderPassManager.js";import{isColor as q}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as G}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as L}from"../effects/RenderNodes.js";import{RenderPluginManager as U}from"../effects/RenderPluginManager.js";import{Blit as V}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as j,renderHighlightBuffer as B}from"../effects/highlight/Highlight.js";import{OITBlend as k}from"../effects/transparency/OITBlend.js";import{AnimationTimer as z}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as Q}from"./BoundingInfo.js";import{DepthRange as Y}from"./DepthRange.js";import{depthRangeFromScene as Z}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as J}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as K}from"./MainFramebuffer.js";import{RenderContext as X,defaultRenderOccludedMask as $}from"./RenderContext.js";import{RendererBase as ee}from"./RendererBase.js";import{setupFeatureDefaults as te}from"./RenderFeature.js";import{RenderPluginInput as re}from"./RenderPluginInput.js";import{ShadowAccumulator as ie}from"./ShadowAccumulator.js";import{ShadowMap as se}from"./ShadowMap.js";import ae from"./SliceHelper.js";import{MergedRenderer as ne}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as he}from"../parts/renderUtils.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{PixelType as _e,ColorAttachment1 as le,ColorAttachment2 as ue}from"../../../webgl/enums.js";let pe=class extends ee{constructor(e,t,r,s,a,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new N,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ae,this._blit=null,this._oitblend=null,this.sceneDepthRange=c(Y.Infinite),this._state=c(2),this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=c(0),this._lastFrameTime=f(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new re,this._releaseNormals=e=>{e.some(({name:e})=>"normals"===e)&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this._fboCache=new H(s),this._renderStateFeatures=c(te(e.view.qualityProfile)),this._framebuffer=new K(this.fboCache),this._performanceInfo=new oe(this._rctx),this._shadowMap=new se(this.fboCache,e.viewingMode),this._shadowAccumulator=new ie(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t},(t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(3,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},n),this._renderContext=new X(this._rctx,this._shadowMap,r),this._nodes=new L(this._renderContext),this._plugins=new U({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([l(()=>e.view.state.camera,()=>n(),u),l(()=>v.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},n()},p),l(()=>e.view.environment.background?.color,e=>{const t=e?i(e):D;E(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()},u),l(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=G,u),l(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},m),l(()=>this._bindParameters.clouds.data?.state,()=>n(),m),l(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,n()},p)])}destroy(){this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._blit=null,this._oitblend=null,this._compositingHelper=null,this._nodes=null,this._framebuffer=null,this._shadowMap=null,this._renderContext=null,this._performanceInfo=null,Q.prune(),ne.prune(),I()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=te(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(i=>i.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&this.isFeatureEnabled(5)}get _hasHighlights(){return this._plugins.produces(8,2,4,19,14,15)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(8,14,15)}get hasSSAO(){return this.isFeatureEnabled(4)&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get hasEmitters(){return this._plugins.hasEmitters&&this.stage.view.qualitySettings.physicallyBasedRenderingEnabled}get highResolutionAtmosphere(){return this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");_(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:xe(this.stage.view.resourceController)});return this.addHandles(l(()=>r.updating,()=>this._requestRender(),m)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&P(this._bindParameters.ssr.reprojectionMatrix,T)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),e.environment){void 0!==e.environment.weather&&(this._bindParameters.weather=e.environment.weather);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,10)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(0,...Ce),has.water=this._plugins.produces(2,20),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new z(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new he(this._pluginInput.get(R.FINAL),null)}_render(e,t,r,i){const s=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=s,this._disposeBindBuffers();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=e;this._state.value=h;const d=this._nodes.produces("magnifier-color"),_=this._nodes.produces(R.FINAL);this._renderContext.time=t,this._renderContext.output=0,this._bindParameters.hasEmission=this.hasEmitters,this._bindParameters.oitPass=0,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null;const l=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(y.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(y.CUTFILL_DEPTH),this._renderOverlay(),a.setGLViewport(this._rctx);const u=this._framebuffer,p=u.initialize(a.fullWidth,a.fullHeight,this._backgroundColor,this._bindParameters.hasEmission);this.hasReflections?(p?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=p):p?.release(),this._ensureBindParametersCamera(a,n),this._updateHUDOccludedFragmentOpacity(h,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const m=this._plugins.produces(0,...ce);this._precompilePrepasses(),this.performanceInfo.advance(de.PREPARE);const c=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,c),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(c,a,n,!s),this._ensureBindParametersSSR(t),this._precompileShaders(m),this._renderContext.output=0,u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._renderOpaque(),this._renderTransparent(m),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(y.FOCUSAREA,this._renderFocusAreaGeometry()),this._pluginInput.set(y.CUTFILL_DEPTH,this._renderCutFillDepth()),u.update(e=>this._renderNodes(y.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(y.VIEWSHED,e)),u.update(e=>this._renderNodes(y.LASERLINES,e)),u.update(e=>this._renderNodes(y.FOCUSAREA_COLOR,e)),this._pluginInput.release(y.FOCUSAREA),this._pluginInput.release(y.CUTFILL_DEPTH),u.update(e=>this._renderNodes(y.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(a,this._bindParameters.lighting.mainLight.direction,c);const f=2===r?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(R.COMPOSITE,e)),this._shadowMap.disposeOffscreenBuffers();const g=s&&!_&&!(d&&!i),b=this._pluginInput.get(R.COMPOSITE),P=g?M:this.fboCache.acquire(b.fbo.width,b.fbo.height,y.ANTIALIASING),C=this._nodes.produces(y.ANTIALIASING)?this._renderNodes(y.ANTIALIASING,P):this.blitFBO(b,P,!1);let w;this._pluginInput.set(y.ANTIALIASING,C),this._hasHUDHighlights?(this._renderHUD(1,C),w=this._renderNodes(y.HIGHLIGHTS,C)):(w=this._renderNodes(y.HIGHLIGHTS,C),this._renderHUD(1,w));const T=this._renderNodes(y.MAGNIFIER,w);return s&&d&&!i&&!_&&this.blitFBO(T),_?(T.attachDepth(u.depth),this.blitFBO(this._renderNodes(R.FINAL,T)),T.detachDepth()):this._pluginInput.set(R.FINAL,T),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),u.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),s||(this._releaseFBOs(),this._disposeOffscreenBuffers()),new he(this._pluginInput.get(R.FINAL),f)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._renderContext.output=0,this._precompileOpaqueGeometry(),this._nodes.precompile(y.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,this._renderContext.output=1,this._plugins.precompile(...fe),this._needsTerrainDepth&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=0,this._plugins.precompile(...fe),e&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(y.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(13),this._plugins.precompile(16),this._precompileHUD(0),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(y.VIEWSHED,y.CUTFILL_DEPTH,y.CUTFILL_COLOR,y.LASERLINES,y.FOCUSAREA_COLOR,y.OCCLUDED,y.ANTIALIASING,y.HIGHLIGHTS);const t=this._bindParameters;t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(1),this._hasHighlights&&(t.highlights.forEach((e,r)=>{t.highlightLevel=r,this._precompileAllGeometry(8)}),t.highlightLevel=null),t.highlightMixTexture=null,this._nodes.precompile(R.COMPOSITE,y.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(y.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(de.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(13),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(D),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,_e.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,6408,_e.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=this._bindParameters.geometryDepth,a=()=>t.render(this._bindParameters,e);this.renderToTargets(a,i,s??this._framebuffer.depth,D),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?de.OPAQUE_EDGES:de.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(),this._bindParameters.overlay&&this.performanceInfo.advance(de.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(5,this._shadowMap),i.copySnapshot(1),this._renderShadowCascades(4,this._shadowMap)):this._renderShadowCascades(3),i.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(de.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(4,this._shadowMap),i.moveSnapshot(0),i.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(de.SHADOW_MAP)}_renderCutFillDepth(){return this._nodes.produce(y.CUTFILL_DEPTH,this._pluginInput)}_precompileShadowCascades(e){0!==this._shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(1)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(y.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(1),d(this._bindParameters.depth),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(de.DEPTH)):(e.detachDepth(),this._bindParameters.depth=d(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"geometry depth",13);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1280),this.renderAllGeometry(1),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(de.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._renderContext.output;this._renderContext.output=1;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"terrain depth",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=r.obtainDepthTexture(),r.release(),this._renderContext.output=e}_renderGeometryDepth(){if(!this._needsTerrainDepth)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const e=this._renderContext.output,{width:t,height:r}=this._framebufferSize,i=this.fboCache.acquire(t,r,"geometry depth",13);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(1),this._renderContext.output=e,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=i.obtainDepthTexture(),i.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Y.Zero;const t=Z(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Y.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<O)return void(this.sceneDepthRange.value=Y.Infinite);const t=e.clone();t.near=F,t.far=1e10;const r=Z(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",R.FINAL,R.COMPOSITE,R.OPAQUE,R.TRANSPARENT,y.VIEWSHED,y.LASERLINES);return(this.hasSSAO?1:0)+e}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:_}=J,l=this.stage.view,u=l.stateManager.camera,p=l.qualitySettings.fadeDuration,m=2===e?r:i,c=s((u.tilt-h)/(o-h),0,1),f=s(((u.position.z??0)-d)/(_-d),0,1),g=a(a(1,m,c),1,f),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===g||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=g,void(this._lastFrameTime=t);const P=t-this._lastFrameTime;this._lastFrameTime=t;const C=Math.max(1-r,Math.abs(r-i)),w=Math.min(C*P/p,n);w>=Math.abs(g-b)?this._bindParameters.hudOccludedFragmentOpacity=g:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(g-b)*w,this._requestRender())}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(2),this._needsDepth&&this._precompileAllGeometry(1),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(4),this._precompileShadowCascades(5)):this._precompileShadowCascades(3)),this._shadowAccumulator.active&&this._precompileAllGeometry(3)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",5);r.acquireDepth(13),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(D,!0,!0),this._renderContext.output=2,this._plugins.render(...ge);const i=this._nodes.optional("normals",R.FINAL,R.COMPOSITE,R.OPAQUE,R.TRANSPARENT,y.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(de.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return;const t=this._nodes.produce(y.SSAO,this._pluginInput);return this._bindParameters.ssao=t,t&&this.performanceInfo.advance(de.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...fe),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Pe);this._renderContext.renderOccludedMask=$}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(10),this.renderSlots(e,...Pe),this._renderContext.renderOccludedMask=$}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(6)}precompileCutFill(){const e=7,t=this._renderContext.output;this._renderContext.output=e,this._plugins.precompile(0,1,...fe),this._renderContext.output=t}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(6),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._renderContext.output=7,this._plugins.render(0,1,...fe),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...be)}_precompileOpaqueGeometry(){this._plugins.precompile(...me),this._nodes.precompile("opaque-color")}_renderOpaqueGeometry(){this._plugins.render(...me)}_renderTransparentGeometry(){this._plugins.render(...ce)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"transparent terrain");return this.renderToTargets(()=>this._plugins.render(6),t,this._framebuffer.depth,D),this.performanceInfo.advance(de.TRANSPARENT_TERRAIN),t}_renderTransparentGround(){this._plugins.render(...fe)}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,13)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(13),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(de.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),t=this._framebufferSize,r=this.fboCache.acquireDepth(12,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(16)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=8,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&q(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...Ce),this._bindParameters.oitPass=2,this._plugins.precompile(...Ce),this._bindParameters.oitPass=0):this._plugins.precompile(...Ce),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t){if(this._pluginsHas.hudElements){if(this._oitEnabled){const r=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,r.getTexture(),!1),r.release()}else if(this._renderContext.output=0,0===e){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(12,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(12),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(0===e?de.HUD_OCCLUDED:de.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(4,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>j?3:1);a.acquireDepth(13);const n=this._plugins.produces(8,0);return n&&this._framebuffer.color.fbo&&a.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,a.fbo,1024),t.bindFramebuffer(a.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),n||t.clear(1024),this._renderContext.output=8,t.bindFramebuffer(a.fbo),B(t,e,i,r,()=>this._renderHighlightGeometries()),a.detachDepth(),this.performanceInfo.advance(de.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(...we),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t,r,i){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r,i)&&this.performanceInfo.advance(de.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&q(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...ce),this._bindParameters.oitPass=2,this._plugins.precompile(...ce),this._bindParameters.oitPass=0):this._plugins.precompile(...ce)}_renderOIT(e,t=2){const r=1===e,i=this._framebufferSize,s=r?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),a=this._bindParameters,n=this._renderContext.output;this._renderContext.output=0,a.oitPass=1;const h=r?"oit hud":"oit",o=this.fboCache.acquire(i.width,i.height,h,8),d=this._bindParameters.hasEmission;d&&o.acquireColor(le,8,"oit emissive"),o.acquireColor(d?ue:le,7,"oit alpha"),r||o.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(o.fbo),this._rctx.clearFramebuffer([0,0,0,1]),d&&this._rctx.clearBuffer(1,x),s(),o.detachDepth(),a.oitPass=2;const _=this.fboCache.acquire(i.width,i.height,r?"oit hud front":"oit front");let l;return d&&_.acquireColor(le,8,"oit emissive front"),r?_.acquireDepth(12):_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer(D,r),s(),_.detachDepth(),a.oitPass=0,r?(l=this.fboCache.acquire(i.width,i.height,"oit hud composite"),this._rctx.bindFramebuffer(l.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):this._framebuffer.bind(),this._oitblend??=new k(this._techniques),this._oitblend.blend(this._rctx,o,_,a,d,!r),l?.detachDepth(),_.release(),o.release(),this._renderContext.output=n,l}_renderOpaque(){const e=this.plugins.produces(0,...me);if(e){this._plugins.render(0,1);const e=this._framebuffer;e.update(e=>this._renderNodes(y.CUTFILL_COLOR,e)),e.update(e=>this._renderNodes(y.OPAQUE_TERRAIN,e)),e.bind(),this._plugins.render(2,3)}const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(R.OPAQUE,t,e)),this.fboCache.debugCallback?.(R.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(y.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(y.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderTransparent(e){const t=this._framebuffer;t.bind(),this._renderPlugins(21,de.VOXEL),this._renderHiddenTransparentEdges(),e&&(this._oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),t.update(t=>this._renderNodes(R.TRANSPARENT,t,e)),this.fboCache.debugCallback?.(R.TRANSPARENT,t.color.fbo),this._renderGeometryDepth(),this._renderHUDVisibility(),this._needsTerrainDepth||this._plugins.render(16),this._renderEdges(0);const r=this._renderPhotoshopTerrain(),i=r?.getTexture();i&&this._bindParameters.hudVisibility&&(this._needsTerrainDepth?this._renderLineCallouts(0):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,i)),this._renderHUD(0,t.color)),this._bindParameters.cullAboveTerrain=!1,i&&(t.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i),r?.release(),this._needsTerrainDepth&&(this._renderEdges(1),e&&(this._oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(de.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=d(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(de.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}blitFBO(e,t=M,r=!0){return this._blit??=new V(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=T:(C(Se,this._bindParameters.camera.viewMatrix),C(Te,this._bindParameters.camera.projectionMatrix),w(Ee,Se,Te),w(Ee,this._renderContext.lastFrameCamera.viewMatrix,Ee),w(Ee,this._renderContext.lastFrameCamera.projectionMatrix,Ee),this._reprojectionMatrix=Ee);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=T,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};e([g({readOnly:!0})],pe.prototype,"highResolutionAtmosphere",null),e([g()],pe.prototype,"_edgeView",void 0),e([g()],pe.prototype,"updating",null),pe=e([b("esri.views.3d.webgl-engine.lib.Renderer")],pe);const me=[0,1,2,3],ce=[7,8,4,5],fe=[6,7,8],ge=[0,1,2,4,...fe],be=[3,5],Pe=[2,4,9],Ce=[17,14,15],we=[4,5,2,3,0,1,...fe],Te=S(),Se=S(),Ee=S();function xe(e){return t=>e.immediate.schedule(t)}export{pe as Renderer};
|
|
5
|
+
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as _}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as u,initial as p,sync as m}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{Milliseconds as f}from"../../../../core/time.js";import{property as g,subclass as b}from"../../../../core/accessorSupport/decorators.js";import{equals as P,invert as C,multiply as w}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as T,create as S}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{c as E}from"../../../../chunks/vec42.js";import{ZEROS as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as A,ZEROS as D}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as I}from"../../../../geometry/support/Indices.js";import{RenderCategory as R,InternalRenderCategory as y}from"../../webgl.js";import{innerAtmosphereFadeStart as O}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as v}from"../../support/debugFlags.js";import{FBOCache as H,defaultWebGLFBO as M}from"../core/FBOCache.js";import{RenderPassManager as N}from"../core/renderPasses/RenderPassManager.js";import{isColor as q}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as G}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as L}from"../effects/RenderNodes.js";import{RenderPluginManager as U}from"../effects/RenderPluginManager.js";import{Blit as V}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as j,renderHighlightBuffer as B}from"../effects/highlight/Highlight.js";import{OITBlend as k}from"../effects/transparency/OITBlend.js";import{AnimationTimer as z}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as Q}from"./BoundingInfo.js";import{DepthRange as Y}from"./DepthRange.js";import{depthRangeFromScene as Z}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as J}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as K}from"./MainFramebuffer.js";import{RenderContext as X,defaultRenderOccludedMask as $}from"./RenderContext.js";import{RendererBase as ee}from"./RendererBase.js";import{setupFeatureDefaults as te}from"./RenderFeature.js";import{RenderPluginInput as re}from"./RenderPluginInput.js";import{ShadowAccumulator as ie}from"./ShadowAccumulator.js";import{ShadowMap as se}from"./ShadowMap.js";import ae from"./SliceHelper.js";import{MergedRenderer as ne}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as he}from"../parts/renderUtils.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{PixelType as _e,ColorAttachment1 as le,ColorAttachment2 as ue}from"../../../webgl/enums.js";let pe=class extends ee{constructor(e,t,r,s,a,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new N,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ae,this._blit=null,this._oitblend=null,this.sceneDepthRange=c(Y.Infinite),this._state=c(2),this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=c(0),this._lastFrameTime=f(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new re,this._releaseNormals=e=>{e.some(({name:e})=>"normals"===e)&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this._fboCache=new H(s),this._renderStateFeatures=c(te(e.view.qualityProfile)),this._framebuffer=new K(this.fboCache),this._performanceInfo=new oe(this._rctx),this._shadowMap=new se(this.fboCache,e.viewingMode),this._shadowAccumulator=new ie(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t},(t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(3,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},n),this._renderContext=new X(this._rctx,this._shadowMap,r),this._nodes=new L(this._renderContext),this._plugins=new U({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([l(()=>e.view.state.camera,()=>n(),u),l(()=>v.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},n()},p),l(()=>e.view.environment.background?.color,e=>{const t=e?i(e):D;E(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()},u),l(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=G,u),l(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},m),l(()=>this._bindParameters.clouds.data?.state,()=>n(),m),l(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,n()},p)])}destroy(){this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._blit=null,this._oitblend=null,this._compositingHelper=null,this._nodes=null,this._framebuffer=null,this._shadowMap=null,this._renderContext=null,this._performanceInfo=null,Q.prune(),ne.prune(),I()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=te(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(i=>i.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&this.isFeatureEnabled(5)}get _hasHighlights(){return this._plugins.produces(8,2,4,19,14,15)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(8,14,15)}get hasSSAO(){return this.isFeatureEnabled(4)&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get hasEmitters(){return this._plugins.hasEmitters&&this._hasFloatBufferBlendSupport}get highResolutionAtmosphere(){return this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");_(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:xe(this.stage.view.resourceController)});return this.addHandles(l(()=>r.updating,()=>this._requestRender(),m)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&P(this._bindParameters.ssr.reprojectionMatrix,T)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),e.environment){void 0!==e.environment.weather&&(this._bindParameters.weather=e.environment.weather);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasFloatBufferBlendSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasFloatBufferBlendSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,10)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(0,...Ce),has.water=this._plugins.produces(2,20),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new z(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new he(this._pluginInput.get(R.FINAL),null)}_render(e,t,r,i){const s=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=s,this._disposeBindBuffers();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=e;this._state.value=h;const d=this._nodes.produces("magnifier-color"),_=this._nodes.produces(R.FINAL);this._renderContext.time=t,this._renderContext.output=0,this._bindParameters.hasEmission=this.hasEmitters,this._bindParameters.oitPass=0,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null;const l=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(y.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(y.CUTFILL_DEPTH),this._renderOverlay(),a.setGLViewport(this._rctx);const u=this._framebuffer,p=u.initialize(a.fullWidth,a.fullHeight,this._backgroundColor,this._bindParameters.hasEmission);this.hasReflections?(p?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=p):p?.release(),this._ensureBindParametersCamera(a,n),this._updateHUDOccludedFragmentOpacity(h,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const m=this._plugins.produces(0,...ce);this._precompilePrepasses(),this.performanceInfo.advance(de.PREPARE);const c=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,c),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(c,a,n,!s),this._ensureBindParametersSSR(t),this._precompileShaders(m),this._renderContext.output=0,u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._renderOpaque(),this._renderTransparent(m),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(y.FOCUSAREA,this._renderFocusAreaGeometry()),this._pluginInput.set(y.CUTFILL_DEPTH,this._renderCutFillDepth()),u.update(e=>this._renderNodes(y.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(y.VIEWSHED,e)),u.update(e=>this._renderNodes(y.LASERLINES,e)),u.update(e=>this._renderNodes(y.FOCUSAREA_COLOR,e)),this._pluginInput.release(y.FOCUSAREA),this._pluginInput.release(y.CUTFILL_DEPTH),u.update(e=>this._renderNodes(y.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(a,this._bindParameters.lighting.mainLight.direction,c);const f=2===r?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(R.COMPOSITE,e)),this._shadowMap.disposeOffscreenBuffers();const g=s&&!_&&!(d&&!i),b=this._pluginInput.get(R.COMPOSITE),P=g?M:this.fboCache.acquire(b.fbo.width,b.fbo.height,y.ANTIALIASING),C=this._nodes.produces(y.ANTIALIASING)?this._renderNodes(y.ANTIALIASING,P):this.blitFBO(b,P,!1);let w;this._pluginInput.set(y.ANTIALIASING,C),this._hasHUDHighlights?(this._renderHUD(1,C),w=this._renderNodes(y.HIGHLIGHTS,C)):(w=this._renderNodes(y.HIGHLIGHTS,C),this._renderHUD(1,w));const T=this._renderNodes(y.MAGNIFIER,w);return s&&d&&!i&&!_&&this.blitFBO(T),_?(T.attachDepth(u.depth),this.blitFBO(this._renderNodes(R.FINAL,T)),T.detachDepth()):this._pluginInput.set(R.FINAL,T),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),u.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),s||(this._releaseFBOs(),this._disposeOffscreenBuffers()),new he(this._pluginInput.get(R.FINAL),f)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._renderContext.output=0,this._precompileOpaqueGeometry(),this._nodes.precompile(y.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,this._renderContext.output=1,this._plugins.precompile(...fe),this._needsTerrainDepth&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=0,this._plugins.precompile(...fe),e&&(this._precompileTransparentGeometry(),this._hasPhotoshopTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=this._needsTerrainDepth)),this._nodes.precompile(y.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(13),this._plugins.precompile(16),this._precompileHUD(0),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(y.VIEWSHED,y.CUTFILL_DEPTH,y.CUTFILL_COLOR,y.LASERLINES,y.FOCUSAREA_COLOR,y.OCCLUDED,y.ANTIALIASING,y.HIGHLIGHTS);const t=this._bindParameters;t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(1),this._hasHighlights&&(t.highlights.forEach((e,r)=>{t.highlightLevel=r,this._precompileAllGeometry(8)}),t.highlightLevel=null),t.highlightMixTexture=null,this._nodes.precompile(R.COMPOSITE,y.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(9),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(y.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(de.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(13),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(D),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,_e.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,6408,_e.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=this._bindParameters.geometryDepth,a=()=>t.render(this._bindParameters,e);this.renderToTargets(a,i,s??this._framebuffer.depth,D),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(1===e?de.OPAQUE_EDGES:de.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(),this._bindParameters.overlay&&this.performanceInfo.advance(de.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(5,this._shadowMap),i.copySnapshot(1),this._renderShadowCascades(4,this._shadowMap)):this._renderShadowCascades(3),i.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(de.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(4,this._shadowMap),i.moveSnapshot(0),i.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this.performanceInfo.advance(de.SHADOW_MAP)}_renderCutFillDepth(){return this._nodes.produce(y.CUTFILL_DEPTH,this._pluginInput)}_precompileShadowCascades(e){0!==this._shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(1)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(y.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(1),d(this._bindParameters.depth),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(de.DEPTH)):(e.detachDepth(),this._bindParameters.depth=d(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"geometry depth",13);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1280),this.renderAllGeometry(1),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(de.DEPTH)}_renderTerrainDepth(){if(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepthTest=this._bindParameters.cullAboveTerrain=this._needsTerrainDepth,!this._needsTerrainDepth)return;const e=this._renderContext.output;this._renderContext.output=1;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"terrain depth",13);this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(1280),this._renderTransparentGround(),this._bindParameters.terrainDepth=r.obtainDepthTexture(),r.release(),this._renderContext.output=e}_renderGeometryDepth(){if(!this._needsTerrainDepth)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const e=this._renderContext.output,{width:t,height:r}=this._framebufferSize,i=this.fboCache.acquire(t,r,"geometry depth",13);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(1),this._renderContext.output=e,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=i.obtainDepthTexture(),i.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Y.Zero;const t=Z(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Y.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<O)return void(this.sceneDepthRange.value=Y.Infinite);const t=e.clone();t.near=F,t.far=1e10;const r=Z(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",R.FINAL,R.COMPOSITE,R.OPAQUE,R.TRANSPARENT,y.VIEWSHED,y.LASERLINES);return(this.hasSSAO?1:0)+e}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:_}=J,l=this.stage.view,u=l.stateManager.camera,p=l.qualitySettings.fadeDuration,m=2===e?r:i,c=s((u.tilt-h)/(o-h),0,1),f=s(((u.position.z??0)-d)/(_-d),0,1),g=a(a(1,m,c),1,f),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===g||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=g,void(this._lastFrameTime=t);const P=t-this._lastFrameTime;this._lastFrameTime=t;const C=Math.max(1-r,Math.abs(r-i)),w=Math.min(C*P/p,n);w>=Math.abs(g-b)?this._bindParameters.hudOccludedFragmentOpacity=g:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(g-b)*w,this._requestRender())}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(2),this._needsDepth&&this._precompileAllGeometry(1),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(4),this._precompileShadowCascades(5)):this._precompileShadowCascades(3)),this._shadowAccumulator.active&&this._precompileAllGeometry(3)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",5);r.acquireDepth(13),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(D,!0,!0),this._renderContext.output=2,this._plugins.render(...ge);const i=this._nodes.optional("normals",R.FINAL,R.COMPOSITE,R.OPAQUE,R.TRANSPARENT,y.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(de.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return;const t=this._nodes.produce(y.SSAO,this._pluginInput);return this._bindParameters.ssao=t,t&&this.performanceInfo.advance(de.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...fe),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Pe);this._renderContext.renderOccludedMask=$}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(10),this.renderSlots(e,...Pe),this._renderContext.renderOccludedMask=$}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(6)}precompileCutFill(){const e=7,t=this._renderContext.output;this._renderContext.output=e,this._plugins.precompile(0,1,...fe),this._renderContext.output=t}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(6),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._renderContext.output=7,this._plugins.render(0,1,...fe),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...be)}_precompileOpaqueGeometry(){this._plugins.precompile(...me),this._nodes.precompile("opaque-color")}_renderOpaqueGeometry(){this._plugins.render(...me)}_renderTransparentGeometry(){this._plugins.render(...ce)}get _hasPhotoshopTerrain(){return this._plugins.produces(0,6)}get _needsTerrainDepth(){return this._highQualityTransparency&&this._hasPhotoshopTerrain}_renderPhotoshopTerrain(){if(!this._hasPhotoshopTerrain)return null;const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"transparent terrain");return this.renderToTargets(()=>this._plugins.render(6),t,this._framebuffer.depth,D),this.performanceInfo.advance(de.TRANSPARENT_TERRAIN),t}_renderTransparentGround(){this._plugins.render(...fe)}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,13)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(13),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(de.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(16),t=this._framebufferSize,r=this.fboCache.acquireDepth(12,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(16)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=8,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&q(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...Ce),this._bindParameters.oitPass=2,this._plugins.precompile(...Ce),this._bindParameters.oitPass=0):this._plugins.precompile(...Ce),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t){if(this._pluginsHas.hudElements){if(this._oitEnabled){const r=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,r.getTexture(),!1),r.release()}else if(this._renderContext.output=0,0===e){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(12,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(12),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(0===e?de.HUD_OCCLUDED:de.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(4,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>j?3:1);a.acquireDepth(13);const n=this._plugins.produces(8,0);return n&&this._framebuffer.color.fbo&&a.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,a.fbo,1024),t.bindFramebuffer(a.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),n||t.clear(1024),this._renderContext.output=8,t.bindFramebuffer(a.fbo),B(t,e,i,r,()=>this._renderHighlightGeometries()),a.detachDepth(),this.performanceInfo.advance(de.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(...we),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t,r,i){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r,i)&&this.performanceInfo.advance(de.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&q(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...ce),this._bindParameters.oitPass=2,this._plugins.precompile(...ce),this._bindParameters.oitPass=0):this._plugins.precompile(...ce)}_renderOIT(e,t=2){const r=1===e,i=this._framebufferSize,s=r?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),a=this._bindParameters,n=this._renderContext.output;this._renderContext.output=0,a.oitPass=1;const h=r?"oit hud":"oit",o=this.fboCache.acquire(i.width,i.height,h,8),d=this._bindParameters.hasEmission;d&&o.acquireColor(le,8,"oit emissive"),o.acquireColor(d?ue:le,7,"oit alpha"),r||o.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(o.fbo),this._rctx.clearFramebuffer([0,0,0,1]),d&&this._rctx.clearBuffer(1,x),s(),o.detachDepth(),a.oitPass=2;const _=this.fboCache.acquire(i.width,i.height,r?"oit hud front":"oit front");let l;return d&&_.acquireColor(le,8,"oit emissive front"),r?_.acquireDepth(12):_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer(D,r),s(),_.detachDepth(),a.oitPass=0,r?(l=this.fboCache.acquire(i.width,i.height,"oit hud composite"),this._rctx.bindFramebuffer(l.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):this._framebuffer.bind(),this._oitblend??=new k(this._techniques),this._oitblend.blend(this._rctx,o,_,a,d,!r),l?.detachDepth(),_.release(),o.release(),this._renderContext.output=n,l}_renderOpaque(){const e=this.plugins.produces(0,...me);if(e){this._plugins.render(0,1);const e=this._framebuffer;e.update(e=>this._renderNodes(y.CUTFILL_COLOR,e)),e.update(e=>this._renderNodes(y.OPAQUE_TERRAIN,e)),e.bind(),this._plugins.render(2,3)}const t=this._framebuffer;this._renderTerrainDepth(),t.update(t=>this._renderNodes(R.OPAQUE,t,e)),this.fboCache.debugCallback?.(R.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(y.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(y.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderTransparent(e){const t=this._framebuffer;t.bind(),this._renderPlugins(21,de.VOXEL),this._renderHiddenTransparentEdges(),e&&(this._oitEnabled?this._renderOIT(0):this._renderTransparentGeometry()),t.update(t=>this._renderNodes(R.TRANSPARENT,t,e)),this.fboCache.debugCallback?.(R.TRANSPARENT,t.color.fbo),this._renderGeometryDepth(),this._renderHUDVisibility(),this._needsTerrainDepth||this._plugins.render(16),this._renderEdges(0);const r=this._renderPhotoshopTerrain(),i=r?.getTexture();i&&this._bindParameters.hudVisibility&&(this._needsTerrainDepth?this._renderLineCallouts(0):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,i)),this._renderHUD(0,t.color)),this._bindParameters.cullAboveTerrain=!1,i&&(t.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i),r?.release(),this._needsTerrainDepth&&(this._renderEdges(1),e&&(this._oitEnabled?this._renderOIT(0):this._renderTransparentGeometry(),this.performanceInfo.advance(de.TRANSPARENT)),this._renderEdges(0))),this._bindParameters.ssao=d(this._bindParameters.ssao),this._needsTerrainDepth&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(de.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(9),this.performanceInfo.advance(de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}blitFBO(e,t=M,r=!0){return this._blit??=new V(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=T:(C(Se,this._bindParameters.camera.viewMatrix),C(Te,this._bindParameters.camera.projectionMatrix),w(Ee,Se,Te),w(Ee,this._renderContext.lastFrameCamera.viewMatrix,Ee),w(Ee,this._renderContext.lastFrameCamera.projectionMatrix,Ee),this._reprojectionMatrix=Ee);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=T,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};e([g({readOnly:!0})],pe.prototype,"highResolutionAtmosphere",null),e([g()],pe.prototype,"_edgeView",void 0),e([g()],pe.prototype,"updating",null),pe=e([b("esri.views.3d.webgl-engine.lib.Renderer")],pe);const me=[0,1,2,3],ce=[7,8,4,5],fe=[6,7,8],ge=[0,1,2,4,...fe],be=[3,5],Pe=[2,4,9],Ce=[17,14,15],we=[4,5,2,3,0,1,...fe],Te=S(),Se=S(),Ee=S();function xe(e){return t=>e.immediate.schedule(t)}export{pe as Renderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{sliceEquals as r}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as i}from"../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{watch as o,sync as a}from"../../../../core/reactiveUtils.js";import{signal as n}from"../../../../core/signal.js";import{property as h,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{d as u,
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import{sliceEquals as r}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as i}from"../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{watch as o,sync as a}from"../../../../core/reactiveUtils.js";import{signal as n}from"../../../../core/signal.js";import{property as h,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{d as u,G as l}from"../../../../chunks/vec32.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as _}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{BindParameters as p}from"./BindParameters.js";import{DepthRange as d}from"./DepthRange.js";import{createQuadVAO as f}from"./glUtil3D.js";import{ShadowCastRenderer as g,shadowCastDisabledElevationThreshold as b,shadowCastDisableElevationMax as v,shadowCastDisableElevationMin as S}from"./ShadowCastRenderer.js";import{ShadowMap as w}from"./ShadowMap.js";import{S as y}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as F}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as A}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as x}from"../shaders/ShadowCastClearTechnique.js";import{TaskPriority as R}from"../../../support/Scheduler.js";import{SizedPixelFormat as C,PixelType as j}from"../../../webgl/enums.js";import{FramebufferObject as P}from"../../../webgl/FramebufferObject.js";import{TextureDescriptor as q}from"../../../webgl/TextureDescriptor.js";let T=class extends e{updateDepthRange(t){this._depthRange.equals(t)||(this._depthRange=t)}constructor(t,e,r,i,s,n){super({}),this.fbos=t,this._techniques=e,this._stage=r,this._prepareForShadowMapPass=i,this._renderToShadowMap=s,this._requestRender=n,this._primarySet=new M(new A(0),()=>this._requestRenderIfEnabled()),this._contextSet=new M(new A(1),()=>this._requestRenderIfEnabled()),this._passParameters=new _,this._depthRange=d.Zero,this._previewing=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._rctx=t.rctx,this._bindParameters=new p(new w(t,r.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=f(this._rctx),this._accumulationRenderer=new g(e,this._rctx,this,n);const h=this._stage.view.resourceController.scheduler;this.addHandles([h.registerTask(R.SHADOW_ACCUMULATOR,this),o(()=>this._previewing,()=>this._requestRenderIfEnabled(),a),o(()=>2===this._numActive,()=>this._numActiveChanged(),a),o(()=>this._depthRange,()=>this._invalidateAccumulationSets(),a)],this._shadowAccumulatorKey);for(const o of this._accumulationSets())o.precompile(e)}*_accumulationSets(){yield this._primarySet,yield this._contextSet}normalizeCtorArgs(){return{}}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=s(this._accumulationRenderer),this._bindParameters.shadowMap.dispose(),this._fbo=s(this._fbo),this._vao=s(this._vao);for(const t of this._accumulationSets())t.destroy();this._contextSet=null,this._primarySet=null,this._bindParameters.destroy()}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fbo?.colorTexture}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return null!=this._fbo&&[...this._accumulationSets()].some(t=>t.active)}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==d.Zero&&this._opacityFromElevation>b}get _doneAccumulating(){return[...this._accumulationSets()].every(t=>t.doneAccumulating)}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(t){this._accumulationRenderer.opacityFromElevation=t}get _numActive(){return[...this._accumulationSets()].reduce((t,e)=>t+(e.active?1:0),0)}get _pixelFormat(){return 2===this._numActive?{pixelFormat:33319,internalFormat:C.RG8}:{pixelFormat:6403,internalFormat:C.R8}}get readyToRun(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some(t=>t.running)}runTask(t){this._clearBuffersOnAccumulationStart(),this._prepareForShadowMapPass(this._bindParameters);let e=!1;for(const r of this._accumulationSets())this._runTaskForSet(r,t)&&(e=!0);e&&this._requestRender()}_runTaskForSet(t,e){let r=!1;for(;!e.done&&!t.doneAccumulating;)this._accumulateShadow(t),e.madeProgress(),r=!0;return r}renderAccumulation(t,e,r,i){return this._updateCamera(e),this._bindParameters.contentCamera=r,this._bindParameters.depth=t,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!(!this.accumulating||!this.canAccumulate)&&(this._previewing||i?(this._clearFramebuffer(),this._reset()):this._clearBuffersOnAccumulationStart(),this._accumulateSetsForRenderFrame(i))}_clearBuffersOnAccumulationStart(){if([...this._accumulationSets()].every(t=>0===t.progress))this._clearFramebuffer();else for(const t of this._accumulationSets())0===t.progress&&this._clearFramebufferForSet(this._fbo,t)}_accumulateSetsForRenderFrame(t){let e=!1;for(const r of this._accumulationSets())this._accumulateSetForRenderFrame(r,t)&&(e=!0);return e&&this._requestRender(),e}_accumulateSetForRenderFrame(t,e){let r=e?t.sampleCount:Math.min(D,t.sampleCount);r-=t.progress;for(let i=0;i<r;++i)this._accumulateShadow(t);return r>0}precompile(){this._accumulationRenderer.precompile()}render(t){this._accumulationRenderer.render(t)}setOptions(t){void 0!==t.previewing&&(this._previewing=t.previewing),void 0!==t.lightDirections&&(this._primarySet.lightDirections=t.lightDirections),void 0!==t.lightDirectionsContext&&(this._contextSet.lightDirections=t.lightDirectionsContext),!0===t.enabled?this._enable():!1===t.enabled&&this._disable(),this._accumulationRenderer.setOptions(t)}readAccumulatedShadow(t,e){const r=this._primarySet.progress;return!this.active||!this._fbo||r<1||t<0||t>=this._fbo.width||e<0||e>=this._fbo.height?0:(this._fbo.readPixels(t,e,1,1,6408,j.UNSIGNED_BYTE,E),E[0]/r)}_numActiveChanged(){if(!this._fbo)return;const t=2===this._numActive,e=this._createFBO();e.resize(this._fbo.width,this._fbo.height),t&&(this._clearFramebuffer(e),this._contextSet.reset()),this._fbo.width&&this._fbo.height&&this._rctx.blitFramebuffer(this._fbo,e),this._fbo.dispose(),this._fbo=e,this._requestRender()}_enable(){this._fbo||(this._fbo=this._createFBO(),this._invalidateAccumulationSets())}_createFBO(){const{pixelFormat:t,internalFormat:e}=this._pixelFormat,r=new q;return r.pixelFormat=t,r.internalFormat=e,r.wrapMode=33071,new P(this._rctx,r)}_invalidateAccumulationSets(){for(const t of this._accumulationSets())t.reset();this._requestRenderIfEnabled()}_disable(){this._fbo&&(this._fbo=s(this._fbo),this._requestRender())}_reset(){for(const t of this._accumulationSets())t.reset()}_clearFramebuffer(t=this._fbo){t&&t.width&&t.height&&(this._rctx.bindFramebuffer(t),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(16384))}_clearFramebufferForSet(t,e){if(!t)return;const r=this._techniques.get(x,e.configuration);this._rctx.bindFramebuffer(t),this._rctx.bindTechnique(r,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(r.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(t){this._renderToShadowMap(this._bindParameters,t.lightDirections[t.progress++],this._depthRange);const e=this._techniques.get(F,t.configuration);this._rctx.bindFramebuffer(this._fbo),this._rctx.bindTechnique(e,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(e.primitiveType,0,this._vao.vertexCount("geometry"))}_updateCamera(t){const e=this._fbo;if(null==e)return;const r=this._bindParameters.camera;t.equals(r)||r.copyFrom(t),e.resize(t.fullWidth,t.fullHeight),this._opacityFromElevation=1-i(S,v,t.relativeElevation)}_requestRenderIfEnabled(){this._fbo&&this._requestRender()}get test(){}};t([h()],T.prototype,"_fbo",void 0),t([h()],T.prototype,"_depthRange",void 0),t([h()],T.prototype,"_previewing",void 0),t([h()],T.prototype,"_accumulationRenderer",void 0),t([h()],T.prototype,"_refining",null),t([h()],T.prototype,"active",null),t([h()],T.prototype,"canAccumulate",null),t([h()],T.prototype,"_doneAccumulating",null),t([h()],T.prototype,"_opacityFromElevation",null),t([h()],T.prototype,"_numActive",null),t([h()],T.prototype,"_pixelFormat",null),t([h()],T.prototype,"readyToRun",null),T=t([c("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],T);const D=6,E=new Uint8Array(4);class M{constructor(t,e){this.configuration=t,this._notifyChange=e,this._cachedLightDirections=[],this._progress=n(0),this._sampleCount=n(0)}get progress(){return this._progress.value}set progress(t){this._progress.value=t}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(t){const e=this._cachedLightDirections,i=Math.min(y,t.length);if(!r(e,0,e.length,t,0,i,l)){e.length=i,this._sampleCount.value=i;for(let r=0;r<i;++r)e[r]=u(e[r]??m(),t[r]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(t){t.precompile(F,this.configuration),t.precompile(x,this.configuration)}}export{T as ShadowAccumulator};
|
|
@@ -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 s from"../../../../core/Collection.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{watch as i,when as o,initial as a,sync as n}from"../../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{translate as c,fromTranslation as p,scale as w,mul as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as u,
|
|
5
|
+
import{__decorate as e}from"tslib";import s from"../../../../core/Collection.js";import{deg2rad as t}from"../../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{watch as i,when as o,initial as a,sync as n}from"../../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{translate as c,fromTranslation as p,scale as w,mul as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as u,D as f}from"../../../../chunks/vec32.js";import{create as v,fromValues as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Sphere as V}from"../../../../geometry/support/sphere.js";import{InternalRenderCategory as g}from"../../webgl.js";import M from"../../webgl/RenderNode.js";import{ViewshedShadowMap as b}from"./ViewshedShadowMap.js";import{V as y}from"../../../../chunks/Viewshed.glsl.js";import{ViewshedTechnique as S}from"../shaders/ViewshedTechnique.js";let j=class extends M{get shadowMap(){return this._shadowMap}get hasViewsheds(){return this._viewsheds.length>0}get _contentPixelRatio(){return this.view.state.contentPixelRatio}get _viewshedsInView(){return this._viewsheds.items.filter(e=>x(this.view,e))}constructor(e){super(e),this.isDecoration=!1,this._passParameters=new y,this._viewsheds=new s,this._shadowMap=null,this.consumes={required:[g.VIEWSHED,"normals"]},this.produces=g.VIEWSHED,this.requireGeometryDepth=!0}initialize(){this._shadowMap=new b(this.fboCache),this.addHandles([i(()=>this.view.resolutionScale,e=>{const s=this._shadowMap;s&&(s.settings.textureSizeQuality=e)},a),o(()=>!this.hasViewsheds,()=>this._shadowMap?.dispose()),i(()=>this._viewshedsInView.map(e=>[e.observerRenderSpace,e.heading,e.tilt,e.farDistance,e.horizontalFieldOfView,e.verticalFieldOfView]),()=>this.requestRender(1),n)])}destroy(){this._shadowMap=r(this._shadowMap)}precompile(){if(this.hasViewsheds){this.techniques.precompile(S);for(const e of this._viewshedsInView)if(this._shadowMap?.isActive(e))return void this.view.stage.renderer.precompileViewshedShadowMap()}}render(e){const s=this.bindParameters,t=this.renderingContext,r=e.find(({name:e})=>e===g.VIEWSHED);if(!this.hasViewsheds||!s.depth||this.isDecoration&&!s.decorations)return r;this._passParameters.shadowMap=this._shadowMap??this._passParameters.shadowMap,this._passParameters.normals=e.find(({name:e})=>"normals"===e)?.getTexture();const i=this.techniques.get(S);if(!i?.compiled)return this.requestRender(1),r;const o=this.view.stage.renderer.isFeatureEnabled(7);for(const a of this._viewshedsInView){if(!this._renderShadowCubeMap(s,a,o)||!this._shadowMap?.ready)continue;const e=this._setupViewshedParameters(a,s.camera);t.bindTechnique(i,s,e),t.bindFramebuffer(r.fbo),t.screen.draw()}return this.shadowMap?.dispose(),r}updateViewsheds(e){const s=this._viewsheds,{removes:t,adds:r}=e;if(t&&(Array.isArray(t)?s.removeMany(t):s.remove(t)),r)if(Array.isArray(r)){const e=r.filter(e=>!s.includes(e));s.addMany(e)}else s.includes(r)||s.add(r)}_renderShadowCubeMap(e,s,t){const r=this._shadowMap;if(!r)return!1;const i=this.view.basemapTerrain.hasStencilEnabledExtents,o=r.start(e.camera,s,t,this._contentPixelRatio,i);return o&&r.faces.forEach(e=>this.view.stage.renderer.renderViewshedShadowMap(e)),r.finish(),o}_setupViewshedParameters(e,s){const r=this._shadowMap;if(!r)return this._passParameters;const i=this._passParameters,o=e.effectiveObserverRenderSpace;i.localOrigin=o,i.observerOffset=u(D,e.observerRenderSpace,e.effectiveObserverRenderSpace),i.fovs=[t(e.horizontalFieldOfView),t(e.verticalFieldOfView)],i.headingAndTilt=[t(e.heading),t(e.tiltParallelToSurface)],i.upVector=e.tiltedUpVector;const a=R(e.targetRenderSpace,o);i.targetVector=a;const n=new Array,h=new Array;for(let t=0;t<r.numActiveFaces;t++)c(E,r.viewshedViewMatrices[t],o),n.push(...E),P(r.viewshedProjectionMatrices[t],E,I),h.push(...I);return i.viewMatrices=n,i.projectionMatrices=h,i.volumeOffset=this.selectedViewshed?.()===e.viewshed?A(e,this.view,s.eye):0,i}get test(){return{viewsheds:this._viewsheds,shadowMap:this._shadowMap,viewshedsInView:this._viewshedsInView}}};function R(e,s){const t=v();return u(t,e,s)}function P(e,s,t){const r=_(.5,.5,.5);return p(t,r),w(t,t,r),l(t,t,e),l(t,t,s),t}function x(e,s){const t=new V(s.observerRenderSpace,s.farDistanceRenderSpace);return!!e.ready&&e.frustum.intersectsSphere(t)}function A(e,s,t){if(null==e)return 0;const{observerRenderSpace:r,targetRenderSpace:i}=e,o=f(t,r)>f(t,i)?e.observer:e.target;return s.pixelSizeAt(o)}e([h()],j.prototype,"selectedViewshed",void 0),e([h()],j.prototype,"isDecoration",void 0),e([h()],j.prototype,"shadowMap",null),e([h()],j.prototype,"hasViewsheds",null),e([h()],j.prototype,"_contentPixelRatio",null),e([h()],j.prototype,"_viewshedsInView",null),e([h()],j.prototype,"consumes",void 0),e([h()],j.prototype,"produces",void 0),j=e([d("esri.views.3d.webgl-engine.lib.Viewshed")],j);const D=v(),E=m(),I=m();export{j as Viewshed,A as computeOffsetScale};
|
|
@@ -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{acosClamped as e,deg2rad as t}from"../../../../../core/mathUtils.js";import n from"../../../../../core/PooledArray.js";import{
|
|
5
|
+
import{acosClamped as e,deg2rad as t}from"../../../../../core/mathUtils.js";import n from"../../../../../core/PooledArray.js";import{D as o,h as s,d as a,g as r,e as c,f as l,n as i,E as h}from"../../../../../chunks/vec32.js";import{create as u}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Edge as g}from"./Edge.js";const p=-1;function d(e,t,n){const c=e.vertices.position,l=e.vertices.componentIndex,i=I.position0,h=I.position1,u=I.faceNormal0,g=I.faceNormal1,{edges:d,normals:v}=w(e),x=d.length/4,y=t.allocate(x);let j=0;const N=x,D=n?.allocate(N);let E=0,b=0,F=0;V.length=0;for(let s=0;s<x;++s){const e=4*s;c.getVec(d.data[e],i),c.getVec(d.data[e+1],h);const t=V.pushNew();t.index=4*s,t.length=o(i,h)}V.sort((e,t)=>t.length-e.length);const L=new Array,U=new Array;V.forAll(({length:e,index:o})=>{const w=d.data[o],x=d.data[o+1],V=d.data[o+2],N=d.data[o+3],q=N===p;if(c.getVec(w,i),c.getVec(x,h),q){const e=3*V;s(u,v.data[e],v.data[e+1],v.data[e+2]),a(g,u),I.componentIndex=l.get(w),I.cosAngle=r(u,g)}else{let e=3*V;if(s(u,v.data[e],v.data[e+1],v.data[e+2]),e=3*N,s(g,v.data[e],v.data[e+1],v.data[e+2]),I.componentIndex=l.get(w),I.cosAngle=r(u,g),m(I,k))return;I.cosAngle<-.9999&&a(g,u)}b+=e,F++,q||f(I,P)?(t.write(y,j++,I),L.push(e)):A(I,M)&&(D&&n&&n.write(D,E++,I),U.push(e))});const q=new Float32Array(L.reverse()),z=new Float32Array(U.reverse()),B=D&&n?{instancesData:D.slice(0,E),lodInfo:{lengths:z}}:void 0;return{regular:{instancesData:y.slice(0,j),lodInfo:{lengths:q}},silhouette:B,averageEdgeLength:b/F}}function f(e,t){return e.cosAngle<t}function m(e,t){return e.cosAngle>t}function A(t,n){const o=e(t.cosAngle);h(D,t.position1,t.position0);return o*(r(l(N,t.faceNormal0,t.faceNormal1),D)>0?-1:1)>n}function w(e){const t=e.faces.length/3,n=e.faces,o=e.neighbors,s=e.vertices.position;y.length=j.length=0;for(let a=0;a<t;a++){const e=3*a,t=o[e],r=o[e+1],h=o[e+2],u=n[e],g=n[e+1],d=n[e+2];s.getVec(u,E),s.getVec(g,b),s.getVec(d,F),c(b,b,E),c(F,F,E),l(E,b,F),i(E,E),j.pushArray(E),(t===p||u<g)&&(y.push(u),y.push(g),y.push(a),y.push(t)),(r===p||g<d)&&(y.push(g),y.push(d),y.push(a),y.push(r)),(h===p||d<u)&&(y.push(d),y.push(u),y.push(a),y.push(h))}return{edges:y,normals:j}}class v{constructor(){this.index=0,this.length=0}}function x(){V.prune(),y.prune(),j.prune()}const V=new n({allocator:e=>e||new v,deallocator:null}),y=new n({deallocator:null}),j=new n({deallocator:null}),I=new g,N=u(),D=u(),E=u(),b=u(),F=u(),M=t(4),k=Math.cos(M),L=t(35),P=Math.cos(L);export{x as cleanupEdgeProcessing,d as extractEdges};
|
|
@@ -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{h as t,i as e,j as n,
|
|
5
|
+
import{h as t,i as e,j as n,H as r}from"../../../../chunks/vec32.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{areaPoints3d as s}from"../../../../geometry/support/triangle.js";function i(r,o){if(!r)return!1;const{size:i,data:c,indices:f}=r;t(o,0,0,0),t(m,0,0,0);let d=0,g=0;for(let p=0;p<f.length-2;p+=3){const r=f[p]*i,h=f[p+1]*i,j=f[p+2]*i;t(a,c[r],c[r+1],c[r+2]),t(l,c[h],c[h+1],c[h+2]),t(u,c[j],c[j+1],c[j+2]);const z=s(a,l,u);z?(e(a,a,l),e(a,a,u),n(a,a,1/3*z),e(o,o,a),d+=z):(e(m,m,a),e(m,m,l),e(m,m,u),g+=3)}return(0!==g||0!==d)&&(0!==d?(n(o,o,1/d),!0):0!==g&&(n(o,m,1/g),!0))}function c(e,r){if(!e)return!1;const{size:o,data:s,indices:i}=e;t(r,0,0,0);let c=-1,f=0;for(let t=0;t<i.length;t++){const e=i[t]*o;c!==e&&(r[0]+=s[e],r[1]+=s[e+1],r[2]+=s[e+2],f++),c=e}return f>1&&n(r,r,1/f),f>0}function f(o,s,i){if(!o)return!1;t(i,0,0,0),t(m,0,0,0);let c=0,f=0;const{size:u,data:d,indices:g}=o,p=g.length-1,h=p+(s?2:0);for(let t=0;t<h;t+=2){const o=t<p?t+1:0,s=g[t<p?t:p]*u,h=g[o]*u;a[0]=d[s],a[1]=d[s+1],a[2]=d[s+2],l[0]=d[h],l[1]=d[h+1],l[2]=d[h+2],n(a,e(a,a,l),.5);const j=r(a,l);j>0?(e(i,i,n(a,a,j)),c+=j):0===c&&(e(m,m,a),f++)}return 0!==c?(n(i,i,1/c),!0):0!==f&&(n(i,m,1/f),!0)}const a=o(),l=o(),u=o(),m=o();export{f as computeAttachmentOriginLines,c as computeAttachmentOriginPoints,i as computeAttachmentOriginTriangles};
|
|
@@ -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{g as n,a as t,f as r,n as o,c,
|
|
5
|
+
import{g as n,a as t,f as r,n as o,c,H as s,u}from"../../../../chunks/vec32.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";function i(t,r,o){const c=n(t,r)-o;return Math.abs(c)<=1e-5}function a(n,c,s){const u=e(),i=e();t(i,c,n);const a=e();return t(a,s,n),r(u,i,a),o(u,u),u}function f(r,s,u,f){const m=[s,u,f],h=a(s,u,f);if(!i(r,h,n(m[0],h)))return!1;for(let i=0;i<3;++i){const r=m[i],s=m[(i+1)%3],u=m[(i+2)%3],a=e();t(a,s,r),o(a,a);const f=e();t(f,u,r);const h=n(f,a),l=e();c(l,r,a,h);const M=e();t(M,u,l),o(M,M);const x=n(r,M);if(!(n(M,l)-x>=-1e-4))return!1}return!0}function m(n){const c=e();t(c,n[1],n[0]),o(c,c);const s=e();t(s,n[2],n[0]),o(s,s);const u=e();return r(u,c,s),o(u,u),u}function h(r,s,u){const i=e();t(i,u,s),o(i,i);const a=e();t(a,r,s);const f=n(a,i),m=e();return c(m,s,i,f),m}function l(n,t,r){const o=h(n,t,r);return s(o,n)}function M(r,i,a){const f=e();t(f,a,i);const m=u(f);o(f,f);const h=e();t(h,r,i);const l=n(h,f);if(l<0)return s(i,r);if(l>m)return s(a,r);const M=e();c(M,i,f,l);return s(M,r)}function x(t,r,o){return n(t,r)-o}function y(c,s,u){const i=e(),a=e();t(a,s,c);const f=e();t(f,u,c),r(i,a,f),o(i,i);return{normal:i,d:n(i,c)}}function A(n,t,r,o){const{normal:s,d:u}=y(t,r,o),i=x(n,s,u),a=e();return c(a,n,s,-i),f(a,t,r,o)?i:Math.min(M(n,t,r),M(n,r,o),M(n,o,t))}function g(r,o,s){const u=e();t(u,o,r);const i=m(s),a=n(i,s[0]),h=n(i,r)-a,l=n(i,o)-a;if(h*l>0)return 1/0;const M=e();return c(M,r,u,(0-h)/(l-h)),f(M,s[0],s[1],s[2])?0:A(M,s[0],s[1],s[2])}function p(n,t){const r=n.length;if(0===r)return 0;if(t<n[0])return-1;if(t>=n[r-1])return r;let o=0,c=r-1;for(;c-o>1;){const r=Math.floor(.5*(c+o));t>=n[r]?o=r:c=r}return o}function w(n,t,r,o,c,s,u){const e=s-u,i=t-n,a=new Float64Array(4*i);for(let f=0;f<i;++f){const t=3*(f+n),s=c*r[t+0],i=o[s+0],m=o[s+1],h=e/(o[s+2]-u),l=i*h,M=m*h,x=c*r[t+1],y=o[x+0],A=o[x+1],g=e/(o[x+2]-u),p=y*g,w=A*g,U=c*r[t+2],b=o[U+0],d=o[U+1],j=e/(o[U+2]-u),v=b*j,F=d*j,k=4*f;a[k+0]=Math.min(l,p,v),a[k+1]=Math.min(M,w,F),a[k+2]=Math.max(l,p,v),a[k+3]=Math.max(M,w,F)}return a}function U(n,t,r,o,c){const s=t-n,u=new Float64Array(4*s);for(let e=0;e<s;++e){const t=3*(e+n),s=c*r[t+0],i=o[s+0],a=o[s+1],f=c*r[t+1],m=o[f+0],h=o[f+1],l=c*r[t+2],M=o[l+0],x=o[l+1],y=4*e;u[y+0]=Math.min(i,m,M),u[y+1]=Math.min(a,h,x),u[y+2]=Math.max(i,m,M),u[y+3]=Math.max(a,h,x)}return u}function b(n,t){return new(d(n))(t)}function d(n){return n<128?Uint8Array:n<32768?Uint16Array:n<1<<31?Uint32Array:Array}function j(n,t){n[2]+=t}function v(n,t,r,o){const[c,s,u]=o??n,e=u-r,i=t/Math.sqrt(c*c+s*s+e*e);n[0]+=c*i,n[1]+=s*i,n[2]+=e*i}export{p as binarySearchSortedArray,m as calculateNormalFromVertices,b as createUintArray,l as distancePointLine,x as distancePointPlane,M as distancePointSegment,A as distancePointTriangle,v as elevationAlignVertexGlobal,j as elevationAlignVertexLocal,w as generateTriangleAabbsGlobal,U as generateTriangleAabbsLocal,d as getConstructorForValueCount,h as getNearestPointOnLine,g as getRayTriangleIntersectionDistance,a as getTriangleNormal,y as getTrianglePlane,i as isPointInPlane,f as isPointInTriangle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as l,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as u,p as f,n as p,e as h,j as m,d,b as g,C as b,i as v,a as x,t as S,g as y}from"../../../../chunks/vec32.js";import{create as O,fromValues as z}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as _,create as P,freeze as j}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMat4 as M}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as V}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as C}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as D}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as R}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as A,isColor as w}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as F}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as T,GLTextureMaterial as E}from"../lib/GLTextureMaterial.js";import{Material as L}from"../lib/Material.js";import{SeparateScreenSizePerspectiveEvaluators as U}from"../lib/screenSizePerspectiveUtils.js";import{assert as B}from"../lib/Util.js";import{writePosition as I,writeNormal as q,writeColor as G,writeBufferVec2 as W,writeBufferFloat as H,writeBufferVec4 as N,writeBufferVec4Zeros as X,writeOlidColor as Y}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as k}from"./internal/MaterialUtil.js";import{c as J,f as K}from"../../../../chunks/HUDMaterial.glsl.js";import{getInstanceLayout as Q,baseLayout as Z,HUDMaterialTechnique as $}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as ee}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as te}from"../../../../webscene/support/AlphaCutoff.js";class ie extends L{constructor(e,t){super(e,Ve),this.produces=new Map([[14,e=>A(e)&&!this.parameters.drawAsLabel],[15,e=>A(e)&&this.parameters.drawAsLabel],[13,()=>this.parameters.occlusionTest],[19,e=>this.parameters.draped&&A(e)]]),this._visible=!0,this._configuration=new ee(t)}getConfiguration(e,t){const i=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=i,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.hasVVSize=!!this.parameters.vvSize,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.occlusionPass=13===t.slot,this._configuration.occludedFragmentFade=!i&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||13===t.slot,w(e)&&(this._configuration.debugDrawLabelBorder=!!R.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:v},point:x,camera:S}=s,{parameters:y}=this;if(!l||!c||v&&y.isLabel||!e.visible||!x||!S)return;const z=e.attributes.get("featureAttribute"),P=null==z?null:_(z.data,Oe),{scaleX:j,scaleY:M}=De(P,y,S.pixelRatio);i(ge,t),e.attributes.has("featureAttribute")&&ne(ge);const V=e.attributes.get("position"),C=e.attributes.get("size"),D=e.attributes.get("normal"),R=e.attributes.get("rotation"),A=e.attributes.get("centerOffsetAndDistance");B(V.size>=3);const w=J(y),F="screen"===this.parameters.centerOffsetUnits;for(let i=0;i<V.data.length/V.size;i++){const e=i*V.size;u(ce,V.data[e],V.data[e+1],V.data[e+2]),f(ce,ce,t),f(ce,ce,S.viewMatrix);const a=i*A.size;if(u(Se,A.data[a],A.data[a+1],A.data[a+2]),!F&&(ce[0]+=Se[0],ce[1]+=Se[1],0!==Se[2])){const e=Se[2];p(Se,ce),h(ce,ce,m(Se,Se,e))}const n=i*D.size;if(u(ue,D.data[n],D.data[n+1],D.data[n+2]),ae(ue,ge,S,ze),Re(this.parameters,ce,ze,S,le),S.applyProjection(ce,fe),fe[0]>-1){F&&(Se[0]||Se[1])&&(fe[0]+=Se[0]*S.pixelRatio,0!==Se[1]&&(fe[1]+=le.alignmentEvaluator.apply(Se[1])*S.pixelRatio),S.unapplyProjection(fe,ce)),fe[0]+=this.parameters.screenOffset[0]*S.pixelRatio,fe[1]+=this.parameters.screenOffset[1]*S.pixelRatio,fe[0]=Math.floor(fe[0]),fe[1]=Math.floor(fe[1]);const e=i*C.size;je[0]=C.data[e],je[1]=C.data[e+1],le.evaluator.applyVec2(je,je);const t=_e*S.pixelRatio;let a=0;if(y.textureIsSignedDistanceField){a=Math.min(y.outlineSize,.5*je[0])*S.pixelRatio/2}je[0]*=j,je[1]*=M;const n=i*R.size,l=y.rotation+R.data[n];if(oe(x,fe[0],fe[1],je,t,a,l,y,w)){const e=s.ray;if(f(he,ce,r(ve,S.viewMatrix)),fe[0]=x[0],fe[1]=x[1],S.unprojectFromRenderScreen(fe,ce)){const t=O();d(t,e.direction);const i=1/g(t);m(t,t,i);o(b(e.origin,ce)*i,t,-1,he)}}}}}intersectDraped(e,t,i,s,r){const a=e.attributes.get("position"),n=e.attributes.get("size"),o=e.attributes.get("rotation"),l=this.parameters,c=J(l),u=e.attributes.get("featureAttribute"),f=null==u?null:_(u.data,Oe),{scaleX:p,scaleY:h}=De(f,l,e.screenToWorldRatio),m=Pe*e.screenToWorldRatio;for(let d=0;d<a.data.length/a.size;d++){const t=d*a.size,u=a.data[t],f=a.data[t+1],g=d*n.size;je[0]=n.data[g],je[1]=n.data[g+1];let b=0;if(l.textureIsSignedDistanceField){b=Math.min(l.outlineSize,.5*je[0])*e.screenToWorldRatio/2}je[0]*=p,je[1]*=h;const v=d*o.size,x=l.rotation+o.data[v];oe(i,u,f,je,m,b,x,l,c)&&s(r.distance,r.normal,-1)}}createBufferWriter(){return new Ce}applyShaderOffsetsView(e,t,i,s,r,a,n){const o=ae(t,i,r,ze);return this._applyVerticalGroundOffsetView(e,o,r,n),Re(this.parameters,n,o,r,a),this._applyPolygonOffsetView(n,o,s[3],r,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,t,i,s,r){return this._applyCenterOffsetNDC(e,t,i,s),null!=r&&d(r,s),this._applyPolygonOffsetNDC(s,t,i,s),s}_applyPolygonOffsetView(t,i,s,r,a){const n=r.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return d(a,t);const c=e(Math.abs(i.cosAngle),.01,1),u=1-Math.sqrt(1-c*c)/c/r.viewport[2];return m(a,t,l>0?u:1/u),a}_applyVerticalGroundOffsetView(e,t,i,s){const r=g(e),a=i.aboveGround?1:-1,n=i.computeRenderPixelSizeAtDist(r)*F,o=m(ce,t.normal,a*n);return v(s,e,o),s}_applyCenterOffsetView(e,t,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&d(i,e),s&&(i[0]+=t[0],i[1]+=t[1],t[2]&&(p(ue,i),x(i,i,m(ue,ue,t[2])))),i}_applyCenterOffsetNDC(e,t,i,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&d(s,e),r||(s[0]+=t[0]/i.fullWidth*2,s[1]+=t[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,i,s){const r=this.parameters.shaderPolygonOffset;if(e!==s&&d(s,e),r){const e=i.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*r}return s}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:i}=this.parameters,s=e[3]>=te||t>=te&&i[3]>=te;return this._visible&&s}createGLMaterial(e){return new se(e)}calculateRelativeScreenBounds(e,t,i=V()){return re(this.parameters,e,t,i),i[2]=i[0]+e[0],i[3]=i[1]+e[1],i}}class se extends E{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique($,e)}}function re(e,t,i,s){s[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*i,s[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*i}function ae(e,t,s,r){return M(t)&&(t=i(be,t)),S(r.normal,e,t),f(r.normal,r.normal,s.viewInverseTransposeMatrix),r.cosAngle=y(pe,Me),r}function ne(e){const t=e[0],i=e[1],s=e[2],r=e[3],a=e[4],n=e[5],o=e[6],l=e[7],c=e[8],u=1/Math.sqrt(t*t+i*i+s*s),f=1/Math.sqrt(r*r+a*a+n*n),p=1/Math.sqrt(o*o+l*l+c*c);return e[0]=t*u,e[1]=i*u,e[2]=s*u,e[3]=r*f,e[4]=a*f,e[5]=n*f,e[6]=o*p,e[7]=l*p,e[8]=c*p,e}function oe(e,i,s,r,a,l,c,u,f){let p=i-a-r[0]*f[0],h=p+r[0]+2*a,m=s-a-r[1]*f[1],d=m+r[1]+2*a;const g=u.distanceFieldBoundingBox;return u.textureIsSignedDistanceField&&null!=g&&(p+=r[0]*g[0],m+=r[1]*g[1],h-=r[0]*(1-g[2]),d-=r[1]*(1-g[3]),p-=l,h+=l,m-=l,d+=l),n(de,i,s),o(me,e,de,t(c)),me[0]>p&&me[0]<h&&me[1]>m&&me[1]<d}const le=new U,ce=O(),ue=O(),fe=P(),pe=O(),he=O(),me=c(),de=c(),ge=s(),be=s(),ve=a(),xe=P(),Se=O(),ye=O(),Oe=P(),ze={normal:pe,cosAngle:0},_e=1,Pe=2,je=l(0,0),Me=z(0,0,1);class Ve extends T{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1,this.color=j(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=j(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=P(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Ce{constructor(){this.layout=Q(),this.baseInstanceLayout=Z}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,i,s,r,a){const{position:n,normal:o,color:l,size:c,rotation:u,centerOffsetAndDistance:f,featureAttribute:p,uvi:h}=r;I(i.get("position"),e,n,a),q(i.get("normal"),t,o,a);const m=i.get("position").indices.length;let d=0,g=0,b=K,v=K;const x=i.get("uvi")?.data;x&&x.length>=4&&(d=x[0],g=x[1],b=x[2],v=x[3]);for(let S=0;S<m;++S){const e=a+S;h.setValues(e,d,g,b,v)}if(G(i.get("color"),4,l,a),W(i.get("size"),c,a),H(i.get("rotation"),u,a),i.get("centerOffsetAndDistance")?N(i.get("centerOffsetAndDistance"),f,a):X(f,a,m),i.get("featureAttribute")?N(i.get("featureAttribute"),p,a):X(p,a,m),null!=s){const e=i.get("position")?.indices;if(e){const t=e.length,i=r.getField("olidColor",C);Y(s,i,t,a)}}return{numVerticesPerItem:1,numItems:m}}writeBaseInstance(e,t){const{uv0:i}=t;W(e.get("uv0"),i,0)}intersect(e,t,i,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:x},point:S,camera:y}=s;if(!l||!c||x&&t.isLabel||!S)return;const z=this.layout.createView(e),{position:_,normal:P,rotation:j,size:M,featureAttribute:V,centerOffsetAndDistance:C}=z,D="screen"===t.centerOffsetUnits,R=J(t);if(null==_||null==P||null==j||null==M||null==C||null==y)return;const A=null==V?null:V.getVec(0,Oe),{scaleX:w,scaleY:F}=De(A,t,y.pixelRatio),T=_.count;for(let E=0;E<T;E++){if(_.getVec(E,ce),null!=i&&v(ce,ce,i),f(ce,ce,y.viewMatrix),C.getVec(E,xe),u(Se,xe[0],xe[1],xe[2]),!D&&(ce[0]+=Se[0],ce[1]+=Se[1],0!==Se[2])){const e=Se[2];p(Se,ce),h(ce,ce,m(Se,Se,e))}if(P.getVec(E,ue),ae(ue,ge,y,ze),Re(t,ce,ze,y,le),y.applyProjection(ce,fe),fe[0]>-1){D&&(Se[0]||Se[1])&&(fe[0]+=Se[0]*y.pixelRatio,0!==Se[1]&&(fe[1]+=le.alignmentEvaluator.apply(Se[1])*y.pixelRatio),y.unapplyProjection(fe,ce)),fe[0]+=t.screenOffset[0]*y.pixelRatio,fe[1]+=t.screenOffset[1]*y.pixelRatio,fe[0]=Math.floor(fe[0]),fe[1]=Math.floor(fe[1]),M.getVec(E,je),le.evaluator.applyVec2(je,je);const e=_e*y.pixelRatio;let i=0;if(t.textureIsSignedDistanceField){i=Math.min(t.outlineSize,.5*je[0])*y.pixelRatio/2}je[0]*=w,je[1]*=F;const a=j.get(E),n=t.rotation+a;if(oe(S,fe[0],fe[1],je,e,i,n,t,R)){const e=s.ray;if(f(he,ce,r(ve,y.viewMatrix)),fe[0]=S[0],fe[1]=S[1],y.unprojectFromRenderScreen(fe,ce)){const t=O();d(t,e.direction);const i=1/g(t);m(t,t,i);o(b(e.origin,ce)*i,t,E,he)}}}}}}function De(e,t,i){return null==e||null==t.vvSize?{scaleX:i,scaleY:i}:(D(ye,t,e),{scaleX:ye[0]*i,scaleY:ye[1]*i})}function Re(e,t,i,s,r){if(!e.verticalOffset?.screenLength){const s=g(t);return r.update(i.cosAngle,s,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),t}const a=g(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=k(s,a,e.verticalOffset,i.cosAngle,n,e.screenSizePerspectiveMinPixelReferenceSize);return r.update(i.cosAngle,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),m(i.normal,i.normal,o),v(t,t,i.normal)}export{ie as HUDMaterial,Ve as Parameters};
|
|
5
|
+
import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as l,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as u,p as f,n as p,e as h,j as m,d,b as g,D as b,i as v,a as x,t as S,g as y}from"../../../../chunks/vec32.js";import{create as O,fromValues as z}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as _,create as P,freeze as j}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMat4 as M}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as D}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as V}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as R}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as A}from"../../support/debugFlags.js";import{isColorHighlightOrOLID as C,isColor as w}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as F}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as T,GLTextureMaterial as E}from"../lib/GLTextureMaterial.js";import{Material as L}from"../lib/Material.js";import{SeparateScreenSizePerspectiveEvaluators as U}from"../lib/screenSizePerspectiveUtils.js";import{assert as B}from"../lib/Util.js";import{writePosition as I,writeNormal as q,writeColor as G,writeBufferVec2 as W,writeBufferFloat as H,writeBufferVec4 as N,writeBufferVec4Zeros as X,writeOlidColor as Y}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as k}from"./internal/MaterialUtil.js";import{c as J,f as K}from"../../../../chunks/HUDMaterial.glsl.js";import{getInstanceLayout as Q,baseLayout as Z,HUDMaterialTechnique as $}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as ee}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as te}from"../../../../webscene/support/AlphaCutoff.js";class ie extends L{constructor(e,t){super(e,De),this.produces=new Map([[14,e=>C(e)&&!this.parameters.drawAsLabel],[15,e=>C(e)&&this.parameters.drawAsLabel],[13,()=>this.parameters.occlusionTest],[19,e=>this.parameters.draped&&C(e)]]),this._visible=!0,this._configuration=new ee(t)}getConfiguration(e,t){const i=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=i,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.hasVVSize=!!this.parameters.vvSize,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.occlusionPass=13===t.slot,this._configuration.occludedFragmentFade=!i&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||13===t.slot,w(e)&&(this._configuration.debugDrawLabelBorder=!!A.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:v},point:x,camera:S}=s,{parameters:y}=this;if(!l||!c||v&&y.isLabel||!e.visible||!x||!S)return;const z=e.attributes.get("featureAttribute"),P=null==z?null:_(z.data,Oe),{scaleX:j,scaleY:M}=Re(P,y,S.pixelRatio);i(ge,t),e.attributes.has("featureAttribute")&&ne(ge);const D=e.attributes.get("position"),V=e.attributes.get("size"),R=e.attributes.get("normal"),A=e.attributes.get("rotation"),C=e.attributes.get("centerOffsetAndDistance");B(D.size>=3);const w=J(y),F="screen"===this.parameters.centerOffsetUnits;for(let i=0;i<D.data.length/D.size;i++){const e=i*D.size;u(ce,D.data[e],D.data[e+1],D.data[e+2]),f(ce,ce,t),f(ce,ce,S.viewMatrix);const a=i*C.size;if(u(Se,C.data[a],C.data[a+1],C.data[a+2]),!F&&(ce[0]+=Se[0],ce[1]+=Se[1],0!==Se[2])){const e=Se[2];p(Se,ce),h(ce,ce,m(Se,Se,e))}const n=i*R.size;if(u(ue,R.data[n],R.data[n+1],R.data[n+2]),ae(ue,ge,S,ze),Ae(this.parameters,ce,ze,S,le),S.applyProjection(ce,fe),fe[0]>-1){F&&(Se[0]||Se[1])&&(fe[0]+=Se[0]*S.pixelRatio,0!==Se[1]&&(fe[1]+=le.alignmentEvaluator.apply(Se[1])*S.pixelRatio),S.unapplyProjection(fe,ce)),fe[0]+=this.parameters.screenOffset[0]*S.pixelRatio,fe[1]+=this.parameters.screenOffset[1]*S.pixelRatio,fe[0]=Math.floor(fe[0]),fe[1]=Math.floor(fe[1]);const e=i*V.size;je[0]=V.data[e],je[1]=V.data[e+1],le.evaluator.applyVec2(je,je);const t=_e*S.pixelRatio;let a=0;if(y.textureIsSignedDistanceField){a=Math.min(y.outlineSize,.5*je[0])*S.pixelRatio/2}je[0]*=j,je[1]*=M;const n=i*A.size,l=y.rotation+A.data[n];if(oe(x,fe[0],fe[1],je,t,a,l,y,w)){const e=s.ray;if(f(he,ce,r(ve,S.viewMatrix)),fe[0]=x[0],fe[1]=x[1],S.unprojectFromRenderScreen(fe,ce)){const t=O();d(t,e.direction);const i=1/g(t);m(t,t,i);o(b(e.origin,ce)*i,t,-1,he)}}}}}intersectDraped(e,t,i,s,r){const a=e.attributes.get("position"),n=e.attributes.get("size"),o=e.attributes.get("rotation"),l=this.parameters,c=J(l),u=e.attributes.get("featureAttribute"),f=null==u?null:_(u.data,Oe),{scaleX:p,scaleY:h}=Re(f,l,e.screenToWorldRatio),m=Pe*e.screenToWorldRatio;for(let d=0;d<a.data.length/a.size;d++){const t=d*a.size,u=a.data[t],f=a.data[t+1],g=d*n.size;je[0]=n.data[g],je[1]=n.data[g+1];let b=0;if(l.textureIsSignedDistanceField){b=Math.min(l.outlineSize,.5*je[0])*e.screenToWorldRatio/2}je[0]*=p,je[1]*=h;const v=d*o.size,x=l.rotation+o.data[v];oe(i,u,f,je,m,b,x,l,c)&&s(r.distance,r.normal,-1)}}createBufferWriter(){return new Ve}applyShaderOffsetsView(e,t,i,s,r,a,n){const o=ae(t,i,r,ze);return this._applyVerticalGroundOffsetView(e,o,r,n),Ae(this.parameters,n,o,r,a),this._applyPolygonOffsetView(n,o,s[3],r,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,t,i,s,r){return this._applyCenterOffsetNDC(e,t,i,s),null!=r&&d(r,s),this._applyPolygonOffsetNDC(s,t,i,s),s}_applyPolygonOffsetView(t,i,s,r,a){const n=r.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return d(a,t);const c=e(Math.abs(i.cosAngle),.01,1),u=1-Math.sqrt(1-c*c)/c/r.viewport[2];return m(a,t,l>0?u:1/u),a}_applyVerticalGroundOffsetView(e,t,i,s){const r=g(e),a=i.aboveGround?1:-1,n=i.computeRenderPixelSizeAtDist(r)*F,o=m(ce,t.normal,a*n);return v(s,e,o),s}_applyCenterOffsetView(e,t,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&d(i,e),s&&(i[0]+=t[0],i[1]+=t[1],t[2]&&(p(ue,i),x(i,i,m(ue,ue,t[2])))),i}_applyCenterOffsetNDC(e,t,i,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&d(s,e),r||(s[0]+=t[0]/i.fullWidth*2,s[1]+=t[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,i,s){const r=this.parameters.shaderPolygonOffset;if(e!==s&&d(s,e),r){const e=i.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*r}return s}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:i}=this.parameters,s=e[3]>=te||t>=te&&i[3]>=te;return this._visible&&s}createGLMaterial(e){return new se(e)}calculateRelativeScreenBounds(e,t,i=D()){return re(this.parameters,e,t,i),i[2]=i[0]+e[0],i[3]=i[1]+e[1],i}}class se extends E{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique($,e)}}function re(e,t,i,s){s[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*i,s[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*i}function ae(e,t,s,r){return M(t)&&(t=i(be,t)),S(r.normal,e,t),f(r.normal,r.normal,s.viewInverseTransposeMatrix),r.cosAngle=y(pe,Me),r}function ne(e){const t=e[0],i=e[1],s=e[2],r=e[3],a=e[4],n=e[5],o=e[6],l=e[7],c=e[8],u=1/Math.sqrt(t*t+i*i+s*s),f=1/Math.sqrt(r*r+a*a+n*n),p=1/Math.sqrt(o*o+l*l+c*c);return e[0]=t*u,e[1]=i*u,e[2]=s*u,e[3]=r*f,e[4]=a*f,e[5]=n*f,e[6]=o*p,e[7]=l*p,e[8]=c*p,e}function oe(e,i,s,r,a,l,c,u,f){let p=i-a-r[0]*f[0],h=p+r[0]+2*a,m=s-a-r[1]*f[1],d=m+r[1]+2*a;const g=u.distanceFieldBoundingBox;return u.textureIsSignedDistanceField&&null!=g&&(p+=r[0]*g[0],m+=r[1]*g[1],h-=r[0]*(1-g[2]),d-=r[1]*(1-g[3]),p-=l,h+=l,m-=l,d+=l),n(de,i,s),o(me,e,de,t(c)),me[0]>p&&me[0]<h&&me[1]>m&&me[1]<d}const le=new U,ce=O(),ue=O(),fe=P(),pe=O(),he=O(),me=c(),de=c(),ge=s(),be=s(),ve=a(),xe=P(),Se=O(),ye=O(),Oe=P(),ze={normal:pe,cosAngle:0},_e=1,Pe=2,je=l(0,0),Me=z(0,0,1);class De extends T{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1,this.color=j(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=j(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=P(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Ve{constructor(){this.layout=Q(),this.baseInstanceLayout=Z}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,i,s,r,a){const{position:n,normal:o,color:l,size:c,rotation:u,centerOffsetAndDistance:f,featureAttribute:p,uvi:h}=r;I(i.get("position"),e,n,a),q(i.get("normal"),t,o,a);const m=i.get("position").indices.length;let d=0,g=0,b=K,v=K;const x=i.get("uvi")?.data;x&&x.length>=4&&(d=x[0],g=x[1],b=x[2],v=x[3]);for(let S=0;S<m;++S){const e=a+S;h.setValues(e,d,g,b,v)}if(G(i.get("color"),4,l,a),W(i.get("size"),c,a),H(i.get("rotation"),u,a),i.get("centerOffsetAndDistance")?N(i.get("centerOffsetAndDistance"),f,a):X(f,a,m),i.get("featureAttribute")?N(i.get("featureAttribute"),p,a):X(p,a,m),null!=s){const e=i.get("position")?.indices;if(e){const t=e.length,i=r.getField("olidColor",V);Y(s,i,t,a)}}return{numVerticesPerItem:1,numItems:m}}writeBaseInstance(e,t){const{uv0:i}=t;W(e.get("uv0"),i,0)}intersect(e,t,i,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:x},point:S,camera:y}=s;if(!l||!c||x&&t.isLabel||!S)return;const z=this.layout.createView(e),{position:_,normal:P,rotation:j,size:M,featureAttribute:D,centerOffsetAndDistance:V}=z,R="screen"===t.centerOffsetUnits,A=J(t);if(null==_||null==P||null==j||null==M||null==V||null==y)return;const C=null==D?null:D.getVec(0,Oe),{scaleX:w,scaleY:F}=Re(C,t,y.pixelRatio),T=_.count;for(let E=0;E<T;E++){if(_.getVec(E,ce),null!=i&&v(ce,ce,i),f(ce,ce,y.viewMatrix),V.getVec(E,xe),u(Se,xe[0],xe[1],xe[2]),!R&&(ce[0]+=Se[0],ce[1]+=Se[1],0!==Se[2])){const e=Se[2];p(Se,ce),h(ce,ce,m(Se,Se,e))}if(P.getVec(E,ue),ae(ue,ge,y,ze),Ae(t,ce,ze,y,le),y.applyProjection(ce,fe),fe[0]>-1){R&&(Se[0]||Se[1])&&(fe[0]+=Se[0]*y.pixelRatio,0!==Se[1]&&(fe[1]+=le.alignmentEvaluator.apply(Se[1])*y.pixelRatio),y.unapplyProjection(fe,ce)),fe[0]+=t.screenOffset[0]*y.pixelRatio,fe[1]+=t.screenOffset[1]*y.pixelRatio,fe[0]=Math.floor(fe[0]),fe[1]=Math.floor(fe[1]),M.getVec(E,je),le.evaluator.applyVec2(je,je);const e=_e*y.pixelRatio;let i=0;if(t.textureIsSignedDistanceField){i=Math.min(t.outlineSize,.5*je[0])*y.pixelRatio/2}je[0]*=w,je[1]*=F;const a=j.get(E),n=t.rotation+a;if(oe(S,fe[0],fe[1],je,e,i,n,t,A)){const e=s.ray;if(f(he,ce,r(ve,y.viewMatrix)),fe[0]=S[0],fe[1]=S[1],y.unprojectFromRenderScreen(fe,ce)){const t=O();d(t,e.direction);const i=1/g(t);m(t,t,i);o(b(e.origin,ce)*i,t,E,he)}}}}}}function Re(e,t,i){return null==e||null==t.vvSize?{scaleX:i,scaleY:i}:(R(ye,t,e),{scaleX:ye[0]*i,scaleY:ye[1]*i})}function Ae(e,t,i,s,r){if(!e.verticalOffset?.screenLength){const s=g(t);return r.update(i.cosAngle,s,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),t}const a=g(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=k(s,a,e.verticalOffset,i.cosAngle,n,e.screenSizePerspectiveMinPixelReferenceSize);return r.update(i.cosAngle,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),m(i.normal,i.normal,o),v(t,t,i.normal)}export{ie as HUDMaterial,De as Parameters};
|