@agrotools1/at-components 0.2.1 → 0.2.3
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/dist/AGraphicContainer-98a4c8a4.js +109 -0
- package/dist/APIKeyMixin-9511e0a5.js +19 -0
- package/dist/Analysis-4b1d1fb5.js +31 -0
- package/dist/ArcGISCachedService-93e2cb27.js +47 -0
- package/dist/ArcGISService-3f8d89c1.js +25 -0
- package/dist/AreaMeasurement2D-e0bb230c.js +405 -0
- package/dist/AreaMeasurement3D-a9959ecf.js +488 -0
- package/dist/AttachmentInfo-601c56e2.js +34 -0
- package/dist/AttachmentQuery-3504d550.js +18 -0
- package/dist/AttributeStore-b90878e3.js +1707 -0
- package/dist/BaseDynamicLayerView2D-b2faf028.js +63 -0
- package/dist/BindType-5e76c8e1.js +7 -0
- package/dist/BingMapsLayer-5d79fe2b.js +112 -0
- package/dist/Bitmap-f775c851.js +128 -0
- package/dist/BitmapContainer-af5942b8.js +23 -0
- package/dist/BlendLayer-a792edf6.js +13 -0
- package/dist/BoundsStore-789624df.js +63 -0
- package/dist/BufferObject-cbd0168e.js +100 -0
- package/dist/BufferView-004ad517.js +683 -0
- package/dist/BuildingSceneLayer-25bc760b.js +535 -0
- package/dist/Button/Button.d.ts +24 -2
- package/dist/Button-70963624.js +36 -0
- package/dist/ByteSizeUnit-90df2840.js +7 -0
- package/dist/CSVLayer-fd3b6750.js +208 -0
- package/dist/CSVSourceWorker-eb24cd85.js +367 -0
- package/dist/CatalogDynamicGroupLayerView2D-dfc700a4.js +66 -0
- package/dist/CatalogFootprintLayerView2D-6eb16597.js +76 -0
- package/dist/CatalogLayer-1cc632fe.js +262 -0
- package/dist/CatalogLayerView2D-d143aa34.js +52 -0
- package/dist/Chips/index.d.ts +1 -0
- package/dist/CircularArray-b2bc1dfd.js +40 -0
- package/dist/ClassBreaksDefinition-07ba0c64.js +18 -0
- package/dist/ColorMaterial.glsl-e7801766.js +64 -0
- package/dist/ColorSet-df5696b5.js +45 -0
- package/dist/ColorStop-7187f368.js +29 -0
- package/dist/Container-ac97765a.js +521 -0
- package/dist/CustomParametersMixin-b3432b3e.js +12 -0
- package/dist/DatePicker/DatePicker.helper.d.ts +22 -0
- package/dist/DatePicker/DatePickerCalendar/DatePickerCalendar.helper.d.ts +18 -0
- package/dist/DatePicker/index.d.ts +2 -0
- package/dist/DefaultMaterial.glsl-3cc4efe7.js +42 -0
- package/dist/DefaultMaterial_COLOR_GAMMA-337c63aa.js +653 -0
- package/dist/DefaultTheme-12dffc66.js +130 -0
- package/dist/DeleteForwardEditsParameters-ae76d898.js +18 -0
- package/dist/DimensionLayer-9eb47c76.js +129 -0
- package/dist/DirectLineMeasurement3D-e9903136.js +449 -0
- package/dist/DistanceMeasurement2D-a4853462.js +303 -0
- package/dist/DoubleArray-5076283e.js +25 -0
- package/dist/EdgeProcessingWorker-c1783ddd.js +63 -0
- package/dist/EditBusLayer-e812f4c9.js +107 -0
- package/dist/ElevationInfo-fad03d5e.js +56 -0
- package/dist/ElevationLayer-397792d5.js +129 -0
- package/dist/ElevationQuery-beceb62f.js +598 -0
- package/dist/ElevationSamplerWorker-0048a204.js +62 -0
- package/dist/ExportImageParameters-c6c4bc61.js +66 -0
- package/dist/ExportStrategy-908f5b8d.js +93 -0
- package/dist/ExportWMSImageParameters-34da6b46.js +33 -0
- package/dist/External-14daf0c1.js +110 -0
- package/dist/FeatureCollectionSnappingSource-f97a1829.js +130 -0
- package/dist/FeatureCommandQueue-d4817eac.js +1244 -0
- package/dist/FeatureEffect-08976bbd.js +39 -0
- package/dist/FeatureEffectLayer-05c258f4.js +13 -0
- package/dist/FeatureFilter-8c5e44b1.js +27 -0
- package/dist/FeatureLayer-d3659466.js +693 -0
- package/dist/FeatureLayerBase-9b63f732.js +148 -0
- package/dist/FeatureLayerSource-960f1c01.js +444 -0
- package/dist/FeatureLayerView2D-7503e1ed.js +1967 -0
- package/dist/FeaturePipelineWorker-d4301d2a.js +3633 -0
- package/dist/FeatureReductionLayer-e6cf73ac.js +225 -0
- package/dist/FeatureReductionSelection-d90249a7.js +22 -0
- package/dist/FeatureServiceSnappingSource-9e49ca72.js +481 -0
- package/dist/FeatureServiceSnappingSourceWorker-39b093b3.js +747 -0
- package/dist/FeatureSet-d79f0e48.js +188 -0
- package/dist/FeatureStore-eb4b87c0.js +131 -0
- package/dist/FeatureTemplate-edb1b782.js +12 -0
- package/dist/FeatureType-bba29adb.js +25 -0
- package/dist/FieldsIndex-75cca4d0.js +109 -0
- package/dist/FormTemplate-22911c47.js +350 -0
- package/dist/GeoJSONLayer-b33c96b8.js +236 -0
- package/dist/GeoJSONSourceWorker-b04ff552.js +247 -0
- package/dist/GeoRSSLayer-6e5fcd0e.js +73 -0
- package/dist/GeoRSSLayerView2D-21b6b12e.js +140 -0
- package/dist/GeometryUtils-fa897cbd.js +403 -0
- package/dist/GraphicContainer-1fd6bfce.js +26 -0
- package/dist/GraphicManipulator-f3b7dc9b.js +1499 -0
- package/dist/GraphicsLayer-e0686779.js +38 -0
- package/dist/GraphicsLayerView2D-a7eba2fe.js +114 -0
- package/dist/GraphicsSnappingSource-594f402a.js +273 -0
- package/dist/GraphicsView2D-347562b8.js +620 -0
- package/dist/GroupLayer-7ae0a916.js +147 -0
- package/dist/GroupLayerView2D-ffcde606.js +98 -0
- package/dist/HUDMaterial.glsl-b0a3e0ce.js +65 -0
- package/dist/HighlightCounter-e18f0179.js +41 -0
- package/dist/HighlightGraphicContainer-fd774cea.js +18 -0
- package/dist/I3SBinaryReader-190e99de.js +310 -0
- package/dist/I3SLayerDefinitions-6ddaca60.js +55 -0
- package/dist/I3SUtil-44b83dc0.js +59 -0
- package/dist/IdentityManager-fbe91c13.js +899 -0
- package/dist/ImageHistogramParameters-d64fd9c8.js +905 -0
- package/dist/ImageryLayer-67878a78.js +1799 -0
- package/dist/ImageryLayerView2D-ae45faba.js +352 -0
- package/dist/ImageryTileLayer-9dca8b93.js +2157 -0
- package/dist/ImageryTileLayerView2D-977f66aa.js +1110 -0
- package/dist/ImmutableArray-fb7b7a6a.js +20 -0
- package/dist/Indices-e6dc3b15.js +67 -0
- package/dist/Input/Input.core.d.ts +37 -11
- package/dist/Input/index.d.ts +37 -11
- package/dist/IntegratedMesh3DTilesLayer-8811e7bf.js +112 -0
- package/dist/IntegratedMeshLayer-9162c0b5.js +141 -0
- package/dist/InteractiveAnalysisViewModel-b046fcb9.js +7397 -0
- package/dist/InterleavedLayout-32973c8a.js +163 -0
- package/dist/KMLLayer-80f81df7.js +162 -0
- package/dist/KMLLayerView2D-b6ba3b80.js +253 -0
- package/dist/KnowledgeGraphLayerView2D-ae91bd81.js +43 -0
- package/dist/LRUCache-27e8c401.js +32 -0
- package/dist/LabelClass-d9a476d6.js +135 -0
- package/dist/LabelMetric-e2728bbf.js +400 -0
- package/dist/LaserlinePath.glsl-60d00e61.js +64 -0
- package/dist/Laserlines.glsl-499a6cbf.js +65 -0
- package/dist/LayerFloorInfo-d05cf9dd.js +15 -0
- package/dist/LayerView-036988a9.js +206 -0
- package/dist/LercWorker-b1b4bb47.js +157 -0
- package/dist/LineOfSightLayer-9a9a60b7.js +147 -0
- package/dist/LinkChartLayer-d61803bb.js +1027 -0
- package/dist/Lyr3DWorker-87be14e0.js +82 -0
- package/dist/MD5-1b5ec1c3.js +76 -0
- package/dist/MagnifierPrograms-da7a27ab.js +806 -0
- package/dist/Map/Map.d.ts +26 -0
- package/dist/Map/index.d.ts +1 -0
- package/dist/Map/types/index.d.ts +38 -0
- package/dist/Map/utils/index.d.ts +24 -0
- package/dist/MapImageLayer-f07adf1a.js +169 -0
- package/dist/MapImageLayerView2D-d1b140c3.js +146 -0
- package/dist/MapNotesLayer-c662d147.js +283 -0
- package/dist/MapNotesLayerView2D-bf9ac698.js +161 -0
- package/dist/MapServiceLayerViewHelper-fb724de9.js +288 -0
- package/dist/MeasurementWidgetContent-e4888ef2.js +2642 -0
- package/dist/MediaLayer-36d873a3.js +523 -0
- package/dist/MediaLayerView2D-e58b8ec0.js +332 -0
- package/dist/MemCache-a9232ec2.js +227 -0
- package/dist/MemorySourceWorker-20ff27d6.js +222 -0
- package/dist/Mesh-3839826a.js +980 -0
- package/dist/MeshLocalVertexSpace-00151564.js +19 -0
- package/dist/MultiOriginJSONSupport-bb258670.js +158 -0
- package/dist/NestedMap-83f8e815.js +29 -0
- package/dist/OGCFeatureLayer-2a8b7ecc.js +211 -0
- package/dist/OGCFeatureLayerView2D-185f9649.js +82 -0
- package/dist/ObjectStack-10d91171.js +21 -0
- package/dist/Octree-78797046.js +495 -0
- package/dist/OpenStreetMapLayer-b0a17790.js +30 -0
- package/dist/OperationalLayer-55af27d6.js +44 -0
- package/dist/OptimizedFeatureSet-54e095c4.js +12 -0
- package/dist/OptimizedGeometry-3b808152.js +68 -0
- package/dist/OrderByInfo-22e3c805.js +16 -0
- package/dist/OrderIndependentTransparency-3eadfe42.js +214 -0
- package/dist/OrderedLayer-1403a591.js +26 -0
- package/dist/OrientedImageryLayer-8ec8d7d1.js +216 -0
- package/dist/OverlayCompositing.glsl-ba3bd81d.js +65 -0
- package/dist/OverrideHelper-82325a2c.js +242 -0
- package/dist/PBFDecoderWorker-f6517afc.js +213 -0
- package/dist/PointCloudLayer-cff43a10.js +197 -0
- package/dist/PointCloudUniqueValueRenderer-f337a895.js +115 -0
- package/dist/PointCloudWorker-cdb28dc1.js +212 -0
- package/dist/PooledRBush-ee4e60af.js +272 -0
- package/dist/Popup-c7f55588.js +3990 -0
- package/dist/PortalLayer-07b3c53e.js +126 -0
- package/dist/Program-ba2f18b2.js +694 -0
- package/dist/ProgramTemplate-eee4f097.js +35 -0
- package/dist/ProgressBar/ProgressBar.d.ts +0 -13
- package/dist/QueryEngine-10c97624.js +896 -0
- package/dist/QueryEngineCapabilities-0d8477a2.js +4 -0
- package/dist/QueryTask-115430b6.js +119 -0
- package/dist/RasterSymbolizer-fbf433fe.js +3024 -0
- package/dist/RasterVFDisplayObject-20b0dd86.js +581 -0
- package/dist/RasterWorker-44c37e20.js +78 -0
- package/dist/RawBlockCache-25203dbd.js +185 -0
- package/dist/RealisticTree.glsl-bc07c4dc.js +42 -0
- package/dist/Rect-894f011c.js +14 -0
- package/dist/RefreshableLayer-9550b85a.js +80 -0
- package/dist/RefreshableLayerView-601f7038.js +16 -0
- package/dist/Relationship-c662830e.js +64 -0
- package/dist/RelationshipQuery-765f068e.js +22 -0
- package/dist/RenderState-b244097f.js +7 -0
- package/dist/RenderingContext-3db74548.js +889 -0
- package/dist/RibbonLine.glsl-c6a715b7.js +65 -0
- package/dist/RouteLayer-3f5411f3.js +786 -0
- package/dist/RouteLayerView2D-a5fd4cbf.js +195 -0
- package/dist/SDFHelper-a34e90ee.js +140 -0
- package/dist/SSAO.glsl-5491a708.js +43 -0
- package/dist/SSAOBlur.glsl-f3068b8e.js +42 -0
- package/dist/ScaleRangeLayer-7ddf00b4.js +21 -0
- package/dist/SceneLayer-c594bfc3.js +542 -0
- package/dist/SceneLayerSnappingSource-a0504ac7.js +218 -0
- package/dist/SceneLayerSnappingSourceWorker-a04d6692.js +112 -0
- package/dist/SceneLayerWorker-1865768e.js +164 -0
- package/dist/SceneService-fb9f0142.js +215 -0
- package/dist/Scheduler-eacc84bb.js +373 -0
- package/dist/Select/Item/Item.d.ts +2 -1
- package/dist/Select/{Select.multiple.d.ts → Multiple/Select.multiple.d.ts} +26 -16
- package/dist/Select/Select.core.d.ts +18 -15
- package/dist/Select/{Select.single.d.ts → Single/Select.single.d.ts} +23 -14
- package/dist/Select/index.d.ts +42 -24
- package/dist/ShadedColorMaterial.glsl-db97956b.js +64 -0
- package/dist/SnappingOperation-9622a00d.js +48 -0
- package/dist/SourceLayerData-7016f1a5.js +116 -0
- package/dist/SpatialFilter-d20d4f50.js +1701 -0
- package/dist/Stop-68022e32.js +281 -0
- package/dist/StreamLayer-7c837e3d.js +188 -0
- package/dist/StreamLayerView2D-586f5a6a.js +164 -0
- package/dist/StyleDefinition-f4862d5a.js +36 -0
- package/dist/StyleRepository-fba75e70.js +2212 -0
- package/dist/SublayersOwner-3dc574cd.js +545 -0
- package/dist/SubtypeGroupLayer-1f9c5398.js +514 -0
- package/dist/SubtypeGroupLayerView2D-0f108d9d.js +84 -0
- package/dist/Tabs/Tab/Tab.d.ts +3 -3
- package/dist/TechniqueInstance-0481dbff.js +233 -0
- package/dist/TemporalLayer-8116b4a4.js +23 -0
- package/dist/Texture-22a8cca5.js +501 -0
- package/dist/TextureOnly.glsl-458f8148.js +65 -0
- package/dist/Theme-f05b8eb0.js +3426 -0
- package/dist/Tick-aef93b48.js +723 -0
- package/dist/TileContainer-0bf0ea1b.js +31 -0
- package/dist/TileInfoTilemapCache-d78858c0.js +38 -0
- package/dist/TileLayer-0edee064.js +194 -0
- package/dist/TileLayerView2D-78d5801b.js +187 -0
- package/dist/TilemapCache-79699d61.js +189 -0
- package/dist/TimeInfo-40c96ade.js +42 -0
- package/dist/TimeOnly-9ee66ca6.js +706 -0
- package/dist/Tooltip-e7498dc9.js +138 -0
- package/dist/TopFeaturesQuery-ad224e01.js +32 -0
- package/dist/TurboLine-6ab04aef.js +565 -0
- package/dist/UniqueValueRenderer-eaa5f8a6.js +1039 -0
- package/dist/UnknownLayer-e280ddd4.js +30 -0
- package/dist/UnknownTimeZone-220952b5.js +15 -0
- package/dist/UnsupportedLayer-447f7676.js +31 -0
- package/dist/UpdateTracking2D-e9adad8f.js +8566 -0
- package/dist/Util-002f5109.js +57 -0
- package/dist/VectorTileLayer-3210be81.js +544 -0
- package/dist/VectorTileLayerView2D-6a51e3b8.js +2108 -0
- package/dist/Version-3de8cbca.js +33 -0
- package/dist/VertexArrayObject-07998745.js +73 -0
- package/dist/VertexAttribute-faad30bf.js +11 -0
- package/dist/VertexColor.glsl-e415cf02.js +2683 -0
- package/dist/VertexElementDescriptor-d7c718c2.js +8 -0
- package/dist/VertexSnappingCandidate-b676241f.js +13 -0
- package/dist/VideoLayerView2D-f659dd0d.js +124 -0
- package/dist/VoxelLayer-003f82ff.js +631 -0
- package/dist/WFSLayer-3da6c5f7.js +221 -0
- package/dist/WFSSourceWorker-9a11693a.js +157 -0
- package/dist/WGLContainer-3d159b63.js +5426 -0
- package/dist/WMSLayer-fc0632f8.js +536 -0
- package/dist/WMSLayerView2D-54e80e1b.js +117 -0
- package/dist/WMTSLayer-9324b12b.js +531 -0
- package/dist/WMTSLayerView2D-3ef936db.js +142 -0
- package/dist/WebTileLayer-45c563ff.js +110 -0
- package/dist/WhereClause-7a28b740.js +2766 -0
- package/dist/WorkerHandle-0d54a6c7.js +47 -0
- package/dist/WorkerTileHandler-786c2b24.js +1539 -0
- package/dist/action-163397e3.js +198 -0
- package/dist/action-group-4859fb97.js +145 -0
- package/dist/action-menu-2d70b2fc.js +1759 -0
- package/dist/agrotools-theme.css.map +1 -1
- package/dist/apng-9b71d52c.js +392 -0
- package/dist/ar-a17f8064.js +18 -0
- package/dist/arcade-fa309282.js +229 -0
- package/dist/arcadeAsyncRuntime-738498fd.js +943 -0
- package/dist/arcadeUtils-f71d80fa.js +8741 -0
- package/dist/arcgis-knowledge-client-core-6056bcea.js +1218 -0
- package/dist/arcgis-knowledge-client-core-simd-9bc1f83e.js +1218 -0
- package/dist/arcgisLayers-b2b878bd.js +152 -0
- package/dist/associatedFeatureServiceUtils-df5b5187.js +92 -0
- package/dist/axisAngleDegrees-32643b7c.js +49 -0
- package/dist/basicInterfaces-fa4f5fa7.js +30 -0
- package/dist/basis_transcoder-3187cc92.js +1248 -0
- package/dist/bg_BG-9950a70b.js +18 -0
- package/dist/bs_BA-60482871.js +18 -0
- package/dist/ca_ES-a121088e.js +18 -0
- package/dist/calcite-action-bar-5a87c23c.js +303 -0
- package/dist/calcite-action-ee2ca847.js +22 -0
- package/dist/calcite-action-group-19aa86ee.js +28 -0
- package/dist/calcite-button-8e9175c0.js +228 -0
- package/dist/calcite-flow-57d26d2d.js +128 -0
- package/dist/calcite-flow-item-4a3e3fc0.js +499 -0
- package/dist/calcite-icon-d99e280a.js +16 -0
- package/dist/calcite-input-28b20785.js +24 -0
- package/dist/calcite-label-4f30e08d.js +79 -0
- package/dist/calcite-list-0cee7628.js +2135 -0
- package/dist/calcite-list-item-0a19efa8.js +576 -0
- package/dist/calcite-list-item-group-0706662f.js +71 -0
- package/dist/calcite-loader-865045b1.js +14 -0
- package/dist/calcite-modal-3e4da6fd.js +333 -0
- package/dist/calcite-notice-50b74ab7.js +181 -0
- package/dist/calcite-option-713c1d40.js +94 -0
- package/dist/calcite-scrim-809fbd0b.js +18 -0
- package/dist/calcite-select-28d8edfc.js +231 -0
- package/dist/capabilities-c8f838be.js +50 -0
- package/dist/chartCommon-13718cda.js +256 -0
- package/dist/chartUtilsAm5-6be145fb.js +2954 -0
- package/dist/clientSideDefaults-5c1f97c9.js +39 -0
- package/dist/colorRamps-8792655e.js +38 -0
- package/dist/colorUtils-54f4b662.js +164 -0
- package/dist/commonProperties-f9559903.js +60 -0
- package/dist/component-51a10bc0.js +18 -0
- package/dist/computeTranslationToOriginAndRotation-4876cb93.js +60 -0
- package/dist/conditionalSlot-87175989.js +27 -0
- package/dist/config-61215215.js +7 -0
- package/dist/constants-5bd557fe.js +5 -0
- package/dist/createConnection-f974a00a.js +299 -0
- package/dist/crsUtils-59933b10.js +7 -0
- package/dist/cs_CZ-1b968650.js +18 -0
- package/dist/da_DK-e0fe1642.js +18 -0
- package/dist/dataUtils-7c276b73.js +1421 -0
- package/dist/date-1c28c6a5.js +52 -0
- package/dist/de_CH-b0dbd4c8.js +6 -0
- package/dist/de_DE-8609ef65.js +6 -0
- package/dist/debounce-de27a42a.js +121 -0
- package/dist/deduplicate-59fb9cac.js +89 -0
- package/dist/defaults-2bfa4a36.js +31 -0
- package/dist/defaultsJSON-ba17aa15.js +10 -0
- package/dist/definitions-a00a3a6c.js +52 -0
- package/dist/deleteForwardEdits-f653b513.js +13 -0
- package/dist/devEnvironmentUtils-42cb97c7.js +11 -0
- package/dist/diffUtils-e71a6152.js +90 -0
- package/dist/dom-b589b728.js +358 -0
- package/dist/doublePrecisionUtils-46e21550.js +22 -0
- package/dist/drapedUtils-b42fcbc6.js +75 -0
- package/dist/earcut-6fa1a128.js +292 -0
- package/dist/edgeProcessing-2ff1f201.js +252 -0
- package/dist/editingSupport-68545668.js +203 -0
- package/dist/editsZScale-c7cdd215.js +37 -0
- package/dist/el_GR-5cfd1e7e.js +18 -0
- package/dist/elevationInfoUtils-5456a079.js +126 -0
- package/dist/en_CA-47f2633b.js +18 -0
- package/dist/en_US-47f2633b.js +18 -0
- package/dist/enums-25d066fc.js +13 -0
- package/dist/enums-2c166c09.js +99 -0
- package/dist/enums-fa8f05ab.js +152 -0
- package/dist/es_ES-489878a2.js +6 -0
- package/dist/et_EE-6472669a.js +18 -0
- package/dist/executeForIds-4ab75c0d.js +14 -0
- package/dist/executeForTopCount-7e095ec1.js +17 -0
- package/dist/executeForTopExtents-19daf9d0.js +17 -0
- package/dist/executeForTopIds-1ba3a4af.js +17 -0
- package/dist/executeQueryJSON-46168866.js +15 -0
- package/dist/executeQueryPBF-d8623daf.js +152 -0
- package/dist/executeRelationshipQuery-011dfb45.js +53 -0
- package/dist/executeTopFeaturesQuery-02166801.js +18 -0
- package/dist/featureConversionUtils-650d7601.js +479 -0
- package/dist/featureLayerUtils-64e09283.js +142 -0
- package/dist/featureLayerUtils-b07f9c11.js +250 -0
- package/dist/featureSetUtils-9d37d6f8.js +2530 -0
- package/dist/featuresetbase-62aeb079.js +707 -0
- package/dist/featuresetgeom-51f9fc4e.js +99 -0
- package/dist/featuresetstats-4db32894.js +81 -0
- package/dist/featuresetstring-990c3287.js +95 -0
- package/dist/fetchService-5198dd4a.js +33 -0
- package/dist/fi_FI-d7a3a525.js +18 -0
- package/dist/fieldProperties-edfa24cb.js +33 -0
- package/dist/floatRGBA-516d7961.js +20 -0
- package/dist/floorFilterUtils-936f7587.js +19 -0
- package/dist/focusTrapComponent-e849bb89.js +475 -0
- package/dist/form-99719d52.js +138 -0
- package/dist/fr_FR-a88f2596.js +7 -0
- package/dist/geohashUtils-2bc76440.js +85 -0
- package/dist/geojson-603231df.js +208 -0
- package/dist/geomasync-e9063b4c.js +567 -0
- package/dist/geometryEngine-d3bb2fd6.js +192 -0
- package/dist/geometryEngineAsync-55aa6170.js +217 -0
- package/dist/geometryEngineBase-527e8b63.js +18463 -0
- package/dist/geometryEngineJSON-28087174.js +46 -0
- package/dist/geometryEngineJSON-d54949f9.js +171 -0
- package/dist/geometryEngineWorker-dc2c7127.js +11 -0
- package/dist/geometryServiceUtils-6a3e1e93.js +28 -0
- package/dist/georeference-ed8b2c30.js +291 -0
- package/dist/gif-204e82dd.js +323 -0
- package/dist/glUtil-8f8bce6b.js +19 -0
- package/dist/gltfexport-b2566542.js +705 -0
- package/dist/groupLayerUtils-ea9e6359.js +39 -0
- package/dist/guid-5ee54248.js +17 -0
- package/dist/he_IL-e34cf273.js +18 -0
- package/dist/heatmapUtils-56758920.js +45 -0
- package/dist/highlightReasons-de432106.js +19 -0
- package/dist/hr_HR-6a124f87.js +18 -0
- package/dist/hu_HU-58f3feb6.js +18 -0
- package/dist/hydrated-0e1c7565.js +40 -0
- package/dist/i3s-bb0b5b67.js +809 -0
- package/dist/icon-c6e3bd23.js +127 -0
- package/dist/id_ID-18d97715.js +18 -0
- package/dist/imageBitmapUtils-881d8c64.js +23 -0
- package/dist/imageUtils-57eeedc5.js +69 -0
- package/dist/imageUtils-ef69c578.js +89 -0
- package/dist/imageryUtils-23f51cb1.js +43 -0
- package/dist/index-01c737ed.js +42563 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +22 -10184
- package/dist/infoFor3D-bf4e6c95.js +58 -0
- package/dist/input-message-673a9baa.js +92 -0
- package/dist/input2-bbf6454e.js +575 -0
- package/dist/interactive-aeb2cb9f.js +80 -0
- package/dist/interfaces-fac3cfda.js +7 -0
- package/dist/it_IT-49e70bbf.js +6 -0
- package/dist/ja_JP-eaef2cc3.js +18 -0
- package/dist/json-5febf88a.js +57 -0
- package/dist/jsonContext-2dc288b1.js +15 -0
- package/dist/jsonUtils-1abd4bfc.js +59 -0
- package/dist/jsonUtils-913fa1bd.js +86 -0
- package/dist/jsonUtils-f6a5e63b.js +476 -0
- package/dist/kmlUtils-7c2744fe.js +112 -0
- package/dist/knowledgeGraphService-6a349e04.js +739 -0
- package/dist/knowledgegraph-c91b0bb2.js +149 -0
- package/dist/ko_KR-5c972fd8.js +14 -0
- package/dist/label2-1ab25f27.js +90 -0
- package/dist/labelUtils-a3634e8f.js +61 -0
- package/dist/labelingInfo-568c9210.js +46 -0
- package/dist/layerViewUtils-052e603c.js +10 -0
- package/dist/layersCreator-4a5366ea.js +151 -0
- package/dist/layersLoader-b87d4857.js +197 -0
- package/dist/lazyLayerLoader-8817000c.js +10 -0
- package/dist/lclayout-64c67b4e.js +773 -0
- package/dist/lengthUtils-695e744c.js +5 -0
- package/dist/lerc-wasm-13192bf3.js +325 -0
- package/dist/libtess-asm-4883179d.js +3673 -0
- package/dist/libtess-fc70d1ce.js +269 -0
- package/dist/lineSegment-3aa941f5.js +76 -0
- package/dist/loadGLTFMesh-db6645f5.js +181 -0
- package/dist/loadable-266f324b.js +24 -0
- package/dist/loader-d1ce1bc1.js +79 -0
- package/dist/lt_LT-26f13fd1.js +6 -0
- package/dist/lv_LV-4feafa92.js +18 -0
- package/dist/lyr3DWorker-dd48e619.js +2108 -0
- package/dist/mapViewDeps-226d9da3.js +3052 -0
- package/dist/mask-svg-30f64a7b.js +4 -0
- package/dist/mat3f64-03233387.js +19 -0
- package/dist/mat4f64-cce69db4.js +19 -0
- package/dist/mediaLayerUtils-ae485c27.js +35 -0
- package/dist/meshFeatureSet-8a2ad011.js +126 -0
- package/dist/meshVertexSpaceUtils-6efe3dcc.js +58 -0
- package/dist/multiOriginJSONSupportUtils-207ba4d4.js +6 -0
- package/dist/multidimensionalUtils-508a3f3f.js +290 -0
- package/dist/nb_NO-21543153.js +18 -0
- package/dist/nl_NL-7876d97f.js +7 -0
- package/dist/normalizeUtilsSync-1dae280b.js +181 -0
- package/dist/number-5aa3a81b.js +128 -0
- package/dist/objectIdUtils-93dae423.js +14 -0
- package/dist/objectResourceUtils-642ab03e.js +1455 -0
- package/dist/observers-f646a6a4.js +30 -0
- package/dist/ogcFeatureUtils-46ac1c44.js +206 -0
- package/dist/openCloseComponent-47eb52c6.js +37 -0
- package/dist/orientedBoundingBox-554ccdc6.js +447 -0
- package/dist/originUtils-87edf087.js +9 -0
- package/dist/overlay-svg-c3941b3b.js +4 -0
- package/dist/parser-0701286c.js +488 -0
- package/dist/pbf-5dd791f5.js +215 -0
- package/dist/pbfQueryUtils-a6ca7e23.js +422 -0
- package/dist/pe-wasm-6c16b121.js +887 -0
- package/dist/persistable-9eb0e8df.js +89 -0
- package/dist/perspectiveUtils-b194621d.js +42 -0
- package/dist/pieChart-b97433d0.js +555 -0
- package/dist/pl_PL-276c6dae.js +18 -0
- package/dist/plane-3398eec1.js +160 -0
- package/dist/popupUtils-c444b896.js +22 -0
- package/dist/popupUtils-d871563b.js +50 -0
- package/dist/portalItemUtils-4c4caad0.js +57 -0
- package/dist/portalLayers-cb07742f.js +312 -0
- package/dist/portalUtils-effd590f.js +7 -0
- package/dist/programUtils-65af7b7c.js +59 -0
- package/dist/project-ee9c2947.js +21 -0
- package/dist/projectPointToVector-7dc831a9.js +14 -0
- package/dist/projectVectorToVector-5163db7a.js +13 -0
- package/dist/pt_BR-4fae3055.js +6 -0
- package/dist/pt_PT-14d9efb1.js +6 -0
- package/dist/quantityUtils-5cd4cf90.js +33 -0
- package/dist/quantizationUtils-0a8f74c6.js +68 -0
- package/dist/quat-a508aed3.js +104 -0
- package/dist/quatf64-bec1af25.js +19 -0
- package/dist/query-b6e1fd14.js +89 -0
- package/dist/queryAttachments-7b39ebdc.js +39 -0
- package/dist/queryEngineUtils-cb8e309e.js +21 -0
- package/dist/queryTopFeatures-2e0e3941.js +50 -0
- package/dist/queryZScale-c5733d0a.js +12 -0
- package/dist/rasterProjectionHelper-213afa27.js +577 -0
- package/dist/rasterUtils-f2e44e8b.js +122 -0
- package/dist/rasterizingUtils-25cc0190.js +46 -0
- package/dist/request-e0c679b3.js +46 -0
- package/dist/requestImageUtils-37d79281.js +8 -0
- package/dist/resourceExtension-5f3f1c80.js +17 -0
- package/dist/resourceUtils-0d68cbc2.js +69 -0
- package/dist/resourceUtils-374db840.js +62 -0
- package/dist/resourceUtils-43ce192b.js +42 -0
- package/dist/ro_RO-8e733cf5.js +18 -0
- package/dist/ru_RU-f7bafc90.js +6 -0
- package/dist/saveAPIKeyUtils-1a3d4a8a.js +8 -0
- package/dist/saveUtils-43fdc547.js +24 -0
- package/dist/scaleUtils-bdf8b6cb.js +23 -0
- package/dist/scrim-44eb4dc0.js +114 -0
- package/dist/serviceCapabilitiesUtils-823612b8.js +64 -0
- package/dist/sizeVariableUtils-a1b694d8.js +27 -0
- package/dist/sk_SK-c279eea3.js +6 -0
- package/dist/sl_SL-e40950dd.js +6 -0
- package/dist/sourceUtils-01d115c6.js +71 -0
- package/dist/sphere-908cd9aa.js +199 -0
- package/dist/sr_RS-b1835dfa.js +18 -0
- package/dist/statsWorker-49f9befe.js +37 -0
- package/dist/streamLayerUtils-29324e05.js +31 -0
- package/dist/style.css +1 -1
- package/dist/styleUtils-82e8da52.js +75 -0
- package/dist/styleUtils-8541d60d.js +14 -0
- package/dist/sublayerUtils-eaac2486.js +37 -0
- package/dist/substitute-1f578d70.js +52 -0
- package/dist/sv_SE-15ca9e36.js +6 -0
- package/dist/symbolColorUtils-18fd6b3d.js +8 -0
- package/dist/symbolLayerUtils-4c58b291.js +31 -0
- package/dist/symbologySnappingCandidates-14d94b6b.js +221 -0
- package/dist/t9n-c1c2b6c8.js +349 -0
- package/dist/testSVGPremultipliedAlpha-159dac90.js +94 -0
- package/dist/th_TH-bf624a56.js +18 -0
- package/dist/tileUtils-3e0c8c1d.js +7 -0
- package/dist/timeSupport-3f529cdb.js +410 -0
- package/dist/tr_TR-ca5c315f.js +18 -0
- package/dist/triangle-8a3a2ba8.js +98 -0
- package/dist/types-adba9034.js +19 -0
- package/dist/uk_UA-4b3cb86d.js +6 -0
- package/dist/unitConversionUtils-f0ebaf75.js +17 -0
- package/dist/unitFormatUtils-555e2d94.js +40 -0
- package/dist/uploadAssetErrors-d1389781.js +70 -0
- package/dist/uploadAssets-5e85f09d.js +330 -0
- package/dist/utils-3a10b10c.js +34 -0
- package/dist/utils-505c54e9.js +91 -0
- package/dist/utils-5432e258.js +433 -0
- package/dist/utils-7a88ec6a.js +419 -0
- package/dist/utils-7fa9cdf9.js +2746 -0
- package/dist/utils-d252c575.js +73 -0
- package/dist/utils-f07e00b3.js +232 -0
- package/dist/utils-fda10b4b.js +79 -0
- package/dist/utils3-c34ab97c.js +75 -0
- package/dist/vec3-f79c600d.js +81 -0
- package/dist/vec3f32-304a6a9c.js +36 -0
- package/dist/vec42-36edeb73.js +125 -0
- package/dist/vec4f32-b2628ced.js +38 -0
- package/dist/vec4f64-043e974c.js +45 -0
- package/dist/versionUtils-6935648b.js +161 -0
- package/dist/vi_VN-ad09e708.js +18 -0
- package/dist/visualVariableUtils-c425461a.js +267 -0
- package/dist/webStyleSymbolUtils-4f42a29f.js +48 -0
- package/dist/webglDeps-5f18210d.js +23 -0
- package/dist/wfsUtils-6f7f1e3e.js +343 -0
- package/dist/workerHelper-9dc9a790.js +11 -0
- package/dist/xmlUtils-64cc47e1.js +24 -0
- package/dist/xyChart-e5648fee.js +3335 -0
- package/dist/zh_Hans-61faef57.js +14 -0
- package/dist/zh_Hant-87a9767b.js +14 -0
- package/dist/zipjs-wrapper-1bd67e07.js +6496 -0
- package/package.json +3 -2
|
@@ -0,0 +1,1455 @@
|
|
|
1
|
+
import { a as ma } from "./devEnvironmentUtils-42cb97c7.js";
|
|
2
|
+
import { jZ as pa, j_ as fa, fb as dt, cv as Ct, g6 as va, gf as ga, j$ as St, fs as xa, aS as Ot, fj as Te, e as d, y as ut, c as ba, o as ya, fG as Ta, Q as wa, I as Ma, b as Ca, fg as we, b9 as j, gn as qe, hk as ke, bg as xe, bm as Sa, bf as $t, bn as be, g7 as Et, bo as ht, bc as Oa, fh as $a, aO as Ea, k0 as _a, bI as _t, U as Aa, bO as At, W as Ra, k1 as Rt, hG as Me, s as Na, hs as mt, ge as za, ej as pt, jF as ft, gc as Pa } from "./index-01c737ed.js";
|
|
3
|
+
import { t as Le, e as Nt, o as ee } from "./mat3f64-03233387.js";
|
|
4
|
+
import { e as Ga } from "./mat4f64-cce69db4.js";
|
|
5
|
+
import { e as Y, t as zt, c as f, a as Pt, E as La, b as Je, o as $, d as x, f as se, g as le, h as ce, l as de, s as z, P as Z, i as ja, j as Ze, n as Gt, k as R, m as Ba, p as Fa, q as Ia, r as k, u as Da, v as Lt, w as ue, x as te, y as He, z as _e, A as jt, B as Bt, C as Ae, D as Xe, F as Ke, O as Qe, G as Va, H as Ua, I as ye, J as Wa, K as qa, R as je, L, M as ka, N as Ya, Q as Ja, S as Za, T as Ft, U as It, V as Dt, W as Ce, X as Vt, Y as Ut, Z as Se, _ as Wt, $ as Ha, a0 as Xa, a1 as Ka, a2 as Qa, a3 as eo, a4 as to, a5 as h, a6 as ao, a7 as oo, a8 as Be, a9 as Fe, aa as ro, ab as io, ac as no, ad as so, ae as lo, af as qt, ag as kt, ah as fe } from "./VertexColor.glsl-e415cf02.js";
|
|
6
|
+
import { c as co, x as Yt, L as uo, i as Jt, O as ho, E as mo } from "./BufferView-004ad517.js";
|
|
7
|
+
import { r as po, n as fo, u as vt } from "./vec3-f79c600d.js";
|
|
8
|
+
import { l as vo, n as go, i as X, o as xo, j as bo, k as yo, u as gt, t as To, m as wo } from "./DefaultMaterial_COLOR_GAMMA-337c63aa.js";
|
|
9
|
+
import { r as Ie } from "./resourceUtils-43ce192b.js";
|
|
10
|
+
import { t as Mo } from "./NestedMap-83f8e815.js";
|
|
11
|
+
import { r as Zt } from "./Version-3de8cbca.js";
|
|
12
|
+
import { l as Co } from "./Indices-e6dc3b15.js";
|
|
13
|
+
import { t as So } from "./requestImageUtils-37d79281.js";
|
|
14
|
+
import { t as K } from "./orientedBoundingBox-554ccdc6.js";
|
|
15
|
+
import { s as M, n as he, e as J } from "./basicInterfaces-fa4f5fa7.js";
|
|
16
|
+
import { e as C } from "./VertexAttribute-faad30bf.js";
|
|
17
|
+
import { H as Oo } from "./InterleavedLayout-32973c8a.js";
|
|
18
|
+
import { o as i, S as et, _ as tt, n as Ht, a as Q, c as $o, A as Eo, h as _o, l as Ao, b as Ro, d as No, e as zo } from "./OrderIndependentTransparency-3eadfe42.js";
|
|
19
|
+
import { n as Po, r as Go } from "./vec4f64-043e974c.js";
|
|
20
|
+
import { n as q } from "./symbolColorUtils-18fd6b3d.js";
|
|
21
|
+
import { a as Re } from "./BindType-5e76c8e1.js";
|
|
22
|
+
import "./RenderState-b244097f.js";
|
|
23
|
+
import { D as Oe, G as Lo, t as jo, _ as Bo, O as xt } from "./enums-2c166c09.js";
|
|
24
|
+
import { e as Fo, m as Io } from "./Texture-22a8cca5.js";
|
|
25
|
+
import { s as V } from "./vec42-36edeb73.js";
|
|
26
|
+
function at(e) {
|
|
27
|
+
e.uniforms.add(new Y("mainLightDirection", (t, a) => a.lighting.mainLight.direction));
|
|
28
|
+
}
|
|
29
|
+
function Ne(e) {
|
|
30
|
+
e.uniforms.add(new Y("mainLightIntensity", (t, a) => a.lighting.mainLight.intensity));
|
|
31
|
+
}
|
|
32
|
+
function bt(e) {
|
|
33
|
+
at(e.fragment), Ne(e.fragment), e.fragment.code.add(i`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) {
|
|
34
|
+
float dotVal = clamp(dot(normal_global, mainLightDirection), 0.0, 1.0);
|
|
35
|
+
return mainLightIntensity * ((1.0 - shadowing) * dotVal);
|
|
36
|
+
}`);
|
|
37
|
+
}
|
|
38
|
+
function Do(e) {
|
|
39
|
+
const t = e.fragment.code;
|
|
40
|
+
t.add(i`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)
|
|
41
|
+
{
|
|
42
|
+
return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
|
|
43
|
+
}`), t.add(i`float integratedRadiance(float cosTheta2, float roughness)
|
|
44
|
+
{
|
|
45
|
+
return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
|
|
46
|
+
}`), t.add(i`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)
|
|
47
|
+
{
|
|
48
|
+
float cosTheta2 = 1.0 - RdotNG * RdotNG;
|
|
49
|
+
float intRadTheta = integratedRadiance(cosTheta2, roughness);
|
|
50
|
+
float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
|
|
51
|
+
float sky = 2.0 - ground;
|
|
52
|
+
return (ground * ambientGround + sky * ambientSky) * 0.5;
|
|
53
|
+
}`);
|
|
54
|
+
}
|
|
55
|
+
function ot(e, t) {
|
|
56
|
+
const a = e.fragment.code;
|
|
57
|
+
e.include(zt), t.pbrMode !== f.Normal && t.pbrMode !== f.Schematic && t.pbrMode !== f.Simplified && t.pbrMode !== f.TerrainWithWater || (a.add(i`float normalDistribution(float NdotH, float roughness)
|
|
58
|
+
{
|
|
59
|
+
float a = NdotH * roughness;
|
|
60
|
+
float b = roughness / (1.0 - NdotH * NdotH + a * a);
|
|
61
|
+
return b * b * INV_PI;
|
|
62
|
+
}`), a.add(i`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
|
|
63
|
+
const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040);
|
|
64
|
+
const vec2 c2 = vec2(-1.04, 1.04);
|
|
65
|
+
vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
|
|
66
|
+
vec4 r = roughness * c0 + c1;
|
|
67
|
+
float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
|
|
68
|
+
return c2 * a004 + r.zw;
|
|
69
|
+
}`)), t.pbrMode !== f.Normal && t.pbrMode !== f.Schematic || (e.include(Do), a.add(i`struct PBRShadingInfo
|
|
70
|
+
{
|
|
71
|
+
float NdotL;
|
|
72
|
+
float NdotV;
|
|
73
|
+
float NdotH;
|
|
74
|
+
float VdotH;
|
|
75
|
+
float LdotH;
|
|
76
|
+
float NdotNG;
|
|
77
|
+
float RdotNG;
|
|
78
|
+
float NdotAmbDir;
|
|
79
|
+
float NdotH_Horizon;
|
|
80
|
+
vec3 skyRadianceToSurface;
|
|
81
|
+
vec3 groundRadianceToSurface;
|
|
82
|
+
vec3 skyIrradianceToSurface;
|
|
83
|
+
vec3 groundIrradianceToSurface;
|
|
84
|
+
float averageAmbientRadiance;
|
|
85
|
+
float ssao;
|
|
86
|
+
vec3 albedoLinear;
|
|
87
|
+
vec3 f0;
|
|
88
|
+
vec3 f90;
|
|
89
|
+
vec3 diffuseColor;
|
|
90
|
+
float metalness;
|
|
91
|
+
float roughness;
|
|
92
|
+
};`), a.add(i`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
|
|
93
|
+
vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);
|
|
94
|
+
vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);
|
|
95
|
+
vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
|
|
96
|
+
vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
|
|
97
|
+
vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
|
|
98
|
+
vec3 specularComponent = specularColor * indirectSpecular;
|
|
99
|
+
return (diffuseComponent + specularComponent);
|
|
100
|
+
}`), a.add(i`float gamutMapChanel(float x, vec2 p){
|
|
101
|
+
return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
|
|
102
|
+
}`), a.add(i`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){
|
|
103
|
+
vec3 outColor;
|
|
104
|
+
vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance));
|
|
105
|
+
outColor.x = gamutMapChanel(inColor.x, p) ;
|
|
106
|
+
outColor.y = gamutMapChanel(inColor.y, p) ;
|
|
107
|
+
outColor.z = gamutMapChanel(inColor.z, p) ;
|
|
108
|
+
return outColor;
|
|
109
|
+
}`));
|
|
110
|
+
}
|
|
111
|
+
const Vo = 3e5, De = 5e5;
|
|
112
|
+
function ie(e) {
|
|
113
|
+
if (e == null)
|
|
114
|
+
return null;
|
|
115
|
+
const t = e.offset != null ? e.offset : pa, a = e.rotation != null ? e.rotation : 0, o = e.scale != null ? e.scale : fa, n = Le(1, 0, 0, 0, 1, 0, t[0], t[1], 1), r = Le(Math.cos(a), -Math.sin(a), 0, Math.sin(a), Math.cos(a), 0, 0, 0, 1), c = Le(o[0], 0, 0, 0, o[1], 0, 0, 0, 1), l = Nt();
|
|
116
|
+
return dt(l, r, c), dt(l, n, l), l;
|
|
117
|
+
}
|
|
118
|
+
let Uo = class {
|
|
119
|
+
constructor() {
|
|
120
|
+
this.geometries = new Array(), this.materials = new Array(), this.textures = new Array();
|
|
121
|
+
}
|
|
122
|
+
}, Wo = class {
|
|
123
|
+
constructor(t, a, o) {
|
|
124
|
+
this.name = t, this.lodThreshold = a, this.pivotOffset = o, this.stageResources = new Uo(), this.numberOfVertices = 0;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
function qo(e, t) {
|
|
128
|
+
const a = e.fragment;
|
|
129
|
+
switch (a.code.add(i`struct ShadingNormalParameters {
|
|
130
|
+
vec3 normalView;
|
|
131
|
+
vec3 viewDirection;
|
|
132
|
+
} shadingParams;`), t.doubleSidedMode) {
|
|
133
|
+
case N.None:
|
|
134
|
+
a.code.add(i`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
135
|
+
return normalize(params.normalView);
|
|
136
|
+
}`);
|
|
137
|
+
break;
|
|
138
|
+
case N.View:
|
|
139
|
+
a.code.add(i`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
140
|
+
return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView);
|
|
141
|
+
}`);
|
|
142
|
+
break;
|
|
143
|
+
case N.WindingOrder:
|
|
144
|
+
a.code.add(i`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
145
|
+
return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView);
|
|
146
|
+
}`);
|
|
147
|
+
break;
|
|
148
|
+
default:
|
|
149
|
+
Ct(t.doubleSidedMode);
|
|
150
|
+
case N.COUNT:
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
var N;
|
|
154
|
+
(function(e) {
|
|
155
|
+
e[e.None = 0] = "None", e[e.View = 1] = "View", e[e.WindingOrder = 2] = "WindingOrder", e[e.COUNT = 3] = "COUNT";
|
|
156
|
+
})(N || (N = {}));
|
|
157
|
+
function ko({ normalTexture: e, metallicRoughnessTexture: t, metallicFactor: a, roughnessFactor: o, emissiveTexture: n, emissiveFactor: r, occlusionTexture: c }) {
|
|
158
|
+
return e == null && t == null && n == null && (r == null || va(r, ga)) && c == null && (o == null || o === 1) && (a == null || a === 1);
|
|
159
|
+
}
|
|
160
|
+
const Xt = [1, 1, 0.5], Yo = [0, 0.6, 0.2], Jo = [0, 1, 0.2];
|
|
161
|
+
function Kt(e) {
|
|
162
|
+
e.vertex.code.add(i`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
|
|
163
|
+
vec3 camToVert = posWorld - camPosWorld;
|
|
164
|
+
bool isBackface = dot(camToVert, normalWorld) > 0.0;
|
|
165
|
+
if (isBackface) {
|
|
166
|
+
posClip.z += 0.0000003 * posClip.w;
|
|
167
|
+
}
|
|
168
|
+
return posClip;
|
|
169
|
+
}`);
|
|
170
|
+
}
|
|
171
|
+
function Zo(e) {
|
|
172
|
+
e.vertex.code.add(i`
|
|
173
|
+
vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
|
|
174
|
+
float symbolAlpha = 0.0;
|
|
175
|
+
|
|
176
|
+
const float maxTint = 85.0;
|
|
177
|
+
const float maxReplace = 170.0;
|
|
178
|
+
const float scaleAlpha = 3.0;
|
|
179
|
+
|
|
180
|
+
if (symbolColor.a > maxReplace) {
|
|
181
|
+
colorMixMode = ${i.int(q.Multiply)};
|
|
182
|
+
symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace);
|
|
183
|
+
} else if (symbolColor.a > maxTint) {
|
|
184
|
+
colorMixMode = ${i.int(q.Replace)};
|
|
185
|
+
symbolAlpha = scaleAlpha * (symbolColor.a - maxTint);
|
|
186
|
+
} else if (symbolColor.a > 0.0) {
|
|
187
|
+
colorMixMode = ${i.int(q.Tint)};
|
|
188
|
+
symbolAlpha = scaleAlpha * symbolColor.a;
|
|
189
|
+
} else {
|
|
190
|
+
colorMixMode = ${i.int(q.Multiply)};
|
|
191
|
+
symbolAlpha = 0.0;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha);
|
|
195
|
+
}
|
|
196
|
+
`);
|
|
197
|
+
}
|
|
198
|
+
function Qt(e, t) {
|
|
199
|
+
t.hasSymbolColors ? (e.include(Zo), e.attributes.add(C.SYMBOLCOLOR, "vec4"), e.varyings.add("colorMixMode", "mediump float"), e.vertex.code.add(i`int symbolColorMixMode;
|
|
200
|
+
vec4 getSymbolColor() {
|
|
201
|
+
return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451;
|
|
202
|
+
}
|
|
203
|
+
void forwardColorMixMode() {
|
|
204
|
+
colorMixMode = float(symbolColorMixMode) + 0.5;
|
|
205
|
+
}`)) : (e.fragment.uniforms.add(new Pt("colorMixMode", (a) => La[a.colorMixMode])), e.vertex.code.add(i`vec4 getSymbolColor() { return vec4(1.0); }
|
|
206
|
+
void forwardColorMixMode() {}`));
|
|
207
|
+
}
|
|
208
|
+
function Ho(e) {
|
|
209
|
+
e.fragment.code.add(i`
|
|
210
|
+
#define discardOrAdjustAlpha(color) { if (color.a < ${i.float(Je)}) { discard; } }
|
|
211
|
+
`);
|
|
212
|
+
}
|
|
213
|
+
function H(e, t) {
|
|
214
|
+
Xo(e, t, new $("textureAlphaCutoff", (a) => a.textureAlphaCutoff));
|
|
215
|
+
}
|
|
216
|
+
function Xo(e, t, a) {
|
|
217
|
+
const o = e.fragment;
|
|
218
|
+
switch (t.alphaDiscardMode !== M.Mask && t.alphaDiscardMode !== M.MaskBlend || o.uniforms.add(a), t.alphaDiscardMode) {
|
|
219
|
+
case M.Blend:
|
|
220
|
+
return e.include(Ho);
|
|
221
|
+
case M.Opaque:
|
|
222
|
+
o.code.add(i`void discardOrAdjustAlpha(inout vec4 color) {
|
|
223
|
+
color.a = 1.0;
|
|
224
|
+
}`);
|
|
225
|
+
break;
|
|
226
|
+
case M.Mask:
|
|
227
|
+
o.code.add(i`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);
|
|
228
|
+
break;
|
|
229
|
+
case M.MaskBlend:
|
|
230
|
+
e.fragment.code.add(i`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
function ea(e, t) {
|
|
234
|
+
const { vertex: a, fragment: o } = e, n = t.hasColorTexture && t.alphaDiscardMode !== M.Opaque;
|
|
235
|
+
switch (t.output) {
|
|
236
|
+
case x.LinearDepth:
|
|
237
|
+
case x.Shadow:
|
|
238
|
+
case x.ShadowHighlight:
|
|
239
|
+
case x.ShadowExcludeHighlight:
|
|
240
|
+
case x.ObjectAndLayerIdColor:
|
|
241
|
+
se(a, t), e.include(le, t), e.include(ce, t), e.include(de, t), e.include(Ba, t), e.include(Z, t), e.include(Fa, t), Ia(e), e.varyings.add("depth", "float"), n && o.uniforms.add(new z("tex", (r) => r.texture)), a.code.add(i`void main(void) {
|
|
242
|
+
vpos = getVertexInLocalOriginSpace();
|
|
243
|
+
vpos = subtractOrigin(vpos);
|
|
244
|
+
vpos = addVerticalOffset(vpos, localOrigin);
|
|
245
|
+
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
|
|
246
|
+
forwardTextureCoordinates();
|
|
247
|
+
forwardObjectAndLayerIdColor();
|
|
248
|
+
}`), e.include(H, t), o.code.add(i`
|
|
249
|
+
void main(void) {
|
|
250
|
+
discardBySlice(vpos);
|
|
251
|
+
${n ? i`
|
|
252
|
+
vec4 texColor = texture(tex, ${t.hasColorTextureTransform ? i`colorUV` : i`vuv0`});
|
|
253
|
+
discardOrAdjustAlpha(texColor);` : ""}
|
|
254
|
+
${t.output === x.ObjectAndLayerIdColor ? i`outputObjectAndLayerIdColor();` : i`outputDepth(depth);`}
|
|
255
|
+
}
|
|
256
|
+
`);
|
|
257
|
+
break;
|
|
258
|
+
case x.Normal: {
|
|
259
|
+
se(a, t), e.include(le, t), e.include(Ze, t), e.include(Gt, t), e.include(ce, t), e.include(de, t), n && o.uniforms.add(new z("tex", (c) => c.texture)), t.normalType === R.ScreenDerivative && e.varyings.add("vPositionView", "vec3");
|
|
260
|
+
const r = t.normalType === R.Attribute || t.normalType === R.Compressed;
|
|
261
|
+
a.code.add(i`
|
|
262
|
+
void main(void) {
|
|
263
|
+
vpos = getVertexInLocalOriginSpace();
|
|
264
|
+
|
|
265
|
+
${r ? i`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));` : i`
|
|
266
|
+
// Get vertex position in camera space for screen-space derivative normals
|
|
267
|
+
vPositionView = (view * vec4(vpos, 1.0)).xyz;
|
|
268
|
+
`}
|
|
269
|
+
vpos = subtractOrigin(vpos);
|
|
270
|
+
vpos = addVerticalOffset(vpos, localOrigin);
|
|
271
|
+
gl_Position = transformPosition(proj, view, vpos);
|
|
272
|
+
forwardTextureCoordinates();
|
|
273
|
+
}
|
|
274
|
+
`), e.include(Z, t), e.include(H, t), o.code.add(i`
|
|
275
|
+
void main() {
|
|
276
|
+
discardBySlice(vpos);
|
|
277
|
+
${n ? i`
|
|
278
|
+
vec4 texColor = texture(tex, ${t.hasColorTextureTransform ? i`colorUV` : i`vuv0`});
|
|
279
|
+
discardOrAdjustAlpha(texColor);` : ""}
|
|
280
|
+
|
|
281
|
+
${t.normalType === R.ScreenDerivative ? i`vec3 normal = screenDerivativeNormal(vPositionView);` : i`
|
|
282
|
+
vec3 normal = normalize(vNormalWorld);
|
|
283
|
+
if (gl_FrontFacing == false){
|
|
284
|
+
normal = -normal;
|
|
285
|
+
}`}
|
|
286
|
+
fragColor = vec4(0.5 + 0.5 * normal, 1.0);
|
|
287
|
+
}
|
|
288
|
+
`);
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
case x.Highlight:
|
|
292
|
+
se(a, t), e.include(le, t), e.include(ce, t), e.include(de, t), n && o.uniforms.add(new z("tex", (r) => r.texture)), a.code.add(i`void main(void) {
|
|
293
|
+
vpos = getVertexInLocalOriginSpace();
|
|
294
|
+
vpos = subtractOrigin(vpos);
|
|
295
|
+
vpos = addVerticalOffset(vpos, localOrigin);
|
|
296
|
+
gl_Position = transformPosition(proj, view, vpos);
|
|
297
|
+
forwardTextureCoordinates();
|
|
298
|
+
}`), e.include(Z, t), e.include(H, t), e.include(ja, t), o.code.add(i`
|
|
299
|
+
void main() {
|
|
300
|
+
discardBySlice(vpos);
|
|
301
|
+
${n ? i`
|
|
302
|
+
vec4 texColor = texture(tex, ${t.hasColorTextureTransform ? i`colorUV` : i`vuv0`});
|
|
303
|
+
discardOrAdjustAlpha(texColor);` : ""}
|
|
304
|
+
outputHighlight();
|
|
305
|
+
}
|
|
306
|
+
`);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
function Ko(e, t) {
|
|
310
|
+
const a = e.fragment;
|
|
311
|
+
t.hasVertexTangents ? (e.attributes.add(C.TANGENT, "vec4"), e.varyings.add("vTangent", "vec4"), t.doubleSidedMode === N.WindingOrder ? a.code.add(i`mat3 computeTangentSpace(vec3 normal) {
|
|
312
|
+
float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
|
|
313
|
+
vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
|
|
314
|
+
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
|
|
315
|
+
return mat3(tangent, bitangent, normal);
|
|
316
|
+
}`) : a.code.add(i`mat3 computeTangentSpace(vec3 normal) {
|
|
317
|
+
float tangentHeadedness = vTangent.w;
|
|
318
|
+
vec3 tangent = normalize(vTangent.xyz);
|
|
319
|
+
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
|
|
320
|
+
return mat3(tangent, bitangent, normal);
|
|
321
|
+
}`)) : a.code.add(i`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {
|
|
322
|
+
vec3 Q1 = dFdx(pos);
|
|
323
|
+
vec3 Q2 = dFdy(pos);
|
|
324
|
+
vec2 stx = dFdx(st);
|
|
325
|
+
vec2 sty = dFdy(st);
|
|
326
|
+
float det = stx.t * sty.s - sty.t * stx.s;
|
|
327
|
+
vec3 T = stx.t * Q2 - sty.t * Q1;
|
|
328
|
+
T = T - normal * dot(normal, T);
|
|
329
|
+
T *= inversesqrt(max(dot(T,T), 1.e-10));
|
|
330
|
+
vec3 B = sign(det) * cross(normal, T);
|
|
331
|
+
return mat3(T, B, normal);
|
|
332
|
+
}`), t.textureCoordinateType !== k.None && (e.include(Da, t), a.uniforms.add(t.pbrTextureBindType === Re.Pass ? new z("normalTexture", (o) => o.textureNormal) : new Lt("normalTexture", (o) => o.textureNormal)), t.hasNormalTextureTransform && (a.uniforms.add(new ue("scale", (o) => o.scale ?? St)), a.uniforms.add(new te("normalTextureTransformMatrix", (o) => o.normalTextureTransformMatrix ?? ee))), a.code.add(i`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
|
|
333
|
+
vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`), t.hasNormalTextureTransform && a.code.add(i`mat3 normalTextureRotation = mat3(normalTextureTransformMatrix[0][0]/scale[0], normalTextureTransformMatrix[0][1]/scale[1], 0.0,
|
|
334
|
+
normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
|
|
335
|
+
0.0, 0.0, 0.0 );
|
|
336
|
+
rawNormal.xy = (normalTextureRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`), a.code.add(i`return tangentSpace * rawNormal;
|
|
337
|
+
}`));
|
|
338
|
+
}
|
|
339
|
+
let Qo = class extends He {
|
|
340
|
+
constructor(t, a) {
|
|
341
|
+
super(t, "vec2", Re.Draw, (o, n, r, c) => o.setUniform2fv(t, a(n, r, c)));
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
const Ve = 4;
|
|
345
|
+
function er() {
|
|
346
|
+
const e = new _e(), t = e.fragment;
|
|
347
|
+
e.include(jt);
|
|
348
|
+
const a = (Ve + 1) / 2, o = 1 / (2 * a * a);
|
|
349
|
+
return t.include(Bt), t.uniforms.add(new z("depthMap", (n) => n.depthTexture), new Lt("tex", (n) => n.colorTexture), new Qo("blurSize", (n) => n.blurSize), new $("projScale", (n, r) => {
|
|
350
|
+
const c = xa(r.camera.eye, r.camera.center);
|
|
351
|
+
return c > 5e4 ? Math.max(0, n.projScale - (c - 5e4)) : n.projScale;
|
|
352
|
+
}), new ue("nearFar", (n, r) => r.camera.nearFar)), t.code.add(i`
|
|
353
|
+
void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
|
|
354
|
+
float c = texture(tex, uv).r;
|
|
355
|
+
float d = linearDepthFromTexture(depthMap, uv, nearFar);
|
|
356
|
+
|
|
357
|
+
float ddiff = d - center_d;
|
|
358
|
+
|
|
359
|
+
float w = exp(-r * r * ${i.float(o)} - ddiff * ddiff * sharpness);
|
|
360
|
+
wTotal += w;
|
|
361
|
+
bTotal += w * c;
|
|
362
|
+
}
|
|
363
|
+
`), e.outputs.add("fragBlur", "float"), t.code.add(i`
|
|
364
|
+
void main(void) {
|
|
365
|
+
float b = 0.0;
|
|
366
|
+
float w_total = 0.0;
|
|
367
|
+
|
|
368
|
+
float center_d = linearDepthFromTexture(depthMap, uv, nearFar);
|
|
369
|
+
|
|
370
|
+
float sharpness = -0.05 * projScale / center_d;
|
|
371
|
+
for (int r = -${i.int(Ve)}; r <= ${i.int(Ve)}; ++r) {
|
|
372
|
+
float rf = float(r);
|
|
373
|
+
vec2 uvOffset = uv + rf * blurSize;
|
|
374
|
+
blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
fragBlur = b / w_total;
|
|
378
|
+
}
|
|
379
|
+
`), e;
|
|
380
|
+
}
|
|
381
|
+
const tr = Object.freeze(Object.defineProperty({ __proto__: null, build: er }, Symbol.toStringTag, { value: "Module" }));
|
|
382
|
+
let ta = class aa extends Xe {
|
|
383
|
+
initializeProgram(t) {
|
|
384
|
+
return new Ke(t.rctx, aa.shader.get().build(), Qe);
|
|
385
|
+
}
|
|
386
|
+
initializePipeline() {
|
|
387
|
+
return et({ colorWrite: tt });
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
ta.shader = new Ae(tr, () => import("./SSAOBlur.glsl-f3068b8e.js"));
|
|
391
|
+
const ar = "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";
|
|
392
|
+
let or = class extends Ht {
|
|
393
|
+
constructor() {
|
|
394
|
+
super(...arguments), this.projScale = 1;
|
|
395
|
+
}
|
|
396
|
+
}, rr = class extends or {
|
|
397
|
+
constructor() {
|
|
398
|
+
super(...arguments), this.intensity = 1;
|
|
399
|
+
}
|
|
400
|
+
}, ir = class extends Ht {
|
|
401
|
+
}, nr = class extends ir {
|
|
402
|
+
constructor() {
|
|
403
|
+
super(...arguments), this.blurSize = Ot();
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
const yt = 16;
|
|
407
|
+
function sr() {
|
|
408
|
+
const e = new _e(), t = e.fragment;
|
|
409
|
+
return e.include(jt), e.include(Va), t.include(Bt), t.uniforms.add(new $("radius", (a, o) => rt(o.camera))), t.code.add(i`vec3 sphere[16] = vec3[16](
|
|
410
|
+
vec3(0.186937, 0.0, 0.0),
|
|
411
|
+
vec3(0.700542, 0.0, 0.0),
|
|
412
|
+
vec3(-0.864858, -0.481795, -0.111713),
|
|
413
|
+
vec3(-0.624773, 0.102853, -0.730153),
|
|
414
|
+
vec3(-0.387172, 0.260319, 0.007229),
|
|
415
|
+
vec3(-0.222367, -0.642631, -0.707697),
|
|
416
|
+
vec3(-0.01336, -0.014956, 0.169662),
|
|
417
|
+
vec3(0.122575, 0.1544, -0.456944),
|
|
418
|
+
vec3(-0.177141, 0.85997, -0.42346),
|
|
419
|
+
vec3(-0.131631, 0.814545, 0.524355),
|
|
420
|
+
vec3(-0.779469, 0.007991, 0.624833),
|
|
421
|
+
vec3(0.308092, 0.209288,0.35969),
|
|
422
|
+
vec3(0.359331, -0.184533, -0.377458),
|
|
423
|
+
vec3(0.192633, -0.482999, -0.065284),
|
|
424
|
+
vec3(0.233538, 0.293706, -0.055139),
|
|
425
|
+
vec3(0.417709, -0.386701, 0.442449)
|
|
426
|
+
);
|
|
427
|
+
float fallOffFunction(float vv, float vn, float bias) {
|
|
428
|
+
float f = max(radius * radius - vv, 0.0);
|
|
429
|
+
return f * f * f * max(vn - bias, 0.0);
|
|
430
|
+
}`), t.code.add(i`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) {
|
|
431
|
+
vec3 v = Q - C;
|
|
432
|
+
float vv = dot(v, v);
|
|
433
|
+
float vn = dot(normalize(v), n_C);
|
|
434
|
+
return fallOffFunction(vv, vn, 0.1);
|
|
435
|
+
}`), t.uniforms.add(new ue("nearFar", (a, o) => o.camera.nearFar), new z("normalMap", (a) => a.normalTexture), new z("depthMap", (a) => a.depthTexture), new $("projScale", (a) => a.projScale), new z("rnm", (a) => a.noiseTexture), new ue("rnmScale", (a, o) => Te(Tt, o.camera.fullWidth / a.noiseTexture.descriptor.width, o.camera.fullHeight / a.noiseTexture.descriptor.height)), new $("intensity", (a) => a.intensity), new ue("screenSize", (a, o) => Te(Tt, o.camera.fullWidth, o.camera.fullHeight))), e.outputs.add("fragOcclusion", "float"), t.code.add(i`
|
|
436
|
+
void main(void) {
|
|
437
|
+
float currentPixelDepth = linearDepthFromTexture(depthMap, uv, nearFar);
|
|
438
|
+
|
|
439
|
+
if (-currentPixelDepth > nearFar.y || -currentPixelDepth < nearFar.x) {
|
|
440
|
+
fragOcclusion = 1.0;
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// get the normal of current fragment
|
|
445
|
+
vec4 norm4 = texture(normalMap, uv);
|
|
446
|
+
if(norm4.a != 1.0) {
|
|
447
|
+
fragOcclusion = 1.0;
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
vec3 norm = vec3(-1.0) + 2.0 * norm4.xyz;
|
|
451
|
+
|
|
452
|
+
vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth);
|
|
453
|
+
|
|
454
|
+
float sum = 0.0;
|
|
455
|
+
vec3 tapPixelPos;
|
|
456
|
+
|
|
457
|
+
vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0);
|
|
458
|
+
|
|
459
|
+
// note: the factor 2.0 should not be necessary, but makes ssao much nicer.
|
|
460
|
+
// bug or deviation from CE somewhere else?
|
|
461
|
+
float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y);
|
|
462
|
+
|
|
463
|
+
for(int i = 0; i < ${i.int(yt)}; ++i) {
|
|
464
|
+
vec2 unitOffset = reflect(sphere[i], fres).xy;
|
|
465
|
+
vec2 offset = vec2(-unitOffset * radius * ps);
|
|
466
|
+
|
|
467
|
+
// don't use current or very nearby samples
|
|
468
|
+
if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){
|
|
469
|
+
continue;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
vec2 tc = vec2(gl_FragCoord.xy + offset);
|
|
473
|
+
if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue;
|
|
474
|
+
vec2 tcTap = tc / screenSize;
|
|
475
|
+
float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap, nearFar);
|
|
476
|
+
|
|
477
|
+
tapPixelPos = reconstructPosition(tc, occluderFragmentDepth);
|
|
478
|
+
|
|
479
|
+
sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// output the result
|
|
483
|
+
float A = max(1.0 - sum * intensity / float(${i.int(yt)}), 0.0);
|
|
484
|
+
|
|
485
|
+
// Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2
|
|
486
|
+
A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2;
|
|
487
|
+
|
|
488
|
+
fragOcclusion = A;
|
|
489
|
+
}
|
|
490
|
+
`), e;
|
|
491
|
+
}
|
|
492
|
+
function rt(e) {
|
|
493
|
+
return Math.max(10, 20 * e.computeScreenPixelSizeAtDist(Math.abs(4 * e.relativeElevation)));
|
|
494
|
+
}
|
|
495
|
+
const Tt = Ot(), lr = Object.freeze(Object.defineProperty({ __proto__: null, build: sr, getRadius: rt }, Symbol.toStringTag, { value: "Module" }));
|
|
496
|
+
class ze extends Xe {
|
|
497
|
+
initializeProgram(t) {
|
|
498
|
+
return new Ke(t.rctx, ze.shader.get().build(), Qe);
|
|
499
|
+
}
|
|
500
|
+
initializePipeline() {
|
|
501
|
+
return et({ colorWrite: tt });
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
ze.shader = new Ae(lr, () => import("./SSAO.glsl-5491a708.js"));
|
|
505
|
+
var Ye;
|
|
506
|
+
(function(e) {
|
|
507
|
+
e[e.Antialiasing = 0] = "Antialiasing", e[e.HighQualityTransparency = 1] = "HighQualityTransparency", e[e.HighResolutionVoxel = 2] = "HighResolutionVoxel", e[e.HighResolutionAtmosphere = 3] = "HighResolutionAtmosphere", e[e.SSAO = 4] = "SSAO", e[e.WaterReflection = 5] = "WaterReflection", e[e.HighResolutionShadows = 6] = "HighResolutionShadows", e[e.PhysicalPixelRendering = 7] = "PhysicalPixelRendering";
|
|
508
|
+
})(Ye || (Ye = {}));
|
|
509
|
+
const ne = 2;
|
|
510
|
+
let ve = class extends Ua {
|
|
511
|
+
constructor(e) {
|
|
512
|
+
super(e), this._context = null, this._passParameters = new rr(), this._drawParameters = new nr(), this.produces = /* @__PURE__ */ new Map([[ye.SSAO, () => this._produces()]]);
|
|
513
|
+
}
|
|
514
|
+
_getCameraElevation() {
|
|
515
|
+
var e;
|
|
516
|
+
return ((e = this._context) == null ? void 0 : e.renderContext.bindParameters.camera.relativeElevation) ?? 1 / 0;
|
|
517
|
+
}
|
|
518
|
+
_produces() {
|
|
519
|
+
return this._enableTime != null && this._context != null && this._getCameraElevation() < De;
|
|
520
|
+
}
|
|
521
|
+
consumes() {
|
|
522
|
+
return this._produces() ? Wa : qa;
|
|
523
|
+
}
|
|
524
|
+
initializeRenderContext(e) {
|
|
525
|
+
this._context = e, this.addHandles([ya(() => {
|
|
526
|
+
var t;
|
|
527
|
+
return this.view.qualitySettings.ambientOcclusion || ((t = this._context) == null ? void 0 : t.isFeatureEnabled(Ye.SSAO));
|
|
528
|
+
}, (t) => t ? this._enable() : this._disable(), Ta)]);
|
|
529
|
+
}
|
|
530
|
+
uninitializeRenderContext() {
|
|
531
|
+
this._disable(), this._context = null;
|
|
532
|
+
}
|
|
533
|
+
_disable() {
|
|
534
|
+
this._passParameters.noiseTexture = wa(this._passParameters.noiseTexture), this._enableTime = null;
|
|
535
|
+
}
|
|
536
|
+
destroy() {
|
|
537
|
+
this._disable();
|
|
538
|
+
}
|
|
539
|
+
_enable() {
|
|
540
|
+
var a;
|
|
541
|
+
if (this._enableTime != null || !this._context)
|
|
542
|
+
return;
|
|
543
|
+
const e = Uint8Array.from(atob(ar), (o) => o.charCodeAt(0)), t = new Fo();
|
|
544
|
+
t.wrapMode = Oe.CLAMP_TO_EDGE, t.pixelFormat = Lo.RGB, t.wrapMode = Oe.REPEAT, t.hasMipmap = !0, t.width = 32, t.height = 32, this._passParameters.noiseTexture = new Io(this._context.renderContext.rctx, t, e), this._ssaoTechnique == null && (this._ssaoTechnique = this._context.techniqueRepository.acquire(ze)), this._blurTechnique == null && (this._blurTechnique = this._context.techniqueRepository.acquire(ta)), this._enableTime = Ma(0), (a = this._context) == null || a.requestRender();
|
|
545
|
+
}
|
|
546
|
+
renderNode(e, t, a) {
|
|
547
|
+
const o = e.bindParameters, n = a == null ? void 0 : a.get("normals"), r = n == null ? void 0 : n.getTexture(), c = n == null ? void 0 : n.getTexture(jo);
|
|
548
|
+
if (this._enableTime == null || this._context == null || !r || !c)
|
|
549
|
+
return;
|
|
550
|
+
if (!this._ssaoTechnique.compiled || !this._blurTechnique.compiled)
|
|
551
|
+
return this._enableTime = e.time, void this._context.requestRender();
|
|
552
|
+
this._enableTime === 0 && (this._enableTime = e.time);
|
|
553
|
+
const l = e.rctx, s = o.camera, p = this.view.qualitySettings.fadeDuration, m = s.relativeElevation, v = Ca((De - m) / (De - Vo), 0, 1), b = p > 0 ? Math.min(p, e.time - this._enableTime) / p : 1, y = b * v;
|
|
554
|
+
this._passParameters.normalTexture = r, this._passParameters.depthTexture = c, this._passParameters.projScale = 1 / s.computeScreenPixelSizeAtDist(1), this._passParameters.intensity = 4 * cr / rt(s) ** 6 * y;
|
|
555
|
+
const w = s.fullViewport[2], g = s.fullViewport[3], T = Math.round(w / ne), S = Math.round(g / ne), E = this._context.fbos, _ = E.acquire(w, g, "ssao input", je.RG);
|
|
556
|
+
l.unbindTexture(_.fbo.colorTexture), l.bindFramebuffer(_.fbo), l.setViewport(0, 0, w, g), l.bindTechnique(this._ssaoTechnique, o, this._passParameters, this._drawParameters), l.screen.draw();
|
|
557
|
+
const B = E.acquire(T, S, "ssao blur", je.RED);
|
|
558
|
+
l.unbindTexture(B.fbo.colorTexture), l.bindFramebuffer(B.fbo), this._drawParameters.colorTexture = _.getTexture(), Te(this._drawParameters.blurSize, 0, ne / g), l.bindTechnique(this._blurTechnique, o, this._passParameters, this._drawParameters), l.setViewport(0, 0, T, S), l.screen.draw(), _.release();
|
|
559
|
+
const F = E.acquire(T, S, "ssao", je.RED);
|
|
560
|
+
return l.unbindTexture(F.fbo.colorTexture), l.bindFramebuffer(F.fbo), l.setViewport(0, 0, w, g), l.setClearColor(1, 1, 1, 0), l.clear(Bo.COLOR_BUFFER_BIT), this._drawParameters.colorTexture = B.getTexture(), Te(this._drawParameters.blurSize, ne / w, 0), l.bindTechnique(this._blurTechnique, o, this._passParameters, this._drawParameters), l.setViewport(0, 0, T, S), l.screen.draw(), l.setViewport4fv(s.fullViewport), B.release(), b < 1 && this._context.requestRender(), F;
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
d([ut({ constructOnly: !0 })], ve.prototype, "view", void 0), d([ut()], ve.prototype, "_context", void 0), ve = d([ba("esri.views.3d.webgl-engine.effects.ssao.SSAO")], ve);
|
|
564
|
+
const cr = 0.5;
|
|
565
|
+
function it(e, t) {
|
|
566
|
+
const a = e.fragment;
|
|
567
|
+
t.receiveAmbientOcclusion ? (a.uniforms.add(new z("ssaoTex", (o, n) => {
|
|
568
|
+
var r;
|
|
569
|
+
return (r = n.ssao) == null ? void 0 : r.getTexture();
|
|
570
|
+
})), a.constants.add("blurSizePixelsInverse", "float", 1 / ne), a.code.add(i`float evaluateAmbientOcclusionInverse() {
|
|
571
|
+
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
572
|
+
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
573
|
+
}
|
|
574
|
+
float evaluateAmbientOcclusion() {
|
|
575
|
+
return 1.0 - evaluateAmbientOcclusionInverse();
|
|
576
|
+
}`)) : a.code.add(i`float evaluateAmbientOcclusionInverse() { return 1.0; }
|
|
577
|
+
float evaluateAmbientOcclusion() { return 0.0; }`);
|
|
578
|
+
}
|
|
579
|
+
function dr(e, t) {
|
|
580
|
+
const a = e.fragment, o = t.lightingSphericalHarmonicsOrder !== void 0 ? t.lightingSphericalHarmonicsOrder : 2;
|
|
581
|
+
o === 0 ? (a.uniforms.add(new Y("lightingAmbientSH0", (n, r) => we(wt, r.lighting.sh.r[0], r.lighting.sh.g[0], r.lighting.sh.b[0]))), a.code.add(i`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
582
|
+
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
583
|
+
return ambientLight * (1.0 - ambientOcclusion);
|
|
584
|
+
}`)) : o === 1 ? (a.uniforms.add(new L("lightingAmbientSH_R", (n, r) => V(U, r.lighting.sh.r[0], r.lighting.sh.r[1], r.lighting.sh.r[2], r.lighting.sh.r[3])), new L("lightingAmbientSH_G", (n, r) => V(U, r.lighting.sh.g[0], r.lighting.sh.g[1], r.lighting.sh.g[2], r.lighting.sh.g[3])), new L("lightingAmbientSH_B", (n, r) => V(U, r.lighting.sh.b[0], r.lighting.sh.b[1], r.lighting.sh.b[2], r.lighting.sh.b[3]))), a.code.add(i`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
585
|
+
vec4 sh0 = vec4(
|
|
586
|
+
0.282095,
|
|
587
|
+
0.488603 * normal.x,
|
|
588
|
+
0.488603 * normal.z,
|
|
589
|
+
0.488603 * normal.y
|
|
590
|
+
);
|
|
591
|
+
vec3 ambientLight = vec3(
|
|
592
|
+
dot(lightingAmbientSH_R, sh0),
|
|
593
|
+
dot(lightingAmbientSH_G, sh0),
|
|
594
|
+
dot(lightingAmbientSH_B, sh0)
|
|
595
|
+
);
|
|
596
|
+
return ambientLight * (1.0 - ambientOcclusion);
|
|
597
|
+
}`)) : o === 2 && (a.uniforms.add(new Y("lightingAmbientSH0", (n, r) => we(wt, r.lighting.sh.r[0], r.lighting.sh.g[0], r.lighting.sh.b[0])), new L("lightingAmbientSH_R1", (n, r) => V(U, r.lighting.sh.r[1], r.lighting.sh.r[2], r.lighting.sh.r[3], r.lighting.sh.r[4])), new L("lightingAmbientSH_G1", (n, r) => V(U, r.lighting.sh.g[1], r.lighting.sh.g[2], r.lighting.sh.g[3], r.lighting.sh.g[4])), new L("lightingAmbientSH_B1", (n, r) => V(U, r.lighting.sh.b[1], r.lighting.sh.b[2], r.lighting.sh.b[3], r.lighting.sh.b[4])), new L("lightingAmbientSH_R2", (n, r) => V(U, r.lighting.sh.r[5], r.lighting.sh.r[6], r.lighting.sh.r[7], r.lighting.sh.r[8])), new L("lightingAmbientSH_G2", (n, r) => V(U, r.lighting.sh.g[5], r.lighting.sh.g[6], r.lighting.sh.g[7], r.lighting.sh.g[8])), new L("lightingAmbientSH_B2", (n, r) => V(U, r.lighting.sh.b[5], r.lighting.sh.b[6], r.lighting.sh.b[7], r.lighting.sh.b[8]))), a.code.add(i`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
598
|
+
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
599
|
+
vec4 sh1 = vec4(
|
|
600
|
+
0.488603 * normal.x,
|
|
601
|
+
0.488603 * normal.z,
|
|
602
|
+
0.488603 * normal.y,
|
|
603
|
+
1.092548 * normal.x * normal.y
|
|
604
|
+
);
|
|
605
|
+
vec4 sh2 = vec4(
|
|
606
|
+
1.092548 * normal.y * normal.z,
|
|
607
|
+
0.315392 * (3.0 * normal.z * normal.z - 1.0),
|
|
608
|
+
1.092548 * normal.x * normal.z,
|
|
609
|
+
0.546274 * (normal.x * normal.x - normal.y * normal.y)
|
|
610
|
+
);
|
|
611
|
+
ambientLight += vec3(
|
|
612
|
+
dot(lightingAmbientSH_R1, sh1),
|
|
613
|
+
dot(lightingAmbientSH_G1, sh1),
|
|
614
|
+
dot(lightingAmbientSH_B1, sh1)
|
|
615
|
+
);
|
|
616
|
+
ambientLight += vec3(
|
|
617
|
+
dot(lightingAmbientSH_R2, sh2),
|
|
618
|
+
dot(lightingAmbientSH_G2, sh2),
|
|
619
|
+
dot(lightingAmbientSH_B2, sh2)
|
|
620
|
+
);
|
|
621
|
+
return ambientLight * (1.0 - ambientOcclusion);
|
|
622
|
+
}`), t.pbrMode !== f.Normal && t.pbrMode !== f.Schematic || a.code.add(i`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
|
|
623
|
+
vec3 calculateAmbientRadiance(float ambientOcclusion)
|
|
624
|
+
{
|
|
625
|
+
vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
|
|
626
|
+
return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
|
|
627
|
+
}`));
|
|
628
|
+
}
|
|
629
|
+
const wt = j(), U = Po();
|
|
630
|
+
function nt(e) {
|
|
631
|
+
e.constants.add("ambientBoostFactor", "float", ka);
|
|
632
|
+
}
|
|
633
|
+
function st(e) {
|
|
634
|
+
e.uniforms.add(new $("lightingGlobalFactor", (t, a) => a.lighting.globalFactor));
|
|
635
|
+
}
|
|
636
|
+
function oa(e, t) {
|
|
637
|
+
const a = e.fragment;
|
|
638
|
+
switch (e.include(it, t), t.pbrMode !== f.Disabled && e.include(ot, t), e.include(dr, t), e.include(zt), a.code.add(i`
|
|
639
|
+
const float GAMMA_SRGB = 2.1;
|
|
640
|
+
const float INV_GAMMA_SRGB = 0.4761904;
|
|
641
|
+
${t.pbrMode === f.Disabled ? "" : "const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
|
|
642
|
+
`), nt(a), st(a), at(a), a.code.add(i`
|
|
643
|
+
float additionalDirectedAmbientLight(vec3 vPosWorld) {
|
|
644
|
+
float vndl = dot(${t.spherical ? i`normalize(vPosWorld)` : i`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
|
|
645
|
+
return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
|
|
646
|
+
}
|
|
647
|
+
`), Ne(a), a.code.add(i`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
|
|
648
|
+
float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
|
|
649
|
+
return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
|
|
650
|
+
}`), t.pbrMode) {
|
|
651
|
+
case f.Disabled:
|
|
652
|
+
case f.WaterOnIntegratedMesh:
|
|
653
|
+
case f.Water:
|
|
654
|
+
e.include(bt), a.code.add(i`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)
|
|
655
|
+
{
|
|
656
|
+
vec3 mainLighting = evaluateMainLighting(normalWorld, shadow);
|
|
657
|
+
vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
|
|
658
|
+
vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
|
|
659
|
+
vec3 totalLight = mainLighting + ambientLighting + additionalLight;
|
|
660
|
+
totalLight = min(totalLight, vec3(PI));
|
|
661
|
+
vec3 outColor = vec3((albedoLinear / PI) * totalLight);
|
|
662
|
+
return pow(outColor, vec3(INV_GAMMA_SRGB));
|
|
663
|
+
}`);
|
|
664
|
+
break;
|
|
665
|
+
case f.Normal:
|
|
666
|
+
case f.Schematic:
|
|
667
|
+
a.code.add(i`const float fillLightIntensity = 0.25;
|
|
668
|
+
const float horizonLightDiffusion = 0.4;
|
|
669
|
+
const float additionalAmbientIrradianceFactor = 0.02;
|
|
670
|
+
vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance)
|
|
671
|
+
{
|
|
672
|
+
vec3 viewDirection = -viewDir;
|
|
673
|
+
vec3 h = normalize(viewDirection + mainLightDirection);
|
|
674
|
+
PBRShadingInfo inputs;
|
|
675
|
+
inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
|
|
676
|
+
inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);
|
|
677
|
+
inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0);
|
|
678
|
+
inputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0);
|
|
679
|
+
inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0);
|
|
680
|
+
vec3 reflectedView = normalize(reflect(viewDirection, normal));
|
|
681
|
+
inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0);
|
|
682
|
+
inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
|
|
683
|
+
inputs.ssao = ssao;
|
|
684
|
+
inputs.metalness = mrr[0];
|
|
685
|
+
inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`), a.code.add(i`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
|
|
686
|
+
inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
|
|
687
|
+
inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`), t.useFillLights ? a.uniforms.add(new Ya("hasFillLights", (o, n) => n.enableFillLights)) : a.constants.add("hasFillLights", "bool", !1), a.code.add(i`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]);
|
|
688
|
+
ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
|
|
689
|
+
inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
|
|
690
|
+
vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity;
|
|
691
|
+
vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
|
|
692
|
+
vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
|
|
693
|
+
inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
|
|
694
|
+
inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`), a.uniforms.add(new $("lightingSpecularStrength", (o, n) => n.lighting.mainLight.specularStrength), new $("lightingEnvironmentStrength", (o, n) => n.lighting.mainLight.environmentStrength)), a.code.add(i`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView;
|
|
695
|
+
vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
|
|
696
|
+
inputs.NdotH_Horizon = dot(normal, horizonRingH);
|
|
697
|
+
vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow);
|
|
698
|
+
vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity;
|
|
699
|
+
vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
|
|
700
|
+
float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0));
|
|
701
|
+
inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
|
|
702
|
+
inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
|
|
703
|
+
inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`), a.code.add(i`
|
|
704
|
+
vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
|
|
705
|
+
vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
|
|
706
|
+
vec3 emissionComponent = _emission == vec3(0.0) ? _emission : pow(_emission, vec3(GAMMA_SRGB));
|
|
707
|
+
vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
|
|
708
|
+
${t.pbrMode !== f.Schematic || t.hasColorTexture ? i`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));` : i`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
|
|
709
|
+
return outColor;
|
|
710
|
+
}
|
|
711
|
+
`);
|
|
712
|
+
break;
|
|
713
|
+
case f.Simplified:
|
|
714
|
+
case f.TerrainWithWater:
|
|
715
|
+
e.include(bt), a.code.add(i`const float roughnessTerrain = 0.5;
|
|
716
|
+
const float specularityTerrain = 0.5;
|
|
717
|
+
const vec3 fresnelReflectionTerrain = vec3(0.04);
|
|
718
|
+
vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) {
|
|
719
|
+
vec3 viewDirection = -vd;
|
|
720
|
+
vec3 h = normalize(viewDirection + mainLightDirection);
|
|
721
|
+
float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0);
|
|
722
|
+
float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0);
|
|
723
|
+
float NdotH = clamp(dot(n, h), 0.0, 1.0);
|
|
724
|
+
float NdotNG = clamp(dot(n, nup), -1.0, 1.0);
|
|
725
|
+
vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB));
|
|
726
|
+
float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2];
|
|
727
|
+
vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain;
|
|
728
|
+
vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0));
|
|
729
|
+
vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity;
|
|
730
|
+
vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al;
|
|
731
|
+
vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent;
|
|
732
|
+
vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5;
|
|
733
|
+
vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI;
|
|
734
|
+
vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity;
|
|
735
|
+
vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV);
|
|
736
|
+
vec3 specularColor = f0 * dfg.x + f90 * dfg.y;
|
|
737
|
+
vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent;
|
|
738
|
+
vec3 outColorLinear = outDiffColor + specularComponent;
|
|
739
|
+
vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB));
|
|
740
|
+
return outColor;
|
|
741
|
+
}`);
|
|
742
|
+
break;
|
|
743
|
+
default:
|
|
744
|
+
Ct(t.pbrMode);
|
|
745
|
+
case f.COUNT:
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
class ur extends He {
|
|
749
|
+
constructor(t, a, o) {
|
|
750
|
+
super(t, "mat4", Re.Draw, (n, r, c, l) => n.setUniformMatrix4fv(t, a(r, c, l)), o);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
class hr extends He {
|
|
754
|
+
constructor(t, a, o) {
|
|
755
|
+
super(t, "mat4", Re.Pass, (n, r, c) => n.setUniformMatrix4fv(t, a(r, c)), o);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
function ra(e, t) {
|
|
759
|
+
t.receiveShadows && (e.fragment.uniforms.add(new hr("shadowMapMatrix", (a, o) => o.shadowMap.getShadowMapMatrices(a.origin), 4)), na(e));
|
|
760
|
+
}
|
|
761
|
+
function ia(e, t) {
|
|
762
|
+
t.receiveShadows && (e.fragment.uniforms.add(new ur("shadowMapMatrix", (a, o) => o.shadowMap.getShadowMapMatrices(a.origin), 4)), na(e));
|
|
763
|
+
}
|
|
764
|
+
function na(e) {
|
|
765
|
+
const t = e.fragment;
|
|
766
|
+
t.include(Ja), t.uniforms.add(new z("shadowMap", (a, o) => o.shadowMap.depthTexture), new Pt("numCascades", (a, o) => o.shadowMap.numCascades), new L("cascadeDistances", (a, o) => o.shadowMap.cascadeDistances)), t.code.add(i`int chooseCascade(float depth, out mat4 mat) {
|
|
767
|
+
vec4 distance = cascadeDistances;
|
|
768
|
+
int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
|
|
769
|
+
mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
|
|
770
|
+
return i;
|
|
771
|
+
}
|
|
772
|
+
vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
|
|
773
|
+
vec4 lv = mat * vec4(_vpos, 1.0);
|
|
774
|
+
lv.xy /= lv.w;
|
|
775
|
+
return 0.5 * lv.xyz + vec3(0.5);
|
|
776
|
+
}
|
|
777
|
+
vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) {
|
|
778
|
+
float xScale = float(textureSize.y) / float(textureSize.x);
|
|
779
|
+
return vec2((float(i) + lvpos.x) * xScale, lvpos.y);
|
|
780
|
+
}
|
|
781
|
+
float readShadowMapDepth(ivec2 uv, sampler2D _depthTex) {
|
|
782
|
+
return rgba4ToFloat(texelFetch(_depthTex, uv, 0));
|
|
783
|
+
}
|
|
784
|
+
float posIsInShadow(ivec2 uv, vec3 lvpos, sampler2D _depthTex) {
|
|
785
|
+
return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0;
|
|
786
|
+
}
|
|
787
|
+
float filterShadow(vec2 uv, vec3 lvpos, ivec2 texSize, sampler2D _depthTex) {
|
|
788
|
+
vec2 st = fract(uv * vec2(texSize) + vec2(0.5));
|
|
789
|
+
ivec2 base = ivec2(uv * vec2(texSize) - vec2(0.5));
|
|
790
|
+
float s00 = posIsInShadow(ivec2(base.x, base.y), lvpos, _depthTex);
|
|
791
|
+
float s10 = posIsInShadow(ivec2(base.x + 1, base.y), lvpos, _depthTex);
|
|
792
|
+
float s11 = posIsInShadow(ivec2(base.x + 1, base.y + 1), lvpos, _depthTex);
|
|
793
|
+
float s01 = posIsInShadow(ivec2(base.x, base.y + 1), lvpos, _depthTex);
|
|
794
|
+
return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);
|
|
795
|
+
}
|
|
796
|
+
float readShadowMap(const in vec3 _vpos, float _linearDepth) {
|
|
797
|
+
mat4 mat;
|
|
798
|
+
int i = chooseCascade(_linearDepth, mat);
|
|
799
|
+
if (i >= numCascades) { return 0.0; }
|
|
800
|
+
vec3 lvpos = lightSpacePosition(_vpos, mat);
|
|
801
|
+
if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }
|
|
802
|
+
ivec2 size = textureSize(shadowMap, 0);
|
|
803
|
+
vec2 uv = cascadeCoordinates(i, size, lvpos);
|
|
804
|
+
return filterShadow(uv, lvpos, size, shadowMap);
|
|
805
|
+
}`);
|
|
806
|
+
}
|
|
807
|
+
function mr(e, t) {
|
|
808
|
+
t.hasColorTextureTransform ? (e.vertex.uniforms.add(new te("colorTextureTransformMatrix", (a) => a.colorTextureTransformMatrix ?? ee)), e.varyings.add("colorUV", "vec2"), e.vertex.code.add(i`void forwardColorUV(){
|
|
809
|
+
colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
810
|
+
}`)) : e.vertex.code.add(i`void forwardColorUV(){}`);
|
|
811
|
+
}
|
|
812
|
+
function pr(e, t) {
|
|
813
|
+
t.hasNormalTextureTransform && t.textureCoordinateType !== k.None ? (e.vertex.uniforms.add(new te("normalTextureTransformMatrix", (a) => a.normalTextureTransformMatrix ?? ee)), e.varyings.add("normalUV", "vec2"), e.vertex.code.add(i`void forwardNormalUV(){
|
|
814
|
+
normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
815
|
+
}`)) : e.vertex.code.add(i`void forwardNormalUV(){}`);
|
|
816
|
+
}
|
|
817
|
+
function fr(e, t) {
|
|
818
|
+
t.hasEmissionTextureTransform && t.textureCoordinateType !== k.None ? (e.vertex.uniforms.add(new te("emissiveTextureTransformMatrix", (a) => a.emissiveTextureTransformMatrix ?? ee)), e.varyings.add("emissiveUV", "vec2"), e.vertex.code.add(i`void forwardEmissiveUV(){
|
|
819
|
+
emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
820
|
+
}`)) : e.vertex.code.add(i`void forwardEmissiveUV(){}`);
|
|
821
|
+
}
|
|
822
|
+
function vr(e, t) {
|
|
823
|
+
t.hasOcclusionTextureTransform && t.textureCoordinateType !== k.None ? (e.vertex.uniforms.add(new te("occlusionTextureTransformMatrix", (a) => a.occlusionTextureTransformMatrix ?? ee)), e.varyings.add("occlusionUV", "vec2"), e.vertex.code.add(i`void forwardOcclusionUV(){
|
|
824
|
+
occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
825
|
+
}`)) : e.vertex.code.add(i`void forwardOcclusionUV(){}`);
|
|
826
|
+
}
|
|
827
|
+
function gr(e, t) {
|
|
828
|
+
t.hasMetallicRoughnessTextureTransform && t.textureCoordinateType !== k.None ? (e.vertex.uniforms.add(new te("metallicRoughnessTextureTransformMatrix", (a) => a.metallicRoughnessTextureTransformMatrix ?? ee)), e.varyings.add("metallicRoughnessUV", "vec2"), e.vertex.code.add(i`void forwardMetallicRoughnessUV(){
|
|
829
|
+
metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
830
|
+
}`)) : e.vertex.code.add(i`void forwardMetallicRoughnessUV(){}`);
|
|
831
|
+
}
|
|
832
|
+
function $e(e) {
|
|
833
|
+
e.include(Za), e.code.add(i`
|
|
834
|
+
vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
|
|
835
|
+
// workaround for artifacts in OSX using Intel Iris Pro
|
|
836
|
+
// see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
|
|
837
|
+
vec3 internalMixed = internalColor * textureColor;
|
|
838
|
+
vec3 allMixed = internalMixed * externalColor;
|
|
839
|
+
|
|
840
|
+
if (mode == ${i.int(q.Multiply)}) {
|
|
841
|
+
return allMixed;
|
|
842
|
+
}
|
|
843
|
+
if (mode == ${i.int(q.Ignore)}) {
|
|
844
|
+
return internalMixed;
|
|
845
|
+
}
|
|
846
|
+
if (mode == ${i.int(q.Replace)}) {
|
|
847
|
+
return externalColor;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
// tint (or something invalid)
|
|
851
|
+
float vIn = rgb2v(internalMixed);
|
|
852
|
+
vec3 hsvTint = rgb2hsv(externalColor);
|
|
853
|
+
vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);
|
|
854
|
+
return hsv2rgb(hsvOut);
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
|
|
858
|
+
// workaround for artifacts in OSX using Intel Iris Pro
|
|
859
|
+
// see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
|
|
860
|
+
float internalMixed = internalOpacity * textureOpacity;
|
|
861
|
+
float allMixed = internalMixed * externalOpacity;
|
|
862
|
+
|
|
863
|
+
if (mode == ${i.int(q.Ignore)}) {
|
|
864
|
+
return internalMixed;
|
|
865
|
+
}
|
|
866
|
+
if (mode == ${i.int(q.Replace)}) {
|
|
867
|
+
return externalOpacity;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
// multiply or tint (or something invalid)
|
|
871
|
+
return allMixed;
|
|
872
|
+
}
|
|
873
|
+
`);
|
|
874
|
+
}
|
|
875
|
+
function xr(e) {
|
|
876
|
+
const t = new _e(), { vertex: a, fragment: o, varyings: n } = t;
|
|
877
|
+
if (se(a, e), t.include(Ft), n.add("vpos", "vec3"), t.include(de, e), t.include(It, e), t.include(Dt, e), t.include(mr, e), e.output === x.Color || e.output === x.Alpha) {
|
|
878
|
+
t.include(pr, e), t.include(fr, e), t.include(vr, e), t.include(gr, e), Ce(a, e), t.include(Ze, e), t.include(le, e);
|
|
879
|
+
const r = e.normalType === R.Attribute || e.normalType === R.Compressed;
|
|
880
|
+
r && e.offsetBackfaces && t.include(Kt), t.include(Ko, e), t.include(Gt, e), e.instancedColor && t.attributes.add(C.INSTANCECOLOR, "vec4"), n.add("vPositionLocal", "vec3"), t.include(ce, e), t.include(Vt, e), t.include(Qt, e), t.include(Ut, e), a.uniforms.add(new L("externalColor", (c) => c.externalColor)), n.add("vcolorExt", "vec4"), e.multipassEnabled && n.add("depth", "float"), a.code.add(i`
|
|
881
|
+
void main(void) {
|
|
882
|
+
forwardNormalizedVertexColor();
|
|
883
|
+
vcolorExt = externalColor;
|
|
884
|
+
${e.instancedColor ? "vcolorExt *= instanceColor * 0.003921568627451;" : ""}
|
|
885
|
+
vcolorExt *= vvColor();
|
|
886
|
+
vcolorExt *= getSymbolColor();
|
|
887
|
+
forwardColorMixMode();
|
|
888
|
+
|
|
889
|
+
if (vcolorExt.a < ${i.float(Je)}) {
|
|
890
|
+
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
891
|
+
} else {
|
|
892
|
+
vpos = getVertexInLocalOriginSpace();
|
|
893
|
+
vPositionLocal = vpos - view[3].xyz;
|
|
894
|
+
vpos = subtractOrigin(vpos);
|
|
895
|
+
${r ? i`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));` : ""}
|
|
896
|
+
vpos = addVerticalOffset(vpos, localOrigin);
|
|
897
|
+
${e.hasVertexTangents ? "vTangent = dpTransformVertexTangent(tangent);" : ""}
|
|
898
|
+
gl_Position = transformPosition(proj, view, vpos);
|
|
899
|
+
${r && e.offsetBackfaces ? "gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);" : ""}
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
${e.multipassEnabled ? "depth = (view * vec4(vpos, 1.0)).z;" : ""}
|
|
903
|
+
forwardLinearDepth();
|
|
904
|
+
forwardTextureCoordinates();
|
|
905
|
+
forwardColorUV();
|
|
906
|
+
forwardNormalUV();
|
|
907
|
+
forwardEmissiveUV();
|
|
908
|
+
forwardOcclusionUV();
|
|
909
|
+
forwardMetallicRoughnessUV();
|
|
910
|
+
}
|
|
911
|
+
`);
|
|
912
|
+
}
|
|
913
|
+
switch (e.output) {
|
|
914
|
+
case x.Alpha:
|
|
915
|
+
t.include(Z, e), t.include(H, e), t.include(Se, e), o.uniforms.add(new $("opacity", (r) => r.opacity), new $("layerOpacity", (r) => r.layerOpacity)), e.hasColorTexture && o.uniforms.add(new z("tex", (r) => r.texture)), o.include($e), o.code.add(i`
|
|
916
|
+
void main() {
|
|
917
|
+
discardBySlice(vpos);
|
|
918
|
+
${e.multipassEnabled ? "terrainDepthTest(depth);" : ""}
|
|
919
|
+
${e.hasColorTexture ? i`
|
|
920
|
+
vec4 texColor = texture(tex, ${e.hasColorTextureTransform ? i`colorUV` : i`vuv0`});
|
|
921
|
+
${e.textureAlphaPremultiplied ? "texColor.rgb /= texColor.a;" : ""}
|
|
922
|
+
discardOrAdjustAlpha(texColor);` : i`vec4 texColor = vec4(1.0);`}
|
|
923
|
+
${e.hasVertexColors ? i`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));` : i`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
|
|
924
|
+
fragColor = vec4(opacity_);
|
|
925
|
+
}
|
|
926
|
+
`);
|
|
927
|
+
break;
|
|
928
|
+
case x.Color:
|
|
929
|
+
t.include(Z, e), t.include(oa, e), t.include(it, e), t.include(H, e), t.include(e.instancedDoublePrecision ? ra : ia, e), t.include(Se, e), Ce(o, e), o.uniforms.add(a.uniforms.get("localOrigin"), new Y("ambient", (r) => r.ambient), new Y("diffuse", (r) => r.diffuse), new $("opacity", (r) => r.opacity), new $("layerOpacity", (r) => r.layerOpacity)), e.hasColorTexture && o.uniforms.add(new z("tex", (r) => r.texture)), t.include(Wt, e), t.include(ot, e), o.include($e), t.include(qo, e), nt(o), st(o), Ne(o), o.code.add(i`
|
|
930
|
+
void main() {
|
|
931
|
+
discardBySlice(vpos);
|
|
932
|
+
${e.multipassEnabled ? "terrainDepthTest(depth);" : ""}
|
|
933
|
+
${e.hasColorTexture ? i`
|
|
934
|
+
vec4 texColor = texture(tex, ${e.hasColorTextureTransform ? i`colorUV` : i`vuv0`});
|
|
935
|
+
${e.textureAlphaPremultiplied ? "texColor.rgb /= texColor.a;" : ""}
|
|
936
|
+
discardOrAdjustAlpha(texColor);` : i`vec4 texColor = vec4(1.0);`}
|
|
937
|
+
shadingParams.viewDirection = normalize(vpos - cameraPosition);
|
|
938
|
+
${e.normalType === R.ScreenDerivative ? i`
|
|
939
|
+
vec3 normal = screenDerivativeNormal(vPositionLocal);` : i`
|
|
940
|
+
shadingParams.normalView = vNormalWorld;
|
|
941
|
+
vec3 normal = shadingNormal(shadingParams);`}
|
|
942
|
+
${e.pbrMode === f.Normal ? "applyPBRFactors();" : ""}
|
|
943
|
+
float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
|
|
944
|
+
|
|
945
|
+
vec3 posWorld = vpos + localOrigin;
|
|
946
|
+
|
|
947
|
+
float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
|
|
948
|
+
float shadow = ${e.receiveShadows ? "readShadowMap(vpos, linearDepth)" : e.spherical ? "lightingGlobalFactor * (1.0 - additionalAmbientScale)" : "0.0"};
|
|
949
|
+
|
|
950
|
+
vec3 matColor = max(ambient, diffuse);
|
|
951
|
+
${e.hasVertexColors ? i`
|
|
952
|
+
vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
|
|
953
|
+
float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));` : i`
|
|
954
|
+
vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
|
|
955
|
+
float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
|
|
956
|
+
${e.hasNormalTexture ? i`
|
|
957
|
+
mat3 tangentSpace = ${e.hasVertexTangents ? "computeTangentSpace(normal);" : "computeTangentSpace(normal, vpos, vuv0);"}
|
|
958
|
+
vec3 shadingNormal = computeTextureNormal(tangentSpace, ${e.hasNormalTextureTransform ? i`normalUV` : "vuv0"});` : i`vec3 shadingNormal = normal;`}
|
|
959
|
+
vec3 normalGround = ${e.spherical ? i`normalize(posWorld);` : i`vec3(0.0, 0.0, 1.0);`}
|
|
960
|
+
|
|
961
|
+
${e.snowCover ? i`
|
|
962
|
+
float snow = smoothstep(0.5, 0.55, dot(normal, normalGround));
|
|
963
|
+
albedo = mix(albedo, vec3(1), snow);
|
|
964
|
+
shadingNormal = mix(shadingNormal, normal, snow);
|
|
965
|
+
ssao = mix(ssao, 1.0, snow);` : ""}
|
|
966
|
+
|
|
967
|
+
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
|
|
968
|
+
|
|
969
|
+
${e.pbrMode === f.Normal || e.pbrMode === f.Schematic ? i`
|
|
970
|
+
float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
971
|
+
${e.snowCover ? i`
|
|
972
|
+
mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);
|
|
973
|
+
emission = mix(emission, vec3(0.0), snow);` : ""}
|
|
974
|
+
|
|
975
|
+
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);` : i`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
976
|
+
fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
|
|
977
|
+
${e.transparencyPassType === Q.Color ? i`fragColor = premultiplyAlpha(fragColor);` : ""}
|
|
978
|
+
}
|
|
979
|
+
`);
|
|
980
|
+
}
|
|
981
|
+
return t.include(ea, e), t;
|
|
982
|
+
}
|
|
983
|
+
const br = Object.freeze(Object.defineProperty({ __proto__: null, build: xr }, Symbol.toStringTag, { value: "Module" }));
|
|
984
|
+
let yr = class extends Qa {
|
|
985
|
+
constructor() {
|
|
986
|
+
super(...arguments), this.isSchematic = !1, this.usePBR = !1, this.mrrFactors = ke(Xt), this.hasVertexColors = !1, this.hasSymbolColors = !1, this.doubleSided = !1, this.doubleSidedType = "normal", this.cullFace = J.Back, this.isInstanced = !1, this.hasInstancedColor = !1, this.emissiveFactor = xe(0, 0, 0), this.instancedDoublePrecision = !1, this.normalType = R.Attribute, this.receiveShadows = !0, this.receiveAmbientOcclusion = !0, this.castShadows = !0, this.shadowMappingEnabled = !1, this.ambient = xe(0.2, 0.2, 0.2), this.diffuse = xe(0.8, 0.8, 0.8), this.externalColor = Go(1, 1, 1, 1), this.colorMixMode = "multiply", this.opacity = 1, this.layerOpacity = 1, this.origin = j(), this.hasSlicePlane = !1, this.hasSliceHighlight = !0, this.offsetTransparentBackfaces = !1, this.vvSize = null, this.vvColor = null, this.vvOpacity = null, this.vvSymbolAnchor = null, this.vvSymbolRotationMatrix = null, this.modelTransformation = null, this.transparent = !1, this.writeDepth = !0, this.customDepthTest = he.Less, this.textureAlphaMode = M.Blend, this.textureAlphaCutoff = eo, this.textureAlphaPremultiplied = !1, this.hasOccludees = !1, this.renderOccluded = to.Occlude, this.isDecoration = !1;
|
|
987
|
+
}
|
|
988
|
+
}, lt = class sa extends Xe {
|
|
989
|
+
initializeConfiguration(t, a) {
|
|
990
|
+
a.spherical = t.viewingMode === qe.Global, a.doublePrecisionRequiresObfuscation = t.rctx.driverTest.doublePrecisionRequiresObfuscation.result, a.textureCoordinateType = a.hasColorTexture || a.hasMetallicRoughnessTexture || a.hasEmissionTexture || a.hasOcclusionTexture || a.hasNormalTexture ? k.Default : k.None, a.objectAndLayerIdColorInstanced = a.instanced;
|
|
991
|
+
}
|
|
992
|
+
initializeProgram(t) {
|
|
993
|
+
return this._initializeProgram(t, sa.shader);
|
|
994
|
+
}
|
|
995
|
+
_initializeProgram(t, a) {
|
|
996
|
+
return new Ke(t.rctx, a.get().build(this.configuration), Qe);
|
|
997
|
+
}
|
|
998
|
+
_convertDepthTestFunction(t) {
|
|
999
|
+
return t === he.Lequal ? xt.LEQUAL : xt.LESS;
|
|
1000
|
+
}
|
|
1001
|
+
_makePipeline(t, a) {
|
|
1002
|
+
const o = this.configuration, n = t === Q.NONE, r = t === Q.FrontFace;
|
|
1003
|
+
return et({ blending: o.output !== x.Color && o.output !== x.Alpha || !o.transparent ? null : n ? $o : Eo(t), culling: Tr(o) ? _o(o.cullFace) : null, depthTest: { func: Ao(t, this._convertDepthTestFunction(o.customDepthTest)) }, depthWrite: (n || r) && o.writeDepth ? Ro : null, colorWrite: tt, stencilWrite: o.hasOccludees ? Ha : null, stencilTest: o.hasOccludees ? a ? Xa : Ka : null, polygonOffset: n || r ? null : No(o.enableOffset) });
|
|
1004
|
+
}
|
|
1005
|
+
initializePipeline() {
|
|
1006
|
+
return this._occludeePipelineState = this._makePipeline(this.configuration.transparencyPassType, !0), this._makePipeline(this.configuration.transparencyPassType, !1);
|
|
1007
|
+
}
|
|
1008
|
+
getPipeline(t) {
|
|
1009
|
+
return t ? this._occludeePipelineState : super.getPipeline();
|
|
1010
|
+
}
|
|
1011
|
+
};
|
|
1012
|
+
function Tr(e) {
|
|
1013
|
+
return e.cullFace !== J.None || !e.hasSlicePlane && !e.transparent && !e.doubleSidedMode;
|
|
1014
|
+
}
|
|
1015
|
+
lt.shader = new Ae(br, () => import("./DefaultMaterial.glsl-3cc4efe7.js"));
|
|
1016
|
+
class u extends ao {
|
|
1017
|
+
constructor() {
|
|
1018
|
+
super(...arguments), this.output = x.Color, this.alphaDiscardMode = M.Opaque, this.doubleSidedMode = N.None, this.pbrMode = f.Disabled, this.cullFace = J.None, this.transparencyPassType = Q.NONE, this.normalType = R.Attribute, this.textureCoordinateType = k.None, this.customDepthTest = he.Less, this.spherical = !1, this.hasVertexColors = !1, this.hasSymbolColors = !1, this.hasVerticalOffset = !1, this.hasSlicePlane = !1, this.hasSliceHighlight = !0, this.hasColorTexture = !1, this.hasMetallicRoughnessTexture = !1, this.hasEmissionTexture = !1, this.hasOcclusionTexture = !1, this.hasNormalTexture = !1, this.hasScreenSizePerspective = !1, this.hasVertexTangents = !1, this.hasOccludees = !1, this.multipassEnabled = !1, this.hasModelTransformation = !1, this.offsetBackfaces = !1, this.vvSize = !1, this.vvColor = !1, this.receiveShadows = !1, this.receiveAmbientOcclusion = !1, this.textureAlphaPremultiplied = !1, this.instanced = !1, this.instancedColor = !1, this.objectAndLayerIdColorInstanced = !1, this.instancedDoublePrecision = !1, this.doublePrecisionRequiresObfuscation = !1, this.writeDepth = !0, this.transparent = !1, this.enableOffset = !0, this.cullAboveGround = !1, this.snowCover = !1, this.hasColorTextureTransform = !1, this.hasEmissionTextureTransform = !1, this.hasNormalTextureTransform = !1, this.hasOcclusionTextureTransform = !1, this.hasMetallicRoughnessTextureTransform = !1;
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
d([h({ count: x.COUNT })], u.prototype, "output", void 0), d([h({ count: M.COUNT })], u.prototype, "alphaDiscardMode", void 0), d([h({ count: N.COUNT })], u.prototype, "doubleSidedMode", void 0), d([h({ count: f.COUNT })], u.prototype, "pbrMode", void 0), d([h({ count: J.COUNT })], u.prototype, "cullFace", void 0), d([h({ count: Q.COUNT })], u.prototype, "transparencyPassType", void 0), d([h({ count: R.COUNT })], u.prototype, "normalType", void 0), d([h({ count: k.COUNT })], u.prototype, "textureCoordinateType", void 0), d([h({ count: he.COUNT })], u.prototype, "customDepthTest", void 0), d([h()], u.prototype, "spherical", void 0), d([h()], u.prototype, "hasVertexColors", void 0), d([h()], u.prototype, "hasSymbolColors", void 0), d([h()], u.prototype, "hasVerticalOffset", void 0), d([h()], u.prototype, "hasSlicePlane", void 0), d([h()], u.prototype, "hasSliceHighlight", void 0), d([h()], u.prototype, "hasColorTexture", void 0), d([h()], u.prototype, "hasMetallicRoughnessTexture", void 0), d([h()], u.prototype, "hasEmissionTexture", void 0), d([h()], u.prototype, "hasOcclusionTexture", void 0), d([h()], u.prototype, "hasNormalTexture", void 0), d([h()], u.prototype, "hasScreenSizePerspective", void 0), d([h()], u.prototype, "hasVertexTangents", void 0), d([h()], u.prototype, "hasOccludees", void 0), d([h()], u.prototype, "multipassEnabled", void 0), d([h()], u.prototype, "hasModelTransformation", void 0), d([h()], u.prototype, "offsetBackfaces", void 0), d([h()], u.prototype, "vvSize", void 0), d([h()], u.prototype, "vvColor", void 0), d([h()], u.prototype, "receiveShadows", void 0), d([h()], u.prototype, "receiveAmbientOcclusion", void 0), d([h()], u.prototype, "textureAlphaPremultiplied", void 0), d([h()], u.prototype, "instanced", void 0), d([h()], u.prototype, "instancedColor", void 0), d([h()], u.prototype, "objectAndLayerIdColorInstanced", void 0), d([h()], u.prototype, "instancedDoublePrecision", void 0), d([h()], u.prototype, "doublePrecisionRequiresObfuscation", void 0), d([h()], u.prototype, "writeDepth", void 0), d([h()], u.prototype, "transparent", void 0), d([h()], u.prototype, "enableOffset", void 0), d([h()], u.prototype, "cullAboveGround", void 0), d([h()], u.prototype, "snowCover", void 0), d([h()], u.prototype, "hasColorTextureTransform", void 0), d([h()], u.prototype, "hasEmissionTextureTransform", void 0), d([h()], u.prototype, "hasNormalTextureTransform", void 0), d([h()], u.prototype, "hasOcclusionTextureTransform", void 0), d([h()], u.prototype, "hasMetallicRoughnessTextureTransform", void 0), d([h({ constValue: !1 })], u.prototype, "occlusionPass", void 0), d([h({ constValue: !0 })], u.prototype, "hasVvInstancing", void 0), d([h({ constValue: !1 })], u.prototype, "useCustomDTRExponentForWater", void 0), d([h({ constValue: !1 })], u.prototype, "supportsTextureAtlas", void 0), d([h({ constValue: !0 })], u.prototype, "useFillLights", void 0);
|
|
1022
|
+
function wr(e) {
|
|
1023
|
+
const t = new _e(), { vertex: a, fragment: o, varyings: n } = t;
|
|
1024
|
+
return se(a, e), t.include(Ft), n.add("vpos", "vec3"), t.include(de, e), t.include(It, e), t.include(Dt, e), e.output !== x.Color && e.output !== x.Alpha || (Ce(t.vertex, e), t.include(Ze, e), t.include(le, e), e.offsetBackfaces && t.include(Kt), e.instancedColor && t.attributes.add(C.INSTANCECOLOR, "vec4"), n.add("vNormalWorld", "vec3"), n.add("localvpos", "vec3"), e.multipassEnabled && n.add("depth", "float"), t.include(ce, e), t.include(Vt, e), t.include(Qt, e), t.include(Ut, e), a.uniforms.add(new L("externalColor", (r) => r.externalColor)), n.add("vcolorExt", "vec4"), a.code.add(i`
|
|
1025
|
+
void main(void) {
|
|
1026
|
+
forwardNormalizedVertexColor();
|
|
1027
|
+
vcolorExt = externalColor;
|
|
1028
|
+
${e.instancedColor ? "vcolorExt *= instanceColor * 0.003921568627451;" : ""}
|
|
1029
|
+
vcolorExt *= vvColor();
|
|
1030
|
+
vcolorExt *= getSymbolColor();
|
|
1031
|
+
forwardColorMixMode();
|
|
1032
|
+
|
|
1033
|
+
if (vcolorExt.a < ${i.float(Je)}) {
|
|
1034
|
+
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
1035
|
+
} else {
|
|
1036
|
+
vpos = getVertexInLocalOriginSpace();
|
|
1037
|
+
localvpos = vpos - view[3].xyz;
|
|
1038
|
+
vpos = subtractOrigin(vpos);
|
|
1039
|
+
vNormalWorld = dpNormal(vvLocalNormal(normalModel()));
|
|
1040
|
+
vpos = addVerticalOffset(vpos, localOrigin);
|
|
1041
|
+
gl_Position = transformPosition(proj, view, vpos);
|
|
1042
|
+
${e.offsetBackfaces ? "gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);" : ""}
|
|
1043
|
+
}
|
|
1044
|
+
${e.multipassEnabled ? i`depth = (view * vec4(vpos, 1.0)).z;` : ""}
|
|
1045
|
+
forwardLinearDepth();
|
|
1046
|
+
forwardTextureCoordinates();
|
|
1047
|
+
}
|
|
1048
|
+
`)), e.output === x.Alpha && (t.include(Z, e), t.include(H, e), t.include(Se, e), o.uniforms.add(new $("opacity", (r) => r.opacity), new $("layerOpacity", (r) => r.layerOpacity)), e.hasColorTexture && o.uniforms.add(new z("tex", (r) => r.texture)), o.include($e), o.code.add(i`
|
|
1049
|
+
void main() {
|
|
1050
|
+
discardBySlice(vpos);
|
|
1051
|
+
${e.multipassEnabled ? i`terrainDepthTest(depth);` : ""}
|
|
1052
|
+
${e.hasColorTexture ? i`
|
|
1053
|
+
vec4 texColor = texture(tex, ${e.hasColorTextureTransform ? i`colorUV` : i`vuv0`});
|
|
1054
|
+
${e.textureAlphaPremultiplied ? "texColor.rgb /= texColor.a;" : ""}
|
|
1055
|
+
discardOrAdjustAlpha(texColor);` : i`vec4 texColor = vec4(1.0);`}
|
|
1056
|
+
${e.hasVertexColors ? i`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));` : i`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
|
|
1057
|
+
|
|
1058
|
+
fragColor = vec4(opacity_);
|
|
1059
|
+
}
|
|
1060
|
+
`)), e.output === x.Color && (t.include(Z, e), t.include(oa, e), t.include(it, e), t.include(H, e), t.include(e.instancedDoublePrecision ? ra : ia, e), t.include(Se, e), Ce(t.fragment, e), at(o), nt(o), st(o), o.uniforms.add(a.uniforms.get("localOrigin"), a.uniforms.get("view"), new Y("ambient", (r) => r.ambient), new Y("diffuse", (r) => r.diffuse), new $("opacity", (r) => r.opacity), new $("layerOpacity", (r) => r.layerOpacity)), e.hasColorTexture && o.uniforms.add(new z("tex", (r) => r.texture)), t.include(Wt, e), t.include(ot, e), o.include($e), Ne(o), o.code.add(i`
|
|
1061
|
+
void main() {
|
|
1062
|
+
discardBySlice(vpos);
|
|
1063
|
+
${e.multipassEnabled ? i`terrainDepthTest(depth);` : ""}
|
|
1064
|
+
${e.hasColorTexture ? i`
|
|
1065
|
+
vec4 texColor = texture(tex, ${e.hasColorTextureTransform ? i`colorUV` : i`vuv0`});
|
|
1066
|
+
${e.textureAlphaPremultiplied ? "texColor.rgb /= texColor.a;" : ""}
|
|
1067
|
+
discardOrAdjustAlpha(texColor);` : i`vec4 texColor = vec4(1.0);`}
|
|
1068
|
+
vec3 viewDirection = normalize(vpos - cameraPosition);
|
|
1069
|
+
${e.pbrMode === f.Normal ? "applyPBRFactors();" : ""}
|
|
1070
|
+
float ssao = evaluateAmbientOcclusionInverse();
|
|
1071
|
+
ssao *= getBakedOcclusion();
|
|
1072
|
+
|
|
1073
|
+
float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
|
|
1074
|
+
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
|
|
1075
|
+
${e.receiveShadows ? "float shadow = readShadowMap(vpos, linearDepth);" : e.spherical ? "float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);" : "float shadow = 0.0;"}
|
|
1076
|
+
vec3 matColor = max(ambient, diffuse);
|
|
1077
|
+
${e.hasVertexColors ? i`
|
|
1078
|
+
vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
|
|
1079
|
+
float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));` : i`
|
|
1080
|
+
vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
|
|
1081
|
+
float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
|
|
1082
|
+
${e.snowCover ? i`albedo = mix(albedo, vec3(1), 0.9);` : i``}
|
|
1083
|
+
${i`
|
|
1084
|
+
vec3 shadingNormal = normalize(vNormalWorld);
|
|
1085
|
+
albedo *= 1.2;
|
|
1086
|
+
vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
|
|
1087
|
+
float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
|
|
1088
|
+
float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);
|
|
1089
|
+
float treeRadialFalloff = vColor.r;
|
|
1090
|
+
float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
|
|
1091
|
+
additionalLight += backLightFactor * mainLightIntensity;`}
|
|
1092
|
+
${e.pbrMode === f.Normal || e.pbrMode === f.Schematic ? e.spherical ? i`vec3 normalGround = normalize(vpos + localOrigin);` : i`vec3 normalGround = vec3(0.0, 0.0, 1.0);` : i``}
|
|
1093
|
+
${e.pbrMode === f.Normal || e.pbrMode === f.Schematic ? i`
|
|
1094
|
+
float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
1095
|
+
${e.snowCover ? i`
|
|
1096
|
+
mrr = vec3(0.0, 1.0, 0.04);
|
|
1097
|
+
emission = vec3(0.0);` : ""}
|
|
1098
|
+
|
|
1099
|
+
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);` : i`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
1100
|
+
fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
|
|
1101
|
+
${e.transparencyPassType === Q.Color ? i`fragColor = premultiplyAlpha(fragColor);` : i``}
|
|
1102
|
+
}
|
|
1103
|
+
`)), t.include(ea, e), t;
|
|
1104
|
+
}
|
|
1105
|
+
const Mr = Object.freeze(Object.defineProperty({ __proto__: null, build: wr }, Symbol.toStringTag, { value: "Module" }));
|
|
1106
|
+
class Pe extends lt {
|
|
1107
|
+
initializeConfiguration(t, a) {
|
|
1108
|
+
super.initializeConfiguration(t, a), a.hasMetallicRoughnessTexture = !1, a.hasEmissionTexture = !1, a.hasOcclusionTexture = !1, a.hasNormalTexture = !1, a.hasModelTransformation = !1, a.normalType = R.Attribute, a.doubleSidedMode = N.WindingOrder, a.hasVertexTangents = !1;
|
|
1109
|
+
}
|
|
1110
|
+
initializeProgram(t) {
|
|
1111
|
+
return this._initializeProgram(t, Pe.shader);
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
Pe.shader = new Ae(Mr, () => import("./RealisticTree.glsl-bc07c4dc.js"));
|
|
1115
|
+
let Ee = class extends oo {
|
|
1116
|
+
constructor(t) {
|
|
1117
|
+
super(t, Or), this.supportsEdges = !0, this.produces = /* @__PURE__ */ new Map([[ye.OPAQUE_MATERIAL, (a) => (Be(a) || Fe(a)) && !this.parameters.transparent], [ye.TRANSPARENT_MATERIAL, (a) => (Be(a) || Fe(a)) && this.parameters.transparent && this.parameters.writeDepth], [ye.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL, (a) => (Be(a) || Fe(a)) && this.parameters.transparent && !this.parameters.writeDepth]]), this._configuration = new u(), this._vertexBufferLayout = $r(this.parameters);
|
|
1118
|
+
}
|
|
1119
|
+
isVisibleForOutput(t) {
|
|
1120
|
+
return t !== x.Shadow && t !== x.ShadowExcludeHighlight && t !== x.ShadowHighlight || this.parameters.castShadows;
|
|
1121
|
+
}
|
|
1122
|
+
isVisible() {
|
|
1123
|
+
const t = this.parameters;
|
|
1124
|
+
if (!super.isVisible() || t.layerOpacity === 0)
|
|
1125
|
+
return !1;
|
|
1126
|
+
const { hasInstancedColor: a, hasVertexColors: o, hasSymbolColors: n, vvColor: r } = t, c = t.colorMixMode === "replace", l = t.opacity > 0, s = t.externalColor && t.externalColor[3] > 0, p = a || r || n;
|
|
1127
|
+
return o && p ? c || l : o ? c ? s : l : p ? c || l : c ? s : l;
|
|
1128
|
+
}
|
|
1129
|
+
getConfiguration(t, a) {
|
|
1130
|
+
return this._configuration.output = t, this._configuration.hasNormalTexture = !!this.parameters.normalTextureId, this._configuration.hasColorTexture = !!this.parameters.textureId, this._configuration.hasVertexTangents = this.parameters.hasVertexTangents, this._configuration.instanced = this.parameters.isInstanced, this._configuration.instancedDoublePrecision = this.parameters.instancedDoublePrecision, this._configuration.vvSize = !!this.parameters.vvSize, this._configuration.hasVerticalOffset = this.parameters.verticalOffset != null, this._configuration.hasScreenSizePerspective = this.parameters.screenSizePerspective != null, this._configuration.hasSlicePlane = this.parameters.hasSlicePlane, this._configuration.hasSliceHighlight = this.parameters.hasSliceHighlight, this._configuration.alphaDiscardMode = this.parameters.textureAlphaMode, this._configuration.normalType = this.parameters.normalType, this._configuration.transparent = this.parameters.transparent, this._configuration.writeDepth = this.parameters.writeDepth, this.parameters.customDepthTest != null && (this._configuration.customDepthTest = this.parameters.customDepthTest), this._configuration.hasOccludees = this.parameters.hasOccludees, this._configuration.cullFace = this.parameters.hasSlicePlane ? J.None : this.parameters.cullFace, this._configuration.multipassEnabled = a.multipassEnabled, this._configuration.cullAboveGround = a.multipassTerrain.cullAboveGround, this._configuration.hasModelTransformation = this.parameters.modelTransformation != null, t !== x.Color && t !== x.Alpha || (this._configuration.hasVertexColors = this.parameters.hasVertexColors, this._configuration.hasSymbolColors = this.parameters.hasSymbolColors, this.parameters.treeRendering ? this._configuration.doubleSidedMode = N.WindingOrder : this._configuration.doubleSidedMode = this.parameters.doubleSided && this.parameters.doubleSidedType === "normal" ? N.View : this.parameters.doubleSided && this.parameters.doubleSidedType === "winding-order" ? N.WindingOrder : N.None, this._configuration.instancedColor = this.parameters.hasInstancedColor, this._configuration.receiveShadows = this.parameters.receiveShadows && this.parameters.shadowMappingEnabled, this._configuration.receiveAmbientOcclusion = this.parameters.receiveAmbientOcclusion && a.ssao != null, this._configuration.vvColor = !!this.parameters.vvColor, this._configuration.textureAlphaPremultiplied = !!this.parameters.textureAlphaPremultiplied, this._configuration.pbrMode = this.parameters.usePBR ? this.parameters.isSchematic ? f.Schematic : f.Normal : f.Disabled, this._configuration.hasMetallicRoughnessTexture = !!this.parameters.metallicRoughnessTextureId, this._configuration.hasEmissionTexture = !!this.parameters.emissiveTextureId, this._configuration.hasOcclusionTexture = !!this.parameters.occlusionTextureId, this._configuration.offsetBackfaces = !(!this.parameters.transparent || !this.parameters.offsetTransparentBackfaces), this._configuration.transparencyPassType = a.transparencyPassType, this._configuration.enableOffset = a.camera.relativeElevation < zo, this._configuration.snowCover = this.hasSnowCover(a), this._configuration.hasColorTextureTransform = !!this.parameters.colorTextureTransformMatrix, this._configuration.hasNormalTextureTransform = !!this.parameters.normalTextureTransformMatrix, this._configuration.hasEmissionTextureTransform = !!this.parameters.emissiveTextureTransformMatrix, this._configuration.hasOcclusionTextureTransform = !!this.parameters.occlusionTextureTransformMatrix, this._configuration.hasMetallicRoughnessTextureTransform = !!this.parameters.metallicRoughnessTextureTransformMatrix), this._configuration;
|
|
1131
|
+
}
|
|
1132
|
+
hasSnowCover(t) {
|
|
1133
|
+
return t.weather != null && t.weatherVisible && t.weather.type === "snowy" && t.weather.snowCover === "enabled";
|
|
1134
|
+
}
|
|
1135
|
+
intersect(t, a, o, n, r, c) {
|
|
1136
|
+
if (this.parameters.verticalOffset != null) {
|
|
1137
|
+
const l = o.camera;
|
|
1138
|
+
we(We, a[12], a[13], a[14]);
|
|
1139
|
+
let s = null;
|
|
1140
|
+
switch (o.viewingMode) {
|
|
1141
|
+
case qe.Global:
|
|
1142
|
+
s = $t(Mt, We);
|
|
1143
|
+
break;
|
|
1144
|
+
case qe.Local:
|
|
1145
|
+
s = Sa(Mt, Ar);
|
|
1146
|
+
}
|
|
1147
|
+
let p = 0;
|
|
1148
|
+
const m = be(Rr, We, l.eye), v = Et(m), b = ht(m, m, 1 / v);
|
|
1149
|
+
let y = null;
|
|
1150
|
+
this.parameters.screenSizePerspective && (y = Oa(s, b)), p += ro(l, v, this.parameters.verticalOffset, y ?? 0, this.parameters.screenSizePerspective), ht(s, s, p), $a(Ue, s, o.transform.inverseRotation), n = be(Er, n, Ue), r = be(_r, r, Ue);
|
|
1151
|
+
}
|
|
1152
|
+
io(t, o, n, r, no(o.verticalOffset), c);
|
|
1153
|
+
}
|
|
1154
|
+
createGLMaterial(t) {
|
|
1155
|
+
return new Cr(t);
|
|
1156
|
+
}
|
|
1157
|
+
createBufferWriter() {
|
|
1158
|
+
return new so(this._vertexBufferLayout);
|
|
1159
|
+
}
|
|
1160
|
+
}, Cr = class extends lo {
|
|
1161
|
+
constructor(t) {
|
|
1162
|
+
super({ ...t, ...t.material.parameters });
|
|
1163
|
+
}
|
|
1164
|
+
_updateShadowState(t) {
|
|
1165
|
+
t.shadowMap.enabled !== this._material.parameters.shadowMappingEnabled && this._material.setParameters({ shadowMappingEnabled: t.shadowMap.enabled });
|
|
1166
|
+
}
|
|
1167
|
+
_updateOccludeeState(t) {
|
|
1168
|
+
t.hasOccludees !== this._material.parameters.hasOccludees && this._material.setParameters({ hasOccludees: t.hasOccludees });
|
|
1169
|
+
}
|
|
1170
|
+
beginSlot(t) {
|
|
1171
|
+
this._output !== x.Color && this._output !== x.Alpha || (this._updateShadowState(t), this._updateOccludeeState(t));
|
|
1172
|
+
const a = this._material.parameters;
|
|
1173
|
+
this.updateTexture(a.textureId);
|
|
1174
|
+
const o = t.camera.viewInverseTransposeMatrix;
|
|
1175
|
+
return we(a.origin, o[3], o[7], o[11]), this._material.setParameters(this.textureBindParameters), this.ensureTechnique(a.treeRendering ? Pe : lt, t);
|
|
1176
|
+
}
|
|
1177
|
+
};
|
|
1178
|
+
class Sr extends yr {
|
|
1179
|
+
constructor() {
|
|
1180
|
+
super(...arguments), this.initTextureTransparent = !1, this.treeRendering = !1, this.hasVertexTangents = !1;
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
const Or = new Sr();
|
|
1184
|
+
function $r(e) {
|
|
1185
|
+
const t = Oo().vec3f(C.POSITION);
|
|
1186
|
+
return e.normalType === R.Compressed ? t.vec2i16(C.NORMALCOMPRESSED, { glNormalized: !0 }) : t.vec3f(C.NORMAL), e.hasVertexTangents && t.vec4f(C.TANGENT), (e.textureId || e.normalTextureId || e.metallicRoughnessTextureId || e.emissiveTextureId || e.occlusionTextureId) && t.vec2f(C.UV0), e.hasVertexColors && t.vec4u8(C.COLOR), e.hasSymbolColors && t.vec4u8(C.SYMBOLCOLOR), Ea("enable-feature:objectAndLayerId-rendering") && t.vec4u8(C.OBJECTANDLAYERIDCOLOR), t;
|
|
1187
|
+
}
|
|
1188
|
+
const Er = j(), _r = j(), Ar = xe(0, 0, 1), Mt = j(), Ue = j(), We = j(), Rr = j(), W = () => Na.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");
|
|
1189
|
+
async function Nr(e, t) {
|
|
1190
|
+
const a = await zr(e, t), o = await Br(a.textureDefinitions ?? {}, t);
|
|
1191
|
+
let n = 0;
|
|
1192
|
+
for (const r in o)
|
|
1193
|
+
if (o.hasOwnProperty(r)) {
|
|
1194
|
+
const c = o[r];
|
|
1195
|
+
n += c != null && c.image ? c.image.width * c.image.height * 4 : 0;
|
|
1196
|
+
}
|
|
1197
|
+
return { resource: a, textures: o, size: n + _a(a) };
|
|
1198
|
+
}
|
|
1199
|
+
async function zr(e, t) {
|
|
1200
|
+
const a = t == null ? void 0 : t.streamDataRequester;
|
|
1201
|
+
if (a)
|
|
1202
|
+
return Pr(e, a, t);
|
|
1203
|
+
const o = await _t(Aa(e, t));
|
|
1204
|
+
if (o.ok === !0)
|
|
1205
|
+
return o.value.data;
|
|
1206
|
+
At(o.error), la(o.error);
|
|
1207
|
+
}
|
|
1208
|
+
async function Pr(e, t, a) {
|
|
1209
|
+
const o = await _t(t.request(e, "json", a));
|
|
1210
|
+
if (o.ok === !0)
|
|
1211
|
+
return o.value;
|
|
1212
|
+
At(o.error), la(o.error.details.url);
|
|
1213
|
+
}
|
|
1214
|
+
function la(e) {
|
|
1215
|
+
throw new Ra("", `Request for object resource failed: ${e}`);
|
|
1216
|
+
}
|
|
1217
|
+
function Gr(e) {
|
|
1218
|
+
const t = e.params, a = t.topology;
|
|
1219
|
+
let o = !0;
|
|
1220
|
+
switch (t.vertexAttributes || (W().warn("Geometry must specify vertex attributes"), o = !1), t.topology) {
|
|
1221
|
+
case "PerAttributeArray":
|
|
1222
|
+
break;
|
|
1223
|
+
case "Indexed":
|
|
1224
|
+
case null:
|
|
1225
|
+
case void 0: {
|
|
1226
|
+
const r = t.faces;
|
|
1227
|
+
if (r) {
|
|
1228
|
+
if (t.vertexAttributes)
|
|
1229
|
+
for (const c in t.vertexAttributes) {
|
|
1230
|
+
const l = r[c];
|
|
1231
|
+
l != null && l.values ? (l.valueType != null && l.valueType !== "UInt32" && (W().warn(`Unsupported indexed geometry indices type '${l.valueType}', only UInt32 is currently supported`), o = !1), l.valuesPerElement != null && l.valuesPerElement !== 1 && (W().warn(`Unsupported indexed geometry values per element '${l.valuesPerElement}', only 1 is currently supported`), o = !1)) : (W().warn(`Indexed geometry does not specify face indices for '${c}' attribute`), o = !1);
|
|
1232
|
+
}
|
|
1233
|
+
} else
|
|
1234
|
+
W().warn("Indexed geometries must specify faces"), o = !1;
|
|
1235
|
+
break;
|
|
1236
|
+
}
|
|
1237
|
+
default:
|
|
1238
|
+
W().warn(`Unsupported topology '${a}'`), o = !1;
|
|
1239
|
+
}
|
|
1240
|
+
e.params.material || (W().warn("Geometry requires material"), o = !1);
|
|
1241
|
+
const n = e.params.vertexAttributes;
|
|
1242
|
+
for (const r in n)
|
|
1243
|
+
n[r].values || (W().warn("Geometries with externally defined attributes are not yet supported"), o = !1);
|
|
1244
|
+
return o;
|
|
1245
|
+
}
|
|
1246
|
+
function Lr(e, t) {
|
|
1247
|
+
var w, g;
|
|
1248
|
+
const a = new Array(), o = new Array(), n = new Array(), r = new Mo(), c = e.resource, l = Zt.parse(c.version || "1.0", "wosr");
|
|
1249
|
+
Ir.validate(l);
|
|
1250
|
+
const s = c.model.name, p = c.model.geometries, m = c.materialDefinitions ?? {}, v = e.textures;
|
|
1251
|
+
let b = 0;
|
|
1252
|
+
const y = /* @__PURE__ */ new Map();
|
|
1253
|
+
for (let T = 0; T < p.length; T++) {
|
|
1254
|
+
const S = p[T];
|
|
1255
|
+
if (!Gr(S))
|
|
1256
|
+
continue;
|
|
1257
|
+
const E = Fr(S), _ = S.params.vertexAttributes, B = [], F = (O) => {
|
|
1258
|
+
if (S.params.topology === "PerAttributeArray")
|
|
1259
|
+
return null;
|
|
1260
|
+
const I = S.params.faces;
|
|
1261
|
+
for (const D in I)
|
|
1262
|
+
if (D === O)
|
|
1263
|
+
return I[D].values;
|
|
1264
|
+
return null;
|
|
1265
|
+
}, ae = _[C.POSITION], me = ae.values.length / ae.valuesPerElement;
|
|
1266
|
+
for (const O in _) {
|
|
1267
|
+
const I = _[O], D = I.values, Ge = F(O) ?? Co(me);
|
|
1268
|
+
B.push([O, new K(D, Ge, I.valuesPerElement, !0)]);
|
|
1269
|
+
}
|
|
1270
|
+
const P = E.texture, A = v && v[P];
|
|
1271
|
+
if (A && !y.has(P)) {
|
|
1272
|
+
const { image: O, parameters: I } = A, D = new qt(O, I);
|
|
1273
|
+
o.push(D), y.set(P, D);
|
|
1274
|
+
}
|
|
1275
|
+
const pe = y.get(P), oe = pe ? pe.id : void 0, G = E.material;
|
|
1276
|
+
let re = r.get(G, P);
|
|
1277
|
+
if (re == null) {
|
|
1278
|
+
const O = m[G.substring(G.lastIndexOf("/") + 1)].params;
|
|
1279
|
+
O.transparency === 1 && (O.transparency = 0);
|
|
1280
|
+
const I = A && A.alphaChannelUsage, D = O.transparency > 0 || I === "transparency" || I === "maskAndTransparency", Ge = A ? ca(A.alphaChannelUsage) : void 0, ct = { ambient: ke(O.diffuse), diffuse: ke(O.diffuse), opacity: 1 - (O.transparency || 0), transparent: D, textureAlphaMode: Ge, textureAlphaCutoff: 0.33, textureId: oe, initTextureTransparent: !0, doubleSided: !0, cullFace: J.None, colorMixMode: O.externalColorMixMode || "tint", textureAlphaPremultiplied: (A == null ? void 0 : A.parameters.preMultiplyAlpha) ?? !1 };
|
|
1281
|
+
t != null && t.materialParameters && Object.assign(ct, t.materialParameters), re = new Ee(ct), r.set(G, P, re);
|
|
1282
|
+
}
|
|
1283
|
+
n.push(re);
|
|
1284
|
+
const ha = new kt(re, B);
|
|
1285
|
+
b += ((g = (w = B.find((O) => O[0] === C.POSITION)) == null ? void 0 : w[1]) == null ? void 0 : g.indices.length) ?? 0, a.push(ha);
|
|
1286
|
+
}
|
|
1287
|
+
return { engineResources: [{ name: s, stageResources: { textures: o, materials: n, geometries: a }, pivotOffset: c.model.pivotOffset, numberOfVertices: b, lodThreshold: null }], referenceBoundingBox: jr(a) };
|
|
1288
|
+
}
|
|
1289
|
+
function jr(e) {
|
|
1290
|
+
const t = Rt();
|
|
1291
|
+
return e.forEach((a) => {
|
|
1292
|
+
const o = a.boundingInfo;
|
|
1293
|
+
o != null && (Me(t, o.bbMin), Me(t, o.bbMax));
|
|
1294
|
+
}), t;
|
|
1295
|
+
}
|
|
1296
|
+
async function Br(e, t) {
|
|
1297
|
+
const a = new Array();
|
|
1298
|
+
for (const r in e) {
|
|
1299
|
+
const c = e[r], l = c.images[0].data;
|
|
1300
|
+
if (!l) {
|
|
1301
|
+
W().warn("Externally referenced texture data is not yet supported");
|
|
1302
|
+
continue;
|
|
1303
|
+
}
|
|
1304
|
+
const s = c.encoding + ";base64," + l, p = "/textureDefinitions/" + r, m = c.channels === "rgba" ? c.alphaChannelUsage || "transparency" : "none", v = { noUnpackFlip: !0, wrap: { s: Oe.REPEAT, t: Oe.REPEAT }, preMultiplyAlpha: ca(m) !== M.Opaque }, b = t != null && t.disableTextures ? Promise.resolve(null) : So(s, t);
|
|
1305
|
+
a.push(b.then((y) => ({ refId: p, image: y, parameters: v, alphaChannelUsage: m })));
|
|
1306
|
+
}
|
|
1307
|
+
const o = await Promise.all(a), n = {};
|
|
1308
|
+
for (const r of o)
|
|
1309
|
+
n[r.refId] = r;
|
|
1310
|
+
return n;
|
|
1311
|
+
}
|
|
1312
|
+
function ca(e) {
|
|
1313
|
+
switch (e) {
|
|
1314
|
+
case "mask":
|
|
1315
|
+
return M.Mask;
|
|
1316
|
+
case "maskAndTransparency":
|
|
1317
|
+
return M.MaskBlend;
|
|
1318
|
+
case "none":
|
|
1319
|
+
return M.Opaque;
|
|
1320
|
+
default:
|
|
1321
|
+
return M.Blend;
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
function Fr(e) {
|
|
1325
|
+
const t = e.params;
|
|
1326
|
+
return { id: 1, material: t.material, texture: t.texture, region: t.texture };
|
|
1327
|
+
}
|
|
1328
|
+
const Ir = new Zt(1, 2, "wosr");
|
|
1329
|
+
async function Dr(e, t) {
|
|
1330
|
+
var v;
|
|
1331
|
+
const a = da(ma(e));
|
|
1332
|
+
if (a.fileType === "wosr") {
|
|
1333
|
+
const b = await (t.cache ? t.cache.loadWOSR(a.url, t) : Nr(a.url, t)), { engineResources: y, referenceBoundingBox: w } = Lr(b, t);
|
|
1334
|
+
return { lods: y, referenceBoundingBox: w, isEsriSymbolResource: !1, isWosr: !0 };
|
|
1335
|
+
}
|
|
1336
|
+
const o = await (t.cache ? t.cache.loadGLTF(a.url, t, !!t.usePBR) : vo(new go(t.streamDataRequester), a.url, t, t.usePBR)), n = (v = o.model.meta) == null ? void 0 : v.ESRI_proxyEllipsoid, r = o.meta.isEsriSymbolResource && n != null && o.meta.ESRI_webstyle === "EsriRealisticTreesStyle";
|
|
1337
|
+
r && !o.customMeta.esriTreeRendering && (o.customMeta.esriTreeRendering = !0, qr(o, n));
|
|
1338
|
+
const c = !!t.usePBR, l = o.meta.isEsriSymbolResource ? { usePBR: c, isSchematic: !1, treeRendering: r, mrrFactors: [...Jo] } : { usePBR: c, isSchematic: !1, treeRendering: !1, mrrFactors: [...Xt] }, s = { ...t.materialParameters, treeRendering: r }, { engineResources: p, referenceBoundingBox: m } = ua(o, l, s, t.skipHighLods && a.specifiedLodIndex == null ? { skipHighLods: !0 } : { skipHighLods: !1, singleLodIndex: a.specifiedLodIndex });
|
|
1339
|
+
return { lods: p, referenceBoundingBox: m, isEsriSymbolResource: o.meta.isEsriSymbolResource, isWosr: !1 };
|
|
1340
|
+
}
|
|
1341
|
+
function da(e) {
|
|
1342
|
+
const t = e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);
|
|
1343
|
+
return t ? { fileType: "gltf", url: t[1], specifiedLodIndex: t[4] != null ? Number(t[4]) : null } : e.match(/(.*\.(json|json\.gz))$/) ? { fileType: "wosr", url: e, specifiedLodIndex: null } : { fileType: "unknown", url: e, specifiedLodIndex: null };
|
|
1344
|
+
}
|
|
1345
|
+
function ua(e, t, a, o) {
|
|
1346
|
+
const n = e.model, r = new Array(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), s = n.lods.length, p = Rt();
|
|
1347
|
+
return n.lods.forEach((m, v) => {
|
|
1348
|
+
const b = o.skipHighLods === !0 && (s > 1 && v === 0 || s > 3 && v === 1) || o.skipHighLods === !1 && o.singleLodIndex != null && v !== o.singleLodIndex;
|
|
1349
|
+
if (b && v !== 0)
|
|
1350
|
+
return;
|
|
1351
|
+
const y = new Wo(m.name, m.lodThreshold, [0, 0, 0]);
|
|
1352
|
+
m.parts.forEach((w) => {
|
|
1353
|
+
const g = b ? new Ee({}) : Vr(n, w, y, t, a, c, l), { geometry: T, vertexCount: S } = Ur(w, g ?? new Ee({})), E = T.boundingInfo;
|
|
1354
|
+
E != null && v === 0 && (Me(p, E.bbMin), Me(p, E.bbMax)), g != null && (y.stageResources.geometries.push(T), y.numberOfVertices += S);
|
|
1355
|
+
}), b || r.push(y);
|
|
1356
|
+
}), { engineResources: r, referenceBoundingBox: p };
|
|
1357
|
+
}
|
|
1358
|
+
function Vr(e, t, a, o, n, r, c) {
|
|
1359
|
+
var y, w;
|
|
1360
|
+
const l = t.material + (t.attributes.normal ? "_normal" : "") + (t.attributes.color ? "_color" : "") + (t.attributes.texCoord0 ? "_texCoord0" : "") + (t.attributes.tangent ? "_tangent" : ""), s = e.materials.get(t.material), p = t.attributes.texCoord0 != null, m = t.attributes.normal != null;
|
|
1361
|
+
if (s == null)
|
|
1362
|
+
return null;
|
|
1363
|
+
const v = Wr(s.alphaMode);
|
|
1364
|
+
if (!r.has(l)) {
|
|
1365
|
+
if (p) {
|
|
1366
|
+
const P = (A, pe = !1) => {
|
|
1367
|
+
if (A != null && !c.has(A)) {
|
|
1368
|
+
const oe = e.textures.get(A);
|
|
1369
|
+
if (oe != null) {
|
|
1370
|
+
const G = oe.data;
|
|
1371
|
+
c.set(A, new qt(Ie(G) ? G.data : G, { ...oe.parameters, preMultiplyAlpha: !Ie(G) && pe, encoding: Ie(G) && G.encoding != null ? G.encoding : void 0 }));
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
};
|
|
1375
|
+
P(s.textureColor, v !== M.Opaque), P(s.textureNormal), P(s.textureOcclusion), P(s.textureEmissive), P(s.textureMetallicRoughness);
|
|
1376
|
+
}
|
|
1377
|
+
const g = s.color[0] ** (1 / X), T = s.color[1] ** (1 / X), S = s.color[2] ** (1 / X), E = s.emissiveFactor[0] ** (1 / X), _ = s.emissiveFactor[1] ** (1 / X), B = s.emissiveFactor[2] ** (1 / X), F = s.textureColor != null && p ? c.get(s.textureColor) : null, ae = ko({ normalTexture: s.textureNormal, metallicRoughnessTexture: s.textureMetallicRoughness, metallicFactor: s.metallicFactor, roughnessFactor: s.roughnessFactor, emissiveTexture: s.textureEmissive, emissiveFactor: s.emissiveFactor, occlusionTexture: s.textureOcclusion }), me = ((y = s.normalTextureTransform) == null ? void 0 : y.scale) != null ? (w = s.normalTextureTransform) == null ? void 0 : w.scale : St;
|
|
1378
|
+
r.set(l, new Ee({ ...o, transparent: v === M.Blend, customDepthTest: he.Lequal, textureAlphaMode: v, textureAlphaCutoff: s.alphaCutoff, diffuse: [g, T, S], ambient: [g, T, S], opacity: s.opacity, doubleSided: s.doubleSided, doubleSidedType: "winding-order", cullFace: s.doubleSided ? J.None : J.Back, hasVertexColors: !!t.attributes.color, hasVertexTangents: !!t.attributes.tangent, normalType: m ? R.Attribute : R.ScreenDerivative, castShadows: !0, receiveShadows: s.receiveShadows, receiveAmbientOcclusion: s.receiveAmbientOcclustion, textureId: F != null ? F.id : void 0, colorMixMode: s.colorMixMode, normalTextureId: s.textureNormal != null && p ? c.get(s.textureNormal).id : void 0, textureAlphaPremultiplied: F != null && !!F.parameters.preMultiplyAlpha, occlusionTextureId: s.textureOcclusion != null && p ? c.get(s.textureOcclusion).id : void 0, emissiveTextureId: s.textureEmissive != null && p ? c.get(s.textureEmissive).id : void 0, metallicRoughnessTextureId: s.textureMetallicRoughness != null && p ? c.get(s.textureMetallicRoughness).id : void 0, emissiveFactor: [E, _, B], mrrFactors: ae ? [...Yo] : [s.metallicFactor, s.roughnessFactor, o.mrrFactors[2]], isSchematic: ae, colorTextureTransformMatrix: ie(s.colorTextureTransform), normalTextureTransformMatrix: ie(s.normalTextureTransform), scale: [me[0], me[1]], occlusionTextureTransformMatrix: ie(s.occlusionTextureTransform), emissiveTextureTransformMatrix: ie(s.emissiveTextureTransform), metallicRoughnessTextureTransformMatrix: ie(s.metallicRoughnessTextureTransform), ...n }));
|
|
1379
|
+
}
|
|
1380
|
+
const b = r.get(l);
|
|
1381
|
+
if (a.stageResources.materials.push(b), p) {
|
|
1382
|
+
const g = (T) => {
|
|
1383
|
+
T != null && a.stageResources.textures.push(c.get(T));
|
|
1384
|
+
};
|
|
1385
|
+
g(s.textureColor), g(s.textureNormal), g(s.textureOcclusion), g(s.textureEmissive), g(s.textureMetallicRoughness);
|
|
1386
|
+
}
|
|
1387
|
+
return b;
|
|
1388
|
+
}
|
|
1389
|
+
function Ur(e, t) {
|
|
1390
|
+
const a = e.attributes.position.count, o = xo(e.indices || a, e.primitiveType), n = fe(3 * a), { typedBuffer: r, typedBufferStride: c } = e.attributes.position;
|
|
1391
|
+
po(n, r, e.transform, 3, c);
|
|
1392
|
+
const l = [[C.POSITION, new K(n, o, 3, !0)]];
|
|
1393
|
+
if (e.attributes.normal != null) {
|
|
1394
|
+
const s = fe(3 * a), { typedBuffer: p, typedBufferStride: m } = e.attributes.normal;
|
|
1395
|
+
mt(ge, e.transform), fo(s, p, ge, 3, m), l.push([C.NORMAL, new K(s, o, 3, !0)]);
|
|
1396
|
+
}
|
|
1397
|
+
if (e.attributes.tangent != null) {
|
|
1398
|
+
const s = fe(4 * a), { typedBuffer: p, typedBufferStride: m } = e.attributes.tangent;
|
|
1399
|
+
mt(ge, e.transform), bo(s, p, ge, 4, m), l.push([C.TANGENT, new K(s, o, 4, !0)]);
|
|
1400
|
+
}
|
|
1401
|
+
if (e.attributes.texCoord0 != null) {
|
|
1402
|
+
const s = fe(2 * a), { typedBuffer: p, typedBufferStride: m } = e.attributes.texCoord0;
|
|
1403
|
+
yo(s, p, 2, m), l.push([C.UV0, new K(s, o, 2, !0)]);
|
|
1404
|
+
}
|
|
1405
|
+
if (e.attributes.color != null) {
|
|
1406
|
+
const s = new Uint8Array(4 * a);
|
|
1407
|
+
e.attributes.color.elementCount === 4 ? e.attributes.color instanceof co ? gt(s, e.attributes.color, 255) : e.attributes.color instanceof Yt ? To(s, e.attributes.color) : e.attributes.color instanceof uo && gt(s, e.attributes.color, 1 / 256) : (s.fill(255), e.attributes.color instanceof Jt ? vt(s, e.attributes.color, 255, 4) : e.attributes.color instanceof ho ? wo(s, e.attributes.color.typedBuffer, 4, e.attributes.color.typedBufferStride) : e.attributes.color instanceof mo && vt(s, e.attributes.color, 1 / 256, 4)), l.push([C.COLOR, new K(s, o, 4, !0)]);
|
|
1408
|
+
}
|
|
1409
|
+
return { geometry: new kt(t, l), vertexCount: a };
|
|
1410
|
+
}
|
|
1411
|
+
const ge = Nt();
|
|
1412
|
+
function Wr(e) {
|
|
1413
|
+
switch (e) {
|
|
1414
|
+
case "BLEND":
|
|
1415
|
+
return M.Blend;
|
|
1416
|
+
case "MASK":
|
|
1417
|
+
return M.Mask;
|
|
1418
|
+
case "OPAQUE":
|
|
1419
|
+
case null:
|
|
1420
|
+
case void 0:
|
|
1421
|
+
return M.Opaque;
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
function qr(e, t) {
|
|
1425
|
+
for (let a = 0; a < e.model.lods.length; ++a) {
|
|
1426
|
+
const o = e.model.lods[a];
|
|
1427
|
+
for (const n of o.parts) {
|
|
1428
|
+
const r = n.attributes.normal;
|
|
1429
|
+
if (r == null)
|
|
1430
|
+
return;
|
|
1431
|
+
const c = n.attributes.position, l = c.count, s = j(), p = j(), m = j(), v = new Uint8Array(4 * l), b = new Float64Array(3 * l), y = za(Ga(), n.transform);
|
|
1432
|
+
let w = 0, g = 0;
|
|
1433
|
+
for (let T = 0; T < l; T++) {
|
|
1434
|
+
c.getVec(T, p), r.getVec(T, s), pt(p, p, n.transform), be(m, p, t.center), ft(m, m, t.radius);
|
|
1435
|
+
const S = m[2], E = Et(m), _ = Math.min(0.45 + 0.55 * E * E, 1);
|
|
1436
|
+
ft(m, m, t.radius), y !== null && pt(m, m, y), $t(m, m), a + 1 !== e.model.lods.length && e.model.lods.length > 1 && Pa(m, m, s, S > -1 ? 0.2 : Math.min(-4 * S - 3.8, 1)), b[w] = m[0], b[w + 1] = m[1], b[w + 2] = m[2], w += 3, v[g] = 255 * _, v[g + 1] = 255 * _, v[g + 2] = 255 * _, v[g + 3] = 255, g += 4;
|
|
1437
|
+
}
|
|
1438
|
+
n.attributes.normal = new Jt(b), n.attributes.color = new Yt(v);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
const $i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1443
|
+
__proto__: null,
|
|
1444
|
+
fetch: Dr,
|
|
1445
|
+
gltfToEngineResources: ua,
|
|
1446
|
+
parseUrl: da
|
|
1447
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1448
|
+
export {
|
|
1449
|
+
xr as H,
|
|
1450
|
+
wr as I,
|
|
1451
|
+
rt as d,
|
|
1452
|
+
sr as f,
|
|
1453
|
+
$i as o,
|
|
1454
|
+
er as u
|
|
1455
|
+
};
|