@arcgis/core 5.1.0-next.71 → 5.1.0-next.73
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/PopupTemplate.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/003fd7745966fe03510c.js +1 -0
- package/assets/esri/core/workers/chunks/00bae4b7e179336e0362.js +1 -0
- package/assets/esri/core/workers/chunks/{36031cb53c486630f3c9.js → 026d3fa331caec1ea3d2.js} +1 -1
- package/assets/esri/core/workers/chunks/027c3ea756db68e51f0a.js +1 -0
- package/assets/esri/core/workers/chunks/041c372e98a6fba90b36.js +1 -0
- package/assets/esri/core/workers/chunks/{a5a46d0a0831497cf1b4.js → 0783890816bac45277b9.js} +1 -1
- package/assets/esri/core/workers/chunks/07aac6245a0d1adbb2d4.js +1 -0
- package/assets/esri/core/workers/chunks/0839da55707f7c4cf780.js +1 -0
- package/assets/esri/core/workers/chunks/0ae360bf253adee46737.js +1 -0
- package/assets/esri/core/workers/chunks/0c00e5e4bd18467bcecd.js +1 -0
- package/assets/esri/core/workers/chunks/0dad0bca8d58b2c63d22.js +1 -0
- package/assets/esri/core/workers/chunks/0ef93722524620023f69.js +1 -0
- package/assets/esri/core/workers/chunks/127cd8fee3717a473fc5.js +1 -0
- package/assets/esri/core/workers/chunks/1286f41f245ef22b3a26.js +1 -0
- package/assets/esri/core/workers/chunks/12e575a6d2b008b8fc2b.js +1 -0
- package/assets/esri/core/workers/chunks/{c92352b0e39576ca317a.js → 13e60f19f436b8d683ae.js} +1 -1
- package/assets/esri/core/workers/chunks/161d60fdac2013c15543.js +1 -0
- package/assets/esri/core/workers/chunks/1661684357912726a72a.js +1 -0
- package/assets/esri/core/workers/chunks/168de44a789d1cecc1f8.js +1 -0
- package/assets/esri/core/workers/chunks/1961b59756933e0a82f2.js +1 -0
- package/assets/esri/core/workers/chunks/1d9d7915cf7449e5d468.js +1 -0
- package/assets/esri/core/workers/chunks/1f85646936200a399c15.js +1 -0
- package/assets/esri/core/workers/chunks/{deb8a0b306d7b9c86b97.js → 2171aaa147aa4d9fc5b5.js} +1 -1
- package/assets/esri/core/workers/chunks/235cb82952a18ff8d206.js +1 -0
- package/assets/esri/core/workers/chunks/260d4571722cb1ff1366.js +1 -0
- package/assets/esri/core/workers/chunks/{3e972ae291df1844017d.js → 266ba61b72a278d93a26.js} +1 -1
- package/assets/esri/core/workers/chunks/27b80c386cebadcaca3c.js +1 -0
- package/assets/esri/core/workers/chunks/29d3890a5a43d934067a.js +1 -0
- package/assets/esri/core/workers/chunks/{7e6ccf9f3e756186e93e.js → 29e76256e3e867e80520.js} +1 -1
- package/assets/esri/core/workers/chunks/{333a0038d782d8a34d58.js → 2abf124e2956e4f76688.js} +1 -1
- package/assets/esri/core/workers/chunks/2f17438d215bea3ce70f.js +1 -0
- package/assets/esri/core/workers/chunks/{f6d5dd2eef0d9918096e.js → 30e710ec4d22c43d4e7e.js} +1 -1
- package/assets/esri/core/workers/chunks/30f04dc001eaf838d64c.js +1 -0
- package/assets/esri/core/workers/chunks/356cb86606b8c674f947.js +1 -0
- package/assets/esri/core/workers/chunks/398e0dd2bc7e1ab84831.js +1 -0
- package/assets/esri/core/workers/chunks/3b1052aa30af3f6186cc.js +1 -0
- package/assets/esri/core/workers/chunks/3bbf684ee2484eb44c9f.js +1 -0
- package/assets/esri/core/workers/chunks/3e87e3ad857d72f6ecbb.js +1 -0
- package/assets/esri/core/workers/chunks/{7cb6d8f7eaf762279632.js → 3ea5a18b264628dc37f0.js} +1 -1
- package/assets/esri/core/workers/chunks/41809c16544ec25120fa.js +1 -0
- package/assets/esri/core/workers/chunks/41913575dd45c65d645e.js +1 -0
- package/assets/esri/core/workers/chunks/{628f56c09838eb9c573b.js → 422824e407b550170c8c.js} +1 -1
- package/assets/esri/core/workers/chunks/42e483fde18f12da32a6.js +1 -0
- package/assets/esri/core/workers/chunks/43ab44d37bc0ea97ef98.js +1 -0
- package/assets/esri/core/workers/chunks/46e622857ba92a72a317.js +1 -0
- package/assets/esri/core/workers/chunks/47f2113357b2aa4f4f37.js +1 -0
- package/assets/esri/core/workers/chunks/488ed9584b527ec47be3.js +1 -0
- package/assets/esri/core/workers/chunks/4ad32580e0c0699fde1f.js +1 -0
- package/assets/esri/core/workers/chunks/4d0f793dee4ad919221b.js +1 -0
- package/assets/esri/core/workers/chunks/4eed175277eb0df3c821.js +1 -0
- package/assets/esri/core/workers/chunks/{916a8f3eed1fafdc7242.js → 54d07eadf113f0e4e506.js} +1 -1
- package/assets/esri/core/workers/chunks/54ed37ec9682ea739deb.js +1 -0
- package/assets/esri/core/workers/chunks/{9187d1caca1fd2d713e0.js → 55369c5bd65bcaf78da1.js} +1 -1
- package/assets/esri/core/workers/chunks/56fd3da911c2c4511e5d.js +1 -0
- package/assets/esri/core/workers/chunks/59592bb25f226865e88a.js +1 -0
- package/assets/esri/core/workers/chunks/{e77d958cb62536b8eebc.js → 5a4d7ba6dc1d4b41d80d.js} +1 -1
- package/assets/esri/core/workers/chunks/5c663d5f98bdfa29151b.js +1 -0
- package/assets/esri/core/workers/chunks/5d55b4449bcb24cd72b6.js +1 -0
- package/assets/esri/core/workers/chunks/5d8fe41a3c06ddb4094b.js +1 -0
- package/assets/esri/core/workers/chunks/{fe68c28d3c61f116ff23.js → 5ef37f37e405b3bb5450.js} +1 -1
- package/assets/esri/core/workers/chunks/608d707fd9d9f9088473.js +1 -0
- package/assets/esri/core/workers/chunks/{ae0a572cbbdd9815ee2e.js → 62b3e933f548ce354b99.js} +1 -1
- package/assets/esri/core/workers/chunks/656d6963e8f837fbf28f.js +1 -0
- package/assets/esri/core/workers/chunks/{a5afcd633b32e6ee31a7.js → 6a0352d20596ca3f4b64.js} +1 -1
- package/assets/esri/core/workers/chunks/6c7ff968bd4fc816442d.js +1 -0
- package/assets/esri/core/workers/chunks/6e526c06825ecc6c99c0.js +1 -0
- package/assets/esri/core/workers/chunks/6ea8b0d68881d16a2432.js +1 -0
- package/assets/esri/core/workers/chunks/7027d93dc5a4595d70c6.js +1 -0
- package/assets/esri/core/workers/chunks/70b35b2446558d5280e3.js +1 -0
- package/assets/esri/core/workers/chunks/7349cb45a93e6916f115.js +1 -0
- package/assets/esri/core/workers/chunks/751609831b283903ba48.js +1 -0
- package/assets/esri/core/workers/chunks/76edaeaf8fe344bb77a8.js +1 -0
- package/assets/esri/core/workers/chunks/76fe5b821d6b54db5721.js +1 -0
- package/assets/esri/core/workers/chunks/7951d93f5f15aa76f49c.js +1 -0
- package/assets/esri/core/workers/chunks/80ace1c7203c5059525d.js +1 -0
- package/assets/esri/core/workers/chunks/81d30c9062ad0120a863.js +1 -0
- package/assets/esri/core/workers/chunks/84772b023d04e415f17f.js +1 -0
- package/assets/esri/core/workers/chunks/{123e920e4460124ec3bb.js → 88b480a1d1fb01778798.js} +9 -30
- package/assets/esri/core/workers/chunks/88c5f7c712c6b89b5109.js +1 -0
- package/assets/esri/core/workers/chunks/88e469b82d2594f23649.js +1 -0
- package/assets/esri/core/workers/chunks/8a14e3db28c403b046cf.js +1 -0
- package/assets/esri/core/workers/chunks/8a664451845a47048859.js +1 -0
- package/assets/esri/core/workers/chunks/8a8242e7cc7e6a9e7876.js +1 -0
- package/assets/esri/core/workers/chunks/{4d51261d6131c07402cd.js → 8acee3fba488f202f82f.js} +1 -1
- package/assets/esri/core/workers/chunks/{31071a43e2c03984d619.js → 8d75f6f27c1c17c33992.js} +1 -1
- package/assets/esri/core/workers/chunks/9444ed8ea117861ae89b.js +1 -0
- package/assets/esri/core/workers/chunks/95d82c619dcbec2e1050.js +1 -0
- package/assets/esri/core/workers/chunks/96bba4d93a32ad34a1c8.js +1 -0
- package/assets/esri/core/workers/chunks/9a38fd68b02b617c45d3.js +1 -0
- package/assets/esri/core/workers/chunks/9d434360dfce1e49b7b9.js +1 -0
- package/assets/esri/core/workers/chunks/9eb4ae556950e1d0124d.js +2 -0
- package/assets/esri/core/workers/chunks/9f4b97204def91567e3c.js +1 -0
- package/assets/esri/core/workers/chunks/a37c28e3c4a2be9fd1d5.js +1 -0
- package/assets/esri/core/workers/chunks/{c06d021180418f2014de.js → a78bc340a794fd332667.js} +1 -1
- package/assets/esri/core/workers/chunks/{1edd39c7c4acdc591d10.js → a809b811121099a87a98.js} +1 -1
- package/assets/esri/core/workers/chunks/a8d7f59927bdad564141.js +1 -0
- package/assets/esri/core/workers/chunks/{f89976ec97938bf86996.js → abc06d10c7ac8ba5b0e4.js} +1 -1
- package/assets/esri/core/workers/chunks/abdf146b35e179b5b245.js +1 -0
- package/assets/esri/core/workers/chunks/abe22ae8ee0dcc9efbb7.js +1 -0
- package/assets/esri/core/workers/chunks/{fef5dc19736f12dfa99a.js → af5db0372d526e592fcc.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b7cda16e656db450f11.js → afc0baf86ece710ef867.js} +1 -1
- package/assets/esri/core/workers/chunks/{6ac5ec3ecbca8860338b.js → b54b7cc6b23a70fed700.js} +1 -1
- package/assets/esri/core/workers/chunks/b6cadb8a579241adcb86.js +1 -0
- package/assets/esri/core/workers/chunks/b702279c48f3009f6dd8.js +1 -0
- package/assets/esri/core/workers/chunks/b9848bdbaf3d9ac93d54.js +1 -0
- package/assets/esri/core/workers/chunks/be1d6a571f76933dfbb0.js +1 -0
- package/assets/esri/core/workers/chunks/{eb3cdc4ff45243fc3cc5.js → bef27a25fbc4a6e19ec0.js} +1 -1
- package/assets/esri/core/workers/chunks/bfcdc5c315131aae34d8.js +1 -0
- package/assets/esri/core/workers/chunks/c0f624a2ca0d07ef8f8c.js +1 -0
- package/assets/esri/core/workers/chunks/c3381b9a36299210ee47.js +1 -0
- package/assets/esri/core/workers/chunks/{c2882a9e67124b7c18be.js → c503c79ba5761f7abbeb.js} +1 -1
- package/assets/esri/core/workers/chunks/{a65d576e90179a2b5400.js → c5507480344176fad241.js} +1 -1
- package/assets/esri/core/workers/chunks/c70df6ed190f9ebcf6aa.js +1 -0
- package/assets/esri/core/workers/chunks/cb5e4b9b4a59c2622eb5.js +1 -0
- package/assets/esri/core/workers/chunks/cd7159600ce132e32d04.js +1 -0
- package/assets/esri/core/workers/chunks/cfe246adb5e6cb6f0cfc.js +1 -0
- package/assets/esri/core/workers/chunks/d17fcfc502f0e0fa6523.js +596 -0
- package/assets/esri/core/workers/chunks/d201a5dff18a5bb467ab.js +1 -0
- package/assets/esri/core/workers/chunks/d65b1234867f7d773d50.js +2 -0
- package/assets/esri/core/workers/chunks/{4d8670f6fa8952b7bab6.js → d950d5c2844206502ff0.js} +1 -1
- package/assets/esri/core/workers/chunks/db3c484bfa607dec6050.js +1 -0
- package/assets/esri/core/workers/chunks/db588bf3256e95c977b7.js +1 -0
- package/assets/esri/core/workers/chunks/{967758a05170545cd371.js → dcc719e15b2e0cce1f3b.js} +1 -1
- package/assets/esri/core/workers/chunks/{6bb090f3e5c18604cb39.js → dd5b362bded458afa2d6.js} +1 -1
- package/assets/esri/core/workers/chunks/dfdd474fddcd1d6091ce.js +1 -0
- package/assets/esri/core/workers/chunks/{aa1a3a849aba84cf585b.js → e1bc9ad767e08dc18bbc.js} +1 -1
- package/assets/esri/core/workers/chunks/e235ea4293d5d463acfb.js +1 -0
- package/assets/esri/core/workers/chunks/e25a684eb9f025bdcc01.js +1 -0
- package/assets/esri/core/workers/chunks/e272411e2c9378aa8496.js +1312 -0
- package/assets/esri/core/workers/chunks/e43486113aaf72ac4dc1.js +1 -0
- package/assets/esri/core/workers/chunks/ea4c3393c5757e309a71.js +1 -0
- package/assets/esri/core/workers/chunks/ed216ddeb7f59f510bd0.js +1 -0
- package/assets/esri/core/workers/chunks/ef8886dff54063928bcb.js +1 -0
- package/assets/esri/core/workers/chunks/{231f502cd15f30d12be2.js → f1673e723b336204ad77.js} +1 -1
- package/assets/esri/core/workers/chunks/{d69110ec4078c583a05e.js → f207b3be0714cc50030a.js} +1 -1
- package/assets/esri/core/workers/chunks/f5223ffb3be548c9b0a1.js +1 -0
- package/assets/esri/core/workers/chunks/f53805c7a84203305b2c.js +1 -0
- package/assets/esri/core/workers/chunks/f5c57ff48ca505ed701d.js +1 -0
- package/assets/esri/core/workers/chunks/fae147d03ed723ab234d.js +1 -0
- package/chunks/CheckerBoard.glsl.js +3 -5
- package/chunks/ColorMaterial.glsl.js +4 -6
- package/chunks/ComponentShader.glsl.js +42 -44
- package/chunks/DefaultMaterial.glsl.js +21 -23
- package/chunks/EdgeShader.glsl.js +9 -11
- package/chunks/GaussianSplat.glsl.js +8 -8
- package/chunks/GlobalIllumination.glsl.js +186 -116
- package/chunks/GlobalIlluminationBlur.glsl.js +81 -61
- package/chunks/GlobalIlluminationUpscale.glsl.js +66 -0
- package/chunks/ImageMaterial.glsl.js +5 -7
- package/chunks/LineCallout.glsl.js +9 -12
- package/chunks/LineMarker.glsl.js +24 -26
- package/chunks/Path.glsl.js +15 -17
- package/chunks/Pattern.glsl.js +25 -27
- package/chunks/RealisticTree.glsl.js +11 -13
- package/chunks/RibbonLine.glsl.js +42 -45
- package/chunks/ShadedColorMaterial.glsl.js +8 -9
- package/chunks/Water.glsl.js +18 -20
- package/config.js +1 -1
- package/form/elements/FieldElement.d.ts +3 -2
- package/form/elements/inputs/Input.d.ts +1 -1
- package/form/elements/inputs/MultipleChoiceInput.d.ts +65 -0
- package/form/elements/inputs/MultipleChoiceInput.js +2 -0
- package/form/elements/inputs/inputUtils.js +1 -1
- package/form/elements/inputs/multipleChoice/Choice.d.ts +30 -0
- package/form/elements/inputs/multipleChoice/Choice.js +2 -0
- package/form/elements/inputs/multipleChoice/OtherChoice.d.ts +28 -0
- package/form/elements/inputs/multipleChoice/OtherChoice.js +2 -0
- package/form/elements/inputs.d.ts +11 -2
- package/form/elements/inputs.js +1 -1
- package/form/support/formUtils.js +1 -1
- package/interfaces.d.ts +28 -0
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/graphics/FlatFeature.js +1 -1
- package/layers/graphics/FlatFeatureSet.js +1 -1
- package/layers/graphics/OptimizedFeature.js +1 -1
- package/layers/graphics/data/AttributesBuilder.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/flatFeatureQueryEngineAdapter.js +1 -1
- package/layers/graphics/data/optimizedFeatureQueryEngineAdapter.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/support/LabelClass.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/labelUtils.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/package.json +2 -2
- package/popupTemplateUtils.js +2 -0
- package/renderers/visualVariables/SizeVariable.js +1 -1
- package/renderers/visualVariables/support/sizeVariableUtils.js +1 -1
- package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
- package/rest/support/OutDistance.js +2 -0
- package/rest/support/Query.js +1 -1
- package/smartMapping/statistics/support/utils.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/third-party-notices.txt +7 -29
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshNormals.js +1 -1
- package/views/3d/layers/StreamLayerView3D.js +1 -1
- package/views/3d/layers/graphics/featureExpressionInfoUtils.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialGlobalParameters.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +20 -32
- package/views/3d/webgl-engine/core/shaderLibrary/shading/GlobalIlluminationWeights.glsl.js +21 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadGlobalIllumination.glsl.js +11 -7
- package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +5 -3
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationUpscale.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationUpscaleTechnique.js +2 -0
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/Compositor.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/interactive/sketch/SketchOptions.d.ts +3 -1
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +6 -0
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/video/VideoOperationalDataView.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/SingleFeatureInputAdapter.js +2 -0
- package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +28 -4
- package/widgets/BatchAttributeForm/inputs/TextElementInput.js +1 -1
- package/widgets/BatchAttributeForm/templates/AttachmentElementTemplate.js +2 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +19 -3
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/VisibleElements.d.ts +15 -1
- package/widgets/FeatureTable/VisibleElements.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.d.ts +15 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search/support/layerSearchUtils.js +1 -1
- package/widgets/support/widgetUtils.js +1 -1
- package/assets/esri/core/workers/chunks/09ecb36e44096e577af8.js +0 -1
- package/assets/esri/core/workers/chunks/0ca06ea649bbdb93ff49.js +0 -1
- package/assets/esri/core/workers/chunks/10308c9f3f0d709d96bc.js +0 -1
- package/assets/esri/core/workers/chunks/141edf5ed890105a079b.js +0 -1
- package/assets/esri/core/workers/chunks/160b9a76b75875507c86.js +0 -1
- package/assets/esri/core/workers/chunks/16dfdee05704df249e95.js +0 -1
- package/assets/esri/core/workers/chunks/17ef955dc48e329aa184.js +0 -1
- package/assets/esri/core/workers/chunks/18001536ed345955121a.js +0 -1
- package/assets/esri/core/workers/chunks/20e715e3aeb1c3265901.js +0 -1
- package/assets/esri/core/workers/chunks/238f51d0b36f998017b8.js +0 -1
- package/assets/esri/core/workers/chunks/2cee6d751c5e73fe09d4.js +0 -1
- package/assets/esri/core/workers/chunks/314140e2e9b813191907.js +0 -1
- package/assets/esri/core/workers/chunks/3158a3487d3e8a61b680.js +0 -1
- package/assets/esri/core/workers/chunks/3b1446286a9b87f34761.js +0 -1
- package/assets/esri/core/workers/chunks/3f7fd58ee7d71989fc83.js +0 -1
- package/assets/esri/core/workers/chunks/41396724040180d2537f.js +0 -1
- package/assets/esri/core/workers/chunks/416e031bafc0189544fa.js +0 -1
- package/assets/esri/core/workers/chunks/55ee78923987ed17ea8c.js +0 -1
- package/assets/esri/core/workers/chunks/56c7d7c7217557375fb6.js +0 -1
- package/assets/esri/core/workers/chunks/58b3c888c8bfedbe6443.js +0 -1
- package/assets/esri/core/workers/chunks/5a1d975b3e9e6b7eff67.js +0 -1
- package/assets/esri/core/workers/chunks/5f6942ac94acd7842926.js +0 -1
- package/assets/esri/core/workers/chunks/6118706b9a038e9a06b8.js +0 -1
- package/assets/esri/core/workers/chunks/6d15229b3fa84a7acf4d.js +0 -599
- package/assets/esri/core/workers/chunks/7314c0131403cac84ad7.js +0 -1
- package/assets/esri/core/workers/chunks/73545bb13c70f6a347a4.js +0 -1
- package/assets/esri/core/workers/chunks/73a045061e69a22b6869.js +0 -1
- package/assets/esri/core/workers/chunks/75669912cddcb5db52c8.js +0 -1
- package/assets/esri/core/workers/chunks/7ca32806e47be15109a4.js +0 -1
- package/assets/esri/core/workers/chunks/7d6ed65bbcd279448191.js +0 -1
- package/assets/esri/core/workers/chunks/81f149e45c79b9b086fb.js +0 -1
- package/assets/esri/core/workers/chunks/84fa25f66a6949290221.js +0 -1
- package/assets/esri/core/workers/chunks/852aabbf671d2ca9cd33.js +0 -1
- package/assets/esri/core/workers/chunks/854fe80272b59fafc2e9.js +0 -1
- package/assets/esri/core/workers/chunks/85edbb072a2ce6c1bb30.js +0 -2
- package/assets/esri/core/workers/chunks/861817be5e050e9522ab.js +0 -1
- package/assets/esri/core/workers/chunks/89345a682dea60ef1643.js +0 -1
- package/assets/esri/core/workers/chunks/8985402c328b90af5724.js +0 -1
- package/assets/esri/core/workers/chunks/89fdf9ad10ca8fbb08a5.js +0 -1
- package/assets/esri/core/workers/chunks/8b094330323d9b16fb5d.js +0 -1
- package/assets/esri/core/workers/chunks/90aed8c4b266832f84ca.js +0 -1
- package/assets/esri/core/workers/chunks/943cf0653a2b7de16a4f.js +0 -1
- package/assets/esri/core/workers/chunks/9776c2db337222ceceef.js +0 -1
- package/assets/esri/core/workers/chunks/990853e9df38fdfc58b5.js +0 -1
- package/assets/esri/core/workers/chunks/9a21ba0c45a96b94c05e.js +0 -1
- package/assets/esri/core/workers/chunks/9a235c92f21df2c17aa8.js +0 -1
- package/assets/esri/core/workers/chunks/9b56162ac67c992193ce.js +0 -1
- package/assets/esri/core/workers/chunks/9f1f5fb648302c43ad12.js +0 -1
- package/assets/esri/core/workers/chunks/a1e6187c239fdc7553ed.js +0 -1
- package/assets/esri/core/workers/chunks/a4b6fdbc995be03d2afb.js +0 -1
- package/assets/esri/core/workers/chunks/a760be8fa6c6ea6b745c.js +0 -1
- package/assets/esri/core/workers/chunks/a8782286ce3c0d6c20e6.js +0 -1
- package/assets/esri/core/workers/chunks/a96692514dcaa50340dd.js +0 -1
- package/assets/esri/core/workers/chunks/a994a3c912a33b2f4100.js +0 -1
- package/assets/esri/core/workers/chunks/aa7aaeae31ddb259e55e.js +0 -1
- package/assets/esri/core/workers/chunks/abcc5fb71be2bd94878c.js +0 -1
- package/assets/esri/core/workers/chunks/aecb05df4ad1454f5435.js +0 -1
- package/assets/esri/core/workers/chunks/aecb105db7cec2c9c4c5.js +0 -1
- package/assets/esri/core/workers/chunks/b19f33e026a2a43b17c4.js +0 -1
- package/assets/esri/core/workers/chunks/b3950d5f1f3352521504.js +0 -1
- package/assets/esri/core/workers/chunks/b3f0600729227b458a75.js +0 -1
- package/assets/esri/core/workers/chunks/b5922991d2f450e6a9d9.js +0 -1
- package/assets/esri/core/workers/chunks/b8643976a7f984552d94.js +0 -1
- package/assets/esri/core/workers/chunks/b8a11d32a4847513619b.js +0 -1
- package/assets/esri/core/workers/chunks/b8acb6c2538053c01cc6.js +0 -1
- package/assets/esri/core/workers/chunks/ba4259aa050169c1d523.js +0 -1
- package/assets/esri/core/workers/chunks/bbaf1d9835671c0165ca.js +0 -1
- package/assets/esri/core/workers/chunks/bcefdf9753d9d2f6f1be.js +0 -1
- package/assets/esri/core/workers/chunks/c178e2cfc34603661b1d.js +0 -1
- package/assets/esri/core/workers/chunks/c3e80c0e29ac6a7a6f80.js +0 -1
- package/assets/esri/core/workers/chunks/c79827f879d1d58d3f1b.js +0 -1
- package/assets/esri/core/workers/chunks/c92b40a532e708e506cc.js +0 -1
- package/assets/esri/core/workers/chunks/cb903ccbce87172a0757.js +0 -1
- package/assets/esri/core/workers/chunks/cda2e445eb2ac269abdf.js +0 -1
- package/assets/esri/core/workers/chunks/ce44e172e2847fd8df14.js +0 -1
- package/assets/esri/core/workers/chunks/cff7e921649aef715c78.js +0 -1
- package/assets/esri/core/workers/chunks/d0c3ab70f390cd579fed.js +0 -1
- package/assets/esri/core/workers/chunks/d315098b038a96084ff5.js +0 -1
- package/assets/esri/core/workers/chunks/d4a9eb4470cc6a1f67fc.js +0 -2
- package/assets/esri/core/workers/chunks/d8c0d18f0132872decd3.js +0 -1
- package/assets/esri/core/workers/chunks/db0061a6d5bf454cc509.js +0 -1
- package/assets/esri/core/workers/chunks/dca595fdd5e1a571e441.js +0 -1
- package/assets/esri/core/workers/chunks/dcfafcf4386f2940d000.js +0 -1
- package/assets/esri/core/workers/chunks/df8143b72ef94806c992.js +0 -1
- package/assets/esri/core/workers/chunks/e2b034c391c603f7f825.js +0 -1
- package/assets/esri/core/workers/chunks/e3a73d9acebccd3ba49b.js +0 -1
- package/assets/esri/core/workers/chunks/e67bdd8bf38ebe89a344.js +0 -1
- package/assets/esri/core/workers/chunks/e797d45eba0884dc7e6f.js +0 -1
- package/assets/esri/core/workers/chunks/e81a3da05fcff97b4752.js +0 -1
- package/assets/esri/core/workers/chunks/e957d52cb9643961a843.js +0 -1127
- package/assets/esri/core/workers/chunks/e9dd60d0220036545ebb.js +0 -1
- package/assets/esri/core/workers/chunks/ea6d3b7c7d720aa7bc94.js +0 -1
- package/assets/esri/core/workers/chunks/eb9982bc866976fef960.js +0 -1
- package/assets/esri/core/workers/chunks/ec4669a0edeca94710e0.js +0 -1
- package/assets/esri/core/workers/chunks/ef013a77950c1902de11.js +0 -1
- package/assets/esri/core/workers/chunks/ef9d74f8d5a502fda809.js +0 -1
- package/assets/esri/core/workers/chunks/f09446b9ff937a84d6d3.js +0 -1
- package/assets/esri/core/workers/chunks/f0bc5e8e44d53b73d431.js +0 -1
- package/assets/esri/core/workers/chunks/f653970d983f17fb764b.js +0 -1
- package/assets/esri/core/workers/chunks/f9edc685099f51363f41.js +0 -1
- package/assets/esri/core/workers/chunks/fa687ba2d66fcc2501da.js +0 -1
- package/assets/esri/core/workers/chunks/fb9a889ec9fd23739a14.js +0 -1
- package/assets/esri/core/workers/chunks/fe1b67ab7748a3aef231.js +0 -1
- package/chunks/HUDCompositing.glsl.js +0 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EncodingColor.glsl.js +0 -7
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/TerrainDepthTest.glsl.js +0 -8
- package/views/3d/webgl-engine/effects/fboFormatUtils.js +0 -2
- package/views/3d/webgl-engine/shaders/GlobalIllumination.glsl.js +0 -2
- package/views/3d/webgl-engine/shaders/GlobalIlluminationBlur.glsl.js +0 -2
- package/views/3d/webgl-engine/shaders/HUDCompositing.glsl.js +0 -2
- package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +0 -2
- /package/assets/esri/core/workers/chunks/{85edbb072a2ce6c1bb30.js.LICENSE.txt → 9eb4ae556950e1d0124d.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d4a9eb4470cc6a1f67fc.js.LICENSE.txt → d65b1234867f7d773d50.js.LICENSE.txt} +0 -0
|
@@ -1,1127 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1951,5647],{28491(e,t,r){r.d(t,{D:()=>G,b:()=>L});var o=r(32680),n=r(49255),a=r(68317),i=r(76597),s=r(24321),l=r(2585),c=r(43519),u=r(96336),d=r(39014),m=r(53466),h=r(92700),f=r(72824),p=r(35640),v=r(40261),g=r(77695),x=r(71651),b=r(9312),w=r(98619),y=r(62602),M=r(22393),T=r(59469),S=r(32482),C=r(96598),_=r(51406),I=r(43259),z=r(58614),P=r(27950),O=r(77949),F=r(33079),H=r(71988),R=r(20304),E=r(31821),j=r(63761),N=r(27832),A=r(43616),D=r(73541),B=r(14113),V=r(49788);function L(e){const t=new B.N5,{attributes:r,vertex:L,fragment:G,varyings:W}=t,{output:k,normalType:U,offsetBackfaces:q,spherical:Z,snowCover:$,pbrMode:Y,textureAlphaPremultiplied:J,instancedDoublePrecision:K,hasVertexColors:X,hasVertexTangents:Q,hasColorTexture:ee,hasNormalTexture:te,hasNormalTextureTransform:re,hasColorTextureTransform:oe}=e;if((0,O.NB)(L,e),r.add("position","vec3"),W.add("vpos","vec3",{invariant:!0}),t.include(I.A,e),t.include(l.B,e),t.include(p.Ge,e),t.include(_.q2,e),!(0,n._o)(k))return t.include(v.E,e),t;t.include(_.Sx,e),t.include(_.MU,e),t.include(_.O1,e),t.include(_.QM,e),(0,O.yu)(L,e),t.include(u.Y,e),t.include(i.d);const ne=0===U||1===U;return ne&&q&&t.include(o.M),t.include(g.J,e),t.include(f.Mh,e),t.include(s.v,e),W.add("vPositionLocal","vec3"),t.include(m.U,e),t.include(d.K,e),t.include(h.c,e),L.uniforms.add(new H.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),W.add("vcolorExt","vec4"),t.include(C.Z,e),L.include(c.WD),L.include(c.oF),t.include(K?S.QH:S.LA,e),L.main.add(E.H`
|
|
2
|
-
forwardVertexColor();
|
|
3
|
-
|
|
4
|
-
MaskedColor maskedColor =
|
|
5
|
-
applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
|
|
6
|
-
|
|
7
|
-
vcolorExt = maskedColor.color;
|
|
8
|
-
forwardColorMixMode(maskedColor.mask);
|
|
9
|
-
|
|
10
|
-
vpos = getVertexInLocalOriginSpace();
|
|
11
|
-
vPositionLocal = vpos - view[3].xyz;
|
|
12
|
-
vpos = subtractOrigin(vpos);
|
|
13
|
-
${(0,E.If)(ne,"vNormalWorld = dpNormal(vvLocalNormal(normalModel()));")}
|
|
14
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
15
|
-
${(0,E.If)(Q,"vTangent = dpTransformVertexTangent(tangent);")}
|
|
16
|
-
gl_Position = transformPosition(proj, view, vpos);
|
|
17
|
-
${(0,E.If)(ne&&q,"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);")}
|
|
18
|
-
|
|
19
|
-
forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
|
|
20
|
-
forwardTextureCoordinates();
|
|
21
|
-
forwardColorUV();
|
|
22
|
-
forwardNormalUV();
|
|
23
|
-
forwardEmissiveUV();
|
|
24
|
-
forwardOcclusionUV();
|
|
25
|
-
forwardMetallicRoughnessUV();
|
|
26
|
-
|
|
27
|
-
if (opacityMixMode != ${E.H.int(A.Um.ignore)} && vcolorExt.a < ${E.H.float(V.Q)}) {
|
|
28
|
-
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
29
|
-
}
|
|
30
|
-
forwardLinearDepthToReadShadowMap();
|
|
31
|
-
`),G.include(b.kA,e),G.include(x.n,e),t.include(z.S,e),G.include(a.HQ,e),t.include(D.D,e),(0,O.yu)(G,e),G.uniforms.add(L.uniforms.get("localOrigin"),new F.t("ambient",e=>e.ambient),new F.t("diffuse",e=>e.diffuse),new R.m("opacity",e=>e.opacity),new R.m("layerOpacity",e=>e.layerOpacity)),ee&&G.uniforms.add(new j.N("tex",e=>e.texture)),t.include(T._,e),G.include(M.c,e),G.include(P.N),t.include(y.r,e),G.include(N.b,e),(0,b.a8)(G),(0,b.eU)(G),(0,w.O4)(G),G.main.add(E.H`
|
|
32
|
-
discardBySlice(vpos);
|
|
33
|
-
discardByTerrainDepth();
|
|
34
|
-
${ee?E.H`
|
|
35
|
-
vec4 texColor = texture(tex, ${oe?"colorUV":"vuv0"});
|
|
36
|
-
${(0,E.If)(J,"texColor.rgb /= texColor.a;")}
|
|
37
|
-
discardOrAdjustAlpha(texColor);`:E.H`vec4 texColor = vec4(1.0);`}
|
|
38
|
-
shadingParams.viewDirection = normalize(vpos - cameraPosition);
|
|
39
|
-
${2===U?E.H`vec3 normal = screenDerivativeNormal(vPositionLocal);`:E.H`shadingParams.normalView = vNormalWorld;
|
|
40
|
-
vec3 normal = shadingNormal(shadingParams);`}
|
|
41
|
-
applyPBRFactors();
|
|
42
|
-
float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
|
|
43
|
-
|
|
44
|
-
vec3 posWorld = vpos + localOrigin;
|
|
45
|
-
|
|
46
|
-
float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
|
|
47
|
-
float shadow = readShadow(additionalAmbientScale, vpos);
|
|
48
|
-
|
|
49
|
-
vec3 matColor = max(ambient, diffuse);
|
|
50
|
-
vec3 albedo = mixExternalColor(${(0,E.If)(X,"vColor.rgb *")} matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
|
|
51
|
-
float opacity_ = layerOpacity * mixExternalOpacity(${(0,E.If)(X,"vColor.a * ")} opacity, texColor.a, vcolorExt.a, opacityMixMode);
|
|
52
|
-
|
|
53
|
-
${te?`mat3 tangentSpace = computeTangentSpace(${Q?"normal":"normal, vpos, vuv0"});\n vec3 shadingNormal = computeTextureNormal(tangentSpace, ${re?"normalUV":"vuv0"});`:"vec3 shadingNormal = normal;"}
|
|
54
|
-
vec3 normalGround = ${Z?"normalize(posWorld);":"vec3(0.0, 0.0, 1.0);"}
|
|
55
|
-
|
|
56
|
-
${(0,E.If)($,E.H`
|
|
57
|
-
float snow = getSnow(normal, normalGround);
|
|
58
|
-
albedo = mix(albedo, vec3(1), snow);
|
|
59
|
-
shadingNormal = mix(shadingNormal, normal, snow);
|
|
60
|
-
ssao = mix(ssao, 1.0, snow);`)}
|
|
61
|
-
|
|
62
|
-
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
|
|
63
|
-
|
|
64
|
-
${1===Y||2===Y?E.H`
|
|
65
|
-
float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
66
|
-
${(0,E.If)($,"mrr = applySnowToMRR(mrr, snow);")}
|
|
67
|
-
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, additionalAmbientIrradiance);`:E.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
68
|
-
vec4 finalColor = vec4(shadedColor, opacity_);
|
|
69
|
-
outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${(0,E.If)($,", snow")});
|
|
70
|
-
`),t}const G=Object.freeze(Object.defineProperty({__proto__:null,build:L},Symbol.toStringTag,{value:"Module"}))},587(e,t,r){r.d(t,{G:()=>v,a:()=>x,b:()=>g});var o=r(82048),n=r(92573),a=r(8578),i=r(98619),s=r(96608),l=r(34845),c=r(20304),u=r(31821),d=r(58029),m=r(12791),h=r(63761),f=r(65786),p=r(14113);class v extends f.Y{constructor(){super(...arguments),this.projScale=1,this.frameCount=0}}function g(e){const t=new p.N5,r=t.fragment;return t.include(o.c),t.include(l.Ir),(0,i.Gc)(r),r.include(n.V),t.include(s.t,{highStepCount:!1,screenSpaceReflections:!0}),r.include(a.k),r.uniforms.add(new h.N("normalMap",e=>e.normalTexture),new h.N("depthMap",e=>e.depthTexture),new h.N("lastFrameDepthTexture",(e,t)=>t.reprojection.lastFrameDepth?.attachment),new m.x("lastFrameGlobalIlluminationTexture",e=>e.globalIllumination?.getTexture()),new d.F("reprojectionViewMatrix",e=>e.reprojection.viewMatrix),new d.F("view",e=>e.camera.viewMatrix),new c.m("frameCount",e=>e.frameCount),new h.N("blueNoiseTex",e=>e.noiseTexture)),e.hasEmission&&r.uniforms.add(new h.N("lastFrameEmissionTexture",(e,t)=>t.reprojection.lastFrameEmission?.attachment)),r.constants.add("timeSamplesSize","float",64),r.constants.add("blueNoiseGridSize","float",8),r.code.add(u.H`vec4 randomDirection(float index) {
|
|
71
|
-
vec2 textureOffset = vec2(mod(index, blueNoiseGridSize), floor(index / blueNoiseGridSize)) * timeSamplesSize;
|
|
72
|
-
ivec2 iuv = ivec2(textureOffset + mod(gl_FragCoord.xy, vec2(timeSamplesSize)));
|
|
73
|
-
vec4 blueNoiseValue = texelFetch(blueNoiseTex, iuv, 0);
|
|
74
|
-
return 2.0 * blueNoiseValue - 1.0;
|
|
75
|
-
}
|
|
76
|
-
vec3 sampleCosineHemisphere(vec2 u) {
|
|
77
|
-
float phi = 6.28318530718 * u.x;
|
|
78
|
-
float radius = sqrt(u.y);
|
|
79
|
-
float x = radius * cos(phi);
|
|
80
|
-
float y = radius * sin(phi);
|
|
81
|
-
float z = sqrt(max(0.0, 1.0 - u.y));
|
|
82
|
-
return vec3(x, y, z);
|
|
83
|
-
}
|
|
84
|
-
mat3 basisFromNormal(vec3 n) {
|
|
85
|
-
vec3 up = abs(n.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
|
|
86
|
-
vec3 tangent = normalize(cross(up, n));
|
|
87
|
-
vec3 bitangent = cross(n, tangent);
|
|
88
|
-
return mat3(tangent, bitangent, n);
|
|
89
|
-
}`),r.main.add(u.H`
|
|
90
|
-
float depth = depthFromTexture(depthMap, uv);
|
|
91
|
-
|
|
92
|
-
// Early out if depth is out of range, such as in the sky
|
|
93
|
-
if (depth >= 1.0 || depth <= 0.0) {
|
|
94
|
-
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Get the normal of current fragment
|
|
99
|
-
ivec2 iuv = ivec2(uv * vec2(textureSize(normalMap, 0)));
|
|
100
|
-
vec4 normal4 = texelFetch(normalMap, iuv, 0);
|
|
101
|
-
if(normal4.a != 1.0) {
|
|
102
|
-
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
vec3 normal = normalize(normal4.xyz * 2.0 - 1.0);
|
|
106
|
-
|
|
107
|
-
// Reconstruct view space position of current fragment
|
|
108
|
-
float currentPixelDepth = linearizeDepth(depth);
|
|
109
|
-
vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth);
|
|
110
|
-
vec4 viewPos = vec4(currentPixelPos, 1.0);
|
|
111
|
-
|
|
112
|
-
// Reproject current view position to last frame
|
|
113
|
-
vec4 reprojectedViewPos = reprojectionViewMatrix * viewPos;
|
|
114
|
-
vec4 reprojectedCoordinate = applyProjectionMat(proj, reprojectedViewPos.xyz);
|
|
115
|
-
|
|
116
|
-
// Read last frame reprojected depth and GI value.
|
|
117
|
-
float lastFrameDepthViewPos = -linearDepthFromTextureLastFrame(lastFrameDepthTexture, reprojectedCoordinate.xy);
|
|
118
|
-
vec4 lastFrameGlobalIllumination = texture(lastFrameGlobalIlluminationTexture, reprojectedCoordinate.xy);
|
|
119
|
-
|
|
120
|
-
int steps;
|
|
121
|
-
float weightOcclusion;
|
|
122
|
-
float weightEmission;
|
|
123
|
-
|
|
124
|
-
// Heuristic to determine blending weights and number of steps for occlusion and emission
|
|
125
|
-
if (abs((lastFrameDepthViewPos + reprojectedViewPos.z)/max(lastFrameDepthViewPos, reprojectedViewPos.z)) > 0.01) {
|
|
126
|
-
steps = 6;
|
|
127
|
-
weightOcclusion = 1.0;
|
|
128
|
-
weightEmission = 1.0;
|
|
129
|
-
} else {
|
|
130
|
-
steps = 1;
|
|
131
|
-
if (lastFrameGlobalIllumination.b > 0.5) {
|
|
132
|
-
weightOcclusion = 0.15;
|
|
133
|
-
weightEmission = 0.008;
|
|
134
|
-
} else if (lastFrameGlobalIllumination.b > 0.02) {
|
|
135
|
-
weightOcclusion = lastFrameGlobalIllumination.b - 0.005;
|
|
136
|
-
weightEmission = 0.008;
|
|
137
|
-
} else {
|
|
138
|
-
weightOcclusion = 0.016;
|
|
139
|
-
weightEmission = 0.008;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
vec4 randomDirectionSample;
|
|
144
|
-
mat3 normalBasis = basisFromNormal(normal);
|
|
145
|
-
|
|
146
|
-
// For each ray determine if it hits geometry and calculate occlusion and emission values
|
|
147
|
-
float stepSize = 1.0 / float(steps);
|
|
148
|
-
for (int i = 0; i < steps; ++i) {
|
|
149
|
-
float index = float(i * min(64/steps, 6) + int(mod(frameCount, float(64/steps))));
|
|
150
|
-
randomDirectionSample = randomDirection(index);
|
|
151
|
-
vec2 hemisphereSample = randomDirectionSample.rg * 0.5 + 0.5;
|
|
152
|
-
vec3 rayDirection = normalBasis * sampleCosineHemisphere(hemisphereSample);
|
|
153
|
-
vec3 hit = screenSpaceIntersection(rayDirection, viewPos.xyz, normalize(viewPos.xyz), normal, randomDirectionSample.a * 0.5 + 0.5, true);
|
|
154
|
-
|
|
155
|
-
if (hit.z > 0.0) {
|
|
156
|
-
// Emission - reproject to get and accumulate emission from last frame
|
|
157
|
-
vec2 hitReprojectedCoordinate = reprojectionCoordinate(hit);
|
|
158
|
-
vec3 emissionColor = ${(0,u.If)(e.hasEmission,"texture(lastFrameEmissionTexture, hitReprojectedCoordinate).xyz","vec3(0.0)")};
|
|
159
|
-
fragColor += vec4(emissionColor * vec3(stepSize), 0.0);
|
|
160
|
-
} else {
|
|
161
|
-
// Occlusion - heuristic modulating sky intensity based on angle to main light
|
|
162
|
-
vec4 viewMainLightDirection = view * vec4(mainLightDirection, 0.0);
|
|
163
|
-
float skyModulation = pow(max(dot(rayDirection, viewMainLightDirection.xyz), 0.0), 3.0) * 5.5;
|
|
164
|
-
float weight = clamp(3.5 * dot(viewMainLightDirection.xyz, normal), 0.0, 1.0);
|
|
165
|
-
skyModulation = mix(1.0, skyModulation * 0.2 + 0.8, weight);
|
|
166
|
-
fragColor += skyModulation * vec4(vec3(0.0), stepSize);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// Rendering trick add noise to reduce accumulation artifacts
|
|
171
|
-
float ditheringNoise = weightOcclusion < 1. ? randomDirectionSample.b * 0.0039 : 0.0;
|
|
172
|
-
|
|
173
|
-
// Accumulate occlusion
|
|
174
|
-
fragColor.a = mix(lastFrameGlobalIllumination.a + ditheringNoise, fragColor.a, weightOcclusion);
|
|
175
|
-
|
|
176
|
-
// Accumulate emission
|
|
177
|
-
vec3 lastFrameEmission = decodeVec2ToRGB(lastFrameGlobalIllumination.rg);
|
|
178
|
-
fragColor.rgb = mix(lastFrameEmission + ditheringNoise, fragColor.rgb, weightEmission);
|
|
179
|
-
|
|
180
|
-
// Encode emission and occlusion into output
|
|
181
|
-
vec2 encodedColor = encodeRGBtoVec2(fragColor.rgb);
|
|
182
|
-
fragColor.r = encodedColor.x;
|
|
183
|
-
fragColor.g = encodedColor.y;
|
|
184
|
-
fragColor.b = weightOcclusion;
|
|
185
|
-
`),t}const x=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationPassParameters:v,build:g},Symbol.toStringTag,{value:"Module"}))},52516(e,t,r){r.d(t,{G:()=>p,a:()=>g,b:()=>v});var o=r(48163),n=r(82048),a=r(52540),i=r(8578),s=r(34845),l=r(68259),c=r(20304),u=r(31821),d=r(15976),m=r(63761),h=r(65786),f=r(14113);class p extends h.Y{constructor(){super(...arguments),this.blurSize=(0,o.vt)()}}function v(){const e=new f.N5,t=e.fragment;e.include(n.c),e.include(s.Ir),t.include(i.k);return t.include(a.E),t.uniforms.add(new m.N("depthMap",e=>e.depthTexture),new m.N("normalMap",e=>e.normalTexture),new d.o("tex",e=>e.colorTexture),new l.t("blurSize",e=>e.blurSize),new c.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(u.H`
|
|
186
|
-
void accumulateBlurSample(
|
|
187
|
-
vec2 sampleUv,
|
|
188
|
-
float sampleOffset,
|
|
189
|
-
float centerDepth,
|
|
190
|
-
vec3 centerNormal,
|
|
191
|
-
float depthSharpness,
|
|
192
|
-
inout float emissionWeightSum,
|
|
193
|
-
inout vec3 emissionSum,
|
|
194
|
-
inout float occlusionWeightSum,
|
|
195
|
-
inout float occlusionSum,
|
|
196
|
-
float centerOcclusionWeight
|
|
197
|
-
) {
|
|
198
|
-
vec4 globalIllumination = texture(tex, sampleUv);
|
|
199
|
-
vec3 sampleNormal = texture(normalMap, sampleUv).rgb;
|
|
200
|
-
float sampleDepth = linearDepthFromTexture(depthMap, sampleUv);
|
|
201
|
-
|
|
202
|
-
float depthDelta = sampleDepth - centerDepth;
|
|
203
|
-
float normalWeight = clamp(1.0 - ${u.H.float(15.3)} * length(sampleNormal - centerNormal), 0.0, 1.0);
|
|
204
|
-
vec3 decodedEmission = decodeVec2ToRGB(globalIllumination.rg);
|
|
205
|
-
|
|
206
|
-
float emissionWeight = exp(-sampleOffset * sampleOffset * ${u.H.float(1/24.5)} * ${u.H.float(.1)} - depthDelta * depthDelta * depthSharpness);
|
|
207
|
-
emissionWeight *= normalWeight;
|
|
208
|
-
emissionWeightSum += emissionWeight;
|
|
209
|
-
emissionSum += emissionWeight * decodedEmission;
|
|
210
|
-
|
|
211
|
-
float occlusionKernelScale = centerOcclusionWeight > ${u.H.float(.03)}
|
|
212
|
-
? ${u.H.float(.08)}
|
|
213
|
-
: ${u.H.float(1.5)};
|
|
214
|
-
float occlusionWeight = exp(-sampleOffset * sampleOffset * occlusionKernelScale - depthDelta * depthDelta * depthSharpness);
|
|
215
|
-
occlusionWeight *= normalWeight;
|
|
216
|
-
occlusionWeightSum += occlusionWeight;
|
|
217
|
-
occlusionSum += occlusionWeight * globalIllumination.a;
|
|
218
|
-
}
|
|
219
|
-
`),t.main.add(u.H`
|
|
220
|
-
vec3 emissionSum = vec3(0.0);
|
|
221
|
-
float emissionWeightSum = 0.0;
|
|
222
|
-
|
|
223
|
-
float centerDepth = linearDepthFromTexture(depthMap, uv);
|
|
224
|
-
vec3 centerNormal = texture(normalMap, uv).rgb;
|
|
225
|
-
float occlusionSum = 0.0;
|
|
226
|
-
float occlusionWeightSum = 0.0;
|
|
227
|
-
float centerOcclusionWeight = texture(tex, uv).b;
|
|
228
|
-
|
|
229
|
-
float depthSharpness = ${u.H.float(-.05)} * projScale / centerDepth;
|
|
230
|
-
for (int sampleOffset = -${u.H.int(4)}; sampleOffset <= ${u.H.int(4)}; ++sampleOffset) {
|
|
231
|
-
float sampleOffsetFloat = float(sampleOffset);
|
|
232
|
-
vec2 sampleUv = uv + sampleOffsetFloat * blurSize;
|
|
233
|
-
accumulateBlurSample(
|
|
234
|
-
sampleUv,
|
|
235
|
-
sampleOffsetFloat,
|
|
236
|
-
centerDepth,
|
|
237
|
-
centerNormal,
|
|
238
|
-
depthSharpness,
|
|
239
|
-
emissionWeightSum,
|
|
240
|
-
emissionSum,
|
|
241
|
-
occlusionWeightSum,
|
|
242
|
-
occlusionSum,
|
|
243
|
-
centerOcclusionWeight
|
|
244
|
-
);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
vec3 blurredEmission = (emissionSum / emissionWeightSum).rgb;
|
|
248
|
-
vec2 encodedEmission = encodeRGBtoVec2(blurredEmission.rgb);
|
|
249
|
-
float occlusion = occlusionSum / occlusionWeightSum;
|
|
250
|
-
fragColor = vec4(vec3(encodedEmission.x, encodedEmission.y, centerOcclusionWeight), occlusion);
|
|
251
|
-
`),e}const g=Object.freeze(Object.defineProperty({__proto__:null,GlobalIlluminationBlurDrawParameters:p,build:v},Symbol.toStringTag,{value:"Module"}))},57323(e,t,r){r.d(t,{R:()=>D,b:()=>A});var o=r(32680),n=r(49255),a=r(68317),i=r(76597),s=r(24321),l=r(2585),c=r(43519),u=r(96336),d=r(39014),m=r(53466),h=r(92700),f=r(35640),p=r(40261),v=r(71651),g=r(9312),x=r(98619),b=r(22393),w=r(59469),y=r(32482),M=r(96598),T=r(43259),S=r(58614),C=r(27950),_=r(77949),I=r(33079),z=r(71988),P=r(20304),O=r(31821),F=r(63761),H=r(27832),R=r(43616),E=r(26934),j=r(73541),N=r(14113);function A(e){const t=new N.N5,{attributes:r,vertex:A,fragment:D,varyings:B}=t,{output:V,offsetBackfaces:L,pbrMode:G,snowCover:W,spherical:k}=e,U=1===G||2===G;if((0,_.NB)(A,e),r.add("position","vec3"),B.add("vpos","vec3",{invariant:!0}),t.include(T.A,e),t.include(l.B,e),t.include(f.Ge,e),t.include(M.Z,e),!(0,n._o)(V))return t.include(p.E,e),t;(0,_.yu)(t.vertex,e),t.include(u.Y,e),t.include(i.d),L&&t.include(o.M),B.add("vNormalWorld","vec3"),B.add("localvpos","vec3",{invariant:!0}),t.include(m.U,e),t.include(d.K,e),t.include(s.v,e),t.include(h.c,e),A.include(c.WD),A.include(c.oF),A.uniforms.add(new z.E("externalColor",e=>e.externalColor,{supportsNaN:!0})),B.add("vcolorExt","vec4"),t.include(e.instancedDoublePrecision?y.QH:y.LA,e),A.include(E.Q),A.main.add(O.H`
|
|
252
|
-
forwardVertexColor();
|
|
253
|
-
|
|
254
|
-
MaskedColor maskedColorExt =
|
|
255
|
-
applySymbolColor(applyVVColor(applyInstanceColor(createMaskedFromNaNColor(externalColor))));
|
|
256
|
-
|
|
257
|
-
vcolorExt = maskedColorExt.color;
|
|
258
|
-
forwardColorMixMode(maskedColorExt.mask);
|
|
259
|
-
|
|
260
|
-
bool alphaCut = opacityMixMode != ${O.H.int(R.Um.ignore)} && vcolorExt.a < alphaCutoff;
|
|
261
|
-
vpos = getVertexInLocalOriginSpace();
|
|
262
|
-
|
|
263
|
-
localvpos = vpos - view[3].xyz;
|
|
264
|
-
vpos = subtractOrigin(vpos);
|
|
265
|
-
vNormalWorld = dpNormal(vvLocalNormal(normalModel()));
|
|
266
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
267
|
-
vec4 basePosition = transformPosition(proj, view, vpos);
|
|
268
|
-
|
|
269
|
-
forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
|
|
270
|
-
forwardTextureCoordinates();
|
|
271
|
-
forwardLinearDepthToReadShadowMap();
|
|
272
|
-
gl_Position = alphaCut ? vec4(1e38, 1e38, 1e38, 1.0) :
|
|
273
|
-
${(0,O.If)(L,"offsetBackfacingClipPosition(basePosition, vpos, vNormalWorld, cameraPosition);","basePosition;")}
|
|
274
|
-
`);const{hasColorTexture:q,hasColorTextureTransform:Z}=e;return D.include(g.kA,e),D.include(v.n,e),t.include(S.S,e),D.include(a.HQ,e),t.include(j.D,e),(0,_.yu)(D,e),(0,x.Gc)(D),(0,g.a8)(D),(0,g.eU)(D),D.uniforms.add(A.uniforms.get("localOrigin"),A.uniforms.get("view"),new I.t("ambient",e=>e.ambient),new I.t("diffuse",e=>e.diffuse),new P.m("opacity",e=>e.opacity),new P.m("layerOpacity",e=>e.layerOpacity)),q&&D.uniforms.add(new F.N("tex",e=>e.texture)),t.include(w._,e),D.include(b.c,e),D.include(C.N),D.include(H.b,e),(0,x.O4)(D),D.main.add(O.H`
|
|
275
|
-
discardBySlice(vpos);
|
|
276
|
-
discardByTerrainDepth();
|
|
277
|
-
vec4 texColor = ${q?`texture(tex, ${Z?"colorUV":"vuv0"})`:" vec4(1.0)"};
|
|
278
|
-
${(0,O.If)(q,`${(0,O.If)(e.textureAlphaPremultiplied,"texColor.rgb /= texColor.a;")}\n discardOrAdjustAlpha(texColor);`)}
|
|
279
|
-
vec3 viewDirection = normalize(vpos - cameraPosition);
|
|
280
|
-
applyPBRFactors();
|
|
281
|
-
float ssao = evaluateAmbientOcclusionInverse();
|
|
282
|
-
ssao *= getBakedOcclusion();
|
|
283
|
-
|
|
284
|
-
float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
|
|
285
|
-
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
|
|
286
|
-
float shadow = readShadow(additionalAmbientScale, vpos);
|
|
287
|
-
vec3 matColor = max(ambient, diffuse);
|
|
288
|
-
${e.hasVertexColors?O.H`vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
|
|
289
|
-
float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, opacityMixMode);`:O.H`vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, colorMixMode);
|
|
290
|
-
float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, opacityMixMode);`}
|
|
291
|
-
|
|
292
|
-
vec3 shadingNormal = normalize(vNormalWorld);
|
|
293
|
-
vec3 groundNormal = ${k?"normalize(vpos + localOrigin)":"vec3(0.0, 0.0, 1.0)"};
|
|
294
|
-
|
|
295
|
-
${(0,O.If)(W,"vec3 faceNormal = screenDerivativeNormal(vpos);\n float snow = getRealisticTreeSnow(faceNormal, shadingNormal, groundNormal);\n albedo = mix(albedo, vec3(1), snow);")}
|
|
296
|
-
|
|
297
|
-
${O.H`albedo *= 1.2;
|
|
298
|
-
vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
|
|
299
|
-
float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
|
|
300
|
-
float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);
|
|
301
|
-
float treeRadialFalloff = vColor.r;
|
|
302
|
-
float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
|
|
303
|
-
additionalLight += backLightFactor * mainLightIntensity;`}
|
|
304
|
-
|
|
305
|
-
${U?O.H`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
306
|
-
${(0,O.If)(W,"mrr = applySnowToMRR(mrr, snow);")}
|
|
307
|
-
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, groundNormal, mrr, additionalAmbientIrradiance);`:O.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
308
|
-
vec4 finalColor = vec4(shadedColor, opacity_);
|
|
309
|
-
outputColorHighlightOLID(applySlice(finalColor, vpos), albedo ${(0,O.If)(W,", 1.0")});`),t}const D=Object.freeze(Object.defineProperty({__proto__:null,build:A},Symbol.toStringTag,{value:"Module"}))},15581(e,t,r){r.d(t,{S:()=>b,b:()=>v,g:()=>g});var o=r(37585),n=r(48163),a=r(82048),i=r(52540),s=r(65261),l=r(34845),c=r(77108),u=r(47286),d=r(33094),m=r(20304),h=r(31821),f=r(63761),p=r(14113);function v(){const e=new p.N5,t=e.fragment;return e.include(a.c),e.include(l.Ir),t.include(i.E),t.include(s.C),t.uniforms.add(new d.U("radius",e=>g(e.camera))).code.add(h.H`vec3 sphere[16] = vec3[16](
|
|
310
|
-
vec3(0.186937, 0.0, 0.0),
|
|
311
|
-
vec3(0.700542, 0.0, 0.0),
|
|
312
|
-
vec3(-0.864858, -0.481795, -0.111713),
|
|
313
|
-
vec3(-0.624773, 0.102853, -0.730153),
|
|
314
|
-
vec3(-0.387172, 0.260319, 0.007229),
|
|
315
|
-
vec3(-0.222367, -0.642631, -0.707697),
|
|
316
|
-
vec3(-0.01336, -0.014956, 0.169662),
|
|
317
|
-
vec3(0.122575, 0.1544, -0.456944),
|
|
318
|
-
vec3(-0.177141, 0.85997, -0.42346),
|
|
319
|
-
vec3(-0.131631, 0.814545, 0.524355),
|
|
320
|
-
vec3(-0.779469, 0.007991, 0.624833),
|
|
321
|
-
vec3(0.308092, 0.209288,0.35969),
|
|
322
|
-
vec3(0.359331, -0.184533, -0.377458),
|
|
323
|
-
vec3(0.192633, -0.482999, -0.065284),
|
|
324
|
-
vec3(0.233538, 0.293706, -0.055139),
|
|
325
|
-
vec3(0.417709, -0.386701, 0.442449)
|
|
326
|
-
);
|
|
327
|
-
float fallOffFunction(float vv, float vn, float bias) {
|
|
328
|
-
float f = max(radius * radius - vv, 0.0);
|
|
329
|
-
return f * f * f * max(vn - bias, 0.0);
|
|
330
|
-
}`),t.code.add(h.H`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) {
|
|
331
|
-
vec3 v = Q - C;
|
|
332
|
-
float vv = dot(v, v);
|
|
333
|
-
float vn = dot(normalize(v), n_C);
|
|
334
|
-
return fallOffFunction(vv, vn, 0.1);
|
|
335
|
-
}`),e.outputs.add("fragOcclusion","float"),t.uniforms.add(new f.N("normalMap",e=>e.normalTexture),new f.N("depthMap",e=>e.depthTexture),new m.m("projScale",e=>e.projScale),new f.N("rnm",e=>e.noiseTexture),new u.G("rnmScale",(e,t)=>(0,o.hZ)(x,t.camera.fullWidth/e.noiseTexture.descriptor.width,t.camera.fullHeight/e.noiseTexture.descriptor.height)),new m.m("intensity",e=>e.intensity),new c.E("screenSize",e=>(0,o.hZ)(x,e.camera.fullWidth,e.camera.fullHeight))).main.add(h.H`
|
|
336
|
-
float depth = depthFromTexture(depthMap, uv);
|
|
337
|
-
|
|
338
|
-
// Early out if depth is out of range, such as in the sky
|
|
339
|
-
if (depth >= 1.0 || depth <= 0.0) {
|
|
340
|
-
fragOcclusion = 1.0;
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
// get the normal of current fragment
|
|
345
|
-
ivec2 iuv = ivec2(uv * vec2(textureSize(normalMap, 0)));
|
|
346
|
-
vec4 norm4 = texelFetch(normalMap, iuv, 0);
|
|
347
|
-
if(norm4.a != 1.0) {
|
|
348
|
-
fragOcclusion = 1.0;
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
vec3 norm = normalize(norm4.xyz * 2.0 - 1.0);
|
|
352
|
-
|
|
353
|
-
float currentPixelDepth = linearizeDepth(depth);
|
|
354
|
-
vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth);
|
|
355
|
-
|
|
356
|
-
float sum = 0.0;
|
|
357
|
-
vec3 tapPixelPos;
|
|
358
|
-
|
|
359
|
-
vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0);
|
|
360
|
-
|
|
361
|
-
// note: the factor 2.0 should not be necessary, but makes ssao much nicer.
|
|
362
|
-
// bug or deviation from CE somewhere else?
|
|
363
|
-
float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y);
|
|
364
|
-
|
|
365
|
-
for(int i = 0; i < ${h.H.int(16)}; ++i) {
|
|
366
|
-
vec2 unitOffset = reflect(sphere[i], fres).xy;
|
|
367
|
-
vec2 offset = vec2(-unitOffset * radius * ps);
|
|
368
|
-
|
|
369
|
-
// don't use current or very nearby samples
|
|
370
|
-
if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){
|
|
371
|
-
continue;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
vec2 tc = vec2(gl_FragCoord.xy + offset);
|
|
375
|
-
if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue;
|
|
376
|
-
vec2 tcTap = tc / screenSize;
|
|
377
|
-
float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap);
|
|
378
|
-
|
|
379
|
-
tapPixelPos = reconstructPosition(tc, occluderFragmentDepth);
|
|
380
|
-
|
|
381
|
-
sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
// output the result
|
|
385
|
-
float A = max(1.0 - sum * intensity / float(${h.H.int(16)}), 0.0);
|
|
386
|
-
|
|
387
|
-
// Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2
|
|
388
|
-
A = (pow(A, 0.2) + 1.2 * pow(A, 4.0)) * INV_GAMMA;
|
|
389
|
-
|
|
390
|
-
fragOcclusion = A;
|
|
391
|
-
`),e}function g(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const x=(0,n.vt)(),b=Object.freeze(Object.defineProperty({__proto__:null,build:v,getRadius:g},Symbol.toStringTag,{value:"Module"}))},95774(e,t,r){r.d(t,{S:()=>m,b:()=>d});var o=r(82048),n=r(52540),a=r(68259),i=r(20304),s=r(31821),l=r(15976),c=r(63761),u=r(14113);function d(){const e=new u.N5,t=e.fragment;return e.include(o.c),t.include(n.E),t.uniforms.add(new c.N("depthMap",e=>e.depthTexture),new l.o("tex",e=>e.colorTexture),new a.t("blurSize",e=>e.blurSize),new i.m("projScale",(e,t)=>{const r=t.camera.distance;return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),t.code.add(s.H`
|
|
392
|
-
void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
|
|
393
|
-
float c = texture(tex, uv).r;
|
|
394
|
-
float d = linearDepthFromTexture(depthMap, uv);
|
|
395
|
-
|
|
396
|
-
float ddiff = d - center_d;
|
|
397
|
-
|
|
398
|
-
float w = exp(-r * r * ${s.H.float(.08)} - ddiff * ddiff * sharpness);
|
|
399
|
-
wTotal += w;
|
|
400
|
-
bTotal += w * c;
|
|
401
|
-
}
|
|
402
|
-
`),e.outputs.add("fragBlur","float"),t.main.add(s.H`
|
|
403
|
-
float b = 0.0;
|
|
404
|
-
float w_total = 0.0;
|
|
405
|
-
|
|
406
|
-
float center_d = linearDepthFromTexture(depthMap, uv);
|
|
407
|
-
|
|
408
|
-
float sharpness = -0.05 * projScale / center_d;
|
|
409
|
-
for (int r = -${s.H.int(4)}; r <= ${s.H.int(4)}; ++r) {
|
|
410
|
-
float rf = float(r);
|
|
411
|
-
vec2 uvOffset = uv + rf * blurSize;
|
|
412
|
-
blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
|
|
413
|
-
}
|
|
414
|
-
fragBlur = b / w_total;`),e}const m=Object.freeze(Object.defineProperty({__proto__:null,build:d},Symbol.toStringTag,{value:"Module"}))},43609(e,t,r){r.d(t,{a:()=>a,f:()=>i,n:()=>n});var o=r(34275);function n(e,t){a(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r=2,n=r){const a=t.length/2;let i=0,s=0;if(!(0,o.iu)(t)||(0,o.dk)(t)){for(let o=0;o<a;++o)e[i]=t[s],e[i+1]=t[s+1],i+=r,s+=n;return}const l=(0,o.a3)(t);if((0,o.JI)(t))for(let o=0;o<a;++o)e[i]=Math.max(t[s]/l,-1),e[i+1]=Math.max(t[s+1]/l,-1),i+=r,s+=n;else for(let o=0;o<a;++o)e[i]=t[s]/l,e[i+1]=t[s+1]/l,i+=r,s+=n}function i(e,t,r,o){const n=e.typedBuffer,a=e.typedBufferStride,i=o?.count??e.count;let s=(o?.dstIndex??0)*a;for(let e=0;e<i;++e)n[s]=t,n[s+1]=r,s+=a}Object.freeze(Object.defineProperty({__proto__:null,fill:i,normalizeIntegerBuffer:a,normalizeIntegerBufferView:n},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>m,b:()=>l,c:()=>s,d:()=>a,e:()=>h,f:()=>d,l:()=>u,n:()=>f,t:()=>i});var o=r(40876),n=(r(44208),r(72727));function a(e,t,r){i(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function i(e,t,r,o=3,a=o){const i=(0,n.k)(e.length,o,3),s=(0,n.k)(t.length,a,3),l=Math.min(i,s),c=r[0],u=r[1],d=r[2],m=r[4],h=r[5],f=r[6],p=r[8],v=r[9],g=r[10],x=r[12],b=r[13],w=r[14];let y=0,M=0;for(let r=0;r<l;r++){const r=t[y],n=t[y+1],i=t[y+2];e[M]=c*r+m*n+p*i+x,e[M+1]=u*r+h*n+v*i+b,e[M+2]=d*r+f*n+g*i+w,y+=a,M+=o}return e}function s(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function l(e,t,r,o=3,a=o){const i=(0,n.k)(e.length,o,3),s=(0,n.k)(t.length,a,3),l=Math.min(i,s),c=r[0],u=r[1],d=r[2],m=r[3],h=r[4],f=r[5],p=r[6],v=r[7],g=r[8];let x=0,b=0;for(let r=0;r<l;r++){const r=t[x],n=t[x+1],i=t[x+2];e[b]=c*r+m*n+p*i,e[b+1]=u*r+h*n+v*i,e[b+2]=d*r+f*n+g*i,x+=a,b+=o}}function c(e,t,r,o=3,n=o){const a=Math.min(e.length/o,t.length/n);let i=0,s=0;for(let l=0;l<a;l++)e[s]=r*t[i],e[s+1]=r*t[i+1],e[s+2]=r*t[i+2],i+=n,s+=o;return e}function u(e,t,r,o){d(e.typedBuffer,t.typedBuffer,r,o,e.typedBufferStride,t.typedBufferStride)}function d(e,t,r,n,a=3,i=a){const s=Math.min(e.length/a,t.length/i);let l=0,c=0;const u=1/o.Tf;for(let o=0;o<s;o++)e[c]=n*(r*t[l])**u,e[c+1]=n*(r*t[l+1])**u,e[c+2]=n*(r*t[l+2])**u,l+=i,c+=a}function m(e,t,r,o=3,a=o){const i=(0,n.k)(e.length,o,3),s=(0,n.k)(t.length,a,3),l=Math.min(i,s);let c=0,u=0;for(let n=0;n<l;n++)e[u]=t[c]+r[0],e[u+1]=t[c+1]+r[1],e[u+2]=t[c+2]+r[2],c+=a,u+=o;return e}function h(e,t){f(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function f(e,t,r=3,o=r){const n=Math.min(e.length/r,t.length/o);let a=0,i=0;for(let s=0;s<n;s++){const n=t[a],s=t[a+1],l=t[a+2],c=n*n+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[i]=t*n,e[i+1]=t*s,e[i+2]=t*l}a+=o,i+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:d,linearToSRGBView:u,normalize:f,normalizeView:h,scale:c,scaleView:function(e,t,r){c(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const o=Math.min(e.count,t.count),n=e.typedBuffer,a=e.typedBufferStride,i=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<o;e++)n[c]=i[l]>>r,n[c+1]=i[l+1]>>r,n[c+2]=i[l+2]>>r,l+=s,c+=a},transformMat3:l,transformMat3View:s,transformMat4:i,transformMat4View:a,translate:m},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>n,ie:()=>l,uC:()=>s});var o=r(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return a(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,o.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+i(this.range,e-t,r)}minimalMonotonic(e,t,r){return a(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,o=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(o)?r:o}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function a(e,t,r,o,n=0,a=!1){return(o-=n)<t?o+=i(e,t-o):o>r&&(o-=i(e,o-r)),a&&o===r&&(o=t),o+n}function i(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const s=new n(0,2*Math.PI),l=(new n(-Math.PI,Math.PI),new n(0,360))},46140(e,t,r){r.d(t,{A:()=>n});var o=r(49186);class n{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new o.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new n(this.major,this.minor,this._context)}static parse(e,t=""){const[r,a]=e.split("."),i=/^\s*\d+\s*$/;if(!r?.match||!i.test(r))throw new o.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!a?.match||!i.test(a))throw new o.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(a,10);return new n(s,l,t)}}},61473(e,t,r){function o(e){return e=e||globalThis.location.hostname,c.some(t=>null!=e?.match(t))}function n(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(i)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>n,b5:()=>o});const a=/^devext\.arcgis\.com$/,i=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,a,i,/^jsapps\.esri\.com$/,s,l]},82534(e,t,r){function o(){return[0,0,0,1]}function n(e){return[e[0],e[1],e[2],e[3]]}r.d(t,{o8:()=>n,vt:()=>o,zK:()=>a});const a=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:a,clone:n,create:o,fromValues:function(e,t,r,o){return[e,t,r,o]}},Symbol.toStringTag,{value:"Module"}))},88340(e,t,r){function o(){return new Float32Array(2)}function n(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function a(){return o()}function i(){return n(1,1)}function s(){return n(1,0)}function l(){return n(0,1)}r.d(t,{Un:()=>u,fA:()=>n,uY:()=>c,vt:()=>o});const c=a(),u=i(),d=s(),m=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:m,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:o,fromValues:n,ones:i,unitX:s,unitY:l,zeros:a},Symbol.toStringTag,{value:"Module"}))},48163(e,t,r){function o(){return[0,0]}function n(e){return[e[0],e[1]]}function a(e,t){return[e,t]}function i(){return a(1,1)}function s(){return a(1,0)}function l(){return a(0,1)}r.d(t,{Un:()=>c,fA:()=>a,o8:()=>n,vt:()=>o});const c=i(),u=s(),d=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:c,UNIT_X:u,UNIT_Y:d,ZEROS:[0,0],clone:n,create:o,freeze:function(e,t){return[e,t]},fromArray:function(e,t=[0,0]){const r=Math.min(2,e.length);for(let o=0;o<r;++o)t[o]=e[o];return t},fromValues:a,ones:i,unitX:s,unitY:l,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},91829(e,t,r){function o(){return[0,0,0,0]}function n(e,t,r,o){return[e,t,r,o]}function a(e,t,r,o){return[e,t,r,o]}function i(){return n(1,1,1,1)}function s(){return n(1,0,0,0)}function l(){return n(0,1,0,0)}function c(){return n(0,0,1,0)}function u(){return n(0,0,0,1)}r.d(t,{CN:()=>a,Un:()=>m,fA:()=>n,uY:()=>d,vt:()=>o});const d=[0,0,0,0],m=i(),h=s(),f=l(),p=c(),v=u();Object.freeze(Object.defineProperty({__proto__:null,ONES:m,UNIT_W:v,UNIT_X:h,UNIT_Y:f,UNIT_Z:p,ZEROS:d,clone:function(e){return[e[0],e[1],e[2],e[3]]},create:o,freeze:a,fromArray:function(e,t=[0,0,0,0]){const r=Math.min(4,e.length);for(let o=0;o<r;++o)t[o]=e[o];return t},fromValues:n,ones:i,unitW:u,unitX:s,unitY:l,unitZ:c,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"}))},78955(e,t,r){r.d(t,{Bw:()=>v,C:()=>n,Cc:()=>w,LI:()=>m,Om:()=>b,S8:()=>x,T9:()=>d,WQ:()=>i,Z0:()=>y,aI:()=>T,hG:()=>p,hZ:()=>a,hs:()=>h,jk:()=>u,m3:()=>g,t2:()=>M});var o=r(34304);function n(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function a(e,t,r,o,n){return e[0]=t,e[1]=r,e[2]=o,e[3]=n,e}function i(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function s(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function l(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function c(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function u(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}function d(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}function m(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function h(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function f(e,t){const r=t[0]-e[0],o=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+o*o+n*n+a*a)}function p(e,t){const r=t[0]-e[0],o=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return r*r+o*o+n*n+a*a}function v(e){const t=e[0],r=e[1],o=e[2],n=e[3];return Math.sqrt(t*t+r*r+o*o+n*n)}function g(e){const t=e[0],r=e[1],o=e[2],n=e[3];return t*t+r*r+o*o+n*n}function x(e,t){const r=t[0],o=t[1],n=t[2],a=t[3];let i=r*r+o*o+n*n+a*a;return i>0&&(i=1/Math.sqrt(i),e[0]=r*i,e[1]=o*i,e[2]=n*i,e[3]=a*i),e}function b(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function w(e,t,r,o){const n=t[0],a=t[1],i=t[2],s=t[3];return e[0]=n+o*(r[0]-n),e[1]=a+o*(r[1]-a),e[2]=i+o*(r[2]-i),e[3]=s+o*(r[3]-s),e}function y(e,t,r){const o=t[0],n=t[1],a=t[2],i=t[3];return e[0]=r[0]*o+r[4]*n+r[8]*a+r[12]*i,e[1]=r[1]*o+r[5]*n+r[9]*a+r[13]*i,e[2]=r[2]*o+r[6]*n+r[10]*a+r[14]*i,e[3]=r[3]*o+r[7]*n+r[11]*a+r[15]*i,e}function M(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function T(e,t){const r=e[0],n=e[1],a=e[2],i=e[3],s=t[0],l=t[1],c=t[2],u=t[3],d=(0,o.FD)();return Math.abs(r-s)<=d*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-l)<=d*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(a-c)<=d*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(i-u)<=d*Math.max(1,Math.abs(i),Math.abs(u))}const S=s,C=l,_=c,I=f,z=p,P=v,O=g;Object.freeze(Object.defineProperty({__proto__:null,add:i,ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e},copy:n,copyVec3:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},dist:I,distance:f,div:_,divide:c,dot:b,equals:T,exactEquals:M,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e},inverse:function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e},len:P,length:v,lerp:w,max:d,min:u,mul:C,multiply:l,negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},normalize:x,random:function(e,t=1){const r=o.Ov;let n,a,i,s,l,c;do{n=2*r()-1,a=2*r()-1,l=n*n+a*a}while(l>=1);do{i=2*r()-1,s=2*r()-1,c=i*i+s*s}while(c>=1);const u=Math.sqrt((1-l)/c);return e[0]=t*n,e[1]=t*a,e[2]=t*i*u,e[3]=t*s*u,e},round:m,scale:h,scaleAndAdd:function(e,t,r,o){return e[0]=t[0]+r[0]*o,e[1]=t[1]+r[1]*o,e[2]=t[2]+r[2]*o,e[3]=t[3]+r[3]*o,e},set:a,sqrDist:z,sqrLen:O,squaredDistance:p,squaredLength:g,str:function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},sub:S,subtract:s,transformMat4:y,transformQuat:function(e,t,r){const o=t[0],n=t[1],a=t[2],i=r[0],s=r[1],l=r[2],c=r[3],u=c*o+s*a-l*n,d=c*n+l*o-i*a,m=c*a+i*n-s*o,h=-i*o-s*n-l*a;return e[0]=u*c+h*-i+d*-l-m*-s,e[1]=d*c+h*-s+m*-i-u*-l,e[2]=m*c+h*-l+u*-s-d*-i,e[3]=t[3],e}},Symbol.toStringTag,{value:"Module"}))},69397(e,t,r){r.d(t,{Qf:()=>l,Qh:()=>i,RS:()=>n,Ul:()=>h,i5:()=>m,lM:()=>a,qK:()=>u});var o=r(34275);const n=16;function a(e){if(!e)return 0;let t=u;for(const r in e)e.hasOwnProperty(r)&&(t+=s(e[r],!1));return t}function i(e){if(!e)return 0;if("number"==typeof e[0])return l(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return c(e,8);let r=d;for(let o=0;o<t;o++)r+=s(e[o]);return r}(e);let t=u;for(const r in e)e.hasOwnProperty(r)&&(t+=s(e[r]));return t}function s(e,t=!0){switch(typeof e){case"object":return t?i(e):u;case"string":return function(e){return 32+e.length}(e);case"number":return n;case"boolean":return 4;default:return 8}}function l(...e){return e.reduce((e,t)=>e+(t?(0,o.iu)(t)?t.byteLength+m:Array.isArray(t)?c(t,n):0:0),0)}function c(e,t){return d+e.length*t}const u=32,d=16,m=145,h=64},65806(e,t,r){r.d(t,{g:()=>i});var o=r(51850),n=r(91218),a=r(9762);function i(e,t,r,o){if((0,n.canProjectWithoutEngine)(e.spatialReference,r))return s[0]=e.x,s[1]=e.y,s[2]=e.z??0,(0,a.projectBuffer)(s,e.spatialReference,0,t,r,0);const i=(0,n.tryProject)(e,r,o);return!!i&&(t[0]=i.x,t[1]=i.y,t[2]=i.z??0,!0)}const s=(0,o.vt)()},27993(e,t,r){r.d(t,{F:()=>s});var o=r(91218),n=r(16930),a=r(9762),i=r(65806);function s(e,t,r,n){return!(null==t||null==n||e.length<2)&&((0,o.canProjectWithoutEngine)(t,n)?(0,a.projectBuffer)(e,t,0,r,n,0,1):(l.x=e[0],l.y=e[1],l.z=e[2],l.spatialReference=t,(0,i.g)(l,r,n)))}const l={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:n.A.WGS84,type:"point"}},72727(e,t,r){function o(e,t,r){if(t<=0)return 0;const o=e-r;return o<0?0:Math.floor(o/t)+1}r.d(t,{k:()=>o}),r(53966)},17136(e,t,r){r.d(t,{Y_:()=>z,O7:()=>_,el:()=>C});var o=r(92602),n=r(69052),a=r(49186),i=r(53966),s=r(39829),l=r(82799),c=r(16930),u=r(80754),d=r(21325),m=r(28735),h=r(11254),f=r(60408),p=r(65864),v=r(2272),g=r(84952),x=r(92300);const b=()=>i.A.getLogger("esri.geometry.support.normalizeUtils");function w(e){return"polygon"===e[0].type}function y(e){return"polyline"===e[0].type}function M(e,t,r){if(t){const t=function(e,t){if(!(e instanceof l.A||e instanceof s.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw b().error(e),new a.A("internal:geometry",e)}const r=(0,u.r8)(e),o=[];for(const e of r){const r=[];o.push(r),r.push([e[0][0],e[0][1]]);for(let o=0;o<e.length-1;o++){const n=e[o][0],a=e[o][1],i=e[o+1][0],s=e[o+1][1],l=Math.sqrt((i-n)*(i-n)+(s-a)*(s-a)),c=(s-a)/l,u=(i-n)/l,d=l/t;if(d>1){for(let e=1;e<=d-1;e++){const o=e*t,i=u*o+n,s=c*o+a;r.push([i,s])}const e=(l+Math.floor(d-1)*t)/2,o=u*e+n,i=c*e+a;r.push([o,i])}r.push([i,s])}}return function(e){return"polygon"===e.type}(e)?new s.A({rings:o,spatialReference:e.spatialReference}):new l.A({paths:o,spatialReference:e.spatialReference})}(e,1e6);e=(0,m.ci)(t,!0)}return r&&(e=(0,u.kS)(e,r)),e}function T(e,t,r){if(Array.isArray(e)){const o=e[0];if(o>t){const r=(0,u.kd)(o,t);e[0]=o+r*(-2*t)}else if(o<r){const t=(0,u.kd)(o,r);e[0]=o+t*(-2*r)}}else{const o=e.x;if(o>t){const r=(0,u.kd)(o,t);e=e.clone().offset(r*(-2*t),0)}else if(o<r){const t=(0,u.kd)(o,r);e=e.clone().offset(t*(-2*r),0)}}return e}function S(e,t){let r=-1;for(let o=0;o<t.cutIndexes.length;o++){const n=t.cutIndexes[o],a=t.geometries[o],i=(0,u.r8)(a);for(let e=0;e<i.length;e++){const t=i[e];t.some(r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const o=t[e][0];r=o>r?o:r}r=Number(r.toFixed(9));const o=-360*(0,u.kd)(r,180);for(let r=0;r<t.length;r++){const t=a.getPoint(e,r);a.setPoint(e,r,t.clone().offset(o,0))}return!0}})}if(n===r){if(w(e))for(const t of(0,u.r8)(a))e[n]=e[n].addRing(t);else if(y(e))for(const t of(0,u.r8)(a))e[n]=e[n].addPath(t)}else r=n,e[n]=a}return e}async function C(e,t,r){if(!Array.isArray(e))return C([e],t);t&&"string"!=typeof t&&b().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??o.A.geometryServiceUrl;let a,i,c,w,y,_,I,z,P=0;const O=[],F=[];for(const t of e)if(null!=t)if(a||(a=t.spatialReference,i=(0,d.Vp)(a),c=a.isWebMercator,_=c?102100:4326,w=u.j7[_].maxX,y=u.j7[_].minX,I=u.j7[_].plus180Line,z=u.j7[_].minus180Line),i)if("mesh"===t.type)F.push(t);else if("point"===t.type)F.push(T(t.clone(),w,y));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>T(e,w,y)),F.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,i);F.push(e.rings?new s.A(e):e)}else if(t.extent){const e=t.extent,r=(0,u.kd)(e.xmin,y)*(2*w);let o=0===r?t.clone():(0,u.kS)(t.clone(),r);e.offset(r,0);let{xmin:n,xmax:a}=e;n=Number(n.toFixed(9)),a=Number(a.toFixed(9)),e.intersects(I)&&a!==w?(P=a>P?a:P,o=M(o,c),O.push(o),F.push("cut")):e.intersects(z)&&n!==y?(P=a*(2*w)>P?a*(2*w):P,o=M(o,c,360),O.push(o),F.push("cut")):F.push(o)}else F.push(t.clone());else F.push(t);else F.push(t);let H=(0,u.kd)(P,w),R=-90;const E=H,j=new l.A;for(;H>0;){const e=360*H-180;j.addPath([[e,R],[e,-1*R]]),R*=-1,H--}if(O.length>0&&E>0){const t=S(O,await async function(e,t,r,o){const n=(0,v.Dl)(e),a=t[0].spatialReference,i={...o,responseType:"json",query:{...n.query,f:"json",sr:(0,d.YX)(a),target:JSON.stringify({geometryType:(0,f.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},s=await(0,h.A)(n.path+"/cut",i),{cutIndexes:l,geometries:c=[]}=s.data;return{cutIndexes:l,geometries:c.map(e=>{const t=(0,p.rS)(e);return t.spatialReference=a,t})}}(n,O,j,r)),o=[],a=[];for(let r=0;r<F.length;r++){const n=F[r];if("cut"!==n)a.push(n);else{const n=t.shift(),i=e[r];null!=i&&"polygon"===i.type&&i.rings&&i.rings.length>1&&n.rings.length>=i.rings.length?(o.push(n),a.push("simplify")):a.push(c?(0,m.Gh)(n):n)}}if(!o.length)return a;const i=await async function(e,t,r){const o="string"==typeof e?(0,g.An)(e):e,n=t[0].spatialReference,a=(0,f.$B)(t[0]),i={...r,query:{...o.query,f:"json",sr:(0,d.YX)(n),geometries:JSON.stringify((0,x.X)(t))}},{data:s}=await(0,h.A)(o.path+"/simplify",i);return(0,x.V)(s.geometries,a,n)}(n,o,r),s=[];for(let e=0;e<a.length;e++){const t=a[e];"simplify"!==t?s.push(t):s.push(c?(0,m.Gh)(i.shift()):i.shift())}return s}const N=[];for(let e=0;e<F.length;e++){const t=F[e];if("cut"!==t)N.push(t);else{const e=O.shift();N.push(!0===c?(0,m.Gh)(e):e)}}return N}function _(e,t,r){const o=(0,d.Vp)(r);if(null==o)return e;const[n,a]=o.valid,i=2*a;let s=0,l=0;t>a?s=Math.ceil(Math.abs(t-a)/i):t<n&&(s=-Math.ceil(Math.abs(t-n)/i)),e>a?l=Math.ceil(Math.abs(e-a)/i):e<n&&(l=-Math.ceil(Math.abs(e-n)/i));let c=e+(s-l)*i;const u=c-t;return u>a?c-=i:u<n&&(c+=i),c}function I(e){const t=(0,d.Vp)(e);if(null==t)return null;const[r,o]=t.valid;return new n.hr(r,o)}const z=I(c.A.WGS84);I(c.A.WebMercator)},80754(e,t,r){r.d(t,{j7:()=>i,kS:()=>l,kd:()=>s,r8:()=>c});var o=r(82799),n=r(16930),a=r(60408);const i={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new o.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator}),minus180Line:new o.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new o.A({paths:[[[180,-180],[180,180]]],spatialReference:n.A.WGS84}),minus180Line:new o.A({paths:[[[-180,-180],[-180,180]]],spatialReference:n.A.WGS84})}};function s(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const r=c(e);for(const e of r)for(const r of e)r[0]+=t;return e}function c(e){return(0,a.Bi)(e)?e.rings:e.paths}},27921(e,t,r){r.d(t,{$Q:()=>w,C:()=>s,Cr:()=>u,O_:()=>c,Qj:()=>l,T7:()=>x,Tj:()=>b,lU:()=>d,mN:()=>y,vE:()=>M,vt:()=>i});var o=r(34727),n=r(35522),a=r(51850);function i(e=T){return[e[0],e[1],e[2],e[3]]}function s(e,t){return function(e,t,r,o,n=i()){return n[0]=e,n[1]=t,n[2]=r,n[3]=o,n}(t[0],t[1],t[2],t[3],e)}function l(e){return e}function c(e,t,r){const o=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=Math.abs(o-1)>1e-5&&o>1e-12?1/Math.sqrt(o):1;return r[0]=t[0]*n,r[1]=t[1]*n,r[2]=t[2]*n,r[3]=-(r[0]*e[0]+r[1]*e[1]+r[2]*e[2]),r}function u(e,t,r,o=i()){const n=r[0]-t[0],a=r[1]-t[1],s=r[2]-t[2],l=e[0]-t[0],c=e[1]-t[1],u=e[2]-t[2],d=a*u-s*c,m=s*l-n*u,h=n*c-a*l,f=d*d+m*m+h*h,p=Math.abs(f-1)>1e-5&&f>1e-12?1/Math.sqrt(f):1;return o[0]=d*p,o[1]=m*p,o[2]=h*p,o[3]=-(o[0]*e[0]+o[1]*e[1]+o[2]*e[2]),o}function d(e,t,r,o=0,a=Math.floor(r*(1/3)),i=Math.floor(r*(2/3))){if(r<3)return!1;t(h,o);let s=a,l=!1;for(;s<r-1&&!l;)t(f,s),s++,l=!(0,n.t2)(h,f);if(!l)return!1;for(s=Math.max(s,i),l=!1;s<r&&!l;)t(p,s),s++,(0,n.Re)(v,h,f),(0,n.S8)(v,v),(0,n.Re)(g,f,p),(0,n.S8)(g,g),l=!(0,n.t2)(h,p)&&!(0,n.t2)(f,p)&&Math.abs((0,n.Om)(v,g))<m;return l?(u(h,f,p,e),!0):(0!==o||1!==a||2!==i)&&d(e,t,r,0,1,2)}r(78955),r(44280),r(32114),r(32728);const m=.99619469809,h=(0,a.vt)(),f=(0,a.vt)(),p=(0,a.vt)(),v=(0,a.vt)(),g=(0,a.vt)();function x(e,t,r){return function(e){return 0===e||1===e}(M(e,t.origin,t.vector,0,r))}function b(e,t){return y(e,t)>=0}function w(e,t){const r=(0,n.Om)(e,t.ray.direction),o=-y(e,t.ray.origin);if(o<0&&r>=0)return!1;if(r>-1e-6&&r<1e-6)return o>0;if((o<0||r<0)&&!(o<0&&r<0))return!0;const a=o/r;return r>0?a<t.c1&&(t.c1=a):a>t.c0&&(t.c0=a),t.c0<=t.c1}function y(e,t){return(0,n.Om)(e,t)+e[3]}function M(e,t,r,a,i){const s=(0,n.Om)(e,r),l=y(e,t);if(0===s)return l>=0?2:3;let c=-l/s;return 1&a&&(c=(0,o.qE)(c,0,1)),!(4&a)&&c<0||!(8&a)&&c>1?l>=0?2:3:((0,n.WQ)(i,t,(0,n.hs)(i,r,c)),l>=0?0:1)}const T=[0,0,1,0]},44280(e,t,r){r.d(t,{g7:()=>s,gr:()=>i});var o=r(34727),n=r(35522),a=r(51850);function i(e,t){return(0,n.Om)(e,t)/(0,n.Bw)(e)}function s(e,t){const r=(0,n.Om)(e,t)/((0,n.Bw)(e)*(0,n.Bw)(t));return-(0,o.XM)(r)}(0,a.vt)(),(0,a.vt)()},32114(e,t,r){r.d(t,{Rc:()=>h,J8:()=>f,rq:()=>d,Km:()=>m}),r(44208);var o=r(26390),n=r(29242),a=r(9093),i=r(82534),s=r(48163),l=r(51850),c=r(91829);class u{constructor(e){this._create=e,this._items=new Array,this._itemsPtr=0}get(){return 0===this._itemsPtr&&(0,o.d)(()=>this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const e=2*this._itemsPtr;this._items.length>e&&(this._items.length=e),this._itemsPtr=0}static createVec2f64(){return new u(s.vt)}static createVec3f64(){return new u(l.vt)}static createVec4f64(){return new u(c.vt)}static createMat3f64(){return new u(n.vt)}static createMat4f64(){return new u(a.vt)}static createQuatf64(){return new u(i.vt)}get test(){}}u.createVec2f64();const d=u.createVec3f64(),m=u.createVec4f64(),h=(u.createMat3f64(),u.createMat4f64()),f=u.createQuatf64()},38969(e,t,r){r.d(t,{i:()=>n});var o=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,o.Oo)(e,"canplay",r)),t((0,o.Oo)(e,"error",n)))})}},92300(e,t,r){r.d(t,{V:()=>i,X:()=>a});var o=r(60408),n=r(65864);function a(e){return{geometryType:(0,o.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function i(e,t,r){const o=(0,n.xD)(t);return e.map(e=>{const t=o.fromJSON(e);return t.spatialReference=r,t})}},21015(e,t,r){r.d(t,{R:()=>l});var o=r(11254),n=r(60999),a=r(49186),i=r(17676),s=r(84952);class l{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,s.DB)(e)?((0,i.Te)(t),(0,s.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);const s=await(0,n.Ke)((0,o.A)(t,{responseType:e,...r}));if(s.ok)return s.value.data;throw(0,i.QP)(s.error),new a.A("gltf-loader-request-error",`Request for resource failed: ${s.error}`)}}},84498(e,t,r){r.d(t,{x:()=>i});var o=r(34275),n=r(97146),a=r(63907);function i(e,t){switch(t){case a.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,n.tM)(e):(0,o.mg)(e)?new Uint16Array(e):e}(e);case a.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,o=(0,n.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(o[e++]=t,o[e++]=t+1,o[e++]=t+2):(o[e++]=t+1,o[e++]=t,o[e++]=t+2)}else{let t=0;for(let n=0;n<r;n+=1)n%2==0?(o[t++]=e[n],o[t++]=e[n+1],o[t++]=e[n+2]):(o[t++]=e[n+1],o[t++]=e[n],o[t++]=e[n+2])}return o}(e);case a.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,o=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)o[e++]=0,o[e++]=t+1,o[e++]=t+2;return o}const n=e[0];let a=e[1],i=0;for(let t=0;t<r;++t){const r=e[t+2];o[i++]=n,o[i++]=a,o[i++]=r,a=r}return o}(e)}}},51530(e,t,r){r.d(t,{KB:()=>i,Xi:()=>n,pn:()=>s,x3:()=>a});var o=r(44208);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function a(e){return"encoded-mesh-texture"===e?.type}async function i(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function s(e,t){if("image/ktx2"===t)return new n(e);const r=new Blob([e],{type:t});let a=URL.createObjectURL(r);switch(t){case"image/jpeg":a+="#.jpg";break;case"image/png":a+="#.png"}const i=new Image;if((0,o.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{n(),e(i)},o=e=>{n(),t(e)},n=()=>{URL.revokeObjectURL(a),i.removeEventListener("load",r),i.removeEventListener("error",o)};i.addEventListener("load",r),i.addEventListener("error",o),i.src=a});try{i.src=a,await i.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(a),i}},5644(e,t,r){r.d(t,{fetch:()=>wt});var o=r(40876),n=r(61473),a=r(34727),i=r(77690),s=r(29242),l=r(58083),c=r(9093),u=r(48163),d=r(35522),m=r(51850),h=r(70328),f=r(34275);function p(e,t=!1){return e<=f.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var v=r(13030),g=r(73354),x=r(50867),b=r(43609),w=r(21015),y=r(84498),M=r(51530),T=r(88340);function S(e){if(null==e)return null;const t=null!=e.offset?e.offset:T.uY,r=null!=e.rotation?e.rotation:0,o=null!=e.scale?e.scale:T.Un,n=(0,s.fA)(1,0,0,0,1,0,t[0],t[1],1),a=(0,s.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,s.fA)(o[0],0,0,0,o[1],0,0,0,1),c=(0,s.vt)();return(0,i.lw)(c,a,l),(0,i.lw)(c,n,c),c}class C{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class _{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new C,this.numberOfVertices=0}}var I=r(11254),z=r(60999),P=r(49186),O=r(53966),F=r(69397);class H{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(const t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){const o=this._outer.get(e);o?o.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){const r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(const e of this._outer)yield e}*values(){for(const e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(const[e,t]of this._outer)for(const[r,o]of t)yield[e,r,o]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,o)=>e(t,r,o)))}copy(){const e=new H;return this.forAll((t,r,o)=>e.set(r,o,t)),e}}var R=r(17676),E=r(46140),j=r(97146),N=r(31217),A=r(46610),D=r(63500),B=r(18845),V=r(49255),L=r(97768),G=r(92130),W=r(65786);class k extends G.A{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,e=>this._textureNormal=e),this._acquire(e.emissiveTextureId,e=>this._textureEmissive=e),this._acquire(e.occlusionTextureId,e=>this._textureOcclusion=e),this._acquire(e.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){super.dispose(),this._texture=(0,L.Gz)(this._texture),this._textureNormal=(0,L.Gz)(this._textureNormal),this._textureEmissive=(0,L.Gz)(this._textureEmissive),this._textureOcclusion=(0,L.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,L.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new q(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,L.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,R.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,L.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class U extends W.Y{constructor(e=null){super(),this.textureEmissive=e}}class q extends U{constructor(e,t,r,o,n,a,i){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=o,this.textureMetallicRoughness=n,this.scale=a,this.normalTextureTransformMatrix=i}}var Z=r(11725),$=r(620);class Y{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const J=(0,h.vt)();function K(e,t,r,o,n,a){if(!e.visible)return;const i=(0,d.jb)(ue,o,r),{tolerance:s}=t,l=new Y(s,!1,t.options.normalRequired);if(e.boundingInfo)(0,$.vA)(0===e.type),Q(e.boundingInfo,r,i,s,n,l,a);else{const t=e.positionAttribute,o=e.primitivePositionIndices;!function(e,t,r,o,n,a,i,s,l,c){const u=t,m=de,h=Math.abs(u[0]),f=Math.abs(u[1]),p=Math.abs(u[2]),v=h>=f?h>=p?0:2:f>=p?1:2,g=v,x=u[g]<0?2:1,b=(v+x)%3,w=(v+(3-x))%3,y=u[b]/u[g],M=u[w]/u[g],T=1/u[g],S=te,C=re,_=oe,{normalRequired:I}=l;for(let t=r;t<o;++t){const r=3*t,o=i*n[r];(0,d.hZ)(m[0],a[o+0],a[o+1],a[o+2]);const l=i*n[r+1];(0,d.hZ)(m[1],a[l+0],a[l+1],a[l+2]);const u=i*n[r+2];(0,d.hZ)(m[2],a[u+0],a[u+1],a[u+2]),s&&((0,d.C)(m[0],s.applyToVertex(m[0][0],m[0][1],m[0][2],t)),(0,d.C)(m[1],s.applyToVertex(m[1][0],m[1][1],m[1][2],t)),(0,d.C)(m[2],s.applyToVertex(m[2][0],m[2][1],m[2][2],t))),(0,d.jb)(S,m[0],e),(0,d.jb)(C,m[1],e),(0,d.jb)(_,m[2],e);const h=S[b]-y*S[g],f=S[w]-M*S[g],p=C[b]-y*C[g],v=C[w]-M*C[g],x=_[b]-y*_[g],z=_[w]-M*_[g],P=x*v-z*p,O=h*z-f*x,F=p*f-v*h;if((P<0||O<0||F<0)&&(P>0||O>0||F>0))continue;const H=P+O+F;if(0===H)continue;const R=P*(T*S[g])+O*(T*C[g])+F*(T*_[g]);if(R*Math.sign(H)<0)continue;const E=R/H;E>=0&&c(E,I?ae(m):null,t)}}(r,i,0,o.length/3,o,t.data,t.stride,n,l,a)}}const X=(0,m.vt)();function Q(e,t,r,o,n,a,i){if(null==e)return;const s=function(e,t){return(0,d.hZ)(t,1/e[0],1/e[1],1/e[2])}(r,X);if((0,h.Ne)(J,e.bbMin),(0,h.vI)(J,e.bbMax),null!=n&&n.applyToAabb(J),function(e,t,r,o){return function(e,t,r,o){const n=(e[0]-o-t[0])*r[0],a=(e[3]+o-t[0])*r[0];let i=Math.min(n,a),s=Math.max(n,a);const l=(e[1]-o-t[1])*r[1],c=(e[4]+o-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(i=Math.max(i,Math.min(l,c)),i>s)return!1;const u=(e[2]-o-t[2])*r[2],d=(e[5]+o-t[2])*r[2];return s=Math.min(s,Math.max(u,d)),!(s<0)&&(i=Math.max(i,Math.min(u,d)),!(i>s)&&i<1/0)}(e,t,r,o)}(J,t,s,o)){const{primitiveIndices:s,position:l}=e,c=s?s.length:l.indices.length/3;if(c>le){const s=e.getChildren();if(void 0!==s){for(const e of s)Q(e,t,r,o,n,a,i);return}}!function(e,t,r,o,n,a,i,s,l,c,u){const d=e[0],m=e[1],h=e[2],f=t[0],p=t[1],v=t[2],{normalRequired:g}=c;for(let e=0;e<o;++e){const t=s[e],r=3*t,o=i*n[r];let c=a[o],x=a[o+1],b=a[o+2];const w=i*n[r+1];let y=a[w],M=a[w+1],T=a[w+2];const S=i*n[r+2];let C=a[S],_=a[S+1],I=a[S+2];null!=l&&([c,x,b]=l.applyToVertex(c,x,b,e),[y,M,T]=l.applyToVertex(y,M,T,e),[C,_,I]=l.applyToVertex(C,_,I,e));const z=y-c,P=M-x,O=T-b,F=C-c,H=_-x,R=I-b,E=p*R-H*v,j=v*F-R*f,N=f*H-F*p,A=z*E+P*j+O*N;if(Math.abs(A)<=ce)continue;const D=d-c,B=m-x,V=h-b,L=D*E+B*j+V*N;if(A>0){if(L<0||L>A)continue}else if(L>0||L<A)continue;const G=B*O-P*V,W=V*z-O*D,k=D*P-z*B,U=f*G+p*W+v*k;if(A>0){if(U<0||L+U>A)continue}else if(U>0||L+U<A)continue;const q=(F*G+H*W+R*k)/A;q>=0&&u(q,g?ne(z,P,O,F,H,R,ee):null,t)}}(t,r,0,c,l.indices,l.data,l.stride,s,n,a,i)}}const ee=(0,m.vt)();const te=(0,m.vt)(),re=(0,m.vt)(),oe=(0,m.vt)();function ne(e,t,r,o,n,a,i){return(0,d.hZ)(ie,e,t,r),(0,d.hZ)(se,o,n,a),(0,d.$A)(i,ie,se),(0,d.S8)(i,i),i}function ae(e){return(0,d.jb)(ie,e[1],e[0]),(0,d.jb)(se,e[2],e[0]),(0,d.$A)(ee,ie,se),(0,d.S8)(ee,ee),ee}const ie=(0,m.vt)(),se=(0,m.vt)(),le=1e3,ce=1e-7,ue=(0,m.vt)(),de=[(0,m.vt)(),(0,m.vt)(),(0,m.vt)()];var me=r(16396),he=r(59907);class fe{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,o,n,a){return(0,he.vJ)(r,o,this.layout,e,t,n,a)}}var pe=r(33442),ve=r(43616),ge=r(5482),xe=r(91429),be=r(91829),we=r(4431),ye=r(1843),Me=r(72824),Te=r(13840),Se=r(98958),Ce=r(16943),_e=r(33524),Ie=r(56133),ze=r(4576);r(66289);var Pe=r(69622),Oe=r(65529),Fe=r(32728);class He{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",v.Eq),this.color=e.getField("instanceColor",v.XP),this.olidColor=e.getField("instanceOlidColor",v.XP),this.state=e.getField("state",v.SL),this.lodLevel=e.getField("lodLevel",v.SL)}}let Re=class extends Pe.A{constructor(e,t){super(e),this.events=new Oe.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return je(Ee.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=Ve,this._buffer=this._layout.createBuffer(this._capacity),this._view=new He(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,$.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,$.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=Ne,o=Ae;t.localTransform.getMat(e,De),t.globalTransform.getMat(e,Be);const n=(0,l.lw)(Be,Be,De);(0,d.hZ)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,i.z0)(o,n),t.model.setMat(e,o);const a=(0,Fe.wp)(Ne,n);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,i.B8)(o,o),(0,i.mg)(o,o),t.modelNormal.setMat(e,o),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,Ae),r.modelOrigin.getVec(e,Ne),t[0]=Ae[0],t[1]=Ae[1],t[2]=Ae[2],t[3]=0,t[4]=Ae[3],t[5]=Ae[4],t[6]=Ae[5],t[7]=0,t[8]=Ae[6],t[9]=Ae[7],t[10]=Ae[8],t[11]=0,t[12]=Ne[0],t[13]=Ne[1],t[14]=Ne[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Ne,this,e),t*=Math.max(Ne[0],Ne[1],Ne[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Ne,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(Ne[0],Ne[1],Ne[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,o=r.get(e);t?t!==o&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):o&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(Ve,Math.floor(this._capacity*ze.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new He(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,ge.Cg)([(0,xe.MZ)({constructOnly:!0})],Re.prototype,"shaderTransformation",void 0),(0,ge.Cg)([(0,xe.MZ)()],Re.prototype,"_size",void 0),(0,ge.Cg)([(0,xe.MZ)({readOnly:!0})],Re.prototype,"size",null),Re=(0,ge.Cg)([(0,xe.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],Re);const Ee=(0,ye.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function je(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,Ce.E)()&&e.vec4u8("instanceOlidColor"),e}const Ne=(0,m.vt)(),Ae=(0,s.vt)(),De=(0,c.vt)(),Be=(0,c.vt)(),Ve=64,Le=(0,ye.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var Ge=r(74810),We=r(28491),ke=r(90644),Ue=r(49788);class qe extends Me.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Ge.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=m.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,m.CN)(.2,.2,.2),this.diffuse=(0,m.CN)(.8,.8,.8),this.externalColor=(0,be.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,m.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=Ue.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}Me.gy;let Ze=class extends Se.w{constructor(e,t){let o=(0,we.U)(Je(t));t.instanced&&t.instancedDoublePrecision&&(o=o.concat((0,we.U)(function(e){return je(Le.clone(),e)}(t)))),super(e,t,o),this.shader=new Te.r(We.D,()=>r.e(5141).then(r.bind(r,5141))),this.ignoreUnused=!0}_makePipeline(e,t){const{output:r,transparent:o,cullFace:n,customDepthTest:a,hasOccludees:i}=e;return(0,ke.Ey)({blending:o?(0,_e.Yf)(r):null,culling:Ye(e)?(0,ke.Xt)(n):null,depthTest:(0,_e.mt)(r,$e(a)),depthWrite:(0,_e.z5)(e),colorWrite:ke.kn,stencilWrite:i?Ie.v0:null,stencilTest:i?t?Ie.a9:Ie.qh:null,polygonOffset:(0,pe.sG)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function $e(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function Ye(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Je(e){const t=(0,ye.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,Ce.E)()&&t.vec4u8("olidColor"),t}Ze=(0,ge.Cg)([(0,xe.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],Ze);var Ke=r(51976),Xe=r(47724);class Qe extends Xe.L{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.hasShadowHighlights=!1,this.receiveAmbientOcclusion=!1,this.receiveGlobalIllumination=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,ge.Cg)([(0,Ke.W)({count:4})],Qe.prototype,"alphaDiscardMode",void 0),(0,ge.Cg)([(0,Ke.W)({count:3})],Qe.prototype,"doubleSidedMode",void 0),(0,ge.Cg)([(0,Ke.W)({count:7})],Qe.prototype,"pbrMode",void 0),(0,ge.Cg)([(0,Ke.W)({count:3})],Qe.prototype,"cullFace",void 0),(0,ge.Cg)([(0,Ke.W)({count:3})],Qe.prototype,"normalType",void 0),(0,ge.Cg)([(0,Ke.W)({count:3})],Qe.prototype,"customDepthTest",void 0),(0,ge.Cg)([(0,Ke.W)({count:8})],Qe.prototype,"emissionSource",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasVertexColors",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasSymbolColors",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasVerticalOffset",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasColorTexture",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasMetallicRoughnessTexture",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasOcclusionTexture",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasNormalTexture",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasScreenSizePerspective",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasVertexTangents",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasOccludees",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"instanced",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"instancedDoublePrecision",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasModelTransformation",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"offsetBackfaces",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasVVSize",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasVVColor",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"receiveShadows",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasShadowHighlights",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"receiveAmbientOcclusion",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"receiveGlobalIllumination",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"textureAlphaPremultiplied",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"instancedFeatureAttribute",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"instancedColor",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"writeDepth",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"terrainDepthTest",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"cullAboveTerrain",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"snowCover",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasColorTextureTransform",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasEmissionTextureTransform",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasNormalTextureTransform",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasOcclusionTextureTransform",void 0),(0,ge.Cg)([(0,Ke.W)()],Qe.prototype,"hasMetallicRoughnessTextureTransform",void 0);var et=r(57323);let tt=class extends Ze{constructor(){super(...arguments),this.shader=new Te.r(et.R,()=>r.e(2314).then(r.bind(r,39933)))}};tt=(0,ge.Cg)([(0,xe.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],tt);class rt extends Ke.K{constructor(){super(...arguments),this.receiveShadows=!0}}(0,ge.Cg)([(0,Ke.W)()],rt.prototype,"receiveShadows",void 0);class ot extends Z.i{constructor(e,t){super(e,at),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(0,V.uw)(e)&&!this.transparent],[4,e=>(0,V.uw)(e)&&this.transparent&&this.parameters.writeDepth],[9,e=>(0,V.uw)(e)&&this.transparent&&!this.parameters.writeDepth]]),this._layout=Je(this.parameters),this._configuration=new Qe(t.spherical)}isVisibleForOutput(e){return 5!==e&&7!==e&&6!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:o}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(o[3])?1:o[3])>=Ue.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,d.t2)(this.parameters.emissiveBaseColor,m.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)?this.transparent?2:1:0}updateConfiguration(e){super.updateConfiguration(e);const{parameters:t,_configuration:r}=this;r.hasNormalTexture=t.hasNormalTexture,r.hasColorTexture=t.hasColorTexture,r.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,r.hasOcclusionTexture=t.hasOcclusionTexture;const{treeRendering:o,doubleSided:n,doubleSidedType:a}=t;r.hasVertexTangents=!o&&t.hasVertexTangents,r.instanced=t.instanced,r.instancedDoublePrecision=t.instancedDoublePrecision,r.hasVVColor=!!t.vvColor,r.hasVVSize=!!t.vvSize,r.hasVerticalOffset=null!=t.verticalOffset,r.hasScreenSizePerspective=null!=t.screenSizePerspective,r.hasSlicePlane=t.hasSlicePlane,r.alphaDiscardMode=t.textureAlphaMode,r.normalType=o?0:t.normalType,r.transparent=this.transparent,r.enableOITOffset=e.enableOITOffset,r.writeDepth=t.writeDepth,r.customDepthTest=t.customDepthTest??0,r.hasOccludees=e.hasOccludees,r.cullFace=t.hasSlicePlane?0:t.cullFace,r.cullAboveTerrain=e.cullAboveTerrain,r.hasModelTransformation=!o&&null!=t.modelTransformation,r.hasVertexColors=t.hasVertexColors,r.hasSymbolColors=t.hasSymbolColors,r.doubleSidedMode=o?2:n&&"normal"===a?1:n&&"winding-order"===a?2:0,r.instancedFeatureAttribute=t.instancedFeatureAttribute,r.instancedColor=t.instancedColor,(0,V._o)(e.output)?(r.terrainDepthTest=e.terrainDepthTest,r.receiveShadows=t.receiveShadows,r.hasShadowHighlights=function(e,t){return e.receiveShadows&&null!=t.shadowHighlight?.getTexture()}(r,e),r.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=e.ssao,r.receiveGlobalIllumination=t.receiveAmbientOcclusion&&null!=e.globalIllumination):(r.terrainDepthTest=!1,r.receiveShadows=r.hasShadowHighlights=r.receiveAmbientOcclusion=!1),r.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,r.pbrMode=t.usePBR?t.isSchematic?2:1:0,r.emissionSource=t.emissionSource,r.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),r.snowCover=e.snowCover>0,r.hasColorTextureTransform=!!t.colorTextureTransformMatrix,r.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,r.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,r.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,r.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix}intersect(e,t,r,o,n,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,d.hZ)(dt,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,d.S8)(ct,dt);break;case 2:a=(0,d.C)(ct,lt)}const i=(0,d.Re)(mt,dt,e.eye),s=(0,d.Bw)(i),l=(0,d.hs)(i,i,1/s);let c=null;this.parameters.screenSizePerspective&&(c=(0,d.Om)(a,l));const u=(0,ve.kE)(e,s,this.parameters.verticalOffset,c??0,this.parameters.screenSizePerspective,null);(0,d.hs)(a,a,u),(0,d.ei)(ut,a,r.transform.inverseRotation),o=(0,d.Re)(it,o,ut),n=(0,d.Re)(st,n,ut)}a=(0,pe.b6)(a,this._configuration,o,n),K(e,r,o,n,(0,me.ou)(r.verticalOffset),a)}createGLMaterial(e){return new nt(e)}createBufferWriter(){return new fe(this._layout)}get transparent(){return function(e){const{drivenOpacity:t,opacity:r,externalColor:o,layerOpacity:n,texture:a,textureId:i,textureAlphaMode:s,colorMixMode:l}=e,c=o[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||n<1||(null!=a||null!=i)&&1!==s&&2!==s&&"replace"!==l}(this.parameters)}}class nt extends k{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,d.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?tt:Ze,e)}}class at extends qe{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const it=(0,m.vt)(),st=(0,m.vt)(),lt=(0,m.fA)(0,0,1),ct=(0,m.vt)(),ut=(0,m.vt)(),dt=(0,m.vt)(),mt=(0,m.vt)(),ht=()=>O.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class ft{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function pt(e){const t=e.params,r=t.topology;let o=!0;switch(t.vertexAttributes||(ht().warn("Geometry must specify vertex attributes"),o=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(ht().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),o=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(ht().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),o=!1)):(ht().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),o=!1)}}else ht().warn("Indexed geometries must specify faces"),o=!1;break}default:ht().warn(`Unsupported topology '${r}'`),o=!1}e.params.material||(ht().warn("Geometry requires material"),o=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(ht().warn("Geometries with externally defined attributes are not yet supported"),o=!1);return o}function vt(e){const t=(0,h.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&((0,h.iT)(t,r.bbMin),(0,h.iT)(t,r.bbMax))}),t}function gt(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function xt(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const bt=new E.A(1,2,"wosr");async function wt(e,t){const s=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,n.EM)(e));if("wosr"===s.fileType){const e=await(t.cache?t.cache.loadWOSR(s.url,t):async function(e,t){const r=await async function(e,t){const r=await(0,z.Ke)((0,I.A)(e,t));if(r.ok)return r.value.data;(0,R.QP)(r.error),function(e){throw new P.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),o=await async function(e,t){const r=new Array;for(const o in e){const n=e[o],a=n.images[0].data;if(!a){ht().warn("Externally referenced texture data is not yet supported");continue}const i=n.encoding+";base64,"+a,s="/textureDefinitions/"+o,l="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==gt(l)},u=t?.disableTextures?Promise.resolve(null):(0,N.D)(i,t);r.push(u.then(e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l})))}const o=await Promise.all(r),n={};for(const e of o)n[e.refId]=e;return n}(r.textureDefinitions??{},t);let n=0;for(const e in o)if(o.hasOwnProperty(e)){const t=o[e];n+=t?.image?t.image.width*t.image.height*4:0}return new ft(r,o,n+(0,F.Qh)(r))}(s.url,t)),{engineResources:r,referenceBoundingBox:o}=function(e,t){const r=new Array,o=new Array,n=new Array,a=new H,i=e.resource,s=E.A.parse(i.version||"1.0","wosr");bt.validate(s);const l=i.model.name,c=i.model.geometries,u=i.materialDefinitions??{},d=e.textures;let h=0;const f=new Map;for(let e=0;e<c.length;e++){const i=c[e];if(!pt(i))continue;const s=xt(i),l=i.params.vertexAttributes,p=[],v=e=>{if("PerAttributeArray"===i.params.topology)return null;const t=i.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l.position,x=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,o=v(e)??(0,j.tM)(x);p.push([e,new A.n(r,o,t.valuesPerElement,!0)])}const b=s.texture,w=d&&d[b];if(w&&!f.has(b)){const{image:e,parameters:t}=w,r=new B.h(e,t);o.push(r),f.set(b,r)}const y=f.get(b),M=y?y.id:void 0,T=s.material;let S=a.get(T,b);if(null==S){const e=u[T.slice(T.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=w?gt(w.alphaChannelUsage):void 0,o={ambient:(0,m.ci)(e.diffuse),diffuse:(0,m.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:M,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:w?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(o,t.materialParameters),S=new ot(o,t),a.set(T,b,S)}n.push(S);const C=new D.V(S,p);h+=p.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(C)}return{engineResources:[{name:l,stageResources:{textures:o,materials:n,geometries:r},pivotOffset:i.model.pivotOffset,numberOfVertices:h,lodThreshold:null}],referenceBoundingBox:vt(r)}}(e,t);return{lods:r,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}let f;if(t.cache)f=await t.cache.loadGLTF(s.url,t,!!t.usePBR,!!t.useEmissive);else{const{loadGLTF:e}=await r.e(1698).then(r.bind(r,51698));f=await e(new w.R,s.url,t,t.usePBR,t.useEmissive)}const{engineResources:T,referenceBoundingBox:C}=function(e,t,r){const n=e.model,s=e.meta,f=n.meta?.ESRI_proxyEllipsoid,w=s.isEsriSymbolResource&&null!=f&&"EsriRealisticTreesStyle"===s.ESRI_webstyle;w&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const n=e.model.lods[r];for(const a of n.parts){const n=a.attributes.normal;if(null==n)return;const i=a.attributes.position,s=i.count,u=(0,m.vt)(),h=(0,m.vt)(),f=(0,m.vt)(),p=new Float32Array(4*s),g=new Float32Array(3*s),x=(0,l.B8)((0,c.vt)(),a.transform);let b=0,w=0;for(let l=0;l<s;l++){i.getVec(l,h),n.getVec(l,u),(0,d.Z0)(h,h,a.transform),(0,d.Re)(f,h,t.center),(0,d.Qr)(f,f,t.radius);const s=f[2],c=(0,d.Bw)(f),m=Math.min(.45+.55*c*c,1)**o.Tf;(0,d.Qr)(f,f,t.radius),null!==x&&(0,d.Z0)(f,f,x),(0,d.S8)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.Cc)(f,f,u,s>-1?.2:Math.min(-4*s-3.8,1)),g[b]=f[0],g[b+1]=f[1],g[b+2]=f[2],b+=3,p[w]=m,p[w+1]=m,p[w+2]=m,p[w+3]=1,w+=4}a.attributes.normal=new v.xs(g.buffer),a.attributes.color=new v.Eq(p.buffer)}}}(e,f));const T=!!t.usePBR,C=s.isEsriSymbolResource?{usePBR:T,isSchematic:!1,treeRendering:w,mrrFactors:Ge.SY}:{usePBR:T,isSchematic:!1,treeRendering:!1,mrrFactors:Ge.mb},I={...t.materialParameters,treeRendering:w},z=new Array,P=new Map,O=new Map,F=n.lods.length,H=(0,h.Ie)();return n.lods.forEach((e,s)=>{const l=!0===t.skipHighLods&&(F>1&&0===s||F>3&&1===s)||!1===t.skipHighLods&&null!=r&&s!==r;if(l&&0!==s)return;const c=new _(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const r=l?new ot({},t):function(e,t,r,n,a,i,s,l,c){const d=e.materials.get(t.material);if(null==d)return null;const{normal:m,color:h,texCoord0:f,tangent:p}=t.attributes,v=t.material+(m?"_normal":"")+(h?"_color":"")+(f?"_texCoord0":"")+(p?"_tangent":""),g=null!=t.attributes.texCoord0,x=null!=t.attributes.normal,b=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(d.alphaMode);if(!i.has(v)){if(g){const t=(t,r=!1,o=!1)=>{if(null!=t&&!s.has(t)){const n=e.textures.get(t);if(n){const e=n.data,a=r&&!(0,M.x3)(e)?l.compressionOptions:void 0;s.set(t,new B.h((0,M.x3)(e)?e.data:e,{...n.parameters,preMultiplyAlpha:!(0,M.x3)(e)&&o,encoding:(0,M.x3)(e)?e.encoding:void 0,compressionOptions:a}))}}},r=1!==b&&!c;t(d.colorTexture,r,1!==b),t(d.normalTexture),t(d.occlusionTexture,!0),t(d.emissiveTexture),t(d.metallicRoughnessTexture,!0)}const r=(0,o.xV)(d.color[0]),m=(0,o.xV)(d.color[1]),h=(0,o.xV)(d.color[2]),f=null!=d.colorTexture&&g?s.get(d.colorTexture):null,p=(0,Ge.Jr)(d),w=null!=d.normalTextureTransform?.scale?d.normalTextureTransform?.scale:u.Un;i.set(v,new ot({...n,customDepthTest:1,textureAlphaMode:b,textureAlphaCutoff:d.alphaCutoff,diffuse:[r,m,h],ambient:[r,m,h],opacity:"OPAQUE"===d.alphaMode?1:d.opacity,doubleSided:d.doubleSided,doubleSidedType:"winding-order",cullFace:d.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:x?0:2,castShadows:!0,receiveShadows:d.receiveShadows,receiveAmbientOcclusion:d.receiveAmbientOcclusion,textureId:null!=f?f.id:void 0,colorMixMode:d.colorMixMode,normalTextureId:null!=d.normalTexture&&g?s.get(d.normalTexture).id:void 0,textureAlphaPremultiplied:null!=f&&!!f.parameters.preMultiplyAlpha,occlusionTextureId:null!=d.occlusionTexture&&g?s.get(d.occlusionTexture).id:void 0,emissiveTextureId:null!=d.emissiveTexture&&g?s.get(d.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=d.metallicRoughnessTexture&&g?s.get(d.metallicRoughnessTexture).id:void 0,emissiveBaseColor:[d.emissiveFactor[0],d.emissiveFactor[1],d.emissiveFactor[2]],emissiveStrengthKHR:null!=d.emissiveStrengthKHR?d.emissiveStrengthKHR:1,emissiveStrengthFromSymbol:null!=a.emissiveStrengthFromSymbol?a.emissiveStrengthFromSymbol:void 0,mrrFactors:p?Ge.Bt:[d.metallicFactor,d.roughnessFactor,n.mrrFactors[2]],isSchematic:p,colorTextureTransformMatrix:S(d.colorTextureTransform),normalTextureTransformMatrix:S(d.normalTextureTransform),scale:[w[0],w[1]],occlusionTextureTransformMatrix:S(d.occlusionTextureTransform),emissiveTextureTransformMatrix:S(d.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:S(d.metallicRoughnessTextureTransform),...a},l))}const w=i.get(v);if(r.stageResources.materials.push(w),g){const e=e=>{null!=e&&r.stageResources.textures.push(s.get(e))};e(d.colorTexture),e(d.normalTexture),e(d.occlusionTexture),e(d.emissiveTexture),e(d.metallicRoughnessTexture)}return w}(n,e,c,C,I,P,O,t,w),{geometry:d,vertexCount:m}=function(e,t){const r=e.attributes.position.count,o=(0,y.x)(e.indices||r,e.primitiveType),n=p(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,g.t)(n,s,e.transform,3,l);const c=[["position",new A.n(n,o,3,!0)]];if(null!=e.attributes.normal){const t=p(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.normal;(0,i.Ge)(yt,e.transform),(0,g.b)(t,n,yt,3,s),(0,a.or)(yt)&&(0,g.n)(t,t),c.push(["normal",new A.n(t,o,3,!0)])}if(null!=e.attributes.tangent){const t=p(4*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.tangent;(0,i.z0)(yt,e.transform),(0,x.t)(t,n,yt,4,s),(0,a.or)(yt)&&(0,g.n)(t,t,4),c.push(["tangent",new A.n(t,o,4,!0)])}if(null!=e.attributes.texCoord0){const t=p(2*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.texCoord0;(0,b.a)(t,n,2,a),c.push(["uv0",new A.n(t,o,2,!0)])}const u=e.attributes.color;if(null!=u){const t=new Uint8Array(4*r);4===u.elementCount?u instanceof v.Eq?(0,x.b)(t,u,1,255):(u instanceof v.XP||u instanceof v.Uz)&&(0,x.b)(t,u,1/255,255):(t.fill(255),u instanceof v.xs?(0,g.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof v.eI||e.attributes.color instanceof v.nS)&&(0,g.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new A.n(t,o,4,!0)])}return{geometry:new D.V(t,c),vertexCount:r}}(e,r??new ot({},t)),f=d.boundingInfo;null!=f&&0===s&&((0,h.iT)(H,f.bbMin),(0,h.iT)(H,f.bbMax)),null!=r&&(c.stageResources.geometries.push(d),c.numberOfVertices+=m)}),l||z.push(c)}),{engineResources:z,referenceBoundingBox:H}}(f,t,s.specifiedLodIndex);return{lods:T,referenceBoundingBox:C,isEsriSymbolResource:f.meta.isEsriSymbolResource,isWosr:!1}}const yt=(0,s.vt)()},32728(e,t,r){r.d(t,{YH:()=>s,hG:()=>a,nu:()=>l,wp:()=>i}),r(34727);var o=r(35522),n=r(51850);function a(e){const t=e[0]*e[0]+e[4]*e[4]+e[8]*e[8],r=e[1]*e[1]+e[5]*e[5]+e[9]*e[9],o=e[2]*e[2]+e[6]*e[6]+e[10]*e[10];return Math.sqrt(Math.max(t,r,o))}function i(e,t){const r=Math.sqrt(t[0]*t[0]+t[4]*t[4]+t[8]*t[8]),n=Math.sqrt(t[1]*t[1]+t[5]*t[5]+t[9]*t[9]),a=Math.sqrt(t[2]*t[2]+t[6]*t[6]+t[10]*t[10]);return(0,o.hZ)(e,r,n,a),e}function s(e,t,r){r=r||e;const n=(0,o.Om)(e,t);(0,o.hZ)(r,e[0]-n*t[0],e[1]-n*t[1],e[2]-n*t[2]),(0,o.S8)(r,r)}function l(e,t,r,a=(0,n.vt)()){const i=(0,o.Bw)(e),s=(0,o.Bw)(t),l=(0,o.Om)(e,t)/(i*s);if(l<.9999999999999999){const n=Math.acos(l),d=((1-r)*i+r*s)/Math.sin(n),m=d/i*Math.sin((1-r)*n),h=d/s*Math.sin(r*n);return(0,o.hs)(c,e,m),(0,o.hs)(u,t,h),(0,o.WQ)(a,c,u)}return(0,o.Cc)(a,e,t,r)}(0,n.vt)(),(0,n.vt)(),(0,n.vt)();const c=(0,n.vt)(),u=(0,n.vt)()},46686(e,t,r){r.d(t,{o:()=>n});var o=r(31821);function n(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(o.H`
|
|
415
|
-
void forwardLinearDepth(float _linearDepth) { ${(0,o.If)(t,"linearDepth = _linearDepth;")} }
|
|
416
|
-
`)}},33120(e,t,r){r.d(t,{i$:()=>i,xJ:()=>a}),r(46686),r(62308);var o=r(77108),n=r(31821);function a(e){e.vertex.uniforms.add(new o.E("nearFar",e=>e.camera.nearFar))}function i(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
417
|
-
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
418
|
-
}`)}},32680(e,t,r){r.d(t,{M:()=>n});var o=r(31821);function n(e){e.vertex.code.add(o.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
|
|
419
|
-
vec3 camToVert = posWorld - camPosWorld;
|
|
420
|
-
bool isBackface = dot(camToVert, normalWorld) > 0.0;
|
|
421
|
-
if (isBackface) {
|
|
422
|
-
posClip.z += 0.0000003 * posClip.w;
|
|
423
|
-
}
|
|
424
|
-
return posClip;
|
|
425
|
-
}`)}},49255(e,t,r){function o(e){return function(e){return c(e)||4===e}(e)||function(e){return 5===(t=e)||6===t||7===t||8===e||9===e;var t}(e)}function n(e){return 10===e||11===e}function a(e){return l(e)||n(e)}function i(e){return 1===e}function s(e){return 2===e}function l(e){return 0===e||function(e){return i(e)||s(e)}(e)}function c(e){return function(e){return l(e)||n(e)}(e)||u(e)}function u(e){return 3===e}r.d(t,{Ex:()=>n,Rb:()=>s,Sp:()=>i,_o:()=>l,eh:()=>u,gr:()=>c,i3:()=>a,uw:()=>o})},76597(e,t,r){r.d(t,{d:()=>a});var o=r(33120),n=r(31821);function a(e){(0,o.i$)(e),e.vertex.code.add(n.H`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
|
|
426
|
-
vec4 eye = view * vec4(pos, 1.0);
|
|
427
|
-
depth = calculateLinearDepth(nearFar,eye.z);
|
|
428
|
-
return proj * eye;
|
|
429
|
-
}`),e.vertex.code.add(n.H`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
|
|
430
|
-
return proj * (view * vec4(pos, 1.0));
|
|
431
|
-
}`)}},24321(e,t,r){r.d(t,{v:()=>a});var o=r(43519),n=r(31821);function a(e,t){t.instancedColor?(e.attributes.add("instanceColor","vec4"),e.vertex.include(o.WD),e.vertex.include(o.Y1),e.vertex.include(o.ML),e.vertex.code.add(n.H`
|
|
432
|
-
MaskedColor applyInstanceColor(MaskedColor color) {
|
|
433
|
-
return multiplyMaskedColors( color, createMaskedFromUInt8NaNColor(${"instanceColor"}));
|
|
434
|
-
}
|
|
435
|
-
`)):e.vertex.code.add(n.H`MaskedColor applyInstanceColor(MaskedColor color) {
|
|
436
|
-
return color;
|
|
437
|
-
}`)}},2585(e,t,r){r.d(t,{B:()=>g});var o=r(77690),n=r(29242),a=r(9093),i=r(35522),s=r(51850),l=r(26425),c=r(77949),u=r(23205),d=r(31821),m=r(35644),h=r(74333);class f extends h.n{constructor(e,t,r){super(e,"mat4",1,(o,n,a)=>o.setUniformMatrix4fv(e,t(n,a),r))}}var p=r(28449);r(65786).Y;const v=(0,n.vt)();function g(e,t){const{hasModelTransformation:r,instancedDoublePrecision:n,instanced:s,output:h,hasVertexTangents:g}=t;r&&(e.vertex.uniforms.add(new f("model",e=>e.modelTransformation??a.zK)),e.vertex.uniforms.add(new m.k("normalLocalOriginFromModel",e=>((0,o.Ge)(v,e.modelTransformation??a.zK),v)))),s&&n&&(e.attributes.add("instanceModelOriginHi","vec3"),e.attributes.add("instanceModelOriginLo","vec3"),e.attributes.add("instanceModel","mat3"),e.attributes.add("instanceModelNormal","mat3"));const b=e.vertex;n&&(b.include(l.u),b.uniforms.add(new u.d("viewOriginHi",e=>(0,p.Zo)((0,i.hZ)(x,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),x)),new u.d("viewOriginLo",e=>(0,p.jA)((0,i.hZ)(x,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]),x)))),b.code.add(d.H`
|
|
438
|
-
vec3 getVertexInLocalOriginSpace() {
|
|
439
|
-
return ${r?n?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":n?"instanceModel * localPosition().xyz":"localPosition().xyz"};
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
vec3 subtractOrigin(vec3 _pos) {
|
|
443
|
-
${n?d.H`
|
|
444
|
-
// Issue: (should be resolved now with invariant position) https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
|
|
445
|
-
vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -instanceModelOriginHi, -instanceModelOriginLo);
|
|
446
|
-
return _pos - originDelta;`:"return vpos;"}
|
|
447
|
-
}
|
|
448
|
-
`),b.code.add(d.H`
|
|
449
|
-
vec3 dpNormal(vec4 _normal) {
|
|
450
|
-
return normalize(${r?n?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":n?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
|
|
451
|
-
}
|
|
452
|
-
`),4===h&&((0,c.S7)(b),b.code.add(d.H`
|
|
453
|
-
vec3 dpNormalView(vec4 _normal) {
|
|
454
|
-
return normalize((viewNormal * ${r?n?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":n?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
|
|
455
|
-
}
|
|
456
|
-
`)),g&&b.code.add(d.H`
|
|
457
|
-
vec4 dpTransformVertexTangent(vec4 _tangent) {
|
|
458
|
-
${r?n?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":n?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
|
|
459
|
-
}`)}const x=(0,s.vt)()},96336(e,t,r){r.d(t,{Y:()=>n});var o=r(31821);function n(e,t){switch(e.fragment.code.add(o.H`vec3 screenDerivativeNormal(vec3 positionView) {
|
|
460
|
-
return normalize(cross(dFdx(positionView), dFdy(positionView)));
|
|
461
|
-
}`),t.normalType){case 1:e.attributes.add("normalCompressed","vec2"),e.vertex.code.add(o.H`vec3 decompressNormal(vec2 normal) {
|
|
462
|
-
float z = 1.0 - abs(normal.x) - abs(normal.y);
|
|
463
|
-
return vec3(normal + sign(normal) * min(z, 0.0), z);
|
|
464
|
-
}
|
|
465
|
-
vec3 normalModel() {
|
|
466
|
-
return decompressNormal(normalCompressed);
|
|
467
|
-
}`);break;case 0:e.attributes.add("normal","vec3"),e.vertex.code.add(o.H`vec3 normalModel() {
|
|
468
|
-
return normal;
|
|
469
|
-
}`);break;default:t.normalType;case 2:case 3:}}},39014(e,t,r){r.d(t,{K:()=>s});var o=r(43519),n=r(31821),a=r(93588),i=r(43616);function s(e,t){e.varyings.add("colorMixMode","int"),e.varyings.add("opacityMixMode","int"),e.vertex.uniforms.add(new a.c("symbolColorMixMode",e=>i.Um[e.colorMixMode])),t.hasSymbolColors?(e.vertex.include(o.WD),e.vertex.include(o.Y1),e.vertex.include(o.ML),e.attributes.add("symbolColor","vec4"),e.vertex.code.add(n.H`
|
|
470
|
-
MaskedColor applySymbolColor(MaskedColor color) {
|
|
471
|
-
return multiplyMaskedColors(color, createMaskedFromUInt8NaNColor(${"symbolColor"}));
|
|
472
|
-
}
|
|
473
|
-
`)):e.vertex.code.add(n.H`MaskedColor applySymbolColor(MaskedColor color) {
|
|
474
|
-
return color;
|
|
475
|
-
}`),e.vertex.code.add(n.H`
|
|
476
|
-
void forwardColorMixMode(bvec4 mask) {
|
|
477
|
-
colorMixMode = mask.r ? ${n.H.int(i.Um.ignore)} : symbolColorMixMode;
|
|
478
|
-
opacityMixMode = mask.a ? ${n.H.int(i.Um.ignore)} : symbolColorMixMode;
|
|
479
|
-
}
|
|
480
|
-
`)}},53466(e,t,r){r.d(t,{U:()=>n});var o=r(31821);function n(e,t){switch(t.textureCoordinateType){case 1:return e.attributes.add("uv0","vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() { vuv0 = uv0; }`);case 2:return e.attributes.add("uv0","vec2"),e.attributes.add("uvRegion","vec4"),e.varyings.add("vuv0","vec2"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(o.H`void forwardTextureCoordinates() {
|
|
481
|
-
vuv0 = uv0;
|
|
482
|
-
vuvRegion = uvRegion;
|
|
483
|
-
}`);default:t.textureCoordinateType;case 0:return void e.vertex.code.add(o.H`void forwardTextureCoordinates() {}`);case 3:return}}},92700(e,t,r){r.d(t,{c:()=>n});var o=r(31821);function n(e,t){t.hasVertexColors?(e.attributes.add("color","vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(o.H`void forwardVertexColor() { vColor = color; }`)):e.vertex.code.add(o.H`void forwardVertexColor() {}`)}},72824(e,t,r){r.d(t,{Mh:()=>u,Zo:()=>d,gy:()=>m});var o=r(29242),n=r(91829),a=r(96336),i=r(62308),s=r(31821),l=r(98353),c=r(35644);function u(e,t){const{vertex:r,varyings:o}=e;switch(t.normalType){case 0:case 1:{e.include(a.Y,t),o.add("vNormalWorld","vec3"),o.add("vNormalView","vec3"),r.uniforms.add(new c.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal));const{vertexNormalRotationType:n}=t,i=1===n;i&&r.uniforms.add(new l.h("transformNormalGlobalFromModel",e=>e.transformNormalGlobalFromModel)),r.code.add(s.H`
|
|
484
|
-
${(0,s.If)(i,s.H`
|
|
485
|
-
mat3 normalModelTransformation() {
|
|
486
|
-
return transformNormalGlobalFromModel;
|
|
487
|
-
}
|
|
488
|
-
`)}
|
|
489
|
-
|
|
490
|
-
void forwardNormal() {
|
|
491
|
-
vNormalWorld = ${(0,s.If)(i,s.H`normalModelTransformation() * `)}normalModel();
|
|
492
|
-
vNormalView = transformNormalViewFromGlobal * vNormalWorld;
|
|
493
|
-
}
|
|
494
|
-
`);break}case 2:e.vertex.code.add(s.H`void forwardNormal() {}`);break;default:t.normalType;case 3:}}class d extends i.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.vt)()}}class m extends i.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,o.vt)(),this.toMapSpace=(0,n.vt)()}}},62308(e,t,r){r.d(t,{EM:()=>s,dO:()=>i});var o=r(29242),n=r(51850);(r(26425),r(40710),r(33079),r(31821),r(74333)).n,r(98353),r(35644),r(58029),r(63761);var a=r(65786);class i extends a.Y{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,n.vt)(),this.transformWorldFromViewTL=(0,n.vt)(),this.transformViewFromCameraRelativeRS=(0,o.vt)(),this.transformationTexture=null}}class s extends a.Y{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,o.vt)(),this.transformWorldFromModelTH=(0,n.vt)(),this.transformWorldFromModelTL=(0,n.vt)(),this.transformationDrawId=0}}},99208(e,t,r){r.d(t,{r:()=>i});var o=r(53466),n=r(31821);function a(e){e.fragment.code.add(n.H`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
|
|
495
|
-
vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
|
|
496
|
-
vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
|
|
497
|
-
float maxdUV = 0.125;
|
|
498
|
-
vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
|
|
499
|
-
vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
|
|
500
|
-
return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
|
|
501
|
-
}`)}function i(e,t){const{textureCoordinateType:r}=t;if(0===r||3===r)return;e.include(o.U,t);const i=2===r;i&&e.include(a),e.fragment.code.add(n.H`
|
|
502
|
-
vec4 textureLookup(sampler2D tex, vec2 uv) {
|
|
503
|
-
return ${i?"textureAtlasLookup(tex, uv, vuvRegion)":"texture(tex, uv)"};
|
|
504
|
-
}
|
|
505
|
-
`)}},35640(e,t,r){r.d(t,{Ge:()=>c});var o=r(78955),n=r(91829),a=r(52587),i=r(77949),s=r(71988),l=r(31821);function c(e,t){const r=e.vertex;t.hasVerticalOffset?(function(e){e.uniforms.add(new s.E("verticalOffset",(e,t)=>{const{minWorldLength:r,maxWorldLength:n,screenLength:a}=e.verticalOffset,i=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,o.hZ)(u,a*s,i,r,n)}))}(r),t.hasScreenSizePerspective&&(e.include(a.Y6),(0,a.OH)(r),(0,i.yu)(e.vertex,t)),r.code.add(l.H`
|
|
506
|
-
vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
|
|
507
|
-
float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
|
|
508
|
-
${t.spherical?l.H`vec3 worldNormal = normalize(worldPos + localOrigin);`:l.H`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
|
|
509
|
-
${t.hasScreenSizePerspective?l.H`
|
|
510
|
-
float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
|
|
511
|
-
float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:l.H`
|
|
512
|
-
float verticalOffsetScreenHeight = verticalOffset.x;`}
|
|
513
|
-
// Screen sized offset in world space, used for example for line callouts
|
|
514
|
-
float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
|
|
515
|
-
return worldNormal * worldOffset;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
|
|
519
|
-
return worldPos + calculateVerticalOffset(worldPos, localOrigin);
|
|
520
|
-
}
|
|
521
|
-
`)):r.code.add(l.H`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const u=(0,n.vt)()},40261(e,t,r){r.d(t,{E:()=>g});var o=r(33120),n=r(68317),a=r(76597),i=r(96336),s=r(36782),l=r(53466),c=r(72824),u=r(31821);function d(e,t){switch(t.output){case 5:case 6:case 7:case 8:e.fragment.code.add(u.H`float _calculateFragDepth(const in float depth) {
|
|
522
|
-
const float SLOPE_SCALE = 2.0;
|
|
523
|
-
const float BIAS = 20.0 * .000015259;
|
|
524
|
-
float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
|
|
525
|
-
return depth + SLOPE_SCALE * m + BIAS;
|
|
526
|
-
}
|
|
527
|
-
void outputDepth(float _linearDepth){
|
|
528
|
-
float fragDepth = _calculateFragDepth(_linearDepth);
|
|
529
|
-
gl_FragDepth = fragDepth;
|
|
530
|
-
}`);break;case 9:e.fragment.code.add(u.H`void outputDepth(float _linearDepth){
|
|
531
|
-
gl_FragDepth = _linearDepth;
|
|
532
|
-
}`)}}var m=r(3871),h=r(43259),f=r(58614),p=r(77949),v=r(63761);function g(e,t){const{vertex:r,fragment:g,varyings:x}=e,{hasColorTexture:b,alphaDiscardMode:w}=t,y=b&&1!==w,{output:M,normalType:T,hasColorTextureTransform:S}=t;switch(M){case 3:(0,p.NB)(r,t),e.include(a.d),g.include(n.HQ,t),e.include(l.U,t),y&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(u.H`vpos = getVertexInLocalOriginSpace();
|
|
533
|
-
vpos = subtractOrigin(vpos);
|
|
534
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
535
|
-
gl_Position = transformPosition(proj, view, vpos);
|
|
536
|
-
forwardTextureCoordinates();`),e.include(f.S,t),g.main.add(u.H`
|
|
537
|
-
discardBySlice(vpos);
|
|
538
|
-
${(0,u.If)(y,u.H`vec4 texColor = texture(tex, ${S?"colorUV":"vuv0"});
|
|
539
|
-
discardOrAdjustAlpha(texColor);`)}`);break;case 5:case 6:case 7:case 8:case 11:(0,p.NB)(r,t),e.include(a.d),e.include(l.U,t),e.include(h.A,t),e.include(d,t),g.include(n.HQ,t),e.include(s.g,t),(0,o.xJ)(e),x.add("depth","float",{invariant:!0}),y&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(u.H`vpos = getVertexInLocalOriginSpace();
|
|
540
|
-
vpos = subtractOrigin(vpos);
|
|
541
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
542
|
-
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
|
|
543
|
-
forwardTextureCoordinates();
|
|
544
|
-
forwardObjectAndLayerIdColor();`),e.include(f.S,t),g.main.add(u.H`
|
|
545
|
-
discardBySlice(vpos);
|
|
546
|
-
${(0,u.If)(y,u.H`vec4 texColor = texture(tex, ${S?"colorUV":"vuv0"});
|
|
547
|
-
discardOrAdjustAlpha(texColor);`)}
|
|
548
|
-
${11===M?u.H`outputObjectAndLayerIdColor();`:u.H`outputDepth(depth);`}`);break;case 4:{(0,p.NB)(r,t),e.include(a.d),e.include(i.Y,t),e.include(c.Mh,t),e.include(l.U,t),e.include(h.A,t),y&&g.uniforms.add(new v.N("tex",e=>e.texture)),2===T&&x.add("vPositionView","vec3",{invariant:!0});const o=0===T||1===T;r.main.add(u.H`
|
|
549
|
-
vpos = getVertexInLocalOriginSpace();
|
|
550
|
-
${o?u.H`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:u.H`vPositionView = (view * vec4(vpos, 1.0)).xyz;`}
|
|
551
|
-
vpos = subtractOrigin(vpos);
|
|
552
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
553
|
-
gl_Position = transformPosition(proj, view, vpos);
|
|
554
|
-
forwardTextureCoordinates();`),g.include(n.HQ,t),e.include(f.S,t),g.main.add(u.H`
|
|
555
|
-
discardBySlice(vpos);
|
|
556
|
-
${(0,u.If)(y,u.H`vec4 texColor = texture(tex, ${S?"colorUV":"vuv0"});
|
|
557
|
-
discardOrAdjustAlpha(texColor);`)}
|
|
558
|
-
|
|
559
|
-
${2===T?u.H`vec3 normal = screenDerivativeNormal(vPositionView);`:u.H`vec3 normal = normalize(vNormalWorld);
|
|
560
|
-
if (gl_FrontFacing == false){
|
|
561
|
-
normal = -normal;
|
|
562
|
-
}`}
|
|
563
|
-
fragColor = vec4(0.5 + 0.5 * normal, 1.0);`);break}case 10:(0,p.NB)(r,t),e.include(a.d),e.include(l.U,t),e.include(h.A,t),y&&g.uniforms.add(new v.N("tex",e=>e.texture)),r.main.add(u.H`vpos = getVertexInLocalOriginSpace();
|
|
564
|
-
vpos = subtractOrigin(vpos);
|
|
565
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
566
|
-
gl_Position = transformPosition(proj, view, vpos);
|
|
567
|
-
forwardTextureCoordinates();`),g.include(n.HQ,t),e.include(f.S,t),e.include(m.Q,t),g.main.add(u.H`
|
|
568
|
-
discardBySlice(vpos);
|
|
569
|
-
${(0,u.If)(y,u.H`vec4 texColor = texture(tex, ${S?"colorUV":"vuv0"});
|
|
570
|
-
discardOrAdjustAlpha(texColor);`)}
|
|
571
|
-
calculateOcclusionAndOutputHighlight();`)}}},22911(e,t,r){r.d(t,{NL:()=>p});var o=r(34727),n=r(49255),a=r(99208),i=r(65261),s=r(40710),l=r(33079),c=r(28421),u=r(20304),d=r(31821),m=r(15976),h=r(63761),f=r(66211);function p(e,t){if(!(0,n._o)(t.output))return;e.fragment.include(i.C);const{emissionSource:r,hasEmissiveTextureTransform:p,bindType:v,useFloatBlend:g}=t,x=3===r||4===r||5===r;x&&(e.include(a.r,t),e.fragment.uniforms.add(1===v?new h.N("texEmission",e=>e.textureEmissive):new m.o("texEmission",e=>e.textureEmissive)));const b=2===r||x;b&&e.fragment.uniforms.add(1===v?new l.t("emissiveBaseColor",e=>e.emissiveBaseColor):new s.W("emissiveBaseColor",e=>e.emissiveBaseColor));const w=0!==r;if(w&&7!==r&&6!==r&&4!==r&&5!==r){const t=e=>null!=e?g?e:(0,o.qE)(e,0,f.m):0;e.fragment.uniforms.add(1===v?new u.m("emissiveStrength",e=>t(e.emissiveStrength)):new c.J("emissiveStrength",e=>t(e.emissiveStrength)))}const y=7===r,M=5===r,T=1===r||6===r||y;e.fragment.code.add(d.H`
|
|
572
|
-
vec4 getEmissions(vec3 symbolColor) {
|
|
573
|
-
vec4 emissions = ${b?M?"emissiveSource == 0 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(emissiveBaseColor, 1.0)":T?y?"emissiveSource == 0 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(linearizeGamma(symbolColor), 1.0)":"vec4(0.0)"};
|
|
574
|
-
${(0,d.If)(x,`${(0,d.If)(M,`if(emissiveSource == 0) {\n vec4 emissiveFromTex = textureLookup(texEmission, ${p?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);\n }`,`vec4 emissiveFromTex = textureLookup(texEmission, ${p?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);`)}\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
|
|
575
|
-
${(0,d.If)(w,`emissions.rgb *= emissiveStrength * ${d.H.float(1)};`)}
|
|
576
|
-
return emissions;
|
|
577
|
-
}
|
|
578
|
-
`)}},92573(e,t,r){r.d(t,{V:()=>i});var o=r(52540),n=r(77108),a=r(31821);function i(e){e.include(o.E),e.uniforms.add(new n.E("zProjectionMapLastFrame",e=>(0,o.l)(e.reprojection.lastFrameCamera))),e.code.add(a.H`float linearDepthFromTextureLastFrame(sampler2D depthTexture, vec2 uv) {
|
|
579
|
-
return linearizeDepth(depthFromTexture(depthTexture, uv), zProjectionMapLastFrame);
|
|
580
|
-
}`)}},77695(e,t,r){r.d(t,{J:()=>m});var o=r(29242),n=r(48163),a=r(99208),i=r(68259),s=r(47286),l=r(31821),c=r(35644),u=r(15976),d=r(63761);function m(e,t){return function(e,t){const r=e.fragment,{hasVertexTangents:m,doubleSidedMode:h,hasNormalTexture:f,textureCoordinateType:p,bindType:v,hasNormalTextureTransform:g}=t;m?(e.attributes.add("tangent","vec4"),e.varyings.add("vTangent","vec4"),2===h?r.code.add(l.H`mat3 computeTangentSpace(vec3 normal) {
|
|
581
|
-
float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
|
|
582
|
-
vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
|
|
583
|
-
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
|
|
584
|
-
return mat3(tangent, bitangent, normal);
|
|
585
|
-
}`):r.code.add(l.H`mat3 computeTangentSpace(vec3 normal) {
|
|
586
|
-
float tangentHeadedness = vTangent.w;
|
|
587
|
-
vec3 tangent = normalize(vTangent.xyz);
|
|
588
|
-
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
|
|
589
|
-
return mat3(tangent, bitangent, normal);
|
|
590
|
-
}`)):r.code.add(l.H`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {
|
|
591
|
-
vec3 Q1 = dFdx(pos);
|
|
592
|
-
vec3 Q2 = dFdy(pos);
|
|
593
|
-
vec2 stx = dFdx(st);
|
|
594
|
-
vec2 sty = dFdy(st);
|
|
595
|
-
float det = stx.t * sty.s - sty.t * stx.s;
|
|
596
|
-
vec3 T = stx.t * Q2 - sty.t * Q1;
|
|
597
|
-
T = T - normal * dot(normal, T);
|
|
598
|
-
T *= inversesqrt(max(dot(T,T), 1.e-10));
|
|
599
|
-
vec3 B = sign(det) * cross(normal, T);
|
|
600
|
-
return mat3(T, B, normal);
|
|
601
|
-
}`),f&&0!==p&&(e.include(a.r,t),r.uniforms.add(1===v?new d.N("normalTexture",e=>e.textureNormal):new u.o("normalTexture",e=>e.textureNormal)),g&&(r.uniforms.add(1===v?new s.G("scale",e=>e.scale??n.Un):new i.t("scale",e=>e.scale??n.Un)),r.uniforms.add(new c.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??o.zK))),r.code.add(l.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
|
|
602
|
-
vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),g&&r.code.add(l.H`mat3 normalRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0,
|
|
603
|
-
normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
|
|
604
|
-
0.0, 0.0, 0.0 );
|
|
605
|
-
rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(l.H`return tangentSpace * rawNormal;
|
|
606
|
-
}`))}(e,t)}},8578(e,t,r){r.d(t,{k:()=>n});var o=r(31821);function n(e){e.code.add(o.H`vec2 encodeRGBtoVec2(vec3 color) {
|
|
607
|
-
return vec2(color.r, color.b);
|
|
608
|
-
}
|
|
609
|
-
vec3 decodeVec2ToRGB(vec2 encoded) {
|
|
610
|
-
return vec3(encoded.x, (encoded.x + encoded.y)/2.0, encoded.y);
|
|
611
|
-
}`)}},71651(e,t,r){r.d(t,{n:()=>H});var o=r(31821),n=r(12791),a=r(5482),i=r(34727),s=r(97768),l=r(36708),c=r(78659),u=r(91429),d=r(37585),m=r(2016),h=r(48375);var f=r(15581),p=r(13840),v=r(98958),g=r(95774),x=r(90644);let b=class extends v.w{constructor(){super(...arguments),this.shader=new p.r(g.S,()=>r.e(1285).then(r.bind(r,91285)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};b=(0,a.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],b);var w=r(48163),y=r(65786);class M extends y.Y{constructor(){super(...arguments),this.projScale=1}}class T extends M{constructor(){super(...arguments),this.intensity=1}}class S extends y.Y{}class C extends S{constructor(){super(...arguments),this.blurSize=(0,w.vt)()}}let _=class extends v.w{constructor(){super(...arguments),this.shader=new p.r(f.S,()=>r.e(6122).then(r.bind(r,86122)))}initializePipeline(){return(0,x.Ey)({colorWrite:x.kn})}};_=(0,a.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],_);var I=r(63907),z=r(76284),P=r(67171);let O=class extends h.A{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=m.OG.AMBIENT_ILLUMINATION,this._enableTime=(0,c.l5)(0),this._passParameters=new T,this._drawParameters=new C}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new P.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new z.A(this.renderingContext,t,e),this.addHandles((0,l.wB)(()=>this.view.stage.renderer.hasAmbientIllumination,()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}precompile(){this.techniques.precompile(_),this.techniques.precompile(b)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),o=t?.getTexture(I.nI);if(!r||!o)return;const n=this.techniques.getCompiled(_),a=this.techniques.getCompiled(b);if(!n||!a)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,u=this.bindParameters,h=u.camera,p=h.relativeElevation,v=(0,i.qE)((5e5-p)/2e5,0,1),g=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,x=g*v;this._passParameters.normalTexture=r,this._passParameters.depthTexture=o,this._passParameters.projScale=1/h.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*F/(0,f.g)(h)**6*x;const w=h.fullViewport[2],y=h.fullViewport[3],M=this.fboCache.acquire(w,y,"ssao input",2);s.bindFramebuffer(M.fbo),s.setViewport(0,0,w,y),s.bindTechnique(n,u,this._passParameters,this._drawParameters),s.screen.draw();const T=Math.round(w/2),S=Math.round(y/2),C=this.fboCache.acquire(T,S,"ssao blur",0);s.bindFramebuffer(C.fbo),this._drawParameters.colorTexture=M.getTexture(),(0,d.hZ)(this._drawParameters.blurSize,0,2/y),s.bindTechnique(a,u,this._passParameters,this._drawParameters),s.setViewport(0,0,T,S),s.screen.draw(),M.release();const z=this.fboCache.acquire(T,S,m.OG.AMBIENT_ILLUMINATION,0);return s.bindFramebuffer(z.fbo),s.setViewport(0,0,w,y),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=C.getTexture(),(0,d.hZ)(this._drawParameters.blurSize,2/w,0),s.bindTechnique(a,u,this._passParameters,this._drawParameters),s.setViewport(0,0,T,S),s.screen.draw(),s.setViewport4fv(h.fullViewport),C.release(),g<1&&this.requestRender(2),z}};(0,a.Cg)([(0,u.MZ)()],O.prototype,"consumes",void 0),(0,a.Cg)([(0,u.MZ)()],O.prototype,"produces",void 0),O=(0,a.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],O);const F=.5;function H(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",.5),e.code.add(o.H`float evaluateAmbientOcclusionInverse() {
|
|
612
|
-
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
613
|
-
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
614
|
-
}
|
|
615
|
-
float evaluateAmbientOcclusion() {
|
|
616
|
-
return 1.0 - evaluateAmbientOcclusionInverse();
|
|
617
|
-
}`)):e.code.add(o.H`float evaluateAmbientOcclusionInverse() { return 1.0; }
|
|
618
|
-
float evaluateAmbientOcclusion() { return 0.0; }`)}},9312(e,t,r){r.d(t,{kA:()=>U,a8:()=>W,eU:()=>k});var o=r(74333);class n extends o.n{constructor(e,t,r,o){super(e,"float",0,(t,n)=>t.setUniform1fv(e,r(n),o),t)}}var a=r(31821);function i(e,t){e.uniforms.add(new n("shR",9,({lighting:e})=>e.sh.r),new n("shG",9,({lighting:e})=>e.sh.g),new n("shB",9,({lighting:e})=>e.sh.b)),e.code.add(a.H`vec3 calculateAmbientIrradiance(vec3 normal) {
|
|
619
|
-
vec3 ambientLight = 0.282095 * vec3(shR[0], shG[0], shB[0]);
|
|
620
|
-
vec4 sh1 = vec4(
|
|
621
|
-
0.488603 * normal.x,
|
|
622
|
-
0.488603 * normal.z,
|
|
623
|
-
0.488603 * normal.y,
|
|
624
|
-
1.092548 * normal.x * normal.y
|
|
625
|
-
);
|
|
626
|
-
vec4 sh2 = vec4(
|
|
627
|
-
1.092548 * normal.y * normal.z,
|
|
628
|
-
0.315392 * (3.0 * normal.z * normal.z - 1.0),
|
|
629
|
-
1.092548 * normal.x * normal.z,
|
|
630
|
-
0.546274 * (normal.x * normal.x - normal.y * normal.y)
|
|
631
|
-
);
|
|
632
|
-
vec4 lightingAmbientSH_R1 = vec4(shR[1], shR[2], shR[3], shR[4]);
|
|
633
|
-
vec4 lightingAmbientSH_G1 = vec4(shG[1], shG[2], shG[3], shG[4]);
|
|
634
|
-
vec4 lightingAmbientSH_B1 = vec4(shB[1], shB[2], shB[3], shB[4]);
|
|
635
|
-
ambientLight += vec3(
|
|
636
|
-
dot(lightingAmbientSH_R1, sh1),
|
|
637
|
-
dot(lightingAmbientSH_G1, sh1),
|
|
638
|
-
dot(lightingAmbientSH_B1, sh1)
|
|
639
|
-
);
|
|
640
|
-
vec4 lightingAmbientSH_R2 = vec4(shR[5], shR[6], shR[7], shR[8]);
|
|
641
|
-
vec4 lightingAmbientSH_G2 = vec4(shG[5], shG[6], shG[7], shG[8]);
|
|
642
|
-
vec4 lightingAmbientSH_B2 = vec4(shB[5], shB[6], shB[7], shB[8]);
|
|
643
|
-
ambientLight += vec3(
|
|
644
|
-
dot(lightingAmbientSH_R2, sh2),
|
|
645
|
-
dot(lightingAmbientSH_G2, sh2),
|
|
646
|
-
dot(lightingAmbientSH_B2, sh2)
|
|
647
|
-
);
|
|
648
|
-
return ambientLight;
|
|
649
|
-
}`),1!==t.pbrMode&&2!==t.pbrMode||e.code.add(a.H`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
|
|
650
|
-
vec3 calculateAmbientRadiance()
|
|
651
|
-
{
|
|
652
|
-
vec3 ambientLight = 1.2 * (0.282095 * vec3(shR[0], shG[0], shB[0])) - 0.2;
|
|
653
|
-
return ambientLight *= skyTransmittance;
|
|
654
|
-
}`)}var s=r(71651),l=r(65261),c=r(98619),u=r(22393),d=r(89786),m=r(8578),h=r(12791),f=r(5482),p=(r(44208),r(53966)),v=r(97768),g=r(17676),x=r(36708),b=r(91429),w=r(37585),y=r(31217),M=r(2016),T=r(48375),S=r(13840),C=r(98958),_=r(52516),I=r(90644);let z=class extends C.w{constructor(){super(...arguments),this.shader=new S.r(_.a,()=>r.e(4434).then(r.bind(r,84434)))}initializePipeline(){return(0,I.Ey)({colorWrite:I.kn})}};z=(0,f.Cg)([(0,b.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationBlurTechnique")],z);var P=r(587);let O=class extends C.w{constructor(){super(...arguments),this.shader=new S.r(P.a,()=>r.e(8225).then(r.bind(r,18225)))}initializePipeline(){return(0,I.Ey)({colorWrite:I.kn})}};O=(0,f.Cg)([(0,b.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIlluminationTechnique")],O);var F=r(51976);class H extends F.K{constructor(){super(...arguments),this.hasEmission=!1}}(0,f.Cg)([(0,F.W)()],H.prototype,"hasEmission",void 0);var R=r(63907),E=r(76284),j=r(67171);let N=class extends T.A{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=M.OG.AMBIENT_ILLUMINATION,this._passParameters=new P.G,this._drawParameters=new _.G,this._accumulatedFrames=0,this._maxFrames=255,this._configuration=new H,this._resetBuffer=!1}async initialize(){this._abortController=new AbortController;const e=this._abortController.signal;try{const t=(await r.e(5354).then(r.bind(r,45354))).data;(0,g.Te)(e),await this._loadBlueNoiseTexture(t,e),(0,g.Te)(e)}catch(e){(0,g.zf)(e)||p.A.getLogger(this).errorOnce("Failed to load blue noise texture:",e)}this.addHandles((0,x.wB)(()=>this.view.stage.renderer.hasAmbientIllumination,e=>{e&&this.resetAccumulation(),this.requestRender(1)},x.pc))}precompile(){this._canRender&&(this._configuration.hasEmission=this.bindParameters.hasEmission,this.techniques.precompile(O,this._configuration),this.techniques.precompile(z))}destroy(){this._abortController=(0,v.DC)(this._abortController),this._passParameters.noiseTexture=(0,v.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),o=t?.getTexture(R.nI);if(!r||!o)return this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this.requestRender(1),this._emptyOutput;const n=this.bindParameters;this._configuration.hasEmission=n.hasEmission;const a=this.techniques.getCompiled(O,this._configuration),i=this.techniques.getCompiled(z);if(!a||!i)return this.requestRender(1),this._emptyOutput;this.view.stage.renderView.updating&&this.resetAccumulation();const s=this.renderingContext,{camera:l}=n;this._passParameters.normalTexture=r,this._passParameters.depthTexture=o,this._passParameters.projScale=1/l.computeScreenPixelSizeAtDist(1);const{fullWidth:c,fullHeight:u}=l,d=this.fboCache.acquire(c,u,"global illumination input");s.bindFramebuffer(d.fbo),s.setViewport(0,0,c,u),s.bindTechnique(a,n,this._passParameters,this._drawParameters),s.screen.draw();const m=Math.round(c/1),h=Math.round(u/1),f=this.fboCache.acquire(m,h,"global illumination blur");s.bindFramebuffer(f.fbo),this._drawParameters.colorTexture=d.getTexture(),(0,w.hZ)(this._drawParameters.blurSize,0,1/u),s.bindTechnique(i,n,this._passParameters,this._drawParameters),s.setViewport(0,0,m,h),s.screen.draw(),d.release();const p=this.fboCache.acquire(c,u,M.OG.AMBIENT_ILLUMINATION);return s.bindFramebuffer(p.fbo),s.setViewport(0,0,c,u),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=f.getTexture(),(0,w.hZ)(this._drawParameters.blurSize,1/c,0),s.bindTechnique(i,n,this._passParameters,this._drawParameters),s.setViewport(0,0,m,h),s.screen.draw(),s.setViewport4fv(l.fullViewport),f.release(),this._passParameters.frameCount=(this._passParameters.frameCount+1)%64,++this._accumulatedFrames,this._accumulatedFrames<this._maxFrames&&this.requestRender(1),p}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,o=this.fboCache.acquire(t,r,M.OG.AMBIENT_ILLUMINATION);return e.bindFramebuffer(o.fbo),e.setViewport(0,0,t,r),e.setClearColor(0,0,0,1),e.clear(16384),o}async _loadBlueNoiseTexture(e,t){(0,g.Te)(t);const r=await(0,y.D)(e,{signal:t});if((0,g.Te)(t),!r)return;const o=new j.R;o.internalFormat=R.H0.RGBA8,o.wrapMode=10497,o.isImmutable=!0,this._passParameters.noiseTexture=new E.A(this.renderingContext,o,r)}get _canRender(){const e=this.bindParameters;return!(!this._passParameters.noiseTexture||e.hasEmission&&!e.reprojection.lastFrameEmission||!e.reprojection.lastFrameDepth||!e.globalIllumination||this._resetBuffer)}resetAccumulation(){this._accumulatedFrames=0}get test(){}};function A(e,t){t.receiveGlobalIllumination?(e.include(m.k),e.uniforms.add(new h.x("globalIlluminationTexture",e=>e.globalIllumination?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1),e.code.add(a.H`vec3 readGlobalIlluminationOcclusionInverse() {
|
|
655
|
-
ivec2 texel = ivec2(gl_FragCoord.xy * blurSizePixelsInverse);
|
|
656
|
-
return vec3(texelFetch(globalIlluminationTexture, texel, 0).a);
|
|
657
|
-
}
|
|
658
|
-
vec3 readGlobalIlluminationOcclusion() {
|
|
659
|
-
return 1.0 - readGlobalIlluminationOcclusionInverse();
|
|
660
|
-
}
|
|
661
|
-
vec4 readGlobalIlluminationEmissionInverse() {
|
|
662
|
-
ivec2 texel = ivec2(gl_FragCoord.xy * blurSizePixelsInverse);
|
|
663
|
-
vec3 encodedEmission = texelFetch(globalIlluminationTexture, texel, 0).rgb;
|
|
664
|
-
vec3 rgb = decodeVec2ToRGB(encodedEmission.rg);
|
|
665
|
-
return 1.0 - vec4(rgb, 0.0);
|
|
666
|
-
}
|
|
667
|
-
vec4 readGlobalIlluminationEmission() {
|
|
668
|
-
return max((1.0 - readGlobalIlluminationEmissionInverse() - 0.01) / 0.99, 0.);
|
|
669
|
-
}`)):e.code.add(a.H`vec3 readGlobalIlluminationOcclusionInverse() { return vec3(1.0); }
|
|
670
|
-
vec3 readGlobalIlluminationOcclusion() { return vec3(0.0); }
|
|
671
|
-
vec4 readGlobalIlluminationEmissionInverse() { return vec4(1.0); }
|
|
672
|
-
vec4 readGlobalIlluminationEmission() { return vec4(0.0); }`)}(0,f.Cg)([(0,b.MZ)()],N.prototype,"consumes",void 0),(0,f.Cg)([(0,b.MZ)()],N.prototype,"produces",void 0),(0,f.Cg)([(0,b.MZ)()],N.prototype,"_abortController",void 0),N=(0,f.Cg)([(0,b.$K)("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],N);var D=r(32976),B=r(33094),V=r(57226);function L(e){e.code.add(a.H`float mapChannel(float x, vec2 p) {
|
|
673
|
-
return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
|
|
674
|
-
}`),e.code.add(a.H`vec3 blackLevelSoftCompression(vec3 color, float averageAmbientRadiance) {
|
|
675
|
-
vec2 p = vec2(0.02, 0.0075) * averageAmbientRadiance;
|
|
676
|
-
return vec3(mapChannel(color.x, p), mapChannel(color.y, p), mapChannel(color.z, p));
|
|
677
|
-
}`)}function G(e){e.code.add(a.H`vec3 tonemapACES(vec3 x) {
|
|
678
|
-
return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
|
|
679
|
-
}`),e.code.add(a.H`vec3 tonemapKhronosNeutral(vec3 color, float exposure) {
|
|
680
|
-
const float startCompression = 0.76;
|
|
681
|
-
const float desaturation = 0.15;
|
|
682
|
-
color *= exposure;
|
|
683
|
-
float x = min( color.r, min( color.g, color.b ) );
|
|
684
|
-
float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
|
|
685
|
-
color -= offset;
|
|
686
|
-
float peak = max( color.r, max( color.g, color.b ) );
|
|
687
|
-
if ( peak < startCompression ) {
|
|
688
|
-
return color;
|
|
689
|
-
}
|
|
690
|
-
float d = 1.0 - startCompression;
|
|
691
|
-
float newPeak = 1.0 - d * d / ( peak + d - startCompression );
|
|
692
|
-
color *= newPeak / peak;
|
|
693
|
-
float g = 1.0 - 1.0 / ( desaturation * ( peak - newPeak ) + 1.0 );
|
|
694
|
-
return mix( color, vec3( newPeak ), g );
|
|
695
|
-
}`)}function W(e){e.constants.add("ambientBoostFactor","float",V.uH)}function k(e){e.uniforms.add(new B.U("lightingGlobalFactor",e=>e.lighting.globalFactor))}function U(e,t){const{pbrMode:r,spherical:o,hasColorTexture:n,receiveGlobalIllumination:m}=t;e.include(l.C),e.include(A,t),e.include(s.n,t),0!==r&&e.include(u.c,t),e.include(i,t),e.include(d.p),e.include(G,t);const h=!(2===r&&!n);h&&e.include(L),W(e),k(e),(0,c.Gc)(e),e.code.add(a.H`
|
|
696
|
-
float additionalDirectedAmbientLight(float lightAlignment) {
|
|
697
|
-
return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
float additionalDirectedAmbientLight(vec3 vPosWorld) {
|
|
701
|
-
float lightAlignment = dot(${o?a.H`normalize(vPosWorld)`:a.H`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
|
|
702
|
-
return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
|
|
703
|
-
}
|
|
704
|
-
`),(0,c.O4)(e),e.code.add(a.H`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
|
|
705
|
-
float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
|
|
706
|
-
return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
|
|
707
|
-
}`);const f=m?"globalIlluminationOcclusion":"ssao",p=m?.75:1,v=m?1.5:1;switch(r){case 0:case 4:case 3:e.include(c.Vt),e.code.add(a.H`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) {
|
|
708
|
-
vec3 mainLighting = applyShading(normalWorld, shadow);
|
|
709
|
-
vec3 ambientLighting = calculateAmbientIrradiance(normalWorld) * (1.0 - ssao);
|
|
710
|
-
vec3 albedoLinear = linearizeGamma(albedo);
|
|
711
|
-
vec3 totalLight = mainLighting + ambientLighting + additionalLight;
|
|
712
|
-
totalLight = min(totalLight, vec3(PI));
|
|
713
|
-
vec3 outColor = vec3((albedoLinear / PI) * totalLight);
|
|
714
|
-
return delinearizeGamma(outColor);
|
|
715
|
-
}`);break;case 1:case 2:{const r=m?.35:.2;e.code.add(a.H`
|
|
716
|
-
const float fillLightIntensity = 0.25;
|
|
717
|
-
const float horizonLightDiffusion = 0.4;
|
|
718
|
-
const float additionalAmbientIrradianceFactor = 0.02;
|
|
719
|
-
const float groundReflectance = ${a.H.float(r)};
|
|
720
|
-
|
|
721
|
-
vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
|
|
722
|
-
vec3 viewDirection, vec3 upDirection, vec3 mrr, float additionalAmbientIrradiance) {
|
|
723
|
-
PBRShadingInfo inputs;
|
|
724
|
-
calculatePBRInputs(inputs, normal, viewDirection, upDirection, albedo, mrr);
|
|
725
|
-
|
|
726
|
-
${(0,a.If)(m,a.H`vec3 globalIlluminationOcclusion = min(1.2 * readGlobalIlluminationOcclusion(), 1.0);`)}
|
|
727
|
-
`),t.useFillLights?e.uniforms.add(new D.o("hasFillLights",e=>e.enableFillLights)):e.constants.add("hasFillLights","bool",!1),e.code.add(a.H`
|
|
728
|
-
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]);
|
|
729
|
-
ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
|
|
730
|
-
|
|
731
|
-
inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
|
|
732
|
-
|
|
733
|
-
// Calculate the irradiance components: sun, fill lights and the sky.
|
|
734
|
-
vec3 mainLightIrradianceComponent = ${a.H.float(p)} * inputs.NdotL * (1.0 - shadow) * mainLightIntensity;
|
|
735
|
-
vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
|
|
736
|
-
// calculate ambient irradiance for localView and additionalLight for globalView
|
|
737
|
-
vec3 ambientLightIrradianceComponent = ${a.H.float(v)} * calculateAmbientIrradiance(normal) * (1.0 - ${f}) + additionalLight;
|
|
738
|
-
|
|
739
|
-
// Assemble the overall irradiance of the sky that illuminates the surface
|
|
740
|
-
inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
|
|
741
|
-
// 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
|
|
742
|
-
inputs.groundIrradianceToSurface = groundReflectance * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
|
|
743
|
-
`),e.uniforms.add(new B.U("lightingSpecularStrength",e=>e.lighting.mainLight.specularStrength),new B.U("lightingEnvironmentStrength",e=>e.lighting.mainLight.environmentStrength)).code.add(a.H`
|
|
744
|
-
vec3 horizonRingDir = inputs.RdotUP * upDirection - inputs.reflectedView;
|
|
745
|
-
vec3 horizonRingH = normalize(horizonRingDir - viewDirection);
|
|
746
|
-
inputs.NdotH_Horizon = dot(normal, horizonRingH);
|
|
747
|
-
|
|
748
|
-
vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow);
|
|
749
|
-
vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity;
|
|
750
|
-
|
|
751
|
-
// calculateAmbientRadiance for localView and additionalLight for global view
|
|
752
|
-
vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance() * (1.0 - ${f}) + additionalLight;
|
|
753
|
-
float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotUP + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0));
|
|
754
|
-
|
|
755
|
-
// Assemble the overall radiance of the sky that illuminates the surface
|
|
756
|
-
inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
|
|
757
|
-
|
|
758
|
-
// Assemble the overall radiance of the ground that illuminates the surface. for this we use the simple model that changes only the sky radiance by the groundReflectance
|
|
759
|
-
inputs.groundRadianceToSurface = 0.5 * groundReflectance * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
|
|
760
|
-
|
|
761
|
-
// Calculate average ambient radiance - This is used in the gamut mapping process to determine the black level for compression
|
|
762
|
-
inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + groundReflectance);
|
|
763
|
-
`),e.code.add(a.H`
|
|
764
|
-
vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
|
|
765
|
-
vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
|
|
766
|
-
vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent;
|
|
767
|
-
|
|
768
|
-
${(0,a.If)(m,a.H`
|
|
769
|
-
vec3 globalIlluminationEmission = 2.25 * (0.75 * inputs.albedoLinear + 0.25) * readGlobalIlluminationEmission().rgb;
|
|
770
|
-
outColorLinear += globalIlluminationEmission;`)}
|
|
771
|
-
|
|
772
|
-
${h?a.H`vec3 adjustedOutColorLinear = blackLevelSoftCompression(outColorLinear, inputs.averageAmbientRadiance);`:a.H`vec3 adjustedOutColorLinear = max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance);`}
|
|
773
|
-
|
|
774
|
-
return delinearizeGamma(adjustedOutColorLinear);
|
|
775
|
-
}
|
|
776
|
-
`);break}case 5:case 6:{const t=m?.35:.5,r=m?.75:1,o=m?1.5:1;(0,c.Gc)(e),(0,c.O4)(e),e.code.add(a.H`
|
|
777
|
-
const float roughnessTerrain = 0.5;
|
|
778
|
-
const float specularityTerrain = ${a.H.float(t)};
|
|
779
|
-
|
|
780
|
-
vec3 evaluatePBRSimplifiedLighting(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDirection, vec3 upDirection) {
|
|
781
|
-
PBRShadingInfo inputs;
|
|
782
|
-
calculateSimplifiedInputs(inputs, normal, viewDirection, upDirection, albedo);
|
|
783
|
-
|
|
784
|
-
${(0,a.If)(m,a.H`vec3 globalIlluminationOcclusion = min(1.2 * readGlobalIlluminationOcclusion(), 1.0);`)}
|
|
785
|
-
|
|
786
|
-
vec3 mainLightIrradianceComponent = ${a.H.float(r)} * (1.0 - shadow) * inputs.NdotL * mainLightIntensity;
|
|
787
|
-
vec3 ambientLightIrradianceComponent = ${a.H.float(o)} * calculateAmbientIrradiance(normal) * (1.0 - ${f}) + additionalLight;
|
|
788
|
-
vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent;
|
|
789
|
-
|
|
790
|
-
vec3 indirectDiffuse = ((1.0 - inputs.NdotUP) * mainLightIrradianceComponent + (1.0 + inputs.NdotUP ) * ambientSky) * 0.5;
|
|
791
|
-
vec3 outDiffColor = inputs.albedoLinear * (1.0 - inputs.f0) * indirectDiffuse / PI;
|
|
792
|
-
|
|
793
|
-
vec3 mainLightRadianceComponent = normalDistribution(inputs.NdotH, roughnessTerrain) * mainLightIntensity;
|
|
794
|
-
vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, inputs.NdotV);
|
|
795
|
-
vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
|
|
796
|
-
vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent;
|
|
797
|
-
|
|
798
|
-
vec3 outColorLinear = outDiffColor + specularComponent;
|
|
799
|
-
|
|
800
|
-
${(0,a.If)(m,a.H`
|
|
801
|
-
vec3 globalIlluminationEmission = 2.25 * (0.75 * inputs.albedoLinear + 0.25) * readGlobalIlluminationEmission().rgb;
|
|
802
|
-
outColorLinear += globalIlluminationEmission;`)}
|
|
803
|
-
|
|
804
|
-
return delinearizeGamma(outColorLinear);
|
|
805
|
-
}
|
|
806
|
-
`);break}}}},65261(e,t,r){r.d(t,{C:()=>a});var o=r(40876),n=r(31821);function a(e){e.constants.add("GAMMA","float",o.Tf).constants.add("INV_GAMMA","float",1/o.Tf).code.add(n.H`vec3 delinearizeGamma(vec3 color) {
|
|
807
|
-
return pow(color, vec3(INV_GAMMA));
|
|
808
|
-
}
|
|
809
|
-
vec4 delinearizeGamma(vec4 color) {
|
|
810
|
-
return vec4(delinearizeGamma(color.rgb), color.a);
|
|
811
|
-
}
|
|
812
|
-
vec3 linearizeGamma(vec3 color) {
|
|
813
|
-
return pow(color, vec3(GAMMA));
|
|
814
|
-
}`)}},98619(e,t,r){r.d(t,{Gc:()=>a,O4:()=>i,Vt:()=>s});var o=r(23205),n=r(31821);function a(e){e.uniforms.add(new o.d("mainLightDirection",e=>e.lighting.mainLight.direction))}function i(e){e.uniforms.add(new o.d("mainLightIntensity",e=>e.lighting.mainLight.intensity))}function s(e){a(e),i(e),e.code.add(n.H`vec3 applyShading(vec3 shadingNormal, float shadow) {
|
|
815
|
-
float dotVal = clamp(dot(shadingNormal, mainLightDirection), 0.0, 1.0);
|
|
816
|
-
return mainLightIntensity * ((1.0 - shadow) * dotVal);
|
|
817
|
-
}`)}},62602(e,t,r){r.d(t,{r:()=>n});var o=r(31821);function n(e,t){const r=e.fragment;switch(r.code.add(o.H`struct ShadingNormalParameters {
|
|
818
|
-
vec3 normalView;
|
|
819
|
-
vec3 viewDirection;
|
|
820
|
-
} shadingParams;`),t.doubleSidedMode){case 0:r.code.add(o.H`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
821
|
-
return normalize(params.normalView);
|
|
822
|
-
}`);break;case 1:r.code.add(o.H`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
823
|
-
return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView);
|
|
824
|
-
}`);break;case 2:r.code.add(o.H`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
825
|
-
return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView);
|
|
826
|
-
}`);break;default:t.doubleSidedMode;case 3:}}},22393(e,t,r){r.d(t,{c:()=>s});var o=r(31821);function n(e){e.code.add(o.H`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) {
|
|
827
|
-
return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
|
|
828
|
-
}`),e.code.add(o.H`float integratedRadiance(float cosTheta2, float roughness) {
|
|
829
|
-
return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
|
|
830
|
-
}`),e.code.add(o.H`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness) {
|
|
831
|
-
float cosTheta2 = 1.0 - RdotNG * RdotNG;
|
|
832
|
-
float intRadTheta = integratedRadiance(cosTheta2, roughness);
|
|
833
|
-
float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
|
|
834
|
-
float sky = 2.0 - ground;
|
|
835
|
-
return (ground * ambientGround + sky * ambientSky) * 0.5;
|
|
836
|
-
}`)}var a=r(65261),i=r(89786);function s(e,t){e.include(a.C),e.include(i.p),1!==t.pbrMode&&2!==t.pbrMode&&5!==t.pbrMode&&6!==t.pbrMode||(e.code.add(o.H`float normalDistribution(float NdotH, float roughness)
|
|
837
|
-
{
|
|
838
|
-
float a = NdotH * roughness;
|
|
839
|
-
float b = roughness / (1.0 - NdotH * NdotH + a * a);
|
|
840
|
-
return b * b * INV_PI;
|
|
841
|
-
}`),e.code.add(o.H`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
|
|
842
|
-
const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040);
|
|
843
|
-
const vec2 c2 = vec2(-1.04, 1.04);
|
|
844
|
-
vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
|
|
845
|
-
vec4 r = roughness * c0 + c1;
|
|
846
|
-
float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
|
|
847
|
-
return c2 * a004 + r.zw;
|
|
848
|
-
}`),e.code.add(o.H`struct PBRShadingInfo
|
|
849
|
-
{
|
|
850
|
-
float NdotV;
|
|
851
|
-
float NdotL;
|
|
852
|
-
float LdotH;
|
|
853
|
-
float NdotUP;
|
|
854
|
-
float RdotUP;
|
|
855
|
-
float NdotAmbDir;
|
|
856
|
-
float NdotH_Horizon;
|
|
857
|
-
float NdotH;
|
|
858
|
-
vec3 skyRadianceToSurface;
|
|
859
|
-
vec3 groundRadianceToSurface;
|
|
860
|
-
vec3 skyIrradianceToSurface;
|
|
861
|
-
vec3 groundIrradianceToSurface;
|
|
862
|
-
vec3 reflectedView;
|
|
863
|
-
float averageAmbientRadiance;
|
|
864
|
-
vec3 albedoLinear;
|
|
865
|
-
vec3 f0;
|
|
866
|
-
vec3 f90;
|
|
867
|
-
vec3 diffuseColor;
|
|
868
|
-
float metalness;
|
|
869
|
-
float roughness;
|
|
870
|
-
};`),e.code.add(o.H`void calculateCommonInputs(out PBRShadingInfo inputs, vec3 normal, vec3 viewDirection, vec3 upDirection, vec3 albedo) {
|
|
871
|
-
vec3 h = normalize(mainLightDirection - viewDirection);
|
|
872
|
-
inputs.NdotV = clamp(abs(dot(normal, -viewDirection)), 0.001, 1.0);
|
|
873
|
-
inputs.NdotUP = clamp(dot(normal, upDirection), -1.0, 1.0);
|
|
874
|
-
inputs.reflectedView = normalize(reflect(-viewDirection, normal));
|
|
875
|
-
inputs.RdotUP = clamp(dot(inputs.reflectedView, upDirection), -1.0, 1.0);
|
|
876
|
-
inputs.albedoLinear = linearizeGamma(albedo);
|
|
877
|
-
inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0);
|
|
878
|
-
inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
|
|
879
|
-
}`)),1!==t.pbrMode&&2!==t.pbrMode||(e.include(n),e.code.add(o.H`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
|
|
880
|
-
vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotUP);
|
|
881
|
-
vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotUP, inputs.roughness);
|
|
882
|
-
vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
|
|
883
|
-
vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
|
|
884
|
-
vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
|
|
885
|
-
vec3 specularComponent = specularColor * indirectSpecular;
|
|
886
|
-
return (diffuseComponent + specularComponent);
|
|
887
|
-
}`),e.code.add(o.H`void calculatePBRInputs(out PBRShadingInfo inputs, vec3 normal, vec3 viewDirection, vec3 upDirection, vec3 albedo, vec3 mrr) {
|
|
888
|
-
calculateCommonInputs(inputs, normal, viewDirection, upDirection, albedo);
|
|
889
|
-
inputs.metalness = mrr[0];
|
|
890
|
-
inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);
|
|
891
|
-
inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
|
|
892
|
-
inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
|
|
893
|
-
inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);
|
|
894
|
-
}`)),5!==t.pbrMode&&6!==t.pbrMode||e.code.add(o.H`const vec3 fresnelReflectionSimplified = vec3(0.04);
|
|
895
|
-
void calculateSimplifiedInputs(out PBRShadingInfo inputs, vec3 normal, vec3 viewDirection, vec3 upDirection, vec3 albedo) {
|
|
896
|
-
calculateCommonInputs(inputs, normal, viewDirection, upDirection, albedo);
|
|
897
|
-
float lightness = 0.3 * inputs.albedoLinear[0] + 0.5 * inputs.albedoLinear[1] + 0.2 * inputs.albedoLinear[2];
|
|
898
|
-
inputs.f0 = (0.85 * lightness + 0.15) * fresnelReflectionSimplified;
|
|
899
|
-
inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
|
|
900
|
-
}`)}},59469(e,t,r){r.d(t,{_:()=>c});var o=r(99208),n=r(40710),a=r(33079),i=r(31821),s=r(15976),l=r(63761);function c(e,t){const r=t.pbrMode,c=e.fragment;if(2!==r&&0!==r&&1!==r)return void c.code.add(i.H`void applyPBRFactors() {}`);if(0===r)return void c.code.add(i.H`void applyPBRFactors() {}
|
|
901
|
-
float getBakedOcclusion() { return 1.0; }`);if(2===r)return void c.code.add(i.H`vec3 mrr = vec3(0.0, 0.6, 0.2);
|
|
902
|
-
float occlusion = 1.0;
|
|
903
|
-
void applyPBRFactors() {}
|
|
904
|
-
float getBakedOcclusion() { return 1.0; }`);const{hasMetallicRoughnessTexture:u,hasMetallicRoughnessTextureTransform:d,hasOcclusionTexture:m,hasOcclusionTextureTransform:h,bindType:f}=t;(u||m)&&e.include(o.r,t),c.code.add(i.H`vec3 mrr;
|
|
905
|
-
float occlusion;`),u&&c.uniforms.add(1===f?new l.N("texMetallicRoughness",e=>e.textureMetallicRoughness):new s.o("texMetallicRoughness",e=>e.textureMetallicRoughness)),m&&c.uniforms.add(1===f?new l.N("texOcclusion",e=>e.textureOcclusion):new s.o("texOcclusion",e=>e.textureOcclusion)),c.uniforms.add(1===f?new a.t("mrrFactors",e=>e.mrrFactors):new n.W("mrrFactors",e=>e.mrrFactors)),c.code.add(i.H`
|
|
906
|
-
${(0,i.If)(u,i.H`void applyMetallicRoughness(vec2 uv) {
|
|
907
|
-
vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
|
|
908
|
-
mrr[0] *= metallicRoughness.b;
|
|
909
|
-
mrr[1] *= metallicRoughness.g;
|
|
910
|
-
}`)}
|
|
911
|
-
|
|
912
|
-
${(0,i.If)(m,"void applyOcclusion(vec2 uv) { occlusion *= textureLookup(texOcclusion, uv).r; }")}
|
|
913
|
-
|
|
914
|
-
float getBakedOcclusion() {
|
|
915
|
-
return ${m?"occlusion":"1.0"};
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
void applyPBRFactors() {
|
|
919
|
-
mrr = mrrFactors;
|
|
920
|
-
occlusion = 1.0;
|
|
921
|
-
|
|
922
|
-
${(0,i.If)(u,`applyMetallicRoughness(${d?"metallicRoughnessUV":"vuv0"});`)}
|
|
923
|
-
${(0,i.If)(m,`applyOcclusion(${h?"occlusionUV":"vuv0"});`)}
|
|
924
|
-
}
|
|
925
|
-
`)}(r(74810),r(65786)).Y},32482(e,t,r){r.d(t,{LA:()=>M,QH:()=>y}),r(51850);var o=r(46686),n=r(49255),a=r(31821);function i(e,t){const r=(0,n._o)(t.output)&&t.receiveShadows;r&&(0,o.o)(e,!0),e.vertex.code.add(a.H`
|
|
926
|
-
void forwardLinearDepthToReadShadowMap() { ${(0,a.If)(r,"forwardLinearDepth(gl_Position.w);")} }
|
|
927
|
-
`)}var s=r(14314),l=r(35818),c=r(74333);class u extends c.n{constructor(e,t,r,o){super(e,"mat4",2,(r,n,a,i)=>r.setUniformMatrices4fv(e,t(n,a,i),o),r)}}class d extends c.n{constructor(e,t,r,o){super(e,"mat4",1,(r,n,a)=>r.setUniformMatrices4fv(e,t(n,a),o),r)}}var m=r(65786);function h(e){e.uniforms.add(new d("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),e.include(p)}function f(e){e.uniforms.add(new u("shadowMapMatrix",(e,t)=>t.shadowMap.getShadowMapMatrices(e.origin),4)),e.include(p)}function p(e){e.uniforms.add(new s.I("cascadeDistances",e=>e.shadowMap.cascadeDistances),new l.W("numCascades",e=>e.shadowMap.numCascades)),e.code.add(v)}m.Y;const v=a.H`const vec3 invalidShadowmapUVZ = vec3(0.0, 0.0, -1.0);
|
|
928
|
-
vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
|
|
929
|
-
vec4 lv = mat * vec4(_vpos, 1.0);
|
|
930
|
-
lv.xy /= lv.w;
|
|
931
|
-
return 0.5 * lv.xyz + vec3(0.5);
|
|
932
|
-
}
|
|
933
|
-
vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) {
|
|
934
|
-
float xScale = float(textureSize.y) / float(textureSize.x);
|
|
935
|
-
return vec2((float(i) + lvpos.x) * xScale, lvpos.y);
|
|
936
|
-
}
|
|
937
|
-
vec3 calculateUVZShadow(in vec3 _worldPos, in float _linearDepth, in ivec2 shadowMapSize) {
|
|
938
|
-
int i = _linearDepth < cascadeDistances[1] ? 0 : _linearDepth < cascadeDistances[2] ? 1 : _linearDepth < cascadeDistances[3] ? 2 : 3;
|
|
939
|
-
if (i >= numCascades) {
|
|
940
|
-
return invalidShadowmapUVZ;
|
|
941
|
-
}
|
|
942
|
-
mat4 shadowMatrix = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
|
|
943
|
-
vec3 lvpos = lightSpacePosition(_worldPos, shadowMatrix);
|
|
944
|
-
if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) {
|
|
945
|
-
return invalidShadowmapUVZ;
|
|
946
|
-
}
|
|
947
|
-
vec2 uvShadow = cascadeCoordinates(i, shadowMapSize, lvpos);
|
|
948
|
-
return vec3(uvShadow, lvpos.z);
|
|
949
|
-
}`;function g(e){e.code.add(a.H`float readShadowMapUVZ(vec3 uvzShadow, sampler2DShadow _shadowMap) {
|
|
950
|
-
return texture(_shadowMap, uvzShadow);
|
|
951
|
-
}`)}r(32976);var x=r(33094),b=r(12791);class w extends c.n{constructor(e,t){super(e,"sampler2DShadow",0,(r,o)=>r.bindTexture(e,t(o)))}}function y(e,t){t.receiveShadows&&e.fragment.include(h),T(e,t)}function M(e,t){t.receiveShadows&&e.fragment.include(f),T(e,t)}function T(e,t){e.fragment.uniforms.add(new x.U("lightingGlobalFactor",e=>e.lighting.globalFactor));const{hasShadowHighlights:r,receiveShadows:o,spherical:n}=t;e.include(i,t),o&&function(e,t){(function(e,t){e.include(g),e.uniforms.add(S()),t&&e.uniforms.add(new b.x("shadowHighlight",({shadowHighlight:e})=>e?.getTexture())),e.code.add(a.H`
|
|
952
|
-
float readShadowMaps(const in vec3 uvzShadow) {
|
|
953
|
-
if (uvzShadow.z < 0.0) {
|
|
954
|
-
return 0.0;
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
float shadow1 = readShadowMapUVZ(uvzShadow, shadowMap);
|
|
958
|
-
${(0,a.If)(t,"float shadow2 = texelFetch(shadowHighlight, ivec2(gl_FragCoord.xy), 0).r;\n return shadow1 > shadow2 ? shadow1 : shadow2;","return shadow1;")}
|
|
959
|
-
}
|
|
960
|
-
`)})(e,t),function(e){e.code.add(a.H`float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
|
|
961
|
-
vec3 uvzShadow = calculateUVZShadow(_worldPos, _linearDepth, textureSize(shadowMap, 0));
|
|
962
|
-
return readShadowMaps(uvzShadow);
|
|
963
|
-
}`)}(e)}(e.fragment,r),e.fragment.code.add(a.H`
|
|
964
|
-
float readShadow(float additionalAmbientScale, vec3 vpos) {
|
|
965
|
-
return ${o?"max(lightingGlobalFactor * (1.0 - additionalAmbientScale), readShadowMap(vpos, linearDepth))":(0,a.If)(n,"lightingGlobalFactor * (1.0 - additionalAmbientScale)","0.0")};
|
|
966
|
-
}
|
|
967
|
-
`)}function S(){return new w("shadowMap",({shadowMap:e})=>e.getOutput(5)??e.getOutput(7))}m.Y},96608(e,t,r){r.d(t,{t:()=>c});var o=r(52540),n=r(77108),a=r(33094),i=r(31821),s=r(58029),l=r(12791);function c(e,t){if(!t.screenSpaceReflections)return;const r=e.fragment;r.include(o.E),r.uniforms.add(new n.E("nearFar",e=>e.camera.nearFar),new l.x("depthMap",e=>e.depth?.attachment),new s.F("proj",e=>e.camera.projectionMatrix),new a.U("invResolutionHeight",e=>1/e.camera.height),new s.F("reprojectionMatrix",e=>e.reprojection.matrix)).code.add(i.H`
|
|
968
|
-
vec2 reprojectionCoordinate(vec3 projectionCoordinate)
|
|
969
|
-
{
|
|
970
|
-
vec4 zw = proj * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0);
|
|
971
|
-
vec4 reprojectedCoord = reprojectionMatrix * vec4(zw.w * (projectionCoordinate.xy * 2.0 - 1.0), zw.z, zw.w);
|
|
972
|
-
reprojectedCoord.xy /= reprojectedCoord.w;
|
|
973
|
-
return reprojectedCoord.xy * 0.5 + 0.5;
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
vec4 applyProjectionMat(mat4 projectionMat, vec3 x)
|
|
977
|
-
{
|
|
978
|
-
vec4 projectedCoord = projectionMat * vec4(x, 1.0);
|
|
979
|
-
projectedCoord.xy /= projectedCoord.w;
|
|
980
|
-
projectedCoord.xy = projectedCoord.xy*0.5 + 0.5;
|
|
981
|
-
return projectedCoord;
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
vec3 screenSpaceIntersection(vec3 dir, vec3 startPosition, vec3 viewDir, vec3 normal, float offset, bool globalIllumination)
|
|
985
|
-
{
|
|
986
|
-
vec3 viewPos = startPosition;
|
|
987
|
-
vec3 viewPosEnd = startPosition;
|
|
988
|
-
|
|
989
|
-
// Project the start position to the screen
|
|
990
|
-
vec4 projectedCoordStart = applyProjectionMat(proj, viewPos);
|
|
991
|
-
vec3 Q0 = viewPos / projectedCoordStart.w; // homogeneous camera space
|
|
992
|
-
float k0 = 1.0/ projectedCoordStart.w;
|
|
993
|
-
|
|
994
|
-
// advance the position in the direction of the reflection
|
|
995
|
-
viewPos += dir;
|
|
996
|
-
|
|
997
|
-
vec4 projectedCoordVanishingPoint = applyProjectionMat(proj, dir);
|
|
998
|
-
|
|
999
|
-
// Project the advanced position to the screen
|
|
1000
|
-
vec4 projectedCoordEnd = applyProjectionMat(proj, viewPos);
|
|
1001
|
-
vec3 Q1 = viewPos / projectedCoordEnd.w; // homogeneous camera space
|
|
1002
|
-
float k1 = 1.0/ projectedCoordEnd.w;
|
|
1003
|
-
|
|
1004
|
-
// calculate the reflection direction in the screen space
|
|
1005
|
-
vec2 projectedCoordDir = (projectedCoordEnd.xy - projectedCoordStart.xy);
|
|
1006
|
-
vec2 projectedCoordDistVanishingPoint = (projectedCoordVanishingPoint.xy - projectedCoordStart.xy);
|
|
1007
|
-
|
|
1008
|
-
float maxReach = globalIllumination ? 0.15 : 1.0;
|
|
1009
|
-
float distMod = min(globalIllumination ? length(projectedCoordDistVanishingPoint.xy) : abs(projectedCoordDistVanishingPoint.y), maxReach);
|
|
1010
|
-
|
|
1011
|
-
float projectedCoordDirLength = length(projectedCoordDir);
|
|
1012
|
-
int maxSteps = globalIllumination ? 16 : ${t.highStepCount?"150":"75"};
|
|
1013
|
-
float maxSt = float(maxSteps);
|
|
1014
|
-
|
|
1015
|
-
// normalize the projection direction depending on maximum steps
|
|
1016
|
-
// this determines how blocky the reflection looks
|
|
1017
|
-
vec2 dP = distMod * (projectedCoordDir)/(maxSt * projectedCoordDirLength);
|
|
1018
|
-
|
|
1019
|
-
// Normalize the homogeneous camera space coordinates
|
|
1020
|
-
vec3 dQ = distMod * (Q1 - Q0)/(maxSt * projectedCoordDirLength);
|
|
1021
|
-
float dk = distMod * (k1 - k0)/(maxSt * projectedCoordDirLength);
|
|
1022
|
-
|
|
1023
|
-
// initialize the variables for ray marching
|
|
1024
|
-
vec2 P = projectedCoordStart.xy;
|
|
1025
|
-
vec3 Q = Q0;
|
|
1026
|
-
float k = k0;
|
|
1027
|
-
float rayStartZ = -startPosition.z; // estimated ray start depth value
|
|
1028
|
-
float rayEndZ = -startPosition.z; // estimated ray end depth value
|
|
1029
|
-
float prevEstimateZ = -startPosition.z;
|
|
1030
|
-
float rayDiffZ = 0.0;
|
|
1031
|
-
float dDepth;
|
|
1032
|
-
float depth;
|
|
1033
|
-
float rayDiffZOld = 0.0;
|
|
1034
|
-
|
|
1035
|
-
// early outs
|
|
1036
|
-
if (dot(normal, dir) < 0.0 || dot(-viewDir, normal) < 0.0)
|
|
1037
|
-
return vec3(P, 0.0);
|
|
1038
|
-
float dDepthBefore = 0.0;
|
|
1039
|
-
|
|
1040
|
-
P = clamp(P + offset * dP, vec2(0.0), vec2(0.999));
|
|
1041
|
-
Q.z += offset * dQ.z;
|
|
1042
|
-
k += offset * dk;
|
|
1043
|
-
|
|
1044
|
-
for(int i = 0; i < maxSteps-1; i++)
|
|
1045
|
-
{
|
|
1046
|
-
depth = -linearDepthFromTexture(depthMap, P); // get linear depth from the depth buffer
|
|
1047
|
-
|
|
1048
|
-
// estimate depth of the marching ray
|
|
1049
|
-
rayStartZ = prevEstimateZ;
|
|
1050
|
-
dDepth = -rayStartZ - depth;
|
|
1051
|
-
rayEndZ = (dQ.z * 0.5 + Q.z)/ ((dk * 0.5 + k));
|
|
1052
|
-
rayDiffZ = rayEndZ- rayStartZ;
|
|
1053
|
-
prevEstimateZ = rayEndZ;
|
|
1054
|
-
|
|
1055
|
-
if(-rayEndZ > nearFar[1] || -rayEndZ < nearFar[0] || P.y < 0.0 || P.y > 1.0 )
|
|
1056
|
-
{
|
|
1057
|
-
return vec3(P, 0.);
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
// If we detect a hit - return the intersection point, two conditions:
|
|
1061
|
-
// - dDepth > 0.0 - sampled point depth is in front of estimated depth
|
|
1062
|
-
// - if difference between dDepth and rayDiffZOld is not too large
|
|
1063
|
-
// - if difference between dDepth and 0.025/abs(k) is not too large
|
|
1064
|
-
// - if the sampled depth is not behind far plane or in front of near plane
|
|
1065
|
-
|
|
1066
|
-
if((dDepth) < 0.025/abs(k) + abs(rayDiffZ) && dDepth > 0.0 && depth > nearFar[0] && depth < nearFar[1] && abs(P.y - projectedCoordStart.y) > invResolutionHeight)
|
|
1067
|
-
{
|
|
1068
|
-
float weight = dDepth / (dDepth - dDepthBefore);
|
|
1069
|
-
vec2 Pf = mix(P - dP, P, 1.0 - weight);
|
|
1070
|
-
if (abs(Pf.y - projectedCoordStart.y) > invResolutionHeight) {
|
|
1071
|
-
return vec3(Pf, depth);
|
|
1072
|
-
}
|
|
1073
|
-
else {
|
|
1074
|
-
return vec3(P, depth);
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
if (globalIllumination && (P.x <= 0.0 || P.x >= 1.0)) {
|
|
1079
|
-
return vec3(P, 0.0);
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
// continue with ray marching
|
|
1083
|
-
// Clamp to 0.999 to avoid sampling edge artifacts for water reflections
|
|
1084
|
-
P = P + dP;
|
|
1085
|
-
Q.z += dQ.z;
|
|
1086
|
-
k += dk;
|
|
1087
|
-
rayDiffZOld = rayDiffZ;
|
|
1088
|
-
dDepthBefore = dDepth;
|
|
1089
|
-
|
|
1090
|
-
// Clamp to 0.999 to avoid sampling edge artifacts for water reflections
|
|
1091
|
-
if (!globalIllumination) {
|
|
1092
|
-
P = clamp(P, vec2(0.0), vec2(0.999));
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
return vec3(P, 0.0);
|
|
1096
|
-
}
|
|
1097
|
-
`)}},51406(e,t,r){r.d(t,{MU:()=>l,O1:()=>c,QM:()=>u,Sx:()=>s,q2:()=>i});var o=r(29242),n=r(31821),a=r(35644);function i(e,t){t.hasColorTextureTransform?(e.varyings.add("colorUV","vec2"),e.vertex.uniforms.add(new a.k("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix??o.zK)).code.add(n.H`void forwardColorUV(){
|
|
1098
|
-
colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
1099
|
-
}`)):e.vertex.code.add(n.H`void forwardColorUV(){}`)}function s(e,t){t.hasNormalTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("normalUV","vec2"),e.vertex.uniforms.add(new a.k("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix??o.zK)).code.add(n.H`void forwardNormalUV(){
|
|
1100
|
-
normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
1101
|
-
}`)):e.vertex.code.add(n.H`void forwardNormalUV(){}`)}function l(e,t){t.hasEmissionTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("emissiveUV","vec2"),e.vertex.uniforms.add(new a.k("emissiveTextureTransformMatrix",e=>e.emissiveTextureTransformMatrix??o.zK)).code.add(n.H`void forwardEmissiveUV(){
|
|
1102
|
-
emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
1103
|
-
}`)):e.vertex.code.add(n.H`void forwardEmissiveUV(){}`)}function c(e,t){t.hasOcclusionTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("occlusionUV","vec2"),e.vertex.uniforms.add(new a.k("occlusionTextureTransformMatrix",e=>e.occlusionTextureTransformMatrix??o.zK)).code.add(n.H`void forwardOcclusionUV(){
|
|
1104
|
-
occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
1105
|
-
}`)):e.vertex.code.add(n.H`void forwardOcclusionUV(){}`)}function u(e,t){t.hasMetallicRoughnessTextureTransform&&0!==t.textureCoordinateType?(e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.uniforms.add(new a.k("metallicRoughnessTextureTransformMatrix",e=>e.metallicRoughnessTextureTransformMatrix??o.zK)).code.add(n.H`void forwardMetallicRoughnessUV(){
|
|
1106
|
-
metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
1107
|
-
}`)):e.vertex.code.add(n.H`void forwardMetallicRoughnessUV(){}`)}},34845(e,t,r){r.d(t,{Ir:()=>u});var o=r(37585),n=r(48163),a=r(78955),i=r(91829),s=r(77108),l=r(14314),c=r(31821);function u(e){e.fragment.uniforms.add(new l.I("projInfo",e=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,a.hZ)(d,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,a.hZ)(d,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(e.camera))),e.fragment.uniforms.add(new s.E("zScale",e=>0===e.camera.projectionMatrix[11]?(0,o.hZ)(m,0,1):(0,o.hZ)(m,1,0))),e.fragment.code.add(c.H`vec3 reconstructPosition(vec2 fragCoord, float depth) {
|
|
1108
|
-
return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
|
|
1109
|
-
}`)}const d=(0,i.vt)(),m=(0,n.vt)()},58614(e,t,r){r.d(t,{S:()=>i}),r(28421);var o=r(20304),n=r(31821),a=r(49788);function i(e,t){!function(e,t,r){const o=e.fragment,i=t.alphaDiscardMode,s=0===i;2!==i&&3!==i||o.uniforms.add(r),o.code.add(n.H`
|
|
1110
|
-
void discardOrAdjustAlpha(inout vec4 color) {
|
|
1111
|
-
${1===i?"color.a = 1.0;":`if (color.a < ${s?n.H.float(a.Q):"textureAlphaCutoff"}) {\n discard;\n } ${(0,n.If)(2===i,"else { color.a = 1.0; }")}`}
|
|
1112
|
-
}
|
|
1113
|
-
`)}(e,t,new o.m("textureAlphaCutoff",e=>e.textureAlphaCutoff))}},26425(e,t,r){r.d(t,{u:()=>a});var o=r(33094),n=r(31821);function a(e){e.uniforms.add(new o.U("dpDummy",()=>1)).code.add(n.H`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
|
|
1114
|
-
vec3 hiD = hiA + hiB;
|
|
1115
|
-
vec3 loD = loA + loB;
|
|
1116
|
-
return dpDummy * hiD + loD;
|
|
1117
|
-
}`)}},32976(e,t,r){r.d(t,{o:()=>n});var o=r(74333);class n extends o.n{constructor(e,t){super(e,"bool",0,(r,o)=>r.setUniform1b(e,t(o)))}}},40710(e,t,r){r.d(t,{W:()=>n});var o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"vec3",2,(o,n,a,i)=>o.setUniform3fv(e,t(n,a,i),r))}}},33079(e,t,r){r.d(t,{t:()=>n});var o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"vec3",1,(o,n,a)=>o.setUniform3fv(e,t(n,a),r))}}},28421(e,t,r){r.d(t,{J:()=>n});var o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"float",2,(o,n,a)=>o.setUniform1f(e,t(n,a),r))}}},20304(e,t,r){r.d(t,{m:()=>n});var o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"float",1,(o,n,a)=>o.setUniform1f(e,t(n,a),r))}}},98353(e,t,r){r.d(t,{h:()=>n});var o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"mat3",2,(o,n,a)=>o.setUniformMatrix3fv(e,t(n,a),r))}}},15976(e,t,r){r.d(t,{o:()=>n});var o=r(74333);class n extends o.n{constructor(e,t,r){super(e,"sampler2D",2,(o,n,a)=>o.bindTexture(e,t(n,a),r?.(n,a)))}}},63761(e,t,r){r.d(t,{N:()=>n});var o=r(74333);class n extends o.n{constructor(e,t){super(e,"sampler2D",1,(r,o,n)=>r.bindTexture(e,t(o,n)))}}},31821(e,t,r){r.d(t,{H:()=>o,If:()=>n});const o=(e,...t)=>{let r="";for(let o=0;o<t.length;o++)r+=e[o]+t[o];return r+=e[e.length-1],r};function n(e,t,r=""){return e?t:r}o.int=e=>e.toFixed(),o.uint=e=>`${Math.max(0,e).toFixed()}u`,o.hexuint=e=>`0x${Math.round(Math.max(0,e)).toString(16)}u`,o.float=e=>e.toPrecision(8)},27832(e,t,r){r.d(t,{b:()=>a});var o=r(33094),n=r(31821);function a(e,t){t.snowCover&&(e.uniforms.add(new o.U("snowCover",e=>e.snowCover)).code.add(n.H`float getSnow(vec3 normal, vec3 groundNormal) {
|
|
1118
|
-
return smoothstep(0.5, 0.55, dot(normal, groundNormal)) * snowCover;
|
|
1119
|
-
}
|
|
1120
|
-
float getRealisticTreeSnow(vec3 faceNormal, vec3 shadingNormal, vec3 groundNormal) {
|
|
1121
|
-
float snow = min(1.0, smoothstep(0.5, 0.55, dot(faceNormal, groundNormal)) +
|
|
1122
|
-
smoothstep(0.5, 0.55, dot(-faceNormal, groundNormal)) +
|
|
1123
|
-
smoothstep(0.0, 0.1, dot(shadingNormal, groundNormal)));
|
|
1124
|
-
return snow * snowCover;
|
|
1125
|
-
}`),e.code.add(n.H`vec3 applySnowToMRR(vec3 mrr, float snow) {
|
|
1126
|
-
return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
|
|
1127
|
-
}`))}},74810(e,t,r){r.d(t,{Bt:()=>s,Jr:()=>a,SY:()=>l,mb:()=>i});var o=r(35522),n=r(51850);function a({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:a,emissiveTexture:i,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==i&&(null==s||(0,o.t2)(s,n.uY))&&null==l&&(null==a||1===a)&&(null==r||1===r)}const i=(0,n.CN)(1,1,.5),s=(0,n.CN)(0,.6,.2),l=(0,n.CN)(0,1,.2)},66211(e,t,r){function o(e,t){t.useFloatBlend?(e.constants.add("floatBlendOutputScale","float",1),e.constants.add("floatBlendInputScale","float",1)):(e.constants.add("floatBlendOutputScale","float",1/n),e.constants.add("floatBlendInputScale","float",n))}r.d(t,{H:()=>o,m:()=>n});const n=16},74333(e,t,r){r.d(t,{n:()=>o});class o{constructor(e,t,r,o,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},o)switch(r){case void 0:break;case 0:this.bind[0]=o;break;case 1:this.bind[1]=o;break;case 2:this.bind[2]=o}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}}}]);
|