@arcgis/core 5.0.0-next.45 → 5.0.0-next.46
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/169be08394c5e7703628.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/{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/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/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/{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/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/78fccea3445fb2f9120a.js +1 -0
- package/assets/esri/core/workers/chunks/7ba31425caa404f86424.js +1 -0
- 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/{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/{768ae52b4e5c3e571ef5.js → dc29cb16704e2e4d0a46.js} +1 -1
- package/assets/esri/core/workers/chunks/e8c2e2fbe9cef4c8a8c6.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/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 +122 -14
- package/kernel.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/tiles3DUtils.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectSuppress.js +1 -1
- package/views/2d/interactive/SegmentLabels2D.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/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/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/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/FeatureForm/TextElementInput.d.ts +2 -2
- 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/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.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/2db7a7607657f1d669f7.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/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/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/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/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/f3c232fc56a29d51196a.js +0 -1
|
@@ -1,1019 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4633],{2451:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(31635),o=r(51976);class n extends o.K{constructor(){super(...arguments),this.output=0,this.hasEmission=!1}}(0,i.Cg)([(0,o.W)({count:10})],n.prototype,"output",void 0),(0,i.Cg)([(0,o.W)()],n.prototype,"hasEmission",void 0);class a extends n{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}class s extends a{constructor(){super(...arguments),this.oitPass=0,this.hasSlicePlane=!1,this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,i.Cg)([(0,o.W)({count:3})],s.prototype,"oitPass",void 0),(0,i.Cg)([(0,o.W)()],s.prototype,"hasSlicePlane",void 0),(0,i.Cg)([(0,o.W)()],s.prototype,"hasHighlightMixTexture",void 0)},2495:(e,t,r)=>{r.d(t,{$U:()=>Se,fs:()=>Ae,ty:()=>Ie});var i=r(38954),o=r(51850),n=r(49255),a=r(25634),s=r(11725),l=r(70328),c=r(620);class d{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const u=(0,l.vt)(),h=(0,o.vt)();function m(e,t,r,o,n,a,s){if(null==e)return;const c=function(e,t){return(0,i.h)(t,1/e[0],1/e[1],1/e[2])}(r,h);if((0,l.Ne)(u,e.bbMin),(0,l.vI)(u,e.bbMax),null!=n&&n.applyToAabb(u),function(e,t,r,i){return function(e,t,r,i){const o=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let a=Math.min(o,n),s=Math.max(o,n);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(u,t,c,o)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>M){const i=e.getChildren();if(void 0!==i){for(const e of i)m(e,t,r,o,n,a,s);return}}!function(e,t,r,i,o,n,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],f=t[0],v=t[1],g=t[2],{normalRequired:_}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*o[r];let c=n[i],w=n[i+1],b=n[i+2];const y=a*o[r+1];let M=n[y],C=n[y+1],S=n[y+2];const E=a*o[r+2];let A=n[E],I=n[E+1],R=n[E+2];null!=l&&([c,w,b]=l.applyToVertex(c,w,b,e),[M,C,S]=l.applyToVertex(M,C,S,e),[A,I,R]=l.applyToVertex(A,I,R,e));const F=M-c,O=C-w,P=S-b,D=A-c,H=I-w,N=R-b,z=v*N-H*g,L=g*D-N*f,B=f*H-D*v,V=F*z+O*L+P*B;if(Math.abs(V)<=T)continue;const U=u-c,G=h-w,j=m-b,W=U*z+G*L+j*B;if(V>0){if(W<0||W>V)continue}else if(W>0||W<V)continue;const k=G*P-O*j,$=j*F-P*U,Z=U*O-F*G,q=f*k+v*$+g*Z;if(V>0){if(q<0||W+q>V)continue}else if(q>0||W+q<V)continue;const Y=(D*k+H*$+N*Z)/V;Y>=0&&d(Y,t,_?x(F,O,P,D,H,N,p):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,n,a,s)}}const p=(0,o.vt)();function f(e,t,r,i,o,n,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,f=n*t,v=o[f],g=o[f+1],_=o[f+2],w=n*r,b=n*i,y=o[w]-v,M=o[w+1]-g,C=o[w+2]-_,S=o[b]-v,E=o[b+1]-g,A=o[b+2]-_,I=h*A-E*m,R=m*S-A*u,F=u*E-S*h,O=y*I+M*R+C*F;if(Math.abs(O)<=T)continue;const P=l-v,D=c-g,H=d-_,N=P*I+D*R+H*F;if(O>0){if(N<0||N>O)continue}else if(N>0||N<O)continue;const z=D*C-M*H,L=H*y-C*P,B=P*M-y*D,V=u*z+h*L+m*B;if(O>0){if(V<0||N+V>O)continue}else if(V>0||N+V<O)continue;const U=(S*z+E*L+A*B)/O;U>=0&&s(U,e,a?x(y,M,C,S,E,A,p):null)}}const v=(0,o.vt)(),g=(0,o.vt)(),_=(0,o.vt)();function x(e,t,r,o,n,a,s){return(0,i.h)(b,e,t,r),(0,i.h)(y,o,n,a),(0,i.f)(s,b,y),(0,i.n)(s,s),s}function w(e){return(0,i.a)(b,e[1],e[0]),(0,i.a)(y,e[2],e[0]),(0,i.f)(p,b,y),(0,i.n)(p,p),p}const b=(0,o.vt)(),y=(0,o.vt)(),M=1e3,T=1e-7,C=(0,o.vt)(),S=[(0,o.vt)(),(0,o.vt)(),(0,o.vt)()];var E=r(16396),A=r(13030),I=r(59907);class R{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,o,n){return(0,I.vJ)(r,i,this.layout,e,t,o,n)}intersect(e,t,r,o,n,a,s){const l=this.layout.createView(e).getField("position",A.xs);if(null==l)return;const c=(0,i.a)(F,a,n),d=l.count/3,u=o.options.normalRequired;f(n,c,0,d,l.typedBuffer,l.typedBufferStride,u,(e,t,r)=>s(e,r,t))}}const F=(0,o.vt)();var O=r(43616),P=r(31635),D=r(91429),H=r(91829),N=r(4431),z=r(1843),L=r(72824),B=r(13840),V=r(42958),U=r(16943),G=r(33524);const j={mask:255},W={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},k={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var $=r(4576),Z=r(44208);r(53966),r(34275),r(94656),r(63907),(0,Z.A)("esri-tests-disable-gpu-memory-measurements");var q=r(69622),Y=r(65529),X=r(77690),K=r(29242),J=r(58083),Q=r(9093),ee=r(32728);class te{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",A.Eq),this.color=e.getField("instanceColor",A.XP),this.olidColor=e.getField("instanceOlidColor",A.XP),this.state=e.getField("state",A.SL),this.lodLevel=e.getField("lodLevel",A.SL)}}let re=class extends q.A{constructor(e,t){super(e),this.events=new Y.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return oe(ie.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=ce,this._buffer=this._layout.createBuffer(this._capacity),this._view=new te(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=ne,o=ae;t.localTransform.getMat(e,se),t.globalTransform.getMat(e,le);const n=(0,J.lw)(le,le,se);(0,i.h)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,X.z0)(o,n),t.model.setMat(e,o);const a=(0,ee.wp)(ne,n);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,X.B8)(o,o),(0,X.mg)(o,o),t.modelNormal.setMat(e,o),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,ae),r.modelOrigin.getVec(e,ne),t[0]=ae[0],t[1]=ae[1],t[2]=ae[2],t[3]=0,t[4]=ae[3],t[5]=ae[4],t[6]=ae[5],t[7]=0,t[8]=ae[6],t[9]=ae[7],t[10]=ae[8],t[11]=0,t[12]=ne[0],t[13]=ne[1],t[14]=ne[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ne,this,e),t*=Math.max(ne[0],ne[1],ne[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(ne,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(ne[0],ne[1],ne[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(ce,Math.floor(this._capacity*$.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new te(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,P.Cg)([(0,D.MZ)({constructOnly:!0})],re.prototype,"shaderTransformation",void 0),(0,P.Cg)([(0,D.MZ)()],re.prototype,"_size",void 0),(0,P.Cg)([(0,D.MZ)({readOnly:!0})],re.prototype,"size",null),re=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],re);const ie=(0,z.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function oe(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,U.E)()&&e.vec4u8("instanceOlidColor"),e}const ne=(0,o.vt)(),ae=(0,K.vt)(),se=(0,Q.vt)(),le=(0,Q.vt)(),ce=64,de=(0,z.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var ue=r(74810),he=r(28491),me=r(90644),pe=r(85079),fe=r(49788);class ve extends L.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=ue.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=o.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,o.CN)(.2,.2,.2),this.diffuse=(0,o.CN)(.8,.8,.8),this.externalColor=(0,H.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,o.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=fe.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}L.gy;let ge=class extends V.w{constructor(e,t){const i=[(0,N.U)(we(t))];t.instanced&&t.instancedDoublePrecision&&i.push((0,N.U)(function(e){return oe(de.clone(),e)}(t))),super(e,t,(0,pe._u)(i)),this.shader=new B.r(he.D,()=>r.e(5141).then(r.bind(r,5141)))}_makePipeline(e,t){const{oitPass:r,output:i,hasEmission:o,transparent:a,cullFace:s,customDepthTest:l,hasOccludees:c}=e;return(0,me.Ey)({blending:(0,n._o)(i)&&a?(0,G.Yf)(r):null,culling:xe(e)?(0,me.Xt)(s):null,depthTest:(0,G.mt)(r,_e(l)),depthWrite:(0,G.z5)(e),drawBuffers:(0,V.L)(i,(0,G.Sv)(r,o)),colorWrite:me.kn,stencilWrite:c?j:null,stencilTest:c?t?k:W:null,polygonOffset:(0,G.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function _e(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function xe(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function we(e){const t=(0,z.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,U.E)()&&t.vec4u8("olidColor"),t}ge=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],ge);var be=r(51976),ye=r(2451);class Me extends ye.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,P.Cg)([(0,be.W)({count:4})],Me.prototype,"alphaDiscardMode",void 0),(0,P.Cg)([(0,be.W)({count:3})],Me.prototype,"doubleSidedMode",void 0),(0,P.Cg)([(0,be.W)({count:7})],Me.prototype,"pbrMode",void 0),(0,P.Cg)([(0,be.W)({count:3})],Me.prototype,"cullFace",void 0),(0,P.Cg)([(0,be.W)({count:3})],Me.prototype,"normalType",void 0),(0,P.Cg)([(0,be.W)({count:3})],Me.prototype,"customDepthTest",void 0),(0,P.Cg)([(0,be.W)({count:8})],Me.prototype,"emissionSource",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVertexColors",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasSymbolColors",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVerticalOffset",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasColorTexture",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasMetallicRoughnessTexture",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasOcclusionTexture",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasNormalTexture",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasScreenSizePerspective",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVertexTangents",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasOccludees",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"instanced",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"instancedDoublePrecision",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasModelTransformation",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"offsetBackfaces",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVVSize",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasVVColor",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"receiveShadows",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"receiveAmbientOcclusion",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"textureAlphaPremultiplied",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"instancedFeatureAttribute",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"instancedColor",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"writeDepth",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"transparent",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"enableOffset",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"terrainDepthTest",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"cullAboveTerrain",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"snowCover",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasColorTextureTransform",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasEmissionTextureTransform",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasNormalTextureTransform",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasOcclusionTextureTransform",void 0),(0,P.Cg)([(0,be.W)()],Me.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Te=r(57323);let Ce=class extends ge{constructor(){super(...arguments),this.shader=new B.r(Te.R,()=>r.e(2314).then(r.bind(r,39933)))}};Ce=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],Ce);class Se extends s.i{constructor(e,t){super(e,Ae),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,n.iq)(e)||(0,n.Bf)(e))&&!this.transparent],[4,e=>((0,n.iq)(e)||(0,n.Bf)(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>((0,n.iq)(e)||(0,n.Bf)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=we(this.parameters),this._configuration=new Me(t.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=fe.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.m)(this.parameters.emissiveBaseColor,o.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:o,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!o&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=o?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!o&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=o?2:a&&"normal"===s?1:a&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,n._o)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.enableOffset,i.snowCover=t.snowCover>0,i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,o,n,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.h)(He,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(Pe,He);break;case 2:a=(0,i.d)(Pe,Oe)}let s=0;const l=(0,i.e)(Ne,He,e.eye),c=(0,i.b)(l),d=(0,i.j)(l,l,1/c);let u=null;this.parameters.screenSizePerspective&&(u=(0,i.g)(a,d)),s+=(0,O.kE)(e,c,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective,null),(0,i.j)(a,a,s),(0,i.t)(De,a,r.transform.inverseRotation),o=(0,i.e)(Re,o,De),n=(0,i.e)(Fe,n,De)}!function(e,t,r,o,n,a){if(!e.visible)return;const s=(0,i.a)(C,o,r),l=(e,t,r)=>a(e,r,t),{tolerance:u}=t,h=new d(u,!1,t.options.normalRequired);if(e.boundingInfo)(0,c.vA)(0===e.type),m(e.boundingInfo,r,s,u,n,h,l);else{const t=e.positionAttribute,o=t.indices;!function(e,t,r,o,n,a,s,l,c,d){const u=t,h=S,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),x=m>=p?m>=f?0:2:p>=f?1:2,b=x,y=u[b]<0?2:1,M=(x+y)%3,T=(x+(3-y))%3,C=u[M]/u[b],E=u[T]/u[b],A=1/u[b],I=v,R=g,F=_,{normalRequired:O}=c;for(let t=r;t<o;++t){const r=3*t,o=s*n[r];(0,i.h)(h[0],a[o+0],a[o+1],a[o+2]);const c=s*n[r+1];(0,i.h)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*n[r+2];(0,i.h)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.d)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.d)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.d)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(I,h[0],e),(0,i.a)(R,h[1],e),(0,i.a)(F,h[2],e);const m=I[M]-C*I[b],p=I[T]-E*I[b],f=R[M]-C*R[b],v=R[T]-E*R[b],g=F[M]-C*F[b],_=F[T]-E*F[b],x=g*v-_*f,y=m*_-p*g,S=f*p-v*m;if((x<0||y<0||S<0)&&(x>0||y>0||S>0))continue;const P=x+y+S;if(0===P)continue;const D=x*(A*I[b])+y*(A*R[b])+S*(A*F[b]);if(D*Math.sign(P)<0)continue;const H=D/P;H>=0&&d(H,t,O?w(h):null)}}(r,s,0,o.length/3,o,t.data,t.stride,n,h,l)}}(e,r,o,n,(0,E.ou)(r.verticalOffset),a)}createGLMaterial(e){return new Ee(e)}createBufferWriter(){return new R(this._layout)}get transparent(){return Ie(this.parameters)}}class Ee extends a.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.h)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Ce:ge,e)}}class Ae extends ve{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function Ie(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:o,texture:n,textureId:a,textureAlphaMode:s,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||o<1||(null!=n||null!=a)&&1!==s&&2!==s&&"replace"!==l}const Re=(0,o.vt)(),Fe=(0,o.vt)(),Oe=(0,o.fA)(0,0,1),Pe=(0,o.vt)(),De=(0,o.vt)(),He=(0,o.vt)(),Ne=(0,o.vt)()},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,n.j)(h,this.ray.direction,this.distance),(0,n.b)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,n.j)(h,this.ray.direction,this.distance),(0,n.i)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,n.d)(m,this.normal),m[3]=0,(0,s.t)(m,m,this.transformation),(0,n.d)(e,m),(0,n.n)(e,e)}constructor(e){this.intersector=4,this.normal=(0,a.vt)(),this.transformation=(0,o.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,d){this.intersector=e,this.distance=r,(0,n.d)(this.normal,s??a.Cb),(0,i.C)(this.transformation,l??o.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=d}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,n.d)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),m=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>n});var i=r(33094),o=r(31821);function n(e,t){t.snowCover&&(e.uniforms.add(new i.U("snowCover",e=>e.snowCover)).code.add(o.H`float getSnow(vec3 normal, vec3 groundNormal) {
|
|
2
|
-
return smoothstep(0.5, 0.55, dot(normal, groundNormal)) * snowCover;
|
|
3
|
-
}
|
|
4
|
-
float getRealisticTreeSnow(vec3 faceNormal, vec3 shadingNormal, vec3 groundNormal) {
|
|
5
|
-
float snow = min(1.0, smoothstep(0.5, 0.55, dot(faceNormal, groundNormal)) +
|
|
6
|
-
smoothstep(0.5, 0.55, dot(-faceNormal, groundNormal)) +
|
|
7
|
-
smoothstep(0.0, 0.1, dot(shadingNormal, groundNormal)));
|
|
8
|
-
return snow * snowCover;
|
|
9
|
-
}`),e.code.add(o.H`vec3 applySnowToMRR(vec3 mrr, float snow) {
|
|
10
|
-
return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
|
|
11
|
-
}`))}},11725:(e,t,r)=>{r.d(t,{i:()=>l});var i=r(24326),o=r(49255),n=r(2451),a=r(43616),s=r(65786);class l{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,a.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,a.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new n.E){return r.output=e,r.hasEmission=t.hasEmission&&(0,o._o)(e),r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},12791:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},13840:(e,t,r)=>{r.d(t,{r:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),o=(r(44208),r(53966));const n=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s=o.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?g:v,d=o.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${d.join("\n")}\n${n.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${u.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let o=0;o<i;++o)r[o](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,n,t,o)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else n().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new d(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?n().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):n().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"uint":i=f._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])}, ${f._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",g="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,o)=>i.setUniform4fv(e,t(o),r))}}},14527:(e,t,r)=>{r.d(t,{n:()=>mt});var i=r(31821),o=r(12791),n=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(91429),u=r(37585),h=r(69540);let m=class extends h.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,n.Cg)([(0,d.$K)("esri.CameraLayout")],m);const p=m;var f=r(69052),v=r(25482),g=r(56507),_=r(86738),x=r(43937),w=r(36005);let b=class extends((0,h.OU)(v.o)){constructor(...e){super(...e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new p}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const o={position:e};return null!=t&&(o.heading=t),null!=r&&(o.tilt=r),null!=i&&(o.fov=i),o}return e}writePosition(e,t,r,i){const o=e.clone();o.x=(0,g.GB)(e.x||0),o.y=(0,g.GB)(e.y||0),o.z=e.hasZ?(0,g.GB)(e.z||0):e.z,t[r]=o.write({},i)}readPosition(e,t){const r=new _.A;return r.read(e,t),r.x=(0,g.GB)(r.x||0),r.y=(0,g.GB)(r.y||0),r.z=r.hasZ?(0,g.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,n.Cg)([(0,d.MZ)({type:_.A,json:{write:{isRequired:!0}}})],b.prototype,"position",void 0),(0,n.Cg)([(0,x.K)("position")],b.prototype,"writePosition",null),(0,n.Cg)([(0,w.w)("position")],b.prototype,"readPosition",null),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>f.ie.normalize((0,g.GB)(e)))],b.prototype,"heading",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e),-180,180))],b.prototype,"tilt",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e,55),1,170))],b.prototype,"fov",void 0),(0,n.Cg)([(0,d.MZ)({type:p,nonNullable:!0,json:{read:!1,write:!1}})],b.prototype,"layout",void 0),b=(0,n.Cg)([(0,d.$K)("esri.Camera")],b);var y=r(9093),M=r(38954),T=r(51850),C=r(16930),S=(r(48353),r(9762),r(65806)),E=r(27993),A=r(73941),I=(r(19419),r(71351)),R=r(69622),F=r(53966),O=r(90629),P=r(58083),D=r(48163),H=r(87317),N=r(91829),z=r(82919),L=r(44280);const B=(0,T.vt)(),V=(0,T.vt)();var U;let G=U=class extends R.A{constructor(e){super(e),this._ray=(0,I.vt)(),this._viewport=(0,N.fA)(0,0,1,1),this._padding=(0,N.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,D.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,y.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,y.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,y.vt)(),this._frustumDirty=!0,this._frustum=(0,z.vt)(),this._fullViewport=(0,N.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,T.vt)(),this._up=(0,T.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,M.e)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,P.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,H.s)((0,N.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,H.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,H.s)((0,N.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,H.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,H.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,H.f)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,P.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,P.B8)((0,y.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,y.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,M.C)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,P.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,P.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,o=r/this.rows,n=i/this.columns,a=-i/2+this.column*n,s=a+n,l=-r/2+this.row*o,c=l+o,d=(0,P.$h)((0,y.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,P.aI)(u,d)?u:d}copyFrom(e){(0,M.d)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,H.f)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,H.f)(this._padding,e.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,P.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,z.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,P.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,H.f)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new U).copyFrom(this)}equals(e){return(0,M.m)(this.eye,e.eye)&&(0,M.m)(this.center,e.center)&&(0,M.m)(this.up,e.up)&&(0,H.a)(this._viewport,e.viewport)&&(0,H.a)(this._padding,e.padding)&&(0,u.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,H.g)(e.screenPadding,this.screenPadding)>=t||(0,H.g)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,M.a)(k,e.eye,e.center),(0,M.a)($,this.eye,this.center);const r=(0,M.g)(k,$),i=(0,M.w)(k),o=(0,M.w)($),n=5e-4;return r*r>=(1-1e-10)*i*o&&(0,M.v)(e.eye,this.eye)<Math.max(i,o)*n*n}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,L.gr)(this.viewForward,(0,M.e)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,O.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,M.d)(j,e),j[3]=1,(0,H.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,M.j)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,H.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,Z),this.renderToScreen(Z,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,H.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,M.j)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,o=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),n=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=o,t.y=n):(t[0]=o,t[1]=n,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Z),t)}unprojectFromRenderScreen(e,t){if((0,P.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,P.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,H.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const o=e*this.pixelRatio,n=t*this.pixelRatio,a=Math.max(o-r/2,0),s=Math.max(this.fullHeight-n-i/2,0),l=-Math.min(o-r/2,0),c=-Math.min(this.fullHeight-n-i/2,0),d=r-l- -Math.min(this.fullWidth-o-r/2,0),u=i-c- -Math.min(n-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:o,fovY:n}=this,s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,B),(0,M.e)(V,r,t);const i=(0,M.b)(V);return 0===i?0:(0,a.XM)((0,M.g)(V,B)/i)}(t,r,i));return e.frustumCoverage(s,o,n)}_computeUpGlobal(){(0,M.e)(k,this.center,this.eye);const e=(0,M.b)(this.center);e<1?(0,M.m)(this._up,T.Cb)&&((0,M.d)(this._up,T.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,M.g)(k,this.center))>.9999*(0,M.b)(k)*e||((0,M.f)($,k,this.center),(0,M.f)($,$,k),(0,M.n)($,$),(0,M.m)(this._up,$)||((0,M.d)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,M.D)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,M.j)(k,k,k[2]),(0,M.h)(k,-k[0],-k[1],1-k[2]),(0,M.n)(k,k),(0,M.m)(this._up,k)||((0,M.d)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,M.m)(e,t)||((0,M.d)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):F.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,z.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,P.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,n.Cg)([(0,d.MZ)()],G.prototype,"_viewport",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_padding",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_fov",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_nearFar",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_viewDirty",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_viewMatrix",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_pixelRatio",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"pixelRatio",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"row",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"column",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_rows",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"rows",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_columns",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"columns",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"eye",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"center",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_center",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"up",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"_up",void 0),(0,n.Cg)([(0,d.MZ)()],G.prototype,"viewMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewForward",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewUp",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewRight",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"nearFar",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"near",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"far",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"viewport",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"screenViewport",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"screenPadding",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"x",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"y",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"width",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"height",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"fullWidth",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"fullHeight",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"_aspect",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"padding",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"projectionMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"inverseProjectionMatrix",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"fov",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"fovX",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"fovY",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"viewInverseTransposeMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"_projectionMatrixInternal",null),(0,n.Cg)([(0,d.MZ)()],G.prototype,"relativeElevation",void 0),G=U=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl.RenderCamera")],G);const j=(0,N.vt)(),W=(0,y.vt)(),k=(0,T.vt)(),$=(0,T.vt)(),Z=(0,O.r_)();r(49718),r(6867),r(16396),(0,T.vt)(),(0,T.vt)(),(0,T.vt)();var q=r(5443),Y=r(39829),X=r(95108);function K(e,t,r,i){const o=function(e,t){const r=0===t||2===t?0:1,i=e[t],o=0===t||1===t?1:-1,n=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===o?0:1;if(t[r]>i&&a[r]>i)return 1===o?1:0;const s=(a[n]-t[n])/(a[r]-t[r]),l=t[n]+s*(i-t[r]);return e[r]=i,e[n]=l,(t[r]<i?1:-1)*o>0?2:3}}(r,i);if(e.length=0,t.length){1===o(Q,t[0],t[0])&&J(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(o(Q,t[r],i)){case 1:J(e,i);break;case 3:J(e,(0,D.o8)(Q));break;case 2:J(e,(0,D.o8)(Q)),J(e,i)}}}}function J(e,t){0!==e.length&&(0,u.aI)(e.at(-1),t)||e.push(t)}const Q=(0,D.vt)();var ee=r(11964),te=r(27921);const re=(0,T.vt)(),ie=(0,T.vt)();function oe(){return{direction:(0,T.vt)(),up:(0,T.vt)()}}function ne(e,t,r,i,o){let n=(0,M.n)(re,e),s=(0,M.g)(n,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,M.g)(t,i)),s<.99?((0,M.d)(n,t),l&&(0,M.j)(n,n,-1)):n=null);let c=0;if(n){(0,M.j)(ie,i,(0,M.g)(i,n)),(0,M.e)(n,n,ie);const e=(0,M.g)(n,o)/((0,M.b)(n)*(0,M.b)(o));(0,M.f)(ie,n,o),c=((0,M.g)(ie,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,M.g)(i,e)/(0,M.b)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function ae(e,t,r,i){(0,M.e)(se,r,t),(0,te.T7)(i,(0,ee.LV)(t,se),e)||e===r||(0,M.d)(e,r)}const se=(0,T.vt)(),le=(0,T.fA)(0,1,0),ce=(0,T.fA)(0,0,1),de=(0,y.vt)(),ue=(0,T.vt)(),he=(0,T.vt)();function me(e,t,r,i=oe()){const{direction:o,up:n}=i;return(0,P.N9)(de,-(0,a.kU)(t)),(0,P.eL)(de,de,(0,a.kU)(r)),(0,M.p)(o,ce,de),(0,M.j)(o,o,-1),(0,M.p)(n,le,de),i}function pe(e,t,r,i,o){const n=t.lines[11].direction,a=(o-r.getAltitude(i))/n[2];(0,M.c)(e,i,n,a)}const fe=(0,T.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return ne(t,r,i,ce,le)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o=me(0,r,i),n=(0,T.vt)();return(0,M.j)(n,o.direction,-t),(0,M.i)(n,n,e),{up:o.up,eye:n,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:me,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,o=i.getAltitude(t),n=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,I.LV)(t.origin,t.direction),o,fe)||pe(fe,r,i,t.endpoint,o),ae(fe,a,fe,l),s.push((0,D.fA)(fe[0],fe[1]))}return function(e,t,r){const i=e.map(e=>((0,M.h)(fe,e[0],e[1],0),t.fromRenderCoords(fe,fe,r),[fe[0],fe[1]]));return i.length<=2?new Y.A({spatialReference:r}):(i.push(i[0].slice()),(0,X.$3)(i)||i.reverse(),new Y.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(s,i.extent),i,n)},toExtent:function(e,t,r,i,o){const n=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,S.g)(t,ue,n),(0,S.g)(t,he,n),ue[0]-=r/2,he[0]+=r/2,ue[1]-=i/2,he[1]+=i/2,(0,E.F)(ue,n,ue,a),(0,E.F)(he,n,he,a),o?(o.xmin=ue[0],o.ymin=ue[1],o.xmax=he[0],o.ymax=he[1],o.spatialReference=a):o=new q.A(ue[0],ue[1],he[0],he[1],a),o}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),ge=r(17136),_e=r(94008),xe=r(28735);class we{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,z.vt)(),this._points=(0,z.Qy)(),this.lines=new Array(12),this._origin=(0,T.vt)(),this._direction=(0,T.vt)(),this._altitude=null;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,T.vt)(),endpoint:null}}update(e){(0,z.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,M.d)(this._origin,e.eye),(0,M.d)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,M.d)(this._points[t],e[t]);(0,z.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,z.m7)(this.frustum,e)}intersectsRay(e){return(0,z.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,z.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,z.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;be(this.lines[t],e[t],e[r]),be(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),be(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}static{this.planePointIndices=z.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function be(e,t,r){e.origin=t,e.endpoint=r,(0,M.D)(e.direction,t,r)}r(86211);const ye=(0,T.fA)(parseFloat(Number(5802e-9).toFixed(6)),parseFloat(Number(13558e-9).toFixed(6)),parseFloat(Number(331e-7).toFixed(6))),Me=(0,T.fA)(3*parseFloat(Number(65e-8).toFixed(6)),3*parseFloat(Number(1881e-9).toFixed(6)),3*parseFloat(Number(85e-9).toFixed(6)));(0,T.fA)(parseFloat(Number(ye[0]+Me[0]).toFixed(6)),parseFloat(Number(ye[1]+Me[1]).toFixed(6)),parseFloat(Number(ye[2]+Me[2]).toFixed(6)));class Te{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Te(0,0)}static{this.Infinite=new Te}}(0,T.vt)(),(0,T.vt)(),new _e.iy,(0,I.vt)();var Ce=r(32728);const Se=(0,T.fA)(0,0,1),Ee=(0,M.n)((0,T.vt)(),(0,T.fA)(1,1,1)),Ae=(0,y.vt)(),Ie=(0,T.vt)(),Re=(0,T.vt)();function Fe(e,t,r,i=oe()){(0,M.f)(Ie,e,Se),0===(0,M.g)(Ie,Ie)&&(0,M.f)(Ie,e,Ee),(0,P.$0)(Ae,-(0,a.kU)(t),e),(0,P.e$)(Ae,Ae,-(0,a.kU)(r),Ie);const{up:o,direction:n}=i;return(0,M.f)(o,Ie,e),(0,M.n)(o,o),(0,M.p)(o,o,Ae),(0,M.n)(n,e),(0,M.q)(n,n),(0,M.p)(n,n,Ae),i}function Oe(e){const t=e[1];e[1]=-e[2],e[2]=t}function Pe(e,t){const r=Fe(t,e.heading,e.tilt);return e.up=r.up,e}function De(e,t){const r=[],i=[],o=(0,ve.FD)();for(let n=0;n<e.length;n++){const a=e[n],s=n===e.length-1?e[0]:e[n+1],l=(0,ee.Cr)(a,s,Ge),c=(0,te.vE)(t,l.origin,l.vector,0,Ve);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,n,s]=0===c?[1,r,i]:[-1,i,r],l=(0,te.Qj)(t),d=(0,M.c)((0,T.vt)(),Ve,l,e*o),u=(0,M.c)((0,T.vt)(),Ve,l,e*-o);n.push(a),n.push(d),s.push(u)}}}const n=[];return r.length&&n.push(r),i.length&&n.push(i),n}const He={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},Ne=(0,T.fA)(1,0,0),ze=(0,T.fA)(0,1,0),Le=(0,T.vt)(),Be=(0,T.vt)(),Ve=(0,T.vt)(),Ue=new _e.iy,Ge=(0,ee.vt)(),je=(0,N.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const o=Ie,n=Re;return(0,M.n)(o,e),(0,M.f)(Re,o,Se),0===(0,M.g)(Re,Re)&&(0,M.f)(Re,o,Ee),(0,M.f)(n,Re,o),ne(t,r,i,o,n)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o={eye:(0,T.vt)(),up:null,tilt:i,heading:r},n=Ie;n[0]=e[0],n[1]=e[2],n[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),m=Math.cos(c),p=(0,M.b)(n);let f;if(Math.abs(c)<1e-8)f=s+p;else{const e=p/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const v=m*s,g=s*s*(h*h),_=u*u*g,x=f-v,w=x*x,b=_*(_+w-n[1]*n[1]);if(b<0)return(0,M.j)(o.eye,n,f/p),o.tilt=0,Pe(o,e);const y=Math.sqrt(b),C=n[1]*x,S=_+w;let E;if(E=u>0?-y+C:y+C,Math.abs(S)<1e-8)return p<1e-8?(o.eye[0]=0,o.eye[1]=0,o.eye[2]=s):(0,M.j)(o.eye,n,f/p),o.tilt=0,Oe(o.eye),Pe(o,e);o.eye[1]=E/S;const A=d*d*g,I=h*s,R=u*I*o.eye[1],F=o.eye[1]*o.eye[1],O=1-F,P=Math.sqrt(O),D=_*F+A-2*R*P*x+O*w;return Math.abs(D)<1e-8?((0,M.j)(o.eye,n,f/p),o.tilt=0,Oe(o.eye),Pe(o,e)):(o.eye[0]=(O*(f*n[0]-v*n[0])-I*P*(n[0]*o.eye[1]*u+n[2]*d))/D,o.eye[2]=(O*(f*n[2]-v*n[2])-I*P*(n[2]*o.eye[1]*u-n[0]*d))/D,(0,M.j)(o.eye,o.eye,f),Oe(o.eye),Pe(o,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),o=(0,M.b)(t);return(0,a.YN)(r/(o/Math.sin(i)))+i},headingTiltToDirectionUp:Fe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,M.b)(t),o=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),n=(0,a.YN)(r/(o/Math.sin(e)));return(0,a.KJ)(e-n)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),o=new we(r);i.near=2,o.update(i);const n=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,M.C)(c,t)/(l+n),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=He,v=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return Ue.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(Ue,t)}(e),g=(0,a.qE)((u-h)/(m-h),0,1),_=Math.round((0,a.Cc)(p,f,g)),x=i.aboveGround,w=o.planes[5],b=[],y=(0,te.O_)(T.uY,Ne,(0,te.vt)()),C=(0,te.O_)(T.uY,ze,(0,te.vt)());(0,H.c)(je,0,0,0,0);const S=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-v:0,i=1===e&&x||3===e&&!x?v:1,s=o.lines[e],l=o.lines[3===e?0:e+1];for(let o=0;o<_;o++){const d=o/_,u=0===o?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,M.l)(Be,s.origin,l.origin,u),m=(0,Ce.nu)(s.direction,l.direction,u,Le);r.intersectManifoldClosestSilhouette((0,I.LV)(h,m),n,Ve),ae(Ve,c,Ve,w),b.push((0,T.o8)(Ve)),0!==b.length&&S((0,M.v)(b.at(-1),Ve));const p=((0,te.Tj)(y,Ve)?1:0)|((0,te.Tj)(C,Ve)?2:0);je[p]=1}}b.length>2&&(0,M.v)(b[0],b.at(-1));const E=function(e,t,r){const i=2*(0,ve.FD)();return e.map(e=>{const o=[];let n=!1;for(const a of e)t.fromRenderCoords(a,Ve,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(o.push([null,Ve[1]]),o.push([null,Ve[1]]),n=!0):o.push([Ve[0],Ve[1]]);if(n)for(let e=0;e<o.length;e++){const t=o[e];if(null!=t[0])continue;const r=o[e+1],i=o.at(0===e?-1:e-1);t[0]=i[0],e++;const n=o.at(e===o.length-1?0:e+1);r[0]=n[0]}return o.push(o[0]),(0,X.$3)(o)||o.reverse(),o})}((0,H.d)(je)>1?function(e,t){const r=[];for(const i of e)r.push(...De(i,t));return r}(De(b,y),C):[b],r,s);return new Y.A({rings:E,spatialReference:s})},toExtent:function(e,t,r,i,o){let n,s,l,c;const d=t.latitude,u=(0,A.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,o=(0,a.kU)(e),n=Math.sin(i/2),s=Math.cos(o),l=2*(0,a.YN)(Math.sqrt(n*n/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;n=h-m,s=h+m;const p=(0,a.kU)(d),v=(1+Math.sin(p))/(1-Math.sin(p)),g=(v+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=f.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*v+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=ge.Y_.monotonic(n,s),s-n>180){const e=(s-n-180)/2;n+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:C.A.WGS84;return o?(o.xmin=n,o.ymin=l,o.xmax=s,o.ymax=c,o.spatialReference=w):o=new q.A(n,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,xe.Gh)(o,!1,o),o}},Symbol.toStringTag,{value:"Module"}));const We="ssao";(0,T.vt)(),r(44208);var ke=r(49186),$e=r(10107),Ze=r(64108);let qe=class extends R.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new ke.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,n.Cg)([(0,$e.MZ)({constructOnly:!0})],qe.prototype,"view",void 0),(0,n.Cg)([(0,$e.MZ)({constructOnly:!0})],qe.prototype,"consumes",void 0),(0,n.Cg)([(0,$e.MZ)()],qe.prototype,"produces",void 0),(0,n.Cg)([(0,$e.MZ)({readOnly:!0})],qe.prototype,"techniques",null),qe=(0,n.Cg)([(0,Ze.$)("esri.views.3d.webgl.RenderNode")],qe);var Ye=r(13840),Xe=r(42958),Ke=r(95774),Je=r(90644);let Qe=class extends Xe.w{constructor(){super(...arguments),this.shader=new Ye.r(Ke.S,()=>r.e(9384).then(r.bind(r,59384)))}initializePipeline(){return(0,Je.Ey)({colorWrite:Je.kn})}};Qe=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],Qe);var et=r(65786);class tt extends et.Y{constructor(){super(...arguments),this.projScale=1}}class rt extends tt{constructor(){super(...arguments),this.intensity=1}}class it extends et.Y{}class ot extends it{constructor(){super(...arguments),this.blurSize=(0,D.vt)()}}var nt=r(15581);let at=class extends Xe.w{constructor(){super(...arguments),this.shader=new Ye.r(nt.S,()=>r.e(191).then(r.bind(r,90191)))}initializePipeline(){return(0,Je.Ey)({colorWrite:Je.kn})}};at=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],at);var st=r(63907),lt=r(76284),ct=r(67171);const dt=2;let ut=class extends qe{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=We,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new rt,this._drawParameters=new ot}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ct.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new lt.g(this.renderingContext,t,e),this.techniques.precompile(at),this.techniques.precompile(Qe),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(st.nI);if(!r||!i)return;const o=this.techniques.get(at),n=this.techniques.get(Qe);if(!o.compiled||!n.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,h=d.camera,m=h.relativeElevation,p=(0,a.qE)((5e5-m)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,v=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/h.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*ht/(0,nt.g)(h)**6*v;const g=h.fullViewport[2],_=h.fullViewport[3],x=this.fboCache.acquire(g,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,g,_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(g/dt),b=Math.round(_/dt),y=this.fboCache.acquire(w,b,"ssao blur",0);s.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,0,dt/_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,b,We,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,g,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,dt/g,0),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),s.setViewport4fv(h.fullViewport),y.release(),f<1&&this.requestRender(2),M}};(0,n.Cg)([(0,d.MZ)()],ut.prototype,"consumes",void 0),(0,n.Cg)([(0,d.MZ)()],ut.prototype,"produces",void 0),(0,n.Cg)([(0,d.MZ)({constructOnly:!0})],ut.prototype,"isEnabled",void 0),ut=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ut);const ht=.5;function mt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new o.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/dt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
12
|
-
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
13
|
-
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
14
|
-
}
|
|
15
|
-
float evaluateAmbientOcclusion() {
|
|
16
|
-
return 1.0 - evaluateAmbientOcclusionInverse();
|
|
17
|
-
}`)):e.code.add(i.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
|
|
18
|
-
float evaluateAmbientOcclusion() { return 0.0; }`)}},15581:(e,t,r)=>{r.d(t,{S:()=>x,b:()=>v,g:()=>g});var i=r(37585),o=r(48163),n=r(82048),a=r(52540),s=r(34845),l=r(77108),c=r(47286),d=r(33094),u=r(20304),h=r(31821),m=r(63761),p=r(14113);const f=16;function v(){const e=new p.N5,t=e.fragment;return e.include(n.c),e.include(s.Ir),t.include(a.E),t.uniforms.add(new d.U("radius",e=>g(e.camera))).code.add(h.H`vec3 sphere[16] = vec3[16](
|
|
19
|
-
vec3(0.186937, 0.0, 0.0),
|
|
20
|
-
vec3(0.700542, 0.0, 0.0),
|
|
21
|
-
vec3(-0.864858, -0.481795, -0.111713),
|
|
22
|
-
vec3(-0.624773, 0.102853, -0.730153),
|
|
23
|
-
vec3(-0.387172, 0.260319, 0.007229),
|
|
24
|
-
vec3(-0.222367, -0.642631, -0.707697),
|
|
25
|
-
vec3(-0.01336, -0.014956, 0.169662),
|
|
26
|
-
vec3(0.122575, 0.1544, -0.456944),
|
|
27
|
-
vec3(-0.177141, 0.85997, -0.42346),
|
|
28
|
-
vec3(-0.131631, 0.814545, 0.524355),
|
|
29
|
-
vec3(-0.779469, 0.007991, 0.624833),
|
|
30
|
-
vec3(0.308092, 0.209288,0.35969),
|
|
31
|
-
vec3(0.359331, -0.184533, -0.377458),
|
|
32
|
-
vec3(0.192633, -0.482999, -0.065284),
|
|
33
|
-
vec3(0.233538, 0.293706, -0.055139),
|
|
34
|
-
vec3(0.417709, -0.386701, 0.442449)
|
|
35
|
-
);
|
|
36
|
-
float fallOffFunction(float vv, float vn, float bias) {
|
|
37
|
-
float f = max(radius * radius - vv, 0.0);
|
|
38
|
-
return f * f * f * max(vn - bias, 0.0);
|
|
39
|
-
}`),t.code.add(h.H`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) {
|
|
40
|
-
vec3 v = Q - C;
|
|
41
|
-
float vv = dot(v, v);
|
|
42
|
-
float vn = dot(normalize(v), n_C);
|
|
43
|
-
return fallOffFunction(vv, vn, 0.1);
|
|
44
|
-
}`),e.outputs.add("fragOcclusion","float"),t.uniforms.add(new m.N("normalMap",e=>e.normalTexture),new m.N("depthMap",e=>e.depthTexture),new u.m("projScale",e=>e.projScale),new m.N("rnm",e=>e.noiseTexture),new c.G("rnmScale",(e,t)=>(0,i.hZ)(_,t.camera.fullWidth/e.noiseTexture.descriptor.width,t.camera.fullHeight/e.noiseTexture.descriptor.height)),new u.m("intensity",e=>e.intensity),new l.E("screenSize",e=>(0,i.hZ)(_,e.camera.fullWidth,e.camera.fullHeight))).main.add(h.H`
|
|
45
|
-
float depth = depthFromTexture(depthMap, uv);
|
|
46
|
-
|
|
47
|
-
// Early out if depth is out of range, such as in the sky
|
|
48
|
-
if (depth >= 1.0 || depth <= 0.0) {
|
|
49
|
-
fragOcclusion = 1.0;
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// get the normal of current fragment
|
|
54
|
-
ivec2 iuv = ivec2(uv * vec2(textureSize(normalMap, 0)));
|
|
55
|
-
vec4 norm4 = texelFetch(normalMap, iuv, 0);
|
|
56
|
-
if(norm4.a != 1.0) {
|
|
57
|
-
fragOcclusion = 1.0;
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
vec3 norm = normalize(norm4.xyz * 2.0 - 1.0);
|
|
61
|
-
|
|
62
|
-
float currentPixelDepth = linearizeDepth(depth);
|
|
63
|
-
vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth);
|
|
64
|
-
|
|
65
|
-
float sum = 0.0;
|
|
66
|
-
vec3 tapPixelPos;
|
|
67
|
-
|
|
68
|
-
vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0);
|
|
69
|
-
|
|
70
|
-
// note: the factor 2.0 should not be necessary, but makes ssao much nicer.
|
|
71
|
-
// bug or deviation from CE somewhere else?
|
|
72
|
-
float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y);
|
|
73
|
-
|
|
74
|
-
for(int i = 0; i < ${h.H.int(f)}; ++i) {
|
|
75
|
-
vec2 unitOffset = reflect(sphere[i], fres).xy;
|
|
76
|
-
vec2 offset = vec2(-unitOffset * radius * ps);
|
|
77
|
-
|
|
78
|
-
// don't use current or very nearby samples
|
|
79
|
-
if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){
|
|
80
|
-
continue;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
vec2 tc = vec2(gl_FragCoord.xy + offset);
|
|
84
|
-
if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue;
|
|
85
|
-
vec2 tcTap = tc / screenSize;
|
|
86
|
-
float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap);
|
|
87
|
-
|
|
88
|
-
tapPixelPos = reconstructPosition(tc, occluderFragmentDepth);
|
|
89
|
-
|
|
90
|
-
sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// output the result
|
|
94
|
-
float A = max(1.0 - sum * intensity / float(${h.H.int(f)}), 0.0);
|
|
95
|
-
|
|
96
|
-
// Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2
|
|
97
|
-
A = (pow(A, 0.2) + 1.2 * A * A * A * A) / 2.2;
|
|
98
|
-
|
|
99
|
-
fragOcclusion = A;
|
|
100
|
-
`),e}function g(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const _=(0,o.vt)(),x=Object.freeze(Object.defineProperty({__proto__:null,build:v,getRadius:g},Symbol.toStringTag,{value:"Module"}))},15976:(e,t,r)=>{r.d(t,{o:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",2,(r,i,o)=>r.bindTexture(e,t(i,o)))}}},16396:(e,t,r)=>{r.d(t,{ou:()=>l}),r(77690),r(29242),r(58083),r(9093);var i=r(38954),o=r(51850),n=r(94008),a=r(57005);const s=new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,o.vt)(),this._tmpSphere=new n.iy}applyToVertex(e,t,r){const o=this.objectTransform.transform,n=(0,i.h)(c,e,t,r),a=(0,i.p)(n,n,o),s=this.offset/(0,i.b)(a);(0,i.c)(a,a,a,s);const l=this.objectTransform.inverse;return(0,i.p)(this.tmpVertex,a,l),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,i.b)(e);(0,i.c)(e,e,e,r);const o=this.offset/(0,i.b)(t);(0,i.c)(t,t,t,o)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=e.center,r=(0,i.b)(t),o=this.offset/r;return(0,i.c)(this._tmpSphere.center,t,t,o),this._tmpSphere.radius=e.radius+e.radius*this.offset/r,this._tmpSphere}};function l(e){return null!=e?(s.offset=e,s):null}new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,o.vt)(),this._tmpMbs=new n.iy,this._tmpObb=new a.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,i.b)(e)}applyToVertex(e,t,r){const o=(0,i.h)(c,e,t,r),n=(0,i.h)(d,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,i.b)(n);return(0,i.c)(this._tmpVertex,o,n,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,n=e[3],a=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(o),u=Math.abs(n),h=Math.abs(a),m=Math.abs(s),p=.5*(1+Math.sign(r*n))*Math.min(l,u),f=.5*(1+Math.sign(i*a))*Math.min(c,h),v=.5*(1+Math.sign(o*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),w=Math.sqrt(p*p+f*f+v*v),b=Math.sign(l+r),y=Math.sign(c+i),M=Math.sign(d+o),T=Math.sign(u+n),C=Math.sign(h+a),S=Math.sign(m+s),E=this._totalOffset;if(w<E)return e[0]-=(1-b)*E,e[1]-=(1-y)*E,e[2]-=(1-M)*E,e[3]+=T*E,e[4]+=C*E,e[5]+=S*E,e;const A=E/Math.sqrt(g*g+_*_+x*x),I=E/w,R=I-A,F=-R;return e[0]+=r*(b*F+I),e[1]+=i*(y*F+I),e[2]+=o*(M*F+I),e[3]+=n*(T*R+A),e[4]+=a*(C*R+A),e[5]+=s*(S*R+A),e}applyToMbs(e){const t=e.center,r=(0,i.b)(t),o=this._totalOffset/r;return(0,i.c)(this._tmpMbs.center,t,t,o),this._tmpMbs.radius=e.radius+e.radius*this._totalOffset/r,this._tmpMbs}applyToObb(e){return(0,a.gm)(e,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,o.vt)()}applyToVertex(e,t,r){const o=(0,i.h)(c,e,t,r),n=(0,i.i)(d,o,this.localOrigin),a=this.offset/(0,i.b)(n);return(0,i.c)(this.tmpVertex,o,n,a),this.tmpVertex}applyToAabb(e){const t=u,r=h,i=m;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const n=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let o=0;o<3;++o)i[o]=e&1<<o?r[o]:t[o];n(i)}let a=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(a|=1<<e);if(0!==a&&7!==a)for(let e=0;e<8;++e)if(0===(a&e)){for(let o=0;o<3;++o)i[o]=a&1<<o?0:e&1<<o?t[o]:r[o];n(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const c=(0,o.vt)(),d=(0,o.vt)(),u=(0,o.vt)(),h=(0,o.vt)(),m=(0,o.vt)()},16943:(e,t,r)=>{r.d(t,{E:()=>o});var i=r(44208);function o(){return!!(0,i.A)("enable-feature:objectAndLayerId-rendering")}},20304:(e,t,r)=>{r.d(t,{m:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"float",1,(i,o,n)=>i.setUniform1f(e,t(o,n),r))}}},20693:(e,t,r)=>{r.d(t,{yu:()=>m,Nz:()=>_,NB:()=>p,S7:()=>g});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(23205),l=r(40710),c=r(33094),d=r(58029),u=r(74333);class h extends u.n{constructor(e,t,r){super(e,"mat4",2,(i,o,n)=>i.setUniformMatrix4fv(e,t(o,n),r))}}function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",a.uY):e.uniforms.add(new l.W("cameraPosition",(e,t)=>(0,n.h)(v,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2])))}function p(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new d.F("proj",e=>e.camera.projectionMatrix),new h("view",(e,t)=>(0,i.Tl)(f,t.camera.viewMatrix,e.origin)),new l.W("localOrigin",e=>e.origin));const r=({camera:e})=>(0,n.h)(v,e.viewInverseTransposeMatrix[3],e.viewInverseTransposeMatrix[7],e.viewInverseTransposeMatrix[11]);e.uniforms.add(new d.F("proj",e=>e.camera.projectionMatrix),new d.F("view",e=>(0,i.Tl)(f,e.camera.viewMatrix,r(e))),new s.d("localOrigin",e=>r(e)))}const f=(0,o.vt)(),v=(0,a.vt)();function g(e){e.uniforms.add(new d.F("viewNormal",e=>e.camera.viewInverseTransposeMatrix))}function _(e){e.uniforms.add(new c.U("pixelRatio",e=>e.camera.pixelRatio/e.overlayStretch))}},22393:(e,t,r)=>{r.d(t,{c:()=>a});var i=r(31821);function o(e){e.code.add(i.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
|
|
101
|
-
return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
|
|
102
|
-
}`),e.code.add(i.H`float integratedRadiance(float cosTheta2, float roughness) {
|
|
103
|
-
return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
|
|
104
|
-
}`),e.code.add(i.H`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness) {
|
|
105
|
-
float cosTheta2 = 1.0 - RdotNG * RdotNG;
|
|
106
|
-
float intRadTheta = integratedRadiance(cosTheta2, roughness);
|
|
107
|
-
float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
|
|
108
|
-
float sky = 2.0 - ground;
|
|
109
|
-
return (ground * ambientGround + sky * ambientSky) * 0.5;
|
|
110
|
-
}`)}var n=r(89786);function a(e,t){e.include(n.p),1!==t.pbrMode&&2!==t.pbrMode&&5!==t.pbrMode&&6!==t.pbrMode||(e.code.add(i.H`float normalDistribution(float NdotH, float roughness)
|
|
111
|
-
{
|
|
112
|
-
float a = NdotH * roughness;
|
|
113
|
-
float b = roughness / (1.0 - NdotH * NdotH + a * a);
|
|
114
|
-
return b * b * INV_PI;
|
|
115
|
-
}`),e.code.add(i.H`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
|
|
116
|
-
const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040);
|
|
117
|
-
const vec2 c2 = vec2(-1.04, 1.04);
|
|
118
|
-
vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
|
|
119
|
-
vec4 r = roughness * c0 + c1;
|
|
120
|
-
float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
|
|
121
|
-
return c2 * a004 + r.zw;
|
|
122
|
-
}`)),1!==t.pbrMode&&2!==t.pbrMode||(e.include(o),e.code.add(i.H`struct PBRShadingInfo
|
|
123
|
-
{
|
|
124
|
-
float NdotV;
|
|
125
|
-
float LdotH;
|
|
126
|
-
float NdotNG;
|
|
127
|
-
float RdotNG;
|
|
128
|
-
float NdotAmbDir;
|
|
129
|
-
float NdotH_Horizon;
|
|
130
|
-
vec3 skyRadianceToSurface;
|
|
131
|
-
vec3 groundRadianceToSurface;
|
|
132
|
-
vec3 skyIrradianceToSurface;
|
|
133
|
-
vec3 groundIrradianceToSurface;
|
|
134
|
-
float averageAmbientRadiance;
|
|
135
|
-
float ssao;
|
|
136
|
-
vec3 albedoLinear;
|
|
137
|
-
vec3 f0;
|
|
138
|
-
vec3 f90;
|
|
139
|
-
vec3 diffuseColor;
|
|
140
|
-
float metalness;
|
|
141
|
-
float roughness;
|
|
142
|
-
};`),e.code.add(i.H`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
|
|
143
|
-
vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);
|
|
144
|
-
vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);
|
|
145
|
-
vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
|
|
146
|
-
vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
|
|
147
|
-
vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
|
|
148
|
-
vec3 specularComponent = specularColor * indirectSpecular;
|
|
149
|
-
return (diffuseComponent + specularComponent);
|
|
150
|
-
}`))}},23205:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec3",0,(i,o)=>i.setUniform3fv(e,t(o),r))}}},24321:(e,t,r)=>{r.d(t,{v:()=>n});var i=r(43519),o=r(31821);function n(e,t){t.instancedColor?(e.attributes.add("instanceColor","vec4"),e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.vertex.code.add(o.H`
|
|
151
|
-
MaskedColor applyInstanceColor(MaskedColor color) {
|
|
152
|
-
return multiplyMaskedColors( color, createMaskedFromUInt8NaNColor(${"instanceColor"}));
|
|
153
|
-
}
|
|
154
|
-
`)):e.vertex.code.add(o.H`MaskedColor applyInstanceColor(MaskedColor color) {
|
|
155
|
-
return color;
|
|
156
|
-
}`)}},25634:(e,t,r)=>{r.d(t,{m8:()=>s,NV:()=>c});var i=r(97768),o=r(74887);class n{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return 2}}var a=r(65786);class s extends n{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,e=>this._textureNormal=e),this._acquire(e.emissiveTextureId,e=>this._textureEmissive=e),this._acquire(e.occlusionTextureId,e=>this._textureOcclusion=e),this._acquire(e.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){super.dispose(),this._texture=(0,i.Gz)(this._texture),this._textureNormal=(0,i.Gz)(this._textureNormal),this._textureEmissive=(0,i.Gz)(this._textureEmissive),this._textureOcclusion=(0,i.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new c(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,o.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,i.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class l extends a.Y{constructor(e=null){super(),this.textureEmissive=e}}class c extends l{constructor(e,t,r,i,o,n,a){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=o,this.scale=n,this.normalTextureTransformMatrix=a}}},26425:(e,t,r)=>{r.d(t,{u:()=>n});var i=r(33094),o=r(31821);function n({code:e,uniforms:t},r){t.add(new i.U("dpDummy",()=>1)),e.add(o.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
|
|
157
|
-
vec3 hiD = hiA + hiB;
|
|
158
|
-
vec3 loD = loA + loB;
|
|
159
|
-
return dpDummy * hiD + loD;
|
|
160
|
-
}`)}},26857:(e,t,r)=>{r.d(t,{b:()=>s});var i=r(31635),o=r(69622),n=r(91429);let a=class extends o.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,n.MZ)()],a.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,n.MZ)()],a.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),a=(0,i.Cg)([(0,n.$K)("esri.views.3d.support.debugFlags")],a);const s=new a},27950:(e,t,r)=>{r.d(t,{N:()=>n});var i=r(63365),o=r(31821);function n(e){e.include(i.a),e.code.add(o.H`
|
|
161
|
-
vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
|
|
162
|
-
// workaround for artifacts in macOS using Intel Iris Pro
|
|
163
|
-
// see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
|
|
164
|
-
vec3 internalMixed = internalColor * textureColor;
|
|
165
|
-
vec3 allMixed = internalMixed * externalColor;
|
|
166
|
-
|
|
167
|
-
if (mode == ${o.H.int(1)}) {
|
|
168
|
-
return allMixed;
|
|
169
|
-
}
|
|
170
|
-
if (mode == ${o.H.int(2)}) {
|
|
171
|
-
return internalMixed;
|
|
172
|
-
}
|
|
173
|
-
if (mode == ${o.H.int(3)}) {
|
|
174
|
-
return externalColor;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// tint (or something invalid)
|
|
178
|
-
float vIn = rgb2v(internalMixed);
|
|
179
|
-
vec3 hsvTint = rgb2hsv(externalColor);
|
|
180
|
-
vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);
|
|
181
|
-
return hsv2rgb(hsvOut);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
|
|
185
|
-
// workaround for artifacts in macOS using Intel Iris Pro
|
|
186
|
-
// see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
|
|
187
|
-
float internalMixed = internalOpacity * textureOpacity;
|
|
188
|
-
float allMixed = internalMixed * externalOpacity;
|
|
189
|
-
|
|
190
|
-
if (mode == ${o.H.int(2)}) {
|
|
191
|
-
return internalMixed;
|
|
192
|
-
}
|
|
193
|
-
if (mode == ${o.H.int(3)}) {
|
|
194
|
-
return externalOpacity;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// multiply or tint (or something invalid)
|
|
198
|
-
return allMixed;
|
|
199
|
-
}
|
|
200
|
-
`)}},27993:(e,t,r)=>{r.d(t,{F:()=>s});var i=r(91218),o=r(16930),n=r(9762),a=r(65806);function s(e,t,r,o){return!(null==t||null==o||e.length<2)&&((0,i.canProjectWithoutEngine)(t,o)?(0,n.projectBuffer)(e,t,0,r,o,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,a.g)(l,r,o)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:o.A.WGS84,type:"point"}},28421:(e,t,r)=>{r.d(t,{J:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"float",2,(i,o,n)=>i.setUniform1f(e,t(o,n),r))}}},28491:(e,t,r)=>{r.d(t,{D:()=>G,b:()=>U});var i=r(32680),o=r(49255),n=r(76591),a=r(76597),s=r(24321),l=r(72722),c=r(43519),d=r(96336),u=r(71955),h=r(53466),m=r(92700),p=r(72824),f=r(35640),v=r(40261),g=r(77695),_=r(14527),x=r(89390),w=r(98619),b=r(62602),y=r(22393),M=r(59469),T=r(32482),C=r(96598),S=r(51406),E=r(42398),A=r(58614),I=r(27950),R=r(20693),F=r(33079),O=r(71988),P=r(20304),D=r(31821),H=r(63761),N=r(10906),z=r(43616),L=r(51255),B=r(14113),V=r(49788);function U(e){const t=new B.N5,{attributes:r,vertex:U,fragment:G,varyings:j}=t,{output:W,normalType:k,offsetBackfaces:$,spherical:Z,snowCover:q,pbrMode:Y,textureAlphaPremultiplied:X,instancedDoublePrecision:K,hasVertexColors:J,hasVertexTangents:Q,hasColorTexture:ee,hasNormalTexture:te,hasNormalTextureTransform:re,hasColorTextureTransform:ie}=e;if((0,R.NB)(U,e),r.add("position","vec3"),j.add("vpos","vec3",{invariant:!0}),t.include(E.A,e),t.include(l.B,e),t.include(f.Ge,e),t.include(S.q2,e),!(0,o._o)(W))return t.include(v.E,e),t;t.include(S.Sx,e),t.include(S.MU,e),t.include(S.O1,e),t.include(S.QM,e),(0,R.yu)(U,e),t.include(d.Y,e),t.include(a.d);const oe=0===k||1===k;return oe&&$&&t.include(i.M),t.include(g.W,e),t.include(p.Mh,e),t.include(s.v,e),j.add("vPositionLocal","vec3"),t.include(h.U,e),t.include(u.K,e),t.include(m.c,e),U.uniforms.add(new O.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),j.add("vcolorExt","vec4"),t.include(C.Z,e),U.include(c.WD),U.include(c.oF),t.include(K?T.G:T.Bz,e),U.main.add(D.H`
|
|
201
|
-
forwardNormalizedVertexColor();
|
|
202
|
-
|
|
203
|
-
MaskedColor maskedColor =
|
|
204
|
-
applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
|
|
205
|
-
|
|
206
|
-
vcolorExt = maskedColor.color;
|
|
207
|
-
forwardColorMixMode(maskedColor.mask);
|
|
208
|
-
|
|
209
|
-
vpos = getVertexInLocalOriginSpace();
|
|
210
|
-
vPositionLocal = vpos - view[3].xyz;
|
|
211
|
-
vpos = subtractOrigin(vpos);
|
|
212
|
-
${(0,D.If)(oe,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
|
|
213
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
214
|
-
${(0,D.If)(Q,"vTangent = dpTransformVertexTangent(tangent);")}
|
|
215
|
-
gl_Position = transformPosition(proj, view, vpos);
|
|
216
|
-
${(0,D.If)(oe&&$,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
|
|
217
|
-
|
|
218
|
-
forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
|
|
219
|
-
forwardTextureCoordinates();
|
|
220
|
-
forwardColorUV();
|
|
221
|
-
forwardNormalUV();
|
|
222
|
-
forwardEmissiveUV();
|
|
223
|
-
forwardOcclusionUV();
|
|
224
|
-
forwardMetallicRoughnessUV();
|
|
225
|
-
|
|
226
|
-
if (opacityMixMode != ${D.H.int(z.Um.ignore)} && vcolorExt.a < ${D.H.float(V.Q)}) {
|
|
227
|
-
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
228
|
-
}
|
|
229
|
-
forwardLinearDepthToReadShadowMap();
|
|
230
|
-
`),G.include(x.kA,e),G.include(_.n,e),t.include(A.S,e),G.include(n.HQ,e),t.include(L.D,e),(0,R.yu)(G,e),G.uniforms.add(U.uniforms.get("localOrigin"),new F.t("ambient",e=>e.ambient),new F.t("diffuse",e=>e.diffuse),new P.m("opacity",e=>e.opacity),new P.m("layerOpacity",e=>e.layerOpacity)),ee&&G.uniforms.add(new H.N("tex",e=>e.texture)),t.include(M._,e),G.include(y.c,e),G.include(I.N),t.include(b.r,e),G.include(N.b,e),(0,x.a8)(G),(0,x.eU)(G),(0,w.O4)(G),G.main.add(D.H`
|
|
231
|
-
discardBySlice(vpos);
|
|
232
|
-
discardByTerrainDepth();
|
|
233
|
-
${ee?D.H`
|
|
234
|
-
vec4 texColor = texture(tex, ${ie?"colorUV":"vuv0"});
|
|
235
|
-
${(0,D.If)(X,"texColor.rgb /= texColor.a;")}
|
|
236
|
-
discardOrAdjustAlpha(texColor);`:D.H`vec4 texColor = vec4(1.0);`}
|
|
237
|
-
shadingParams.viewDirection = normalize(vpos - cameraPosition);
|
|
238
|
-
${2===k?D.H`vec3 normal = screenDerivativeNormal(vPositionLocal);`:D.H`shadingParams.normalView = vNormalWorld;
|
|
239
|
-
vec3 normal = shadingNormal(shadingParams);`}
|
|
240
|
-
applyPBRFactors();
|
|
241
|
-
float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
|
|
242
|
-
|
|
243
|
-
vec3 posWorld = vpos + localOrigin;
|
|
244
|
-
|
|
245
|
-
float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
|
|
246
|
-
float shadow = readShadow(additionalAmbientScale, vpos);
|
|
247
|
-
|
|
248
|
-
vec3 matColor = max(ambient, diffuse);
|
|
249
|
-
vec3 albedo = mixExternalColor(${(0,D.If)(J,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
|
|
250
|
-
float opacity_ = layerOpacity * mixExternalOpacity(${(0,D.If)(J,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, opacityMixMode);
|
|
251
|
-
|
|
252
|
-
${te?`mat3 tangentSpace = computeTangentSpace(${Q?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${re?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
|
|
253
|
-
vec3 normalGround = ${Z?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
|
|
254
|
-
|
|
255
|
-
${(0,D.If)(q,D.H`
|
|
256
|
-
float snow = getSnow(normal, normalGround);
|
|
257
|
-
albedo = mix(albedo, vec3(1), snow);
|
|
258
|
-
shadingNormal = mix(shadingNormal, normal, snow);
|
|
259
|
-
ssao = mix(ssao, 1.0, snow);`)}
|
|
260
|
-
|
|
261
|
-
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
|
|
262
|
-
|
|
263
|
-
${1===Y||2===Y?D.H`
|
|
264
|
-
float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
265
|
-
${(0,D.If)(q,"mrr = applySnowToMRR(mrr, snow);")}
|
|
266
|
-
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, additionalAmbientIrradiance);`:D.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
267
|
-
vec4 finalColor = vec4(shadedColor, opacity_);
|
|
268
|
-
outputColorHighlightOLID(finalColor, vpos, albedo ${(0,D.If)(q,", snow")});
|
|
269
|
-
`),t}const G=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(15142),o=r(38954),n=r(51850),a=r(620);class s{get center(){return(0,n.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,n.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,n.fA)(this._data[7],this._data[8],this._data[9])}constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:c}=r;(0,a.vA)(c.length%this._numIndexPerPrimitive===0),(0,a.vA)(c.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*c[this._numIndexPerPrimitive*e[0]];l.clear(),l.push(u);const h=(0,n.fA)(i[u],i[u+1],i[u+2]),m=(0,n.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*c[r+e],l.push(u);let t=i[u];h[0]=Math.min(t,h[0]),m[0]=Math.max(t,m[0]),t=i[u+1],h[1]=Math.min(t,h[1]),m[1]=Math.max(t,m[1]),t=i[u+2],h[2]=Math.min(t,h[2]),m[2]=Math.max(t,m[2])}}for(let e=0;e<3;++e)this._data[4+e]=h[e],this._data[7+e]=m[e];const p=(0,o.l)((0,n.vt)(),this.bbMin,this.bbMax,.5);let f=.5*Math.max(Math.max(m[0]-h[0],m[1]-h[1]),m[2]-h[2]),v=f*f;for(let e=0;e<l.length;++e){u=l.at(e);const t=i[u]-p[0],r=i[u+1]-p[1],o=i[u+2]-p[2],n=t*t+r*r+o*o;if(n<=v)continue;const a=Math.sqrt(n),s=.5*(a-f);f+=s,v=f*f;const c=s/a;p[0]+=t*c,p[1]+=r*c,p[2]+=o*c}this._data[3]=f;for(let e=0;e<3;++e)this._data[0+e]=p[e];l.clear()}getChildren(){if(this._children||(0,o.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,o.l)((0,n.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:l,indices:c}=this.position;for(let o=0;o<t;++o){let t=0;const n=this._numIndexPerPrimitive*this.primitiveIndices[o];let s=l*c[n],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=l*c[n+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[o]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){l.prune()}}const l=new i.A({deallocator:null})},31217:(e,t,r)=>{r.d(t,{D:()=>o});var i=r(11254);async function o(e,t){return(await(0,i.A)(e,{responseType:"image",...t})).data}},31821:(e,t,r)=>{r.d(t,{H:()=>i,If:()=>o});const i=(e,...t)=>{let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r};function o(e,t,r=""){return e?t:r}i.int=e=>Math.round(e).toString(),i.float=e=>e.toPrecision(8)},32482:(e,t,r)=>{r.d(t,{Bz:()=>w,G:()=>x}),r(51850);var i=r(46686),o=r(49255),n=r(31821);function a(e,t){const r=(0,o._o)(t.output)&&t.receiveShadows;r&&(0,i.o)(e,!0),e.vertex.code.add(n.H`
|
|
270
|
-
void forwardLinearDepthToReadShadowMap() { ${(0,n.If)(r,"forwardLinearDepth(gl_Position.w);")} }
|
|
271
|
-
`)}var s=r(14314),l=r(35818),c=r(74333);class d extends c.n{constructor(e,t,r,i){super(e,"mat4",2,(r,o,n,a)=>r.setUniformMatrices4fv(e,t(o,n,a),i),r)}}class u extends c.n{constructor(e,t,r,i){super(e,"mat4",1,(r,o,n)=>r.setUniformMatrices4fv(e,t(o,n),i),r)}}var h=r(65786);function m(e){e.fragment.uniforms.add(new u("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),f(e)}function p(e){e.fragment.uniforms.add(new d("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),f(e)}function f(e){const{fragment:t}=e;t.uniforms.add(new s.I("cascadeDistances",e=>e.shadowMap.cascadeDistances),new l.W("numCascades",e=>e.shadowMap.numCascades)),t.code.add(n.H`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
|
|
272
|
-
vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
|
|
273
|
-
vec4 lv = mat * vec4(_vpos, 1.0);
|
|
274
|
-
lv.xy /= lv.w;
|
|
275
|
-
return 0.5 * lv.xyz + vec3(0.5);
|
|
276
|
-
}
|
|
277
|
-
vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) {
|
|
278
|
-
float xScale = float(textureSize.y) / float(textureSize.x);
|
|
279
|
-
return vec2((float(i) + lvpos.x) * xScale, lvpos.y);
|
|
280
|
-
}
|
|
281
|
-
vec3 calculateUVZShadow(in vec3 _worldPos, in float _linearDepth, in ivec2 shadowMapSize) {
|
|
282
|
-
int i = _linearDepth < cascadeDistances[1] ? 0 : _linearDepth < cascadeDistances[2] ? 1 : _linearDepth < cascadeDistances[3] ? 2 : 3;
|
|
283
|
-
if (i >= numCascades) {
|
|
284
|
-
return invalidShadowmapUVZ;
|
|
285
|
-
}
|
|
286
|
-
mat4 shadowMatrix = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
|
|
287
|
-
vec3 lvpos = lightSpacePosition(_worldPos, shadowMatrix);
|
|
288
|
-
if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) {
|
|
289
|
-
return invalidShadowmapUVZ;
|
|
290
|
-
}
|
|
291
|
-
vec2 uvShadow = cascadeCoordinates(i, shadowMapSize, lvpos);
|
|
292
|
-
return vec3(uvShadow, lvpos.z);
|
|
293
|
-
}`)}function v(e){e.fragment.code.add(n.H`float readShadowMapUVZ(vec3 uvzShadow, sampler2DShadow _shadowMap) {
|
|
294
|
-
return texture(_shadowMap, uvzShadow);
|
|
295
|
-
}`)}h.Y;var g=r(33094);class _ extends c.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,i)=>r.bindTexture(e,t(i)))}}function x(e,t){t.receiveShadows&&e.include(m),b(e,t)}function w(e,t){t.receiveShadows&&e.include(p),b(e,t)}function b(e,t){e.fragment.uniforms.add(new g.U("lightingGlobalFactor",e=>e.lighting.globalFactor));const{receiveShadows:r,spherical:i}=t;e.include(a,t),r&&y(e),e.fragment.code.add(n.H`
|
|
296
|
-
float readShadow(float additionalAmbientScale, vec3 vpos) {
|
|
297
|
-
return ${r?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,n.If)(i,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
|
|
298
|
-
}
|
|
299
|
-
`)}function y(e){e.include(v),e.fragment.uniforms.add(new _("shadowMap",({shadowMap:e})=>e.depthTexture)).code.add(n.H`float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
|
|
300
|
-
vec3 uvzShadow = calculateUVZShadow(_worldPos, _linearDepth, textureSize(shadowMap,0));
|
|
301
|
-
if (uvzShadow.z < 0.0) {
|
|
302
|
-
return 0.0;
|
|
303
|
-
}
|
|
304
|
-
return readShadowMapUVZ(uvzShadow, shadowMap);
|
|
305
|
-
}`)}h.Y},32680:(e,t,r)=>{r.d(t,{M:()=>o});var i=r(31821);function o(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
|
|
306
|
-
vec3 camToVert = posWorld - camPosWorld;
|
|
307
|
-
bool isBackface = dot(camToVert, normalWorld) > 0.0;
|
|
308
|
-
if (isBackface) {
|
|
309
|
-
posClip.z += 0.0000003 * posClip.w;
|
|
310
|
-
}
|
|
311
|
-
return posClip;
|
|
312
|
-
}`)}},32976:(e,t,r)=>{r.d(t,{o:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"bool",0,(r,i)=>r.setUniform1b(e,t(i)))}}},33079:(e,t,r)=>{r.d(t,{t:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec3",1,(i,o,n)=>i.setUniform3fv(e,t(o,n),r))}}},33094:(e,t,r)=>{r.d(t,{U:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"float",0,(i,o)=>i.setUniform1f(e,t(o),r))}}},33120:(e,t,r)=>{r.d(t,{i$:()=>a,xJ:()=>n}),r(46686),r(33752);var i=r(77108),o=r(31821);function n(e){e.vertex.uniforms.add(new i.E("nearFar",e=>e.camera.nearFar))}function a(e){e.vertex.code.add(o.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
313
|
-
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
314
|
-
}`)}},33524:(e,t,r)=>{r.d(t,{Sv:()=>u,Yf:()=>a,mE:()=>d,mt:()=>l,z5:()=>s});var i=r(63907),o=r(90644);const n=(0,o.p3)(1,0,1,771);function a(e,t=!1){switch(e){case 0:return t?o.RC:o.T8;case 1:return n;case 2:case 3:return null}}function s(e){if(e.draped)return null;switch(e.oitPass){case 0:case 2:return e.writeDepth?o.Uy:null;case 1:case 3:return null}}function l(e,t=513){return{func:0===e||2===e?t:515}}const c={factor:-1,units:-2};function d({oitPass:e,enableOffset:t}){return t&&1===e?c:null}function u(e,t){return 1===e?t?{buffers:[i.r6,i.yI,i.Fq]}:{buffers:[i.r6,i.yI]}:t?{buffers:[i.r6,i.yI]}:null}},33752:(e,t,r)=>{r.d(t,{EM:()=>s,dO:()=>a});var i=r(29242),o=r(51850),n=(r(26425),r(40710),r(33079),r(31821),r(98353),r(35644),r(58029),r(65786));class a extends n.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,o.vt)(),this.transformWorldFromViewTL=(0,o.vt)(),this.transformViewFromCameraRelativeRS=(0,i.vt)()}}class s extends n.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.vt)(),this.transformWorldFromModelTH=(0,o.vt)(),this.transformWorldFromModelTL=(0,o.vt)()}}},34845:(e,t,r)=>{r.d(t,{Ir:()=>d});var i=r(37585),o=r(48163),n=r(87317),a=r(91829),s=r(77108),l=r(14314),c=r(31821);function d(e){e.fragment.uniforms.add(new l.I("projInfo",e=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,n.c)(u,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,n.c)(u,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(e.camera))),e.fragment.uniforms.add(new s.E("zScale",e=>0===e.camera.projectionMatrix[11]?(0,i.hZ)(h,0,1):(0,i.hZ)(h,1,0))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
|
|
315
|
-
return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
|
|
316
|
-
}`)}const u=(0,a.vt)(),h=(0,o.vt)()},35640:(e,t,r)=>{r.d(t,{Ge:()=>c,VQ:()=>u});var i=r(87317),o=r(91829),n=r(52587),a=r(20693),s=r(71988),l=r(31821);function c(e,t){const r=e.vertex;t.hasVerticalOffset?(u(r),t.hasScreenSizePerspective&&(e.include(n.Y6),(0,n.OH)(r),(0,a.yu)(e.vertex,t)),r.code.add(l.H`
|
|
317
|
-
vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
|
|
318
|
-
float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
|
|
319
|
-
${t.spherical?l.H`vec3 worldNormal = normalize(worldPos + localOrigin);`:l.H`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
|
|
320
|
-
${t.hasScreenSizePerspective?l.H`
|
|
321
|
-
float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
|
|
322
|
-
float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:l.H`
|
|
323
|
-
float verticalOffsetScreenHeight = verticalOffset.x;`}
|
|
324
|
-
// Screen sized offset in world space, used for example for line callouts
|
|
325
|
-
float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
|
|
326
|
-
return worldNormal * worldOffset;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
|
|
330
|
-
return worldPos + calculateVerticalOffset(worldPos, localOrigin);
|
|
331
|
-
}
|
|
332
|
-
`)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const d=(0,o.vt)();function u(e){e.uniforms.add(new s.E("verticalOffset",(e,t)=>{const{minWorldLength:r,maxWorldLength:o,screenLength:n}=e.verticalOffset,a=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,i.c)(d,n*s,a,r,o)}))}},35644:(e,t,r)=>{r.d(t,{k:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"mat3",1,(i,o,n)=>i.setUniformMatrix3fv(e,t(o,n),r))}}},35818:(e,t,r)=>{r.d(t,{W:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"int",0,(r,i)=>r.setUniform1i(e,t(i)))}}},36782:(e,t,r)=>{r.d(t,{g:()=>o});var i=r(31821);function o(e,t){if(9!==t.output)return e.vertex.code.add(i.H`void forwardObjectAndLayerIdColor() {}`),void e.fragment.code.add(i.H`void outputObjectAndLayerIdColor() {}`);const r=t.instanced;e.varyings.add("objectAndLayerIdColorVarying","vec4");const o=r?"instanceOlidColor":"olidColor";e.attributes.add(o,"vec4"),e.vertex.code.add(i.H`
|
|
333
|
-
void forwardObjectAndLayerIdColor() {
|
|
334
|
-
objectAndLayerIdColorVarying = ${o} * 0.003921568627451;
|
|
335
|
-
}`),e.fragment.code.add(i.H`void outputObjectAndLayerIdColor() {
|
|
336
|
-
fragColor = objectAndLayerIdColorVarying;
|
|
337
|
-
}`)}},38969:(e,t,r)=>{r.d(t,{i:()=>o});var i=r(37955);function o(e,t){return new Promise((r,o)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",o)))})}},40261:(e,t,r)=>{r.d(t,{E:()=>g});var i=r(33120),o=r(76591),n=r(76597),a=r(96336),s=r(36782),l=r(53466),c=r(72824),d=r(31821);function u(e,t){switch(t.output){case 3:case 4:case 5:case 6:e.fragment.code.add(d.H`float _calculateFragDepth(const in float depth) {
|
|
338
|
-
const float SLOPE_SCALE = 2.0;
|
|
339
|
-
const float BIAS = 20.0 * .000015259;
|
|
340
|
-
float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
|
|
341
|
-
return depth + SLOPE_SCALE * m + BIAS;
|
|
342
|
-
}
|
|
343
|
-
void outputDepth(float _linearDepth){
|
|
344
|
-
float fragDepth = _calculateFragDepth(_linearDepth);
|
|
345
|
-
gl_FragDepth = fragDepth;
|
|
346
|
-
}`);break;case 7:e.fragment.code.add(d.H`void outputDepth(float _linearDepth){
|
|
347
|
-
gl_FragDepth = _linearDepth;
|
|
348
|
-
}`)}}var h=r(42593),m=r(42398),p=r(58614),f=r(20693),v=r(63761);function g(e,t){const{vertex:r,fragment:g,varyings:_}=e,{hasColorTexture:x,alphaDiscardMode:w}=t,b=x&&1!==w,{output:y,normalType:M,hasColorTextureTransform:T}=t;switch(y){case 1:(0,f.NB)(r,t),e.include(n.d),g.include(o.HQ,t),e.include(l.U,t),b&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
|
|
349
|
-
vpos = subtractOrigin(vpos);
|
|
350
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
351
|
-
gl_Position = transformPosition(proj, view, vpos);
|
|
352
|
-
forwardTextureCoordinates();`),e.include(p.S,t),g.main.add(d.H`
|
|
353
|
-
discardBySlice(vpos);
|
|
354
|
-
${(0,d.If)(b,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
355
|
-
discardOrAdjustAlpha(texColor);`)}`);break;case 3:case 4:case 5:case 6:case 9:(0,f.NB)(r,t),e.include(n.d),e.include(l.U,t),e.include(m.A,t),e.include(u,t),g.include(o.HQ,t),e.include(s.g,t),(0,i.xJ)(e),_.add("depth","float",{invariant:!0}),b&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
|
|
356
|
-
vpos = subtractOrigin(vpos);
|
|
357
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
358
|
-
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
|
|
359
|
-
forwardTextureCoordinates();
|
|
360
|
-
forwardObjectAndLayerIdColor();`),e.include(p.S,t),g.main.add(d.H`
|
|
361
|
-
discardBySlice(vpos);
|
|
362
|
-
${(0,d.If)(b,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
363
|
-
discardOrAdjustAlpha(texColor);`)}
|
|
364
|
-
${9===y?d.H`outputObjectAndLayerIdColor();`:d.H`outputDepth(depth);`}`);break;case 2:{(0,f.NB)(r,t),e.include(n.d),e.include(a.Y,t),e.include(c.Mh,t),e.include(l.U,t),e.include(m.A,t),b&&g.uniforms.add(new v.N("tex",e=>e.texture)),2===M&&_.add("vPositionView","vec3",{invariant:!0});const i=0===M||1===M;r.main.add(d.H`
|
|
365
|
-
vpos = getVertexInLocalOriginSpace();
|
|
366
|
-
${i?d.H`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:d.H`vPositionView = (view * vec4(vpos, 1.0)).xyz;`}
|
|
367
|
-
vpos = subtractOrigin(vpos);
|
|
368
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
369
|
-
gl_Position = transformPosition(proj, view, vpos);
|
|
370
|
-
forwardTextureCoordinates();`),g.include(o.HQ,t),e.include(p.S,t),g.main.add(d.H`
|
|
371
|
-
discardBySlice(vpos);
|
|
372
|
-
${(0,d.If)(b,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
373
|
-
discardOrAdjustAlpha(texColor);`)}
|
|
374
|
-
|
|
375
|
-
${2===M?d.H`vec3 normal = screenDerivativeNormal(vPositionView);`:d.H`vec3 normal = normalize(vNormalWorld);
|
|
376
|
-
if (gl_FrontFacing == false){
|
|
377
|
-
normal = -normal;
|
|
378
|
-
}`}
|
|
379
|
-
fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case 8:(0,f.NB)(r,t),e.include(n.d),e.include(l.U,t),e.include(m.A,t),b&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(d.H`vpos = getVertexInLocalOriginSpace();
|
|
380
|
-
vpos = subtractOrigin(vpos);
|
|
381
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
382
|
-
gl_Position = transformPosition(proj, view, vpos);
|
|
383
|
-
forwardTextureCoordinates();`),g.include(o.HQ,t),e.include(p.S,t),e.include(h.Q,t),g.main.add(d.H`
|
|
384
|
-
discardBySlice(vpos);
|
|
385
|
-
${(0,d.If)(b,d.H`vec4 texColor = texture(tex, ${T?"colorUV":"vuv0"});
|
|
386
|
-
discardOrAdjustAlpha(texColor);`)}
|
|
387
|
-
calculateOcclusionAndOutputHighlight();`)}}},40710:(e,t,r)=>{r.d(t,{W:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec3",2,(i,o,n,a)=>i.setUniform3fv(e,t(o,n,a),r))}}},42293:(e,t,r)=>{r.d(t,{MW:()=>n,wH:()=>o}),r(44208),r(94656);var i=r(63907);function o(e){switch(e){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function n(e){switch(e){case 6406:case 6409:case 6403:case 36244:case i.H0.R8:case i.H0.R8I:case i.H0.R8UI:case i.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case i.H0.RGBA4:case i.H0.R16F:case i.H0.R16I:case i.H0.R16UI:case i.H0.RG8:case i.H0.RG8I:case i.H0.RG8UI:case i.H0.RG8_SNORM:case i.H0.RGB565:case i.H0.RGB5_A1:case i.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case i.H0.RGB8:case i.H0.RGB8I:case i.H0.RGB8UI:case i.H0.RGB8_SNORM:case i.H0.SRGB8:case i.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case i.H0.RGBA8:case i.H0.R32F:case i.H0.R11F_G11F_B10F:case i.H0.RG16F:case i.H0.R32I:case i.H0.R32UI:case i.H0.RG16I:case i.H0.RG16UI:case i.H0.RGBA8I:case i.H0.RGBA8UI:case i.H0.RGBA8_SNORM:case i.H0.SRGB8_ALPHA8:case i.H0.RGB9_E5:case i.H0.RGB10_A2UI:case i.H0.RGB10_A2:case i.SB.DEPTH_COMPONENT32F:case i.iE.DEPTH24_STENCIL8:return 4;case i.iE.DEPTH32F_STENCIL8:return 5;case i.H0.RGB16F:case i.H0.RGB16I:case i.H0.RGB16UI:return 6;case i.H0.RG32F:case i.H0.RG32I:case i.H0.RG32UI:case i.H0.RGBA16F:case i.H0.RGBA16I:case i.H0.RGBA16UI:return 8;case i.H0.RGB32F:case i.H0.RGB32I:case i.H0.RGB32UI:return 12;case i.H0.RGBA32F:case i.H0.RGBA32I:case i.H0.RGBA32UI:return 16;case i.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.CQ.COMPRESSED_R11_EAC:case i.CQ.COMPRESSED_SIGNED_R11_EAC:case i.CQ.COMPRESSED_RGB8_ETC2:case i.CQ.COMPRESSED_SRGB8_ETC2:case i.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.CQ.COMPRESSED_RG11_EAC:case i.CQ.COMPRESSED_SIGNED_RG11_EAC:case i.CQ.COMPRESSED_RGBA8_ETC2_EAC:case i.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}new Set([i.pe.BYTE,i.pe.SHORT,i.pe.INT,i.pe.UNSIGNED_BYTE,i.pe.UNSIGNED_SHORT,i.pe.UNSIGNED_INT])},42398:(e,t,r)=>{r.d(t,{A:()=>h});var i=r(43519),o=r(33079),n=r(71988),a=r(74333);class s extends a.n{constructor(e,t,r,i){super(e,"vec4",1,(r,o,n)=>r.setUniform4fv(e,t(o,n),i),r)}}class l extends a.n{constructor(e,t,r,i){super(e,"float",1,(r,o,n)=>r.setUniform1fv(e,t(o,n),i),r)}}var c=r(31821),d=r(35644);r(78662).Gd;const u=8;function h(e,t){const{vertex:r,attributes:a}=e;t.hasVVInstancing&&(t.hasVVSize||t.hasVVColor)&&a.add("instanceFeatureAttribute","vec4"),t.hasVVSize?(r.uniforms.add(new o.t("vvSizeMinSize",e=>e.vvSize.minSize)),r.uniforms.add(new o.t("vvSizeMaxSize",e=>e.vvSize.maxSize)),r.uniforms.add(new o.t("vvSizeOffset",e=>e.vvSize.offset)),r.uniforms.add(new o.t("vvSizeFactor",e=>e.vvSize.factor)),r.uniforms.add(new o.t("vvSizeFallback",e=>e.vvSize.fallback)),r.uniforms.add(new d.k("vvSymbolRotationMatrix",e=>e.vvSymbolRotationMatrix)),r.uniforms.add(new o.t("vvSymbolAnchor",e=>e.vvSymbolAnchor)),r.code.add(c.H`vec3 vvScale(vec4 _featureAttribute) {
|
|
388
|
-
if (isnan(_featureAttribute.x)) {
|
|
389
|
-
return vvSizeFallback;
|
|
390
|
-
}
|
|
391
|
-
return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
|
|
392
|
-
}
|
|
393
|
-
vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
|
|
394
|
-
return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
|
|
395
|
-
}`),r.code.add(c.H`
|
|
396
|
-
const float eps = 1.192092896e-07;
|
|
397
|
-
vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
|
|
398
|
-
vec3 scale = max(vvScale(_featureAttribute), eps);
|
|
399
|
-
return vec4(vvSymbolRotationMatrix * _normal / scale, 1.0);
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
${t.hasVVInstancing?c.H`
|
|
403
|
-
vec4 vvLocalNormal(vec3 _normal) {
|
|
404
|
-
return vvTransformNormal(_normal, instanceFeatureAttribute);
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
vec4 localPosition() {
|
|
408
|
-
return vvTransformPosition(position, instanceFeatureAttribute);
|
|
409
|
-
}`:""}
|
|
410
|
-
`)):r.code.add(c.H`vec4 localPosition() { return vec4(position, 1.0); }
|
|
411
|
-
vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),e.vertex.include(i.WD),t.hasVVColor?(r.constants.add("vvColorNumber","int",u),r.uniforms.add(new l("vvColorValues",e=>e.vvColor.values,u),new s("vvColorColors",e=>e.vvColor.colors,u),new n.E("vvColorFallback",e=>e.vvColor.fallback,{supportsNaN:!0})),t.hasVVInstancing&&(e.vertex.include(i.ML),e.vertex.include(i.oF)),r.code.add(c.H`
|
|
412
|
-
vec4 interpolateVVColor(float value) {
|
|
413
|
-
if (isnan(value)) {
|
|
414
|
-
return vvColorFallback;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
if (value <= vvColorValues[0]) {
|
|
418
|
-
return vvColorColors[0];
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
for (int i = 1; i < vvColorNumber; ++i) {
|
|
422
|
-
if (vvColorValues[i] >= value) {
|
|
423
|
-
float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
|
|
424
|
-
return mix(vvColorColors[i-1], vvColorColors[i], f);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
return vvColorColors[vvColorNumber - 1];
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
vec4 vvGetColor(vec4 featureAttribute) {
|
|
431
|
-
return interpolateVVColor(featureAttribute.y);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
${t.hasVVInstancing?c.H`
|
|
435
|
-
vec4 vvColor() {
|
|
436
|
-
return vvGetColor(instanceFeatureAttribute);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
MaskedColor applyVVColor(MaskedColor color) {
|
|
440
|
-
return multiplyMaskedColors(color, createMaskedFromNaNColor(vvColor()));
|
|
441
|
-
}
|
|
442
|
-
`:c.H`
|
|
443
|
-
vec4 vvColor() {
|
|
444
|
-
return vec4(1.0);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
MaskedColor applyVVColor(MaskedColor color) {
|
|
448
|
-
return color;
|
|
449
|
-
}
|
|
450
|
-
`}
|
|
451
|
-
`)):r.code.add(c.H`vec4 vvColor() {
|
|
452
|
-
return vec4(1.0);
|
|
453
|
-
}
|
|
454
|
-
MaskedColor applyVVColor(MaskedColor color) {
|
|
455
|
-
return color;
|
|
456
|
-
}`)}},42593:(e,t,r)=>{r.d(t,{Q:()=>d});var i=r(31821);function o(e){const{fragment:t}=e;t.code.add(i.H`uint readChannelBits(uint channel, int highlightLevel) {
|
|
457
|
-
int llc = (highlightLevel & 3) << 1;
|
|
458
|
-
return (channel >> llc) & 3u;
|
|
459
|
-
}
|
|
460
|
-
uint readChannel(uvec2 texel, int highlightLevel) {
|
|
461
|
-
int lic = (highlightLevel >> 2) & 1;
|
|
462
|
-
return texel[lic];
|
|
463
|
-
}
|
|
464
|
-
uint readLevelBits(uvec2 texel, int highlightLevel) {
|
|
465
|
-
return readChannelBits(readChannel(texel, highlightLevel), highlightLevel);
|
|
466
|
-
}`)}var n=r(74333);class a extends n.n{constructor(e,t){super(e,"ivec2",0,(r,i)=>r.setUniform2iv(e,t(i)))}}var s=r(35818),l=r(12791);class c extends n.n{constructor(e,t){super(e,"usampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}function d(e,t){const{fragment:r}=e,{output:n,draped:d,hasHighlightMixTexture:u}=t;8===n?(r.uniforms.add(new s.W("highlightLevel",e=>e.highlightLevel??0),new a("highlightMixOrigin",e=>e.highlightMixOrigin)),e.outputs.add("fragHighlight","uvec2",0),e.include(o),u?r.uniforms.add(new c("highlightMixTexture",e=>e.highlightMixTexture)).code.add(i.H`uvec2 getAccumulatedHighlight() {
|
|
467
|
-
return texelFetch(highlightMixTexture, ivec2(gl_FragCoord.xy) - highlightMixOrigin, 0).rg;
|
|
468
|
-
}
|
|
469
|
-
void outputHighlight(bool occluded) {
|
|
470
|
-
if (highlightLevel == 0) {
|
|
471
|
-
uint bits = occluded ? 3u : 1u;
|
|
472
|
-
fragHighlight = uvec2(bits, 0);
|
|
473
|
-
} else {
|
|
474
|
-
int ll = (highlightLevel & 3) << 1;
|
|
475
|
-
int li = (highlightLevel >> 2) & 3;
|
|
476
|
-
uint bits;
|
|
477
|
-
if (occluded) {
|
|
478
|
-
bits = 3u << ll;
|
|
479
|
-
} else {
|
|
480
|
-
bits = 1u << ll;
|
|
481
|
-
}
|
|
482
|
-
uvec2 combinedHighlight = getAccumulatedHighlight();
|
|
483
|
-
combinedHighlight[li] |= bits;
|
|
484
|
-
fragHighlight = combinedHighlight;
|
|
485
|
-
}
|
|
486
|
-
}`):r.code.add(i.H`void outputHighlight(bool occluded) {
|
|
487
|
-
uint bits = occluded ? 3u : 1u;
|
|
488
|
-
fragHighlight = uvec2(bits, 0);
|
|
489
|
-
}`),d?r.code.add(i.H`bool isHighlightOccluded() {
|
|
490
|
-
return false;
|
|
491
|
-
}`):r.uniforms.add(new l.x("depthTexture",e=>e.mainDepth)).code.add(i.H`bool isHighlightOccluded() {
|
|
492
|
-
float sceneDepth = texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x;
|
|
493
|
-
return gl_FragCoord.z > sceneDepth + 5e-7;
|
|
494
|
-
}`),r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {
|
|
495
|
-
outputHighlight(isHighlightOccluded());
|
|
496
|
-
}`)):r.code.add(i.H`void calculateOcclusionAndOutputHighlight() {}`)}},42958:(e,t,r)=>{r.d(t,{w:()=>_,L:()=>x});var i=r(31635),o=r(69622),n=r(53966),a=r(97768),s=r(91429),l=r(49255),c=r(63907),d=r(85079),u=r(74038);const h=[new u._("position",3,c.pe.FLOAT,0,12)],m=[new u._("position",2,c.pe.FLOAT,0,8)],p=(0,d.Xk)(m);(0,d.Xk)(h),new u._("position",2,c.pe.FLOAT,0,12),new u._("uv0",2,c.pe.HALF_FLOAT,8,12),new u._("position",2,c.pe.FLOAT,0,16),new u._("uv0",2,c.pe.FLOAT,8,16),r(44208);var f=r(94656);class v{constructor(e,t,r){this._context=e,this.locations=r,this._textures=new Map,this.source=(0,f.en)()?t:null,t.attributeNames.forEach(e=>{r.has(e)||console.error(`Missing VertexAttributeLocation for ${e} used in shader`)}),this._glProgram=e.programCache.acquire(t.generate("vertex",!0),t.generate("fragment",!0),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=t.generateBind(this),this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this)}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t,r){this._glProgram.setUniform1f(e,t,r)}setUniform2fv(e,t,r){this._glProgram.setUniform2fv(e,t,r)}setUniform3fv(e,t,r){this._glProgram.setUniform3fv(e,t,r)}setUniform4fv(e,t,r){this._glProgram.setUniform4fv(e,t,r)}setUniformMatrix3fv(e,t,r){this._glProgram.setUniformMatrix3fv(e,t,!1,r)}setUniformMatrix4fv(e,t,r){this._glProgram.setUniformMatrix4fv(e,t,!1,r)}setUniformMatrices4fv(e,t,r){this._glProgram.setUniformMatrices4fv(e,t,!1,r)}setUniform1fv(e,t,r){this._glProgram.setUniform1fv(e,t,r)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e,t){let r=e.locations;if(t){const e=new Map(r);t.forEach((t,i)=>e.set(i,r.size+t)),r=e}r.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${r}, ${this.locations}`),this.locations.forEach((e,t)=>{r.get(t)!==e&&console.error(`VertexAttributeLocations are incompatible: Program has ${t} at position ${e}, VAO has it at position ${r.get(t)}.`)})}stop(){this._textures.clear()}bindTexture(e,t){if(!t?.glName){const r=`Texture sampler ${e} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,f.en)()&&console.error(r),t=this._context.emptyTexture}const r=this._ensureTextureUnit(e,t);this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit)}_ensureTextureUnit(e,t){let r=this._textures.get(e);return null==r?(r={texture:t,unit:this._textures.size},this._textures.set(e,r)):r.texture=t,r}}var g=r(90644);let _=class extends o.A{constructor(e,t,r=p){super({}),this._context=e,this._configuration=t,this.locations=r,this.primitiveType=c.WR.TRIANGLES,this.key=t.key,this._pipeline=this.initializePipeline(t),this.reload=async i=>{i&&await this.shader.reload(),this.key.equals(t.key)||n.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn("Configuration was changed after construction, cannot reload shader.",this.shader),(0,a.WD)(this._program);const o=this.shader.get().build(t);o.debugName=this.declaredClass,this._program=new v(e.rctx,o,r),this._pipeline=this.initializePipeline(t)}}initialize(){const e=this.shader.get().build(this._configuration);e.debugName=this.declaredClass,this._program=new v(this._context.rctx,e,this.locations)}destroy(){this._program=(0,a.WD)(this._program),this._pipeline=null}get program(){return this._program}get compiled(){return this.program.compiled}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}getPipeline(e,t){return this._pipeline}initializePipeline(e){return(0,g.Ey)({blending:g.RC,colorWrite:g.kn})}};function x(e,t){return(0,l.Dz)(e)?{buffers:[c.$0]}:t??null}_=(0,i.Cg)([(0,s.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],_)},43519:(e,t,r)=>{r.d(t,{ML:()=>a,WD:()=>o,Y1:()=>n,oF:()=>s});var i=r(31821);function o(e){e.code.add(i.H`struct MaskedColor {
|
|
497
|
-
vec4 color;
|
|
498
|
-
bvec4 mask;
|
|
499
|
-
};`)}function n(e){e.include(o),e.code.add(i.H`
|
|
500
|
-
MaskedColor createMaskedFromUInt8NaNColor(vec4 color) {
|
|
501
|
-
return MaskedColor(color * ${i.H.float(1/254)}, equal(color, vec4(255)));
|
|
502
|
-
}
|
|
503
|
-
`)}function a(e){e.include(o),e.code.add(i.H`vec4 maskedColorSelectOrOne(MaskedColor color) {
|
|
504
|
-
return vec4(
|
|
505
|
-
color.mask.r ? 1.0 : color.color.r,
|
|
506
|
-
color.mask.g ? 1.0 : color.color.g,
|
|
507
|
-
color.mask.b ? 1.0 : color.color.b,
|
|
508
|
-
color.mask.a ? 1.0 : color.color.a
|
|
509
|
-
);
|
|
510
|
-
}
|
|
511
|
-
MaskedColor multiplyMaskedColors(MaskedColor color1, MaskedColor color2) {
|
|
512
|
-
vec4 masked1 = maskedColorSelectOrOne(color1);
|
|
513
|
-
vec4 masked2 = maskedColorSelectOrOne(color2);
|
|
514
|
-
return MaskedColor(masked1 * masked2, bvec4(ivec4(color1.mask) & ivec4(color2.mask)));
|
|
515
|
-
}`)}function s(e){e.include(o),e.code.add(i.H`MaskedColor createMaskedFromNaNColor(vec4 color) {
|
|
516
|
-
return MaskedColor(color, isnan(color));
|
|
517
|
-
}`)}},43616:(e,t,r)=>{r.d(t,{MB:()=>l,Um:()=>c,kE:()=>a});var i=r(4576),o=r(34727),n=r(77194);function a(e,t,r,i,n,a){let s=r.screenLength*e.pixelRatio;null!=n&&(d.update(i,t,n,a),s=d.apply(s));const l=s*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.qE)(l*t,r.minWorldLength,r.maxWorldLength)}const s=(0,i.VO)();function l(e,t){let r=!1;for(const i in t){const o=t[i];void 0!==o&&(Array.isArray(o)?Array.isArray(e[i])&&s(o,e[i])||(e[i]=o.slice(),r=!0):e[i]!==o&&(r=!0,e[i]=o))}return r}const c={multiply:1,ignore:2,replace:3,tint:4},d=new n.PS},46140:(e,t,r)=>{r.d(t,{R:()=>o});var i=r(49186);let o=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[o,n]=t.split("."),a=/^\s*\d+\s*$/;if(!o?.match||!a.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!n?.match||!a.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(o,10),l=parseInt(n,10);return new e(s,l,r)}}},46686:(e,t,r)=>{r.d(t,{o:()=>o});var i=r(31821);function o(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(i.H`
|
|
518
|
-
void forwardLinearDepth(float _linearDepth) { ${(0,i.If)(t,"linearDepth = _linearDepth;")} }
|
|
519
|
-
`)}},46859:(e,t,r)=>{r.d(t,{h:()=>B}),r(44208);var i=r(49186),o=r(65529),n=r(97768),a=r(74887),s=r(34275),l=r(24326),c=r(84952),d=r(38969),u=r(31217),h=r(95117),m=r(2741);let p;var f=r(63907),v=r(76284),g=r(42293);let _=null,x=null;async function w(){return null==x&&(p??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,m.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),x=p,_=await x),x}function b(e,t){if(null==_)return e.byteLength;const r=new _.BasisFile(new Uint8Array(e)),i=T(r)?M(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function y(e,t){if(null==_)return e.byteLength;const r=new _.KTX2File(new Uint8Array(e)),i=C(r)?M(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function M(e,t,r,i,o){const n=(0,g.MW)(t?f.CQ.COMPRESSED_RGBA8_ETC2_EAC:f.CQ.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function T(e){return e.getNumImages()>=1&&!e.isUASTC()}function C(e){return e.getFaces()>=1&&e.isETC1S()}function S(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[1,f.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,f.CQ.COMPRESSED_RGB8_ETC2]:c?i?[3,f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=o,t.height=n,new v.g(e,t,{type:"compressed",levels:m})}var E=r(53966);const A=()=>E.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function I(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const R=I("DXT1"),F=I("DXT3"),O=I("DXT5");function P(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return A().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return A().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case R:o=8,n=f.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case F:o=16,n=f.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case O:o=16,n=f.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return A().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];(3&s||3&l)&&(A().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const p=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e.buffer,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:n,width:c,height:d}}function D(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function H(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const o=Math.max(e,t),n=e*t;if(o<=i&&n<=r)return[e,t];const a=Math.min(Math.sqrt(r/n),i/o);return[D(Math.round(e*a),i),D(Math.round(t*a),i)]}(e,t);return e.width===r&&e.height===i?e:N(e,r,i)}function N(e,t,r){if(e instanceof ImageData)return N(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new i.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}var z=r(620),L=r(67171);class B{constructor(e,t){this._data=e,this.id=(0,l.c)(),this.events=new o.bk,this._parameters={...U,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,c.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,d.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,c.DB)(e.src)||(0,c.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new L.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,s.mw)(e)||(0,s.mg)(e))return"image/ktx2"===t.encoding?y(e,!!t.mipmap):"image/x.basis"===t.encoding?b(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?V(e):t,o=t.pixelFormat??6408,n=(0,g.wH)(o);return(t.mipmap?4/3:1)*r*i*n||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const t=this._data;return null==t?(this._texture=new v.g(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,s.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,s.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,s.mw)(t)||(0,s.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,s.mw)(t)||(0,s.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,s.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,s.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){const i=P(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?9987:9729,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new v.g(e,t,o)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.KTX2File(new Uint8Array(r));if(!C(i))return null;i.startTranscoding();const o=S(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==_&&(_=await w());const i=new _.BasisFile(new Uint8Array(r));if(!T(i))return null;i.startTranscoding();const o=S(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,z.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new v.g(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await(0,u.D)(t,{signal:r});return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,h.y)(t,t.src,!1,r);return(0,a.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((o,s)=>{const l=()=>{t.removeEventListener("loadeddata",c),t.removeEventListener("error",d),(0,n.xt)(u)},c=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),o(this._loadFromImage(e,t)))},d=e=>{l(),s(e||new i.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",c),t.addEventListener("error",d);const u=(0,a.u7)(r,()=>d((0,a.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=H(r,e.parameters));const i=V(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.width=i.width,o.height=i.height,o.compress=this._parameters.compressionOptions,this._texture=new v.g(e,o,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,n.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function V(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const U={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},47286:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",1,(i,o,n)=>i.setUniform2fv(e,t(o,n),r))}}},49255:(e,t,r)=>{function i(e){return 3===e||4===e||5===e||6===e||7===e}function o(e){return function(e){return a(e)||s(e)}(e)||2===e}function n(e){return 0===e}function a(e){return n(e)||function(e){return 8===e||9===e}(e)}function s(e){return 1===e}function l(e){return s(e)||i(e)}r.d(t,{Bf:()=>i,Dz:()=>l,Lc:()=>a,_o:()=>n,iq:()=>o})},49718:(e,t,r)=>{r(51850),r(6867).i},49788:(e,t,r)=>{r.d(t,{Q:()=>i});const i=1/255.5},51255:(e,t,r)=>{r.d(t,{D:()=>c});var i=r(49255),o=r(63201),n=r(42593),a=r(63365),s=r(31821),l=r(49788);function c(e,t){e.include(n.Q,t),e.include(o.NL,t),e.fragment.include(a.a);const{output:r,oitPass:c,hasEmission:d,discardInvisibleFragments:u,oitPremultipliedAlpha:h,snowCover:m}=t,p=9===r,f=(0,i._o)(r)&&1===c,v=(0,i._o)(r)&&1!==c;let g=0;(v||f)&&e.outputs.add("fragColor","vec4",g++),d&&e.outputs.add("fragEmission","vec4",g++),f&&e.outputs.add("fragAlpha","float",g++),e.fragment.code.add(s.H`
|
|
520
|
-
void outputColorHighlightOLID(vec4 finalColor, const in vec3 vWorldPosition, vec3 emissiveSymbolColor ${(0,s.If)(m,", float snow")}) {
|
|
521
|
-
${(0,s.If)(p,"finalColor.a = 1.0;")}
|
|
522
|
-
${(0,s.If)(u,`if (finalColor.a < ${s.H.float(l.Q)}) { discard; }`)}
|
|
523
|
-
finalColor = applySlice(finalColor, vWorldPosition);
|
|
524
|
-
|
|
525
|
-
${(0,s.If)(f,`${(0,s.If)(h,"fragColor = vec4(finalColor.rgb, sqrt(finalColor.a));","fragColor = premultiplyAlpha(finalColor);")}\n fragAlpha = finalColor.a;`)}
|
|
526
|
-
${(0,s.If)(v,"fragColor = finalColor;")}
|
|
527
|
-
${(0,s.If)(d,`fragEmission = ${(0,s.If)(m,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}`)}
|
|
528
|
-
calculateOcclusionAndOutputHighlight();
|
|
529
|
-
${(0,s.If)(p,"outputObjectAndLayerIdColor();")}
|
|
530
|
-
}
|
|
531
|
-
`)}},51406:(e,t,r)=>{r.d(t,{MU:()=>l,O1:()=>c,QM:()=>d,Sx:()=>s,q2:()=>a});var i=r(29242),o=r(31821),n=r(35644);function a(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new n.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??i.zK)).code.add(o.H`void forwardColorUV(){
|
|
532
|
-
colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
533
|
-
}`)):e.vertex.code.add(o.H`void forwardColorUV(){}`)}function s(e,t){t.hasNormalTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new n.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK)).code.add(o.H`void forwardNormalUV(){
|
|
534
|
-
normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
535
|
-
}`)):e.vertex.code.add(o.H`void forwardNormalUV(){}`)}function l(e,t){t.hasEmissionTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("emissiveUV","vec2"),e.vertex.uniforms.add(new n.k("emissiveTextureTransformMatrix",e=>e.emissiveTextureTransformMatrix??i.zK)).code.add(o.H`void forwardEmissiveUV(){
|
|
536
|
-
emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
537
|
-
}`)):e.vertex.code.add(o.H`void forwardEmissiveUV(){}`)}function c(e,t){t.hasOcclusionTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("occlusionUV","vec2"),e.vertex.uniforms.add(new n.k("occlusionTextureTransformMatrix",e=>e.occlusionTextureTransformMatrix??i.zK)).code.add(o.H`void forwardOcclusionUV(){
|
|
538
|
-
occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
539
|
-
}`)):e.vertex.code.add(o.H`void forwardOcclusionUV(){}`)}function d(e,t){t.hasMetallicRoughnessTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new n.k("metallicRoughnessTextureTransformMatrix",e=>e.metallicRoughnessTextureTransformMatrix??i.zK)).code.add(o.H`void forwardMetallicRoughnessUV(){
|
|
540
|
-
metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
541
|
-
}`)):e.vertex.code.add(o.H`void forwardMetallicRoughnessUV(){}`)}},51976:(e,t,r)=>{r.d(t,{K:()=>s,W:()=>l});var i=r(49186),o=r(4576);class n{constructor(e){this._bits=[...e]}equals(e){return(0,o.aI)(this._bits,e.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var a=r(65786);class s extends a.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new n(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map(e=>` ${e}: ${this[e]}`).join("\n");return this._parameterBits=t,r}}function l(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const o=e.count||2,n=Math.ceil(Math.log2(o)),a=t._parameterBits;let s=0;for(;a[s]+n>16;)s++,s>=a.length&&a.push(0);const l=a[s],c=(1<<n)-1<<l;a[s]+=n,e.count?Object.defineProperty(t,r,{get(){return(this._parameterBits[s]&c)>>l},set(t){if(this[r]!==t){if(this._key=null,this._parameterBits[s]=this._parameterBits[s]&~c|+t<<l&c,"number"!=typeof t)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be a number, got ${typeof t}`);if(null==e.count)throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must provide a count option`)}}}):Object.defineProperty(t,r,{get(){return!!((this._parameterBits[s]&c)>>l)},set(e){if(this[r]!==e&&(this._key=null,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"boolean"!=typeof e))throw new i.A("internal:invalid-shader-configuration",`Configuration value for ${r} must be boolean, got ${typeof e}`)}})}}},52540:(e,t,r)=>{r.d(t,{E:()=>s});var i=r(37585),o=r(48163),n=r(77108),a=r(31821);function s(e){e.uniforms.add(new n.E("zProjectionMap",e=>function(e){const t=e.projectionMatrix;return(0,i.hZ)(l,t[14],t[10])}(e.camera))),e.code.add(a.H`float linearizeDepth(float depth) {
|
|
542
|
-
float depthNdc = depth * 2.0 - 1.0;
|
|
543
|
-
float c1 = zProjectionMap[0];
|
|
544
|
-
float c2 = zProjectionMap[1];
|
|
545
|
-
return -(c1 / (depthNdc + c2 + 1e-7));
|
|
546
|
-
}`),e.code.add(a.H`float delinearizeDepth(float linearDepth) {
|
|
547
|
-
float c1 = zProjectionMap[0];
|
|
548
|
-
float c2 = zProjectionMap[1];
|
|
549
|
-
float depthNdc = (-c1/linearDepth) - c2 - 1e-7;
|
|
550
|
-
float depthNonlinear01 = (depthNdc + 1.0 ) / 2.0;
|
|
551
|
-
return depthNonlinear01;
|
|
552
|
-
}`),e.code.add(a.H`float depthFromTexture(sampler2D depthTexture, vec2 uv) {
|
|
553
|
-
ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0)));
|
|
554
|
-
float depth = texelFetch(depthTexture, iuv, 0).r;
|
|
555
|
-
return depth;
|
|
556
|
-
}`),e.code.add(a.H`float linearDepthFromTexture(sampler2D depthTexture, vec2 uv) {
|
|
557
|
-
return linearizeDepth(depthFromTexture(depthTexture, uv));
|
|
558
|
-
}`)}const l=(0,o.vt)()},52587:(e,t,r)=>{r.d(t,{OH:()=>c,Y6:()=>s,pM:()=>l});var i=r(38954),o=r(51850),n=r(33079),a=r(31821);function s(e){e.vertex.code.add(a.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
|
|
559
|
-
return absCosAngle * absCosAngle * absCosAngle;
|
|
560
|
-
}`),e.vertex.code.add(a.H`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) {
|
|
561
|
-
return vec3(
|
|
562
|
-
min(params.x / (distanceToCamera - params.y), 1.0),
|
|
563
|
-
screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
|
|
564
|
-
params.z
|
|
565
|
-
);
|
|
566
|
-
}`),e.vertex.code.add(a.H`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) {
|
|
567
|
-
return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
|
|
568
|
-
}`),e.vertex.code.add(a.H`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) {
|
|
569
|
-
return applyScreenSizePerspectiveScaleFactorFloat(
|
|
570
|
-
size,
|
|
571
|
-
screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
|
|
572
|
-
);
|
|
573
|
-
}`),e.vertex.code.add(a.H`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) {
|
|
574
|
-
return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
|
|
575
|
-
}`),e.vertex.code.add(a.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
|
|
576
|
-
return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
|
|
577
|
-
}`)}function l(e){e.uniforms.add(new n.t("screenSizePerspective",e=>d(e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize)))}function c(e){e.uniforms.add(new n.t("screenSizePerspectiveAlignment",e=>d(e.screenSizePerspectiveAlignment||e.screenSizePerspective,e.screenSizePerspectiveAlignment?null:e.screenSizePerspectiveMinPixelReferenceSize)))}function d(e,t){const r=null!=t&&null!=e?Math.min(e.minPixelSize/t,1):0;return e?(0,i.h)(u,e.divisor,e.offset,r):(0,i.h)(u,0,0,0)}const u=(0,o.vt)()},53466:(e,t,r)=>{r.d(t,{U:()=>n});var i=r(21818),o=r(31821);function n(e,t){switch(t.textureCoordinateType){case 1:return e.attributes.add("uv0","vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case 2:return e.attributes.add("uv0","vec2"),e.attributes.add("uvRegion","vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() {
|
|
578
|
-
vuv0 = uv0;
|
|
579
|
-
vuvRegion = uvRegion;
|
|
580
|
-
}`);default:(0,i.Xb)(t.textureCoordinateType);case 0:return void e.vertex.code.add(o.H`void forwardTextureCoordinates() {}`);case 3:return}}},57323:(e,t,r)=>{r.d(t,{R:()=>L,b:()=>z});var i=r(32680),o=r(49255),n=r(76591),a=r(76597),s=r(24321),l=r(72722),c=r(43519),d=r(96336),u=r(71955),h=r(53466),m=r(92700),p=r(35640),f=r(40261),v=r(14527),g=r(89390),_=r(98619),x=r(22393),w=r(59469),b=r(32482),y=r(96598),M=r(42398),T=r(58614),C=r(27950),S=r(20693),E=r(33079),A=r(71988),I=r(20304),R=r(31821),F=r(63761),O=r(10906),P=r(43616),D=r(51255),H=r(14113),N=r(49788);function z(e){const t=new H.N5,{attributes:r,vertex:z,fragment:L,varyings:B}=t,{output:V,offsetBackfaces:U,pbrMode:G,snowCover:j,spherical:W}=e,k=1===G||2===G;if((0,S.NB)(z,e),r.add("position","vec3"),B.add("vpos","vec3",{invariant:!0}),t.include(M.A,e),t.include(l.B,e),t.include(p.Ge,e),t.include(y.Z,e),!(0,o._o)(V))return t.include(f.E,e),t;(0,S.yu)(t.vertex,e),t.include(d.Y,e),t.include(a.d),U&&t.include(i.M),B.add("vNormalWorld","vec3"),B.add("localvpos","vec3",{invariant:!0}),t.include(h.U,e),t.include(u.K,e),t.include(s.v,e),t.include(m.c,e),z.include(c.WD),z.include(c.oF),z.uniforms.add(new A.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),B.add("vcolorExt","vec4"),t.include(e.instancedDoublePrecision?b.G:b.Bz,e),z.main.add(R.H`
|
|
581
|
-
forwardNormalizedVertexColor();
|
|
582
|
-
|
|
583
|
-
MaskedColor maskedColorExt =
|
|
584
|
-
applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
|
|
585
|
-
|
|
586
|
-
vcolorExt = maskedColorExt.color;
|
|
587
|
-
forwardColorMixMode(maskedColorExt.mask);
|
|
588
|
-
|
|
589
|
-
bool alphaCut = opacityMixMode != ${R.H.int(P.Um.ignore)} && vcolorExt.a < ${R.H.float(N.Q)};
|
|
590
|
-
vpos = getVertexInLocalOriginSpace();
|
|
591
|
-
|
|
592
|
-
localvpos = vpos - view[3].xyz;
|
|
593
|
-
vpos = subtractOrigin(vpos);
|
|
594
|
-
vNormalWorld = dpNormal(vvLocalNormal(normalModel()));
|
|
595
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
596
|
-
vec4 basePosition = transformPosition(proj, view, vpos);
|
|
597
|
-
|
|
598
|
-
forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
|
|
599
|
-
forwardTextureCoordinates();
|
|
600
|
-
forwardLinearDepthToReadShadowMap();
|
|
601
|
-
gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
|
|
602
|
-
${(0,R.If)(U,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
|
|
603
|
-
`);const{hasColorTexture:$,hasColorTextureTransform:Z}=e;return L.include(g.kA,e),L.include(v.n,e),t.include(T.S,e),L.include(n.HQ,e),t.include(D.D,e),(0,S.yu)(L,e),(0,_.Gc)(L),(0,g.a8)(L),(0,g.eU)(L),L.uniforms.add(z.uniforms.get("localOrigin"),z.uniforms.get("view"),new E.t("ambient",e=>e.ambient),new E.t("diffuse",e=>e.diffuse),new I.m("opacity",e=>e.opacity),new I.m("layerOpacity",e=>e.layerOpacity)),$&&L.uniforms.add(new F.N("tex",e=>e.texture)),t.include(w._,e),L.include(x.c,e),L.include(C.N),L.include(O.b,e),(0,_.O4)(L),L.main.add(R.H`
|
|
604
|
-
discardBySlice(vpos);
|
|
605
|
-
discardByTerrainDepth();
|
|
606
|
-
vec4 texColor = ${$?`texture(tex, ${Z?"colorUV":"vuv0"})`:" vec4(1.0)"};
|
|
607
|
-
${(0,R.If)($,`${(0,R.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
|
|
608
|
-
vec3 viewDirection = normalize(vpos - cameraPosition);
|
|
609
|
-
applyPBRFactors();
|
|
610
|
-
float ssao = evaluateAmbientOcclusionInverse();
|
|
611
|
-
ssao *= getBakedOcclusion();
|
|
612
|
-
|
|
613
|
-
float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
|
|
614
|
-
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
|
|
615
|
-
float shadow = readShadow(additionalAmbientScale, vpos);
|
|
616
|
-
vec3 matColor = max(ambient, diffuse);
|
|
617
|
-
${e.hasVertexColors?R.H`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
|
|
618
|
-
float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, opacityMixMode);`:R.H`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
|
|
619
|
-
float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, opacityMixMode);`}
|
|
620
|
-
|
|
621
|
-
vec3 shadingNormal = normalize(vNormalWorld);
|
|
622
|
-
vec3 groundNormal = ${W?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};
|
|
623
|
-
|
|
624
|
-
${(0,R.If)(j,"vec3 faceNormal = screenDerivativeNormal(vpos);\n float snow = getRealisticTreeSnow(faceNormal, shadingNormal, groundNormal);\n albedo = mix(albedo, vec3(1), snow);")}
|
|
625
|
-
|
|
626
|
-
${R.H`albedo *= 1.2;
|
|
627
|
-
vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
|
|
628
|
-
float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
|
|
629
|
-
float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);
|
|
630
|
-
float treeRadialFalloff = vColor.r;
|
|
631
|
-
float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
|
|
632
|
-
additionalLight += backLightFactor * mainLightIntensity;`}
|
|
633
|
-
|
|
634
|
-
${k?R.H`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
635
|
-
${(0,R.If)(j,"mrr = applySnowToMRR(mrr, snow);")}
|
|
636
|
-
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, groundNormal, mrr, additionalAmbientIrradiance);`:R.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
637
|
-
vec4 finalColor = vec4(shadedColor, opacity_);
|
|
638
|
-
outputColorHighlightOLID(finalColor, vpos, albedo ${(0,R.If)(j,", 1.0")});`),t}const L=Object.freeze(Object.defineProperty({__proto__:null,build:z},Symbol.toStringTag,{value:"Module"}))},57917:(e,t,r)=>{r.d(t,{S:()=>n});var i=r(34275),o=r(20498);function n(e){if(e.length<i.y9)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,i.LW)(e)?(0,o.pX)().from(e):(0,i.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}},58029:(e,t,r)=>{r.d(t,{F:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"mat4",0,(i,o)=>i.setUniformMatrix4fv(e,t(o),r))}}},58614:(e,t,r)=>{r.d(t,{S:()=>a}),r(28421);var i=r(20304),o=r(31821),n=r(49788);function a(e,t){!function(e,t,r){const i=e.fragment,a=t.alphaDiscardMode,s=0===a;2!==a&&3!==a||i.uniforms.add(r),i.code.add(o.H`
|
|
639
|
-
void discardOrAdjustAlpha(inout vec4 color) {
|
|
640
|
-
${1===a?"color.a = 1.0;":`if (color.a < ${s?o.H.float(n.Q):"textureAlphaCutoff"}) {\n discard;\n } ${(0,o.If)(2===a,"else { color.a = 1.0; }")}`}
|
|
641
|
-
}
|
|
642
|
-
`)}(e,t,new i.m("textureAlphaCutoff",e=>e.textureAlphaCutoff))}},59469:(e,t,r)=>{r.d(t,{_:()=>c});var i=r(99208),o=r(40710),n=r(33079),a=r(31821),s=r(15976),l=r(63761);function c(e,t){const r=t.pbrMode,c=e.fragment;if(2!==r&&0!==r&&1!==r)return void c.code.add(a.H`void applyPBRFactors() {}`);if(0===r)return void c.code.add(a.H`void applyPBRFactors() {}
|
|
643
|
-
float getBakedOcclusion() { return 1.0; }`);if(2===r)return void c.code.add(a.H`vec3 mrr = vec3(0.0, 0.6, 0.2);
|
|
644
|
-
float occlusion = 1.0;
|
|
645
|
-
void applyPBRFactors() {}
|
|
646
|
-
float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:d,hasMetallicRoughnessTextureTransform:u,hasOcclusionTexture:h,hasOcclusionTextureTransform:m,bindType:p}=t;(d||h)&&e.include(i.r,t),c.code.add(a.H`vec3 mrr;
|
|
647
|
-
float occlusion;`),d&&c.uniforms.add(1===p?new l.N("texMetallicRoughness",e=>e.textureMetallicRoughness):new s.o("texMetallicRoughness",e=>e.textureMetallicRoughness)),h&&c.uniforms.add(1===p?new l.N("texOcclusion",e=>e.textureOcclusion):new s.o("texOcclusion",e=>e.textureOcclusion)),c.uniforms.add(1===p?new n.t("mrrFactors",e=>e.mrrFactors):new o.W("mrrFactors",e=>e.mrrFactors)),c.code.add(a.H`
|
|
648
|
-
${(0,a.If)(d,a.H`void applyMetallicRoughness(vec2 uv) {
|
|
649
|
-
vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
|
|
650
|
-
mrr[0] *= metallicRoughness.b;
|
|
651
|
-
mrr[1] *= metallicRoughness.g;
|
|
652
|
-
}`)}
|
|
653
|
-
|
|
654
|
-
${(0,a.If)(h,"void applyOcclusion(vec2 uv) { occlusion *= textureLookup(texOcclusion, uv).r; }")}
|
|
655
|
-
|
|
656
|
-
float getBakedOcclusion() {
|
|
657
|
-
return ${h?"occlusion":"1.0"};
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
void applyPBRFactors() {
|
|
661
|
-
mrr = mrrFactors;
|
|
662
|
-
occlusion = 1.0;
|
|
663
|
-
|
|
664
|
-
${(0,a.If)(d,`applyMetallicRoughness(${u?"metallicRoughnessUV":"vuv0"});`)}
|
|
665
|
-
${(0,a.If)(h,`applyOcclusion(${m?"occlusionUV":"vuv0"});`)}
|
|
666
|
-
}
|
|
667
|
-
`)}(r(74810),r(65786)).Y},59907:(e,t,r)=>{r.d(t,{Hk:()=>h,Pq:()=>u,Ue:()=>l,Ut:()=>d,p1:()=>m,tb:()=>p,uO:()=>s,vJ:()=>v,vx:()=>f}),r(38954);var i=r(51850),o=r(58083),n=r(13030),a=r(620);function s(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,1===i)for(let e=0;e<l;++e)a[r]=o[n[e]],r+=s;else for(let e=0;e<l;++e){const t=o[n[e]];for(let e=0;e<i;e++)a[r]=t,r+=s}}function l(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length;r*=a;for(let e=0;e<s;++e){const t=2*o[e];n[r]=i[t],n[r+1]=i[t+1],r+=a}}function c(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=3*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],r+=s}}function d(e,t,r,i=1){const{data:o,indices:n}=e,a=t.typedBuffer,s=t.typedBufferStride,l=n.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*n[e];a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*n[e];for(let e=0;e<i;++e)a[r]=o[t],a[r+1]=o[t+1],a[r+2]=o[t+2],a[r+3]=o[t+3],r+=s}}function u(e,t,r){const i=e.typedBuffer,o=e.typedBufferStride;t*=o;for(let e=0;e<r;++e)i[t]=0,i[t+1]=0,i[t+2]=0,i[t+3]=0,t+=o}function h(e,t,r,i,n=1){if(!t)return void c(e,r,i,n);const{data:a,indices:s}=e,l=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=t[0],m=t[1],p=t[2],f=t[4],v=t[5],g=t[6],_=t[8],x=t[9],w=t[10],b=t[12],y=t[13],M=t[14];i*=d;let T=0,C=0,S=0;const E=(0,o.tZ)(t)?e=>{T=a[e]+b,C=a[e+1]+y,S=a[e+2]+M}:e=>{const t=a[e],r=a[e+1],i=a[e+2];T=h*t+f*r+_*i+b,C=m*t+v*r+x*i+y,S=p*t+g*r+w*i+M};if(1===n)for(let e=0;e<u;++e)E(3*s[e]),l[i]=T,l[i+1]=C,l[i+2]=S,i+=d;else for(let e=0;e<u;++e){E(3*s[e]);for(let e=0;e<n;++e)l[i]=T,l[i+1]=C,l[i+2]=S,i+=d}}function m(e,t,r,i,n=1){if(!t)return void c(e,r,i,n);const{data:a,indices:s}=e,l=t,d=r.typedBuffer,u=r.typedBufferStride,h=s.length,m=l[0],p=l[1],f=l[2],v=l[4],g=l[5],_=l[6],x=l[8],w=l[9],b=l[10],y=!(0,o.ut)(l),M=1e-6,T=1-M;i*=u;let C=0,S=0,E=0;const A=(0,o.tZ)(l)?e=>{C=a[e],S=a[e+1],E=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];C=m*t+v*r+x*i,S=p*t+g*r+w*i,E=f*t+_*r+b*i};if(1===n)if(y)for(let e=0;e<h;++e){A(3*s[e]);const t=C*C+S*S+E*E;if(t<T&&t>M){const e=1/Math.sqrt(t);d[i]=C*e,d[i+1]=S*e,d[i+2]=E*e}else d[i]=C,d[i+1]=S,d[i+2]=E;i+=u}else for(let e=0;e<h;++e)A(3*s[e]),d[i]=C,d[i+1]=S,d[i+2]=E,i+=u;else for(let e=0;e<h;++e){if(A(3*s[e]),y){const e=C*C+S*S+E*E;if(e<T&&e>M){const t=1/Math.sqrt(e);C*=t,S*=t,E*=t}}for(let e=0;e<n;++e)d[i]=C,d[i+1]=S,d[i+2]=E,i+=u}}function p(e,t,r,i,o=1){const{data:n,indices:a}=e,s=r.typedBuffer,l=r.typedBufferStride,c=a.length;if(i*=l,t===n.length&&4===t){s[i]=n[0],s[i+1]=n[1],s[i+2]=n[2],s[i+3]=n[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,a=e[i/=4];i+=t;const d=c*o;for(let r=1;r<d;++r)e[i]=a,i+=t;return}if(1!==o)if(4!==t)for(let e=0;e<c;++e){const t=3*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*a[e];for(let e=0;e<o;++e)s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=n[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*a[e];s[i]=n[t],s[i+1]=n[t+1],s[i+2]=n[t+2],s[i+3]=255,i+=l}}}function f(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}function v(e,t,r,i,o,a,s){let l={numItems:0,numVerticesPerItem:0};for(const c of r.fields.keys()){const r=e.get(c),d=r?.indices;if(r&&d)"position"===c&&(l={numItems:1,numVerticesPerItem:d.length}),g(c,r,i,o,a,s);else if("olidColor"===c&&null!=t){const r=e.get("position")?.indices;if(r){const e=r.length;f(t,a.getField(c,n.XP),e,s)}}}return l}function g(e,t,r,i,s,u){switch(e){case"position":{(0,a.vA)(3===t.size);const i=s.getField(e,n.xs);(0,a.vA)(!!i,`No buffer view for ${e}`),h(t,r,i,u);break}case"normal":{(0,a.vA)(3===t.size);const r=s.getField(e,n.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),m(t,i,r,u);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,a.vA)(2===t.size);const r=s.getField(e,n.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,u);break}case"uv0":{(0,a.vA)(2===t.size);const r=s.getField(e,n.ZD)??s.getField(e,n.gH);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,u);break}case"uvi":{(0,a.vA)(2===t.size);const r=s.getField(e,n.mJ);(0,a.vA)(!!r,`No buffer view for ${e}`),l(t,r,u);break}case"color":case"symbolColor":{const r=s.getField(e,n.XP);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(3===t.size||4===t.size),p(t,t.size,r,u);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=s.getField(e,n.Y$)??s.getField(e,n.Y$);(0,a.vA)(!!r,`No buffer view for ${e}`),(0,a.vA)(1===t.size),function(e,t,r){const{data:i,indices:o}=e,n=t.typedBuffer,a=t.typedBufferStride,s=o.length,l=i[0];r*=a;for(let e=0;e<s;++e)n[r]=l,r+=a}(t,r,u);break}case"tangent":{(0,a.vA)(4===t.size);const i=s.getField(e,n.Eq);(0,a.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void d(e,r,i,n);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,h=s.length,m=l[0],p=l[1],f=l[2],v=l[4],g=l[5],_=l[6],x=l[8],w=l[9],b=l[10],y=!(0,o.ut)(l),M=1e-6,T=1-M;if(i*=u,1===n)for(let e=0;e<h;++e){const t=4*s[e],r=a[t],o=a[t+1],n=a[t+2],l=a[t+3];let d=m*r+v*o+x*n,h=p*r+g*o+w*n,C=f*r+_*o+b*n;if(y){const e=d*d+h*h+C*C;if(e<T&&e>M){const t=1/Math.sqrt(e);d*=t,h*=t,C*=t}}c[i]=d,c[i+1]=h,c[i+2]=C,c[i+3]=l,i+=u}else for(let e=0;e<h;++e){const t=4*s[e],r=a[t],o=a[t+1],l=a[t+2],d=a[t+3];let h=m*r+v*o+x*l,C=p*r+g*o+w*l,S=f*r+_*o+b*l;if(y){const e=h*h+C*C+S*S;if(e<T&&e>M){const t=1/Math.sqrt(e);h*=t,C*=t,S*=t}}for(let e=0;e<n;++e)c[i]=h,c[i+1]=C,c[i+2]=S,c[i+3]=d,i+=u}}(t,r,i,u);break}case"profileVertexAndNormal":{(0,a.vA)(4===t.size);const r=s.getField(e,n.jz)??s.getField(e,n.Eq);(0,a.vA)(!!r,`No buffer view for ${e}`),d(t,r,u);break}case"profileAuxData":{(0,a.vA)(3===t.size);const r=s.getField(e,n.EC)??s.getField(e,n.xs);(0,a.vA)(!!r,`No buffer view for ${e}`),c(t,r,u);break}}}(0,i.vt)()},62602:(e,t,r)=>{r.d(t,{r:()=>n});var i=r(21818),o=r(31821);function n(e,t){const r=e.fragment;switch(r.code.add(o.H`struct ShadingNormalParameters {
|
|
668
|
-
vec3 normalView;
|
|
669
|
-
vec3 viewDirection;
|
|
670
|
-
} shadingParams;`),t.doubleSidedMode){case 0:r.code.add(o.H`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
671
|
-
return normalize(params.normalView);
|
|
672
|
-
}`);break;case 1:r.code.add(o.H`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
673
|
-
return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView);
|
|
674
|
-
}`);break;case 2:r.code.add(o.H`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
675
|
-
return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView);
|
|
676
|
-
}`);break;default:(0,i.Xb)(t.doubleSidedMode);case 3:}}},63201:(e,t,r)=>{r.d(t,{NL:()=>f});var i=r(49255),o=r(99208),n=r(40876),a=r(31821);function s(e){e.code.add(a.H`
|
|
677
|
-
const float GAMMA = ${a.H.float(n.Tf)};
|
|
678
|
-
const float INV_GAMMA = ${a.H.float(1/n.Tf)};
|
|
679
|
-
|
|
680
|
-
vec4 delinearizeGamma(vec4 color) {
|
|
681
|
-
return vec4(pow(color.rgb, vec3(INV_GAMMA)), color.a);
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
vec3 linearizeGamma(vec3 color) {
|
|
685
|
-
return pow(color, vec3(GAMMA));
|
|
686
|
-
}
|
|
687
|
-
`)}var l=r(40710),c=r(33079),d=r(28421),u=r(20304),h=r(15976),m=r(63761);r(25634);const p=1;function f(e,t){if(!(0,i._o)(t.output))return;e.fragment.include(s);const{emissionSource:r,hasEmissiveTextureTransform:n,bindType:f}=t,v=3===r||4===r||5===r;v&&(e.include(o.r,t),e.fragment.uniforms.add(1===f?new m.N("texEmission",e=>e.textureEmissive):new h.o("texEmission",e=>e.textureEmissive)));const g=2===r||v;g&&e.fragment.uniforms.add(1===f?new c.t("emissiveBaseColor",e=>e.emissiveBaseColor):new l.W("emissiveBaseColor",e=>e.emissiveBaseColor));const _=0!==r;_&&7!==r&&6!==r&&4!==r&&5!==r&&e.fragment.uniforms.add(1===f?new u.m("emissiveStrength",e=>e.emissiveStrength):new d.J("emissiveStrength",e=>e.emissiveStrength));const x=7===r,w=5===r,b=1===r||6===r||x;e.fragment.code.add(a.H`
|
|
688
|
-
vec4 getEmissions(vec3 symbolColor) {
|
|
689
|
-
vec4 emissions = ${g?w?"emissiveSource == 0 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(emissiveBaseColor, 1.0)":b?x?"emissiveSource == 0 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(linearizeGamma(symbolColor), 1.0)":"vec4(0.0)"};
|
|
690
|
-
${(0,a.If)(v,`${(0,a.If)(w,`if(emissiveSource == 0) {\n vec4 emissiveFromTex = textureLookup(texEmission, ${n?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);\n }`,`vec4 emissiveFromTex = textureLookup(texEmission, ${n?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);`)}\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
|
|
691
|
-
${(0,a.If)(_,`emissions.rgb *= emissiveStrength * ${a.H.float(p)};`)}
|
|
692
|
-
return emissions;
|
|
693
|
-
}
|
|
694
|
-
`)}},63365:(e,t,r)=>{r.d(t,{a:()=>o});var i=r(31821);function o(e){e.code.add(i.H`vec4 premultiplyAlpha(vec4 v) {
|
|
695
|
-
return vec4(v.rgb * v.a, v.a);
|
|
696
|
-
}
|
|
697
|
-
vec3 rgb2hsv(vec3 c) {
|
|
698
|
-
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
|
699
|
-
vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
|
|
700
|
-
vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
|
|
701
|
-
float d = q.x - min(q.w, q.y);
|
|
702
|
-
float e = 1.0e-10;
|
|
703
|
-
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);
|
|
704
|
-
}
|
|
705
|
-
vec3 hsv2rgb(vec3 c) {
|
|
706
|
-
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
|
707
|
-
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
|
708
|
-
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
|
709
|
-
}
|
|
710
|
-
float rgb2v(vec3 c) {
|
|
711
|
-
return max(c.x, max(c.y, c.z));
|
|
712
|
-
}`)}},63761:(e,t,r)=>{r.d(t,{N:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",1,(r,i,o)=>r.bindTexture(e,t(i,o)))}}},65786:(e,t,r)=>{r.d(t,{Y:()=>i});const i=class{};new i},65806:(e,t,r)=>{r.d(t,{g:()=>a});var i=r(51850),o=r(91218),n=r(9762);function a(e,t,r){if((0,o.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,n.projectBuffer)(s,e.spatialReference,0,t,r,0);const i=(0,o.tryProjectWithZConversion)(e,r);return!!i&&(t[0]=i.x,t[1]=i.y,t[2]=i.z??0,!0)}const s=(0,i.vt)()},67171:(e,t,r)=>{r.d(t,{R:()=>n,e:()=>a});var i=r(63907),o=r(42293);class n{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=i.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function a(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,o.MW)(e.internalFormat))*(34067===e.target?6:1))}},68259:(e,t,r)=>{r.d(t,{t:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",2,(i,o,n,a)=>i.setUniform2fv(e,t(o,n,a),r))}}},71955:(e,t,r)=>{r.d(t,{K:()=>l});var i=r(43519),o=r(31821),n=r(74333);class a extends n.n{constructor(e,t){super(e,"int",1,(r,i,o)=>r.setUniform1i(e,t(i,o)))}}var s=r(43616);function l(e,t){e.varyings.add("colorMixMode","int"),e.varyings.add("opacityMixMode","int"),e.vertex.uniforms.add(new a("symbolColorMixMode",e=>s.Um[e.colorMixMode])),t.hasSymbolColors?(e.vertex.include(i.WD),e.vertex.include(i.Y1),e.vertex.include(i.ML),e.attributes.add("symbolColor","vec4"),e.vertex.code.add(o.H`
|
|
713
|
-
MaskedColor applySymbolColor(MaskedColor color) {
|
|
714
|
-
return multiplyMaskedColors(color, createMaskedFromUInt8NaNColor(${"symbolColor"}));
|
|
715
|
-
}
|
|
716
|
-
`)):e.vertex.code.add(o.H`MaskedColor applySymbolColor(MaskedColor color) {
|
|
717
|
-
return color;
|
|
718
|
-
}`),e.vertex.code.add(o.H`
|
|
719
|
-
void forwardColorMixMode(bvec4 mask) {
|
|
720
|
-
colorMixMode = mask.r ? ${o.H.int(s.Um.ignore)} : symbolColorMixMode;
|
|
721
|
-
opacityMixMode = mask.a ? ${o.H.int(s.Um.ignore)} : symbolColorMixMode;
|
|
722
|
-
}
|
|
723
|
-
`)}},71988:(e,t,r)=>{r.d(t,{E:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",1,(i,o,n)=>i.setUniform4fv(e,t(o,n),r))}}},72722:(e,t,r)=>{r.d(t,{B:()=>x});var i=r(77690),o=r(29242),n=r(9093),a=r(38954),s=r(51850),l=r(26425),c=r(20693),d=r(23205),u=r(31821),h=r(35644),m=r(74333);class p extends m.n{constructor(e,t,r){super(e,"mat4",1,(i,o,n)=>i.setUniformMatrix4fv(e,t(o,n),r))}}function f(e,t){const r=e.length;for(let i=0;i<r;++i)g[0]=e[i],t[i]=g[0];return t}function v(e,t){const r=e.length;for(let i=0;i<r;++i)g[0]=e[i],g[1]=e[i]-g[0],t[i]=g[1];return t}const g=new Float32Array(2);r(65786).Y;const _=(0,o.vt)();function x(e,t){const{hasModelTransformation:r,instancedDoublePrecision:o,instanced:s,output:m,hasVertexTangents:g}=t;r&&(e.vertex.uniforms.add(new p("model",e=>e.modelTransformation??n.zK)),e.vertex.uniforms.add(new h.k("normalLocalOriginFromModel",e=>((0,i.Ge)(_,e.modelTransformation??n.zK),_)))),s&&o&&(e.attributes.add("instanceModelOriginHi","vec3"),e.attributes.add("instanceModelOriginLo","vec3"),e.attributes.add("instanceModel","mat3"),e.attributes.add("instanceModelNormal","mat3"));const x=e.vertex;o&&(x.include(l.u,t),x.uniforms.add(new d.d("viewOriginHi",e=>f((0,a.h)(w,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),w)),new d.d("viewOriginLo",e=>v((0,a.h)(w,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),w)))),x.code.add(u.H`
|
|
724
|
-
vec3 getVertexInLocalOriginSpace() {
|
|
725
|
-
return ${r?o?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":o?"instanceModel * localPosition().xyz":"localPosition().xyz"};
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
vec3 subtractOrigin(vec3 _pos) {
|
|
729
|
-
${o?u.H`
|
|
730
|
-
// Issue: (should be resolved now with invariant position) https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
|
|
731
|
-
vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -instanceModelOriginHi, -instanceModelOriginLo);
|
|
732
|
-
return _pos - originDelta;`:"return vpos;"}
|
|
733
|
-
}
|
|
734
|
-
`),x.code.add(u.H`
|
|
735
|
-
vec3 dpNormal(vec4 _normal) {
|
|
736
|
-
return normalize(${r?o?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":o?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
|
|
737
|
-
}
|
|
738
|
-
`),2===m&&((0,c.S7)(x),x.code.add(u.H`
|
|
739
|
-
vec3 dpNormalView(vec4 _normal) {
|
|
740
|
-
return normalize((viewNormal * ${r?o?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":o?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
|
|
741
|
-
}
|
|
742
|
-
`)),g&&x.code.add(u.H`
|
|
743
|
-
vec4 dpTransformVertexTangent(vec4 _tangent) {
|
|
744
|
-
${r?o?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":o?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
|
|
745
|
-
}`)}const w=(0,s.vt)()},72824:(e,t,r)=>{r.d(t,{Mh:()=>u,Zo:()=>h,gy:()=>m});var i=r(21818),o=r(29242),n=r(91829),a=r(96336),s=r(33752),l=r(31821),c=r(98353),d=r(35644);function u(e,t){switch(t.normalType){case 0:case 1:e.include(a.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new c.h("transformNormalGlobalFromModel",e=>e.transformNormalGlobalFromModel),new d.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)).code.add(l.H`void forwardNormal() {
|
|
746
|
-
vNormalWorld = transformNormalGlobalFromModel * normalModel();
|
|
747
|
-
vNormalView = transformNormalViewFromGlobal * vNormalWorld;
|
|
748
|
-
}`);break;case 2:e.vertex.code.add(l.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.vt)()}}class m extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,o.vt)(),this.toMapSpace=(0,n.vt)()}}},74333:(e,t,r)=>{r.d(t,{n:()=>i}),r(44208);class i{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>n,SY:()=>l,mb:()=>a});var i=r(38954),o=r(51850);function n({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:n,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.m)(s,o.uY))&&null==l&&(null==n||1===n)&&(null==r||1===r)}const a=(0,o.CN)(1,1,.5),s=(0,o.CN)(0,.6,.2),l=(0,o.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{g:()=>T});var i=r(49186),o=r(44208),n=r(53966),a=r(97768),s=r(93637),l=r(74887),c=r(94656),d=r(63907),u=r(67171);const h=()=>n.A.getLogger("esri/views/webgl/textureUtils");function m(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:o}=e;if(o&&(p(o)||f(o))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:o}=e;o&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function p(e){return(0,s.a4)(d.SB,e)}function f(e){return(0,s.a4)(d.iE,e)}function v(e){return null!=e&&"type"in e&&"compressed"===e.type}function g(e){return null!=e&&!v(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let o=Math.max(t,r);return 32879===e&&(o=Math.max(o,i)),Math.floor(Math.log2(o))+1}function w(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case d.ld.FLOAT:switch(e.pixelFormat){case 6408:return d.H0.RGBA32F;case 6407:return d.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case d.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return d.H0.RGBA8;case 6407:return d.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?d.iE.DEPTH24_STENCIL8:6402===t?d.SB.DEPTH_COMPONENT24:t,e.internalFormat}class b extends u.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case d.H0.R16F:case d.H0.R32F:case d.H0.R8_SNORM:case d.H0.R8:this.pixelFormat=6403;break;case d.H0.R8I:case d.H0.R8UI:case d.H0.R16I:case d.H0.R16UI:case d.H0.R32I:case d.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new b(e,t)}}const y=!!(0,o.A)("esri-tests-disable-gpu-memory-measurements"),M=()=>n.A.getLogger("esri/views/webgl/Texture");class T{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=b.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return y?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(d.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!v(e)&&this._descriptor.internalFormat&&(0,s.a4)(d.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!v(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,o,n,a,s=0){a||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=w(l);const{context:c,pixelFormat:d,dataType:u,target:h,isImmutable:m}=l;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const p=c.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+o>l.width||r+n>l.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:f}=c;s&&(o&&n||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),f.pixelStorei(f.UNPACK_SKIP_ROWS,s)),g(a)?f.texSubImage2D(h,e,t,r,o,n,d,u,a):v(a)?f.compressedTexSubImage2D(h,e,t,r,o,n,l.internalFormat,a.levels[e]):f.texSubImage2D(h,e,t,r,o,n,d,u,a),s&&f.pixelStorei(f.UNPACK_SKIP_ROWS,0),c.bindTexture(p,T.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,o,n,a,s,l){l||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const c=this._descriptor;c.internalFormat=w(c);const{context:d,pixelFormat:u,dataType:h,isImmutable:m,target:p}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(p)||M().warn("Attempting to set 3D texture data on a non-3D texture");const f=d.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||o<0||t+n>c.width||r+a>c.height||o+s>c.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:g}=d;if(v(l))l=l.levels[e],g.compressedTexSubImage3D(p,e,t,r,o,n,a,s,c.internalFormat,l);else{const i=l;g.texSubImage3D(p,e,t,r,o,n,a,s,u,h,i)}d.bindTexture(f,T.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,m(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._descriptor.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,T.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(e,t){const r=this._descriptor,o=r.context?.gl;if(!o)return;(0,c.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),r.context.instanceCounter.increment(d.vt.Texture,this)),m(r);const n=r.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(o);const a=t??r.target,l=_(a);if(g(e))this._setDataFromTexImageSource(e,a);else{const{width:t,height:n,depth:u}=r;if(null==t||null==n)throw new i.A("texture:missing-size","Width and height must be specified!");if(l&&null==u)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=w(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,r.internalFormat,r.hasMipmap,t,n,u),v(e)){if(!function(e){return null!=e&&(0,s.a4)(d.CQ,e)}(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,a)}else this._texImage(a,0,r.internalFormat,t,n,u,e),(0,c.Y2)(o),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(o),r.context.bindTexture(n,T.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=w(i);const o=_(t),{width:n,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=n),i.height||(i.height=a),o&&i.depth,o&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,n,a,s),this._texImage(t,0,i.internalFormat,n,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:o,height:n,depth:a}=i,s=e.levels,l=x(r,o,n,a),c=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,o,n)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,o,n,a)},c)}_texStorage(e,t,r,o,n,a){const{gl:s}=this._descriptor.context;if(!function(e){return d.XN.includes(e)}(t)&&!p(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,o,n,a):1;if(_(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,o,n,a)}else s.texStorage2D(e,l,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=_(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,o,n,a,u,h,r)}else l.texSubImage2D(e,t,0,0,o,n,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,o,n,a,0,u,h,d)}else l.texImage2D(e,t,r,o,n,0,u,h,d)}}_compressedTexImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,o,n,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,o,n,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,o,n,a,0,s)}else l.compressedTexImage2D(e,t,r,o,n,0,s)}async _compressOnWorker(e){const{width:t,height:r,context:i,flipped:o,preMultiplyAlpha:n,hasMipmap:a}=this._descriptor,s=this._descriptor.compress?.compressionTracker,c=this._descriptor.compress?.compressionCallback,{compressedTextureETC:d,compressedTextureS3TC:u}=i.capabilities;if(!T.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!d&&!u)return;this.abortCompression();const h=new AbortController;let m;this._compressionAbortController=h,s?.increment();try{e instanceof Uint8Array?m=e.buffer:(m=await createImageBitmap(e,{imageOrientation:o?"flipY":"none"}),(0,l.Te)(h));const i={data:m,width:t,height:r,needsFlip:e instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:a,hasETC:!!d,hasS3TC:!!u},s=await T.compressionWorkerHandle.invoke(i,h.signal,1);if((0,l.Te)(h),s.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=s.internalFormat,this._setData(s.compressedTexture),c?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||M().error("Texture compression failed!")}finally{s?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m instanceof ImageBitmap&&m.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:s}=this._descriptor;const l=32879===s;if(null==r||null==o||l&&null==n)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||l&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),l&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>c,rA:()=>d});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(31821));function c(e,t){!function(e,t,...r){e.constants.add("groundSliceOpacity","float",.2),h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (rejectBySlice(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(l.H`void discardBySlice(vec3 pos) { }
|
|
749
|
-
vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,new s.W("slicePlaneOrigin",(e,r)=>v(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>g(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>g(t,e,r,r.slicePlane?.basis2)))}function d(e,t){h(e,t,new s.W("slicePlaneOrigin",(e,r)=>v(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>g(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>g(t,e,r,r.slicePlane?.basis2)))}r(65786).Y;const u=l.H`struct SliceFactors {
|
|
750
|
-
float front;
|
|
751
|
-
float side0;
|
|
752
|
-
float side1;
|
|
753
|
-
float side2;
|
|
754
|
-
float side3;
|
|
755
|
-
};
|
|
756
|
-
SliceFactors calculateSliceFactors(vec3 pos) {
|
|
757
|
-
vec3 rel = pos - slicePlaneOrigin;
|
|
758
|
-
vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);
|
|
759
|
-
float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);
|
|
760
|
-
float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);
|
|
761
|
-
float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);
|
|
762
|
-
float basis1Dot = dot(slicePlaneBasis1, rel);
|
|
763
|
-
float basis2Dot = dot(slicePlaneBasis2, rel);
|
|
764
|
-
return SliceFactors(
|
|
765
|
-
dot(slicePlaneNormal, pos) + slicePlaneW,
|
|
766
|
-
-basis1Dot - basis1Len2,
|
|
767
|
-
basis1Dot - basis1Len2,
|
|
768
|
-
-basis2Dot - basis2Len2,
|
|
769
|
-
basis2Dot - basis2Len2
|
|
770
|
-
);
|
|
771
|
-
}
|
|
772
|
-
bool sliceByFactors(SliceFactors factors) {
|
|
773
|
-
return factors.front < 0.0
|
|
774
|
-
&& factors.side0 < 0.0
|
|
775
|
-
&& factors.side1 < 0.0
|
|
776
|
-
&& factors.side2 < 0.0
|
|
777
|
-
&& factors.side3 < 0.0;
|
|
778
|
-
}
|
|
779
|
-
bool sliceEnabled() {
|
|
780
|
-
return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
|
|
781
|
-
}
|
|
782
|
-
bool rejectBySlice(vec3 pos) {
|
|
783
|
-
return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
|
|
784
|
-
}`;function h(e,t,...r){t.hasSlicePlane?(e.uniforms.add(...r),e.code.add(u)):e.code.add("bool rejectBySlice(vec3 pos) { return false; }")}function m(e,t,r){return e.instancedDoublePrecision?(0,n.h)(_,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function p(e,t){return null!=e?(0,n.e)(x,t.origin,e):t.origin}function f(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,i.Tl)(b,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function v(e,t,r){if(null==r.slicePlane)return a.uY;const i=m(e,t,r),o=p(i,r.slicePlane),s=f(e,i,r);return null!=s?(0,n.p)(x,o,s):o}function g(e,t,r,i){if(null==i||null==r.slicePlane)return a.uY;const o=m(e,t,r),s=p(o,r.slicePlane),l=f(e,o,r);return null!=l?((0,n.i)(w,i,s),(0,n.p)(x,s,l),(0,n.p)(w,w,l),(0,n.e)(w,w,x)):i}const _=(0,a.vt)(),x=(0,a.vt)(),w=(0,a.vt)(),b=(0,o.vt)()},76597:(e,t,r)=>{r.d(t,{d:()=>n});var i=r(33120),o=r(31821);function n(e){(0,i.i$)(e),e.vertex.code.add(o.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
|
|
785
|
-
vec4 eye = view * vec4(pos, 1.0);
|
|
786
|
-
depth = calculateLinearDepth(nearFar,eye.z);
|
|
787
|
-
return proj * eye;
|
|
788
|
-
}`),e.vertex.code.add(o.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
|
|
789
|
-
return proj * (view * vec4(pos, 1.0));
|
|
790
|
-
}`)}},77108:(e,t,r)=>{r.d(t,{E:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec2",0,(i,o)=>i.setUniform2fv(e,t(o),r))}}},77194:(e,t,r)=>{r.d(t,{PS:()=>o,fc:()=>n}),r(44208);var i=r(34727);class o{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(e,t,r,i){r?(this._scale=Math.min(r.divisor/(t-r.offset),1),this._angleFactor=function(e){return Math.abs(e)**3}(e),this._minScale=null!=i?Math.min(r.minPixelSize/i,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(e){const{_scale:t,_angleFactor:r,_minScale:o}=this;return e*(0,i.qE)((0,i.Cc)(t,1,r),o,1)}applyVec2(e,t){e[0]=this.apply(t[0]),e[1]=this.apply(t[1])}}class n{constructor(){this.evaluator=new o,this.alignmentEvaluator=new o}update(e,t,r,i,o,n){this.evaluator.update(e,t,r,i),this.alignmentEvaluator.update(e,t,o??r,(o?n:null)??i)}}},77695:(e,t,r)=>{r.d(t,{W:()=>u});var i=r(29242),o=r(48163),n=r(99208),a=r(47286),s=r(31821),l=r(35644),c=r(15976),d=r(63761);function u(e,t){const r=e.fragment,{hasVertexTangents:u,doubleSidedMode:h,hasNormalTexture:m,textureCoordinateType:p,bindType:f,hasNormalTextureTransform:v}=t;u?(e.attributes.add("tangent","vec4"),e.varyings.add("vTangent","vec4"),2===h?r.code.add(s.H`mat3 computeTangentSpace(vec3 normal) {
|
|
791
|
-
float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
|
|
792
|
-
vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
|
|
793
|
-
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
|
|
794
|
-
return mat3(tangent, bitangent, normal);
|
|
795
|
-
}`):r.code.add(s.H`mat3 computeTangentSpace(vec3 normal) {
|
|
796
|
-
float tangentHeadedness = vTangent.w;
|
|
797
|
-
vec3 tangent = normalize(vTangent.xyz);
|
|
798
|
-
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
|
|
799
|
-
return mat3(tangent, bitangent, normal);
|
|
800
|
-
}`)):r.code.add(s.H`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {
|
|
801
|
-
vec3 Q1 = dFdx(pos);
|
|
802
|
-
vec3 Q2 = dFdy(pos);
|
|
803
|
-
vec2 stx = dFdx(st);
|
|
804
|
-
vec2 sty = dFdy(st);
|
|
805
|
-
float det = stx.t * sty.s - sty.t * stx.s;
|
|
806
|
-
vec3 T = stx.t * Q2 - sty.t * Q1;
|
|
807
|
-
T = T - normal * dot(normal, T);
|
|
808
|
-
T *= inversesqrt(max(dot(T,T), 1.e-10));
|
|
809
|
-
vec3 B = sign(det) * cross(normal, T);
|
|
810
|
-
return mat3(T, B, normal);
|
|
811
|
-
}`),m&&0!==p&&(e.include(n.r,t),r.uniforms.add(1===f?new d.N("normalTexture",e=>e.textureNormal):new c.o("normalTexture",e=>e.textureNormal)),v&&(r.uniforms.add(new a.G("scale",e=>e.scale??o.Un)),r.uniforms.add(new l.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??i.zK))),r.code.add(s.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
|
|
812
|
-
vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),v&&r.code.add(s.H`mat3 normalRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0,
|
|
813
|
-
normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
|
|
814
|
-
0.0, 0.0, 0.0 );
|
|
815
|
-
rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(s.H`return tangentSpace * rawNormal;
|
|
816
|
-
}`))}},78662:(e,t,r)=>{r.d(t,{Gd:()=>l,VC:()=>c}),r(44208);var i=r(34727),o=(r(77690),r(29242),r(58083),r(9093)),n=r(38954),a=r(51850),s=(r(87317),r(91829),r(31756),r(26857),r(16943),r(65786));class l extends s.Y{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}function c(e,t,r){if(!t.vvSize)return(0,n.h)(e,1,1,1),e;if(Number.isNaN(r[0]))return(0,n.d)(e,t.vvSize.fallback);for(let o=0;o<3;++o){const n=t.vvSize.offset[o]+r[0]*t.vvSize.factor[o];e[o]=(0,i.qE)(n,t.vvSize.minSize[o],t.vvSize.maxSize[o])}return e}(0,o.vt)(),(0,a.vt)(),(0,o.vt)()},78754:(e,t,r)=>{r.d(t,{F:()=>n});var i=r(24326),o=r(97146);class n{constructor(e){this.id=(0,i.c)(),this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,o.Dg)(r.indices)})}get attributes(){return this._attributes}}},82048:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(31821);function o(e,t=!0){e.attributes.add("position","vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
|
|
817
|
-
gl_Position = vec4(position, 0.0, 1.0);
|
|
818
|
-
${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
|
|
819
|
-
`)}},87170:(e,t,r)=>{r.d(t,{V:()=>T});var i=r(9093),o=r(38954),n=r(97146),a=r(57917),s=r(29920),l=r(78754),c=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,o.e)(m,t,e),(0,o.e)(p,r,e),.5*(0,o.b)((0,o.f)(m,m,p))}r(32114),new d.I(u.vt),new d.I(()=>function(e){return e?{p0:(0,c.o8)(e.p0),p1:(0,c.o8)(e.p1),p2:(0,c.o8)(e.p2)}:{p0:(0,c.vt)(),p1:(0,c.vt)(),p2:(0,c.vt)()}}());const m=(0,c.vt)(),p=(0,c.vt)(),f=(0,c.vt)(),v=(0,c.vt)(),g=(0,c.vt)(),_=(0,c.vt)();var x=r(24326);class w{constructor(){this.uid=(0,x.c)()}}class b extends w{constructor(e){super(),this.highlightName=e,this.channel=0}}var y=r(620),M=r(94656);class T extends l.F{constructor(e,t,r=null,i=0,o=null,n=-1,a){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=o,this.edgeIndicesLength=n,this.baseGeometry=a,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null;const s=this.positionAttribute;null!=s&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=s.indices.length)}instantiate(e={}){const t=new T(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,a.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,M.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.p)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.h)(t,0,0,0),(0,o.h)(_,0,0,0);let a=0,s=0;for(let e=0;e<n.length-2;e+=3){const l=n[e]*r,c=n[e+1]*r,d=n[e+2]*r;(0,o.h)(f,i[l],i[l+1],i[l+2]),(0,o.h)(v,i[c],i[c+1],i[c+2]),(0,o.h)(g,i[d],i[d+1],i[d+2]);const u=h(f,v,g);u?((0,o.i)(f,f,v),(0,o.i)(f,f,g),(0,o.j)(f,f,1/3*u),(0,o.i)(t,t,f),a+=u):((0,o.i)(_,_,f),(0,o.i)(_,_,v),(0,o.i)(_,_,g),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.j)(t,t,1/a),0):0===s||((0,o.j)(t,_,1/s),0)))}(this.positionAttribute,e)}_computeAttachmentOriginLines(e){const t=this.positionAttribute;return function(e,t,r){if(!e)return!1;(0,o.h)(r,0,0,0),(0,o.h)(_,0,0,0);let i=0,n=0;const{size:a,data:s,indices:l}=e,c=l.length-1,d=c+(t?2:0);for(let e=0;e<d;e+=2){const t=e<c?e+1:0,d=l[e<c?e:c]*a,u=l[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],v[0]=s[u],v[1]=s[u+1],v[2]=s[u+2],(0,o.j)(f,(0,o.i)(f,f,v),.5);const h=(0,o.G)(f,v);h>0?((0,o.i)(r,r,(0,o.j)(f,f,h)),i+=h):0===i&&((0,o.i)(_,_,f),n++)}return 0!==i?((0,o.j)(r,r,1/i),!0):0!==n&&((0,o.j)(r,_,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.h)(t,0,0,0);let a=-1,s=0;for(let e=0;e<n.length;e++){const o=n[e]*r;a!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],s++),a=o}return s>1&&(0,o.j)(t,t,1/s),s>0}(this.positionAttribute,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.positionAttribute;if(!e||0===e.indices.length)return null;const t=0===this.type?3:1;(0,y.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,n.tM)(e.indices.length/t);return new s.j(r,t,e)}get transformation(){return this._transformation??i.zK}set transformation(e){this._transformation=e&&e!==i.zK?(0,i.o8)(e):null}get highlights(){return this._highlights||C}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new b(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const C=new Set},89390:(e,t,r)=>{r.d(t,{kA:()=>C,a8:()=>M,eU:()=>T});var i=r(40876),o=(r(44208),r(38954)),n=r(51850),a=r(87317),s=r(91829),l=r(23205),c=r(14314),d=r(31821);function u(e,t){const r=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===r?(e.uniforms.add(new l.d("lightingAmbientSH0",({lighting:e})=>(0,o.h)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0]))),e.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
820
|
-
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
821
|
-
return ambientLight * (1.0 - ambientOcclusion);
|
|
822
|
-
}`)):1===r?(e.uniforms.add(new c.I("lightingAmbientSH_R",({lighting:e})=>(0,a.c)(m,e.sh.r[0],e.sh.r[1],e.sh.r[2],e.sh.r[3])),new c.I("lightingAmbientSH_G",({lighting:e})=>(0,a.c)(m,e.sh.g[0],e.sh.g[1],e.sh.g[2],e.sh.g[3])),new c.I("lightingAmbientSH_B",({lighting:e})=>(0,a.c)(m,e.sh.b[0],e.sh.b[1],e.sh.b[2],e.sh.b[3]))),e.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
823
|
-
vec4 sh0 = vec4(
|
|
824
|
-
0.282095,
|
|
825
|
-
0.488603 * normal.x,
|
|
826
|
-
0.488603 * normal.z,
|
|
827
|
-
0.488603 * normal.y
|
|
828
|
-
);
|
|
829
|
-
vec3 ambientLight = vec3(
|
|
830
|
-
dot(lightingAmbientSH_R, sh0),
|
|
831
|
-
dot(lightingAmbientSH_G, sh0),
|
|
832
|
-
dot(lightingAmbientSH_B, sh0)
|
|
833
|
-
);
|
|
834
|
-
return ambientLight * (1.0 - ambientOcclusion);
|
|
835
|
-
}`)):2===r&&(e.uniforms.add(new l.d("lightingAmbientSH0",({lighting:e})=>(0,o.h)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0])),new c.I("lightingAmbientSH_R1",({lighting:e})=>(0,a.c)(m,e.sh.r[1],e.sh.r[2],e.sh.r[3],e.sh.r[4])),new c.I("lightingAmbientSH_G1",({lighting:e})=>(0,a.c)(m,e.sh.g[1],e.sh.g[2],e.sh.g[3],e.sh.g[4])),new c.I("lightingAmbientSH_B1",({lighting:e})=>(0,a.c)(m,e.sh.b[1],e.sh.b[2],e.sh.b[3],e.sh.b[4])),new c.I("lightingAmbientSH_R2",({lighting:e})=>(0,a.c)(m,e.sh.r[5],e.sh.r[6],e.sh.r[7],e.sh.r[8])),new c.I("lightingAmbientSH_G2",({lighting:e})=>(0,a.c)(m,e.sh.g[5],e.sh.g[6],e.sh.g[7],e.sh.g[8])),new c.I("lightingAmbientSH_B2",({lighting:e})=>(0,a.c)(m,e.sh.b[5],e.sh.b[6],e.sh.b[7],e.sh.b[8]))),e.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
836
|
-
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
837
|
-
vec4 sh1 = vec4(
|
|
838
|
-
0.488603 * normal.x,
|
|
839
|
-
0.488603 * normal.z,
|
|
840
|
-
0.488603 * normal.y,
|
|
841
|
-
1.092548 * normal.x * normal.y
|
|
842
|
-
);
|
|
843
|
-
vec4 sh2 = vec4(
|
|
844
|
-
1.092548 * normal.y * normal.z,
|
|
845
|
-
0.315392 * (3.0 * normal.z * normal.z - 1.0),
|
|
846
|
-
1.092548 * normal.x * normal.z,
|
|
847
|
-
0.546274 * (normal.x * normal.x - normal.y * normal.y)
|
|
848
|
-
);
|
|
849
|
-
ambientLight += vec3(
|
|
850
|
-
dot(lightingAmbientSH_R1, sh1),
|
|
851
|
-
dot(lightingAmbientSH_G1, sh1),
|
|
852
|
-
dot(lightingAmbientSH_B1, sh1)
|
|
853
|
-
);
|
|
854
|
-
ambientLight += vec3(
|
|
855
|
-
dot(lightingAmbientSH_R2, sh2),
|
|
856
|
-
dot(lightingAmbientSH_G2, sh2),
|
|
857
|
-
dot(lightingAmbientSH_B2, sh2)
|
|
858
|
-
);
|
|
859
|
-
return ambientLight * (1.0 - ambientOcclusion);
|
|
860
|
-
}`),1!==t.pbrMode&&2!==t.pbrMode||e.code.add(d.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
|
|
861
|
-
vec3 calculateAmbientRadiance(float ambientOcclusion)
|
|
862
|
-
{
|
|
863
|
-
vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
|
|
864
|
-
return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
|
|
865
|
-
}`))}const h=(0,n.vt)(),m=(0,s.vt)();var p=r(14527),f=r(98619),v=r(22393),g=r(89786),_=r(32976),x=r(33094);r(34727),(0,n.vt)();const w=.4;function b(e){e.code.add(d.H`float mapChannel(float x, vec2 p) {
|
|
866
|
-
return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
|
|
867
|
-
}`),e.code.add(d.H`vec3 blackLevelSoftCompression(vec3 color, float averageAmbientRadiance) {
|
|
868
|
-
vec2 p = vec2(0.02, 0.0075) * averageAmbientRadiance;
|
|
869
|
-
return vec3(mapChannel(color.x, p), mapChannel(color.y, p), mapChannel(color.z, p));
|
|
870
|
-
}`)}function y(e){e.code.add(d.H`vec3 tonemapACES(vec3 x) {
|
|
871
|
-
return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
|
|
872
|
-
}`)}function M(e){e.constants.add("ambientBoostFactor","float",w)}function T(e){e.uniforms.add(new x.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function C(e,t){const{pbrMode:r,spherical:o,hasColorTexture:n}=t;e.include(p.n,t),0!==r&&e.include(v.c,t),e.include(u,t),e.include(g.p),e.include(y,t);const a=!(2===r&&!n);switch(a&&e.include(b),e.code.add(d.H`
|
|
873
|
-
const float GAMMA_SRGB = ${d.H.float(i.Tf)};
|
|
874
|
-
const float INV_GAMMA_SRGB = 0.4761904;
|
|
875
|
-
${(0,d.If)(0!==r,"const float GROUND_REFLECTANCE = 0.2;")}
|
|
876
|
-
`),M(e),T(e),(0,f.Gc)(e),e.code.add(d.H`
|
|
877
|
-
float additionalDirectedAmbientLight(float lightAlignment) {
|
|
878
|
-
return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
float additionalDirectedAmbientLight(vec3 vPosWorld) {
|
|
882
|
-
float lightAlignment = dot(${o?d.H`normalize(vPosWorld)`:d.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
|
|
883
|
-
return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
|
|
884
|
-
}
|
|
885
|
-
`),(0,f.O4)(e),e.code.add(d.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
|
|
886
|
-
float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
|
|
887
|
-
return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
|
|
888
|
-
}`),r){case 0:case 4:case 3:e.include(f.Vt),e.code.add(d.H`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) {
|
|
889
|
-
vec3 mainLighting = applyShading(normalWorld, shadow);
|
|
890
|
-
vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
|
|
891
|
-
vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
|
|
892
|
-
vec3 totalLight = mainLighting + ambientLighting + additionalLight;
|
|
893
|
-
totalLight = min(totalLight, vec3(PI));
|
|
894
|
-
vec3 outColor = vec3((albedoLinear / PI) * totalLight);
|
|
895
|
-
return pow(outColor, vec3(INV_GAMMA_SRGB));
|
|
896
|
-
}`);break;case 1:case 2:e.code.add(d.H`const float fillLightIntensity = 0.25;
|
|
897
|
-
const float horizonLightDiffusion = 0.4;
|
|
898
|
-
const float additionalAmbientIrradianceFactor = 0.02;
|
|
899
|
-
vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
|
|
900
|
-
vec3 viewDir, vec3 groundNormal, vec3 mrr, float additionalAmbientIrradiance) {
|
|
901
|
-
vec3 viewDirection = -viewDir;
|
|
902
|
-
vec3 h = normalize(viewDirection + mainLightDirection);
|
|
903
|
-
PBRShadingInfo inputs;
|
|
904
|
-
inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);
|
|
905
|
-
inputs.NdotNG = clamp(dot(normal, groundNormal), -1.0, 1.0);
|
|
906
|
-
vec3 reflectedView = normalize(reflect(viewDirection, normal));
|
|
907
|
-
inputs.RdotNG = clamp(dot(reflectedView, groundNormal), -1.0, 1.0);
|
|
908
|
-
inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
|
|
909
|
-
inputs.ssao = ssao;
|
|
910
|
-
inputs.metalness = mrr[0];
|
|
911
|
-
inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),e.code.add(d.H`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
|
|
912
|
-
inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
|
|
913
|
-
inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?e.uniforms.add(new _.o("hasFillLights",e=>e.enableFillLights)):e.constants.add("hasFillLights","bool",!1),e.code.add(d.H`vec3 ambientDir = vec3(5.0 * groundNormal[1] - groundNormal[0] * groundNormal[2], - 5.0 * groundNormal[0] - groundNormal[2] * groundNormal[1], groundNormal[1] * groundNormal[1] + groundNormal[0] * groundNormal[0]);
|
|
914
|
-
ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
|
|
915
|
-
inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
|
|
916
|
-
float NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
|
|
917
|
-
vec3 mainLightIrradianceComponent = NdotL * (1.0 - shadow) * mainLightIntensity;
|
|
918
|
-
vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
|
|
919
|
-
vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
|
|
920
|
-
inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
|
|
921
|
-
inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),e.uniforms.add(new x.U("lightingSpecularStrength",e=>e.lighting.mainLight.specularStrength),new x.U("lightingEnvironmentStrength",e=>e.lighting.mainLight.environmentStrength)).code.add(d.H`vec3 horizonRingDir = inputs.RdotNG * groundNormal - reflectedView;
|
|
922
|
-
vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
|
|
923
|
-
inputs.NdotH_Horizon = dot(normal, horizonRingH);
|
|
924
|
-
float NdotH = clamp(dot(normal, h), 0.0, 1.0);
|
|
925
|
-
vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow);
|
|
926
|
-
vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity;
|
|
927
|
-
vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
|
|
928
|
-
float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0));
|
|
929
|
-
inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
|
|
930
|
-
inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
|
|
931
|
-
inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE);`),e.code.add(d.H`
|
|
932
|
-
vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
|
|
933
|
-
vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
|
|
934
|
-
vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent;
|
|
935
|
-
${a?d.H`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:d.H`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
|
|
936
|
-
return outColor;
|
|
937
|
-
}
|
|
938
|
-
`);break;case 5:case 6:(0,f.Gc)(e),(0,f.O4)(e),e.code.add(d.H`const float roughnessTerrain = 0.5;
|
|
939
|
-
const float specularityTerrain = 0.5;
|
|
940
|
-
const vec3 fresnelReflectionTerrain = vec3(0.04);
|
|
941
|
-
vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) {
|
|
942
|
-
vec3 viewDirection = -vd;
|
|
943
|
-
vec3 h = normalize(viewDirection + mainLightDirection);
|
|
944
|
-
float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0);
|
|
945
|
-
float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0);
|
|
946
|
-
float NdotH = clamp(dot(n, h), 0.0, 1.0);
|
|
947
|
-
float NdotNG = clamp(dot(n, nup), -1.0, 1.0);
|
|
948
|
-
vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB));
|
|
949
|
-
float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2];
|
|
950
|
-
vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain;
|
|
951
|
-
vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0));
|
|
952
|
-
vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity;
|
|
953
|
-
vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al;
|
|
954
|
-
vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent;
|
|
955
|
-
vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5;
|
|
956
|
-
vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI;
|
|
957
|
-
vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity;
|
|
958
|
-
vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV);
|
|
959
|
-
vec3 specularColor = f0 * dfg.x + f90 * dfg.y;
|
|
960
|
-
vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent;
|
|
961
|
-
vec3 outColorLinear = outDiffColor + specularComponent;
|
|
962
|
-
vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB));
|
|
963
|
-
return outColor;
|
|
964
|
-
}`)}}(0,n.vt)()},89786:(e,t,r)=>{function i(e){const t=.3183098861837907;e.constants.add("PI","float",3.141592653589793),e.constants.add("LIGHT_NORMALIZATION","float",t),e.constants.add("INV_PI","float",t),e.constants.add("ONE_QUATER_PI","float",.78539816339745),e.constants.add("HALF_PI","float",1.570796326794897),e.constants.add("THREE_QUATER_PI","float",2.35619449019234),e.constants.add("TWO_PI","float",6.28318530717958),e.constants.add("PI_SQUARED","float",9.86960440108936)}r.d(t,{p:()=>i})},90644:(e,t,r)=>{function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function o(e,t,r,i,o=32774,n=32774,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:o,opAlpha:n,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}r.d(t,{Ey:()=>b,RC:()=>n,T8:()=>a,Uy:()=>d,Xt:()=>c,kn:()=>u,p3:()=>o}),i(0,771),i(1,0),i(1,1);const n=i(1,771),a=o(770,1,771,771),s=(o(0,0,768,1),{face:1029,mode:2305}),l={face:1028,mode:2305},c=e=>2===e?s:1===e?l:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function h(e){return T.intern(e)}function m(e){return S.intern(e)}function p(e){return A.intern(e)}function f(e){return R.intern(e)}function v(e){return O.intern(e)}function g(e){return D.intern(e)}function _(e){return N.intern(e)}function x(e){return L.intern(e)}function w(e){return V.intern(e)}function b(e){return G.intern(e)}class y{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function M(e){return"["+e.join(",")+"]"}const T=new y(C,e=>({__tag:"Blending",...e}));function C(e){return e?M([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const S=new y(E,e=>({__tag:"Culling",...e}));function E(e){return e?M([e.face,e.mode]):null}const A=new y(I,e=>({__tag:"PolygonOffset",...e}));function I(e){return e?M([e.factor,e.units]):null}const R=new y(F,e=>({__tag:"DepthTest",...e}));function F(e){return e?M([e.func]):null}const O=new y(P,e=>({__tag:"StencilTest",...e}));function P(e){return e?M([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const D=new y(H,e=>({__tag:"DepthWrite",...e}));function H(e){return e?M([e.zNear,e.zFar]):null}const N=new y(z,e=>({__tag:"ColorWrite",...e}));function z(e){return e?M([e.r,e.g,e.b,e.a]):null}const L=new y(B,e=>({__tag:"StencilWrite",...e}));function B(e){return e?M([e.mask]):null}const V=new y(U,e=>({__tag:"DrawBuffers",...e}));function U(e){return e?M(e.buffers):null}const G=new y(function(e){return e?M([C(e.blending),E(e.culling),I(e.polygonOffset),F(e.depthTest),P(e.stencilTest),H(e.depthWrite),z(e.colorWrite),B(e.stencilWrite),U(e.drawBuffers)]):null},e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:p(e.polygonOffset),depthTest:f(e.depthTest),stencilTest:v(e.stencilTest),depthWrite:g(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:x(e.stencilWrite),drawBuffers:w(e.drawBuffers)}))},92700:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(31821);function o(e,t){t.hasVertexColors?(e.attributes.add("color","vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.H`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.H`
|
|
965
|
-
void forwardNormalizedVertexColor() { vColor = color * ${i.H.float(1/255)}; }
|
|
966
|
-
`)):e.vertex.code.add(i.H`void forwardVertexColor() {}
|
|
967
|
-
void forwardNormalizedVertexColor() {}`)}},94656:(e,t,r)=>{r.d(t,{Y2:()=>c,en:()=>l});var i=r(49186),o=r(44208),n=r(53966);const a=()=>n.A.getLogger("esri.views.webgl.checkWebGLError"),s=!!(0,o.A)("enable-feature:webgl-debug");function l(){return s}function c(e,t=l()){if(t){const t=function(e){switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e);if(t){const e=(new Error).stack;a().error(new i.A("webgl-error","WebGL error occurred",{message:t,stack:e}))}}}},95774:(e,t,r)=>{r.d(t,{S:()=>m,b:()=>h});var i=r(82048),o=r(52540),n=r(68259),a=r(20304),s=r(31821),l=r(15976),c=r(63761),d=r(14113);const u=4;function h(){const e=new d.N5,t=e.fragment;e.include(i.c);const r=(u+1)/2,h=1/(2*r*r);return t.include(o.E),t.uniforms.add(new c.N("depthMap",e=>e.depthTexture),new l.o("tex",e=>e.colorTexture),new n.t("blurSize",e=>e.blurSize),new a.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(s.H`
|
|
968
|
-
void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
|
|
969
|
-
float c = texture(tex, uv).r;
|
|
970
|
-
float d = linearDepthFromTexture(depthMap, uv);
|
|
971
|
-
|
|
972
|
-
float ddiff = d - center_d;
|
|
973
|
-
|
|
974
|
-
float w = exp(-r * r * ${s.H.float(h)} - ddiff * ddiff * sharpness);
|
|
975
|
-
wTotal += w;
|
|
976
|
-
bTotal += w * c;
|
|
977
|
-
}
|
|
978
|
-
`),e.outputs.add("fragBlur","float"),t.main.add(s.H`
|
|
979
|
-
float b = 0.0;
|
|
980
|
-
float w_total = 0.0;
|
|
981
|
-
|
|
982
|
-
float center_d = linearDepthFromTexture(depthMap, uv);
|
|
983
|
-
|
|
984
|
-
float sharpness = -0.05 * projScale / center_d;
|
|
985
|
-
for (int r = -${s.H.int(u)}; r <= ${s.H.int(u)}; ++r) {
|
|
986
|
-
float rf = float(r);
|
|
987
|
-
vec2 uvOffset = uv + rf * blurSize;
|
|
988
|
-
blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
|
|
989
|
-
}
|
|
990
|
-
fragBlur = b / w_total;`),e}const m=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}))},96336:(e,t,r)=>{r.d(t,{Y:()=>n});var i=r(21818),o=r(31821);function n(e,t){switch(e.fragment.code.add(o.H`vec3 screenDerivativeNormal(vec3 positionView) {
|
|
991
|
-
return normalize(cross(dFdx(positionView), dFdy(positionView)));
|
|
992
|
-
}`),t.normalType){case 1:e.attributes.add("normalCompressed","vec2"),e.vertex.code.add(o.H`vec3 decompressNormal(vec2 normal) {
|
|
993
|
-
float z = 1.0 - abs(normal.x) - abs(normal.y);
|
|
994
|
-
return vec3(normal + sign(normal) * min(z, 0.0), z);
|
|
995
|
-
}
|
|
996
|
-
vec3 normalModel() {
|
|
997
|
-
return decompressNormal(normalCompressed);
|
|
998
|
-
}`);break;case 0:e.attributes.add("normal","vec3"),e.vertex.code.add(o.H`vec3 normalModel() {
|
|
999
|
-
return normal;
|
|
1000
|
-
}`);break;default:(0,i.Xb)(t.normalType);case 2:case 3:}}},96598:(e,t,r)=>{r.d(t,{Z:()=>a});var i=r(52540),o=r(31821),n=r(12791);function a(e,{occlusionPass:t,terrainDepthTest:r,cullAboveTerrain:a}){const{vertex:s,fragment:l,varyings:c}=e;if(!r)return s.code.add("void forwardViewPosDepth(vec3 pos) {}"),void l.code.add(`${t?"bool":"void"} discardByTerrainDepth() { ${(0,o.If)(t,"return false;")}}`);c.add("viewPosDepth","float",{invariant:!0}),s.code.add("void forwardViewPosDepth(vec3 pos) {\n viewPosDepth = pos.z;\n }"),l.include(i.E),l.uniforms.add(new n.x("terrainDepthTexture",e=>e.terrainDepth?.attachment)).code.add(o.H`
|
|
1001
|
-
${t?"bool":"void"} discardByTerrainDepth() {
|
|
1002
|
-
float depth = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0).r;
|
|
1003
|
-
float linearDepth = linearizeDepth(depth);
|
|
1004
|
-
${t?"return viewPosDepth < linearDepth && depth < 1.0;":`if(viewPosDepth ${a?">":"<="} linearDepth) discard;`}
|
|
1005
|
-
}`)}},98353:(e,t,r)=>{r.d(t,{h:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"mat3",2,(i,o,n)=>i.setUniformMatrix3fv(e,t(o,n),r))}}},98619:(e,t,r)=>{r.d(t,{Gc:()=>n,O4:()=>a,Vt:()=>s});var i=r(23205),o=r(31821);function n(e){e.uniforms.add(new i.d("mainLightDirection",e=>e.lighting.mainLight.direction))}function a(e){e.uniforms.add(new i.d("mainLightIntensity",e=>e.lighting.mainLight.intensity))}function s(e){n(e),a(e),e.code.add(o.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
|
|
1006
|
-
float dotVal = clamp(dot(shadingNormal, mainLightDirection), 0.0, 1.0);
|
|
1007
|
-
return mainLightIntensity * ((1.0 - shadow) * dotVal);
|
|
1008
|
-
}`)}},99208:(e,t,r)=>{r.d(t,{r:()=>a});var i=r(53466),o=r(31821);function n(e){e.fragment.code.add(o.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
|
|
1009
|
-
vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
|
|
1010
|
-
vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
|
|
1011
|
-
float maxdUV = 0.125;
|
|
1012
|
-
vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
|
|
1013
|
-
vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
|
|
1014
|
-
return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
|
|
1015
|
-
}`)}function a(e,t){const{textureCoordinateType:r}=t;if(0===r||3===r)return;e.include(i.U,t);const a=2===r;a&&e.include(n),e.fragment.code.add(o.H`
|
|
1016
|
-
vec4 textureLookup(sampler2D tex, vec2 uv) {
|
|
1017
|
-
return ${a?"textureAtlasLookup(tex, uv, vuvRegion)":"texture(tex, uv)"};
|
|
1018
|
-
}
|
|
1019
|
-
`)}}}]);
|