@arcgis/core 5.2.0-next.121 → 5.2.0-next.123
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/Ground.js +1 -1
- package/arcgisGlobal.d.ts +2 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0148cb611bf7c8c5fe8a.js +1 -0
- package/assets/esri/core/workers/chunks/{deb5b1d772ca407654d4.js → 0acc754907395e83bbc6.js} +1 -1
- package/assets/esri/core/workers/chunks/{bcb06a0643b4c83535ee.js → 1302bf9718747cd9fdd9.js} +1 -1
- package/assets/esri/core/workers/chunks/{956432c9d45940983bc2.js → 1b42d163ef22e3565bb7.js} +1 -1
- package/assets/esri/core/workers/chunks/1b551ef3d84d9c1e93f9.js +1 -0
- package/assets/esri/core/workers/chunks/{4adad3312caa24af98ac.js → 1c38ce72160d5a4e4b3d.js} +1 -1
- package/assets/esri/core/workers/chunks/1c3b087fbf2d102376fc.js +1 -0
- package/assets/esri/core/workers/chunks/{9b3813e39992b1b99941.js → 1e46703cb566c25458ad.js} +1 -1
- package/assets/esri/core/workers/chunks/{015cb790262a59857c5f.js → 1f135269aea3931e11b2.js} +1 -1
- package/assets/esri/core/workers/chunks/23279303cd7698314c56.js +1 -0
- package/assets/esri/core/workers/chunks/{4bf2cc4d092601ff2b86.js → 24673aac70d6c949b6fa.js} +1 -1
- package/assets/esri/core/workers/chunks/24cf91aeab53a897e951.js +1 -0
- package/assets/esri/core/workers/chunks/26bc509a031788bfa678.js +1 -0
- package/assets/esri/core/workers/chunks/2ae6deade655fdbc28de.js +1 -0
- package/assets/esri/core/workers/chunks/{37cf4ca2083cd3b6002e.js → 2c7bb5c9751524687002.js} +1 -1
- package/assets/esri/core/workers/chunks/2c8957f9c7610805208c.js +1 -0
- package/assets/esri/core/workers/chunks/{a3c1a5a5c5cbf27b376d.js → 2d592c935571de80a2e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{a917a1df8270860dc514.js → 2f52ad525744b8793d49.js} +1 -1
- package/assets/esri/core/workers/chunks/{6efc5873747b9cd44fb9.js → 323451ef52d0c2805f1d.js} +1 -1
- package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +1 -0
- package/assets/esri/core/workers/chunks/38890ac5917942374ab8.js +1 -0
- package/assets/esri/core/workers/chunks/3e33d953e41b281a120b.js +1 -0
- package/assets/esri/core/workers/chunks/3e52351e06d85bf9bedd.js +1 -0
- package/assets/esri/core/workers/chunks/{fbc5f275c4e5e6bfffaa.js → 462fd57af8ed7921d6ba.js} +1 -1
- package/assets/esri/core/workers/chunks/{1846296be959e28c42bb.js → 475906b079f4f1ddacf2.js} +1 -1
- package/assets/esri/core/workers/chunks/{ea49721fdd2172d1c799.js → 48a2f68e06a2e90b77d0.js} +1 -1
- package/assets/esri/core/workers/chunks/{b6ca73c1384f07b30b74.js → 4bb8432d99a39733368f.js} +1 -1
- package/assets/esri/core/workers/chunks/{c44cbe04efddbbbaec13.js → 4f58e0322707f63f5bf2.js} +1 -1
- package/assets/esri/core/workers/chunks/{0e9f54d7f158195bd203.js → 59cd139712d919e6a738.js} +1 -1
- package/assets/esri/core/workers/chunks/59d5247ac4075b024244.js +1 -0
- package/assets/esri/core/workers/chunks/5afc12671a9a1bb6c56c.js +1 -0
- package/assets/esri/core/workers/chunks/5b9f3c4f65412c66316f.js +1 -0
- package/assets/esri/core/workers/chunks/{be3421ffb5b391bca02e.js → 5d35e0c2665f5e625ee9.js} +1 -1
- package/assets/esri/core/workers/chunks/5e70bfb9d6235a87b87a.js +1 -0
- package/assets/esri/core/workers/chunks/6006bd8a5ed945fa2776.js +1 -0
- package/assets/esri/core/workers/chunks/618927cfcb93dd1d92fd.js +1 -0
- package/assets/esri/core/workers/chunks/6709d24867d275b33d24.js +1 -0
- package/assets/esri/core/workers/chunks/68e24fa3f564c2a5c9fd.js +1 -0
- package/assets/esri/core/workers/chunks/{fd5e61cb6f936eadcfe3.js → 724ea2e2843e6dac0a90.js} +1 -1
- package/assets/esri/core/workers/chunks/7441d121f00ce747c08e.js +1 -0
- package/assets/esri/core/workers/chunks/{e86f83a6514a35255f64.js → 781fa83e8063b8f685dc.js} +1 -1
- package/assets/esri/core/workers/chunks/{a005efcde3ca9def4e6b.js → 78c1b75b1a8937eaa3cd.js} +1 -1
- package/assets/esri/core/workers/chunks/793b072519ded0dc6f34.js +1 -0
- package/assets/esri/core/workers/chunks/{1086f190f94c715bbfe4.js → 7994fce5f36963aadc51.js} +1 -1
- package/assets/esri/core/workers/chunks/7adee504107cb9ad8563.js +1 -0
- package/assets/esri/core/workers/chunks/7efc45858ebd3fd3302e.js +1 -0
- package/assets/esri/core/workers/chunks/7ff536284942c5284a16.js +1 -0
- package/assets/esri/core/workers/chunks/813dd84933b407c8fe86.js +1 -0
- package/assets/esri/core/workers/chunks/8daeac785af725c3ebdf.js +1 -0
- package/assets/esri/core/workers/chunks/{3ab25279aaa30f035038.js → 8daed13400d9e63e65ae.js} +1 -1
- package/assets/esri/core/workers/chunks/9020bd7a0e488d55ef14.js +1 -0
- package/assets/esri/core/workers/chunks/{cf7c06702babd6fa88b4.js → 9af36ee6a0df224859bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{452d069ba7ad6759b558.js → 9c46c7f00d42f5c02b26.js} +1 -1
- package/assets/esri/core/workers/chunks/a3ab53b534e2872131be.js +1 -0
- package/assets/esri/core/workers/chunks/{fa3f824c874f29d24953.js → aa6b2cc8f6f5627891c1.js} +1 -1
- package/assets/esri/core/workers/chunks/ac7af417ebf7721d7400.js +1 -0
- package/assets/esri/core/workers/chunks/aed479c14d93955f4798.js +1 -0
- package/assets/esri/core/workers/chunks/{60c61f34733063730386.js → b013b70e40dfb6ce013e.js} +1 -1
- package/assets/esri/core/workers/chunks/b22de8bf4a4a739bc36d.js +1 -0
- package/assets/esri/core/workers/chunks/b39cd78d2d97bef9909e.js +1 -0
- package/assets/esri/core/workers/chunks/b5f50955c1eee55b67d1.js +1 -0
- package/assets/esri/core/workers/chunks/bdf012e591a8476db467.js +1 -0
- package/assets/esri/core/workers/chunks/{daf7b647bd960d8bad56.js → be52c319a0a81ce1ba36.js} +1 -1
- package/assets/esri/core/workers/chunks/{89edaa1ffa566908ebca.js → ca5a4f62b09cc8579dc0.js} +1 -1
- package/assets/esri/core/workers/chunks/{fbb390c0d92d1536fce3.js → ce1ccf9ec90b786591e5.js} +1 -1
- package/assets/esri/core/workers/chunks/cf0bed7ae27021fd7b05.js +1 -0
- package/assets/esri/core/workers/chunks/cf6f671823fa6c2a9a5e.js +1 -0
- package/assets/esri/core/workers/chunks/{39c5e0f6262f69a62c66.js → d25210574168ead2f813.js} +1 -1
- package/assets/esri/core/workers/chunks/d3378c479052d566317c.js +1 -0
- package/assets/esri/core/workers/chunks/d3ef23923424ad8c5048.js +1 -0
- package/assets/esri/core/workers/chunks/{46388b86d1b10e6121bd.js → d507d7d7a7282fc38e8d.js} +1 -1
- package/assets/esri/core/workers/chunks/dc0816f064be576a2fa6.js +1 -0
- package/assets/esri/core/workers/chunks/{d9b761104ab6e4acaf91.js → dd4ecf81250cc001d040.js} +1 -1
- package/assets/esri/core/workers/chunks/{ab60f3bc18b5ea504f70.js → e0eb89a935509ba34d9b.js} +1 -1
- package/assets/esri/core/workers/chunks/e10fe4c77b8dc4492092.js +1 -0
- package/assets/esri/core/workers/chunks/e4e1db4e9e5f13167401.js +1 -0
- package/assets/esri/core/workers/chunks/e5ee64e2fb5bfcb716d8.js +1 -0
- package/assets/esri/core/workers/chunks/{e755075ac2e02e881fad.js → e6637f9176566382ed3e.js} +1 -1
- package/assets/esri/core/workers/chunks/e6dc68c4bd8eddb168d1.js +1 -0
- package/assets/esri/core/workers/chunks/eb780f2dafa14f776166.js +1 -0
- package/assets/esri/core/workers/chunks/{d9d5f50af047ee7af129.js → eb7f45736c852725b0bb.js} +89 -58
- package/assets/esri/core/workers/chunks/ed31ec586b754241474d.js +1 -0
- package/assets/esri/core/workers/chunks/f38d11be766043413659.js +1 -0
- package/assets/esri/libs/pdfjs/pdf.worker.mjs +63075 -0
- package/assets/esri/libs/pdfjs/wasm/jbig2.wasm +0 -0
- package/assets/esri/libs/pdfjs/wasm/openjpeg.wasm +0 -0
- package/assets/esri/libs/pdfjs/wasm/qcms_bg.wasm +0 -0
- package/assets/esri/libs/pdfjs/wasm/quickjs-eval.wasm +0 -0
- package/assets/esri/widgets/support/SelectionToolbar/t9n/messages.en.json +1 -1
- package/chunks/CloudsComposition.glsl.js +2 -2
- package/chunks/GlobalIllumination.glsl.js +42 -13
- package/chunks/GlobalIlluminationBlur.glsl.js +1 -1
- package/config.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/workers/registry.js +1 -1
- package/geometry/support/geometryUtils.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/meshUtils/elevation.js +1 -1
- package/kernel.js +1 -1
- package/layers/GeospatialPDFLayer.d.ts +40 -0
- package/layers/GeospatialPDFLayer.js +2 -0
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFFrame.js +2 -0
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +5 -0
- package/layers/geospatialPDF/GeospatialPDFParserUtils.js +2 -0
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +2 -0
- package/layers/geospatialPDF/LGIDictMapFrame.js +2 -0
- package/layers/geospatialPDF/Projection.js +2 -0
- package/layers/geospatialPDF/ViewportMeasureFrame.js +2 -0
- package/layers/geospatialPDF/renderExtentUtils.js +2 -0
- package/layers/geospatialPDF/sharedUtils.js +2 -0
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +2 -0
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/LabelClass.js +1 -1
- package/layers/support/layersLoader.js +1 -1
- package/layers/types.d.ts +1 -1
- package/package.json +4 -4
- package/portal/PortalItem.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/OverrideHelper.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/input/MapViewInputManager.js +1 -1
- package/views/2d/input/handlers/KeyPan.js +1 -1
- package/views/2d/input/handlers/KeyRotate.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/layers/GeospatialPDFLayerView2D.js +2 -0
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/2d/layers/support/annodime/virtualFields.js +1 -1
- package/views/2d/types.d.ts +2 -0
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/GeospatialPDFLayerView3D.js +2 -0
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/LayerView3D.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/Intersector.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/support/GroundAndIMSurface.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
- package/views/3d/types.d.ts +2 -0
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +8 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +6 -6
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/SceneView.d.ts +31 -0
- package/views/SceneView.js +1 -1
- package/views/View.d.ts +35 -0
- package/views/View.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileQuerySourceUtils.js +1 -1
- package/views/interactive/options/ViewOptions.d.ts +98 -0
- package/views/interactive/options/ViewOptions.js +2 -0
- package/views/interactive/support/Units.d.ts +10 -2
- package/views/interactive/support/Units.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +27 -5
- package/views/layers/GraphicsLayerView.d.ts +25 -2
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/selection/types.d.ts +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/types.d.ts +9 -3
- package/widgets/ElevationProfile/ElevationProfileLineGround.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +8 -2
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/VisibleElements.d.ts +8 -1
- package/widgets/support/SelectionToolbar/VisibleElements.js +1 -1
- package/widgets/support/SelectionToolbar.d.ts +7 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/assets/esri/core/workers/chunks/01ca17092545d72be7b6.js +0 -1
- package/assets/esri/core/workers/chunks/0b727d7bf3e36e146725.js +0 -1
- package/assets/esri/core/workers/chunks/0bd067a5c0bac96caeb5.js +0 -1
- package/assets/esri/core/workers/chunks/0ff13f7a18b0123d253e.js +0 -1
- package/assets/esri/core/workers/chunks/114bc14c49176f64a2c5.js +0 -1
- package/assets/esri/core/workers/chunks/173417fe995e9bfc49d8.js +0 -1
- package/assets/esri/core/workers/chunks/2cf571d968118b6bdde0.js +0 -1
- package/assets/esri/core/workers/chunks/43436c7ccc6baefc885d.js +0 -1
- package/assets/esri/core/workers/chunks/445b0ca1b70730c9a2e6.js +0 -1
- package/assets/esri/core/workers/chunks/48d3da636be15581fd7d.js +0 -1
- package/assets/esri/core/workers/chunks/501df20cdd09384f6ee2.js +0 -1
- package/assets/esri/core/workers/chunks/50ae209237f104735a30.js +0 -1
- package/assets/esri/core/workers/chunks/54f9062526c2002b7fd7.js +0 -1
- package/assets/esri/core/workers/chunks/56b7ac280bf0be938c14.js +0 -1
- package/assets/esri/core/workers/chunks/61bcbafd676804ce3e1d.js +0 -1
- package/assets/esri/core/workers/chunks/63f7141c71f29dbe8270.js +0 -1
- package/assets/esri/core/workers/chunks/726ca458b98bb4334431.js +0 -1
- package/assets/esri/core/workers/chunks/75410a4de76e67ed5da4.js +0 -1
- package/assets/esri/core/workers/chunks/85780f4fa4b5509f864e.js +0 -1
- package/assets/esri/core/workers/chunks/862754d2d659528fe884.js +0 -1
- package/assets/esri/core/workers/chunks/8675ab3c4dec2f13b9c6.js +0 -1
- package/assets/esri/core/workers/chunks/8a103b6e9534516421e2.js +0 -1
- package/assets/esri/core/workers/chunks/917dec9c004218c58950.js +0 -1
- package/assets/esri/core/workers/chunks/91a51d959ee5c6123c46.js +0 -1
- package/assets/esri/core/workers/chunks/91f451b98e0f696043df.js +0 -1
- package/assets/esri/core/workers/chunks/99ebc99e8d1bca105b5e.js +0 -1
- package/assets/esri/core/workers/chunks/9d92e6f0beed9a8580fa.js +0 -1
- package/assets/esri/core/workers/chunks/a42505b978d54d36d3b6.js +0 -1
- package/assets/esri/core/workers/chunks/a70c59129ea808857d07.js +0 -1
- package/assets/esri/core/workers/chunks/a86a4e550a92f770d6d5.js +0 -1
- package/assets/esri/core/workers/chunks/b45ebb1b64ee7314375e.js +0 -1
- package/assets/esri/core/workers/chunks/b5b30c8447a0f967fa79.js +0 -1
- package/assets/esri/core/workers/chunks/baa8bce361a2677533ec.js +0 -1
- package/assets/esri/core/workers/chunks/c70a32ac0fa49f4493ca.js +0 -1
- package/assets/esri/core/workers/chunks/cf1106eda10f3cccb1bd.js +0 -1
- package/assets/esri/core/workers/chunks/d1b5be1aeab16d36d4b1.js +0 -1
- package/assets/esri/core/workers/chunks/d38252956c3d9e2168f7.js +0 -1
- package/assets/esri/core/workers/chunks/d6130cd8a20d24dd9d3c.js +0 -1
- package/assets/esri/core/workers/chunks/da161f8cbe1cfc5fcf7c.js +0 -1
- package/assets/esri/core/workers/chunks/da5b3421a984cb94fd58.js +0 -1
- package/assets/esri/core/workers/chunks/e52f30dfb7c82491a7f2.js +0 -1
- package/assets/esri/core/workers/chunks/e88eee4c2fc4229c2a8b.js +0 -1
- package/assets/esri/core/workers/chunks/f75e57d3e02f9828b049.js +0 -1
- package/assets/esri/core/workers/chunks/f774e5b94710ccee1af0.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as i,destroyMaybe as r,removeMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as a,createAbortError as o}from"../../../core/promiseUtils.js";import{initial as n,whenOnce as l,watch as c,when as d}from"../../../core/reactiveUtils.js";import{schedule as h}from"../../../core/scheduling.js";import{isUint8Array as u,isFloat32Array as m,isUint32Array as p,isUint16Array as f}from"../../../core/typedArrayUtil.js";import{unitFromRESTJSON as g,convertUnit as y}from"../../../core/units.js";import{property as b,subclass as _}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as v,invert as w}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as T,IDENTITY as C}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as x}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as j}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{normalize as E,sub as M,dot as R,set as O}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as S,freeze as V,clone as U,ZEROS as P,fromValues as I}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as H,clone as A,ONES as D}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMoon as k,isMars as L,getReferenceEllipsoid as F,SphericalECEFSpatialReferenceLike as G}from"../../../geometry/ellipsoidUtils.js";import z from"../../../geometry/HeightModelInfo.js";import{computeTranslationToOriginAndRotation as B}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as N}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as q}from"../../../geometry/projection/projectVectorToVector.js";import{create as W}from"../../../geometry/support/aaBoundingRect.js";import{isCompatible as X}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as $,isWebMercator as Z,equals as Y,isGeographic as J,isCGCS2000 as K}from"../../../geometry/support/spatialReferenceUtils.js";import Q from"../../../geometry/support/WKIDUnitConversion.js";import{BufferViewVec4u8 as ee,BufferViewVec3u8 as te,BufferViewVec2f as ie,BufferViewVec3f as re,BufferViewUint32 as se,BufferViewUint16 as ae}from"../../../geometry/support/buffer/BufferView.js";import{nullId as oe}from"../../../layers/ILyr3DWasmPerSceneView.js";import ne from"../../../layers/support/SceneModification.js";import{getHeightModelInfoFromVCS as le,validateEntity3D as ce,makeCacheKey as de}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as he}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as ue}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as me}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as pe}from"./Lyr3DViewPerformanceInfo.js";import{addLayerViewToWasm as fe,removeLayerViewFromWasm as ge,getLyr3DWasm as ye}from"./Lyr3DWasm.js";import{toWasmModification as be}from"./SceneLayerWorkerHandle.js";import{LayerElevationProvider as _e}from"./i3s/LayerElevationProvider.js";import{IntegratedMesh3DTilesLayerView3DSymbol as ve}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as we,alphaModeConversion as Te,faceCullingConversion as Ce,wrapModeConversion as xe}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as je}from"./support/makeScheduleFunction.js";import{Tiles3DMeshIntersectionHandler as Ee}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as Me}from"../state/Frustum.js";import{ElevationRange as Re}from"../support/ElevationRange.js";import{toBoundingRect as Oe}from"../support/extentUtils.js";import{Obb as Se}from"../support/orientedBoundingBox.js";import{glLayout as Ve}from"../support/buffer/glUtil.js";import{getGroundTransparencyModeFromOpacity as Ue}from"../terrain/TransparencyMode.js";import{ComponentGeometryParameters as Pe,SourceGeometry as Ie}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as He}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as Ae}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as De}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as ke}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as Le}from"../webgl-engine/materials/pbrUtils.js";import Fe from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as Ge,isInEffectiveScaleRange as ze,validateScaleRange as Be}from"../../support/layerViewUtils.js";import{TaskPriority as Ne}from"../../support/Scheduler.js";import{TextureCompressionTracker as qe}from"../../support/TextureCompressionTracker.js";import{CompressedTextureFormat as We,SizedPixelFormat as Xe}from"../../webgl/enums.js";import{alphaCutoff as $e}from"../../../webscene/support/AlphaCutoff.js";var Ze;function Ye(e,t,i){if("image/vnd-ms.dds"===t)switch(i){case"Dxt1":return We.COMPRESSED_RGB_S3TC_DXT1_EXT;case"Dxt5":return We.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if("image/ktx"===t)return"Etc1"===i?We.COMPRESSED_RGB8_ETC2:null;switch(e){case 33319:return Xe.RG8;case 6407:return Xe.RGB8;case 6408:return Xe.RGBA8;case 6403:return Xe.R8;default:return null}}let Je=class extends(me(Fe)){static{Ze=ve}constructor(e){super(e),this[Ze]=!0,this.type="integrated-mesh-3dtiles",this.freeze=!1,this._modifications=new Array,this._visibleGeometryChangedSchedulerHandle=null,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._applySSAO=!has("disable-feature:im-ssao"),this._imShading=!!has("enable-feature:im-shading"),this._imVertexNormals=!!has("enable-feature:im-vertex-normals"),this._lyrHandleToObjects=new Map,this._visibleObjects=new Set,this._loadedObjects=new Set,this._compressionTracker=new qe,this._dbgFlags=new Set;const t=e.view.resourceController;this._memCache=t.memoryController.newCache(`IM3DTiles-${this.uid}`,e=>this._deletePerObjectData(e)),this._replacesTerrain=e.layer.replacesTerrain,this._isUsedAsGroundLayer=e.layer.isUsedAsGroundLayer,this._frameTask=t.scheduler.registerTask(Ne.TILES3D,this),this._frustum=new Me(e.view.renderCoordsHelper)}tryRecycleWith(e,t){return this.canRecycleWith(e)?e.load(t).then(()=>{a(t);const i=this.layer.queryElevationCallback;this.layer=e,this.layer.queryElevationCallback=i}):null}canRecycleWith(e){return e.url===this.layer.url&&"integrated-mesh-3dtiles"===e.type&&e.replacesTerrain===this._replacesTerrain&&e.isUsedAsGroundLayer===this.usedAsGround}initialize(){this._dbg(2,"Tiles3DLayerView3D initialize() called");const{view:e}=this;this._workerHandle=new ue(je(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),n),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;const{signal:t}=this._initializationController;if(await l(()=>e?.defaultsFromMap.heightModelInfoReady,t),a(t),!this._canProjectWithoutEngine())throw Ge("layer",this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._wasmLayerId=await fe(this,t),a(t);const i=new Ee(this);this._intersectionHandler=i,e.sceneIntersectionHelper.addIntersectionHandler(i),this._elevationProvider=new _e({view:e,layerElevationSource:this,intersectionHandler:i});const r=this._replacesTerrain?0:has("enable-feature:im-as-ground")?this.usedAsGround?1:2:1;e.elevationProvider.register(r,this._elevationProvider),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged()),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.overlayManager.renderer.isEmpty,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),n),this._updatingHandles.add(()=>e.state.contentCamera,()=>this._cameraChanged(),n),e.overlayManager.registerDrapeTarget(this),this.addHandles([c(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),d(()=>this.fullOpacity,()=>this._opacityChange()),c(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),n),c(()=>this.freeze,e=>{e?this._wasm?.incrementFrozenLayerViewCount(this):(this._wasm?.decrementFrozenLayerViewCount(this),this._cameraChanged())})]),this._initializationController=null,this.addHandles(d(()=>this._replacesTerrain&&this._wasm?.isTerrainReady||!this._replacesTerrain&&!!has("enable-feature:im-as-ground")&&this.usedAsGround,()=>{this.layer.queryElevationCallback=(e,t)=>this._queryElevation(e,t)},{initial:!0}))}destroy(){if(this.freeze=!1,this._initializationController=i(this._initializationController),this._dbg(2,"Tiles3DLayerView3D destroy() called"),this._workerHandle?.destroyContextAndSelf(this.uid),ge(this),this.layer.queryElevationCallback=null,this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler.destroy(),this._intersectionHandler=null),this._elevationProvider){const e=Array.from(this._lyrHandleToObjects.values()),t=e.reduce((e,{componentObjects:t})=>e+t.length,0);this._elevationProvider.notifyObjectsChangedFunctional(t,t=>{for(const{componentObjects:i}of e)for(const{obb:e}of i)if(!t(e))return}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null}this.view.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._visibleObjects.clear(),this._loadedObjects.clear(),this._usedMemory=0,this._cacheMemory=0,this._memCache.destroy(),this._frameTask.remove(),this._updatingHandles=r(this._updatingHandles),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=s(this._visibleGeometryChangedSchedulerHandle)}get usedAsGround(){return this._isUsedAsGroundLayer}get fullOpacity(){return has("enable-feature:im-as-ground")?this.usedAsGround?this.view.map.ground.opacity:1:this.layer.replacesTerrain?this.view.map.ground.opacity:1}get opaque(){return 0===this._groundTransparencyMode}get invisible(){return 3===this._groundTransparencyMode}get _groundTransparencyMode(){return(has("enable-feature:im-as-ground")?this.usedAsGround:this._replacesTerrain)?Ue(this.fullOpacity,this.view.overlayManager.renderer.isEmpty):0}get _renderOpacity(){switch(this._groundTransparencyMode){case 3:return 0;case 2:return $e;default:return this.fullOpacity}}get hasModifications(){return this._modifications&&this._modifications.length>0}_opacityChange(){const e=this._renderOpacity,t=this._groundTransparencyMode;this.forEachComponentObject(i=>this._collection.updateObjectOpacity(i,e,t))}_cameraChanged(){if(this.freeze)return;const e=this._frustum;e.update(this.view.state.contentCamera);const t=this._visibleObjects;let i=!1;this._loadedObjects.forEach(r=>{const s=r.obb?.intersectsFrustum(e)??!1;s!==r.isVisible&&(r.isVisible=s,s?t.add(r):t.delete(r),r.componentObjects.forEach(e=>this._collection.setObjectVisibility(e,s)),i||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(s,r.elevationRange))}),i&&this._setVisibleElevationRangeDirty()}intersect(e,t,i,r){this._intersectionHandler.intersectRay(e,t,i,r,null,!1)}get ready(){return!this.layer.replacesTerrain||!!this._wasm?.isTerrainReady}_modificationsChanged(){const e=this.useEsriCrs?this.layer.supportedSpatialReferences[1]:this.layer.supportedSpatialReferences[0],t=be(this._layerClippingArea,this._modifications,e,this.view.state.isGlobal);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=W();this._layerClippingArea=Oe(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=h(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e&&!this.layer.replacesTerrain),this.forEachComponentObject(t=>t.updateMaterial({slicePlaneEnabled:e}))}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,he(e))}get _wasm(){return ye(this.view)}_queryElevation(e,t){return this.destroying||this.destroyed?Promise.reject(o()):this._wasm?.queryElevation(this,e,t)??Promise.reject(o())}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get useEsriCrs(){return this._useEsriCrs}get visibleAtCurrentScale(){return this._replacesTerrain||ze(this.layer.effectiveScaleRange,this.view.scale)}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&(this._replacesTerrain||Be(e)&&this.visibleAtCurrentScale)&&this.visibleAtCurrentTimeExtent||!1}get performanceInfo(){let e=0,t=0,i=0,r=0,s=0,a=0;return this._lyrHandleToObjects.forEach(o=>{o.isLoaded?(e+=o.textureMemoryUsage,t+=o.vboMemoryUsage,s++):(i+=o.textureMemoryUsage,r+=o.vboMemoryUsage,a++)}),new pe(this.usedMemory,s,a,et(t),et(e),et(r),et(i))}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if($(this.view.renderSpatialReference)||Z(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&Y(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(115700===this.layer.esriCrsSpatialReference.vcsWkid)return!1;let e=le(this.layer.esriCrsSpatialReference);if(!e){const t=this.layer.esriCrsSpatialReference;let i="meters";!J(t)&&t.wkid&&-1!==t.wkid&&(i=g(Q.units[Q[t.wkid]])),i&&(e=new z({heightModel:"gravity-related-height",heightUnit:i}))}const t=this.view.heightModelInfo;return this._useEsriCrs=0===X(e,t,!1),this._useEsriCrs&&(e&&(this._metersPerVCSUnit=y(1,e.heightUnit,"meters")),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return he(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new Re(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){const e=new Re;0===this._visibleObjects.size?e.setElevationRangeValues(0,0):(e.setElevationRangeValues(1/0,-1/0),this._forEachRelevantVisibleTile(t=>e.expandElevationRange(t.elevationRange)),e.minElevation===1/0&&e.setElevationRangeValues(0,0));const t=this._get("visibleElevationRange");return t&&t.minElevation===e.minElevation&&t.maxElevation===e.maxElevation?t:e}_setVisibleElevationRangeDirty(){this.notifyChange("visibleElevationRange")}_forEachRelevantVisibleTile(e){const{view:t}=this,{spatialReference:i}=t,r=i.isWGS84||i.isWebMercator||K(i)||k(i)||L(i);if(this.view.state.isGlobal||!r)return this.forEachVisibleTile(e);const s=F(i).radius,{eye:a,viewForward:o,near:n}=t.state.contentCamera,l=E(S(),o),c=500,d=Math.max(a[2],c),h=d+s,u=Math.sqrt(h**2-s**2),m=Math.abs(Math.atan2(u,s))*s,p=d>.5*s?.5*Math.PI*s:m,f=S();this.forEachVisibleTile(t=>{const{mbsRadius:i,mbsCenter:r}=t;if(i<0)return;M(f,r,a);const s=R(f,l);Math.abs(s)<p&&s+i>n&&s-i<p&&e(t)})}get fullExtent(){return this.layer.fullExtent}forEachComponentObject(e){this._forEachObject(this._lyrHandleToObjects.values(),e)}forEachVisibleTile(e){for(const t of this._visibleObjects)e(t)}forEachTile(e){for(const t of this._loadedObjects)e(t)}forEachVisibleComponentObject(e){this._forEachObject(this._visibleObjects,e)}_forEachObject(e,t){for(const{componentObjects:i}of e)for(const e of i)t(e)}get drapeTargetType(){return this._replacesTerrain?0:1}isUpdating(){const e=this._wasm;return!this.freeze&&this._wasmLayerId>=0&&null!=e&&(e.isUpdating(this._wasmLayerId)||this._compressionTracker.compressing)}get readyToRun(){return!!this._frameTask?.readyToRun}runTask(e){this._frameTask.processQueue(e)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy");const{entity3d:t}=e;if(!ce(t))throw new Error("entity3D not valid");const i=new Map;let r;try{r=this._createPrimitiveTextureBundles(t,i)}catch(a){throw i.forEach(e=>this._stage?.removeTexture(e)),a}let s=null;try{if(s=await this._createRenderableMain(t,r),this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable aborted due to destroyed instance");const{tileObb:a,componentObjects:o,elevationRange:n}=s;let l=0,c=0,d=0;for(const e of o){const{texture:t,textureMetallicRoughness:i,textureEmissive:r,textureOcclusion:s,textureNormal:a}=e.renderable.drawParameters;l+=(t?.usedMemory??0)+(i?.usedMemory??0)+(r?.usedMemory??0)+(s?.usedMemory??0)+(a?.usedMemory??0),c+=this._collection.getObjectGPUMemoryUsage(e),d+=e.intersectionGeometry.usedMemory}const h=Array.from(i.values()),u=new Qe(e.handle,o,h,d,c,l,a,e.stableNodeId,e.nodeDepth,n);return this._lyrHandleToObjects.set(e.handle,u),()=>{this._memCache.put(de(u.handle),u);const{usedMemory:e}=u;return this._cacheMemory+=e,{memUsageBytes:e}}}catch(a){throw r.forEach(e=>e.cleanup()),s?.componentObjects.forEach(e=>this._collection.destroyObject(e)),i.forEach(e=>this._stage?.removeTexture(e)),a}}_createPrimitiveTextureBundles(e,t){const i=new Array;try{const r=e.desc.geometry;for(const s of e.validPrimitiveIndices){const a=r.prims[s].materialId,o=e.desc.materials?.materials&&null!=a&&a!==oe?e.desc.materials.materials[a]:null;let n=Promise.resolve(it),l=null,c=null,d=null,h=null,u=null;if(o){const i="Pbr"===o.lightingModel;l=this._getTexture(o.baseColorTex,e,t),c=i?this._getTexture(o.metalTex,e,t):null,d=i?this._getTexture(o.emissiveTex,e,t):null,h=i?this._getTexture(o.occlusionTex,e,t):null,u=i?this._getTexture(o.normalTex,e,t):null;const r=[l,c,d,h,u].map(e=>e?.loadPromise??null);n=Promise.all(r)}i.push(new rt(n,l,c,d,h,u))}}catch(r){throw i.forEach(e=>e.cleanup()),r}return i}async _createRenderableMain(e,t){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain called after destroy");const i=new Array,r=e.desc,s=V(...e.origin),a=this.view.groundView.spatialReference,o=this.view.state.isGlobal;let n=C;if(o){const e=x();B(G,s,e,a),n=v(T(),e)}const l=tt(r.obb),c=o?F(this.view.spatialReference).radius:0,d=new Array;try{let h=-1;for(const i of e.validPrimitiveIndices){h+=1;const s=r.geometry.prims[i],a=t[h];this._dbgFlags.has(2)&&this._dbg(2,JSON.stringify(s));if(null==we[s.ptype]){this._dbg(2,"[Unsupported Feature] Unsupported primitive mode ("+s.ptype+"). Skipping primitive."),a.cleanup();continue}const{positionView:o,normalsData:n,colorView:l,texCoord0Data:c,indicesView:u}=this._getBufferViews(s,e);if(null==o||null==u){a.cleanup();continue}const m=o.count,p=(e,t)=>null==e||e===m||(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1);p(null!=c?c.length/2:void 0,"numTexcoord")&&p(l?.count,"numColors")&&p(n?.length,"normals")?d.push({componentIndex:h,positionView:o,indicesView:u,texCoord0Data:c,colorView:l,normalsData:n}):a.cleanup()}const u=n!==C,m=u?w(T(),n)??C:C,{vertexProcessingOutputs:p,obbHalfSizeAccumulator:f,elevationRange:g}=await this._workerHandle.processTiles3DVertices(d,s,c,o,n,l,this._imVertexNormals&&!this.usedAsGround);if(this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance");const y=r.materials;if(await Promise.all(t.map(e=>e.materialPromise)),this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance");p.length>0&&l.setHalfSize(f);for(const o of p){const{componentIndex:n,positionView:c,indicesView:d,layout:h,textureCoordinateType:p,interleavedVertexData:f,indices:g}=o,b=e.validPrimitiveIndices[n],_=r.geometry.prims[b],v=t[n],w=l.clone(),T=Ve(h),C=new Uint32Array([0,d.typedBuffer.length]),x=new Pe(T,this._imShading?2:0,p,u?2:0),j=new Ie({interleavedVertexData:f,vertexCount:f.byteLength/T[0].stride,indexData:g},{positions:c.typedBuffer,indices:d.typedBuffer},C,x),E=this.view.renderSpatialReference,M=S(),R=[1,1,1];N(s,E,R,a)||this._dbg(3,"Unsupported coordinate system for IM overlay"),q(s,E,M,a);const O=this._createComponentMaterialInitParameters(y,_.materialId,v);O.baseColorTexture||this._dbg(3,"No colour texture 1");const V=this._collection.createObject({toMapSpace:H(M[0],M[1],R[0],R[1]),transform:new He(s,m),obb:w,geometry:j,elevationAlignable:!1},O);i.push(V)}const{fullExtent:b}=this.layer;return b?.hasZ&&b.zmax&&b.zmin&&(g.minElevation=Math.max(g.minElevation,b.zmin),g.maxElevation=Math.min(g.maxElevation,b.zmax)),{tileObb:l,componentObjects:i,elevationRange:g}}catch(h){throw i.forEach(e=>this._collection.destroyObject(e)),h}}_createComponentMaterialInitParameters(e,t,i){const r=null!=e?.materials&&null!=t&&t!==oe?e.materials[t]:null;let s=1;const a=r?.baseColorTex?.imageId;if(null!=a&&e&&Array.isArray(e.images)&&a>=0&&a<e.images.length){const t=e.images[a];t.alpha&&(s=Te[t.alpha])}const o="Pbr"===(null!=r?r.lightingModel:"Unlit");let n=D,l=$e,c=!1,d=2,h=I(0,0,0);const u=U(Le),m=i.baseColorTexture,p=i.metallicRoughnessTexture,f=i.emissionTexture,g=i.occlusionTexture,y=i.normalTexture;return r&&(n=A(r.baseColorFactor),l=r.alphaCutoff??$e,o&&(O(u,r.metallicFactor,r.roughnessFactor,0),r.emissiveFactor&&(h=r.emissiveFactor)),c=r.isDoubleSided,d=Ce[r.faceCulling??"NotSet"]),{isIntegratedMesh:!0,baseColor:n,textureAlphaCutoff:l,mrrFactors:u,baseColorTexture:m,metallicRoughnessTexture:p,normalTexture:y,occlusionTexture:g,emissionTexture:f,hasParametersFromSource:!1,sphereDepthInterpolate:this.layer.hasGoogleUrl,alphaDiscardMode:s,doubleSided:c,cullFace:d,isGround:has("enable-feature:im-as-ground")?this.usedAsGround:this._replacesTerrain,groundTransparencyMode:this._groundTransparencyMode,emissiveBaseColor:h,usePBR:o,slicePlaneEnabled:this.slicePlaneEnabled,opacity:this._renderOpacity,polygonOffset:0,ellipsoidMode:1,applySSAO:this._applySSAO}}freeRenderable(e){const t=this._lyrHandleToObjects.get(e);t?(t.isLoaded?(this._loadedObjects.delete(t),this._visibleObjects.delete(t),this._intersectionHandler.removeTile(t),this._usedMemory-=t.usedMemory):this._cacheMemory-=t.usedMemory,this.freeObject(t),this._lyrHandleToObjects.delete(e)):this._dbg(3,`freeRendedrable on non-existent renderable ${e}`)}freeObject(e){const t=de(e.handle);this._memCache.pop(t),e.textures.forEach(e=>this._stage.removeTexture(e)),e.componentObjects.forEach(e=>this._collection.destroyObject(e))}setRenderableVisibility(e,t,i){if(this.destroyed||this.destroying)return;const r=this._frustum,s=new Array;let a=!1,o=!1;for(let n=0;n<i;++n){if(!t[n])continue;const i=e[n],l=this._lyrHandleToObjects.get(i);if(l){if(l.isLoaded){this._dbg(3,`Already loaded object marked loaded again ${l.stableNodeId}`);continue}a=!0,l.isLoaded=!0,this._loadedObjects.add(l),this._intersectionHandler.addTile(l),this._usedMemory+=l.usedMemory,this._cacheMemory-=l.usedMemory;const e=l.obb?.intersectsFrustum(r)??!0;l.isVisible=e,e&&(this._visibleObjects.add(l),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,l.elevationRange)),s.push(l.obb),l.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(de(i))}else this._dbg(3,`Tried to mark Non existent object ${i} as loaded`)}for(let n=0;n<i;++n){const i=e[n];if(t[n])continue;const r=this._lyrHandleToObjects.get(i);if(r){if(!r.isLoaded){this._dbg(3,`Tried to unload not-loaded object ${r.stableNodeId}`);continue}const e=r.isVisible;this._visibleObjects.delete(r),r.isVisible=!1,r.isLoaded=!1,this._loadedObjects.delete(r),this._intersectionHandler.removeTile(r),e&&(this._visibleGeometryChanged(),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(!1,r.elevationRange)),this._usedMemory-=r.usedMemory,this._cacheMemory+=r.usedMemory,s.push(r.obb),r.componentObjects.forEach(e=>{this._collection.setObjectVisibility(e,!1)}),this._memCache.put(de(i),r)}else this._dbg(3,`Tried to mark Non existent object ${i} as not loaded`)}a&&this._visibleGeometryChanged(),s.length>0&&this._elevationProvider.notifyObjectsChanged(s),o&&this._setVisibleElevationRangeDirty()}setLodPixelThreshold(e){this._wasm?.setLodPixelThreshold(this,e)}_isVisibileElevationRangeModifiedByChangedTileVisbility(e,t){const{visibleElevationRange:i}=this,{minElevation:r,maxElevation:s}=t;return e?r<i.minElevation||s>i.maxElevation:r===i.minElevation||s===i.maxElevation}_getTexture(e,t,i){const r=e&&t.desc.materials?.images?.[e.imageId];if(!r||null==r.data||r.data===oe)return null;const s=t.assets[r.data];if(!s||s.byteCount<1||"U8"!==s.dataType)return null;const a=i.get(r)??this._createTexture(e,r,s,i);return a?new Ae(this._stage.renderView.textures,a.id):null}_createTexture(e,t,i,r){const s=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,a=!!t.mipCount||s>1,o=xe[e.wrapMode??"None"];let n=t.alpha?6408:6407;const l=new Uint8Array(i.data.buffer,0,i.byteCount);let c=null,d=null,h=null;switch(t.format){case"Raw":"R8"===t.pixelFormat?(c=l,n=6403,d=""):"Rg8"===t.pixelFormat||"Ga8"===t.pixelFormat?(c=l,n=33319,d=""):"Rgb8"===t.pixelFormat?(c=l,n=6407,d=""):"Rgba8"===t.pixelFormat&&(c=l,n=6408,d="");break;case"Dxt1":c=l,n=6407,d="image/vnd-ms.dds";break;case"Dxt5":c=l,n=6408,d="image/vnd-ms.dds";break;case"Basis":c=l,n=6407,d="image/ktx2";break;case"Etc1":c=l,n=6407,d="image/ktx";break;case"Png":d="image/png",h=document.createElement("img");break;case"Jpeg":d="image/jpeg",h=document.createElement("img");break;case"Etc2":d="image/ktx",h=document.createElement("img");break;case"Astc":this._dbg(3,"Astc texture not supported");break;case"Pvrtc":this._dbg(3,"Pvrtc texture not supported")}if(h&&d){const e=new Blob([l],{type:d});h.src=URL.createObjectURL(e),c=h}if(c&&null!=d){const e=has("enable-feature:esri-compress-IM-textures")?{compressionTracker:this._compressionTracker}:void 0,i=Ye(n,d,t.format),l=new De(c,{mipmap:a,maxAnisotropy:s,encoding:d,wrap:o,pixelFormat:n,internalFormat:i??void 0,immutable:null!=i,compressionOptions:e,noUnpackFlip:!0,width:t.mip0Width,height:t.mip0Height});return this._stage.addTexture(l),r.set(t,l),l}return null}_getBufferViews(e,t){let i,r,s,a,o;for(let c=0;c<e.atrbs.length;c++){const o=e.atrbs[c],n=t.assets[o.assetId];if(!n)continue;const d=n.data.buffer,h=void 0,p=0,f=n.byteCount;try{switch(o.sem){case"Position":3===n.ncomp&&"F32"===n.dataType&&m(n.data)?i=new re(d,p,h,f):this._dbg(3,"[Unsupported Feature] Unsupported view for Position ("+n+")");break;case"Normal":if(3===n.ncomp&&"F32"===n.dataType&&m(n.data)){const e=new re(d,p,h,f);a=new Uint32Array(e.count),ke(e.typedBuffer,new Int16Array(a.buffer,a.byteOffset,2*a.length))}else this._dbg(3,"[Unsupported Feature] Unsupported view for Normal ("+n+")");break;case"TexCoord":2===n.ncomp&&"F32"===n.dataType&&m(n.data)?void 0===s&&(s=new ie(d,p,h,f).typedBuffer):this._dbg(3,"[Unsupported Feature] Unsupported view for Texcoord ("+n+")");break;case"Color":"U8"===n.dataType&&u(n.data)&&(4===n.ncomp?r=new ee(d,p,h,f):3===n.ncomp&&(r=new te(d,p,h,f))),null==r&&this._dbg(3,"[Unsupported Feature] Unsupported view for Color ("+n+")");break;case"FeatureIndex":break;default:this._dbg(2,"[Unsupported Feature] Unsupported semantic ("+o.sem+"). Skipping vertex attribute.")}}catch(l){this._dbg(2,"Error Creating buffer ("+l+"). Skipping vertex attribute.")}}let n=!1;if(null!=e.index&&e.index!==oe){const i=t.assets[e.index];if(i){const e=void 0,t=0,r=i.byteCount;switch(i.dataType){case"U16":1===i.ncomp&&f(i.data)&&(o=new ae(i.data.buffer,t,e,r));break;case"U32":1===i.ncomp&&p(i.data)&&(o=new se(i.data.buffer,t,e,r))}n=!o}else n=!0}if(!n&&null==o&&null!=i){const e=i.count;o=o=e<65535?new ae(new Uint16Array(e).buffer):new se(new Uint32Array(e).buffer);for(let t=0;t<e;t++)o.set(t,t)}return{positionView:i,colorView:r,texCoord0Data:s,indicesView:o,normalsData:a}}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>{this._modifications=e.filter(e=>!(this.usedAsGround&&"replace"!==e.type)).toArray(),this._modifications.length<e.length&&t.getLogger(this).info("Ground layers only support replace modifications. Other modification types have been ignored.")},n),"modifications")}_deletePerObjectData(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,i){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(i):t.getLogger(this).warn(i))}};e([b()],Je.prototype,"freeze",void 0),e([b()],Je.prototype,"fullOpacity",null),e([b()],Je.prototype,"opaque",null),e([b()],Je.prototype,"invisible",null),e([b({readOnly:!0})],Je.prototype,"ready",null),e([b({type:[ne]})],Je.prototype,"_modifications",void 0),e([b()],Je.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([b()],Je.prototype,"layer",void 0),e([b({readOnly:!0})],Je.prototype,"visibleAtCurrentScale",null),e([b({readOnly:!0})],Je.prototype,"_collection",null),e([b()],Je.prototype,"elevationOffset",null),e([b({readOnly:!0})],Je.prototype,"visibleElevationRange",null),e([b()],Je.prototype,"fullExtentInLocalViewSpatialReference",void 0),Je=e([_("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],Je);const Ke=Je;class Qe{constructor(e,t,i,r,s,a,o,n,l,c){this.handle=e,this.componentObjects=t,this.textures=i,this.cpuMemoryUsage=r,this.vboMemoryUsage=s,this.textureMemoryUsage=a,this.obb=o,this.stableNodeId=n,this.nodeDepth=l,this.elevationRange=c,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;const d=S();o?.getCenter(d),this._obbCenterX=d[0],this._obbCenterY=d[1],this._obbCenterZ=d[2];const h=o?.radius??-1;this._obbRadius=h,this._obbRadiusSquared=h*h,this._obbShortestHalfsize=o?Math.min(o.halfSizeX,o.halfSizeY,o.halfSizeZ):0,this._mbsCenter=o?o.getCenter(S()):P}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get mbsRadius(){return this._obbRadius}get mbsCenter(){return this._mbsCenter}boundingVolumeIntersectsRay(e,t){if(!this.obb)return!0;const{_obbCenterX:i,_obbCenterY:r,_obbCenterZ:s}=this,a=i-e[0],o=r-e[1],n=s-e[2],l=a*t[0]+o*t[1]+n*t[2];return a*a+o*o+n*n-l*l<=this._obbRadiusSquared&&this.obb.intersectRay(e,t)}boundingVolumeIntersectsSphere(e){const t=this._obbRadius;if(t<0)return!0;const i=e.center,r=e.radius,s=t+r,a=this._obbCenterX-i[0];if(a>s)return!1;const o=this._obbCenterY-i[1];if(o>s)return!1;const n=this._obbCenterZ-i[2];if(n>s)return!1;const l=a*a+o*o+n*n;if(l>s*s)return!1;if(l<=(this._obbShortestHalfsize+r)**2)return!0;const c=r-t;return c>0&&l<=c*c||(this.obb?.intersectSphere(e)??!0)}}function et(e){return Math.round(e/1048.576)/1e3}function tt(e){return new Se(e.center,e.halfSize,j(...e.quaternion))}const it=new Array;class rt{constructor(e,t,i,r,s,a){this.materialPromise=e,this.baseColorTexture=t,this.metallicRoughnessTexture=i,this.emissionTexture=r,this.occlusionTexture=s,this.normalTexture=a}cleanup(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}}export{Ke as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as i,destroyMaybe as r,removeMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as a,createAbortError as o}from"../../../core/promiseUtils.js";import{initial as n,whenOnce as l,watch as c,when as d}from"../../../core/reactiveUtils.js";import{schedule as h}from"../../../core/scheduling.js";import{isUint8Array as u,isFloat32Array as m,isUint32Array as p,isUint16Array as f}from"../../../core/typedArrayUtil.js";import{unitFromRESTJSON as g,convertUnit as y}from"../../../core/units.js";import{property as b,subclass as _}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as v,invert as w}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as T,IDENTITY as C}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as x}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as j}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{normalize as E,sub as M,dot as R,set as O}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as S,freeze as V,clone as U,ZEROS as I,fromValues as P}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as H,clone as A,ONES as D}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMoon as k,isMars as L,getReferenceEllipsoid as F,SphericalECEFSpatialReferenceLike as G}from"../../../geometry/ellipsoidUtils.js";import z from"../../../geometry/HeightModelInfo.js";import{computeTranslationToOriginAndRotation as B}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as N}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as q}from"../../../geometry/projection/projectVectorToVector.js";import{create as W}from"../../../geometry/support/aaBoundingRect.js";import{isCompatible as X}from"../../../geometry/support/heightModelInfoUtils.js";import{isPlateCarree as $,isWebMercator as Z,equals as Y,isGeographic as J,isCGCS2000 as K}from"../../../geometry/support/spatialReferenceUtils.js";import Q from"../../../geometry/support/WKIDUnitConversion.js";import{BufferViewVec4u8 as ee,BufferViewVec3u8 as te,BufferViewVec2f as ie,BufferViewVec3f as re,BufferViewUint32 as se,BufferViewUint16 as ae}from"../../../geometry/support/buffer/BufferView.js";import{nullId as oe}from"../../../layers/ILyr3DWasmPerSceneView.js";import ne from"../../../layers/support/SceneModification.js";import{getHeightModelInfoFromVCS as le,validateEntity3D as ce,makeCacheKey as de}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as he}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as ue}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as me}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as pe}from"./Lyr3DViewPerformanceInfo.js";import{addLayerViewToWasm as fe,removeLayerViewFromWasm as ge,getLyr3DWasm as ye}from"./Lyr3DWasm.js";import{toWasmModification as be}from"./SceneLayerWorkerHandle.js";import{LayerElevationProvider as _e}from"./i3s/LayerElevationProvider.js";import{IntegratedMesh3DTilesLayerView3DSymbol as ve}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as we,alphaModeConversion as Te,faceCullingConversion as Ce,wrapModeConversion as xe}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as je}from"./support/makeScheduleFunction.js";import{Tiles3DMeshIntersectionHandler as Ee}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as Me}from"../state/Frustum.js";import{ElevationRange as Re}from"../support/ElevationRange.js";import{toBoundingRect as Oe}from"../support/extentUtils.js";import{Obb as Se}from"../support/orientedBoundingBox.js";import{glLayout as Ve}from"../support/buffer/glUtil.js";import{getGroundTransparencyModeFromOpacity as Ue}from"../terrain/TransparencyMode.js";import{ComponentGeometryParameters as Ie,SourceGeometry as Pe}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as He}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as Ae}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as De}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as ke}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as Le}from"../webgl-engine/materials/pbrUtils.js";import Fe from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as Ge,isInEffectiveScaleRange as ze,validateScaleRange as Be}from"../../support/layerViewUtils.js";import{TaskPriority as Ne}from"../../support/Scheduler.js";import{TextureCompressionTracker as qe}from"../../support/TextureCompressionTracker.js";import{CompressedTextureFormat as We,SizedPixelFormat as Xe}from"../../webgl/enums.js";import{alphaCutoff as $e}from"../../../webscene/support/AlphaCutoff.js";var Ze;function Ye(e,t,i){if("image/vnd-ms.dds"===t)switch(i){case"Dxt1":return We.COMPRESSED_RGB_S3TC_DXT1_EXT;case"Dxt5":return We.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if("image/ktx"===t)return"Etc1"===i?We.COMPRESSED_RGB8_ETC2:null;switch(e){case 33319:return Xe.RG8;case 6407:return Xe.RGB8;case 6408:return Xe.RGBA8;case 6403:return Xe.R8;default:return null}}let Je=class extends(me(Fe)){static{Ze=ve}constructor(e){super(e),this[Ze]=!0,this.type="integrated-mesh-3dtiles",this.skipHeightModelInfoValidation=!0,this.freeze=!1,this._modifications=new Array,this._visibleGeometryChangedSchedulerHandle=null,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._applySSAO=!has("disable-feature:im-ssao"),this._imShading=!!has("enable-feature:im-shading"),this._imVertexNormals=!!has("enable-feature:im-vertex-normals"),this._lyrHandleToObjects=new Map,this._visibleObjects=new Set,this._loadedObjects=new Set,this._compressionTracker=new qe,this._dbgFlags=new Set;const t=e.view.resourceController;this._memCache=t.memoryController.newCache(`IM3DTiles-${this.uid}`,e=>this._deletePerObjectData(e)),this._replacesTerrain=e.layer.replacesTerrain,this._isUsedAsGroundLayer=e.layer.isUsedAsGroundLayer,this._frameTask=t.scheduler.registerTask(Ne.TILES3D,this),this._frustum=new Me(e.view.renderCoordsHelper)}tryRecycleWith(e,t){return this.canRecycleWith(e)?e.load(t).then(()=>{a(t);const i=this.layer.queryElevationCallback;this.layer=e,this.layer.queryElevationCallback=i}):null}canRecycleWith(e){return e.url===this.layer.url&&"integrated-mesh-3dtiles"===e.type&&e.replacesTerrain===this._replacesTerrain&&e.isUsedAsGroundLayer===this.usedAsGround}initialize(){this._dbg(2,"Tiles3DLayerView3D initialize() called");const{view:e}=this;this._workerHandle=new ue(je(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),n),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;const{signal:t}=this._initializationController;if(await l(()=>e?.defaultsFromMap.heightModelInfoReady,t),a(t),!this._canProjectWithoutEngine())throw Ge("layer",this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._wasmLayerId=await fe(this,t),a(t);const i=new Ee(this);this._intersectionHandler=i,e.sceneIntersectionHelper.addIntersectionHandler(i),this._elevationProvider=new _e({view:e,layerElevationSource:this,intersectionHandler:i});const r=this._replacesTerrain?0:has("enable-feature:im-as-ground")?this.usedAsGround?1:2:1;e.elevationProvider.register(r,this._elevationProvider),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged()),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.overlayManager.renderer.isEmpty,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),n),this._updatingHandles.add(()=>e.state.contentCamera,()=>this._cameraChanged(),n),e.overlayManager.registerDrapeTarget(this),this.addHandles([c(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),d(()=>this.fullOpacity,()=>this._opacityChange()),c(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),n),c(()=>this.freeze,e=>{e?this._wasm?.incrementFrozenLayerViewCount(this):(this._wasm?.decrementFrozenLayerViewCount(this),this._cameraChanged())})]),this._initializationController=null,this.addHandles(d(()=>this._replacesTerrain&&this._wasm?.isTerrainReady||!this._replacesTerrain&&!!has("enable-feature:im-as-ground")&&this.usedAsGround,()=>{this.layer.queryElevationCallback=(e,t)=>this._queryElevation(e,t)},{initial:!0}))}destroy(){if(this.freeze=!1,this._initializationController=i(this._initializationController),this._dbg(2,"Tiles3DLayerView3D destroy() called"),this._workerHandle?.destroyContextAndSelf(this.uid),ge(this),this.layer.queryElevationCallback=null,this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler.destroy(),this._intersectionHandler=null),this._elevationProvider){const e=Array.from(this._lyrHandleToObjects.values()),t=e.reduce((e,{componentObjects:t})=>e+t.length,0);this._elevationProvider.notifyObjectsChangedFunctional(t,t=>{for(const{componentObjects:i}of e)for(const{obb:e}of i)if(!t(e))return}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null}this.view.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._visibleObjects.clear(),this._loadedObjects.clear(),this._usedMemory=0,this._cacheMemory=0,this._memCache.destroy(),this._frameTask.remove(),this._updatingHandles=r(this._updatingHandles),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=s(this._visibleGeometryChangedSchedulerHandle)}get usedAsGround(){return this._isUsedAsGroundLayer}get replacesTerrain(){return this.layer.replacesTerrain}get fullOpacity(){return has("enable-feature:im-as-ground")?this.usedAsGround?this.view.map.ground.opacity:this.layer.opacity:this.layer.replacesTerrain?this.view.map.ground.opacity:1}get opaque(){return 0===this._groundTransparencyMode}get invisible(){return 3===this._groundTransparencyMode}get _groundTransparencyMode(){return(has("enable-feature:im-as-ground")?this.usedAsGround:this._replacesTerrain)?Ue(this.fullOpacity,this.view.overlayManager.renderer.isEmpty):0}get _renderOpacity(){switch(this._groundTransparencyMode){case 3:return 0;case 2:return $e;default:return this.fullOpacity}}get hasModifications(){return this._modifications&&this._modifications.length>0}_opacityChange(){const e=this._renderOpacity,t=this._groundTransparencyMode;this.forEachComponentObject(i=>this._collection.updateObjectOpacity(i,e,t))}_cameraChanged(){if(this.freeze)return;const e=this._frustum;e.update(this.view.state.contentCamera);const t=this._visibleObjects;let i=!1;this._loadedObjects.forEach(r=>{const s=r.obb?.intersectsFrustum(e)??!1;s!==r.isVisible&&(r.isVisible=s,s?t.add(r):t.delete(r),r.componentObjects.forEach(e=>this._collection.setObjectVisibility(e,s)),i||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(s,r.elevationRange))}),i&&this._setVisibleElevationRangeDirty()}intersect(e,t,i,r){this._intersectionHandler.intersectRay(e,t,i,r,null,!1)}get ready(){return!this.layer.replacesTerrain||!!this._wasm?.isTerrainReady}_modificationsChanged(){const e=this.useEsriCrs?this.layer.supportedSpatialReferences[1]:this.layer.supportedSpatialReferences[0],t=be(this._layerClippingArea,this._modifications,e,this.view.state.isGlobal);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=W();this._layerClippingArea=Oe(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=h(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e&&!this.layer.replacesTerrain),this.forEachComponentObject(t=>t.updateMaterial({slicePlaneEnabled:e}))}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,he(e))}get _wasm(){return ye(this.view)}_queryElevation(e,t){return this.destroying||this.destroyed?Promise.reject(o()):this._wasm?.queryElevation(this,e,t)??Promise.reject(o())}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get useEsriCrs(){return this._useEsriCrs}get visibleAtCurrentScale(){return this._replacesTerrain||ze(this.layer.effectiveScaleRange,this.view.scale)}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&(this._replacesTerrain||Be(e)&&this.visibleAtCurrentScale)&&this.visibleAtCurrentTimeExtent||!1}get performanceInfo(){let e=0,t=0,i=0,r=0,s=0,a=0;return this._lyrHandleToObjects.forEach(o=>{o.isLoaded?(e+=o.textureMemoryUsage,t+=o.vboMemoryUsage,s++):(i+=o.textureMemoryUsage,r+=o.vboMemoryUsage,a++)}),new pe(this.usedMemory,s,a,et(t),et(e),et(r),et(i))}_canProjectWithoutEngine(){if(1===this.view.state.viewingMode)return!0;if($(this.view.renderSpatialReference)||Z(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&Y(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(115700===this.layer.esriCrsSpatialReference.vcsWkid)return!1;let e=le(this.layer.esriCrsSpatialReference);if(!e){const t=this.layer.esriCrsSpatialReference;let i="meters";!J(t)&&t.wkid&&-1!==t.wkid&&(i=g(Q.units[Q[t.wkid]])),i&&(e=new z({heightModel:"gravity-related-height",heightUnit:i}))}const t=this.view.heightModelInfo;return this._useEsriCrs=0===X(e,t,!1),this._useEsriCrs&&(e&&(this._metersPerVCSUnit=y(1,e.heightUnit,"meters")),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return he(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new Re(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){const e=new Re;0===this._visibleObjects.size?e.setElevationRangeValues(0,0):(e.setElevationRangeValues(1/0,-1/0),this._forEachRelevantVisibleTile(t=>e.expandElevationRange(t.elevationRange)),e.minElevation===1/0&&e.setElevationRangeValues(0,0));const t=this._get("visibleElevationRange");return t&&t.minElevation===e.minElevation&&t.maxElevation===e.maxElevation?t:e}_setVisibleElevationRangeDirty(){this.notifyChange("visibleElevationRange")}_forEachRelevantVisibleTile(e){const{view:t}=this,{spatialReference:i}=t,r=i.isWGS84||i.isWebMercator||K(i)||k(i)||L(i);if(this.view.state.isGlobal||!r)return this.forEachVisibleTile(e);const s=F(i).radius,{eye:a,viewForward:o,near:n}=t.state.contentCamera,l=E(S(),o),c=500,d=Math.max(a[2],c),h=d+s,u=Math.sqrt(h**2-s**2),m=Math.abs(Math.atan2(u,s))*s,p=d>.5*s?.5*Math.PI*s:m,f=S();this.forEachVisibleTile(t=>{const{mbsRadius:i,mbsCenter:r}=t;if(i<0)return;M(f,r,a);const s=R(f,l);Math.abs(s)<p&&s+i>n&&s-i<p&&e(t)})}get fullExtent(){return this.layer.fullExtent}forEachComponentObject(e){this._forEachObject(this._lyrHandleToObjects.values(),e)}forEachVisibleTile(e){for(const t of this._visibleObjects)e(t)}forEachTile(e){for(const t of this._loadedObjects)e(t)}forEachVisibleComponentObject(e){this._forEachObject(this._visibleObjects,e)}_forEachObject(e,t){for(const{componentObjects:i}of e)for(const e of i)t(e)}get drapeTargetType(){return has("enable-feature:im-as-ground")?this._isUsedAsGroundLayer?0:1:this._replacesTerrain?0:1}isUpdating(){const e=this._wasm;return!this.freeze&&this._wasmLayerId>=0&&null!=e&&(e.isUpdating(this._wasmLayerId)||this._compressionTracker.compressing)}get readyToRun(){return!!this._frameTask?.readyToRun}runTask(e){this._frameTask.processQueue(e)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy");const{entity3d:t}=e;if(!ce(t))throw new Error("entity3D not valid");const i=new Map;let r;try{r=this._createPrimitiveTextureBundles(t,i)}catch(a){throw i.forEach(e=>this._stage?.removeTexture(e)),a}let s=null;try{if(s=await this._createRenderableMain(t,r),this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable aborted due to destroyed instance");const{tileObb:a,componentObjects:o,elevationRange:n}=s;let l=0,c=0,d=0;for(const e of o){const{texture:t,textureMetallicRoughness:i,textureEmissive:r,textureOcclusion:s,textureNormal:a}=e.renderable.drawParameters;l+=(t?.usedMemory??0)+(i?.usedMemory??0)+(r?.usedMemory??0)+(s?.usedMemory??0)+(a?.usedMemory??0),c+=this._collection.getObjectGPUMemoryUsage(e),d+=e.intersectionGeometry.usedMemory}const h=Array.from(i.values()),u=new Qe(e.handle,o,h,d,c,l,a,e.stableNodeId,e.nodeDepth,n);return this._lyrHandleToObjects.set(e.handle,u),()=>{this._memCache.put(de(u.handle),u);const{usedMemory:e}=u;return this._cacheMemory+=e,{memUsageBytes:e}}}catch(a){throw r.forEach(e=>e.cleanup()),s?.componentObjects.forEach(e=>this._collection.destroyObject(e)),i.forEach(e=>this._stage?.removeTexture(e)),a}}_createPrimitiveTextureBundles(e,t){const i=new Array;try{const r=e.desc.geometry;for(const s of e.validPrimitiveIndices){const a=r.prims[s].materialId,o=e.desc.materials?.materials&&null!=a&&a!==oe?e.desc.materials.materials[a]:null;let n=Promise.resolve(it),l=null,c=null,d=null,h=null,u=null;if(o){const i="Pbr"===o.lightingModel;l=this._getTexture(o.baseColorTex,e,t),c=i?this._getTexture(o.metalTex,e,t):null,d=i?this._getTexture(o.emissiveTex,e,t):null,h=i?this._getTexture(o.occlusionTex,e,t):null,u=i?this._getTexture(o.normalTex,e,t):null;const r=[l,c,d,h,u].map(e=>e?.loadPromise??null);n=Promise.all(r)}i.push(new rt(n,l,c,d,h,u))}}catch(r){throw i.forEach(e=>e.cleanup()),r}return i}async _createRenderableMain(e,t){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain called after destroy");const i=new Array,r=e.desc,s=V(...e.origin),a=this.view.groundView.spatialReference,o=this.view.state.isGlobal;let n=C;if(o){const e=x();B(G,s,e,a),n=v(T(),e)}const l=tt(r.obb),c=o?F(this.view.spatialReference).radius:0,d=new Array;try{let h=-1;for(const i of e.validPrimitiveIndices){h+=1;const s=r.geometry.prims[i],a=t[h];this._dbgFlags.has(2)&&this._dbg(2,JSON.stringify(s));if(null==we[s.ptype]){this._dbg(2,"[Unsupported Feature] Unsupported primitive mode ("+s.ptype+"). Skipping primitive."),a.cleanup();continue}const{positionView:o,normalsData:n,colorView:l,texCoord0Data:c,indicesView:u}=this._getBufferViews(s,e);if(null==o||null==u){a.cleanup();continue}const m=o.count,p=(e,t)=>null==e||e===m||(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1);p(null!=c?c.length/2:void 0,"numTexcoord")&&p(l?.count,"numColors")&&p(n?.length,"normals")?d.push({componentIndex:h,positionView:o,indicesView:u,texCoord0Data:c,colorView:l,normalsData:n}):a.cleanup()}const u=n!==C,m=u?w(T(),n)??C:C,{vertexProcessingOutputs:p,obbHalfSizeAccumulator:f,elevationRange:g}=await this._workerHandle.processTiles3DVertices(d,s,c,o,n,l,this._imVertexNormals&&!this.usedAsGround);if(this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance");const y=r.materials;if(await Promise.all(t.map(e=>e.materialPromise)),this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance");p.length>0&&l.setHalfSize(f);for(const o of p){const{componentIndex:n,positionView:c,indicesView:d,layout:h,textureCoordinateType:p,interleavedVertexData:f,indices:g}=o,b=e.validPrimitiveIndices[n],_=r.geometry.prims[b],v=t[n],w=l.clone(),T=Ve(h),C=new Uint32Array([0,d.typedBuffer.length]),x=new Ie(T,this._imShading?2:0,p,u?2:0),j=new Pe({interleavedVertexData:f,vertexCount:f.byteLength/T[0].stride,indexData:g},{positions:c.typedBuffer,indices:d.typedBuffer},C,x),E=this.view.renderSpatialReference,M=S(),R=[1,1,1];N(s,E,R,a)||this._dbg(3,"Unsupported coordinate system for IM overlay"),q(s,E,M,a);const O=this._createComponentMaterialInitParameters(y,_.materialId,v);O.baseColorTexture||this._dbg(3,"No colour texture 1");const V=this._collection.createObject({toMapSpace:H(M[0],M[1],R[0],R[1]),transform:new He(s,m),obb:w,geometry:j,elevationAlignable:!1},O);i.push(V)}const{fullExtent:b}=this.layer;return b?.hasZ&&b.zmax&&b.zmin&&(g.minElevation=Math.max(g.minElevation,b.zmin),g.maxElevation=Math.min(g.maxElevation,b.zmax)),{tileObb:l,componentObjects:i,elevationRange:g}}catch(h){throw i.forEach(e=>this._collection.destroyObject(e)),h}}_createComponentMaterialInitParameters(e,t,i){const r=null!=e?.materials&&null!=t&&t!==oe?e.materials[t]:null;let s=1;const a=r?.baseColorTex?.imageId;if(null!=a&&e&&Array.isArray(e.images)&&a>=0&&a<e.images.length){const t=e.images[a];t.alpha&&(s=Te[t.alpha])}const o="Pbr"===(null!=r?r.lightingModel:"Unlit");let n=D,l=$e,c=!1,d=2,h=P(0,0,0);const u=U(Le),m=i.baseColorTexture,p=i.metallicRoughnessTexture,f=i.emissionTexture,g=i.occlusionTexture,y=i.normalTexture;return r&&(n=A(r.baseColorFactor),l=r.alphaCutoff??$e,o&&(O(u,r.metallicFactor,r.roughnessFactor,0),r.emissiveFactor&&(h=r.emissiveFactor)),c=r.isDoubleSided,d=Ce[r.faceCulling??"NotSet"]),{isIntegratedMesh:!0,baseColor:n,textureAlphaCutoff:l,mrrFactors:u,baseColorTexture:m,metallicRoughnessTexture:p,normalTexture:y,occlusionTexture:g,emissionTexture:f,hasParametersFromSource:!1,sphereDepthInterpolate:this.layer.hasGoogleUrl,alphaDiscardMode:s,doubleSided:c,cullFace:d,isGround:has("enable-feature:im-as-ground")?this.usedAsGround:this._replacesTerrain,groundTransparencyMode:this._groundTransparencyMode,emissiveBaseColor:h,usePBR:o,slicePlaneEnabled:this.slicePlaneEnabled,opacity:this._renderOpacity,polygonOffset:0,ellipsoidMode:1,applySSAO:this._applySSAO}}freeRenderable(e){const t=this._lyrHandleToObjects.get(e);t?(t.isLoaded?(this._loadedObjects.delete(t),this._visibleObjects.delete(t),this._intersectionHandler.removeTile(t),this._usedMemory-=t.usedMemory):this._cacheMemory-=t.usedMemory,this.freeObject(t),this._lyrHandleToObjects.delete(e)):this._dbg(3,`freeRendedrable on non-existent renderable ${e}`)}freeObject(e){const t=de(e.handle);this._memCache.pop(t),e.textures.forEach(e=>this._stage.removeTexture(e)),e.componentObjects.forEach(e=>this._collection.destroyObject(e))}setRenderableVisibility(e,t,i){if(this.destroyed||this.destroying)return;const r=this._frustum,s=new Array;let a=!1,o=!1;for(let n=0;n<i;++n){if(!t[n])continue;const i=e[n],l=this._lyrHandleToObjects.get(i);if(l){if(l.isLoaded){this._dbg(3,`Already loaded object marked loaded again ${l.stableNodeId}`);continue}a=!0,l.isLoaded=!0,this._loadedObjects.add(l),this._intersectionHandler.addTile(l),this._usedMemory+=l.usedMemory,this._cacheMemory-=l.usedMemory;const e=l.obb?.intersectsFrustum(r)??!0;l.isVisible=e,e&&(this._visibleObjects.add(l),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,l.elevationRange)),s.push(l.obb),l.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(de(i))}else this._dbg(3,`Tried to mark Non existent object ${i} as loaded`)}for(let n=0;n<i;++n){const i=e[n];if(t[n])continue;const r=this._lyrHandleToObjects.get(i);if(r){if(!r.isLoaded){this._dbg(3,`Tried to unload not-loaded object ${r.stableNodeId}`);continue}const e=r.isVisible;this._visibleObjects.delete(r),r.isVisible=!1,r.isLoaded=!1,this._loadedObjects.delete(r),this._intersectionHandler.removeTile(r),e&&(this._visibleGeometryChanged(),o||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(!1,r.elevationRange)),this._usedMemory-=r.usedMemory,this._cacheMemory+=r.usedMemory,s.push(r.obb),r.componentObjects.forEach(e=>{this._collection.setObjectVisibility(e,!1)}),this._memCache.put(de(i),r)}else this._dbg(3,`Tried to mark Non existent object ${i} as not loaded`)}a&&this._visibleGeometryChanged(),s.length>0&&this._elevationProvider.notifyObjectsChanged(s),o&&this._setVisibleElevationRangeDirty()}setLodPixelThreshold(e){this._wasm?.setLodPixelThreshold(this,e)}_isVisibileElevationRangeModifiedByChangedTileVisbility(e,t){const{visibleElevationRange:i}=this,{minElevation:r,maxElevation:s}=t;return e?r<i.minElevation||s>i.maxElevation:r===i.minElevation||s===i.maxElevation}_getTexture(e,t,i){const r=e&&t.desc.materials?.images?.[e.imageId];if(!r||null==r.data||r.data===oe)return null;const s=t.assets[r.data];if(!s||s.byteCount<1||"U8"!==s.dataType)return null;const a=i.get(r)??this._createTexture(e,r,s,i);return a?new Ae(this._stage.renderView.textures,a.id):null}_createTexture(e,t,i,r){const s=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,a=!!t.mipCount||s>1,o=xe[e.wrapMode??"None"];let n=t.alpha?6408:6407;const l=new Uint8Array(i.data.buffer,0,i.byteCount);let c=null,d=null,h=null;switch(t.format){case"Raw":"R8"===t.pixelFormat?(c=l,n=6403,d=""):"Rg8"===t.pixelFormat||"Ga8"===t.pixelFormat?(c=l,n=33319,d=""):"Rgb8"===t.pixelFormat?(c=l,n=6407,d=""):"Rgba8"===t.pixelFormat&&(c=l,n=6408,d="");break;case"Dxt1":c=l,n=6407,d="image/vnd-ms.dds";break;case"Dxt5":c=l,n=6408,d="image/vnd-ms.dds";break;case"Basis":c=l,n=6407,d="image/ktx2";break;case"Etc1":c=l,n=6407,d="image/ktx";break;case"Png":d="image/png",h=document.createElement("img");break;case"Jpeg":d="image/jpeg",h=document.createElement("img");break;case"Etc2":d="image/ktx",h=document.createElement("img");break;case"Astc":this._dbg(3,"Astc texture not supported");break;case"Pvrtc":this._dbg(3,"Pvrtc texture not supported")}if(h&&d){const e=new Blob([l],{type:d});h.src=URL.createObjectURL(e),c=h}if(c&&null!=d){const e=has("enable-feature:esri-compress-IM-textures")?{compressionTracker:this._compressionTracker}:void 0,i=Ye(n,d,t.format),l=new De(c,{mipmap:a,maxAnisotropy:s,encoding:d,wrap:o,pixelFormat:n,internalFormat:i??void 0,immutable:null!=i,compressionOptions:e,noUnpackFlip:!0,width:t.mip0Width,height:t.mip0Height});return this._stage.addTexture(l),r.set(t,l),l}return null}_getBufferViews(e,t){let i,r,s,a,o;for(let c=0;c<e.atrbs.length;c++){const o=e.atrbs[c],n=t.assets[o.assetId];if(!n)continue;const d=n.data.buffer,h=void 0,p=0,f=n.byteCount;try{switch(o.sem){case"Position":3===n.ncomp&&"F32"===n.dataType&&m(n.data)?i=new re(d,p,h,f):this._dbg(3,"[Unsupported Feature] Unsupported view for Position ("+n+")");break;case"Normal":if(3===n.ncomp&&"F32"===n.dataType&&m(n.data)){const e=new re(d,p,h,f);a=new Uint32Array(e.count),ke(e.typedBuffer,new Int16Array(a.buffer,a.byteOffset,2*a.length))}else this._dbg(3,"[Unsupported Feature] Unsupported view for Normal ("+n+")");break;case"TexCoord":2===n.ncomp&&"F32"===n.dataType&&m(n.data)?void 0===s&&(s=new ie(d,p,h,f).typedBuffer):this._dbg(3,"[Unsupported Feature] Unsupported view for Texcoord ("+n+")");break;case"Color":"U8"===n.dataType&&u(n.data)&&(4===n.ncomp?r=new ee(d,p,h,f):3===n.ncomp&&(r=new te(d,p,h,f))),null==r&&this._dbg(3,"[Unsupported Feature] Unsupported view for Color ("+n+")");break;case"FeatureIndex":break;default:this._dbg(2,"[Unsupported Feature] Unsupported semantic ("+o.sem+"). Skipping vertex attribute.")}}catch(l){this._dbg(2,"Error Creating buffer ("+l+"). Skipping vertex attribute.")}}let n=!1;if(null!=e.index&&e.index!==oe){const i=t.assets[e.index];if(i){const e=void 0,t=0,r=i.byteCount;switch(i.dataType){case"U16":1===i.ncomp&&f(i.data)&&(o=new ae(i.data.buffer,t,e,r));break;case"U32":1===i.ncomp&&p(i.data)&&(o=new se(i.data.buffer,t,e,r))}n=!o}else n=!0}if(!n&&null==o&&null!=i){const e=i.count;o=o=e<65535?new ae(new Uint16Array(e).buffer):new se(new Uint32Array(e).buffer);for(let t=0;t<e;t++)o.set(t,t)}return{positionView:i,colorView:r,texCoord0Data:s,indicesView:o,normalsData:a}}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>{this._modifications=e.filter(e=>!(this.usedAsGround&&"replace"!==e.type)).toArray(),this._modifications.length<e.length&&t.getLogger(this).info("Ground layers only support replace modifications. Other modification types have been ignored.")},n),"modifications")}_deletePerObjectData(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,i){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(i):t.getLogger(this).warn(i))}};e([b()],Je.prototype,"freeze",void 0),e([b()],Je.prototype,"fullOpacity",null),e([b()],Je.prototype,"opaque",null),e([b()],Je.prototype,"invisible",null),e([b({readOnly:!0})],Je.prototype,"ready",null),e([b({type:[ne]})],Je.prototype,"_modifications",void 0),e([b()],Je.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([b()],Je.prototype,"layer",void 0),e([b({readOnly:!0})],Je.prototype,"visibleAtCurrentScale",null),e([b({readOnly:!0})],Je.prototype,"_collection",null),e([b()],Je.prototype,"elevationOffset",null),e([b({readOnly:!0})],Je.prototype,"visibleElevationRange",null),e([b()],Je.prototype,"fullExtentInLocalViewSpatialReference",void 0),Je=e([_("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],Je);const Ke=Je;class Qe{constructor(e,t,i,r,s,a,o,n,l,c){this.handle=e,this.componentObjects=t,this.textures=i,this.cpuMemoryUsage=r,this.vboMemoryUsage=s,this.textureMemoryUsage=a,this.obb=o,this.stableNodeId=n,this.nodeDepth=l,this.elevationRange=c,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;const d=S();o?.getCenter(d),this._obbCenterX=d[0],this._obbCenterY=d[1],this._obbCenterZ=d[2];const h=o?.radius??-1;this._obbRadius=h,this._obbRadiusSquared=h*h,this._obbShortestHalfsize=o?Math.min(o.halfSizeX,o.halfSizeY,o.halfSizeZ):0,this._mbsCenter=o?o.getCenter(S()):I}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get mbsRadius(){return this._obbRadius}get mbsCenter(){return this._mbsCenter}boundingVolumeIntersectsRay(e,t){if(!this.obb)return!0;const{_obbCenterX:i,_obbCenterY:r,_obbCenterZ:s}=this,a=i-e[0],o=r-e[1],n=s-e[2],l=a*t[0]+o*t[1]+n*t[2];return a*a+o*o+n*n-l*l<=this._obbRadiusSquared&&this.obb.intersectRay(e,t)}boundingVolumeIntersectsSphere(e){const t=this._obbRadius;if(t<0)return!0;const i=e.center,r=e.radius,s=t+r,a=this._obbCenterX-i[0];if(a>s)return!1;const o=this._obbCenterY-i[1];if(o>s)return!1;const n=this._obbCenterZ-i[2];if(n>s)return!1;const l=a*a+o*o+n*n;if(l>s*s)return!1;if(l<=(this._obbShortestHalfsize+r)**2)return!0;const c=r-t;return c>0&&l<=c*c||(this.obb?.intersectSphere(e)??!0)}}function et(e){return Math.round(e/1048.576)/1e3}function tt(e){return new Se(e.center,e.halfSize,j(...e.quaternion))}const it=new Array;class rt{constructor(e,t,i,r,s,a){this.materialPromise=e,this.baseColorTexture=t,this.metallicRoughnessTexture=i,this.emissionTexture=r,this.occlusionTexture=s,this.normalTexture=a}cleanup(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}}export{Ke as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{initial as
|
|
2
|
+
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{initial as r}from"../../../core/reactiveUtils.js";import{property as t,subclass as i}from"../../../core/accessorSupport/decorators.js";import{I3SMeshView3D as o}from"./I3SMeshView3D.js";import{LayerView3D as s}from"./LayerView3D.js";import{ElevationRange as a}from"../support/ElevationRange.js";import{updatingProgress as n}from"../support/updatingProperties.js";import{getGroundTransparencyModeFromOpacity as l}from"../terrain/TransparencyMode.js";import d from"../../layers/LayerView.js";import{isInEffectiveScaleRange as p}from"../../support/layerViewUtils.js";const u=.2;let c=class extends(o(s(d))){constructor(){super(...arguments),this.type="integrated-mesh-3d",this.visibleElevationRange=new a(1/0,-1/0),this._supportsLabeling=!1,this._applySSAO=!has("disable-feature:im-ssao")}get usedAsGround(){return this.layer.isUsedAsGroundLayer}get replacesTerrain(){return this.layer.replacesTerrain}get updatingProgressValue(){return this._controller?.updatingProgress??0}get lodFactor(){return this.view?.qualitySettings?.sceneService?.meshLoDFactor??1}get progressiveLoadFactor(){return this.lodFactor>=1?u:1}get visibleAtCurrentScale(){return p(this.layer.effectiveScaleRange,this.view.scale)}get fullOpacity(){return has("enable-feature:im-as-ground")?this.usedAsGround?this.view.map.ground.opacity:this.layer.opacity:1}get opaque(){return 0===this._groundTransparencyMode}get invisible(){return 3===this._groundTransparencyMode}get _groundTransparencyMode(){return has("enable-feature:im-as-ground")&&this.usedAsGround?l(this.fullOpacity,this.view.overlayManager.renderer.isEmpty):0}get layerPopupEnabledAndHasTemplate(){return!1}get _elevationContext(){return has("enable-feature:im-as-ground")?this.layer.isUsedAsGroundLayer?1:2:1}get drapeTargetType(){return has("enable-feature:im-as-ground")&&this.usedAsGround?0:1}initialize(){this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),r),this.view.overlayManager.registerDrapeTarget(this)}destroy(){this.view.overlayManager.unregisterDrapeTarget(this)}get ready(){return this.layer.loaded}_createLayerGraphic(){}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>this._modifications=e.toArray(),r),"modifications")}};e([t()],c.prototype,"layer",void 0),e([t(n)],c.prototype,"updatingProgress",void 0),e([t()],c.prototype,"updatingProgressValue",null),e([t()],c.prototype,"lodFactor",null),e([t({readOnly:!0})],c.prototype,"progressiveLoadFactor",null),e([t({readOnly:!0})],c.prototype,"visibleAtCurrentScale",null),e([t({readOnly:!0})],c.prototype,"visibleElevationRange",void 0),e([t()],c.prototype,"fullOpacity",null),e([t()],c.prototype,"opaque",null),e([t()],c.prototype,"invisible",null),c=e([i("esri.views.3d.layers.IntegratedMeshLayerView3D")],c);const y=c;export{y as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{makeHandle as o}from"../../../core/handleUtils.js";import{throwIfAborted as e}from"../../../core/promiseUtils.js";import{whenOnce as
|
|
2
|
+
import{__decorate as t}from"tslib";import{makeHandle as o}from"../../../core/handleUtils.js";import{throwIfAborted as e}from"../../../core/promiseUtils.js";import{whenOnce as i}from"../../../core/reactiveUtils.js";import{property as s,subclass as r}from"../../../core/accessorSupport/decorators.js";import{supportsHeightModelInfo as l,rejectLayerError as n}from"../../../geometry/support/heightModelInfoUtils.js";const a=a=>{const p=a;let d=class extends p{constructor(){super(...arguments),this.slicePlaneEnabled=!1,this.supportsHeightUnitConversion=!1,this.skipHeightModelInfoValidation=!1}postscript(){super.postscript(),!this.skipHeightModelInfoValidation&&l(this.layer)&&this.addResolvingPromise(this._validateHeightModelInfo())}async _validateHeightModelInfo(){const t=new AbortController,s=t.signal;this.addHandles(o(()=>t.abort())),await i(()=>this.view.defaultsFromMap?.heightModelInfoReady,s),e(s);const r=n(this.layer,this.view.heightModelInfo,this.supportsHeightUnitConversion);if(r)throw r}};return t([s()],d.prototype,"view",void 0),t([s()],d.prototype,"slicePlaneEnabled",void 0),d=t([r("esri.views.3d.layers.LayerView3D")],d),d};export{a as LayerView3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{validateColorAndOpacity as e,validateColor as r}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as a}from"../../../../core/mathUtils.js";import{clone as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{uncompressedFormats as t,compressibleUsages as s}from"./enums.js";import{RenderTexture as n}from"../../webgl-engine/core/material/RenderTexture.js";import{getEllipsoidMode as l}from"../../webgl-engine/core/shaderLibrary/util/EllipsoidMode.js";import{ManagedTexture as i}from"../../webgl-engine/lib/ManagedTexture.js";import{useSchematicPBR as u,schematicMRRFactors as c,advancedMRRFactors as m}from"../../webgl-engine/materials/pbrUtils.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";function p(r,a,o){const t=new Map,s=(e,r)=>{if(null==e)return-1;const a=t.get(e.id);if(a)return a.usage|=r,a.id;const o=t.size;return t.set(e.id,{id:o,usage:r}),o},n=a.pbrMetallicRoughness,l=n?.baseColorFactor?e(n.baseColorFactor):null,i=a.emissiveFactor,d=o&&0===n?.metallicFactor||u({normalTexture:a.normalTexture,emissiveTexture:a.emissiveTexture,emissiveFactor:a.emissiveFactor,occlusionTexture:a.occlusionTexture,metallicRoughnessTexture:n?.metallicRoughnessTexture,metallicFactor:n?.metallicFactor,roughnessFactor:n?.roughnessFactor}),p=d?c[0]:n?.metallicFactor??m[0],h=d?c[1]:n?.roughnessFactor??m[1],x="mask"===a.alphaMode?33:1,b={baseColorFactor:l?[l[0],l[1],l[2],l[3]]:[1,1,1,1],baseColorTextureId:s(n?.baseColorTexture,x),metallicRoughnessTextureId:s(n?.metallicRoughnessTexture,2),metallicFactor:p,roughnessFactor:h},F={alphaMode:a.alphaMode,alphaCutoff:a.alphaCutoff,doubleSided:a.doubleSided,cullFace:"none"===a.cullFace?0:"back"===a.cullFace?2:"front"===a.cullFace?1:0,normalTextureId:s(a.normalTexture,4),emissiveTextureId:s(a.emissiveTexture,16),occlusionTextureId:s(a.occlusionTexture,8),emissiveFactor:i?[i[0],i[1],i[2]]:[0,0,0],metallicRoughness:b,wrapTextures:!1,hasParametersFromSource:d},T=[];return t.forEach(({usage:e},a)=>{const o=null!=r&&r[a]&&r[a].formats,t=o?g(o.map(({name:e,format:r})=>({name:e,encoding:f[r]}))):[];T.push({id:a,usage:e,encodings:t})}),{material:F,textures:T}}function g(e){return e.sort((e,r)=>e.encoding-r.encoding)}const f={ktx2:1,basis:2,dds:4,png:8,jpg:16,"ktx-etc2":32},h={"image/ktx2":2,"image/x.basis":2,"image/vnd-ms.dds":4,"image/png":8,"image/jpg":16,"image/jpeg":16,"image/ktx":32};function x(e){const o=e?.materialDefinitions?Object.keys(e.materialDefinitions)[0]:null,t=e?.textureDefinitions?Object.keys(e.textureDefinitions)[0]:null,s=o?e.materialDefinitions?.[o]:null,n=t?e.textureDefinitions?.[t]:null,l=b();if(null!=s){const e=s.params;e.diffuse&&(r(e.diffuse),l.metallicRoughness.baseColorFactor=[e.diffuse[0],e.diffuse[1],e.diffuse[2],1]),null!=e.doubleSided&&(l.doubleSided=e.doubleSided,l.cullFace=e.doubleSided?0:2),"none"!==e.cullFace&&"front"!==e.cullFace&&"back"!==e.cullFace||(l.cullFace="none"===e.cullFace?0:"back"===e.cullFace?2:1),e.transparency&&(l.metallicRoughness.baseColorFactor[3]=a(1-e.transparency,0,1)),(e.useVertexColorAlpha||l.metallicRoughness.baseColorFactor[3]<1)&&(l.alphaMode="blend")}const i=[];if(null!=n){const e=0;!n.wrap||"repeat"!==n.wrap[0]&&"repeat"!==n.wrap[1]||(l.wrapTextures=!0);let r=1;"rgba"===n.channels&&(l.alphaMode="blend",r|=32);const a=n.images.length-1,o=n.images[a],t=e=>e?.split("/").pop(),s=Array.isArray(n.encoding)?g(n.encoding.map((e,r)=>({name:t(o.href[r]),encoding:h[e]||0}))):[{name:t(o.href),encoding:h[n.encoding]||0}];i.push({id:e,usage:r,encodings:s}),l.metallicRoughness.baseColorTextureId=e}return{material:l,textures:i}}const b=()=>({alphaMode:"opaque",alphaCutoff:d,doubleSided:!0,cullFace:0,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[.8,.8,.8,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6},wrapTextures:!1,hasParametersFromSource:!0});function F(e,r,a,o,t,s){if(null==e?.data)return null;const n=e.data,l=o.renderingContext.parameters.maxMaxAnisotropy,u=l>1,c=a||!r.wrapTextures?T:C,m=v(e.encoding),d=1&e.usage?"opaque"===r.alphaMode?6407:6408:6407,p=k(e.encoding,e.usage)?{compressionTracker:t,compressionCallback:s}:void 0;return new i(n,{mipmap:u,maxAnisotropy:l,encoding:m,wrap:c,pixelFormat:d,compressionOptions:p,noUnpackFlip:!0})}const T={s:33071,t:33071},C={s:10497,t:10497};function M(r,a,t,s,i){const u=i.rendererTextureUsage,p=e=>w(t,a,e&u),g=[],f=e=>{const r=p(e);if(null==r)return null;const a=new n(s,r);return g.push(a.loadPromise),a},h=f(33),x=f(2),b=f(16),F=f(8),T=f(4),C={baseColor:o(e(r.metallicRoughness.baseColorFactor)),hasParametersFromSource:!!r.hasParametersFromSource,usePBR:i.usePBR,mrrFactors:[r.metallicRoughness.metallicFactor,r.metallicRoughness.roughnessFactor,r.hasParametersFromSource?c[2]:m[2]],emissiveBaseColor:r.emissiveFactor,isIntegratedMesh:i.isIntegratedMesh,textureAlphaCutoff:"mask"===r.alphaMode?r.alphaCutoff:d,alphaDiscardMode:"opaque"===r.alphaMode?1:"mask"===r.alphaMode?2:3,baseColorTexture:h,metallicRoughnessTexture:x,emissionTexture:b,occlusionTexture:F,normalTexture:T,slicePlaneEnabled:i.slicePlaneEnabled,doubleSided:r.doubleSided,cullFace:r.cullFace,ellipsoidMode:l(i.viewSpatialReference),sphereDepthInterpolate:!1,isGround
|
|
2
|
+
import{validateColorAndOpacity as e,validateColor as r}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as a}from"../../../../core/mathUtils.js";import{clone as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{uncompressedFormats as t,compressibleUsages as s}from"./enums.js";import{RenderTexture as n}from"../../webgl-engine/core/material/RenderTexture.js";import{getEllipsoidMode as l}from"../../webgl-engine/core/shaderLibrary/util/EllipsoidMode.js";import{ManagedTexture as i}from"../../webgl-engine/lib/ManagedTexture.js";import{useSchematicPBR as u,schematicMRRFactors as c,advancedMRRFactors as m}from"../../webgl-engine/materials/pbrUtils.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";function p(r,a,o){const t=new Map,s=(e,r)=>{if(null==e)return-1;const a=t.get(e.id);if(a)return a.usage|=r,a.id;const o=t.size;return t.set(e.id,{id:o,usage:r}),o},n=a.pbrMetallicRoughness,l=n?.baseColorFactor?e(n.baseColorFactor):null,i=a.emissiveFactor,d=o&&0===n?.metallicFactor||u({normalTexture:a.normalTexture,emissiveTexture:a.emissiveTexture,emissiveFactor:a.emissiveFactor,occlusionTexture:a.occlusionTexture,metallicRoughnessTexture:n?.metallicRoughnessTexture,metallicFactor:n?.metallicFactor,roughnessFactor:n?.roughnessFactor}),p=d?c[0]:n?.metallicFactor??m[0],h=d?c[1]:n?.roughnessFactor??m[1],x="mask"===a.alphaMode?33:1,b={baseColorFactor:l?[l[0],l[1],l[2],l[3]]:[1,1,1,1],baseColorTextureId:s(n?.baseColorTexture,x),metallicRoughnessTextureId:s(n?.metallicRoughnessTexture,2),metallicFactor:p,roughnessFactor:h},F={alphaMode:a.alphaMode,alphaCutoff:a.alphaCutoff,doubleSided:a.doubleSided,cullFace:"none"===a.cullFace?0:"back"===a.cullFace?2:"front"===a.cullFace?1:0,normalTextureId:s(a.normalTexture,4),emissiveTextureId:s(a.emissiveTexture,16),occlusionTextureId:s(a.occlusionTexture,8),emissiveFactor:i?[i[0],i[1],i[2]]:[0,0,0],metallicRoughness:b,wrapTextures:!1,hasParametersFromSource:d},T=[];return t.forEach(({usage:e},a)=>{const o=null!=r&&r[a]&&r[a].formats,t=o?g(o.map(({name:e,format:r})=>({name:e,encoding:f[r]}))):[];T.push({id:a,usage:e,encodings:t})}),{material:F,textures:T}}function g(e){return e.sort((e,r)=>e.encoding-r.encoding)}const f={ktx2:1,basis:2,dds:4,png:8,jpg:16,"ktx-etc2":32},h={"image/ktx2":2,"image/x.basis":2,"image/vnd-ms.dds":4,"image/png":8,"image/jpg":16,"image/jpeg":16,"image/ktx":32};function x(e){const o=e?.materialDefinitions?Object.keys(e.materialDefinitions)[0]:null,t=e?.textureDefinitions?Object.keys(e.textureDefinitions)[0]:null,s=o?e.materialDefinitions?.[o]:null,n=t?e.textureDefinitions?.[t]:null,l=b();if(null!=s){const e=s.params;e.diffuse&&(r(e.diffuse),l.metallicRoughness.baseColorFactor=[e.diffuse[0],e.diffuse[1],e.diffuse[2],1]),null!=e.doubleSided&&(l.doubleSided=e.doubleSided,l.cullFace=e.doubleSided?0:2),"none"!==e.cullFace&&"front"!==e.cullFace&&"back"!==e.cullFace||(l.cullFace="none"===e.cullFace?0:"back"===e.cullFace?2:1),e.transparency&&(l.metallicRoughness.baseColorFactor[3]=a(1-e.transparency,0,1)),(e.useVertexColorAlpha||l.metallicRoughness.baseColorFactor[3]<1)&&(l.alphaMode="blend")}const i=[];if(null!=n){const e=0;!n.wrap||"repeat"!==n.wrap[0]&&"repeat"!==n.wrap[1]||(l.wrapTextures=!0);let r=1;"rgba"===n.channels&&(l.alphaMode="blend",r|=32);const a=n.images.length-1,o=n.images[a],t=e=>e?.split("/").pop(),s=Array.isArray(n.encoding)?g(n.encoding.map((e,r)=>({name:t(o.href[r]),encoding:h[e]||0}))):[{name:t(o.href),encoding:h[n.encoding]||0}];i.push({id:e,usage:r,encodings:s}),l.metallicRoughness.baseColorTextureId=e}return{material:l,textures:i}}const b=()=>({alphaMode:"opaque",alphaCutoff:d,doubleSided:!0,cullFace:0,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[.8,.8,.8,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6},wrapTextures:!1,hasParametersFromSource:!0});function F(e,r,a,o,t,s){if(null==e?.data)return null;const n=e.data,l=o.renderingContext.parameters.maxMaxAnisotropy,u=l>1,c=a||!r.wrapTextures?T:C,m=v(e.encoding),d=1&e.usage?"opaque"===r.alphaMode?6407:6408:6407,p=k(e.encoding,e.usage)?{compressionTracker:t,compressionCallback:s}:void 0;return new i(n,{mipmap:u,maxAnisotropy:l,encoding:m,wrap:c,pixelFormat:d,compressionOptions:p,noUnpackFlip:!0})}const T={s:33071,t:33071},C={s:10497,t:10497};function M(r,a,t,s,i){const u=i.rendererTextureUsage,p=e=>w(t,a,e&u),g=[],f=e=>{const r=p(e);if(null==r)return null;const a=new n(s,r);return g.push(a.loadPromise),a},h=f(33),x=f(2),b=f(16),F=f(8),T=f(4),C={baseColor:o(e(r.metallicRoughness.baseColorFactor)),hasParametersFromSource:!!r.hasParametersFromSource,usePBR:i.usePBR,mrrFactors:[r.metallicRoughness.metallicFactor,r.metallicRoughness.roughnessFactor,r.hasParametersFromSource?c[2]:m[2]],emissiveBaseColor:r.emissiveFactor,isIntegratedMesh:i.isIntegratedMesh,textureAlphaCutoff:"mask"===r.alphaMode?r.alphaCutoff:d,alphaDiscardMode:"opaque"===r.alphaMode?1:"mask"===r.alphaMode?2:3,baseColorTexture:h,metallicRoughnessTexture:x,emissionTexture:b,occlusionTexture:F,normalTexture:T,slicePlaneEnabled:i.slicePlaneEnabled,doubleSided:r.doubleSided,cullFace:r.cullFace,ellipsoidMode:l(i.viewSpatialReference),sphereDepthInterpolate:!1,isGround:!!has("enable-feature:im-as-ground")&&i.isGround,opacity:1,polygonOffset:0,applySSAO:i.applySSAO};return{texturePromise:Promise.all(g),materialParameters:C}}function R(e){const r=!!e.compressedTextureS3TC,a=!!e.compressedTextureETC,o=has("disable-feature:i3s-basis")?0:3;return 24|(r?4|o:0)|(a?o:0)}function S(e,r){if(null!=r)return e.find(e=>0!==(e.encoding&r))}function w(e,r,a){if(null==e||0===a)return null;for(let o=0;o<e.length;o++){const t=e[o];if(null!=t&&0!==(t.usage&a)){const e=r[o];return null!=e?e.id:null}}return null}function k(e,r){return!!has("enable-feature:esri-compress-IM-textures")&&(0!==(e&t)&&!(r&~s))}function v(e){switch(e){case 1:return"image/ktx2";case 2:return"image/x.basis";case 4:return"image/vnd-ms.dds";case 8:return"image/png";case 16:return"image/jpeg";case 32:return"image/ktx";default:return""}}export{M as configureMaterial,F as createTexture,b as defaultMaterial,p as getMaterialAndTextures,x as getMaterialAndTexturesFromShared,R as getSupportedEncodings,w as getTextureIdByUsage,S as selectEncoding};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isValidIntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{Graphic3DTarget as e,LayerTarget as r}from"../../webgl-engine/lib/IntersectorTarget.js";class
|
|
2
|
+
import{isValidIntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{Graphic3DTarget as e,LayerTarget as r}from"../../webgl-engine/lib/IntersectorTarget.js";class n extends e{constructor(t,e,r){super(r,null),this.point=t,this.outwardDirection=e}}function s(e){return t(e)&&0===e.intersector&&!!e.target}class i extends e{constructor(t,e,r,n){super(e,r),this.point=t,this.createGraphic=n}}function o(e){return t(e)&&6===e.intersector&&!!e.target}class c extends r{constructor(t,e,r,n,s){super(t),this.layerViewUid=t,this.sublayerId=e,this.nodeIndex=r,this.componentIndex=n,this.triangleNr=s}}class u extends e{constructor(t,e,r){super(e,null),this.point=t,this.createVoxelGraphic=r}}class a extends r{}function l(e){return t(e)&&2===e.intersector&&!!e.target}function h(e){return t(e)&&8===e.intersector&&!!e.target}function p(e){return t(e)&&9===e.intersector&&!!e.target}export{n as GaussianSplatTarget,c as I3sTarget,i as PclTarget,a as Tiles3DTarget,u as VoxelTarget,h as is3DTilesIntersectorResult,s as isGaussianSplatIntersectorResult,l as isI3sIntersectorResult,o as isPclIntersectorResult,p as isVoxelIntersectorResult};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{clamp as e,acosClamped as i,deg2rad as a}from"../../../../core/mathUtils.js";import{property as r,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{translate as o,rotate as s,identity as c}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as m,transformMat4 as h,add as p,scale as d,copy as u,negate as _,length as f,set as v,normalize as C,cross as g,distance as y,direction as b,dot as w}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as S}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as O}from"../../../../geometry/ellipsoidUtils.js";import{wrap as x}from"../../../../geometry/support/ray.js";import{Sphere as M}from"../../../../geometry/support/sphere.js";import{angle as E}from"../../../../geometry/support/vector.js";import{sv3d as j}from"../../../../geometry/support/vectorStacks.js";import{applyAll as z}from"../../camera/constraintUtils.js";import{ConstraintOptions as P}from"../../camera/constraintUtils/ConstraintOptions.js";import{TiltRange as T}from"../Constraints.js";import{InteractiveController as A}from"./InteractiveController.js";import{panMotionToRotationMatrix as D,onSurfaceTiltToEyeTiltGlobal as R,offSurfaceTiltToEyeTiltGlobal as H}from"../utils/navigationUtils.js";import{viewAngle as U}from"../utils/viewUtils.js";import{headingTiltToDirectionUp as k}from"../../support/cameraUtils.js";import{createDirectionUp as F}from"../../support/cameraUtilsInternal.js";import G from"../../webgl/RenderCamera.js";import{extractTransformation as B,isZeroTransformation as I,extractTransformationKeyboard as V}from"../../../navigation/gamepadAndKeyboardUtils.js";let L=class extends A{constructor(t){super(t),this._filteredSurfaceElevation=0,this._precisionPanEnabled=!1,this._coarsePanEnabled=!1,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._keysButtonState=[0,0,0,0,0,0,0,0,0,0,0,0],this._tmpCamera=new G,this._headingStart=0,this._constraintOptions=new P(15,0,0,new G,null,1)}handleEventGamepad(t){const e=B(t,this.view.navigation.gamepad,this._transformation);("end"===t.action||I(e))&&this.finishController()}activateDirection(t){this._keysButtonState[t]=1,V(this._keysButtonState,this._transformation)}directionActive(t){return 1===this._keysButtonState[t]}countActiveDirections(){return this._keysButtonState.reduce((t,e)=>e>0?t+1:t,0)}deactivateDirection(t){this._keysButtonState[t]=0;const e=V(this._keysButtonState,this._transformation);I(e)&&(this._precisionPanEnabled=!1,this._coarsePanEnabled=!1,this.finishController())}setPrecisionPanEnabled(t){this._precisionPanEnabled=t}setCoarsePanEnabled(t){this._coarsePanEnabled=t}onControllerStart(t){this._filteredSurfaceElevation=this.view.pointsOfInterest.cameraOnSurface.location.z,this._headingStart=this.view.camera.heading,super.onControllerStart(t)}_updateFilteredSurfaceElevation(t){const e=this.view.pointsOfInterest.cameraOnSurface.location.z,i=1;this._filteredSurfaceElevation+=i*(e-this._filteredSurfaceElevation)*t}stepController(t,e){this._updateStartHeading(),this._updateFilteredSurfaceElevation(t),this.currentCamera.copyViewFrom(e),this._updateCameraCenter(),this._constraintOptions.interactionStartCamera?.copyFrom(this.currentCamera),this._calculateControlTransformation(t,this.currentCamera,$),this._applyDisabledMovementTypes($),this._applyPan($.pan),this._applyRotate($.rotate),this._applyZoom($.zoom),this._applyAscend($.ascend),this._constraintOptions.interactionType=0,this._constraintOptions.selection=8,z(this.view,this.currentCamera,this._constraintOptions),super.stepController(t,e)}_updateStartHeading(){0!==this._transformation.heading&&(this._headingStart=this.view.camera.heading)}_applyRotate(t){if(!t.enabled)return;const e=this.currentCamera;m(tt,e.center,e.eye),h(tt,tt,t.matrix),e.center=p(tt,tt,e.eye),e.up=h(tt,e.up,t.matrix),this._constraintOptions.interactionType=3,this._constraintOptions.selection=7,z(this.view,e,this._constraintOptions)}_applyPan(t,e=this.currentCamera){if(!t.enabled)return;e.eye=h(tt,e.eye,t.matrix),e.center=h(tt,e.center,t.matrix);this.view.state.isGlobal&&(e.up=h(tt,e.up,t.matrix)),this._constraintOptions.interactionType=4,this._constraintOptions.selection=15,z(this.view,e,this._constraintOptions)}_applyZoom(t){if(!t)return;const e=this.currentCamera.viewForward;this.currentCamera.eye=p(tt,this.currentCamera.eye,d(j.get(),e,t)),u(et,e),_(et,et),this._constraintOptions.interactionDirection=et,this._constraintOptions.interactionType=1,this._constraintOptions.selection=7,z(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}_applyAscend(t){if(!t)return;const e=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,j.get());this._constraintOptions.interactionDirection=u(et,e);if(this.view.state.isGlobal){const e=f(this.currentCamera.eye),i=(e+t)/e;this.currentCamera.eye=d(tt,this.currentCamera.eye,i),this.currentCamera.center=d(tt,this.currentCamera.center,i)}else{const i=d(j.get(),e,t);this.currentCamera.eye=p(tt,this.currentCamera.eye,i),this.currentCamera.center=p(tt,this.currentCamera.center,i)}this._updateCameraCenter(),this._constraintOptions.interactionType=5,this._constraintOptions.selection=8,z(this.view,this.currentCamera,this._constraintOptions)&&this._updateCameraCenter(),this._constraintOptions.selection=7,z(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}_calculateControlTransformation(t,e,i){rt(i);const a=this._computeVelocities(t);this.view.state.isLocal?this._calculateControlTransformationLocal(a,e,i):this._calculateControlTransformationGlobal(a,e,i)}_updateCameraCenter(){const t=this.view.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,e=this.view.renderCoordsHelper,i=this.currentCamera.ray;this.currentCamera.center=e.intersectManifoldClosestSilhouette(i,t,tt)}_calculateControlTransformationLocal(t,i,a){const{viewRight:r,viewForward:n}=i,c=this._transformation,l=this.view.navigation.gamepad,m=v(j.get(),n[0],n[1],0);C(m,m);const h=c.translation[0]*t.pan;if(0!==h){const t=d(j.get(),r,h);o(a.pan.matrix,a.pan.matrix,t),a.pan.enabled=!0}switch(l.mode){case"pan":{const e=-c.translation[1]*t.pan;if(0!==e){const t=d(j.get(),m,e);o(a.pan.matrix,a.pan.matrix,t),a.pan.enabled=!0}a.zoom=c.zoom*t.zoom;break}case"zoom":a.zoom=(-c.translation[1]+c.zoom)*t.zoom;break;default:l.mode}const p=c.translation[2]*t.ascend;a.ascend=p;const u=-c.heading*t.rotate;0!==u&&(s(a.rotate.matrix,a.rotate.matrix,u,this.view.renderCoordsHelper.worldUpAtPosition(i.eye,j.get())),a.rotate.enabled=!0);const _=c.tilt*t.rotate,f=U(this.view.renderCoordsHelper,i.center,i.eye),g=e(f+_,T.min,T.max)-f;g&&(s(a.rotate.matrix,a.rotate.matrix,g,r),a.rotate.enabled=!0)}_calculateControlTransformationGlobal(t,e,i){const{eye:a,viewRight:r}=e,n=this._transformation,o=this.view.navigation.gamepad,c=g(j.get(),r,a);C(c,c),_(c,c),D(this.startCamera,e,n,t,this.view.camera.heading,this._headingStart,this.view.camera.tilt,i,o),this._tmpCamera.copyFrom(this.currentCamera),this._applyPan($.pan,this._tmpCamera);const l=this.view.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,m=n.translation[2]*t.ascend;i.ascend=m;const h=-n.heading*t.rotate;0!==h&&(s(i.rotate.matrix,i.rotate.matrix,h,this._tmpCamera.eye),i.rotate.enabled=!0);const p=n.tilt*t.rotate,d=this._clampTiltDeltaGlobalToValidRange(p,e.ray,l);0!==d&&(s(i.rotate.matrix,i.rotate.matrix,d,this._tmpCamera.viewRight),i.rotate.enabled=!0),i.zoom+=n.zoom*t.zoom}_clampTiltDeltaGlobalToValidRange(t,i,a){const r=O(this.view.spatialReference),n=R(T.min,i.origin,a,r);let o=0,s=0;const c=j.get();if(this.view.renderCoordsHelper.intersectManifold(i,a,c)){const t=U(this.view.renderCoordsHelper,c,i.origin);o=R(t,i.origin,a,r),s=R(T.max,i.origin,a,r)}else{at.radius=a+r.radius,at.closestPointOnSilhouette(i,c);const t=Math.PI+E(i.direction,c);o=H(t,i.origin,a,r),s=H(T.max,i.origin,a,r)}return e(o+t,n,s)-o}_getPointAbsoluteSurfaceElevation(t,e,i){const{renderCoordsHelper:a}=this.view,r=a.getAltitude(t),n=e+Math.abs(r-e);return a.setAltitude(i,n,t),n}_clampedDistanceToSurface(t,e){const{renderCoordsHelper:i}=this.view,{camera:a}=this.view.state,{direction:r}=k(this.view,e,0,K,it),n=i.intersectManifoldClosestSilhouette(x(e,r),t,j.get()),o=y(e,n),s=i.intersectManifoldClosestSilhouette(x(e,b(j.get(),e,a.center)),t,j.get()),c=y(e,s);return Math.min(o,c)}_computeHeadingRotateRadius(t){const{renderCoordsHelper:e,state:a}=this.view,{camera:r,isGlobal:n}=a,o=e.intersectManifoldClosestSilhouette(r.ray,this._filteredSurfaceElevation,j.get());if(n){const e=m(j.get(),t,o),a=f(e);d(e,e,1/a);const r=C(j.get(),t),n=i(w(r,e));return a*Math.sin(Math.min(Z,n))}{const i=u(j.get(),t);return e.setAltitude(i,this._filteredSurfaceElevation),y(o,i)}}_minimumAscendVelocity(){return this.view.state.constraints.collision.enabled?0:Q}_computeVelocities(t){const i=this._filteredSurfaceElevation,a=i+O(this.view.spatialReference).radius,{camera:r,isGlobal:n}=this.view.state,o=j.get(),s=this._getPointAbsoluteSurfaceElevation(r.eye,i,o),c=this._clampedDistanceToSurface(i,o),l=r.width/2,m=X*r.width,h=X*r.width,p=c*Math.tan(.5*r.fovX)/l,d=p/a,u=p/this._computeHeadingRotateRadius(o),_=s-i;return{pan:(n?d:p)*m*t*(this._precisionPanEnabled?J:this._coarsePanEnabled?N:1),ascend:Math.max(this._minimumAscendVelocity()*t,2**(m*t/l)*_-_),zoom:2**(m*t/l)*c-c,rotate:e(u*h,W,Y)*t}}_applyDisabledMovementTypes(t){null==this.disableMovements||void 0!==this.disableMovements.mode&&this.view.state.viewingMode!==this.disableMovements.mode||(t.zoom=this.disableMovements.zoom?0:t.zoom,t.ascend=this.disableMovements.ascend?0:t.ascend,t.pan.enabled=!this.disableMovements.pan,this.disableMovements.pan&&c(t.pan.matrix),t.rotate.enabled=!this.disableMovements.rotate,this.disableMovements.rotate&&c(t.rotate.matrix))}static activatesFor(t,e){const i=B(e,t.navigation.gamepad,q);return!("end"===e.action||I(i))}};t([r({constructOnly:!0})],L.prototype,"gamepadDevice",void 0),t([r({constructOnly:!0})],L.prototype,"disableMovements",void 0),L=t([n("esri.views.3d.state.controllers.GamepadKeyboardController")],L);const q={translation:[0,0,0],heading:0,tilt:0,zoom:0},K=80,Z=a(K),X=.75,J=.25,N=4,Q=5,W=a(30),Y=a(80),$={zoom:0,ascend:0,pan:{enabled:!1,matrix:l()},rotate:{enabled:!1,matrix:l()}},tt=S(),et=S(),it=F(),at=new M;function rt(t){t.zoom=0,t.ascend=0,t.pan.enabled=!1,c(t.pan.matrix),t.rotate.enabled=!1,c(t.rotate.matrix)}export{L as GamepadKeyboardController};
|
|
2
|
+
import{__decorate as t}from"tslib";import{clamp as e,acosClamped as i,deg2rad as a}from"../../../../core/mathUtils.js";import{property as r,subclass as n}from"../../../../core/accessorSupport/decorators.js";import{translate as o,rotate as s,identity as c}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{subtract as m,transformMat4 as h,add as p,scale as d,copy as u,negate as _,length as f,set as v,normalize as C,cross as g,distance as y,direction as b,dot as w}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as S}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as O}from"../../../../geometry/ellipsoidUtils.js";import{wrap as x}from"../../../../geometry/support/ray.js";import{Sphere as M}from"../../../../geometry/support/sphere.js";import{angle as E}from"../../../../geometry/support/vector.js";import{sv3d as j}from"../../../../geometry/support/vectorStacks.js";import{applyAll as z}from"../../camera/constraintUtils.js";import{ConstraintOptions as P}from"../../camera/constraintUtils/ConstraintOptions.js";import{TiltRange as T}from"../Constraints.js";import{InteractiveController as A}from"./InteractiveController.js";import{panMotionToRotationMatrix as D,onSurfaceTiltToEyeTiltGlobal as R,offSurfaceTiltToEyeTiltGlobal as H}from"../utils/navigationUtils.js";import{viewAngle as U}from"../utils/viewUtils.js";import{headingTiltToDirectionUp as k}from"../../support/cameraUtils.js";import{createDirectionUp as F}from"../../support/cameraUtilsInternal.js";import G from"../../webgl/RenderCamera.js";import{extractTransformation as B,isZeroTransformation as I,extractTransformationKeyboard as V}from"../../../navigation/gamepadAndKeyboardUtils.js";let L=class extends A{constructor(t){super(t),this._filteredSurfaceElevation=0,this._precisionPanEnabled=!1,this._coarsePanEnabled=!1,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._keysButtonState=[0,0,0,0,0,0,0,0,0,0,0,0],this._tmpCamera=new G,this._headingStart=0,this._constraintOptions=new P(15,0,0,new G,null,1)}handleEventGamepad(t){const e=B(t,this.view.navigation.gamepad,this._transformation);("end"===t.action||I(e))&&this.finishController()}activateDirection(t){this._keysButtonState[t]=1,V(this._keysButtonState,this._transformation)}directionActive(t){return 1===this._keysButtonState[t]}countActiveDirections(){return this._keysButtonState.reduce((t,e)=>e>0?t+1:t,0)}deactivateDirection(t){this._keysButtonState[t]=0;const e=V(this._keysButtonState,this._transformation);I(e)&&(this._precisionPanEnabled=!1,this._coarsePanEnabled=!1,this.finishController())}setPrecisionPanEnabled(t){this._precisionPanEnabled=t}setCoarsePanEnabled(t){this._coarsePanEnabled=t}onControllerStart(t){this._filteredSurfaceElevation=this.view.pointsOfInterest.cameraOnSurface.location.z,this._headingStart=this.view.camera.heading,super.onControllerStart(t)}_updateFilteredSurfaceElevation(t){const e=this.view.pointsOfInterest.cameraOnSurface.location.z,i=1;this._filteredSurfaceElevation+=i*(e-this._filteredSurfaceElevation)*t}stepController(t,e){this._updateStartHeading(),this._updateFilteredSurfaceElevation(t),this.currentCamera.copyViewFrom(e),this._updateCameraCenter(),this._constraintOptions.interactionStartCamera?.copyFrom(this.currentCamera),this._calculateControlTransformation(t,this.currentCamera,$),this._applyDisabledMovementTypes($),this._applyPan($.pan),this._applyRotate($.rotate),this._applyZoom($.zoom),this._applyAscend($.ascend),this._constraintOptions.interactionType=0,this._constraintOptions.selection=8,z(this.view,this.currentCamera,this._constraintOptions),super.stepController(t,e)}_updateStartHeading(){0!==this._transformation.heading&&(this._headingStart=this.view.camera.heading)}_applyRotate(t){if(!t.enabled)return;const e=this.currentCamera;m(tt,e.center,e.eye),h(tt,tt,t.matrix),e.center=p(tt,tt,e.eye),e.up=h(tt,e.up,t.matrix),this._constraintOptions.interactionType=3,this._constraintOptions.selection=7,z(this.view,e,this._constraintOptions)}_applyPan(t,e=this.currentCamera){if(!t.enabled)return;e.eye=h(tt,e.eye,t.matrix),e.center=h(tt,e.center,t.matrix);this.view.state.isGlobal&&(e.up=h(tt,e.up,t.matrix)),this._constraintOptions.interactionType=4,this._constraintOptions.selection=15,z(this.view,e,this._constraintOptions)}_applyZoom(t){if(!t)return;const e=this.currentCamera.viewForward;this.currentCamera.eye=p(tt,this.currentCamera.eye,d(j.get(),e,t)),u(et,e),_(et,et),this._constraintOptions.interactionDirection=et,this._constraintOptions.interactionType=1,this._constraintOptions.selection=7,z(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}_applyAscend(t){if(!t)return;const e=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,j.get());this._constraintOptions.interactionDirection=u(et,e);if(this.view.state.isGlobal){const e=f(this.currentCamera.eye),i=(e+t)/e;this.currentCamera.eye=d(tt,this.currentCamera.eye,i),this.currentCamera.center=d(tt,this.currentCamera.center,i)}else{const i=d(j.get(),e,t);this.currentCamera.eye=p(tt,this.currentCamera.eye,i),this.currentCamera.center=p(tt,this.currentCamera.center,i)}this._updateCameraCenter(),this._constraintOptions.interactionType=5,this._constraintOptions.selection=8,z(this.view,this.currentCamera,this._constraintOptions)&&this._updateCameraCenter(),this._constraintOptions.selection=7,z(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}_calculateControlTransformation(t,e,i){rt(i);const a=this._computeVelocities(t);this.view.state.isLocal?this._calculateControlTransformationLocal(a,e,i):this._calculateControlTransformationGlobal(a,e,i)}_updateCameraCenter(){const t=this.view.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,e=this.view.renderCoordsHelper,i=this.currentCamera.ray;this.currentCamera.center=e.intersectManifoldClosestSilhouette(i,t,tt)}_calculateControlTransformationLocal(t,i,a){const{viewRight:r,viewForward:n}=i,c=this._transformation,l=this.view.navigation.gamepad,m=v(j.get(),n[0],n[1],0);C(m,m);const h=c.translation[0]*t.pan;if(0!==h){const t=d(j.get(),r,h);o(a.pan.matrix,a.pan.matrix,t),a.pan.enabled=!0}switch(l.mode){case"pan":{const e=-c.translation[1]*t.pan;if(0!==e){const t=d(j.get(),m,e);o(a.pan.matrix,a.pan.matrix,t),a.pan.enabled=!0}a.zoom=c.zoom*t.zoom;break}case"zoom":a.zoom=(-c.translation[1]+c.zoom)*t.zoom;break;default:l.mode}const p=c.translation[2]*t.ascend;a.ascend=p;const u=-c.heading*t.rotate;0!==u&&(s(a.rotate.matrix,a.rotate.matrix,u,this.view.renderCoordsHelper.worldUpAtPosition(i.eye,j.get())),a.rotate.enabled=!0);const _=c.tilt*t.rotate,f=U(this.view.renderCoordsHelper,i.center,i.eye),g=e(f+_,T.min,T.max)-f;g&&(s(a.rotate.matrix,a.rotate.matrix,g,r),a.rotate.enabled=!0)}_calculateControlTransformationGlobal(t,e,i){const{eye:a,viewRight:r}=e,n=this._transformation,o=this.view.navigation.gamepad,c=g(j.get(),r,a);C(c,c),_(c,c),D(this.startCamera,e,n,t,this.view.camera.heading,this._headingStart,this.view.camera.tilt,i,o),this._tmpCamera.copyFrom(this.currentCamera),this._applyPan($.pan,this._tmpCamera);const l=this.view.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,m=n.translation[2]*t.ascend;i.ascend=m;const h=-n.heading*t.rotate;0!==h&&(s(i.rotate.matrix,i.rotate.matrix,h,this._tmpCamera.eye),i.rotate.enabled=!0);const p=n.tilt*t.rotate,d=this._clampTiltDeltaGlobalToValidRange(p,e.ray,l);0!==d&&(s(i.rotate.matrix,i.rotate.matrix,d,this._tmpCamera.viewRight),i.rotate.enabled=!0),i.zoom+=n.zoom*t.zoom}_clampTiltDeltaGlobalToValidRange(t,i,a){const r=O(this.view.spatialReference),n=R(T.min,i.origin,a,r);let o=0,s=0;const c=j.get();if(this.view.renderCoordsHelper.intersectManifold(i,a,c)){const t=U(this.view.renderCoordsHelper,c,i.origin);o=R(t,i.origin,a,r),s=R(T.max,i.origin,a,r)}else{at.radius=a+r.radius,at.closestPointOnSilhouette(i,c);const t=Math.PI+E(i.direction,c);o=H(t,i.origin,a,r),s=H(T.max,i.origin,a,r)}return e(o+t,n,s)-o}_getPointAbsoluteSurfaceElevation(t,e,i){const{renderCoordsHelper:a}=this.view,r=a.getAltitude(t),n=e+Math.abs(r-e);return a.setAltitude(i,n,t),n}_clampedDistanceToSurface(t,e){const{renderCoordsHelper:i}=this.view,{camera:a}=this.view.state,{direction:r}=k(this.view,e,0,K,it),n=i.intersectManifoldClosestSilhouette(x(e,r),t,j.get()),o=y(e,n),s=i.intersectManifoldClosestSilhouette(x(e,b(j.get(),e,a.center)),t,j.get()),c=y(e,s);return Math.min(o,c)}_computeHeadingRotateRadius(t){const{renderCoordsHelper:e,state:a}=this.view,{camera:r,isGlobal:n}=a,o=e.intersectManifoldClosestSilhouette(r.ray,this._filteredSurfaceElevation,j.get());if(n){const e=m(j.get(),t,o),a=f(e);d(e,e,1/a);const r=C(j.get(),t),n=i(w(r,e));return a*Math.sin(Math.min(Z,n))}{const i=u(j.get(),t);return e.setAltitude(i,this._filteredSurfaceElevation),y(o,i)}}_minimumAscendVelocity(){return this.view.state.constraints.collision.enabled?0:Q}_computeVelocities(t){const i=this._filteredSurfaceElevation,a=i+O(this.view.spatialReference).radius,{camera:r,isGlobal:n}=this.view.state,o=j.get(),s=this._getPointAbsoluteSurfaceElevation(r.eye,i,o),c=this._clampedDistanceToSurface(i,o),l=r.width/2,m=X*r.width,h=X*r.width,p=c*Math.tan(.5*r.fovX)/l,d=p/a,u=p/this._computeHeadingRotateRadius(o),_=s-i;return{pan:(n?d:p)*m*t*(this._precisionPanEnabled===this._coarsePanEnabled?1:this._precisionPanEnabled?J:N),ascend:Math.max(this._minimumAscendVelocity()*t,2**(m*t/l)*_-_),zoom:2**(m*t/l)*c-c,rotate:e(u*h,W,Y)*t}}_applyDisabledMovementTypes(t){null==this.disableMovements||void 0!==this.disableMovements.mode&&this.view.state.viewingMode!==this.disableMovements.mode||(t.zoom=this.disableMovements.zoom?0:t.zoom,t.ascend=this.disableMovements.ascend?0:t.ascend,t.pan.enabled=!this.disableMovements.pan,this.disableMovements.pan&&c(t.pan.matrix),t.rotate.enabled=!this.disableMovements.rotate,this.disableMovements.rotate&&c(t.rotate.matrix))}static activatesFor(t,e){const i=B(e,t.navigation.gamepad,q);return!("end"===e.action||I(i))}};t([r({constructOnly:!0})],L.prototype,"gamepadDevice",void 0),t([r({constructOnly:!0})],L.prototype,"disableMovements",void 0),L=t([n("esri.views.3d.state.controllers.GamepadKeyboardController")],L);const q={translation:[0,0,0],heading:0,tilt:0,zoom:0},K=80,Z=a(K),X=.75,J=.25,N=4,Q=5,W=a(30),Y=a(80),$={zoom:0,ascend:0,pan:{enabled:!1,matrix:l()},rotate:{enabled:!1,matrix:l()}},tt=S(),et=S(),it=F(),at=new M;function rt(t){t.zoom=0,t.ascend=0,t.pan.enabled=!1,c(t.pan.matrix),t.rotate.enabled=!1,c(t.rotate.matrix)}export{L as GamepadKeyboardController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import{on as
|
|
2
|
+
import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import has from"../../../core/has.js";import{on as r}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{isIntegratedMeshLayerView as i}from"../../support/layerViewUtils.js";let a=class extends t{constructor(e){super(e),this._integratedMeshElevationUpdateHandles=new Map}initialize(){const e=this._integratedMeshElevationUpdateHandles;this.addHandles([r(()=>this.view.groundView,"elevation-change",e=>this._elevationChange(e)),this.view.allLayerViews.on("change",t=>{t.added.forEach(t=>{if(!i(t))return;if(has("enable-feature:im-as-ground")?t.usedAsGround:t.replacesTerrain)return;const r=t.elevationProvider.on("elevation-change",e=>this._elevationChange(e));e.set(t,r),this.addHandles(r,t)}),t.removed.forEach(t=>{i(t)&&(this.removeHandles(t),e.delete(t))})})])}intersect(e,t,r,o){this.view.groundView.intersect(e,t,r,o);for(const s of this._integratedMeshElevationUpdateHandles.keys())s.intersect(e,t,r,o)}_elevationChange(e){this.emit("elevation-change",e)}};e([o({constructOnly:!0})],a.prototype,"view",void 0),a=e([s("esri.views.3d.support.GroundAndIMSurface")],a);export{a as GroundAndIMSurface};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../Graphic.js";import has from"../../../core/has.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as t,isScreenPolygon as i,isScreenRect as r,createScreenPointArray as s,createScreenPoint as o}from"../../../core/screenUtils.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../geometry/Point.js";import c from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{Sphere as d,sphereCSO as p}from"../../../geometry/support/sphere.js";import{fallbackObjectIDAttribute as f}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as m}from"../../../layers/support/layerUtils.js";import{debugFlags as g}from"./debugFlags.js";import{getElevationAtPoint as y}from"./ElevationProvider.js";import{getGraphicHitDedupeKey as h,resolveOrderedIntersectionHits as w}from"./intersectionHitUtils.js";import{Intersector as b}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResultRay as S}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as x,toOwner as E}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as U}from"../webgl-engine/lib/verticalOffsetUtils.js";async function j(e,n,t,o){const l=t?D(e,t):o;if(i(n))return I(e,n,l,t?.excludeLabels);if(r(n))return I(e,V(n),l,t?.excludeLabels);const a=n,c=s(a.x,a.y);l.requiresGroundFeedback=!0,l.enableDraped=!0;const u=new b(e.state.viewingMode);u.options.selectionMode=!0,u.options.store=2,u.options.excludeLabels=t?.excludeLabels??!1,e.sceneIntersectionHelper.intersectIntersectorScreen(c,u,l);const d=await Array.fromAsync(
|
|
2
|
+
import e from"../../../Graphic.js";import has from"../../../core/has.js";import{isIterable as n}from"../../../core/iteratorUtils.js";import{screenPointObjectToArray as t,isScreenPolygon as i,isScreenRect as r,createScreenPointArray as s,createScreenPoint as o}from"../../../core/screenUtils.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import a from"../../../geometry/Point.js";import c from"../../../geometry/SpatialReference.js";import{projectVectorToVector as u}from"../../../geometry/projection/projectVectorToVector.js";import{Sphere as d,sphereCSO as p}from"../../../geometry/support/sphere.js";import{fallbackObjectIDAttribute as f}from"../../../layers/LayerConstants.js";import{isIntegratedMeshLayer as m}from"../../../layers/support/layerUtils.js";import{debugFlags as g}from"./debugFlags.js";import{getElevationAtPoint as y}from"./ElevationProvider.js";import{getGraphicHitDedupeKey as h,resolveOrderedIntersectionHits as w}from"./intersectionHitUtils.js";import{Intersector as b}from"../webgl-engine/lib/Intersector.js";import{isValidIntersectorResultRay as S}from"../webgl-engine/lib/IntersectorResult.js";import{toHit as x,toOwner as E}from"../webgl-engine/lib/intersectorUtilsConversions.js";import{terrainId as U}from"../webgl-engine/lib/verticalOffsetUtils.js";async function j(e,n,t,o){const l=t?D(e,t):o;if(i(n))return I(e,n,l,t?.excludeLabels);if(r(n))return I(e,V(n),l,t?.excludeLabels);const a=n,c=s(a.x,a.y);l.requiresGroundFeedback=!0,l.enableDraped=!0;const u=new b(e.state.viewingMode);u.options.selectionMode=!0,u.options.store=2,u.options.excludeLabels=t?.excludeLabels??!1,e.sceneIntersectionHelper.intersectIntersectorScreen(c,u,l);const d=await Array.fromAsync(L(e,u.results.all,l.graphics,{getDistance:e=>e.distanceInRenderSpace,getMapPoint:n=>M(e,n),stopAtSupportSurface:!0})),p=u.results.ground,f=E(p,e),y=null!=f&&"type"in f&&m(f)&&(!has("enable-feature:im-as-ground")||f.isUsedAsGroundLayer)?f:null,h={screenPoint:a,results:d,ground:{mapPoint:M(e,p),distance:S(p)?p.distanceInRenderSpace:0,layer:y}};return g.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=u),h}async function I(e,n,i,r){i.enableDraped=!0;const s=new b(e.state.viewingMode);s.options.selectionMode=!0,s.options.store=2,s.options.excludeLabels=r??!1,await e.sceneIntersectionHelper.intersectIntersectorScreenPolygon(n.map(e=>t(e)),s,i);const o=new Array;await e.sceneIntersectionHelper.screenPolygonIntersectionTask.scheduleGenerator(async function*(n){for await(const t of L(e,R(e,s.polygonResults.all),i.graphics,{getDistance:e=>e.distance,getMapPoint:()=>null}))o.push(t),n.madeProgress()&&(n=yield)});const l={screenPoint:null,results:o,ground:{mapPoint:null,distance:0,layer:null}};return g.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(l.intersector=s),l}function*R(e,n){const t=T(e);if(null!=t)for(const i of n)null!=i.distance&&i.distance<=t&&(yield i);else yield*n}function T(e){const n=e.basemapTerrain,t=e.state.camera;if(1!==e.state.viewingMode||!t.aboveGround||!n?.opaque)return null;z.radius=n.getLowerBoundRadius();return p.distanceToSilhouette(z,t.eye)*F}function V(e){return[o(e.x,e.y),o(e.x+e.width,e.y),o(e.x+e.width,e.y+e.height),o(e.x,e.y+e.height)]}function P(e,n,i,r){const s=i?D(e,i):r,o=!(!s.graphics?.include&&!s.graphics?.exclude),l=!(!s.mediaElements?.include&&!s.mediaElements?.exclude),a=t(n);s.enableDraped=s.include&&!s.include.has(U)||s.exclude?.has(U);const c=e.sceneIntersectionHelper,u=new b(e.state.viewingMode);if(u.options.selectionMode=!0,u.options.store=o||l?2:0,u.options.excludeLabels=i?.excludeLabels??!1,c.intersectIntersectorScreen(a,u,s),o||l){for(const n of u.results.all){const t=x(n,e);if(null==t)return M(e,n);if(o&&("graphic"!==t.type||G(s.graphics,t.graphic)))return M(e,n);if(l&&("media"!==t.type||H(s.mediaElements,t.element)))return M(e,n)}return null}return M(e,u.results.min)}async function*L(e,n,t,i){const r=w(e,i.stopAtSupportSurface?function*(){for(const t of n){yield t;const n=E(t,e);if(null!=n&&(n===e.map.ground||"type"in n&&m(n)&&(!has("enable-feature:im-as-ground")||n.isUsedAsGroundLayer)))break}}():n,{getDedupeKey:e=>"graphic"===e.type?v(e.graphic):null,filterHit:e=>"graphic"!==e.type||G(t,e.graphic)});for await(const{input:s,hit:o}of r){const e=i.getMapPoint(s),n=i.getDistance(s);if("media"===o.type){const t=e?o.element.toSource(e):null;yield{...o,mapPoint:e,distance:n,sourcePoint:t}}else yield{...o,mapPoint:e,distance:n}}}function M(e,n,t){return n.getIntersectionPoint(q)?(t=A(e,q,t),7===n.intersector&&e.basemapTerrain&&(t.z=y(e.basemapTerrain,t)??0),t):null}function v(e){const n=e.getObjectId()??e.attributes?.[f];return e.origin&&null!=n?`o-${e.origin.id}-${n}`:`u-${h(e)}`}function G(e,n){return H(e,v(n))}function H(e,n){return null==e||(null==e.include||e.include.has(n))&&(null==e.exclude||!e.exclude.has(n))}function A(e,n,t){let i=e.spatialReference||c.WGS84;return u(n,e.renderSpatialReference,q,i)?n=q:(i=c.WGS84,u(n,e.renderSpatialReference,q,i)&&(n=q)),t?(t.x=n[0],t.y=n[1],t.z=n[2],t.spatialReference=i):t=new a(n,i),t}function D(e,n){const t=C(e,n.include,0),i=C(e,n.exclude,1);return{include:t.layerViewUids,exclude:i.layerViewUids,graphics:{include:t.graphicUids,exclude:i.graphicUids},mediaElements:{include:t.mediaElements,exclude:i.mediaElements}}}function C(t,i,r,s=new N){if(!i)return s;if(i instanceof e)k(s,v(i)),0===r&&(null!=t.graphicsView&&i.layer===t?O(s,t.graphicsView.uid):i.layer&&_(s,t,i.layer.uid));else if("layer"in i&&"element"in i)$(s,i.element),0===r&&_(s,t,i.layer.uid);else if(n(i))for(const e of i)if(e===t.graphics&&null!=t.graphicsView)O(s,t.graphicsView.uid);else if(e===t.map.ground){O(s,U);for(const e of t.map.ground.allIntegratedMeshGround)_(s,t,e.uid)}else C(t,e,r,s);else"layer"in i&&W(s,t,i),"uid"in i&&_(s,t,i.uid);return s}class N{constructor(){this.layerViewUids=null,this.graphicUids=null,this.mediaElements=null}}function _(e,n,t){const i=n.allLayerViews.find(e=>e.layer.uid===t);i&&O(e,i.uid)}function O(e,n){e.layerViewUids??=new Map,e.layerViewUids.set(n,!0)}function W(e,n,t){const i=n.allLayerViews.find(e=>e.layer.uid===t.layer.uid);if(!i)return;e.layerViewUids??=new Map;const r=e.layerViewUids.get(i.uid);!0!==r&&(r?r.add(t.id):e.layerViewUids.set(i.uid,new Set([t.id])))}function k(e,n){e.graphicUids??=new Set,e.graphicUids.add(n)}function $(e,n){e.mediaElements??=new Set,e.mediaElements.add(n)}const q=l(),z=new d,F=1.2;export{A as computeMapPointFromVec3d,D as externalToInternalIntersectOptions,j as hitTest,M as intersectResultToMapPoint,G as testGraphicUidFilter,P as toMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function e(e){switch(e.type){case"annotation-feature":case"building-scene":case"catalog":case"catalog-dynamic-group":case"catalog-footprint":case"csv":case"dimension":case"dimension-feature":case"feature":case"gaussian-splat":case"geo-rss":case"geojson":case"graphics":case"group":case"integrated-mesh":case"integrated-mesh-3dtiles":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-notes":case"ogc-feature":case"oriented-imagery":case"point-cloud":case"route":case"scene":case"stream":case"viewshed":case"voxel":case"subtype-group":case"unknown":case"unsupported":case"wfs":case"parquet":case"imagery":case"imagery-tile":return!1;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"elevation":case"map-image":case"media":case"open-street-map":case"tile":case"vector-tile":case"video":case"wcs":case"web-tile":case"wms":case"wmts":return!0;default:return e.type,!1}}export{e as isTerrainSurfaceLayer};
|
|
2
|
+
function e(e){switch(e.type){case"annotation-feature":case"building-scene":case"catalog":case"catalog-dynamic-group":case"catalog-footprint":case"csv":case"dimension":case"dimension-feature":case"feature":case"gaussian-splat":case"geo-rss":case"geojson":case"graphics":case"group":case"integrated-mesh":case"integrated-mesh-3dtiles":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-notes":case"ogc-feature":case"oriented-imagery":case"point-cloud":case"route":case"scene":case"stream":case"viewshed":case"voxel":case"subtype-group":case"unknown":case"unsupported":case"wfs":case"parquet":case"imagery":case"imagery-tile":return!1;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"elevation":case"geospatial-pdf":case"map-image":case"media":case"open-street-map":case"tile":case"vector-tile":case"video":case"wcs":case"web-tile":case"wms":case"wmts":return!0;default:return e.type,!1}}export{e as isTerrainSurfaceLayer};
|
package/views/3d/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"../../../../../../core/has.js";import{ComponentTechnique as e}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as s}from"../../../core/material/MaterialBase.js";import{isColor as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{hasShadowHighlights as a}from"../../../shaders/ReceiveShadowsConfiguration.js";import{isSphereDepthInterpolateActive as
|
|
2
|
+
import has from"../../../../../../core/has.js";import{ComponentTechnique as e}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as s}from"../../../core/material/MaterialBase.js";import{isColor as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{hasShadowHighlights as a}from"../../../shaders/ReceiveShadowsConfiguration.js";import{isSphereDepthInterpolateActive as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class o extends s{constructor(e,s,r,a,i){super(),this.parameters=e,this.key=i;const o=u(e,r);this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this._emissions=0!==o,this.materialPass=n(e,r),this._configuration=new t(a),this._supportsSphereDepthInterpolate=e.sphereDepthInterpolate&&this._configuration.spherical,this._initializeMaterialConfiguration(e,s,r)}destroy(){}get emissions(){if(!this._emissions)return 0;switch(this.materialPass){case 0:case 3:return 1;case 1:case 4:return 2;case 2:return 3}}acquireTechnique(t,s,r,a){const o=this._updateConfiguration(s,r);if(this._supportsSphereDepthInterpolate&&t.precompiling>0){o.sphereDepthInterpolate=!1;const s=t.get(e,o,a.layout);o.sphereDepthInterpolate=!0;const n=t.get(e,o,a.layout);return i(r.camera,o)?n:s}return t.get(e,o,a.layout)}_initializeMaterialConfiguration(e,t,s){const r=this._configuration;r.hasMetallicRoughnessTexture=e.hasMetallicRoughnessTexture,r.hasOcclusionTexture=e.hasOcclusionTexture,r.hasNormalTexture=e.hasNormalTexture,r.sphereDepthInterpolate=!1,r.ellipsoidMode=e.ellipsoidMode,r.doubleSidedMode=e.doubleSided?1:0,r.hasColorTexture=e.hasBaseColorTexture,r.cullFace=e.cullFace,r.alphaDiscardMode=e.alphaDiscardMode,r.hasVertexColors=t.hasVertexColors,r.textureCoordinateType=t.textureCoordinateType,r.shadeNormals=t.shadeNormals,r.normalType=t.hasNormals?1:2,r.polygonOffset=e.polygonOffset,r.vertexPositionRotationType=t.vertexPositionRotationType,r.componentDataType=s.componentDataType,r.emissionSource=u(e,s),r.groundTransparencyMode=e.groundTransparencyMode}_updateConfiguration(e,t){const s=this._configuration,{identifier:o}=e,n=0===o;s.output=t.output,s.enableOITOffset=t.enableOITOffset,s.sphereDepthInterpolate=this._supportsSphereDepthInterpolate&&i(t.camera,s),s.hasEmission=t.hasEmission,s.renderOccluded=9===t.slot;const l=!this.isIntegratedMesh||has("enable-feature:im-as-ground")&&!this.isGround?0:c(t)?h(t)?3:2:1;s.integratedMeshMode=l,s.pbrMode=3===l?4:this.usePBR?this.hasParametersFromSource?0!==s.shadeNormals&&this.isIntegratedMesh?0:2:1:0,s.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,s.isGroundSlice=s.hasSlicePlane&&this.isGround;const{materialPass:u}=this;s.transparent=n&&(1===u||2===u&&e.transparent||4===u)||s.isGroundSlice,s.hasHighlightMixTexture=2===o&&null!=t.highlightMixTexture,s.snowCover=n&&t.snowCover>0,s.vertexDiscardMode=n&&2===u?e.transparent?2:1:0;const p=r(t.output);return s.receiveAmbientOcclusion=p&&this.applySSAO&&!s.renderOccluded&&null!=t.ssao?.getTexture(),s.receiveGlobalIllumination=p&&this.applySSAO&&!s.renderOccluded&&t.globalIlluminationEnabled,s.hasOccludees=p&&t.hasOccludees,s.receiveShadows=p&&t.shadowMap.ready,s.hasShadowHighlights=a(s,t),s.screenSpaceReflections=t.hasScreenSpaceReflections,s.cloudReflections=p&&null!=t.clouds.data?.cubeMap?.colorTexture,s}}function n(e,t){const{alphaDiscardMode:s,isIntegratedMesh:r,slicePlaneEnabled:a}=e,{transparent:i,opaqueOverride:o}=t,n=e.isObjectTransparent,l=e.hasBaseColorTransparency;if(r)return n||a&&(!has("enable-feature:im-as-ground")||e.isGround)?4:3;if(n)return 1;if(0===o)return 0;if(l||0===s||3===s)return 1;switch(i){case 2:return 0;case 0:return 1;case 1:return 2}}function l(e){return e.hasEmissionTexture||e.hasEmissiveBaseColor}function u(e,{emissiveSourceOverride:t,emissiveOverride:s}){const r=e.hasEmissionTexture,a=1===t,i=2===t;return 2!==s&&(l(e)||2!==t)?l(e)?i?r?4:2:a?r?5:7:6:a?7:6:0}function h(e){return null!=e.overlay?.getTexture(3)}function c(e){return null!=e.overlay?.getTexture(1)}export{o as ComponentMaterial,n as computeMaterialPass,u as getEmissionSource};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{EvaluateAmbientLighting as i}from"./EvaluateAmbientLighting.glsl.js";import{EvaluateAmbientOcclusion as
|
|
2
|
+
import{EvaluateAmbientLighting as i}from"./EvaluateAmbientLighting.glsl.js";import{EvaluateAmbientOcclusion as n}from"./EvaluateAmbientOcclusion.glsl.js";import{Gamma as e}from"./Gamma.glsl.js";import{mainLightDirection as a,mainLightIntensity as t,applyShading as o}from"./MainLighting.glsl.js";import{PhysicallyBasedRendering as l}from"./PhysicallyBasedRendering.glsl.js";import{PiUtils as r}from"./PiUtils.glsl.js";import{ReadGlobalIllumination as c}from"./ReadGlobalIllumination.glsl.js";import{BooleanBindUniform as s}from"../../shaderModules/BooleanBindUniform.js";import{FloatBindUniform as d}from"../../shaderModules/FloatBindUniform.js";import{glsl as m,If as u}from"../../shaderModules/glsl.js";import{ambientBoost as g}from"../../../lighting/SceneLighting.js";import{BlackLevelLightSoftCompression as h}from"../../../shaders/BlackLevelLightSoftCompression.glsl.js";import{ToneMapping as p}from"../../../shaders/ToneMapping.glsl.js";function f(i){i.constants.add("ambientBoostFactor","float",g)}function v(i){i.uniforms.add(new d("lightingGlobalFactor",i=>i.lighting.globalFactor))}function b(g,b){const{pbrMode:L,spherical:I,hasColorTexture:C,receiveGlobalIllumination:D}=b;g.include(e),g.include(c,b),g.include(n,b),0!==L&&g.include(l,b),g.include(i,b),g.include(r),g.include(p,b);const S=!(2===L&&!C);S&&g.include(h),f(g),v(g),g.uniforms.add(a).code.add(m`
|
|
3
3
|
float additionalDirectedAmbientLight(float lightAlignment) {
|
|
4
4
|
return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
|
|
5
5
|
}
|
|
@@ -11,12 +11,14 @@ import{EvaluateAmbientLighting as i}from"./EvaluateAmbientLighting.glsl.js";impo
|
|
|
11
11
|
`),g.uniforms.add(t).code.add(m`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
|
|
12
12
|
float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
|
|
13
13
|
return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
|
|
14
|
-
}`);const R=D?"globalIlluminationOcclusion":"ssao";switch(g.constants.add("mainLightIrradianceScale","float",D?.75:1),g.constants.add("ambientIrradianceScale","float",D?1.5:1),D&&g.code.add(m`vec3 evaluateGlobalIlluminationOcclusion() {
|
|
14
|
+
}`);const R=D?"globalIlluminationOcclusion":"ssao";switch(g.constants.add("mainLightIrradianceScale","float",D?.75:1),g.constants.add("ambientIrradianceScale","float",D?1.5:1),D&&(g.constants.add("globalIlluminationEmissionCompressionWeight","float",.75),g.code.add(m`vec3 evaluateGlobalIlluminationOcclusion() {
|
|
15
15
|
return min(1.2 * readGlobalIlluminationOcclusion(), 1.0);
|
|
16
16
|
}
|
|
17
17
|
vec3 evaluateGlobalIlluminationEmission(vec3 albedoLinear) {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
vec3 emission = 2.25 * (0.75 * albedoLinear + 0.25) * readGlobalIlluminationEmission().rgb;
|
|
19
|
+
vec3 compressedEmission = emission / (emission + 1.0);
|
|
20
|
+
return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWeight);
|
|
21
|
+
}`)),L){case 0:case 4:case 3:g.include(o),g.code.add(m`
|
|
20
22
|
vec3 evaluateSceneLighting(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
|
|
21
23
|
vec3 viewDirection, vec3 upDirection) {
|
|
22
24
|
${u(D,m`vec3 globalIlluminationOcclusion = evaluateGlobalIlluminationOcclusion();`)}
|
|
@@ -40,7 +42,7 @@ return 2.25 * (0.75 * albedoLinear + 0.25) * readGlobalIlluminationEmission().rg
|
|
|
40
42
|
PBRShadingInfo inputs;
|
|
41
43
|
calculatePBRInputs(inputs, normal, viewDirection, upDirection, albedo);
|
|
42
44
|
${u(D,"vec3 globalIlluminationOcclusion = evaluateGlobalIlluminationOcclusion();")}
|
|
43
|
-
`),b.useFillLights?g.uniforms.add(new
|
|
45
|
+
`),b.useFillLights?g.uniforms.add(new s("hasFillLights",i=>i.enableFillLights)):g.constants.add("hasFillLights","bool",!1),g.code.add(m`
|
|
44
46
|
vec3 ambientDir = vec3(5.0 * upDirection[1] - upDirection[0] * upDirection[2], - 5.0 * upDirection[0] - upDirection[2] * upDirection[1], upDirection[1] * upDirection[1] + upDirection[0] * upDirection[0]);
|
|
45
47
|
ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
|
|
46
48
|
|
|
@@ -56,7 +58,7 @@ return 2.25 * (0.75 * albedoLinear + 0.25) * readGlobalIlluminationEmission().rg
|
|
|
56
58
|
inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
|
|
57
59
|
// Assemble the overall irradiance of the ground that illuminates the surface. for this we use the simple model that changes only the sky irradiance by the groundReflectance
|
|
58
60
|
inputs.groundIrradianceToSurface = groundReflectance * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
|
|
59
|
-
`),g.uniforms.add(new
|
|
61
|
+
`),g.uniforms.add(new d("lightingSpecularStrength",i=>i.lighting.mainLight.specularStrength),new d("lightingEnvironmentStrength",i=>i.lighting.mainLight.environmentStrength)).code.add(m`
|
|
60
62
|
vec3 horizonRingDir = inputs.RdotUP * upDirection - inputs.reflectedView;
|
|
61
63
|
vec3 horizonRingH = normalize(horizonRingDir - viewDirection);
|
|
62
64
|
inputs.NdotH_Horizon = dot(normal, horizonRingH);
|
package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{VertexTextureCoordinates as e}from"../attributes/VertexTextureCoordinates.glsl.js";import{pbrGlobals as o}from"./pbrGlobals.glsl.js";import{Float3DrawUniform as s}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as r}from"../../shaderModules/Float3PassUniform.js";import{glsl as t,If as c}from"../../shaderModules/glsl.js";import{Texture2DDrawUniform as a}from"../../shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as l}from"../../shaderModules/Texture2DPassUniform.js";import{
|
|
2
|
+
import{VertexTextureCoordinates as e}from"../attributes/VertexTextureCoordinates.glsl.js";import{pbrGlobals as o}from"./pbrGlobals.glsl.js";import{Float3DrawUniform as s}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as r}from"../../shaderModules/Float3PassUniform.js";import{glsl as t,If as c}from"../../shaderModules/glsl.js";import{Texture2DDrawUniform as a}from"../../shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as l}from"../../shaderModules/Texture2DPassUniform.js";import{ShaderTechniqueConfiguration as u}from"../../shaderTechnique/ShaderTechniqueConfiguration.js";import{schematicMRRFactors as i}from"../../../materials/pbrUtils.js";import{NoParameters as n}from"../../../../../webgl/NoParameters.js";class d extends u{constructor(){super(...arguments),this.pbrMode=0}}class m extends n{constructor(e,o){super(),this.textureOcclusion=e,this.textureMetallicRoughness=o,this.mrrFactors=i}}function p(u,i){const n=i.pbrMode,d=u.fragment;switch(n){case 5:case 3:case 4:case 6:return void d.code.add(t`void applyPBRFactors() {}`);case 0:case 7:return void d.code.add(t`void applyPBRFactors() {}
|
|
3
3
|
float getBakedOcclusion() { return 1.0; }`);case 2:return void d.code.add(t`float occlusion = 1.0;
|
|
4
4
|
void applyPBRFactors() {}
|
|
5
5
|
float getBakedOcclusion() { return 1.0; }`);case 1:{const{hasMetallicRoughnessTexture:n,hasMetallicRoughnessTextureTransform:m,hasOcclusionTexture:p,hasOcclusionTextureTransform:h,bindType:f}=i;(n||p)&&u.include(e,i),d.code.add("float occlusion;"),n&&d.uniforms.add(1===f?new l("texMetallicRoughness",e=>e.textureMetallicRoughness):new a("texMetallicRoughness",e=>e.textureMetallicRoughness)),p&&d.uniforms.add(1===f?new l("texOcclusion",e=>e.textureOcclusion):new a("texOcclusion",e=>e.textureOcclusion)),d.uniforms.add(1===f?new r("mrrFactors",e=>e.mrrFactors):new s("mrrFactors",e=>e.mrrFactors)),d.include(o),n&&d.code.add(t`void applyMetallicRoughness(vec2 uv) {
|
|
@@ -17,4 +17,4 @@ mrr[1] *= metallicRoughness.g;
|
|
|
17
17
|
|
|
18
18
|
${c(n,`applyMetallicRoughness(${m?"metallicRoughnessUV":"vuv0"});`)}
|
|
19
19
|
${c(p,`applyOcclusion(${h?"occlusionUV":"vuv0"});`)}
|
|
20
|
-
}`)}}}export{
|
|
20
|
+
}`)}}}export{d as PBRDefaultConfiguration,m as PBRRenderingParameters,p as PhysicallyBasedRenderingParameters};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{FoamColor as e}from"./FoamRendering.glsl.js";import{Gamma as o}from"./Gamma.glsl.js";import{PhysicallyBasedRenderingWater as t}from"./PhysicallyBasedRendering.glsl.js";import{distanceFadeStart as r,distanceFadeEnd as i}from"./ScreenSpaceConstants.js";import{ScreenSpaceRayMarching as n}from"./ScreenSpaceRayMarching.glsl.js";import{viewMatrix as a}from"../util/cameraUniforms.js";import{CloudsParallaxShading as l}from"../util/CloudsParallaxShading.glsl.js";import{FloatBindUniform as d}from"../../shaderModules/FloatBindUniform.js";import{glsl as c}from"../../shaderModules/glsl.js";import{Texture2DBindUniform as s}from"../../shaderModules/Texture2DBindUniform.js";import{ToneMapping as f}from"../../../shaders/ToneMapping.glsl.js";function m(m,v){const u=m.fragment;u.include(t,v),u.include(o),u.include(e),v.cloudReflections&&m.include(l),v.screenSpaceReflections&&m.include(n,v),u.include(f,v),u.constants.add("fresnelSky","vec3",[.02,1,15]),u.constants.add("fresnelMaterial","vec2",[.02,.1]),u.constants.add("roughness","float",.015),u.constants.add("foamIntensityExternal","float",1.7),u.constants.add("ssrIntensity","float",.65),u.constants.add("ssrHeightFadeStart","float",r),u.constants.add("ssrHeightFadeEnd","float",i),u.constants.add("waterDiffusion","float",.92),u.constants.add("waterSeaColorMod","float",.8),u.constants.add("correctionViewingPowerFactor","float",.4),u.constants.add("skyZenitColor","vec3",[.52,.68,.9]),u.constants.add("skyColor","vec3",[.67,.79,.9]),u.constants.add("cloudFresnelModifier","vec2",[1.2,.01]),u.code.add(c`PBRShadingWater shadingInfo;
|
|
2
|
+
import{FoamColor as e}from"./FoamRendering.glsl.js";import{Gamma as o}from"./Gamma.glsl.js";import{PhysicallyBasedRenderingWater as t}from"./PhysicallyBasedRendering.glsl.js";import{distanceFadeStart as r,distanceFadeEnd as i}from"./ScreenSpaceConstants.js";import{ScreenSpaceRayMarching as n}from"./ScreenSpaceRayMarching.glsl.js";import{viewMatrix as a}from"../util/cameraUniforms.js";import{CloudsParallaxShading as l}from"../util/CloudsParallaxShading.glsl.js";import{FloatBindUniform as d}from"../../shaderModules/FloatBindUniform.js";import{glsl as c}from"../../shaderModules/glsl.js";import{Texture2DBindUniform as s}from"../../shaderModules/Texture2DBindUniform.js";import{ToneMapping as f}from"../../../shaders/ToneMapping.glsl.js";function m(m,v){const u=m.fragment;u.include(t,v),u.include(o),u.include(e),v.cloudReflections&&m.include(l,v),v.screenSpaceReflections&&m.include(n,v),u.include(f,v),u.constants.add("fresnelSky","vec3",[.02,1,15]),u.constants.add("fresnelMaterial","vec2",[.02,.1]),u.constants.add("roughness","float",.015),u.constants.add("foamIntensityExternal","float",1.7),u.constants.add("ssrIntensity","float",.65),u.constants.add("ssrHeightFadeStart","float",r),u.constants.add("ssrHeightFadeEnd","float",i),u.constants.add("waterDiffusion","float",.92),u.constants.add("waterSeaColorMod","float",.8),u.constants.add("correctionViewingPowerFactor","float",.4),u.constants.add("skyZenitColor","vec3",[.52,.68,.9]),u.constants.add("skyColor","vec3",[.67,.79,.9]),u.constants.add("cloudFresnelModifier","vec2",[1.2,.01]),u.code.add(c`PBRShadingWater shadingInfo;
|
|
3
3
|
vec3 getSkyGradientColor(in float cosTheta, in vec3 horizon, in vec3 zenit) {
|
|
4
4
|
float exponent = pow((1.0 - cosTheta), fresnelSky[2]);
|
|
5
5
|
return mix(zenit, horizon, exponent);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{fromValues as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{earth as t}from"../../../../../../geometry/support/Ellipsoid.js";import{cloudsHeight as a}from"../../../../environment/weather.js";import{EvaluateAmbientLighting as r}from"../shading/EvaluateAmbientLighting.glsl.js";import{mainLightDirection as e,mainLightIntensity as i}from"../shading/MainLighting.glsl.js";import{LookupCloudsFromTextureArray as c}from"./LookupCloudsFromTextureArray.glsl.js";import{BooleanBindUniform as n}from"../../shaderModules/BooleanBindUniform.js";import{Float3BindUniform as d}from"../../shaderModules/Float3BindUniform.js";import{FloatBindUniform as l}from"../../shaderModules/FloatBindUniform.js";import{glsl as s}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as u}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DArrayBindUniform as m}from"../../shaderModules/Texture2DArrayBindUniform.js";function h(t){const
|
|
2
|
+
import{fromValues as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{earth as t}from"../../../../../../geometry/support/Ellipsoid.js";import{cloudsHeight as a}from"../../../../environment/weather.js";import{EvaluateAmbientLighting as r}from"../shading/EvaluateAmbientLighting.glsl.js";import{mainLightDirection as e,mainLightIntensity as i}from"../shading/MainLighting.glsl.js";import{LookupCloudsFromTextureArray as c}from"./LookupCloudsFromTextureArray.glsl.js";import{BooleanBindUniform as n}from"../../shaderModules/BooleanBindUniform.js";import{Float3BindUniform as d}from"../../shaderModules/Float3BindUniform.js";import{FloatBindUniform as l}from"../../shaderModules/FloatBindUniform.js";import{glsl as s}from"../../shaderModules/glsl.js";import{Matrix4BindUniform as u}from"../../shaderModules/Matrix4BindUniform.js";import{Texture2DArrayBindUniform as m}from"../../shaderModules/Texture2DArrayBindUniform.js";function h(t,a){const h=t.fragment;h.constants.add("radiusCloudsSquared","float",C).code.add(s`vec3 intersectWithCloudLayer(vec3 dir, vec3 cameraPosition, vec3 spherePos) {
|
|
3
3
|
float B = 2.0 * dot(cameraPosition, dir);
|
|
4
4
|
float C = dot(cameraPosition, cameraPosition) - radiusCloudsSquared;
|
|
5
5
|
float det = B * B - 4.0 * C;
|
|
6
6
|
float pointIntDist = max(0.0, 0.5 *(-B + sqrt(det)));
|
|
7
7
|
return (cameraPosition + dir * pointIntDist) - spherePos;
|
|
8
|
-
}`),
|
|
8
|
+
}`),h.uniforms.add(new l("radiusCurvatureCorrection",({clouds:o})=>o.parallax.radiusCurvatureCorrection)).code.add(s`vec3 correctForPlanetCurvature(vec3 dir) {
|
|
9
9
|
dir.z = dir.z * (1.0 - radiusCurvatureCorrection) + radiusCurvatureCorrection;
|
|
10
10
|
return dir;
|
|
11
|
-
}`),
|
|
11
|
+
}`),h.code.add(s`vec3 rotateDirectionToAnchorPoint(mat4 rotMat, vec3 inVec) {
|
|
12
12
|
return (rotMat * vec4(inVec, 0.0)).xyz;
|
|
13
|
-
}`),
|
|
13
|
+
}`),h.include(r,a),h.constants.add("RIM_COLOR","vec3",o(.28,.175,.035)),h.constants.add("sunsetTransitionFactor","float",.3),h.constants.add("rimScattering","float",140),h.constants.add("backlightFactor","float",.2),h.constants.add("backlightScattering","float",10),h.constants.add("backlightTransition","float",.3),h.uniforms.add(e,i).code.add(s`vec3 calculateCloudColor(vec3 cameraPosition, vec3 worldSpaceRay, vec4 clouds) {
|
|
14
14
|
float upDotLight = dot(cameraPosition, mainLightDirection);
|
|
15
15
|
float dirDotLight = max(dot(worldSpaceRay, mainLightDirection), 0.0);
|
|
16
16
|
float sunsetTransition = clamp(pow(max(upDotLight, 0.0), sunsetTransitionFactor), 0.0, 1.0);
|
|
@@ -22,12 +22,12 @@ float rimLightIntensity = 0.5 + 0.5 * pow(max(upDotLight, 0.0), 0.35);
|
|
|
22
22
|
vec3 directSunScattering = RIM_COLOR * rimLightIntensity * (pow(dirDotLight, rimScattering)) * scatteringMod;
|
|
23
23
|
float additionalLight = backlightFactor * pow(dirDotLight, backlightScattering) * (1. - pow(sunsetTransition, backlightTransition)) ;
|
|
24
24
|
return vec3(baseCloudColor * (1.0 + additionalLight) + directSunScattering);
|
|
25
|
-
}`),t.include(c),
|
|
25
|
+
}`),t.include(c),h.uniforms.add(new n("readChannelsRG",o=>0===o.clouds.readChannels),new m("cubeMap",o=>o.clouds.data?.cubeMap?.colorTexture)).code.add(s`vec4 sampleCloud(vec3 rayDir, bool readOtherChannel) {
|
|
26
26
|
vec4 s = lookupCloudsFromTextureArray(cubeMap, rayDir);
|
|
27
27
|
bool readRG = readChannelsRG ^^ readOtherChannel;
|
|
28
28
|
s = readRG ? vec4(vec3(s.r), s.g) : vec4(vec3(s.b), s.a);
|
|
29
29
|
return length(s) == 0.0 ? vec4(s.rgb, 1.0) : s;
|
|
30
|
-
}`),
|
|
30
|
+
}`),h.uniforms.add(new d("anchorPoint",o=>o.clouds.parallax.anchorPoint),new d("anchorPointNew",o=>o.clouds.parallaxNew.anchorPoint),new u("rotationClouds",o=>o.clouds.parallax.transform),new u("rotationCloudsNew",o=>o.clouds.parallaxNew.transform),new l("cloudsOpacity",o=>o.clouds.opacity),new l("fadeFactor",o=>o.clouds.fadeFactor),new n("crossFade",o=>3===o.clouds.fadeState)).code.add(s`vec4 renderClouds(vec3 worldRay, vec3 cameraPosition) {
|
|
31
31
|
vec3 intersectionPoint = intersectWithCloudLayer(worldRay, cameraPosition, anchorPoint);
|
|
32
32
|
vec3 worldRayRotated = rotateDirectionToAnchorPoint(rotationClouds, normalize(intersectionPoint));
|
|
33
33
|
vec3 worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as i,initial as
|
|
2
|
+
import{__decorate as e}from"tslib";import{disposeMaybe as t}from"../../../../../core/maybe.js";import{watch as i,initial as r}from"../../../../../core/reactiveUtils.js";import{subclass as s}from"../../../../../core/accessorSupport/decorators.js";import{PBRDefaultConfiguration as o}from"../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OpaqueEnvironment as n}from"../OpaqueEnvironment.js";import{CloudsCompositionTechnique as a}from"./CloudsCompositionTechnique.js";import{createQuadVAO as m}from"../../lib/glUtil3D.js";import{ColorAttachment0 as d,PrimitiveType as h}from"../../../../webgl/enums.js";import{noParameters as l}from"../../../../webgl/NoParameters.js";let c=class extends n{constructor(){super(...arguments),this._configuration=new o}initialize(){this.addHandles([i(()=>null!=this.view.environment.weather&&this.view.environment.atmosphereEnabled,e=>e?this._enable():this._disable(),r)])}destroy(){this._vao=t(this._vao)}render(){const e=this.input,t=this.bindParameters.clouds;if(!t.data)return e;const i=this.techniques.getCompiled(a,this._configuration);if(!i)return this.requestRender(1),e;const r=this.renderingContext;this._vao??=m(r);const s=r.bindTechnique(i,this.bindParameters,l);return r.setDrawBuffers([d]),r.bindVAO(this._vao),s.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(h.TRIANGLE_STRIP,0,4),t.isFading&&this.requestRender(2),e}};c=e([s("esri.views.3d.webgl-engine.effects.clouds.CloudsComposition")],c);export{c as CloudsComposition};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import"../../core/shaderLibrary/util/CameraSpace.glsl.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./GlobalIlluminationColorQuantization.glsl.js";import"../../shaders/floatBlendScale.glsl.js";import"../../../../webgl/enums.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlobalIlluminationPassParameters,c as build,e as defaultColorBleedWeight,d as defaultRayMarchMaxReach,f as defaultRayMarchMaxReachEmissionWeight,b as defaultRayMarchMaxSteps,g as defaultRayMarchMinReach,h as defaultRayMarchMinReachEmissionWeight,i as defaultRayMarchWorldReach}from"../../../../../chunks/GlobalIllumination.glsl.js";
|
|
2
|
+
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import"../../core/shaderLibrary/shading/Gamma.glsl.js";import"../../core/shaderLibrary/shading/MainLighting.glsl.js";import"../../core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import"../../core/shaderLibrary/util/CameraSpace.glsl.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./GlobalIlluminationColorQuantization.glsl.js";import"../../shaders/floatBlendScale.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/enums.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlobalIlluminationPassParameters,c as build,e as defaultColorBleedWeight,d as defaultRayMarchMaxReach,f as defaultRayMarchMaxReachEmissionWeight,b as defaultRayMarchMaxSteps,g as defaultRayMarchMinReach,h as defaultRayMarchMinReachEmissionWeight,i as defaultRayMarchWorldReach}from"../../../../../chunks/GlobalIllumination.glsl.js";
|