@arcgis/core 4.23.0-next.20220123 → 4.23.0-next.20220128
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/Graphic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02fbc76dfdc20e628c61.js +1 -0
- package/assets/esri/core/workers/chunks/0453fad5cb819797b4f6.js +1 -0
- package/assets/esri/core/workers/chunks/0463ba46df855a92b9c0.js +1 -0
- package/assets/esri/core/workers/chunks/0cd0a6eef51fc5b9ea61.js +1 -0
- package/assets/esri/core/workers/chunks/{d1454155ee1b8a421cbb.js → 0d02c6ad1f4688bfa374.js} +1 -1
- package/assets/esri/core/workers/chunks/0d684f16f37d5dc385dd.js +1 -0
- package/assets/esri/core/workers/chunks/0e17691520d890d34efb.js +1 -0
- package/assets/esri/core/workers/chunks/16b6d0f8378582c051c3.js +1 -0
- package/assets/esri/core/workers/chunks/{0ce1dc14280d6f188468.js → 17de7a324dfa7f57ad5d.js} +1 -1
- package/assets/esri/core/workers/chunks/{b313ab14a643273e7d09.js → 1877ab1b6a115dbba1c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{c36f84daa7736878418d.js → 197ec52641aed20029c6.js} +1 -1
- package/assets/esri/core/workers/chunks/1b2a961f776a0b57e57a.js +1 -0
- package/assets/esri/core/workers/chunks/1b3fd66577b19aa5f2b6.js +1 -0
- package/assets/esri/core/workers/chunks/1c733b7db092a2a88ef3.js +1 -0
- package/assets/esri/core/workers/chunks/1f8c6a179e39fd4c5e6f.js +1 -0
- package/assets/esri/core/workers/chunks/2076fcbae63f1bfb7143.js +1 -0
- package/assets/esri/core/workers/chunks/{9387db408f496e7dd003.js → 214910032945dd2d86b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2ae5fc4f787ea568b88.js → 2460f3b6ada6ae900dec.js} +1 -1
- package/assets/esri/core/workers/chunks/27474b007988855bea9d.js +1 -0
- package/assets/esri/core/workers/chunks/281b89dbf5574fc642ae.js +1 -0
- package/assets/esri/core/workers/chunks/{4d539878bfbd7c549e60.js → 2c8fe9bc988c3c5760a5.js} +1 -1
- package/assets/esri/core/workers/chunks/2e899ef5881b4ec6fa55.js +1 -0
- package/assets/esri/core/workers/chunks/34b59d7099904dcb28b5.js +1 -0
- package/assets/esri/core/workers/chunks/357033117dfe61eb81ea.js +1 -0
- package/assets/esri/core/workers/chunks/37c03cfc19086ce631c6.js +1 -0
- package/assets/esri/core/workers/chunks/391e96192d1ec4e55ce2.js +1 -0
- package/assets/esri/core/workers/chunks/3c673495e5f507c4a9e5.js +1 -0
- package/assets/esri/core/workers/chunks/422537fc3df707bb62c9.js +1 -0
- package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
- package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
- package/assets/esri/core/workers/chunks/{c959e0d1cf7dce0421b9.js → 48fa8aed6c24877b44c4.js} +1 -1
- package/assets/esri/core/workers/chunks/{44b01d42d4ec72913229.js → 4954fd86b48cc68b737c.js} +1 -1
- package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
- package/assets/esri/core/workers/chunks/4ba6de8aa7e2960bad49.js +1 -0
- package/assets/esri/core/workers/chunks/4be35af7d6babbfe9d84.js +1 -0
- package/assets/esri/core/workers/chunks/5457962a70bd3c557a75.js +1 -0
- package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
- package/assets/esri/core/workers/chunks/{b9c177524b3e7de1ffd1.js → 5790d171072b3c7d108f.js} +1 -1
- package/assets/esri/core/workers/chunks/57b349d1dbc0bed75b79.js +1 -0
- package/assets/esri/core/workers/chunks/5bcb3240b3c005e5fe72.js +1 -0
- package/assets/esri/core/workers/chunks/5d11b97b667921d67ae7.js +1 -0
- package/assets/esri/core/workers/chunks/5dbe555a5a662ff3d9ce.js +1 -0
- package/assets/esri/core/workers/chunks/5ec98f4ddac707d0fbd1.js +1 -0
- package/assets/esri/core/workers/chunks/64b7e8d812ea8fcf269e.js +1 -0
- package/assets/esri/core/workers/chunks/{4c9084a04948b6924749.js → 655b55ac0cd533d7e9d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{b0b036ad3ad3cd956747.js → 69fd99b7c76e9992ccf3.js} +1 -1
- package/assets/esri/core/workers/chunks/{9cdaba126ac7fa5f33f0.js → 6cd5e4380d29b9a3c344.js} +1 -1
- package/assets/esri/core/workers/chunks/75d812955a473d0e8960.js +1 -0
- package/assets/esri/core/workers/chunks/7903a3e2e0faff0f86c0.js +1 -0
- package/assets/esri/core/workers/chunks/{cc146c57bbdac8029fd8.js → 7a5f5acfbd4ca1a5c1f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{64276aacaafa4c8a15bd.js → 7dcf52d3db3903c8eb9f.js} +1 -1
- package/assets/esri/core/workers/chunks/83d00afae4406ec78bc9.js +1 -0
- package/assets/esri/core/workers/chunks/{625d2663daa8e0cf64b0.js → 85b1f36790df95b17659.js} +1 -1
- package/assets/esri/core/workers/chunks/89820b200ee44e678af5.js +1 -0
- package/assets/esri/core/workers/chunks/918bb7a7d901544a7367.js +1 -0
- package/assets/esri/core/workers/chunks/{94b8dbf859df71858d1c.js → 929c9b7cdab7c4ca3d87.js} +1 -1
- package/assets/esri/core/workers/chunks/94515fb3ef38067eeadd.js +1 -0
- package/assets/esri/core/workers/chunks/949b2269457302ffc64b.js +1 -0
- package/assets/esri/core/workers/chunks/952980635afc7ec81804.js +1 -0
- package/assets/esri/core/workers/chunks/9876a1bae350795fab36.js +1 -0
- package/assets/esri/core/workers/chunks/99619fcb772807c74f3b.js +1 -0
- package/assets/esri/core/workers/chunks/{010a71c2aa1b7681e191.js → 9d11f84e6c893b9d0019.js} +1 -1
- package/assets/esri/core/workers/chunks/a1930e4f035bc9aa1ae5.js +1 -0
- package/assets/esri/core/workers/chunks/a8692bffb76444c34760.js +1 -0
- package/assets/esri/core/workers/chunks/aa04b90b82bf70caaae4.js +1 -0
- package/assets/esri/core/workers/chunks/aeaa1667c2d9f1b3366b.js +1 -0
- package/assets/esri/core/workers/chunks/b2d2de935487257c568b.js +1 -0
- package/assets/esri/core/workers/chunks/b3f5e91116112b0b612a.js +1 -0
- package/assets/esri/core/workers/chunks/b97953694f42bfec1b3c.js +1 -0
- package/assets/esri/core/workers/chunks/b9e9cb354822c6d995a4.js +1 -0
- package/assets/esri/core/workers/chunks/ba762bcfd74af0bb8218.js +1 -0
- package/assets/esri/core/workers/chunks/bac9fc90e6756e211160.js +1 -0
- package/assets/esri/core/workers/chunks/be588873c16770ceb9ef.js +1 -0
- package/assets/esri/core/workers/chunks/bf97a933ea3b220115e1.js +1 -0
- package/assets/esri/core/workers/chunks/bfedd6ebff817c9b31c0.js +1 -0
- package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +1 -0
- package/assets/esri/core/workers/chunks/c1135cb02ec46c491459.js +1 -0
- package/assets/esri/core/workers/chunks/c2253a9f29c1aabb2b75.js +1 -0
- package/assets/esri/core/workers/chunks/{d39b7983b68d6e5b404d.js → cdbc005eebec1503b99d.js} +1 -1
- package/assets/esri/core/workers/chunks/d04fca5d46cca02500b7.js +1 -0
- package/assets/esri/core/workers/chunks/d08efbc349dd9f999497.js +1 -0
- package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +1 -0
- package/assets/esri/core/workers/chunks/{a8b13fb804bb775e4967.js → db3c729ce0c0b2690dc9.js} +1 -1
- package/assets/esri/core/workers/chunks/dd13772a5e2eccc6a2bc.js +1 -0
- package/assets/esri/core/workers/chunks/dedc333a61081772ca7b.js +1 -0
- package/assets/esri/core/workers/chunks/{a7b1b75643ed31489495.js → e0c8d61c7a85ce15499a.js} +1 -1
- package/assets/esri/core/workers/chunks/{199670a3a564ebe3bd79.js → e218bde41ffbcc5194f5.js} +1 -1
- package/assets/esri/core/workers/chunks/e21b211913aefde47e30.js +1 -0
- package/assets/esri/core/workers/chunks/e287f49184d076af17e2.js +1 -0
- package/assets/esri/core/workers/chunks/{bde1d5b0a7717350986e.js → e4019b63a1fe74e2c842.js} +1 -1
- package/assets/esri/core/workers/chunks/e8e775758b79c5a084c8.js +1 -0
- package/assets/esri/core/workers/chunks/e93dfdede0532a89ffa5.js +1 -0
- package/assets/esri/core/workers/chunks/e9e5196b44b6923be1a3.js +1 -0
- package/assets/esri/core/workers/chunks/ea595b0df5050eda2a13.js +1 -0
- package/assets/esri/core/workers/chunks/eb82ff10cef2bde6e57f.js +1 -0
- package/assets/esri/core/workers/chunks/ebc6f4764b82d4104c65.js +1 -0
- package/assets/esri/core/workers/chunks/{1305ef8717da6e902a55.js → ec10151a2a95e95a0bb5.js} +1 -1
- package/assets/esri/core/workers/chunks/eccba071ced2d922bb85.js +1 -0
- package/assets/esri/core/workers/chunks/ee6e0db58dc64410e687.js +1 -0
- package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +1 -0
- package/assets/esri/core/workers/chunks/f2124f4d0f2b8a91f0ea.js +1 -0
- package/assets/esri/core/workers/chunks/ff6abdc72076f3994659.js +981 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/base/_mixins.scss +4 -1
- package/assets/esri/themes/base/icons/style.scss +11 -2
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +13 -10
- package/assets/esri/themes/base/widgets/_CoordinateConversion.scss +4 -2
- package/assets/esri/themes/base/widgets/_Directions.scss +5 -3
- package/assets/esri/themes/base/widgets/_Editor.scss +5 -2
- package/assets/esri/themes/base/widgets/_ElevationProfile.scss +6 -4
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +6 -0
- package/assets/esri/themes/base/widgets/_ItemList.scss +1 -1
- package/assets/esri/themes/base/widgets/_LayerList.scss +13 -9
- package/assets/esri/themes/base/widgets/_Popup.scss +4 -2
- package/assets/esri/themes/base/widgets/_Print.scss +24 -11
- package/assets/esri/themes/base/widgets/_Search.scss +4 -2
- package/assets/esri/themes/base/widgets/_TableList.scss +9 -7
- package/assets/esri/themes/base/widgets/_Weather.scss +12 -0
- package/assets/esri/themes/base/widgets/_Widget.scss +18 -9
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/dark-blue/main.css +1 -1
- package/assets/esri/themes/dark-green/main.css +1 -1
- package/assets/esri/themes/dark-purple/main.css +1 -1
- package/assets/esri/themes/dark-red/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/themes/light-blue/main.css +1 -1
- package/assets/esri/themes/light-green/main.css +1 -1
- package/assets/esri/themes/light-purple/main.css +1 -1
- package/assets/esri/themes/light-red/main.css +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
- package/chunks/BlendLayers.glsl.js +2 -2
- package/chunks/ChapmanAtmosphere.glsl.js +17 -17
- package/chunks/CheckerBoard.glsl.js +3 -3
- package/chunks/Clouds.glsl.js +2 -2
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ColorMaterial.glsl.js +12 -12
- package/chunks/ComponentShader.glsl.js +21 -21
- package/chunks/Compositing.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +33 -33
- package/chunks/EdgeShaderProgram.glsl.js +7 -7
- package/chunks/Fog.glsl.js +10 -12
- package/chunks/HUDMaterial.glsl.js +2 -2
- package/chunks/HighlightComposition.glsl.js +5 -5
- package/chunks/ImageMaterial.glsl.js +6 -6
- package/chunks/LaserlinePath.glsl.js +8 -8
- package/chunks/LineCallout.glsl.js +6 -6
- package/chunks/MeasurementArrow.glsl.js +1 -1
- package/chunks/NativeLine.glsl.js +1 -1
- package/chunks/Path.glsl.js +5 -5
- package/chunks/Pattern.glsl.js +9 -9
- package/chunks/PointRenderer.glsl.js +14 -14
- package/chunks/Precipitation.glsl.js +91 -0
- package/chunks/RealisticTree.glsl.js +21 -21
- package/chunks/RibbonLine.glsl.js +11 -11
- package/chunks/SMAA.glsl.js +40 -40
- package/chunks/ShadedColorMaterial.glsl.js +12 -12
- package/chunks/ShadowCast.glsl.js +6 -6
- package/chunks/ShadowHighlight.glsl.js +4 -4
- package/chunks/SimpleAtmosphere.glsl.js +3 -3
- package/chunks/SlicePlaneMaterial.glsl.js +3 -3
- package/chunks/Stars.glsl.js +3 -3
- package/chunks/Terrain.glsl.js +3 -3
- package/chunks/TextureOnly.glsl.js +2 -2
- package/chunks/WaterSurface.glsl.js +22 -22
- package/chunks/boundedPlane.js +1 -1
- package/chunks/pe.js +1 -1
- package/chunks/vec3.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/accessorSupport/read.js +1 -1
- package/core/accessorSupport/set.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/accessorSupport/write.js +1 -1
- package/core/clock.js +1 -1
- package/core/jsonMap.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/loadAll.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/reactiveUtils.js +1 -1
- package/form/ExpressionInfo.js +1 -1
- package/geometry/pe.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +263 -35
- package/layers/VectorTileLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/package.json +2 -2
- package/popup/content/AttachmentsContent.js +1 -1
- package/popup/content/support/mediaInfoTypes.js +1 -1
- package/rest/print.js +1 -1
- package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
- package/support/arcadeOnDemand.js +1 -1
- package/support/featureFlags.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/FillSymbol3DLayer.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/LabelSymbol3D.js +1 -1
- package/symbols/ObjectSymbol3DLayer.js +1 -1
- package/symbols/PointSymbol3D.js +1 -1
- package/symbols/Symbol3D.js +1 -1
- package/symbols/WebStyleSymbol.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/support/IconSymbol3DLayerResource.js +1 -1
- package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
- package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
- package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
- package/symbols/support/Symbol3DFillMaterial.js +1 -1
- package/symbols/support/Symbol3DIconOutline.js +1 -1
- package/symbols/support/Symbol3DOutline.js +1 -1
- package/symbols/support/Symbol3DVerticalOffset.js +1 -1
- package/symbols/support/Thumbnail.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/symbols/support/previewWebStyleSymbol.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/symbols/support/webStyleSymbolUtils.js +1 -1
- package/symbols.js +1 -1
- package/views/2d/MapViewConstraints.js +1 -1
- package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
- package/views/2d/engine/webgl/brushes/raster/BrushRasterBitmap.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsComposition.glsl.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/CloudsPresets.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.glsl.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/Precipitation.glsl.js +5 -0
- package/views/3d/environment/Precipitation.js +5 -0
- package/views/3d/environment/PrecipitationTechnique.js +5 -0
- package/views/3d/environment/RainyWeather.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/SnowyWeather.js +5 -0
- package/views/3d/environment/Stars.glsl.js +1 -1
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/environment/weather.js +1 -1
- package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
- package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/lineUtils.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/graphics/symbolComplexity.js +1 -1
- package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
- package/views/3d/layers/support/overlayImageUtils.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/support/LaserlinePathData.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
- package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +22 -14
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/{layers/graphics/IGraphics3DFeatureProcessor.js → webgl-engine/lib/TextureUniformName.js} +0 -0
- package/views/3d/webgl-engine/lib/UniformName.js +4 -0
- package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
- package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
- package/views/MapView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/input/recognizers/DoubleTapDrag.js +1 -1
- package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
- package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
- package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/WatchUpdatingTracking.js +1 -1
- package/views/support/projectionUtils.js +5 -0
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/InstanceCounter.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/views/webgl/rasterUtils.js +1 -1
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
- package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/FeatureForm/InputField.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/Search/support/locatorUtils.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather/enums.js +5 -0
- package/widgets/Weather.js +1 -1
- package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
- package/widgets/support/InteractiveToolViewModel.js +1 -1
- package/assets/components/assets/calcite-icon/checkSquareF16.json +0 -1
- package/assets/components/assets/calcite-icon/checkSquareF24.json +0 -1
- package/assets/components/assets/calcite-icon/checkSquareF32.json +0 -1
- package/assets/components/assets/calcite-icon/lineSolid4.json +0 -1
- package/assets/components/assets/calcite-icon/squareF16.json +0 -1
- package/assets/components/assets/calcite-icon/squareF24.json +0 -1
- package/assets/components/assets/calcite-icon/squareF32.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon16.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon24.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon32.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF16.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF24.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF32.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF16.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF24.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF32.json +0 -1
- package/assets/esri/core/workers/chunks/09da224052976e290828.js +0 -1
- package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +0 -1
- package/assets/esri/core/workers/chunks/0c3e3a5baf54bd5e210c.js +0 -1
- package/assets/esri/core/workers/chunks/14bef72154b3a19561a7.js +0 -1
- package/assets/esri/core/workers/chunks/18668dc45eb9e35530df.js +0 -1
- package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +0 -1
- package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +0 -1
- package/assets/esri/core/workers/chunks/208a7e24e19fc5633dd7.js +0 -1
- package/assets/esri/core/workers/chunks/22b09e276c9b9f22f0f8.js +0 -1
- package/assets/esri/core/workers/chunks/23745a5ab47c840dc452.js +0 -1
- package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +0 -1
- package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +0 -1
- package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +0 -1
- package/assets/esri/core/workers/chunks/32f8c4af7e70ebdcb19e.js +0 -1
- package/assets/esri/core/workers/chunks/36a3f6fb4d1d18fcb642.js +0 -1
- package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +0 -1
- package/assets/esri/core/workers/chunks/3a9740dccda6a733313c.js +0 -1
- package/assets/esri/core/workers/chunks/3aa4194dc5497c57647f.js +0 -1
- package/assets/esri/core/workers/chunks/40a1e713f63ec77110c0.js +0 -1
- package/assets/esri/core/workers/chunks/43cdff2418325e163420.js +0 -1
- package/assets/esri/core/workers/chunks/4bfbf5a34c9207fdcf44.js +0 -1
- package/assets/esri/core/workers/chunks/5383a8f3e4ec1a8a4fcd.js +0 -1
- package/assets/esri/core/workers/chunks/5538639a49c7cc2eca63.js +0 -1
- package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +0 -1
- package/assets/esri/core/workers/chunks/5d4863a92b03bebc1b54.js +0 -1
- package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +0 -1
- package/assets/esri/core/workers/chunks/634b5ccd7a3ac67f855d.js +0 -1
- package/assets/esri/core/workers/chunks/662d13f68cf3ec92439b.js +0 -1
- package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
- package/assets/esri/core/workers/chunks/67162b3e2cc1b5dc6818.js +0 -1
- package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +0 -1
- package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +0 -1
- package/assets/esri/core/workers/chunks/76eef4799f6c5fff7e2d.js +0 -1
- package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +0 -1
- package/assets/esri/core/workers/chunks/7bc5cc5dbf1b7b70ddac.js +0 -1
- package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +0 -1
- package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +0 -1
- package/assets/esri/core/workers/chunks/8b6ab6202a40fe622833.js +0 -1
- package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +0 -1
- package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
- package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +0 -1
- package/assets/esri/core/workers/chunks/9cb2ae42a8e328b1d98d.js +0 -1
- package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +0 -1
- package/assets/esri/core/workers/chunks/a6ff3db3493543df81bc.js +0 -1
- package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +0 -1
- package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +0 -1
- package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +0 -1
- package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +0 -1
- package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +0 -1
- package/assets/esri/core/workers/chunks/afa6912454f2a5ffadce.js +0 -1
- package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +0 -1
- package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +0 -1
- package/assets/esri/core/workers/chunks/ba6654a885be4b7a43f0.js +0 -1
- package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +0 -1
- package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +0 -1
- package/assets/esri/core/workers/chunks/c080114a69fa95b88d22.js +0 -1
- package/assets/esri/core/workers/chunks/c11474b702dfb94e8e87.js +0 -1
- package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +0 -1
- package/assets/esri/core/workers/chunks/c6bd943fe8fd13bb4806.js +0 -1
- package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +0 -1
- package/assets/esri/core/workers/chunks/ca2f5faa01d99c21ec14.js +0 -1
- package/assets/esri/core/workers/chunks/cd7d83d127e085d52584.js +0 -1
- package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +0 -1
- package/assets/esri/core/workers/chunks/cfbffa429d88e7709c3f.js +0 -1
- package/assets/esri/core/workers/chunks/d24c4fbc567486b1188f.js +0 -1
- package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +0 -1
- package/assets/esri/core/workers/chunks/da1c2873bdbc0956dca0.js +0 -1
- package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +0 -1
- package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
- package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +0 -1
- package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
- package/assets/esri/core/workers/chunks/e6df9839b551569fbc62.js +0 -1
- package/assets/esri/core/workers/chunks/e97e986120aaadad7d4c.js +0 -1
- package/assets/esri/core/workers/chunks/f467c8f1fce22f6f599c.js +0 -1
- package/assets/esri/core/workers/chunks/f678293de9a6d8f5b5db.js +0 -1
- package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +0 -1
- package/assets/esri/core/workers/chunks/fd3e5d823dc7917f4b8f.js +0 -1
- package/assets/esri/core/workers/chunks/ffaf091c6023225cf5aa.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
var
|
|
5
|
+
var n,N,e,O,t,i,o,a,A,c,u,l,C;!function(n){n[n.None=0]="None",n[n.Front=1]="Front",n[n.Back=2]="Back",n[n.COUNT=3]="COUNT"}(n||(n={})),function(n){n[n.NONE=0]="NONE",n[n.SMAA=1]="SMAA"}(N||(N={})),function(n){n[n.Color=0]="Color",n[n.Alpha=1]="Alpha",n[n.FrontFace=2]="FrontFace",n[n.NONE=3]="NONE",n[n.COUNT=4]="COUNT"}(e||(e={})),function(n){n[n.BACKGROUND=0]="BACKGROUND",n[n.UPDATE=1]="UPDATE"}(O||(O={})),function(n){n[n.NOT_LOADED=0]="NOT_LOADED",n[n.LOADING=1]="LOADING",n[n.LOADED=2]="LOADED"}(t||(t={})),function(n){n[n.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",n[n.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(i||(i={})),function(n){n[n.ASYNC=0]="ASYNC",n[n.SYNC=1]="SYNC"}(o||(o={})),function(n){n[n.Highlight=0]="Highlight",n[n.MaskOccludee=1]="MaskOccludee",n[n.COUNT=2]="COUNT"}(a||(a={})),function(n){n[n.Triangle=0]="Triangle",n[n.Point=1]="Point",n[n.Line=2]="Line"}(A||(A={})),function(n){n[n.STRETCH=1]="STRETCH",n[n.PAD=2]="PAD"}(c||(c={})),function(n){n[n.CHANGED=0]="CHANGED",n[n.UNCHANGED=1]="UNCHANGED"}(u||(u={})),function(n){n[n.Blend=0]="Blend",n[n.Opaque=1]="Opaque",n[n.Mask=2]="Mask",n[n.MaskBlend=3]="MaskBlend",n[n.COUNT=4]="COUNT"}(l||(l={})),function(n){n[n.OFF=0]="OFF",n[n.ON=1]="ON"}(C||(C={}));export{l as AlphaDiscardMode,N as AntiAliasingMode,n as CullFaceOptions,C as Decorations,a as Object3DState,c as PowerOfTwoResizeMode,A as PrimitiveType,O as RenderRequestType,t as ResourceState,i as StencilBits,e as TransparencyPassType,o as UpdatePolicy,u as ValidationState};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{unpackFloatRGBA as e}from"../../../../core/floatRGBA.js";import{isSome as t,isNone as r}from"../../../../core/maybe.js";import i from"../../../../core/PooledArray.js";import{m as n,c as s}from"../../../../chunks/mat4.js";import{c as a}from"../../../../chunks/mat4f64.js";import{m as o}from"../../../../chunks/vec3.js";import{l as h}from"../../../../chunks/vec4.js";import{c as f}from"../../../../chunks/vec4f64.js";import{intersectsSphere as c,create as l,copy as u}from"../../../../geometry/support/frustum.js";import{c as d}from"../../../../chunks/sphere.js";import{maxScale as g}from"../../support/mathUtils.js";import{empty as m,union as p,set as _}from"./depthRange.js";import{DepthOrder as b}from"./Octree.js";import{assert as w}from"./Util.js";const R=1e4,B=100,v=500,j=500,C=.1;function A(t,r,i){return e(r,t)*(i[1]-i[0])+i[0]}function M(e,t,r){if(t.size<R)return K.compute(e,t);const i=m();return r.forAll((t=>{t.isVisible&&p(i,T(e,t))})),i}function T(e,r){if(!r.isVisible)return;const i=m(),n=r.getSpatialQueryAccelerator();return t(n)?O(i,e,n):S(i,e,r.objects),i}function O(e,t,r){const i=t.eye,n=t.viewForward,s=t.frustum,a=e=>e.isVisible,o=r.objectCount;if(o<v)_(W,t.near,Math.min(e.near,t.far)),r.forEachInDepthRange(i,n,b.FRONT_TO_BACK,W,((r,i)=>{y(e,t,r),W.far=e.near,i.setRange(W)}),s,a),_(W,Math.max(e.far,t.near),t.far),r.forEachInDepthRange(i,n,b.BACK_TO_FRONT,W,((r,i)=>{y(e,t,r),W.near=e.far,i.setRange(W)}),s,a);else{const i=Math.max(Math.min(o,j),Math.ceil(o*C)),h=r.findClosest(n,b.FRONT_TO_BACK,s,a,i),f=r.findClosest(n,b.BACK_TO_FRONT,s,a,i);h&&f&&(I(e,t,h.boundingVolumeWorldSpace.bounds),I(e,t,f.boundingVolumeWorldSpace.bounds))}}function S(e,t,r){k.clear(),r.forAll((e=>{e.isVisible&&0!==e.geometryRecords.length&&k.add(e)})),k.empty||(k.sort(t),_(W,t.near,Math.min(e.near,t.far)),k.forEachInDepthRange(W,b.FRONT_TO_BACK,((r,i)=>{i<e.near&&y(e,t,r)})),_(W,Math.max(e.far,t.near),t.far),k.forEachInDepthRange(W,b.BACK_TO_FRONT,((t,r,i)=>{e.far=Math.max(e.far,i)})))}function y(e,t,r){if(!r.isVisible)return;if(!c(t.frustum,r.boundingVolumeWorldSpace.bounds))return;const i=r.transformation,s=E;r.geometryRecords.forEach((r=>{n(s,i,r.getShaderTransformation());const a=g(s);F(e,t,r.geometry.boundingInfo,s,a)}))}function F(e,t,i,n,s){if(r(i))return;const a=t.eye,h=t.viewForward;o(D,i.center,n);const f=h[0]*(D[0]-a[0])+h[1]*(D[1]-a[1])+h[2]*(D[2]-a[2]);if(D[3]=i.radius*s,!(f-D[3]>e.near&&f+D[3]<e.far)&&c(t.frustum,D))if(i.radius>B&&i.getChildren()){const r=i.getChildren();for(let i=0;i<8;++i)r[i]&&F(e,t,r[i],n,s)}else U.unionDepthRangeWithAABB(e,t.viewProjectionMatrix,n,i.bbMin,i.bbMax)}function I(e,t,r){const i=t.eye,n=t.viewForward,s=(r[0]-i[0])*n[0]+(r[1]-i[1])*n[1]+(r[2]-i[2])*n[2];e.near=Math.min(e.near,s-r[3]),e.far=Math.max(e.far,s+r[3])}class P{constructor(){this._items=new i({allocator:e=>e||{obj:null,distance:0,near:0,far:0},deallocator:e=>(e.obj=null,e.distance=0,e.near=0,e.far=0,e)})}get length(){return this._items.length}get empty(){return 0===this._items.length}clear(){this._items.clear()}add(e){this._items.pushNew().obj=e}sort(e){const t=e.eye,r=e.viewForward;this._items.forAll((e=>{const i=e.obj.boundingVolumeWorldSpace.bounds,n=(i[0]-t[0])*r[0]+(i[1]-t[1])*r[1]+(i[2]-t[2])*r[2];e.distance=n,e.near=n-i[3],e.far=n+i[3]})),this._items.sort(((e,t)=>e.distance-t.distance))}forEachInDepthRange(e,t,r){if(t===b.FRONT_TO_BACK)for(let i=0;i<this._items.length;++i){const t=this._items.data[i];t.far<e.near||t.near>e.far||r(t.obj,t.near,t.far)}else for(let i=this._items.length-1;i>=0;--i){const t=this._items.data[i];t.far<e.near||t.near>e.far||r(t.obj,t.near,t.far)}}}class x{constructor(){this.view=a(),this.viewProj=a(),this.frustum=l(),this.geometries=[],this.near=[],this.far=[],this.nearCandidates=[],this.farCandidates=[],this.range={near:0,far:0},this.looseRange={near:0,far:0}}compute(e,t){this._reset(),s(this.view,e.viewMatrix),n(this.viewProj,e.projectionMatrix,this.view),u(
|
|
5
|
+
import{unpackFloatRGBA as e}from"../../../../core/floatRGBA.js";import{isSome as t,isNone as r}from"../../../../core/maybe.js";import i from"../../../../core/PooledArray.js";import{m as n,c as s}from"../../../../chunks/mat4.js";import{c as a}from"../../../../chunks/mat4f64.js";import{m as o}from"../../../../chunks/vec3.js";import{l as h}from"../../../../chunks/vec4.js";import{c as f}from"../../../../chunks/vec4f64.js";import{intersectsSphere as c,create as l,copy as u}from"../../../../geometry/support/frustum.js";import{c as d}from"../../../../chunks/sphere.js";import{maxScale as g}from"../../support/mathUtils.js";import{empty as m,union as p,set as _}from"./depthRange.js";import{DepthOrder as b}from"./Octree.js";import{assert as w}from"./Util.js";const R=1e4,B=100,v=500,j=500,C=.1;function A(t,r,i){return e(r,t)*(i[1]-i[0])+i[0]}function M(e,t,r){if(t.size<R)return K.compute(e,t);const i=m();return r.forAll((t=>{t.isVisible&&p(i,T(e,t))})),i}function T(e,r){if(!r.isVisible)return;const i=m(),n=r.getSpatialQueryAccelerator();return t(n)?O(i,e,n):S(i,e,r.objects),i}function O(e,t,r){const i=t.eye,n=t.viewForward,s=t.frustum,a=e=>e.isVisible,o=r.objectCount;if(o<v)_(W,t.near,Math.min(e.near,t.far)),r.forEachInDepthRange(i,n,b.FRONT_TO_BACK,W,((r,i)=>{y(e,t,r),W.far=e.near,i.setRange(W)}),s,a),_(W,Math.max(e.far,t.near),t.far),r.forEachInDepthRange(i,n,b.BACK_TO_FRONT,W,((r,i)=>{y(e,t,r),W.near=e.far,i.setRange(W)}),s,a);else{const i=Math.max(Math.min(o,j),Math.ceil(o*C)),h=r.findClosest(n,b.FRONT_TO_BACK,s,a,i),f=r.findClosest(n,b.BACK_TO_FRONT,s,a,i);h&&f&&(I(e,t,h.boundingVolumeWorldSpace.bounds),I(e,t,f.boundingVolumeWorldSpace.bounds))}}function S(e,t,r){k.clear(),r.forAll((e=>{e.isVisible&&0!==e.geometryRecords.length&&k.add(e)})),k.empty||(k.sort(t),_(W,t.near,Math.min(e.near,t.far)),k.forEachInDepthRange(W,b.FRONT_TO_BACK,((r,i)=>{i<e.near&&y(e,t,r)})),_(W,Math.max(e.far,t.near),t.far),k.forEachInDepthRange(W,b.BACK_TO_FRONT,((t,r,i)=>{e.far=Math.max(e.far,i)})))}function y(e,t,r){if(!r.isVisible)return;if(!c(t.frustum,r.boundingVolumeWorldSpace.bounds))return;const i=r.transformation,s=E;r.geometryRecords.forEach((r=>{n(s,i,r.getShaderTransformation());const a=g(s);F(e,t,r.geometry.boundingInfo,s,a)}))}function F(e,t,i,n,s){if(r(i))return;const a=t.eye,h=t.viewForward;o(D,i.center,n);const f=h[0]*(D[0]-a[0])+h[1]*(D[1]-a[1])+h[2]*(D[2]-a[2]);if(D[3]=i.radius*s,!(f-D[3]>e.near&&f+D[3]<e.far)&&c(t.frustum,D))if(i.radius>B&&i.getChildren()){const r=i.getChildren();for(let i=0;i<8;++i)r[i]&&F(e,t,r[i],n,s)}else U.unionDepthRangeWithAABB(e,t.viewProjectionMatrix,n,i.bbMin,i.bbMax)}function I(e,t,r){const i=t.eye,n=t.viewForward,s=(r[0]-i[0])*n[0]+(r[1]-i[1])*n[1]+(r[2]-i[2])*n[2];e.near=Math.min(e.near,s-r[3]),e.far=Math.max(e.far,s+r[3])}class P{constructor(){this._items=new i({allocator:e=>e||{obj:null,distance:0,near:0,far:0},deallocator:e=>(e.obj=null,e.distance=0,e.near=0,e.far=0,e)})}get length(){return this._items.length}get empty(){return 0===this._items.length}clear(){this._items.clear()}add(e){this._items.pushNew().obj=e}sort(e){const t=e.eye,r=e.viewForward;this._items.forAll((e=>{const i=e.obj.boundingVolumeWorldSpace.bounds,n=(i[0]-t[0])*r[0]+(i[1]-t[1])*r[1]+(i[2]-t[2])*r[2];e.distance=n,e.near=n-i[3],e.far=n+i[3]})),this._items.sort(((e,t)=>e.distance-t.distance))}forEachInDepthRange(e,t,r){if(t===b.FRONT_TO_BACK)for(let i=0;i<this._items.length;++i){const t=this._items.data[i];t.far<e.near||t.near>e.far||r(t.obj,t.near,t.far)}else for(let i=this._items.length-1;i>=0;--i){const t=this._items.data[i];t.far<e.near||t.near>e.far||r(t.obj,t.near,t.far)}}}class x{constructor(){this.view=a(),this.viewProj=a(),this.frustum=l(),this.geometries=[],this.near=[],this.far=[],this.nearCandidates=[],this.farCandidates=[],this.range={near:0,far:0},this.looseRange={near:0,far:0}}compute(e,t){this._reset(),s(this.view,e.viewMatrix),n(this.viewProj,e.projectionMatrix,this.view),u(this.frustum,e.frustum);const r=this.view,i=r[2],a=r[6],o=r[10],h=r[14],f=this.range;let c=0;if(t.forEach((e=>{if(!e.instanceParameters.visible)return;if(!e.castShadow)return;let t;e.hasShaderTransformation?(e.computeBoundingSphere(e.getShaderTransformation(),D,1),t=D):t=e.boundingSphere;const r=i*t[0]+a*t[1]+o*t[2]+h,n=r-t[3],s=r+t[3];this.geometries[c]=e,this.near[c]=-s,this.far[c]=-n,++c})),0===this.geometries.length)return f;for(let n=0;n<this.geometries.length;++n)this.near[n]>f.far&&(f.far=this.near[n]),this.near[n]>2&&this.far[n]<f.near&&(f.near=this.far[n]);const l=this.looseRange;l.near=Math.max(.5*f.near,2),l.far=2*f.far;let d=0,g=0;for(let n=0;n<this.geometries.length;++n)this.near[n]<f.near&&(this.near[n]>=l.near?f.near=this.near[n]:this.nearCandidates[d++]=n),this.far[n]>f.far&&(this.far[n]<=l.far?f.far=this.far[n]:this.farCandidates[g++]=n);if(0===this.nearCandidates.length&&0===this.farCandidates.length)return f;this.nearCandidates.sort(((e,t)=>this.near[e]<this.near[t]?-1:this.near[e]>this.near[t]?1:0)),this.farCandidates.sort(((e,t)=>this.far[e]<this.far[t]?1:this.far[e]>this.far[t]?-1:0));for(let n=0;n<this.nearCandidates.length;++n){const e=this.nearCandidates[n];if(this.near[e]<f.near){const t=this.geometries[e],r=t.boundingInfo;this._includeNearBoundingInfoRec(r,t.getShaderTransformation())}}for(let n=0;n<this.farCandidates.length;++n){const e=this.farCandidates[n];if(this.far[e]>f.far){const t=this.geometries[e],r=t.boundingInfo;this._includeFarBoundingInfoRec(r,t.getShaderTransformation())}}return f}_reset(){this.geometries.length=0,this.near.length=0,this.far.length=0,this.nearCandidates.length=0,this.farCandidates.length=0,this.range.near=Number.MAX_VALUE,this.range.far=-Number.MAX_VALUE}_includeNearBoundingInfoRec(e,t){if(r(e))return;const i=e.getCenter();o(D,i,t);const n=g(t),s=D[0],a=D[1],h=D[2],f=e.getBSRadius()*n,c=this.frustum;if(c[0][0]*s+c[0][1]*a+c[0][2]*h+c[0][3]>f||c[1][0]*s+c[1][1]*a+c[1][2]*h+c[1][3]>f||c[2][0]*s+c[2][1]*a+c[2][2]*h+c[2][3]>f||c[3][0]*s+c[3][1]*a+c[3][2]*h+c[3][3]>f)return;const l=this.view[2]*s+this.view[6]*a+this.view[10]*h+this.view[14],u=l+f;if(!(-(l-f)<2||-u>=this.range.near))if(-u>this.looseRange.near)this.range.near=-u;else{if(f>B){const r=e.getChildren();if(void 0!==r){for(let e=0;e<8;++e)void 0!==r[e]&&this._includeNearBoundingInfoRec(r[e],t);return}}U.unionDepthRangeWithAABB(this.range,this.viewProj,t,e.getBBMin(),e.getBBMax())}}_includeFarBoundingInfoRec(e,t){if(r(e))return;let i=e.getBSRadius();const n=e.getCenter();o(D,n,t);const s=g(t),a=D[0],h=D[1],f=D[2];i*=s;const c=this.frustum;if(c[0][0]*a+c[0][1]*h+c[0][2]*f+c[0][3]>i||c[1][0]*a+c[1][1]*h+c[1][2]*f+c[1][3]>i||c[2][0]*a+c[2][1]*h+c[2][2]*f+c[2][3]>i||c[3][0]*a+c[3][1]*h+c[3][2]*f+c[3][3]>i)return;const l=this.view[2]*a+this.view[6]*h+this.view[10]*f+this.view[14]-i;if(!(-l<=this.range.far))if(-l<this.looseRange.far)this.range.far=-l;else{if(i>B){const r=e.getChildren();if(void 0!==r){for(let e=0;e<8;++e)void 0!==r[e]&&this._includeFarBoundingInfoRec(r[e],t);return}}U.unionDepthRangeWithAABB(this.range,this.viewProj,t,e.getBBMin(),e.getBBMax())}}}class N{constructor(){this.modelViewProj=a(),this.clipPosition=[f(),f(),f(),f(),f(),f(),f(),f()]}unionDepthRangeWithAABB(e,t,r,i,s){const a=this.modelViewProj;n(a,t,r);let o=!1;for(let n=0;n<8;++n){const e=this.clipPosition[n],t=0===n||3===n||4===n||7===n?i[0]:s[0],r=0===n||1===n||4===n||5===n?i[1]:s[1],o=n<4?i[2]:s[2];e[0]=a[0]*t+a[4]*r+a[8]*o+a[12],e[1]=a[1]*t+a[5]*r+a[9]*o+a[13],e[2]=a[2]*t+a[6]*r+a[10]*o+a[14],e[3]=a[3]*t+a[7]*r+a[11]*o+a[15]}for(let n=0;n<12;++n){const t=this.clipPosition[V[n][0]],r=this.clipPosition[V[n][1]],i=this.clipPosition[V[n][2]],s=this._clipTriangle(t,r,i);let a=!0;for(let e=0;e<s.length;++e){if(s[e][3]>=2){a=!1;break}}if(!a){o=!0;for(let t=0;t<s.length;++t){const r=s[t][3];r<e.near&&(e.near=r),r>e.far&&(e.far=r)}}}return o}_inside(e,t){return 0===t?e[0]>=-e[3]:1===t?e[1]>=-e[3]:2===t?e[0]<=e[3]:3===t?e[1]<=e[3]:void w(!1)}_intersect(e,t,r){let i=0;return 0===r?i=(-e[3]-e[0])/(t[0]-e[0]+t[3]-e[3]):1===r?i=(-e[3]-e[1])/(t[1]-e[1]+t[3]-e[3]):2===r?i=(e[3]-e[0])/(t[0]-e[0]-t[3]+e[3]):3===r&&(i=(e[3]-e[1])/(t[1]-e[1]-t[3]+e[3])),h(f(),e,t,i)}_clipTriangle(e,t,r){let i=[e,t,r];for(let n=0;n<4;++n){const e=i;i=[];for(let t=0;t<e.length;++t){const r=e[t],s=e[(t+1)%e.length];this._inside(s,n)?(this._inside(r,n)||i.push(this._intersect(r,s,n)),i.push(s)):this._inside(r,n)&&i.push(this._intersect(r,s,n))}}return i}}const V=[[0,1,3],[2,3,1],[1,5,2],[6,2,5],[5,4,6],[7,6,4],[4,0,7],[3,7,0],[3,2,7],[6,7,2],[4,5,0],[1,0,5]],D=d(),E=a(),W=m(),k=new P,K=new x,U=new N;export{x as DepthRangeFromRenderGeometries,T as depthRangeFromLayer,M as depthRangeFromScene,A as textureToDepth};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{releaseMaybe as e,isNone as s}from"../../../../../core/maybe.js";import t from"../../../../../core/PooledArray.js";import{t as r,e as i,g as
|
|
5
|
+
import{releaseMaybe as e,isNone as s}from"../../../../../core/maybe.js";import t from"../../../../../core/PooledArray.js";import{t as r,e as i,g as n}from"../../../../../chunks/mat3.js";import{c as o}from"../../../../../chunks/mat3f32.js";import{g as a,s as l}from"../../../../../chunks/vec3.js";import{c as h}from"../../../../../chunks/vec3f64.js";import c from"../../../support/debugFlags.js";import{ComponentDrawParameters as d}from"../../collections/Component/Material/ComponentTechnique.js";import{bindSliceUniforms as m}from"../../core/shaderLibrary/Slice.glsl.js";import{bindModelTransform as u}from"../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import{bindMultipassTerrainTexture as f}from"../../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import{doublePrecisionRequiresObfuscation as g}from"../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{TwoVectorPosition as b}from"../../core/util/TwoVectorPosition.js";import{EdgeShaderTechniqueConfiguration as p,EdgeShaderTechnique as T}from"./EdgeShaderTechnique.js";import{Transparency as R}from"./interfaces.js";import{EdgeUtilMode as A}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{PrimitiveType as P}from"../../../../webgl/enums.js";const E=8,S=128,y={type:"uber",slicePlaneEnabled:!1,sliceHighlightDisabled:!1,strokesTexture:null,legacy:!0};class N{constructor(){this._value=0}get value(){return this._value}increment(){this._value++}decrement(){this._value--}}const v={solid:A.SOLID,sketch:A.SKETCH,uber:A.MIXED};class x{constructor(e,s,r){this.rctx=e,this.shaderTechniqueRepository=s,this.config=new p,this.technique=null,this.refCount=new N,this.renderables=new Set,this.sortedRenderables={[R.TRANSPARENT]:{[R.TRANSPARENT]:new t,[R.OPAQUE]:new t},[R.OPAQUE]:{[R.TRANSPARENT]:new t,[R.OPAQUE]:new t}},this.renderablesDirty=!1,this.settings={...y,...r},this.key=x.getKey(this.settings.type,this.settings.slicePlaneEnabled,this.settings.legacy);const i=this.settings.strokesTexture.variants;this.writerSettings={variants:i,reducedPrecision:c.TESTS_DISABLE_OPTIMIZATIONS},this.config.legacy=this.settings.legacy,this.config.mode=v[this.settings.type],this.config.silhouette=!1,this.config.antialiasing=!!this.rctx.capabilities.blendMinMax,this.config.slicePlaneEnabled=this.settings.slicePlaneEnabled,this.config.doublePrecisionRequiresObfuscation=g(e)}dispose(){this.technique=e(this.technique)}addRenderable(e){this.renderables.add(e),this.renderablesDirty=!0}removeRenderable(e){this.renderables.delete(e),this.renderablesDirty=!0}setRenderablesDirty(){this.renderablesDirty=!0}forEachRenderable(e,s){this.renderablesDirty&&this._sortRenderables(),this.sortedRenderables[s][R.TRANSPARENT].forAll(e),this.sortedRenderables[s][R.OPAQUE].forAll(e)}setMultipassParameters(e){this.config.multipassTerrainEnabled=!!e.multipassTerrainEnabled&&e.multipassTerrainEnabled,this.config.cullAboveGround=!!e.cullAboveGround&&e.cullAboveGround}bindRegularEdges(e,s){this.setMultipassParameters(e),this.config.silhouette=!1,this.technique=this.shaderTechniqueRepository.releaseAndAcquire(T,this.config,this.technique),this.rctx.useProgram(this.technique.program),this.technique.bindPass({bindParameters:e,edgeRenderParameters:s}),this.technique.bindPipelineState(this.rctx,e.slot)}bindSilhouetteEdges(e,s){this.setMultipassParameters(e),this.config.silhouette=!0,this.technique=this.shaderTechniqueRepository.releaseAndAcquire(T,this.config,this.technique),this.rctx.useProgram(this.technique.program),this.technique.bindPass({bindParameters:e,edgeRenderParameters:s}),this.technique.bindPipelineState(this.rctx,e.slot)}renderRegularEdges(e,s,t){this._render(e,e.regular.vao,s,t)}renderSilhouetteEdges(e,s,t){this._render(e,e.silhouette.vao,s,t)}_render(e,s,t,r){this._setUniforms(e,t),this.rctx.bindVAO(s),this.rctx.capabilities.instancing.drawArraysInstanced(P.TRIANGLE_FAN,0,4,r)}_setUniforms(e,s){const t=this.technique.program;if(e.components.buffer.textureBuffer.bind(t,U,q),s.multipassTerrainEnabled&&(t.setUniform2fv("nearFar",s.camera.nearFar),t.setUniform2fv("inverseViewport",s.inverseViewport),f(t,s)),"origin"in e.transform)t.setUniformMatrix4fv("view",s.localViewMatrixForEdges),t.setUniformMatrix4fv("model",e.transform.modelMatrix),m(t,this.settings,s.slicePlane,e.transform.origin.vec3);else{const o=new b(e.transform.position),h=r(M,i(M,e.transform.rotationScale)),c=new d;a(c.transformWorldFromModelTL,o.low),a(c.transformWorldFromModelTH,o.high),n(c.transformWorldFromModelRS,e.transform.rotationScale),n(c.transformNormalGlobalFromModel,h),u(t,c),t.setUniformMatrix3fv("transformNormalGlobalFromModel",c.transformNormalGlobalFromModel);const f=s.camera.viewInverseTransposeMatrix,g=l(w,f[3],f[7],f[11]);m(t,this.settings,s.slicePlane,g)}"uber"!==this.settings.type&&"sketch"!==this.settings.type||this._setSketchUniforms(t)}_setSketchUniforms(e){const t=this.settings.strokesTexture,r=t.texture;s(r)||(e.bindTexture(r,"strokesTexture"),e.setUniform2f("strokesTextureScale",1/r.descriptor.width,1/r.descriptor.height),e.setUniform1f("strokesLog2Resolution",Math.log2(t.resolution)),e.setUniform1f("strokesNormalizationScale",t.normalizationScale),e.setUniform1f("strokesAmplitude",t.amplitude),e.setUniform1f("strokeVariants",t.variants))}_sortRenderables(){this.renderablesDirty=!1,this.sortedRenderables[R.TRANSPARENT][R.TRANSPARENT].clear(),this.sortedRenderables[R.TRANSPARENT][R.OPAQUE].clear(),this.sortedRenderables[R.OPAQUE][R.TRANSPARENT].clear(),this.sortedRenderables[R.OPAQUE][R.OPAQUE].clear(),this.renderables.forEach((e=>{e.objectTransparency!==R.INVISIBLE&&e.edgeTransparency!==R.INVISIBLE&&this.sortedRenderables[e.objectTransparency][e.edgeTransparency].push(e)}));const e=(e,s)=>"origin"in e.transform&&"origin"in s.transform?e.transform.origin.id<s.transform.origin.id?-1:e.transform.origin.id>s.transform.origin.id?1:0:0;this.sortedRenderables[R.TRANSPARENT][R.TRANSPARENT].sort(e),this.sortedRenderables[R.TRANSPARENT][R.OPAQUE].sort(e),this.sortedRenderables[R.OPAQUE][R.TRANSPARENT].sort(e),this.sortedRenderables[R.OPAQUE][R.OPAQUE].sort(e)}static getKey(e,s,t){return`edges-t:${e}:${s}:${t}`}}const U="componentDataTex",q="componentDataTexInvDim",M=o(),w=h();export{S as EXTENSION_LENGTH_OFFSET,x as EdgeRenderer,E as LINE_WIDTH_FRACTION_FACTOR,q as componentDataInvDimName,U as componentDataTexName};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{bindViewProjTransform as r}from"../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import{ReloadableShaderModule as i}from"../../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as o}from"../../core/shaderTechnique/ShaderTechnique.js";import{parameter as t,ShaderTechniqueConfiguration as s}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Program as a}from"../Program.js";import{EdgeShaderAttributeLocations as l}from"./bufferLayouts.js";import{E as n}from"../../../../../chunks/EdgeShaderProgram.glsl.js";import{EdgeUtilMode as d}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{BlendOperation as c,BlendFactor as m,CompareFunction as u}from"../../../../webgl/enums.js";import{makePipelineState as p,separateBlendingParams as f,defaultColorWriteParams as h,defaultDepthWriteParams as b}from"../../../../webgl/renderState.js";const g=-4e-4,P=.5;class E extends o{bindPass(e){const i=this.program,{edgeRenderParameters:o,bindParameters:t}=e;r(i,o.viewProjectionTransform),i.setUniformMatrix3fv("transformNormalViewFromGlobal",o.transformNormalViewFromGlobal),i.setUniformMatrix4fv("proj",t.camera.projectionMatrix),i.setUniform2f("depthBias",P,g),i.setUniform2f("pixelToNDC",2/t.camera.fullViewport[2],2/t.camera.fullViewport[3]),i.setUniform2f("ndcToPixel",t.camera.fullViewport[2]/2,t.camera.fullViewport[3]/2),i.setUniform1f("distanceFalloffFactor",o.distanceFalloffFactor),i.setUniform2f("inverseViewport",1/t.camera.fullViewport[2],1/t.camera.fullViewport[3]),i.setUniform1f("pixelRatio",t.camera.pixelRatio||1)}initializeProgram(e){const r=E.shader.get(),i=this.configuration,o=r.build({slicePlaneEnabled:i.slicePlaneEnabled,sliceHighlightDisabled:!1,sliceEnabledForVertexPrograms:!1,silhouette:i.silhouette,legacy:i.legacy,antialiasing:i.antialiasing,mode:i.mode,doublePrecisionRequiresObfuscation:i.doublePrecisionRequiresObfuscation,multipassTerrainEnabled:i.multipassTerrainEnabled,cullAboveGround:i.cullAboveGround});return new a(e.rctx,o,l)}initializePipeline(e){const r=e.rctx.capabilities.blendMinMax;return p(r?{blending:f(m.ONE,m.ONE,m.ZERO,m.ONE,c.ADD,r.MAX),depthTest:{func:u.LEQUAL},colorWrite:h}:{depthTest:{func:u.LEQUAL},depthWrite:b,colorWrite:h})}}E.shader=new i(n,(()=>import("../../shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js")));class v extends s{constructor(){super(...arguments),this.slicePlaneEnabled=!1,this.silhouette=!1,this.legacy=!1,this.antialiasing=!1,this.mode=d.SOLID,this.doublePrecisionRequiresObfuscation=!1,this.multipassTerrainEnabled=!1,this.cullAboveGround=!1}}e([t()],v.prototype,"slicePlaneEnabled",void 0),e([t()],v.prototype,"silhouette",void 0),e([t()],v.prototype,"legacy",void 0),e([t()],v.prototype,"antialiasing",void 0),e([t({count:d.COUNT})],v.prototype,"mode",void 0),e([t()],v.prototype,"doublePrecisionRequiresObfuscation",void 0),e([t()],v.prototype,"multipassTerrainEnabled",void 0),e([t()],v.prototype,"cullAboveGround",void 0);export{E as EdgeShaderTechnique,v as EdgeShaderTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r}from"../../../../../core/arrayUtils.js";import s from"../../../../../core/Logger.js";import{clamp as o}from"../../../../../core/mathUtils.js";import{disposeMaybe as i,destroyMaybe as n,isNone as a,isSome as c}from"../../../../../core/maybe.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as g,t as m,e as u}from"../../../../../chunks/mat3.js";import{c as h}from"../../../../../chunks/mat3f64.js";import{c as p}from"../../../../../chunks/mat4.js";import{c as f}from"../../../../../chunks/mat4f64.js";import{s as b,g as y,v as j,d as O}from"../../../../../chunks/vec3.js";import{c as v}from"../../../../../chunks/vec3f64.js";import{g as w,l as E}from"../../../../../chunks/sphere.js";import{c as R}from"../../../../../chunks/vec33.js";import{VertexPosition as x}from"../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import{TwoVectorPosition as _}from"../../core/util/TwoVectorPosition.js";import{VertexAttribute as T}from"../basicInterfaces.js";import{GridLocalOriginFactory as M}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as C}from"../localOriginHelper.js";import{LocalOriginManager as P}from"../LocalOriginManager.js";import{Object3D as D}from"../Object3D.js";import{VertexLayout as A,EdgeShaderAttributeLocations as S,glVertexLayout as k,EdgeInputBufferLayout as I}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as B,SilhouetteEdgeBufferWriter as L}from"./edgeBufferWriters.js";import{EdgeType as U}from"./edgePreprocessing.js";import{EdgeRenderer as V,LINE_WIDTH_FRACTION_FACTOR as N,EXTENSION_LENGTH_OFFSET as H}from"./EdgeRenderer.js";import z from"./EdgeWorkerHandle.js";import{Transparency as F}from"./interfaces.js";import{generateStrokesTexture as K}from"./strokes.js";import{determineRendererType as W,determineEdgeTransparency as G,determineObjectTransparency as q,fillComponenBufferIndices as Q,computeEdgeCount as J}from"./util.js";import{BufferManager as X}from"../TextureBackedBuffer/BufferManager.js";import{WatchUpdatingTracking as Y}from"../../../../support/WatchUpdatingTracking.js";import{BufferObject as Z}from"../../../../webgl/BufferObject.js";import{Usage as $}from"../../../../webgl/enums.js";import{VertexArrayObject as ee}from"../../../../webgl/VertexArrayObject.js";const te=s.getLogger("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView");let re=class extends t{constructor(e){super(e),this.updatingHandles=new Y,this.perObjectData=new Map,this.perObjectDataEvictionCache=new Set,this.renderers=new Map,this.numberOfRenderedEdges={[F.TRANSPARENT]:0,[F.OPAQUE]:0},this.gpuMemoryUsage=0,this.workerAbort=new AbortController,this.tmpModelPosition=v(),this.localOrigins=new P(new M(e.renderSR))}initialize(){this.worker=new z(this.schedule),this.componentColorManager=new X(this.rctx,2);const e=A.createBuffer(4);for(let t=0;t<4;t++)e.sideness.set(t,0,0===t||3===t?0:1),e.sideness.set(t,1,0===t||1===t?0:1);this.verticesBufferObject=Z.createVertex(this.rctx,$.STATIC_DRAW,e.buffer)}destroy(){this.destroyed||(this.perObjectData.forEach((e=>this._discardObjectEntry(e))),this.perObjectData.clear(),this.strokesTexture=i(this.strokesTexture),this.componentColorManager=n(this.componentColorManager),this.workerAbort.abort(),this.worker.destroy(),this.verticesBufferObject=i(this.verticesBufferObject),this.renderers.clear(),this.updatingHandles.destroy())}get updating(){return this.updatingHandles.updating}get usedMemory(){return this.gpuMemoryUsage}get numberOfRenderedPrimitives(){return this.numberOfRenderedEdges[F.TRANSPARENT]+this.numberOfRenderedEdges[F.OPAQUE]}shouldRender(){return this.renderers.size>0}async addComponentObject(e,t,r,s,o,i,n,a){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let c;const d=new ie(new Promise((e=>c=e)),r.center,r.radius);this.perObjectData.set(e,d);const l=await this.updatingHandles.addPromise(this._addComponentGeometry(t,d,s,o,i,n,a));return this.setNeedsRender(),c(),l}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void te.warn("Attempt to add an object to a destroyed instance");const o=this.perObjectData.get(e);let i;(null==o?void 0:o.renderables.length)>0&&this.perObjectDataEvictionCache.add(o);const n=e.boundingVolumeWorldSpace.bounds,a=new ie(new Promise((e=>i=e)),w(n),E(n));this.perObjectData.set(e,a);const c=new Array;if(r.mergeGeometries&&e.geometries.length>1&&oe(e))c.push(this._addObjectMergedGeometries(e,a,t,r,s));else for(let d=0;d<e.geometries.length;d++){const o=e.geometryRecords[d];if(!o.material.supportsEdges)continue;const i=e.geometries[d];c.push(this._addGeometry(e,a,i,o,t[0],r,s))}await this.updatingHandles.addPromise(Promise.all(c)),this.perObjectDataEvictionCache.delete(a),this._discardObjectEntry(o),this.setNeedsRender(),i()}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this.perObjectData.has(e)}async updateAllComponentOpacities(e,t){const r=t instanceof Array?e=>t[e]:()=>t;(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>{const t=e.components.meta.length;for(let s=0;s<t;s++){const t=r(s),o=e.components.meta[s],i=o.index;o.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(i,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async getObjectMemoryUsage(e){return(await this._getObjectEntry(e)).renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0)}async updateAllComponentMaterials(e,t,r,s){const o=e instanceof D,i=!!r.slicePlaneEnabled,n=W(t),a=V.getKey(n,i,o);(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>{if(a!==e.rendererKey){const t=this.renderers.get(e.rendererKey),r=this._acquireRenderer(n,i,o);t.removeRenderable(e),t.refCount.decrement(),e.rendererKey=a,r.addRenderable(e)}for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];s&&this._updateComponentBuffer(e.components),this._updateTransparency(e)})),this.setNeedsRender()}async updateObjectVisibility(e,t){(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>e.visible=t)),this.setNeedsRender()}removeObject(e){const t=this.perObjectData.get(e);t&&(this.perObjectData.delete(e),this._discardObjectEntry(t))}async _getObjectEntry(e){const t=this.perObjectData.get(e);if(!t)throw"no object";return await t.loaded,t}removeAll(){this.perObjectData.forEach(((e,t)=>this.removeObject(t)))}render(e,t){if(this.numberOfRenderedEdges[t]=0,a(this.componentColorManager))return;this.localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=v(),o=new _,i=new x.ViewProjectionTransform,n=h();b(s,r[3],r[7],r[11]),o.set(s),y(i.worldFromView_TH,o.high),y(i.worldFromView_TL,o.low),g(i.viewFromCameraRelative_RS,e.camera.viewMatrix),p(i.projFromView,e.camera.projectionMatrix);const c=h();m(c,i.viewFromCameraRelative_RS),u(n,c);let d=0,l=0;if(this.renderers.forEach((e=>{0===e.refCount.value?(this.renderers.delete(e.key),e.dispose()):e.forEachRenderable((e=>{e.visible&&(d+=e.statistics.averageEdgeLength,l++)}),t)})),this.componentColorManager.garbageCollect(),this.componentColorManager.updateTextures(),0===l)return;const f={distanceFalloffFactor:40*d/l,minimumEdgeLength:e.camera.perScreenPixelRatio,transparency:t,viewProjectionTransform:i,transformNormal_ViewFromGlobal:n};this._updateObjectCameraDistances(e),this.renderers.forEach((t=>{this._renderRegularEdges(t,e,f),this._renderSilhouetteEdges(t,e,f)}))}_updateTransparency(e){const t=G(e.components.meta),r=q(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this.renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){if(e.getCombinedStaticTransformation(t,r),c(t.origin))this.localOrigins.register(t.origin);else{const e=b(this.tmpModelPosition,r[12],r[13],r[14]);t.origin=this.localOrigins.acquire(e)}return C(t.origin.vec3,r),t.origin}_updateComponentBuffer(e){const{meta:t,buffer:r}=e;for(let s=0;s<t.length;s++){const e=t[s].material,i=t[s].index,n=o(Math.round(e.size*N),0,255),a=o(e.extensionLength,-H,255-H)+H,c="solid"===e.type?U.SOLID:U.SKETCH,d=255*e.opacity,l=e.color,g=255*l[0],m=255*l[1],u=255*l[2],h=255*l[3];r.textureBuffer.setData(i,0,g,m,u,h),r.textureBuffer.setData(i,1,n,a,c,d)}}_createComponentBuffers(e){if(a(this.componentColorManager))return null;const t=new Array,r=this.componentColorManager.getBuffer(e.length);for(let o=0;o<e.length;o++){const s=e[o],i=r.acquireIndex();t.push({index:i,material:s})}const s={meta:t,buffer:r};return this._updateComponentBuffer(s),s}_extractEdges(e,t,r,s,o,i=o.length){return this.worker.process({data:t,indices:o,indicesLength:i,writerSettings:e,skipDeduplicate:r},this.workerAbort.signal,s)}_createEdgeResources(e){const t={};if(a(this.verticesBufferObject))return t;if(e.regular.lodInfo.lengths.length>0){const r=new ee(this.rctx,S,{vertices:k,instances:B.glLayout},{vertices:this.verticesBufferObject,instances:Z.createVertex(this.rctx,$.STATIC_DRAW,e.regular.instancesData.buffer)});t.regular={vao:r,lod:e.regular.lodInfo}}if(e.silhouette.lodInfo.lengths.length>0){const r=new ee(this.rctx,S,{vertices:k,instances:L.glLayout},{vertices:this.verticesBufferObject,instances:Z.createVertex(this.rctx,$.STATIC_DRAW,e.silhouette.instancesData.buffer)});t.silhouette={vao:r,lod:e.silhouette.lodInfo}}return t}async _addGeometry(e,t,r,s,o,i,n){const a=r.vertexAttributes.get(T.POSITION),c=r.indices.get(T.POSITION),d=f(),l={position:a,indices:c,modelTransform:d,origin:this._computeModelTransformWithLocalOrigin(e,s,d)};return this._addPositionData(t,l,r.edgeIndicesLength,o,i,n)}async _addPositionData(e,t,r,s,o,i=!1){if(null==e.loaded)return;const n=this._createComponentBuffers([s]);if(a(n)||r<=0)return;const c=this._acquireRenderer(s.type,!!o.slicePlaneEnabled),{modelTransform:d,origin:l}=t,g=t.indices,m=t.position,u=m.data.length/m.size,h=I.createBuffer(u);for(let a=0;a<u;a++)h.position.set(a,0,m.data[a*m.size+0]),h.position.set(a,1,m.data[a*m.size+1]),h.position.set(a,2,m.data[a*m.size+2]);Q(n.meta,[0,h.componentIndex.count],h.componentIndex);const p=await this.updatingHandles.addPromise(this._extractEdges(c.writerSettings,h,!1,i,g,r));if(null==e.loaded)return;const{regular:f,silhouette:b}=this._createEdgeResources(p),y=(f?f.vao.size:0)+(b?b.vao.size:0),j={regular:f,silhouette:b,transform:{modelMatrix:d,origin:l},statistics:{gpuMemoryUsage:y,externalMemoryUsage:!1,averageEdgeLength:p.averageEdgeLength},components:n,visible:!0,edgeTransparency:G(n.meta),objectTransparency:q(n.meta),distanceToCamera:0,rendererKey:c.key};e.renderables.push(j),c.addRenderable(j),this.gpuMemoryUsage+=y}async _addComponentGeometry(e,t,r,s,o,i,n){if(null==t.loaded)return 0;const c=this._createComponentBuffers(i);if(a(c))return 0;const d=W(i),l=this._acquireRenderer(d,n.slicePlaneEnabled||!1,!1),g=I.createBuffer(r.count);R(g.position,r),Q(c.meta,o,g.componentIndex,s);const m=!0,u=l.writerSettings,h=await this.updatingHandles.addPromise(this._extractEdges(u,g,m,!1,s));if(null==t.loaded)return 0;const{regular:p,silhouette:f}=this._createEdgeResources(h),b=(p?p.vao.size:0)+(f?f.vao.size:0),y={regular:p,silhouette:f,transform:e,statistics:{gpuMemoryUsage:b,externalMemoryUsage:!0,averageEdgeLength:h.averageEdgeLength},components:c,visible:!0,edgeTransparency:G(c.meta),objectTransparency:q(c.meta),distanceToCamera:0,rendererKey:l.key};return t.renderables.push(y),l.addRenderable(y),b}async _addObjectMergedGeometries(e,t,r,s,o){const i=new Map;let n=0,a=null,c=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f],r=e.geometryRecords[f];if(!r.material.supportsEdges)continue;!a&&r.origin&&(a=r);const s=t.vertexAttributes.get(T.POSITION);c+=s.data.length/s.size,n+=t.edgeIndicesLength}const d=c>=65536?Uint32Array:Uint16Array,l=n?new d(n):null,g=[];let m=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f];if(!e.geometryRecords[f].material.supportsEdges)continue;const r=t.vertexAttributes.get(T.POSITION),s=t.indices.get(T.POSITION);let o=i.get(r.data);if(null==o){o=g.length/3;for(let e=0;e<r.data.length;e+=r.size)g.push(r.data[e+0]),g.push(r.data[e+1]),g.push(r.data[e+2]);i.set(r.data,o)}if(s)for(let e=0;e<t.edgeIndicesLength;e++)l[m++]=o+s[e]}const u=a||e.geometryRecords[0],h=f(),p=this._computeModelTransformWithLocalOrigin(e,u,h);for(let f=0;f<e.geometryRecords.length;f++)e.geometryRecords[f].origin=p;const b={position:{data:g,size:3},indices:l,modelTransform:h,origin:p};await this.updatingHandles.addPromise(this._addPositionData(t,b,l.length,r[0],s,o))}_acquireRenderer(e,t,r=!0){const s=V.getKey(e,t,r);let o=this.renderers.get(s);return a(this.strokesTexture)&&(this.strokesTexture=K(this.rctx)),o||(o=new V(this.rctx,this.techniqueRepository,{type:e,slicePlaneEnabled:t,strokesTexture:this.strokesTexture,legacy:r}),this.renderers.set(s,o)),o.refCount.increment(),o}_removeRenderable(e){se(e);const t=this.renderers.get(e.rendererKey);if(t){t.removeRenderable(e),t.refCount.decrement(),"origin"in e.transform&&this.localOrigins.release(e.transform.origin),this.gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=v(),o=e=>{const{center:o,radius:i}=e;j(s,o,t);const n=O(s,r),a=n<-i?1/0:n<i?0:n-i;e.renderables.forEach((e=>e.distanceToCamera=a))};this.perObjectData.forEach(o),this.perObjectDataEvictionCache.forEach(o)}_renderRegularEdges(e,t,r){e.bindRegularEdges(t,r);const s=r.transparency;e.forEachRenderable((o=>{if(!o.visible||!o.regular)return;const i=J(o.regular.lod.lengths,o.distanceToCamera,r);"origin"in o.transform&&(t.localViewMatrixForEdges=this.localOrigins.getViewMatrix(o.transform.origin)),e.renderRegularEdges(o,t,i),this.numberOfRenderedEdges[s]+=i}),s)}_renderSilhouetteEdges(e,t,r){e.bindSilhouetteEdges(t,r);const s=r.transparency;e.forEachRenderable((o=>{if(!o.visible||!o.silhouette)return;const i=J(o.silhouette.lod.lengths,o.distanceToCamera,r);"origin"in o.transform&&(t.localViewMatrixForEdges=this.localOrigins.getViewMatrix(o.transform.origin)),e.renderSilhouetteEdges(o,t,i),this.numberOfRenderedEdges[s]+=i}),s)}};function se(e){e.regular&&(e.regular.vao.vertexBuffers.instances.dispose(),e.regular.vao.dispose(!1),e.regular.vao=null),e.silhouette&&(e.silhouette.vao.vertexBuffers.instances.dispose(),e.silhouette.vao.dispose(!1),e.silhouette.vao=null)}function oe(e){let t=null,s=null;for(let i=0;i<e.geometries.length;i++){var o;const n=e.geometryRecords[i];if(n.material.supportsEdges){if(t){if(!r(t,n.transformation))return!1}else t=n.transformation;if(!s&&c(n.origin))s=n;else if(c(null==(o=s)?void 0:o.origin)&&c(n.origin)&&s.origin.id!==n.origin.id)return!1}}return!0}e([d({constructOnly:!0})],re.prototype,"rctx",void 0),e([d({constructOnly:!0})],re.prototype,"renderSR",void 0),e([d({constructOnly:!0})],re.prototype,"techniqueRepository",void 0),e([d({constructOnly:!0})],re.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],re.prototype,"schedule",void 0),e([d({readOnly:!0})],re.prototype,"updatingHandles",void 0),e([d({readOnly:!0})],re.prototype,"updating",null),re=e([l("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],re);class ie{constructor(e,t,r){this.center=t,this.radius=r,this.renderables=new Array,this.loaded=e,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0)}))}}export{re as EdgeView};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r}from"../../../../../core/arrayUtils.js";import s from"../../../../../core/Logger.js";import{clamp as o}from"../../../../../core/mathUtils.js";import{disposeMaybe as n,destroyMaybe as i,isNone as a,isSome as c}from"../../../../../core/maybe.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{f as g,t as m,e as u}from"../../../../../chunks/mat3.js";import{c as h}from"../../../../../chunks/mat3f64.js";import{c as p}from"../../../../../chunks/mat4.js";import{c as f}from"../../../../../chunks/mat4f64.js";import{s as b,g as y,v as j,d as O}from"../../../../../chunks/vec3.js";import{c as v}from"../../../../../chunks/vec3f64.js";import{g as E,l as w}from"../../../../../chunks/sphere.js";import{c as R}from"../../../../../chunks/vec33.js";import{VertexPositionViewProjectionTransform as x}from"../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import{TwoVectorPosition as T}from"../../core/util/TwoVectorPosition.js";import{GridLocalOriginFactory as _}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as M}from"../localOriginHelper.js";import{LocalOriginManager as C}from"../LocalOriginManager.js";import{Object3D as P}from"../Object3D.js";import{VertexAttribute as D}from"../VertexAttribute.js";import{VertexLayout as A,EdgeShaderAttributeLocations as S,glVertexLayout as k,EdgeInputBufferLayout as I}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as B,SilhouetteEdgeBufferWriter as L}from"./edgeBufferWriters.js";import{EdgeType as V}from"./edgePreprocessing.js";import{EdgeRenderer as U,LINE_WIDTH_FRACTION_FACTOR as N,EXTENSION_LENGTH_OFFSET as H}from"./EdgeRenderer.js";import z from"./EdgeWorkerHandle.js";import{Transparency as F}from"./interfaces.js";import{generateStrokesTexture as W}from"./strokes.js";import{determineRendererType as K,determineEdgeTransparency as G,determineObjectTransparency as q,fillComponenBufferIndices as Q,computeEdgeCount as J}from"./util.js";import{BufferManager as X}from"../TextureBackedBuffer/BufferManager.js";import{WatchUpdatingTracking as Y}from"../../../../support/WatchUpdatingTracking.js";import{BufferObject as Z}from"../../../../webgl/BufferObject.js";import{Usage as $}from"../../../../webgl/enums.js";import{VertexArrayObject as ee}from"../../../../webgl/VertexArrayObject.js";const te=s.getLogger("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView");let re=class extends t{constructor(e){super(e),this.updatingHandles=new Y,this.perObjectData=new Map,this.perObjectDataEvictionCache=new Set,this.renderers=new Map,this.numberOfRenderedEdges={[F.TRANSPARENT]:0,[F.OPAQUE]:0},this.gpuMemoryUsage=0,this.workerAbort=new AbortController,this.tmpModelPosition=v(),this.localOrigins=new C(new _(e.renderSR))}initialize(){this.worker=new z(this.schedule),this.componentColorManager=new X(this.rctx,2);const e=A.createBuffer(4);for(let t=0;t<4;t++)e.sideness.set(t,0,0===t||3===t?0:1),e.sideness.set(t,1,0===t||1===t?0:1);this.verticesBufferObject=Z.createVertex(this.rctx,$.STATIC_DRAW,e.buffer)}destroy(){this.destroyed||(this.perObjectData.forEach((e=>this._discardObjectEntry(e))),this.perObjectData.clear(),this.strokesTexture=n(this.strokesTexture),this.componentColorManager=i(this.componentColorManager),this.workerAbort.abort(),this.worker.destroy(),this.verticesBufferObject=n(this.verticesBufferObject),this.renderers.clear(),this.updatingHandles.destroy())}get updating(){return this.updatingHandles.updating}get usedMemory(){return this.gpuMemoryUsage}get numberOfRenderedPrimitives(){return this.numberOfRenderedEdges[F.TRANSPARENT]+this.numberOfRenderedEdges[F.OPAQUE]}shouldRender(){return this.renderers.size>0}async addComponentObject(e,t,r,s,o,n,i,a){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let c;const d=new ne(new Promise((e=>c=e)),r.center,r.radius);this.perObjectData.set(e,d);const l=await this.updatingHandles.addPromise(this._addComponentGeometry(t,d,s,o,n,i,a));return this.setNeedsRender(),c(),l}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void te.warn("Attempt to add an object to a destroyed instance");const o=this.perObjectData.get(e);let n;(null==o?void 0:o.renderables.length)>0&&this.perObjectDataEvictionCache.add(o);const i=e.boundingVolumeWorldSpace.bounds,a=new ne(new Promise((e=>n=e)),E(i),w(i));this.perObjectData.set(e,a);const c=new Array;if(r.mergeGeometries&&e.geometries.length>1&&oe(e))c.push(this._addObjectMergedGeometries(e,a,t,r,s));else for(let d=0;d<e.geometries.length;d++){const o=e.geometryRecords[d];if(!o.material.supportsEdges)continue;const n=e.geometries[d];c.push(this._addGeometry(e,a,n,o,t[0],r,s))}await this.updatingHandles.addPromise(Promise.all(c)),this.perObjectDataEvictionCache.delete(a),this._discardObjectEntry(o),this.setNeedsRender(),n()}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this.perObjectData.has(e)}async updateAllComponentOpacities(e,t){const r=t instanceof Array?e=>t[e]:()=>t;(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>{const t=e.components.meta.length;for(let s=0;s<t;s++){const t=r(s),o=e.components.meta[s],n=o.index;o.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(n,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async getObjectMemoryUsage(e){return(await this._getObjectEntry(e)).renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0)}async updateAllComponentMaterials(e,t,r,s){const o=e instanceof P,n=!!r.slicePlaneEnabled,i=K(t),a=U.getKey(i,n,o);(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>{if(a!==e.rendererKey){const t=this.renderers.get(e.rendererKey),r=this._acquireRenderer(i,n,o);t.removeRenderable(e),t.refCount.decrement(),e.rendererKey=a,r.addRenderable(e)}for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];s&&this._updateComponentBuffer(e.components),this._updateTransparency(e)})),this.setNeedsRender()}async updateObjectVisibility(e,t){(await this.updatingHandles.addPromise(this._getObjectEntry(e))).renderables.forEach((e=>e.visible=t)),this.setNeedsRender()}removeObject(e){const t=this.perObjectData.get(e);t&&(this.perObjectData.delete(e),this._discardObjectEntry(t))}async _getObjectEntry(e){const t=this.perObjectData.get(e);if(!t)throw"no object";return await t.loaded,t}removeAll(){this.perObjectData.forEach(((e,t)=>this.removeObject(t)))}render(e,t){if(this.numberOfRenderedEdges[t]=0,a(this.componentColorManager))return;this.localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=v(),o=new T,n=new x,i=h();b(s,r[3],r[7],r[11]),o.set(s),y(n.transformWorldFromViewTH,o.high),y(n.transformWorldFromViewTL,o.low),g(n.transformViewFromCameraRelativeRS,e.camera.viewMatrix),p(n.transformProjFromView,e.camera.projectionMatrix);const c=h();m(c,n.transformViewFromCameraRelativeRS),u(i,c);let d=0,l=0;if(this.renderers.forEach((e=>{0===e.refCount.value?(this.renderers.delete(e.key),e.dispose()):e.forEachRenderable((e=>{e.visible&&(d+=e.statistics.averageEdgeLength,l++)}),t)})),this.componentColorManager.garbageCollect(),this.componentColorManager.updateTextures(),0===l)return;const f={distanceFalloffFactor:40*d/l,minimumEdgeLength:e.camera.perScreenPixelRatio,transparency:t,viewProjectionTransform:n,transformNormalViewFromGlobal:i};this._updateObjectCameraDistances(e),this.renderers.forEach((t=>{this._renderRegularEdges(t,e,f),this._renderSilhouetteEdges(t,e,f)}))}_updateTransparency(e){const t=G(e.components.meta),r=q(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this.renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){if(e.getCombinedStaticTransformation(t,r),c(t.origin))this.localOrigins.register(t.origin);else{const e=b(this.tmpModelPosition,r[12],r[13],r[14]);t.origin=this.localOrigins.acquire(e)}return M(t.origin.vec3,r),t.origin}_updateComponentBuffer(e){const{meta:t,buffer:r}=e;for(let s=0;s<t.length;s++){const e=t[s].material,n=t[s].index,i=o(Math.round(e.size*N),0,255),a=o(e.extensionLength,-H,255-H)+H,c="solid"===e.type?V.SOLID:V.SKETCH,d=255*e.opacity,l=e.color,g=255*l[0],m=255*l[1],u=255*l[2],h=255*l[3];r.textureBuffer.setData(n,0,g,m,u,h),r.textureBuffer.setData(n,1,i,a,c,d)}}_createComponentBuffers(e){if(a(this.componentColorManager))return null;const t=new Array,r=this.componentColorManager.getBuffer(e.length);for(let o=0;o<e.length;o++){const s=e[o],n=r.acquireIndex();t.push({index:n,material:s})}const s={meta:t,buffer:r};return this._updateComponentBuffer(s),s}_extractEdges(e,t,r,s,o,n=o.length){return this.worker.process({data:t,indices:o,indicesLength:n,writerSettings:e,skipDeduplicate:r},this.workerAbort.signal,s)}_createEdgeResources(e){const t={};if(a(this.verticesBufferObject))return t;if(e.regular.lodInfo.lengths.length>0){const r=new ee(this.rctx,S,{vertices:k,instances:B.glLayout},{vertices:this.verticesBufferObject,instances:Z.createVertex(this.rctx,$.STATIC_DRAW,e.regular.instancesData.buffer)});t.regular={vao:r,lod:e.regular.lodInfo}}if(e.silhouette.lodInfo.lengths.length>0){const r=new ee(this.rctx,S,{vertices:k,instances:L.glLayout},{vertices:this.verticesBufferObject,instances:Z.createVertex(this.rctx,$.STATIC_DRAW,e.silhouette.instancesData.buffer)});t.silhouette={vao:r,lod:e.silhouette.lodInfo}}return t}async _addGeometry(e,t,r,s,o,n,i){const a=r.vertexAttributes.get(D.POSITION),c=r.indices.get(D.POSITION),d=f(),l={position:a,indices:c,modelTransform:d,origin:this._computeModelTransformWithLocalOrigin(e,s,d)};return this._addPositionData(t,l,r.edgeIndicesLength,o,n,i)}async _addPositionData(e,t,r,s,o,n=!1){if(null==e.loaded)return;const i=this._createComponentBuffers([s]);if(a(i)||r<=0)return;const c=this._acquireRenderer(s.type,!!o.slicePlaneEnabled),{modelTransform:d,origin:l}=t,g=t.indices,m=t.position,u=m.data.length/m.size,h=I.createBuffer(u);for(let a=0;a<u;a++)h.position.set(a,0,m.data[a*m.size+0]),h.position.set(a,1,m.data[a*m.size+1]),h.position.set(a,2,m.data[a*m.size+2]);Q(i.meta,[0,h.componentIndex.count],h.componentIndex);const p=await this.updatingHandles.addPromise(this._extractEdges(c.writerSettings,h,!1,n,g,r));if(null==e.loaded)return;const{regular:f,silhouette:b}=this._createEdgeResources(p),y=(f?f.vao.size:0)+(b?b.vao.size:0),j={regular:f,silhouette:b,transform:{modelMatrix:d,origin:l},statistics:{gpuMemoryUsage:y,externalMemoryUsage:!1,averageEdgeLength:p.averageEdgeLength},components:i,visible:!0,edgeTransparency:G(i.meta),objectTransparency:q(i.meta),distanceToCamera:0,rendererKey:c.key};e.renderables.push(j),c.addRenderable(j),this.gpuMemoryUsage+=y}async _addComponentGeometry(e,t,r,s,o,n,i){if(null==t.loaded)return 0;const c=this._createComponentBuffers(n);if(a(c))return 0;const d=K(n),l=this._acquireRenderer(d,i.slicePlaneEnabled||!1,!1),g=I.createBuffer(r.count);R(g.position,r),Q(c.meta,o,g.componentIndex,s);const m=!0,u=l.writerSettings,h=await this.updatingHandles.addPromise(this._extractEdges(u,g,m,!1,s));if(null==t.loaded)return 0;const{regular:p,silhouette:f}=this._createEdgeResources(h),b=(p?p.vao.size:0)+(f?f.vao.size:0),y={regular:p,silhouette:f,transform:e,statistics:{gpuMemoryUsage:b,externalMemoryUsage:!0,averageEdgeLength:h.averageEdgeLength},components:c,visible:!0,edgeTransparency:G(c.meta),objectTransparency:q(c.meta),distanceToCamera:0,rendererKey:l.key};return t.renderables.push(y),l.addRenderable(y),b}async _addObjectMergedGeometries(e,t,r,s,o){const n=new Map;let i=0,a=null,c=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f],r=e.geometryRecords[f];if(!r.material.supportsEdges)continue;!a&&r.origin&&(a=r);const s=t.vertexAttributes.get(D.POSITION);c+=s.data.length/s.size,i+=t.edgeIndicesLength}const d=c>=65536?Uint32Array:Uint16Array,l=i?new d(i):null,g=[];let m=0;for(let f=0;f<e.geometries.length;f++){const t=e.geometries[f];if(!e.geometryRecords[f].material.supportsEdges)continue;const r=t.vertexAttributes.get(D.POSITION),s=t.indices.get(D.POSITION);let o=n.get(r.data);if(null==o){o=g.length/3;for(let e=0;e<r.data.length;e+=r.size)g.push(r.data[e+0]),g.push(r.data[e+1]),g.push(r.data[e+2]);n.set(r.data,o)}if(s)for(let e=0;e<t.edgeIndicesLength;e++)l[m++]=o+s[e]}const u=a||e.geometryRecords[0],h=f(),p=this._computeModelTransformWithLocalOrigin(e,u,h);for(let f=0;f<e.geometryRecords.length;f++)e.geometryRecords[f].origin=p;const b={position:{data:g,size:3},indices:l,modelTransform:h,origin:p};await this.updatingHandles.addPromise(this._addPositionData(t,b,l.length,r[0],s,o))}_acquireRenderer(e,t,r=!0){const s=U.getKey(e,t,r);let o=this.renderers.get(s);return a(this.strokesTexture)&&(this.strokesTexture=W(this.rctx)),o||(o=new U(this.rctx,this.techniqueRepository,{type:e,slicePlaneEnabled:t,strokesTexture:this.strokesTexture,legacy:r}),this.renderers.set(s,o)),o.refCount.increment(),o}_removeRenderable(e){se(e);const t=this.renderers.get(e.rendererKey);if(t){t.removeRenderable(e),t.refCount.decrement(),"origin"in e.transform&&this.localOrigins.release(e.transform.origin),this.gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=v(),o=e=>{const{center:o,radius:n}=e;j(s,o,t);const i=O(s,r),a=i<-n?1/0:i<n?0:i-n;e.renderables.forEach((e=>e.distanceToCamera=a))};this.perObjectData.forEach(o),this.perObjectDataEvictionCache.forEach(o)}_renderRegularEdges(e,t,r){e.bindRegularEdges(t,r);const s=r.transparency;e.forEachRenderable((o=>{if(!o.visible||!o.regular)return;const n=J(o.regular.lod.lengths,o.distanceToCamera,r);"origin"in o.transform&&(t.localViewMatrixForEdges=this.localOrigins.getViewMatrix(o.transform.origin)),e.renderRegularEdges(o,t,n),this.numberOfRenderedEdges[s]+=n}),s)}_renderSilhouetteEdges(e,t,r){e.bindSilhouetteEdges(t,r);const s=r.transparency;e.forEachRenderable((o=>{if(!o.visible||!o.silhouette)return;const n=J(o.silhouette.lod.lengths,o.distanceToCamera,r);"origin"in o.transform&&(t.localViewMatrixForEdges=this.localOrigins.getViewMatrix(o.transform.origin)),e.renderSilhouetteEdges(o,t,n),this.numberOfRenderedEdges[s]+=n}),s)}};function se(e){e.regular&&(e.regular.vao.vertexBuffers.instances.dispose(),e.regular.vao.dispose(!1),e.regular.vao=null),e.silhouette&&(e.silhouette.vao.vertexBuffers.instances.dispose(),e.silhouette.vao.dispose(!1),e.silhouette.vao=null)}function oe(e){let t=null,s=null;for(let n=0;n<e.geometries.length;n++){var o;const i=e.geometryRecords[n];if(i.material.supportsEdges){if(t){if(!r(t,i.transformation))return!1}else t=i.transformation;if(!s&&c(i.origin))s=i;else if(c(null==(o=s)?void 0:o.origin)&&c(i.origin)&&s.origin.id!==i.origin.id)return!1}}return!0}e([d({constructOnly:!0})],re.prototype,"rctx",void 0),e([d({constructOnly:!0})],re.prototype,"renderSR",void 0),e([d({constructOnly:!0})],re.prototype,"techniqueRepository",void 0),e([d({constructOnly:!0})],re.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],re.prototype,"schedule",void 0),e([d({readOnly:!0})],re.prototype,"updatingHandles",void 0),e([d({readOnly:!0})],re.prototype,"updating",null),re=e([l("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],re);class ne{constructor(e,t,r){this.center=t,this.radius=r,this.renderables=new Array,this.loaded=e,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0)}))}}export{re as EdgeView};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{glLayout as N}from"../../../support/buffer/glUtil.js";import{newLayout as
|
|
5
|
+
import{glLayout as N}from"../../../support/buffer/glUtil.js";import{newLayout as O}from"../../../support/buffer/InterleavedLayout.js";import{VertexAttribute as I}from"../VertexAttribute.js";const A=O().vec3f(I.POSITION).u16(I.COMPONENTINDEX).u16(I.U16PADDING),e=O().vec2u8(I.SIDENESS),T=N(e),E=O().vec3f(I.POSITION0).vec3f(I.POSITION1).u16(I.COMPONENTINDEX).u8(I.VARIANTOFFSET,{glNormalized:!0}).u8(I.VARIANTSTROKE).u8(I.VARIANTEXTENSION,{glNormalized:!0}).u8(I.U8PADDING,{glPadding:!0}).u16(I.U16PADDING,{glPadding:!0}),S=E.clone().vec3f(I.NORMAL),r=E.clone().vec3f(I.NORMALA).vec3f(I.NORMALB),o=new Map([[I.POSITION0,0],[I.POSITION1,1],[I.COMPONENTINDEX,2],[I.VARIANTOFFSET,3],[I.VARIANTSTROKE,4],[I.VARIANTEXTENSION,5],[I.NORMAL,6],[I.NORMALA,6],[I.NORMALB,7],[I.SIDENESS,8]]);export{E as CommonInstancesLayout,A as EdgeInputBufferLayout,o as EdgeShaderAttributeLocations,S as RegularEdgeInstancesLayout,r as SilhouetteEdgeInstancesLayout,e as VertexLayout,T as glVertexLayout};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../../core/Evented.js";import{f as e,e as s,t as i}from"../../../../../chunks/mat3.js";import{c as a}from"../../../../../chunks/mat3f64.js";import{m as r}from"../../../../../chunks/mat4.js";import{c as o}from"../../../../../chunks/mat4f64.js";import{s as n}from"../../../../../chunks/vec3.js";import{c as h}from"../../../../../chunks/vec3f64.js";import{BufferViewMat4f64 as l,BufferViewVec3f64 as c,BufferViewMat3f as f,BufferViewVec2f as m,BufferViewVec4f64 as g,BufferViewVec4f as _,BufferViewUint8 as d}from"../../../../../geometry/support/buffer/BufferView.js";import{scaleFromMatrix as T}from"../../../support/mathUtils.js";import{newLayout as u}from"../../../support/buffer/InterleavedLayout.js";import{
|
|
5
|
+
import t from"../../../../../core/Evented.js";import{f as e,e as s,t as i}from"../../../../../chunks/mat3.js";import{c as a}from"../../../../../chunks/mat3f64.js";import{m as r}from"../../../../../chunks/mat4.js";import{c as o}from"../../../../../chunks/mat4f64.js";import{s as n}from"../../../../../chunks/vec3.js";import{c as h}from"../../../../../chunks/vec3f64.js";import{BufferViewMat4f64 as l,BufferViewVec3f64 as c,BufferViewMat3f as f,BufferViewVec2f as m,BufferViewVec4f64 as g,BufferViewVec4f as _,BufferViewUint8 as d}from"../../../../../geometry/support/buffer/BufferView.js";import{scaleFromMatrix as T}from"../../../support/mathUtils.js";import{newLayout as u}from"../../../support/buffer/InterleavedLayout.js";import{assert as L}from"../Util.js";import{VertexAttribute as A}from"../VertexAttribute.js";var E;function F(t){let e=u().mat4f64(A.LOCALTRANSFORM).mat4f64(A.GLOBALTRANSFORM).vec4f64(A.BOUNDINGSPHERE).vec3f64(A.MODELORIGIN).mat3f(A.MODEL).mat3f(A.MODELNORMAL).vec2f(A.MODELSCALEFACTORS);return t.indexOf("color")>=0&&(e=e.vec4f(A.COLOR)),t.indexOf("featureAttribute")>=0&&(e=e.vec4f(A.FEATUREATTRIBUTE)),e=e.u8(A.STATE).u8(A.LODLEVEL).alignTo(8),e}!function(t){t[t.ALLOCATED=1]="ALLOCATED",t[t.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE",t[t.VISIBLE=4]="VISIBLE",t[t.HIGHLIGHT=8]="HIGHLIGHT",t[t.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",t[t.REMOVE=32]="REMOVE",t[t.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED",t[t.ACTIVE=18]="ACTIVE"}(E||(E={}));class O{constructor(t){this.localTransform=t.getField(A.LOCALTRANSFORM,l),this.globalTransform=t.getField(A.GLOBALTRANSFORM,l),this.modelOrigin=t.getField(A.MODELORIGIN,c),this.model=t.getField(A.MODEL,f),this.modelNormal=t.getField(A.MODELNORMAL,f),this.modelScaleFactors=t.getField(A.MODELSCALEFACTORS,m),this.boundingSphere=t.getField(A.BOUNDINGSPHERE,g),this.color=t.getField(A.COLOR,_),this.featureAttribute=t.getField(A.FEATUREATTRIBUTE,_),this.state=t.getField(A.STATE,d),this.lodLevel=t.getField(A.LODLEVEL,d)}}class S extends t{constructor(t,e){super(),this._capacity=0,this._size=0,this._next=0,this._layout=F(t),this._shaderTransformation=e}get capacity(){return this._capacity}get size(){return this._size}get buffer(){return this._buffer.buffer}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const t=this._findSlot();return this._view.state.set(t,E.ALLOCATED),this._size++,this.emit("instance-added",{index:t}),t}removeInstance(t){const e=this._view.state;L(t>=0&&t<this._capacity&&e.get(t)&E.ALLOCATED,"invalid instance handle"),this._getStateFlag(t,E.ACTIVE)?this._setStateFlags(t,E.REMOVE):this.freeInstance(t),this.emit("instance-removed",{index:t})}freeInstance(t){const e=this._view.state;L(t>=0&&t<this._capacity&&e.get(t)&E.ALLOCATED,"invalid instance handle"),e.set(t,0),this._size--}setLocalTransform(t,e,s=!0){this._view.localTransform.setMat(t,e),s&&this.updateModelTransform(t)}getLocalTransform(t,e){this._view.localTransform.getMat(t,e)}setGlobalTransform(t,e,s=!0){this._view.globalTransform.setMat(t,e),s&&this.updateModelTransform(t)}getGlobalTransform(t,e){this._view.globalTransform.getMat(t,e)}updateModelTransform(t){const a=this._view,o=M,h=I;a.localTransform.getMat(t,b),a.globalTransform.getMat(t,w);const l=r(w,w,b);n(o,l[12],l[13],l[14]),a.modelOrigin.setVec(t,o),e(h,l),a.model.setMat(t,h);const c=T(M,l);c.sort(),a.modelScaleFactors.set(t,0,c[1]),a.modelScaleFactors.set(t,1,c[2]),s(h,h),i(h,h),a.modelNormal.setMat(t,h),this._setStateFlags(t,E.TRANSFORM_CHANGED),this.emit("instance-transform-changed",{index:t})}getModelTransform(t,e){const s=this._view;s.model.getMat(t,I),s.modelOrigin.getVec(t,M),e[0]=I[0],e[1]=I[1],e[2]=I[2],e[3]=0,e[4]=I[3],e[5]=I[4],e[6]=I[5],e[7]=0,e[8]=I[6],e[9]=I[7],e[10]=I[8],e[11]=0,e[12]=M[0],e[13]=M[1],e[14]=M[2],e[15]=1}applyShaderTransformation(t,e){this._shaderTransformation&&this._shaderTransformation.applyTransform(this,t,e)}getCombinedModelTransform(t,e){return this.getModelTransform(t,e),this._shaderTransformation&&this._shaderTransformation.applyTransform(this,t,e),e}getCombinedLocalTransform(t,e){return this._view.localTransform.getMat(t,e),this._shaderTransformation&&this._shaderTransformation.applyTransform(this,t,e),e}getCombinedMaxScaleFactor(t){let e=this._view.modelScaleFactors.get(t,1);if(this._shaderTransformation){const s=this._shaderTransformation.scaleFactor(M,this,t);e*=Math.max(s[0],s[1],s[2])}return e}getCombinedMedianScaleFactor(t){let e=this._view.modelScaleFactors.get(t,0);if(this._shaderTransformation){const s=this._shaderTransformation.scaleFactor(M,this,t);s.sort(),e*=s[1]}return e}getModel(t,e){this._view.model.getMat(t,e)}setFeatureAttribute(t,e){this._view.featureAttribute.setVec(t,e)}getFeatureAttribute(t,e){this._view.featureAttribute.getVec(t,e)}setColor(t,e){this._view.color.setVec(t,e)}getColor(t,e){this._view.color.getVec(t,e)}setVisible(t,e){e!==this.getVisible(t)&&(this._setStateFlag(t,E.VISIBLE,e),this.emit("instance-visibility-changed",{index:t}))}getVisible(t){return this._getStateFlag(t,E.VISIBLE)}setHighlight(t,e){e!==this.getHighlight(t)&&(this._setStateFlag(t,E.HIGHLIGHT,e),this.emit("instance-highlight-changed",{index:t}))}getHighlight(t){return this._getStateFlag(t,E.HIGHLIGHT)}getState(t){return this._view.state.get(t)}getLodLevel(t){return this._view.lodLevel.get(t)}countFlags(t){let e=0;for(let s=0;s<this._capacity;++s){this.getState(s)&t&&++e}return e}_setStateFlags(t,e){const s=this._view.state;e=s.get(t)|e,s.set(t,e)}_clearStateFlags(t,e){const s=this._view.state;e=s.get(t)&~e,s.set(t,e)}_setStateFlag(t,e,s){s?this._setStateFlags(t,e):this._clearStateFlags(t,e)}_getStateFlag(t,e){return!!(this._view.state.get(t)&e)}_grow(){const t=Math.max(v,Math.floor(this._capacity*p)),e=this._layout.createBuffer(t);if(this._buffer){const t=new Uint8Array(this._buffer.buffer);new Uint8Array(e.buffer).set(t)}this._capacity=t,this._buffer=e,this._view=new O(this._buffer)}_findSlot(){const t=this._view.state;let e=this._next;for(;t.get(e)&E.ALLOCATED;)e=(e+1)%this._capacity;return this._next=(e+1)%this._capacity,e}}const v=1024,p=2,M=h(),I=a(),b=o(),w=o();export{S as InstanceData,O as InstanceDataView,E as StateFlags};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as e}from"../../../../../core/maybe.js";import{isAborted as t,throwIfAborted as s}from"../../../../../core/promiseUtils.js";import{I as a,c as n}from"../../../../../chunks/mat4f64.js";import{a as i}from"../../../../../chunks/vec2f64.js";import{f as r,d as l,m as o}from"../../../../../chunks/vec3.js";import{c}from"../../../../../chunks/vec3f64.js";import{c as h}from"../../../../../chunks/vec4f64.js";import d from"../../../support/debugFlags.js";import{glLayout as u}from"../../../support/buffer/glUtil.js";import{bindOutputHighlight as _}from"../../core/shaderLibrary/output/OutputHighlight.glsl.js";import p from"../Camera.js";import{Default3D as m}from"../DefaultVertexAttributeLocations.js";import{IntersectorType as f}from"../IntersectorInterfaces.js";import{DepthOrder as g}from"../Octree.js";import{RenderPass as I}from"../RenderPass.js";import{RenderSlot as D}from"../RenderSlot.js";import{assert as v}from"../Util.js";import{InstanceData as y,StateFlags as E}from"./InstanceData.js";import{InstanceOctree as T}from"./InstanceOctree.js";import{LevelSelector as R}from"./LevelSelector.js";import{LodLevel as A}from"./LodLevel.js";import{RenderInstanceData as b}from"./RenderInstanceData.js";import{getInstanceBufferLayout as C}from"../../materials/DefaultMaterial.js";import{colorMixModes as L}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as S}from"../../materials/renderers/utils.js";import{bindVertexBufferLayout as U,unbindVertexBufferLayout as x}from"../../../../webgl/Util.js";let P=function(e){const t=e.baseBoundingSphere.radius,s=e.levels.map((e=>e.minScreenSpaceRadius));return new R(t,s)};function O(e){P=e}class H{constructor(e,t,s,a){this.type=f.LOD,this.isGround=!1,this._inverseViewport=i(),this._levels=[],this._defaultRenderInstanceData=[],this._highlightRenderInstanceData=[],this._instanceIndex=0,this._slicePlane=!1,this._enableLevelSelection=!0,this._lastCamera=new p,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.slots=[D.OPAQUE_PLUGIN,D.TRANSPARENT_PLUGIN],this.canRender=!0,this._symbol=e,this._optionalFields=t,this._metadata=s,this._instanceBufferLayout=C({instancedDoublePrecision:!0,instanced:t}),this._glInstanceBufferLayout=u(this._instanceBufferLayout,1),this._instanceData=new y(this._optionalFields,a),this._instanceData.on("instance-added",(()=>this._requestUpdateCycle())),this._instanceData.on("instance-removed",(()=>this._requestUpdateCycle())),this._instanceData.on("instance-transform-changed",(e=>{this._requestUpdateCycle(),this._metadata.notifyGraphicGeometryChanged(e.index)})),this._instanceData.on("instance-visibility-changed",(e=>{this._requestUpdateCycle(!0),this._metadata.notifyGraphicVisibilityChanged(e.index)})),this._instanceData.on("instance-highlight-changed",(()=>this._requestUpdateCycle(!0))),this._enableLevelSelection=this._symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this._metadata.layerUid}get instanceData(){return this._instanceData}get memoryUsage(){const e={cpu:0,gpu:0};return this._defaultRenderInstanceData.forEach((t=>{const s=t.memoryUsage;e.cpu+=s.cpu,e.gpu+=s.gpu})),this._highlightRenderInstanceData.forEach((t=>{const s=t.memoryUsage;e.cpu+=s.cpu,e.gpu+=s.gpu})),e}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach(((e,s)=>{const a=this._defaultRenderInstanceData[s],n=this._highlightRenderInstanceData[s],i=a.size+n.size,r=e.triangleCount;t.push({renderedInstances:i,renderedTriangles:i*r,trianglesPerInstance:r})})),{totalInstances:e,renderedInstances:t.reduce(((e,t)=>e+t.renderedInstances),0),renderedTriangles:t.reduce(((e,t)=>e+t.renderedTriangles),0),levels:t}}async initializeRenderContext(e,a){this._context=e;const n=e.renderContext.rctx,i=await Promise.allSettled(this._symbol.levels.map((t=>(this._defaultRenderInstanceData.push(new b(n,this._instanceBufferLayout)),this._highlightRenderInstanceData.push(new b(n,this._instanceBufferLayout)),A.create(e,t,a))))),r=i.map((e=>"fulfilled"===e.status?e.value:null)).filter((e=>e));if(t(a)||r.length!==i.length){r.forEach((e=>e.destroy())),s(a);for(const e of i)if("rejected"===e.status)throw e.reason}this._levels=r,this._levelSelector=P(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach((e=>e.destroy())),this._defaultRenderInstanceData.forEach((e=>e.destroy())),this._highlightRenderInstanceData.forEach((e=>e.destroy()))}get needsTransparentPass(){return this._levels.some((e=>e.components.some((e=>e.material.requiresSlot(D.TRANSPARENT_MATERIAL)))))}get needsHighlight(){return this._highlightRenderInstanceData.some((e=>e.size>0))}prepareRender(e,t){if(d.LOD_INSTANCE_RENDERER_DISABLE_UPDATES)return;if(this._enableLevelSelection){const e=t.equals(this._lastCamera);this._lastCamera.copyFrom(t),e||this._requestUpdateCycle()}const s=this._needFullCycle?this._instanceData.size:2e3;this._needFullCycle=!1,this._updateInstances(t,s),this.needsUpdates&&this._context.requestRender()}render(e){var t,s,n,i;const r=e.slot===D.OPAQUE_PLUGIN?D.OPAQUE_MATERIAL:e.slot===D.TRANSPARENT_PLUGIN?D.TRANSPARENT_MATERIAL:null;if(!r||!this.baseMaterial.isVisible()||!this.baseMaterial.isVisibleInPass(e.pass))return;const l=e.camera;this._inverseViewport[0]=1/l.fullViewport[2],this._inverseViewport[1]=1/l.fullViewport[3];const o={slot:r,origin:[0,0,0],camera:l,inverseViewport:this._inverseViewport,shadowMap:e.shadowMap,shadowMappingEnabled:e.shadowMap.enabled,ssaoHelper:e.ssaoHelper,ssaoEnabled:e.ssaoHelper.enabled,screenToWorldRatio:null,screenToPCSRatio:null,slicePlane:e.sliceHelper&&e.sliceHelper.plane,hudVisibilityTexture:null!=(t=null==(s=e.offscreenRenderingHelper)?void 0:s.hudVisibilityTexture)?t:null,highlightDepthTexture:null!=(n=null==(i=e.offscreenRenderingHelper)?void 0:i.depthTexture)?n:null,hasOccludees:!1,linearDepthTexture:null,lastFrameColorTexture:null,reprojectionMatrix:a,ssrEnabled:!1,lighting:e.scenelightingData,transparencyPassType:e.transparencyPassType,terrainLinearDepthTexture:e.multipassTerrainParams.terrainLinearDepthTexture,geometryLinearDepthTexture:e.multipassGeometryParams.geometryLinearDepthTexture,multipassTerrainEnabled:e.multipassTerrainParams.multipassTerrainEnabled,cullAboveGround:e.multipassTerrainParams.cullAboveGround,multipassGeometryEnabled:e.multipassGeometryParams.multipassGeometryEnabled,highlightColorTexture:null};e.rctx.bindVAO();const c=e.pass!==I.MATERIAL_HIGHLIGHT&&e.pass!==I.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT,h=e.pass!==I.MATERIAL_DEPTH_SHADOWMAP_DEFAULT;c&&this._renderComponents(e,r,o,this._defaultRenderInstanceData),h&&this._renderComponents(e,r,o,this._highlightRenderInstanceData)}intersect(e,t,s,a){if(!this.baseMaterial.isVisible())return;const n=c();r(n,a,s);const i=n=>{this._instanceData.getCombinedModelTransform(n,N),e.transform.set(N),o(G,s,e.transform.inverse),o(F,a,e.transform.inverse);const i=this._instanceData.getState(n),r=this._instanceData.getLodLevel(n);v(i&E.ACTIVE,"invalid instance state"),v(r>=0&&r<this._levels.length,"invaid lod level"),this._levels[r].intersect(e,t,G,F,n,this._metadata)};this.baseMaterial.parameters.verticalOffset?this.octree.forEach(i):this.octree.forEachAlongRay(s,n,i)}queryDepthRange(e){return this._queryDepthRangeOctree(e)}notifyShaderTransformationChanged(){this._invalidateOctree()}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,e&&(this._needFullCycle=!0),this.needsUpdates&&this._context.requestRender()}get needsUpdates(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}get octree(){return this._octree||(this._octree=this._buildOctree()),this._octree}_invalidateOctree(){this._octree&&(this._octree.destroy(),this._octree=null)}_buildOctree(){const e=new T(this._instanceData,this.baseBoundingSphere),t=this._instanceData,s=t.view?t.view.state:null;for(let a=0;a<this._instanceData.capacity;++a){s.get(a)&E.ACTIVE&&e.addInstance(a)}return e}_queryDepthRangeOctree(e){const t=e.eye,s=e.viewForward,a=this.octree.findClosest(s,g.FRONT_TO_BACK,e.frustum),n=this.octree.findClosest(s,g.BACK_TO_FRONT,e.frustum);if(null!=a&&null!=n){this._instanceData.view.boundingSphere.getVec(a,j),r(j,j,t);const i=l(j,s)-j[3];this._instanceData.view.boundingSphere.getVec(n,j),r(j,j,t);const o=l(j,s)+j[3];return{near:Math.max(e.near,i),far:Math.min(e.far,o)}}return{near:1/0,far:-1/0}}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._defaultRenderInstanceData.forEach((e=>{e.startUpdateCylce()})),this._highlightRenderInstanceData.forEach((e=>{e.startUpdateCylce()})),this.needsUpdates&&this._context.requestRender()}_updateInstances(e,t){const s=this._enableLevelSelection,a=this._levelSelector;a.updateCamera(e),this._defaultRenderInstanceData.forEach((e=>{e.beginUpdate()})),this._highlightRenderInstanceData.forEach((e=>{e.beginUpdate()}));const n=this._instanceData,i=this._instanceData.view,r=n.size,l=n.capacity;let o=this._instanceIndex;t=Math.min(r,t);for(let c=0;c<t;++c){0===o&&this._startUpdateCycle();const e=i.state.get(o);let r=0;if(!(e&E.ALLOCATED)){o=(o+1)%l,t++;continue}const c=i.lodLevel.get(o);if(e&E.DEFAULT_ACTIVE&&this._defaultRenderInstanceData[c].freeTail(),e&E.HIGHLIGHT_ACTIVE&&this._highlightRenderInstanceData[c].freeTail(),e&E.REMOVE)n.freeInstance(o);else if(e&E.VISIBLE){let t=0;s&&(i.modelOrigin.getVec(o,w),t=a.selectLevel(w,n.getCombinedMedianScaleFactor(o))),r=e&~(E.ACTIVE|E.TRANSFORM_CHANGED),t>=0&&(e&E.HIGHLIGHT?(M(this._highlightRenderInstanceData[t],i,o),r|=E.HIGHLIGHT_ACTIVE):(M(this._defaultRenderInstanceData[t],i,o),r|=E.DEFAULT_ACTIVE)),i.state.set(o,r),i.lodLevel.set(o,t)}else r=e&~(E.ACTIVE|E.TRANSFORM_CHANGED),i.state.set(o,r);if(this._octree){const t=!!(e&E.ACTIVE),s=!!(r&E.ACTIVE);!t&&s?this._octree.addInstance(o):t&&!s?this._octree.removeInstance(o):t&&s&&e&E.TRANSFORM_CHANGED&&(this._octree.removeInstance(o),this._octree.addInstance(o))}o=(o+1)%l}this._instanceIndex=o,this._defaultRenderInstanceData.forEach((e=>{e.endUpdate()})),this._highlightRenderInstanceData.forEach((e=>{e.endUpdate()}))}_renderComponents(e,t,s,a){this.levels.forEach(((n,i)=>{n.components.forEach((n=>{this._renderComponent(e,t,s,a[i],n,i)}))}))}_renderComponent(t,s,a,n,i,r){if(0===n.size||!i.material.requiresSlot(s))return;const{rctx:l,pass:o}=t,c=i.glMaterials.load(l,o);if(e(c))return;const h=l.capabilities.instancing,u=c.beginSlot(a),p=u.program;u.bindPipelineState(l,s),l.useProgram(p),c.bind(a,u),l.bindVAO(i.vao),u.ensureAttributeLocations(i.vao),t.isHighlightPass&&_(p,a),u.bindDraw(a),d.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&t.pass===I.MATERIAL&&(p.setUniform4fv("externalColor",B[Math.min(r,B.length-1)]),p.setUniform1i("colorMixMode",L.replace));const f=n.capacity,g=n.headIndex,D=n.tailIndex,y=n.firstIndex,E=this._glInstanceBufferLayout,T=(e,t)=>{U(l,m,n.buffer,E,e),h.drawArraysInstanced(u.primitiveType,0,i.vertexCount,t-e),x(l,m,n.buffer,E)};i.material.parameters.transparent&&null!=y?g>D?(v(y>=D&&y<=g,"invalid firstIndex"),T(y,g),T(D,y)):g<D&&(y<=g?(v(y>=0&&y<=g,"invalid firstIndex"),T(y,g),T(D,f),T(0,y)):(v(y>=D&&y<=f,"invalid firstIndex"),T(y,f),T(0,g),T(D,y))):g>D?T(D,g):g<D&&(T(0,g),T(D,f)),l.bindVAO(null)}}function M(e,t,s){const a=e.allocateHead();V(t,s,e.view,a)}function V(e,t,s,a){S(e.modelOrigin,t,s.modelOriginHi,s.modelOriginLo,a),s.model.copyFrom(a,e.model,t),s.modelNormal.copyFrom(a,e.modelNormal,t),e.color&&s.color&&s.color.copyFrom(a,e.color,t),e.featureAttribute&&s.featureAttribute&&s.featureAttribute.copyFrom(a,e.featureAttribute,t)}const w=c(),j=h(),N=n(),G=c(),F=c(),B=[[1,0,1,1],[0,0,1,1],[0,1,0,1],[1,1,0,1],[1,0,0,1]];export{H as LodRenderer,O as setLevelSelectorFactory};
|
|
5
|
+
import{isNone as e}from"../../../../../core/maybe.js";import{isAborted as t,throwIfAborted as s}from"../../../../../core/promiseUtils.js";import{I as a,c as n}from"../../../../../chunks/mat4f64.js";import{a as i}from"../../../../../chunks/vec2f64.js";import{f as r,d as l,m as o}from"../../../../../chunks/vec3.js";import{c}from"../../../../../chunks/vec3f64.js";import{c as h}from"../../../../../chunks/vec4f64.js";import d from"../../../support/debugFlags.js";import{glLayout as u}from"../../../support/buffer/glUtil.js";import{bindOutputHighlight as _}from"../../core/shaderLibrary/output/OutputHighlight.glsl.js";import m from"../Camera.js";import{Default3D as p}from"../DefaultVertexAttributeLocations.js";import{IntersectorType as f}from"../IntersectorInterfaces.js";import{DepthOrder as g}from"../Octree.js";import{RenderPass as I}from"../RenderPass.js";import{RenderSlot as D}from"../RenderSlot.js";import{assert as v}from"../Util.js";import{InstanceData as y,StateFlags as E}from"./InstanceData.js";import{InstanceOctree as T}from"./InstanceOctree.js";import{LevelSelector as R}from"./LevelSelector.js";import{LodLevel as A}from"./LodLevel.js";import{RenderInstanceData as C}from"./RenderInstanceData.js";import{getInstanceBufferLayout as b}from"../../materials/DefaultMaterial.js";import{colorMixModes as L}from"../../materials/internal/MaterialUtil.js";import{encodeDoubleVec3 as S}from"../../materials/renderers/utils.js";import{bindVertexBufferLayout as U,unbindVertexBufferLayout as x}from"../../../../webgl/Util.js";let P=function(e){const t=e.baseBoundingSphere.radius,s=e.levels.map((e=>e.minScreenSpaceRadius));return new R(t,s)};function O(e){P=e}class H{constructor(e,t,s,a){this.type=f.LOD,this.isGround=!1,this._inverseViewport=i(),this._levels=[],this._defaultRenderInstanceData=[],this._highlightRenderInstanceData=[],this._instanceIndex=0,this._slicePlane=!1,this._enableLevelSelection=!0,this._lastCamera=new m,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.slots=[D.OPAQUE_PLUGIN,D.TRANSPARENT_PLUGIN],this.canRender=!0,this._symbol=e,this._optionalFields=t,this._metadata=s,this._instanceBufferLayout=b({instancedDoublePrecision:!0,instanced:t}),this._glInstanceBufferLayout=u(this._instanceBufferLayout,1),this._instanceData=new y(this._optionalFields,a),this._instanceData.on("instance-added",(()=>this._requestUpdateCycle())),this._instanceData.on("instance-removed",(()=>this._requestUpdateCycle())),this._instanceData.on("instance-transform-changed",(e=>{this._requestUpdateCycle(),this._metadata.notifyGraphicGeometryChanged(e.index)})),this._instanceData.on("instance-visibility-changed",(e=>{this._requestUpdateCycle(!0),this._metadata.notifyGraphicVisibilityChanged(e.index)})),this._instanceData.on("instance-highlight-changed",(()=>this._requestUpdateCycle(!0))),this._enableLevelSelection=this._symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this._metadata.layerUid}get instanceData(){return this._instanceData}get memoryUsage(){const e={cpu:0,gpu:0};return this._defaultRenderInstanceData.forEach((t=>{const s=t.memoryUsage;e.cpu+=s.cpu,e.gpu+=s.gpu})),this._highlightRenderInstanceData.forEach((t=>{const s=t.memoryUsage;e.cpu+=s.cpu,e.gpu+=s.gpu})),e}get renderStats(){const e=this._instanceData.size,t=[];return this._levels.forEach(((e,s)=>{const a=this._defaultRenderInstanceData[s],n=this._highlightRenderInstanceData[s],i=a.size+n.size,r=e.triangleCount;t.push({renderedInstances:i,renderedTriangles:i*r,trianglesPerInstance:r})})),{totalInstances:e,renderedInstances:t.reduce(((e,t)=>e+t.renderedInstances),0),renderedTriangles:t.reduce(((e,t)=>e+t.renderedTriangles),0),levels:t}}async initializeRenderContext(e,a){this._context=e;const n=e.renderContext.rctx,i=await Promise.allSettled(this._symbol.levels.map((t=>(this._defaultRenderInstanceData.push(new C(n,this._instanceBufferLayout)),this._highlightRenderInstanceData.push(new C(n,this._instanceBufferLayout)),A.create(e,t,a))))),r=i.map((e=>"fulfilled"===e.status?e.value:null)).filter((e=>e));if(t(a)||r.length!==i.length){r.forEach((e=>e.destroy())),s(a);for(const e of i)if("rejected"===e.status)throw e.reason}this._levels=r,this._levelSelector=P(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach((e=>e.destroy())),this._defaultRenderInstanceData.forEach((e=>e.destroy())),this._highlightRenderInstanceData.forEach((e=>e.destroy()))}get needsTransparentPass(){return this._levels.some((e=>e.components.some((e=>e.material.requiresSlot(D.TRANSPARENT_MATERIAL)))))}get needsHighlight(){return this._highlightRenderInstanceData.some((e=>e.size>0))}prepareRender(e,t){if(d.LOD_INSTANCE_RENDERER_DISABLE_UPDATES)return;if(this._enableLevelSelection){const e=t.equals(this._lastCamera);this._lastCamera.copyFrom(t),e||this._requestUpdateCycle()}const s=this._needFullCycle?this._instanceData.size:2e3;this._needFullCycle=!1,this._updateInstances(t,s),this.needsUpdates&&this._context.requestRender()}render(e){var t,s,n,i;const r=e.slot===D.OPAQUE_PLUGIN?D.OPAQUE_MATERIAL:e.slot===D.TRANSPARENT_PLUGIN?D.TRANSPARENT_MATERIAL:null;if(!r||!this.baseMaterial.isVisible()||!this.baseMaterial.isVisibleInPass(e.pass))return;const l=e.camera;this._inverseViewport[0]=1/l.fullViewport[2],this._inverseViewport[1]=1/l.fullViewport[3];const o={slot:r,origin:[0,0,0],camera:l,inverseViewport:this._inverseViewport,shadowMap:e.shadowMap,shadowMappingEnabled:e.shadowMap.enabled,ssaoHelper:e.ssaoHelper,ssaoEnabled:e.ssaoHelper.enabled,screenToWorldRatio:null,screenToPCSRatio:null,slicePlane:e.sliceHelper&&e.sliceHelper.plane,hudVisibilityTexture:null!=(t=null==(s=e.offscreenRenderingHelper)?void 0:s.hudVisibilityTexture)?t:null,highlightDepthTexture:null!=(n=null==(i=e.offscreenRenderingHelper)?void 0:i.depthTexture)?n:null,hasOccludees:!1,linearDepthTexture:null,lastFrameColorTexture:null,reprojectionMatrix:a,ssrEnabled:!1,lighting:e.scenelightingData,transparencyPassType:e.transparencyPassType,terrainLinearDepthTexture:e.multipassTerrainParams.terrainLinearDepthTexture,geometryLinearDepthTexture:e.multipassGeometryParams.geometryLinearDepthTexture,multipassTerrainEnabled:e.multipassTerrainParams.multipassTerrainEnabled,cullAboveGround:e.multipassTerrainParams.cullAboveGround,multipassGeometryEnabled:e.multipassGeometryParams.multipassGeometryEnabled,highlightColorTexture:null,cloudsCompositionParams:null};e.rctx.bindVAO();const c=e.pass!==I.MATERIAL_HIGHLIGHT&&e.pass!==I.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT,h=e.pass!==I.MATERIAL_DEPTH_SHADOWMAP_DEFAULT;c&&this._renderComponents(e,r,o,this._defaultRenderInstanceData),h&&this._renderComponents(e,r,o,this._highlightRenderInstanceData)}intersect(e,t,s,a){if(!this.baseMaterial.isVisible())return;const n=c();r(n,a,s);const i=n=>{this._instanceData.getCombinedModelTransform(n,N),e.transform.set(N),o(G,s,e.transform.inverse),o(F,a,e.transform.inverse);const i=this._instanceData.getState(n),r=this._instanceData.getLodLevel(n);v(i&E.ACTIVE,"invalid instance state"),v(r>=0&&r<this._levels.length,"invaid lod level"),this._levels[r].intersect(e,t,G,F,n,this._metadata)};this.baseMaterial.parameters.verticalOffset?this.octree.forEach(i):this.octree.forEachAlongRay(s,n,i)}queryDepthRange(e){return this._queryDepthRangeOctree(e)}notifyShaderTransformationChanged(){this._invalidateOctree()}_requestUpdateCycle(e=!1){this._updateCyclesWithStaticCamera=-1,e&&(this._needFullCycle=!0),this.needsUpdates&&this._context.requestRender()}get needsUpdates(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}get octree(){return this._octree||(this._octree=this._buildOctree()),this._octree}_invalidateOctree(){this._octree&&(this._octree.destroy(),this._octree=null)}_buildOctree(){const e=new T(this._instanceData,this.baseBoundingSphere),t=this._instanceData,s=t.view?t.view.state:null;for(let a=0;a<this._instanceData.capacity;++a){s.get(a)&E.ACTIVE&&e.addInstance(a)}return e}_queryDepthRangeOctree(e){const t=e.eye,s=e.viewForward,a=this.octree.findClosest(s,g.FRONT_TO_BACK,e.frustum),n=this.octree.findClosest(s,g.BACK_TO_FRONT,e.frustum);if(null!=a&&null!=n){this._instanceData.view.boundingSphere.getVec(a,j),r(j,j,t);const i=l(j,s)-j[3];this._instanceData.view.boundingSphere.getVec(n,j),r(j,j,t);const o=l(j,s)+j[3];return{near:Math.max(e.near,i),far:Math.min(e.far,o)}}return{near:1/0,far:-1/0}}_startUpdateCycle(){this._updateCyclesWithStaticCamera++,this._defaultRenderInstanceData.forEach((e=>{e.startUpdateCylce()})),this._highlightRenderInstanceData.forEach((e=>{e.startUpdateCylce()})),this.needsUpdates&&this._context.requestRender()}_updateInstances(e,t){const s=this._enableLevelSelection,a=this._levelSelector;a.updateCamera(e),this._defaultRenderInstanceData.forEach((e=>{e.beginUpdate()})),this._highlightRenderInstanceData.forEach((e=>{e.beginUpdate()}));const n=this._instanceData,i=this._instanceData.view,r=n.size,l=n.capacity;let o=this._instanceIndex;t=Math.min(r,t);for(let c=0;c<t;++c){0===o&&this._startUpdateCycle();const e=i.state.get(o);let r=0;if(!(e&E.ALLOCATED)){o=(o+1)%l,t++;continue}const c=i.lodLevel.get(o);if(e&E.DEFAULT_ACTIVE&&this._defaultRenderInstanceData[c].freeTail(),e&E.HIGHLIGHT_ACTIVE&&this._highlightRenderInstanceData[c].freeTail(),e&E.REMOVE)n.freeInstance(o);else if(e&E.VISIBLE){let t=0;s&&(i.modelOrigin.getVec(o,w),t=a.selectLevel(w,n.getCombinedMedianScaleFactor(o))),r=e&~(E.ACTIVE|E.TRANSFORM_CHANGED),t>=0&&(e&E.HIGHLIGHT?(M(this._highlightRenderInstanceData[t],i,o),r|=E.HIGHLIGHT_ACTIVE):(M(this._defaultRenderInstanceData[t],i,o),r|=E.DEFAULT_ACTIVE)),i.state.set(o,r),i.lodLevel.set(o,t)}else r=e&~(E.ACTIVE|E.TRANSFORM_CHANGED),i.state.set(o,r);if(this._octree){const t=!!(e&E.ACTIVE),s=!!(r&E.ACTIVE);!t&&s?this._octree.addInstance(o):t&&!s?this._octree.removeInstance(o):t&&s&&e&E.TRANSFORM_CHANGED&&(this._octree.removeInstance(o),this._octree.addInstance(o))}o=(o+1)%l}this._instanceIndex=o,this._defaultRenderInstanceData.forEach((e=>{e.endUpdate()})),this._highlightRenderInstanceData.forEach((e=>{e.endUpdate()}))}_renderComponents(e,t,s,a){this.levels.forEach(((n,i)=>{n.components.forEach((n=>{this._renderComponent(e,t,s,a[i],n,i)}))}))}_renderComponent(t,s,a,n,i,r){if(0===n.size||!i.material.requiresSlot(s))return;const{rctx:l,pass:o}=t,c=i.glMaterials.load(l,o);if(e(c))return;const h=l.capabilities.instancing,u=c.beginSlot(a),m=u.program;u.bindPipelineState(l,s),l.useProgram(m),c.bind(a,u),l.bindVAO(i.vao),u.ensureAttributeLocations(i.vao),t.isHighlightPass&&_(m,a),u.bindDraw(a),d.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&t.pass===I.MATERIAL&&(m.setUniform4fv("externalColor",B[Math.min(r,B.length-1)]),m.setUniform1i("colorMixMode",L.replace));const f=n.capacity,g=n.headIndex,D=n.tailIndex,y=n.firstIndex,E=this._glInstanceBufferLayout,T=(e,t)=>{U(l,p,n.buffer,E,e),h.drawArraysInstanced(u.primitiveType,0,i.vertexCount,t-e),x(l,p,n.buffer,E)};i.material.parameters.transparent&&null!=y?g>D?(v(y>=D&&y<=g,"invalid firstIndex"),T(y,g),T(D,y)):g<D&&(y<=g?(v(y>=0&&y<=g,"invalid firstIndex"),T(y,g),T(D,f),T(0,y)):(v(y>=D&&y<=f,"invalid firstIndex"),T(y,f),T(0,g),T(D,y))):g>D?T(D,g):g<D&&(T(0,g),T(D,f)),l.bindVAO(null)}}function M(e,t,s){const a=e.allocateHead();V(t,s,e.view,a)}function V(e,t,s,a){S(e.modelOrigin,t,s.modelOriginHi,s.modelOriginLo,a),s.model.copyFrom(a,e.model,t),s.modelNormal.copyFrom(a,e.modelNormal,t),e.color&&s.color&&s.color.copyFrom(a,e.color,t),e.featureAttribute&&s.featureAttribute&&s.featureAttribute.copyFrom(a,e.featureAttribute,t)}const w=c(),j=h(),N=n(),G=c(),F=c(),B=[[1,0,1,1],[0,0,1,1],[0,1,0,1],[1,1,0,1],[1,0,0,1]];export{H as LodRenderer,O as setLevelSelectorFactory};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{BufferViewVec3f as t,BufferViewMat3f as i,BufferViewVec4f as e}from"../../../../../geometry/support/buffer/BufferView.js";import{
|
|
5
|
+
import{BufferViewVec3f as t,BufferViewMat3f as i,BufferViewVec4f as e}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as s}from"../Util.js";import{VertexAttribute as a}from"../VertexAttribute.js";import r from"./BackedBufferObject.js";class h{constructor(s){this.modelOriginHi=s.getField(a.MODELORIGINHI,t),this.modelOriginLo=s.getField(a.MODELORIGINLO,t),this.model=s.getField(a.MODEL,i),this.modelNormal=s.getField(a.MODELNORMAL,i),this.color=s.getField(a.INSTANCECOLOR,e),this.featureAttribute=s.getField(a.INSTANCEFEATUREATTRIBUTE,e)}}class n{constructor(t,i){this._headIndex=0,this._tailIndex=0,this._captureFirstIndex=!0,this._updating=!1,this._prevHeadIndex=0,this._resized=!1,this._rctx=t,this._instanceBufferLayout=i,this._elementSize=i.stride,this._capacity=1}destroy(){this._buffer&&this._buffer.destroy()}get buffer(){return this._buffer.buffer}get view(){return this._view}get capacity(){return this._capacity}get size(){const t=this._headIndex,i=this._tailIndex;return t>=i?t-i:t+this._capacity-i}get isEmpty(){return this._headIndex===this._tailIndex}get isFull(){return this._tailIndex===(this._headIndex+1)%this._capacity}get headIndex(){return this._headIndex}get tailIndex(){return this._tailIndex}get firstIndex(){return this._firstIndex}get memoryUsage(){return this._buffer?this._buffer.memoryUsage:{cpu:0,gpu:0}}reset(){this._headIndex=0,this._tailIndex=0,this._firstIndex=null}startUpdateCylce(){this._captureFirstIndex=!0}beginUpdate(){s(!this._updating,"already updating"),this._updating=!0,this._prevHeadIndex=this._headIndex}endUpdate(){s(this._updating,"not updating"),this.size<c*this.capacity&&this._shrink(),this._resized?(this._buffer.transferAll(),this._resized=!1):this._transferRange(this._prevHeadIndex,this._headIndex),this._updating=!1}allocateHead(){s(this._updating,"not updating"),this.isFull&&this._grow();const t=this.headIndex;return this._captureFirstIndex&&(this._firstIndex=t,this._captureFirstIndex=!1),this._incrementHead(),s(this._headIndex!==this._tailIndex,"invalid pointers"),t}freeTail(){s(this._updating,"not updating"),s(this.size>0,"invalid size");const t=this._tailIndex===this._firstIndex;this._incrementTail(),t&&(this._firstIndex=this._tailIndex)}_grow(){const t=Math.max(_,Math.floor(this._capacity*d));this._resize(t)}_shrink(){const t=Math.max(_,Math.floor(this._capacity*f));this._resize(t)}_resize(t){if(s(this._updating,"not updating"),t===this._capacity)return;const i=new r(this._rctx,this._elementSize,t);if(this._buffer){this._firstIndex&&(this._firstIndex=(this._firstIndex+this._capacity-this._tailIndex)%this._capacity);const t=this.size,e=this._compactInstances(i);s(e===t,"invalid compaction"),this._buffer.destroy(),this._tailIndex=0,this._headIndex=e,this._prevHeadIndex=0}this._resized=!0,this._capacity=t,this._buffer=i,this._view=new h(this._instanceBufferLayout.createView(this._buffer.array))}_compactInstances(t){const i=this._headIndex,e=this._tailIndex;return e<i?(this._buffer.copyRange(e,i,t),i-e):e>i?(this._buffer.copyRange(e,this._capacity,t),i>0&&this._buffer.copyRange(0,i,t,this._capacity-e),i+(this._capacity-e)):0}_incrementHead(t=1){this._headIndex=(this._headIndex+t)%this._capacity}_incrementTail(t=1){this._tailIndex=(this._tailIndex+t)%this._capacity}_transferRange(t,i){t<i?this._buffer.transferRange(t,i):t>i&&(i>0&&this._buffer.transferRange(0,i),this._buffer.transferRange(t,this._capacity))}}const _=1024,d=2,c=.3,f=.5;export{n as RenderInstanceData,h as RenderInstanceDataView};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{acosClamped as t,reciprocalClamped as e}from"../../../../core/mathUtils.js";import{s as i}from"../../../../chunks/mat2.js";import{c as s}from"../../../../chunks/mat2f64.js";import{j as r,d as o}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{s as n,k as a,p as l,f as u,g as p,m as c,i as f,l as x}from"../../../../chunks/vec2.js";import{a as d,b as v,f as m}from"../../../../chunks/vec2f64.js";import{d as g,g as V,b,n as A,a as C,f as D,c as I,o as R,s as N,l as P,m as S}from"../../../../chunks/vec3.js";import{c as U}from"../../../../chunks/vec3f64.js";import{create as _,fromPositionAndNormal as y,intersectRay as T}from"../../../../geometry/support/plane.js";import{wrap as L}from"../../../../geometry/support/ray.js";import{VertexAttribute as F}from"./basicInterfaces.js";import O from"./GeometryUtil.js";import{intersectTriangles as M}from"../materials/internal/MaterialUtil.js";function k(){return{up:U(),right:U()}}function E(t,e,i){S(t.up,e.up,i),S(t.right,e.right,i)}function B(t,e,i){t[0]=i[0]*e.right[0]+i[1]*e.up[0],t[1]=i[0]*e.right[1]+i[1]*e.up[1],t[2]=i[0]*e.right[2]+i[1]*e.up[2]}function w(t,e,i){n(t,g(i,e.right),g(i,e.up))}class G{constructor(){this.pos=U(),this.posES=U(),this.posGS=U(),this.vRight=U(),this.vLeft=U(),this.frame=k(),this.rotationFrame=k(),this.rotationRight=d(),this.rotationAngle=0,this.miterStretch=s()}setFrameFromUpVector(t){V(this.frame.up,t),b(at,this.vLeft,this.vRight),A(at,at),C(nt,this.frame.up,g(at,this.frame.up)),D(pt,at,nt),A(pt,pt),I(this.frame.right,pt,this.frame.up)}computeRotationAxisAndAngleFromUpVector(){V(this.rotationFrame.up,this.frame.up),V(this.rotationFrame.right,this.frame.right),n(this.rotationRight,1,0),C(nt,this.frame.up,g(this.frame.up,this.vLeft)),D(nt,this.vLeft,nt),R(nt,nt),A(nt,nt),C(at,this.frame.up,g(this.frame.up,this.vRight)),D(at,this.vRight,at),A(at,at),I(lt,this.rotationFrame.up,this.vLeft);const s=Math.sign(g(lt,this.vRight));if(this.rotationAngle=s*(Math.PI-t(g(nt,at))),Math.abs(this.rotationAngle)>0){const t=e(Math.cos(.5*this.rotationAngle));i(this.miterStretch,t-1+1,0,0,1)}const r=Math.PI-this.rotationAngle;this.maxStretchDistance=Math.abs(Math.min(this.vLeftLength,this.vRightLength)/Math.cos(.5*r))}}class j{constructor(){this.vertices=[],this.vertexIndices=[],this.vertexNormals=[],this.poles=[],this.poleIndices=[],this.uvs=null,this.uvIndices=null}addVertex(t,e){return this.vertices.push(v(t)),this.vertexNormals.push(v(e)),this.vertices.length-1}addUV(t){return this.uvs||(this.uvs=[],this.uvIndices=[]),this.uvs.push(t),this.uvs.length-1}addPole(t,e=null){return this.poles.push({position:v(t),normal:e?v(e):null}),this.poles.length-1}addSegment(t,e=null,i=null){this.vertexIndices.push(t.v0),this.vertexIndices.push(t.v1),e&&(this.uvIndices.push(e.v0),this.uvIndices.push(e.v1)),i&&(this.poleIndices.push(i.v0),this.poleIndices.push(i.v1))}get numSegments(){return this.vertexIndices.length/2}hasUV(){return null!=this.uvs}translate(t,e){for(const i of this.vertices)i[0]+=t,i[1]+=e;for(const i of this.poles)i.position[0]+=t,i.position[1]+=e}static circle(t=20){const e=.5,i=new j,s={v0:0,v1:0};i.addPole(m(0,0));for(let h=0;h<t;++h){const s=2*h*Math.PI/t,r=Math.cos(s),o=Math.sin(s),n=m(r*e,o*e),a=m(r,o);i.addVertex(n,a),i.addUV(h/t)}i.addUV(1);for(let h=0;h<t-1;++h){const t={v0:h,v1:h+1},e=t;i.addSegment(t,e,s)}const r={v0:t-1,v1:0},o={v0:t-1,v1:t};return i.addSegment(r,o,s),i}static rect(){const t=1,e=1,i=new j,s=m(.5*-t,.5*-e),r=m(.5*t,.5*-e),o=m(.5*t,.5*e),h=m(.5*-t,.5*e),n=m(0,-1),a=m(1,0),l=m(0,1),u=m(-1,0);i.addUV(0),i.addUV(1),i.addPole(m(0,.5*e),l),i.addPole(m(0,.5*e)),i.addPole(m(0,.5*-e)),i.addPole(m(0,.5*-e),n);const p={v0:0,v1:1};return i.addVertex(s,n),i.addVertex(r,n),i.addSegment({v0:0,v1:1},p,{v0:3,v1:3}),i.addVertex(r,a),i.addVertex(o,a),i.addSegment({v0:2,v1:3},p,{v0:2,v1:1}),i.addVertex(o,l),i.addVertex(h,l),i.addSegment({v0:4,v1:5},p,{v0:0,v1:0}),i.addVertex(h,u),i.addVertex(s,u),i.addSegment({v0:6,v1:7},p,{v0:1,v1:2}),i}}class z{constructor(t){this.vertices=[],this.offset=U(),this.xform=h(),this.vertices=t;const e=Math.floor((t.length-1)/2);V(this.offset,this.vertices[e].pos);for(const i of this.vertices)D(i.pos,i.pos,this.offset);r(this.xform,this.xform,this.offset),this.updatePathVertexInformation()}updatePathVertexInformation(){const t=this.vertices.length;let e=this.vertices[0];e.index=0,N(e.vLeft,0,0,0),e.vLeftLength=0,D(e.vRight,this.vertices[1].pos,e.pos),e.vRightLength=P(e.vRight),A(e.vRight,e.vRight);let i=e;for(let s=1;s<t;++s)e=this.vertices[s],e.index=s,V(e.vLeft,i.vRight),e.vLeftLength=i.vRightLength,s<t-1?(D(e.vRight,this.vertices[s+1].pos,e.pos),e.vRightLength=P(e.vRight),A(e.vRight,e.vRight)):(V(e.vRight,e.vLeft),e.vRightLength=e.vLeftLength),i=e}}function J(t,e){let i=null;const s=t.vertices.length,r=.99619469809,o=U(),h=U(),n=U(),a=U(),l=U(),u=U(),p=_();let c=t.vertices[0];V(h,e),N(o,0,1,0),O.makeOrthoBasisDirUpFallback(c.vRight,h,o,o,n,h,r),V(c.frame.up,h),V(c.frame.right,n),i=c;for(let f=1;f<s;++f){c=t.vertices[f],b(l,c.vLeft,c.vRight);let e=P(l);e>0?(e=1/Math.sqrt(e),l[0]=l[0]*e,l[1]=l[1]*e,l[2]=l[2]*e):(l[0]=c.vRight[0],l[1]=c.vRight[1],l[2]=c.vRight[2]),b(u,i.pos,i.frame.up),y(c.pos,l,p);T(p,L(u,c.vLeft),a)?(D(a,a,c.pos),A(h,a),I(n,l,h),A(n,n)):O.makeOrthoBasisDirUpFallback(l,i.frame.up,i.frame.right,o,n,h,r),V(c.frame.up,h),V(c.frame.right,n),i=c}}class H{}class X{numProfilesPerJoin(){return 1}extrude(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],!1)}}class q{constructor(t=.8*Math.PI,e=1){this.cutoffAngle=t,this.numBendSubdivisions=e}numProfilesPerJoin(){return this.numBendSubdivisions+1}extrude(t,e,i){const s=ct;if(Math.abs(t.rotationAngle)>=this.cutoffAngle)for(let r=0;r<this.numBendSubdivisions+1;++r){o(ft,.5*-t.rotationAngle+r*t.rotationAngle/this.numBendSubdivisions,t.rotationFrame.up),E(s,t.frame,ft);for(let r=0;r<e.vertices.length;++r){a(e.vertices[r],t.rotationRight)*t.rotationAngle>=0?i(t.index,s,e.vertices[r],e.vertexNormals[r],!1):(l(rt,e.vertices[r],t.miterStretch),i(t.index,t.frame,rt,e.vertexNormals[r],!0))}}else for(let r=0;r<this.numBendSubdivisions+1;++r)for(let s=0;s<e.vertices.length;++s){const r=a(e.vertices[s],t.rotationRight)*t.rotationAngle>=0;l(rt,e.vertices[s],t.miterStretch),i(t.index,t.frame,rt,e.vertexNormals[s],!r)}}}const K={generateUV:!1};class Q{rebuildConnectingProfileGeometry(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],0,0)}}class W extends Q{constructor(){super()}getNumVertices(){return 0}getNumIndices(){return 0}rebuildCapGeometry(){}buildTopology(){}}class Y extends Q{constructor(t,e=0,i=!1){super(),this.profile=t,this.profilePlaneOffset=e,this.flip=i}getNumVertices(){return this.profile.vertices.length}getNumIndices(){return 3*this.profile.numSegments}rebuildConnectingProfileGeometry(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],this.profilePlaneOffset,0)}rebuildCapGeometry(t,e){const i=ot;n(i,0,0);const s=this.flip?1:-1;for(let r=0;r<this.profile.vertices.length;++r)e(t.index,t.frame,this.profile.vertices[r],i,this.profilePlaneOffset,s)}buildTopology(t,e){const i=this.vertexBufferStart+this.profile.vertexIndices[0];for(let s=1;s<this.profile.numSegments;++s){const t=this.profile.vertexIndices[2*s+0],r=this.profile.vertexIndices[2*s+1],o=this.vertexBufferStart+t,h=this.vertexBufferStart+r;this.flip?e(h,o,i):e(i,o,h)}}}class Z extends Q{constructor(t){super(),this.flip=!1,this.sign=0,this.breakNormals=!1,this.numSegments=3,this.profile=t.profile,this.flip=t.flip,this.sign=this.flip?1:-1,this.breakNormals=t.breakNormals,this.numSegments=t.subdivisions}getNumVertices(){let t=0;return t=this.profile.vertices.length*(this.numSegments-1),this.breakNormals&&(t+=this.profile.vertices.length),t+=this.profile.poles.length,t}getNumIndices(){let t=0;t+=2*this.profile.numSegments*(this.numSegments-1);for(let e=0;e<this.profile.numSegments;++e){const i=this.profile.vertexIndices[2*e+0],s=this.profile.vertexIndices[2*e+1];this.profile.poleIndices[i]===this.profile.poleIndices[s]?t+=1:t+=2}return 3*t}rebuildCapGeometry(t,e){const i=t.frame,s=.5*this.sign,r=rt,o=ot;n(o,0,0);for(let h=0;h<this.profile.poles.length;++h){const r=this.profile.poles[h];r.normal?e(t.index,i,r.position,r.normal,s,0):e(t.index,i,r.position,o,s,this.sign)}if(this.breakNormals)for(let h=0;h<this.profile.vertices.length;++h)e(t.index,i,this.profile.vertices[h],this.profile.vertexNormals[h],0,0);for(let h=0;h<this.numSegments-1;++h){const n=(1-(h+1)/this.numSegments)*Math.PI*.5,a=Math.sin(n),l=Math.cos(n);for(let h=0;h<this.profile.vertices.length;++h){const n=this.profile.poles[this.profile.poleIndices[h]];u(r,this.profile.vertices[h],n.position),p(r,r,a),n.normal?(c(r,r,n.position),e(t.index,i,r,n.normal,s*l,0)):(f(o,r),p(o,o,a),c(r,r,n.position),e(t.index,i,r,o,s*l,this.sign*l))}}}buildTopology(t,e){const i=this.breakNormals?this.vertexBufferStart+this.profile.poles.length:this.firstProfileVertexIndex,s=this.breakNormals?this.vertexBufferStart+this.profile.poles.length+this.profile.vertices.length:this.vertexBufferStart+this.profile.poles.length;for(let r=0;r<this.profile.numSegments;++r){const t=this.profile.vertexIndices[2*r+0],o=this.profile.vertexIndices[2*r+1],h=this.vertexBufferStart+this.profile.poleIndices[t],n=this.vertexBufferStart+this.profile.poleIndices[o];let a=i+t,l=i+o;for(let i=0;i<this.numSegments-1;++i){const r=s+i*this.profile.vertices.length+t,h=s+i*this.profile.vertices.length+o;this.flip?(e(r,l,a),e(l,r,h)):(e(a,l,r),e(h,r,l)),a=r,l=h}this.flip?(e(h,l,a),h!==n&&e(h,n,l)):(e(a,l,h),h!==n&&e(l,n,h))}}}class ${constructor(t,e,i,s,r,o=K){this.options=o,this._extrusionVertexCount=0,this._triangleCount=0,this.numExtrusionProfiles=0,this.numVerticesTotal=0,this.numNormalsTotal=0,this.numUVTotal=0,this.profile=e,this.path=t,this.extruder=i,this.startCap=s,this.endCap=r;const h=this.path.vertices.length-2;this.numExtrusionProfiles=i.numProfilesPerJoin()*h+2,this.numVerticesTotal=e.vertices.length*this.numExtrusionProfiles,this.numNormalsTotal=this.numVerticesTotal,this.startCap.vertexBufferStart=this.numVerticesTotal;const n=this.startCap.getNumVertices();this.numVerticesTotal+=n,this.numNormalsTotal+=n,this.endCap.vertexBufferStart=this.numVerticesTotal;const a=this.endCap.getNumVertices();this.numVerticesTotal+=a,this.numNormalsTotal+=a,this.pathVertexData=new Float32Array(1*this.numVerticesTotal),this.profileRightAxisData=new Float32Array(4*this.numVerticesTotal),this.profileUpAxisData=new Float32Array(4*this.numVerticesTotal),this.profileVertexAndNormalData=new Float32Array(4*this.numVerticesTotal),this.profile.hasUV()&&this.options.generateUV&&(this.numUVTotal=this.profile.uvs.length,this.uvData=new Float32Array(2*this.numUVTotal)),this.originData=new Float32Array(3*this.path.vertices.length),this._rebuildGeometry(),this.buildTopology()}emitVertex(t,e,i,s,r){if(this.profileRightAxisData[4*this._extrusionVertexCount+0]=e.right[0],this.profileRightAxisData[4*this._extrusionVertexCount+1]=e.right[1],this.profileRightAxisData[4*this._extrusionVertexCount+2]=e.right[2],this.profileUpAxisData[4*this._extrusionVertexCount+0]=e.up[0],this.profileUpAxisData[4*this._extrusionVertexCount+1]=e.up[1],this.profileUpAxisData[4*this._extrusionVertexCount+2]=e.up[2],this.profileVertexAndNormalData[4*this._extrusionVertexCount+0]=i[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+1]=i[1],this.profileVertexAndNormalData[4*this._extrusionVertexCount+2]=s[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,r){const e=this.path.vertices[t];this.profileRightAxisData[4*this._extrusionVertexCount+3]=e.rotationRight[0]*e.maxStretchDistance,this.profileUpAxisData[4*this._extrusionVertexCount+3]=e.rotationRight[1]*e.maxStretchDistance}else this.profileRightAxisData[4*this._extrusionVertexCount+3]=0,this.profileUpAxisData[4*this._extrusionVertexCount+3]=0;++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){this.profileRightAxisData[4*this._extrusionVertexCount+0]=e.right[0],this.profileRightAxisData[4*this._extrusionVertexCount+1]=e.right[1],this.profileRightAxisData[4*this._extrusionVertexCount+2]=e.right[2],this.profileUpAxisData[4*this._extrusionVertexCount+0]=e.up[0],this.profileUpAxisData[4*this._extrusionVertexCount+1]=e.up[1],this.profileUpAxisData[4*this._extrusionVertexCount+2]=e.up[2],this.profileVertexAndNormalData[4*this._extrusionVertexCount+0]=i[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+1]=i[1],this.profileVertexAndNormalData[4*this._extrusionVertexCount+2]=s[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,this.profileRightAxisData[4*this._extrusionVertexCount+3]=r,this.profileUpAxisData[4*this._extrusionVertexCount+3]=o,++this._extrusionVertexCount}emitTriangle(t,e,i){this.vertexIndices[3*this._triangleCount+0]=t,this.vertexIndices[3*this._triangleCount+1]=e,this.vertexIndices[3*this._triangleCount+2]=i,this.pathVertexIndices[3*this._triangleCount+0]=this.pathVertexData[t],this.pathVertexIndices[3*this._triangleCount+1]=this.pathVertexData[e],this.pathVertexIndices[3*this._triangleCount+2]=this.pathVertexData[i],this.normalIndices[3*this._triangleCount+0]=t,this.normalIndices[3*this._triangleCount+1]=e,this.normalIndices[3*this._triangleCount+2]=i,++this._triangleCount}_rebuildGeometry(){const t=(t,e,i,s,r)=>this.emitVertex(t,e,i,s,r),e=(t,e,i,s,r,o)=>this.emitCapVertex(t,e,i,s,r,o);this._extrusionVertexCount=0;for(const i of this.path.vertices)this.originData[3*i.index+0]=i.pos[0],this.originData[3*i.index+1]=i.pos[1],this.originData[3*i.index+2]=i.pos[2];this.startCap.rebuildConnectingProfileGeometry(this.path.vertices[0],this.profile,e);for(let i=1;i<this.path.vertices.length-1;++i)this.extruder.extrude(this.path.vertices[i],this.profile,t);if(this.endCap.rebuildConnectingProfileGeometry(this.path.vertices[this.path.vertices.length-1],this.profile,e),this.startCap.rebuildCapGeometry(this.path.vertices[0],e),this.endCap.rebuildCapGeometry(this.path.vertices[this.path.vertices.length-1],e),this.profile.hasUV()&&this.options.generateUV)for(let i=0;i<this.profile.uvs.length;++i)this.uvData[2*i+0]=this.profile.uvs[i],this.uvData[2*i+1]=0}buildTopology(){const t=(t,e,i)=>this.emitTriangle(t,e,i);this._triangleCount=0;const e=this.profile.vertices.length,i=this.profile.numSegments,s=this.numExtrusionProfiles-1;let r=3*(2*(i*s));this.startCap.indexBufferStart=r,this.startCap.firstProfileVertexIndex=0,r+=this.startCap.getNumIndices(),this.endCap.indexBufferStart=r,this.endCap.firstProfileVertexIndex=e*(this.numExtrusionProfiles-1),r+=this.endCap.getNumIndices(),this.vertexIndices=new Uint32Array(r),this.normalIndices=new Uint32Array(r),this.pathVertexIndices=new Uint32Array(r),this.profile.hasUV()&&this.options.generateUV&&(this.uvIndices=new Uint32Array(r));for(let o=0;o<i;++o){const i=this.profile.vertexIndices[2*o],r=this.profile.vertexIndices[2*o+1];for(let o=0;o<s;++o){const s=o*e+i,h=(o+1)*e+r,n=o*e+r;t(s,(o+1)*e+i,h),t(s,h,n)}}this.startCap.buildTopology(this.path.vertices[0],t),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],t)}onPathChanged(){this._rebuildGeometry()}}class tt{constructor(t){this.builder=t}get xform(){return this.builder.path.xform}onPathChanged(){this.builder.onPathChanged()}}class et extends tt{constructor(t){super(t),this.vertexAttributePosition=null,this.vertexAttributeNormal=null,this.vertexAttributeColor=null,this.vertexAttributePosition=new Float32Array(3*this.builder.numVerticesTotal),this.vertexAttributeNormal=new Float32Array(3*this.builder.numNormalsTotal),this.vertexAttributeColor=new Uint8Array(4),this.vertexAttributeColor[0]=255,this.vertexAttributeColor[1]=255,this.vertexAttributeColor[2]=255,this.vertexAttributeColor[3]=255}bakeVertexColors(t){this.vertexAttributeColor[0]=255*t[0],this.vertexAttributeColor[1]=255*t[1],this.vertexAttributeColor[2]=255*t[2],this.vertexAttributeColor[3]=255*(t.length>3?t[3]:1)}bake(t){this.size=t;for(let e=0;e<this.builder.numVerticesTotal;++e){let i=this.builder.pathVertexData[e];const s=0===i||i===this.builder.path.vertices.length-1;i*=3;const r=st;N(r,this.builder.originData[i++],this.builder.originData[i++],this.builder.originData[i]);const o=4*e,h=nt,l=rt,u=at,d=lt,v=ut;let m=0,g=0;if(N(d,this.builder.profileRightAxisData[o],this.builder.profileRightAxisData[o+1],this.builder.profileRightAxisData[o+2]),N(v,this.builder.profileUpAxisData[o],this.builder.profileUpAxisData[o+1],this.builder.profileUpAxisData[o+2]),n(l,this.builder.profileVertexAndNormalData[o]*t[0],this.builder.profileVertexAndNormalData[o+1]*t[1]),s)I(u,v,d),m=this.builder.profileRightAxisData[o+3]*t[0],g=this.builder.profileUpAxisData[o+3];else{const t=ot,e=ht;n(t,this.builder.profileRightAxisData[o+3],this.builder.profileUpAxisData[o+3]);const i=x(t);f(t,t);const s=a(l,t);if(Math.abs(s)>i){n(e,-t[1],t[0]);const r=a(l,e);p(t,t,i*Math.sign(s)),p(e,e,r),c(l,t,e)}N(u,0,0,0)}N(h,d[0]*l[0]+v[0]*l[1],d[1]*l[0]+v[1]*l[1],d[2]*l[0]+v[2]*l[1]),this.vertexAttributePosition[3*e+0]=r[0]+h[0]+u[0]*m,this.vertexAttributePosition[3*e+1]=r[1]+h[1]+u[1]*m,this.vertexAttributePosition[3*e+2]=r[2]+h[2]+u[2]*m;const V=rt;n(V,this.builder.profileVertexAndNormalData[o+2],this.builder.profileVertexAndNormalData[o+3]),this.vertexAttributeNormal[3*e+0]=d[0]*V[0]+v[0]*V[1]+u[0]*g,this.vertexAttributeNormal[3*e+1]=d[1]*V[0]+v[1]*V[1]+u[1]*g,this.vertexAttributeNormal[3*e+2]=d[2]*V[0]+v[2]*V[1]+u[2]*g}}createGeometryData(){const t=[[F.POSITION,this.builder.vertexIndices],[F.NORMAL,this.builder.normalIndices]],e=[[F.POSITION,{size:3,data:this.vertexAttributePosition,exclusive:!0}],[F.NORMAL,{size:3,data:this.vertexAttributeNormal,exclusive:!0}]];if(this.vertexAttributeColor){const i=this.builder.vertexIndices.length;t.push([F.COLOR,new Uint32Array(i)]),e.push([F.COLOR,{size:4,data:this.vertexAttributeColor}])}return{vertexAttributes:e,indices:t}}onPathChanged(){super.onPathChanged(),this.bake(this.size)}intersect(t,e,i){const s=this.builder.vertexIndices,r={size:3,data:this.vertexAttributePosition},o=s.length/3;M(t,e,0,o,s,r,void 0,void 0,i)}}class it extends tt{constructor(t,e,i,s){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=i,this.opacityAttributeValue=s,this.vvData=null,this.baked=new et(t),this.vvData=new Float32Array(4*this.builder.path.vertices.length);for(let r=0;r<this.builder.path.vertices.length;++r){this.vvData[4*r+0]=e,this.vvData[4*r+1]=i,this.vvData[4*r+2]=s;const t=0===r||r===this.builder.path.vertices.length-1;this.vvData[4*r+3]=t?1:0}}createGeometryData(){return{vertexAttributes:[[F.POSITION,{size:3,data:this.builder.originData,exclusive:!0}],[F.PROFILERIGHT,{size:4,data:this.builder.profileRightAxisData,exclusive:!0}],[F.PROFILEUP,{size:4,data:this.builder.profileUpAxisData,exclusive:!0}],[F.PROFILEVERTEXANDNORMAL,{size:4,data:this.builder.profileVertexAndNormalData,exclusive:!0}],[F.FEATUREVALUE,{size:4,data:this.vvData,exclusive:!0}]],indices:[[F.POSITION,this.builder.pathVertexIndices],[F.PROFILERIGHT,this.builder.vertexIndices],[F.PROFILEUP,this.builder.vertexIndices],[F.PROFILEVERTEXANDNORMAL,this.builder.vertexIndices],[F.FEATUREVALUE,this.builder.pathVertexIndices]]}}}const st=U(),rt=d(),ot=d(),ht=d(),nt=U(),at=U(),lt=U(),ut=U(),pt=U(),ct=k(),ft=h();export{$ as Builder,Q as CapBuilder,H as Extruder,it as FastUpdatePathGeometry,q as MiterExtruder,W as NoCapBuilder,z as Path,tt as PathGeometryData,G as PathVertex,j as Profile,Z as RoundCapBuilder,X as SimpleExtruder,et as StaticPathGeometry,Y as TriangulationCapBuilder,J as computeMinimumRotationTangentFrame,k as makeFrame,B as profileSpaceToVertexSpace,w as vertexSpaceToProfileSpace};
|
|
5
|
+
import{acosClamped as t,reciprocalClamped as e}from"../../../../core/mathUtils.js";import{s as i}from"../../../../chunks/mat2.js";import{c as s}from"../../../../chunks/mat2f64.js";import{j as r,d as o}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{s as n,k as a,p as l,f as u,g as p,m as f,i as c,l as x}from"../../../../chunks/vec2.js";import{a as d,b as v,f as m}from"../../../../chunks/vec2f64.js";import{d as g,g as V,b as A,n as b,a as C,f as D,c as I,o as R,s as N,l as P,m as S}from"../../../../chunks/vec3.js";import{c as U}from"../../../../chunks/vec3f64.js";import{create as _,fromPositionAndNormal as y,intersectRay as T}from"../../../../geometry/support/plane.js";import{wrap as L}from"../../../../geometry/support/ray.js";import F from"./GeometryUtil.js";import{VertexAttribute as O}from"./VertexAttribute.js";import{intersectTriangles as M}from"../materials/internal/MaterialUtil.js";function k(){return{up:U(),right:U()}}function E(t,e,i){S(t.up,e.up,i),S(t.right,e.right,i)}function B(t,e,i){t[0]=i[0]*e.right[0]+i[1]*e.up[0],t[1]=i[0]*e.right[1]+i[1]*e.up[1],t[2]=i[0]*e.right[2]+i[1]*e.up[2]}function w(t,e,i){n(t,g(i,e.right),g(i,e.up))}class G{constructor(){this.pos=U(),this.posES=U(),this.posGS=U(),this.vRight=U(),this.vLeft=U(),this.frame=k(),this.rotationFrame=k(),this.rotationRight=d(),this.rotationAngle=0,this.miterStretch=s()}setFrameFromUpVector(t){V(this.frame.up,t),A(at,this.vLeft,this.vRight),b(at,at),C(nt,this.frame.up,g(at,this.frame.up)),D(pt,at,nt),b(pt,pt),I(this.frame.right,pt,this.frame.up)}computeRotationAxisAndAngleFromUpVector(){V(this.rotationFrame.up,this.frame.up),V(this.rotationFrame.right,this.frame.right),n(this.rotationRight,1,0),C(nt,this.frame.up,g(this.frame.up,this.vLeft)),D(nt,this.vLeft,nt),R(nt,nt),b(nt,nt),C(at,this.frame.up,g(this.frame.up,this.vRight)),D(at,this.vRight,at),b(at,at),I(lt,this.rotationFrame.up,this.vLeft);const s=Math.sign(g(lt,this.vRight));if(this.rotationAngle=s*(Math.PI-t(g(nt,at))),Math.abs(this.rotationAngle)>0){const t=e(Math.cos(.5*this.rotationAngle));i(this.miterStretch,t-1+1,0,0,1)}const r=Math.PI-this.rotationAngle;this.maxStretchDistance=Math.abs(Math.min(this.vLeftLength,this.vRightLength)/Math.cos(.5*r))}}class j{constructor(){this.vertices=[],this.vertexIndices=[],this.vertexNormals=[],this.poles=[],this.poleIndices=[],this.uvs=null,this.uvIndices=null}addVertex(t,e){return this.vertices.push(v(t)),this.vertexNormals.push(v(e)),this.vertices.length-1}addUV(t){return this.uvs||(this.uvs=[],this.uvIndices=[]),this.uvs.push(t),this.uvs.length-1}addPole(t,e=null){return this.poles.push({position:v(t),normal:e?v(e):null}),this.poles.length-1}addSegment(t,e=null,i=null){this.vertexIndices.push(t.v0),this.vertexIndices.push(t.v1),e&&(this.uvIndices.push(e.v0),this.uvIndices.push(e.v1)),i&&(this.poleIndices.push(i.v0),this.poleIndices.push(i.v1))}get numSegments(){return this.vertexIndices.length/2}hasUV(){return null!=this.uvs}translate(t,e){for(const i of this.vertices)i[0]+=t,i[1]+=e;for(const i of this.poles)i.position[0]+=t,i.position[1]+=e}static circle(t=20){const e=.5,i=new j,s={v0:0,v1:0};i.addPole(m(0,0));for(let h=0;h<t;++h){const s=2*h*Math.PI/t,r=Math.cos(s),o=Math.sin(s),n=m(r*e,o*e),a=m(r,o);i.addVertex(n,a),i.addUV(h/t)}i.addUV(1);for(let h=0;h<t-1;++h){const t={v0:h,v1:h+1},e=t;i.addSegment(t,e,s)}const r={v0:t-1,v1:0},o={v0:t-1,v1:t};return i.addSegment(r,o,s),i}static rect(){const t=1,e=1,i=new j,s=m(.5*-t,.5*-e),r=m(.5*t,.5*-e),o=m(.5*t,.5*e),h=m(.5*-t,.5*e),n=m(0,-1),a=m(1,0),l=m(0,1),u=m(-1,0);i.addUV(0),i.addUV(1),i.addPole(m(0,.5*e),l),i.addPole(m(0,.5*e)),i.addPole(m(0,.5*-e)),i.addPole(m(0,.5*-e),n);const p={v0:0,v1:1};return i.addVertex(s,n),i.addVertex(r,n),i.addSegment({v0:0,v1:1},p,{v0:3,v1:3}),i.addVertex(r,a),i.addVertex(o,a),i.addSegment({v0:2,v1:3},p,{v0:2,v1:1}),i.addVertex(o,l),i.addVertex(h,l),i.addSegment({v0:4,v1:5},p,{v0:0,v1:0}),i.addVertex(h,u),i.addVertex(s,u),i.addSegment({v0:6,v1:7},p,{v0:1,v1:2}),i}}class z{constructor(t){this.vertices=[],this.offset=U(),this.xform=h(),this.vertices=t;const e=Math.floor((t.length-1)/2);V(this.offset,this.vertices[e].pos);for(const i of this.vertices)D(i.pos,i.pos,this.offset);r(this.xform,this.xform,this.offset),this.updatePathVertexInformation()}updatePathVertexInformation(){const t=this.vertices.length;let e=this.vertices[0];e.index=0,N(e.vLeft,0,0,0),e.vLeftLength=0,D(e.vRight,this.vertices[1].pos,e.pos),e.vRightLength=P(e.vRight),b(e.vRight,e.vRight);let i=e;for(let s=1;s<t;++s)e=this.vertices[s],e.index=s,V(e.vLeft,i.vRight),e.vLeftLength=i.vRightLength,s<t-1?(D(e.vRight,this.vertices[s+1].pos,e.pos),e.vRightLength=P(e.vRight),b(e.vRight,e.vRight)):(V(e.vRight,e.vLeft),e.vRightLength=e.vLeftLength),i=e}}function J(t,e){let i=null;const s=t.vertices.length,r=.99619469809,o=U(),h=U(),n=U(),a=U(),l=U(),u=U(),p=_();let f=t.vertices[0];V(h,e),N(o,0,1,0),F.makeOrthoBasisDirUpFallback(f.vRight,h,o,o,n,h,r),V(f.frame.up,h),V(f.frame.right,n),i=f;for(let c=1;c<s;++c){f=t.vertices[c],A(l,f.vLeft,f.vRight);let e=P(l);e>0?(e=1/Math.sqrt(e),l[0]=l[0]*e,l[1]=l[1]*e,l[2]=l[2]*e):(l[0]=f.vRight[0],l[1]=f.vRight[1],l[2]=f.vRight[2]),A(u,i.pos,i.frame.up),y(f.pos,l,p);T(p,L(u,f.vLeft),a)?(D(a,a,f.pos),b(h,a),I(n,l,h),b(n,n)):F.makeOrthoBasisDirUpFallback(l,i.frame.up,i.frame.right,o,n,h,r),V(f.frame.up,h),V(f.frame.right,n),i=f}}class H{}class X{numProfilesPerJoin(){return 1}extrude(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],!1)}}class q{constructor(t=.8*Math.PI,e=1){this.cutoffAngle=t,this.numBendSubdivisions=e}numProfilesPerJoin(){return this.numBendSubdivisions+1}extrude(t,e,i){const s=ft;if(Math.abs(t.rotationAngle)>=this.cutoffAngle)for(let r=0;r<this.numBendSubdivisions+1;++r){o(ct,.5*-t.rotationAngle+r*t.rotationAngle/this.numBendSubdivisions,t.rotationFrame.up),E(s,t.frame,ct);for(let r=0;r<e.vertices.length;++r){a(e.vertices[r],t.rotationRight)*t.rotationAngle>=0?i(t.index,s,e.vertices[r],e.vertexNormals[r],!1):(l(rt,e.vertices[r],t.miterStretch),i(t.index,t.frame,rt,e.vertexNormals[r],!0))}}else for(let r=0;r<this.numBendSubdivisions+1;++r)for(let s=0;s<e.vertices.length;++s){const r=a(e.vertices[s],t.rotationRight)*t.rotationAngle>=0;l(rt,e.vertices[s],t.miterStretch),i(t.index,t.frame,rt,e.vertexNormals[s],!r)}}}const K={generateUV:!1};class Q{rebuildConnectingProfileGeometry(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],0,0)}}class W extends Q{constructor(){super()}getNumVertices(){return 0}getNumIndices(){return 0}rebuildCapGeometry(){}buildTopology(){}}class Y extends Q{constructor(t,e=0,i=!1){super(),this.profile=t,this.profilePlaneOffset=e,this.flip=i}getNumVertices(){return this.profile.vertices.length}getNumIndices(){return 3*this.profile.numSegments}rebuildConnectingProfileGeometry(t,e,i){for(let s=0;s<e.vertices.length;++s)i(t.index,t.frame,e.vertices[s],e.vertexNormals[s],this.profilePlaneOffset,0)}rebuildCapGeometry(t,e){const i=ot;n(i,0,0);const s=this.flip?1:-1;for(let r=0;r<this.profile.vertices.length;++r)e(t.index,t.frame,this.profile.vertices[r],i,this.profilePlaneOffset,s)}buildTopology(t,e){const i=this.vertexBufferStart+this.profile.vertexIndices[0];for(let s=1;s<this.profile.numSegments;++s){const t=this.profile.vertexIndices[2*s+0],r=this.profile.vertexIndices[2*s+1],o=this.vertexBufferStart+t,h=this.vertexBufferStart+r;this.flip?e(h,o,i):e(i,o,h)}}}class Z extends Q{constructor(t){super(),this.flip=!1,this.sign=0,this.breakNormals=!1,this.numSegments=3,this.profile=t.profile,this.flip=t.flip,this.sign=this.flip?1:-1,this.breakNormals=t.breakNormals,this.numSegments=t.subdivisions}getNumVertices(){let t=0;return t=this.profile.vertices.length*(this.numSegments-1),this.breakNormals&&(t+=this.profile.vertices.length),t+=this.profile.poles.length,t}getNumIndices(){let t=0;t+=2*this.profile.numSegments*(this.numSegments-1);for(let e=0;e<this.profile.numSegments;++e){const i=this.profile.vertexIndices[2*e+0],s=this.profile.vertexIndices[2*e+1];this.profile.poleIndices[i]===this.profile.poleIndices[s]?t+=1:t+=2}return 3*t}rebuildCapGeometry(t,e){const i=t.frame,s=.5*this.sign,r=rt,o=ot;n(o,0,0);for(let h=0;h<this.profile.poles.length;++h){const r=this.profile.poles[h];r.normal?e(t.index,i,r.position,r.normal,s,0):e(t.index,i,r.position,o,s,this.sign)}if(this.breakNormals)for(let h=0;h<this.profile.vertices.length;++h)e(t.index,i,this.profile.vertices[h],this.profile.vertexNormals[h],0,0);for(let h=0;h<this.numSegments-1;++h){const n=(1-(h+1)/this.numSegments)*Math.PI*.5,a=Math.sin(n),l=Math.cos(n);for(let h=0;h<this.profile.vertices.length;++h){const n=this.profile.poles[this.profile.poleIndices[h]];u(r,this.profile.vertices[h],n.position),p(r,r,a),n.normal?(f(r,r,n.position),e(t.index,i,r,n.normal,s*l,0)):(c(o,r),p(o,o,a),f(r,r,n.position),e(t.index,i,r,o,s*l,this.sign*l))}}}buildTopology(t,e){const i=this.breakNormals?this.vertexBufferStart+this.profile.poles.length:this.firstProfileVertexIndex,s=this.breakNormals?this.vertexBufferStart+this.profile.poles.length+this.profile.vertices.length:this.vertexBufferStart+this.profile.poles.length;for(let r=0;r<this.profile.numSegments;++r){const t=this.profile.vertexIndices[2*r+0],o=this.profile.vertexIndices[2*r+1],h=this.vertexBufferStart+this.profile.poleIndices[t],n=this.vertexBufferStart+this.profile.poleIndices[o];let a=i+t,l=i+o;for(let i=0;i<this.numSegments-1;++i){const r=s+i*this.profile.vertices.length+t,h=s+i*this.profile.vertices.length+o;this.flip?(e(r,l,a),e(l,r,h)):(e(a,l,r),e(h,r,l)),a=r,l=h}this.flip?(e(h,l,a),h!==n&&e(h,n,l)):(e(a,l,h),h!==n&&e(l,n,h))}}}class ${constructor(t,e,i,s,r,o=K){this.options=o,this._extrusionVertexCount=0,this._triangleCount=0,this.numExtrusionProfiles=0,this.numVerticesTotal=0,this.numNormalsTotal=0,this.numUVTotal=0,this.profile=e,this.path=t,this.extruder=i,this.startCap=s,this.endCap=r;const h=this.path.vertices.length-2;this.numExtrusionProfiles=i.numProfilesPerJoin()*h+2,this.numVerticesTotal=e.vertices.length*this.numExtrusionProfiles,this.numNormalsTotal=this.numVerticesTotal,this.startCap.vertexBufferStart=this.numVerticesTotal;const n=this.startCap.getNumVertices();this.numVerticesTotal+=n,this.numNormalsTotal+=n,this.endCap.vertexBufferStart=this.numVerticesTotal;const a=this.endCap.getNumVertices();this.numVerticesTotal+=a,this.numNormalsTotal+=a,this.pathVertexData=new Float32Array(1*this.numVerticesTotal),this.profileRightAxisData=new Float32Array(4*this.numVerticesTotal),this.profileUpAxisData=new Float32Array(4*this.numVerticesTotal),this.profileVertexAndNormalData=new Float32Array(4*this.numVerticesTotal),this.profile.hasUV()&&this.options.generateUV&&(this.numUVTotal=this.profile.uvs.length,this.uvData=new Float32Array(2*this.numUVTotal)),this.originData=new Float32Array(3*this.path.vertices.length),this._rebuildGeometry(),this.buildTopology()}emitVertex(t,e,i,s,r){if(this.profileRightAxisData[4*this._extrusionVertexCount+0]=e.right[0],this.profileRightAxisData[4*this._extrusionVertexCount+1]=e.right[1],this.profileRightAxisData[4*this._extrusionVertexCount+2]=e.right[2],this.profileUpAxisData[4*this._extrusionVertexCount+0]=e.up[0],this.profileUpAxisData[4*this._extrusionVertexCount+1]=e.up[1],this.profileUpAxisData[4*this._extrusionVertexCount+2]=e.up[2],this.profileVertexAndNormalData[4*this._extrusionVertexCount+0]=i[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+1]=i[1],this.profileVertexAndNormalData[4*this._extrusionVertexCount+2]=s[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,r){const e=this.path.vertices[t];this.profileRightAxisData[4*this._extrusionVertexCount+3]=e.rotationRight[0]*e.maxStretchDistance,this.profileUpAxisData[4*this._extrusionVertexCount+3]=e.rotationRight[1]*e.maxStretchDistance}else this.profileRightAxisData[4*this._extrusionVertexCount+3]=0,this.profileUpAxisData[4*this._extrusionVertexCount+3]=0;++this._extrusionVertexCount}emitCapVertex(t,e,i,s,r,o){this.profileRightAxisData[4*this._extrusionVertexCount+0]=e.right[0],this.profileRightAxisData[4*this._extrusionVertexCount+1]=e.right[1],this.profileRightAxisData[4*this._extrusionVertexCount+2]=e.right[2],this.profileUpAxisData[4*this._extrusionVertexCount+0]=e.up[0],this.profileUpAxisData[4*this._extrusionVertexCount+1]=e.up[1],this.profileUpAxisData[4*this._extrusionVertexCount+2]=e.up[2],this.profileVertexAndNormalData[4*this._extrusionVertexCount+0]=i[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+1]=i[1],this.profileVertexAndNormalData[4*this._extrusionVertexCount+2]=s[0],this.profileVertexAndNormalData[4*this._extrusionVertexCount+3]=s[1],this.pathVertexData[this._extrusionVertexCount]=t,this.profileRightAxisData[4*this._extrusionVertexCount+3]=r,this.profileUpAxisData[4*this._extrusionVertexCount+3]=o,++this._extrusionVertexCount}emitTriangle(t,e,i){this.vertexIndices[3*this._triangleCount+0]=t,this.vertexIndices[3*this._triangleCount+1]=e,this.vertexIndices[3*this._triangleCount+2]=i,this.pathVertexIndices[3*this._triangleCount+0]=this.pathVertexData[t],this.pathVertexIndices[3*this._triangleCount+1]=this.pathVertexData[e],this.pathVertexIndices[3*this._triangleCount+2]=this.pathVertexData[i],this.normalIndices[3*this._triangleCount+0]=t,this.normalIndices[3*this._triangleCount+1]=e,this.normalIndices[3*this._triangleCount+2]=i,++this._triangleCount}_rebuildGeometry(){const t=(t,e,i,s,r)=>this.emitVertex(t,e,i,s,r),e=(t,e,i,s,r,o)=>this.emitCapVertex(t,e,i,s,r,o);this._extrusionVertexCount=0;for(const i of this.path.vertices)this.originData[3*i.index+0]=i.pos[0],this.originData[3*i.index+1]=i.pos[1],this.originData[3*i.index+2]=i.pos[2];this.startCap.rebuildConnectingProfileGeometry(this.path.vertices[0],this.profile,e);for(let i=1;i<this.path.vertices.length-1;++i)this.extruder.extrude(this.path.vertices[i],this.profile,t);if(this.endCap.rebuildConnectingProfileGeometry(this.path.vertices[this.path.vertices.length-1],this.profile,e),this.startCap.rebuildCapGeometry(this.path.vertices[0],e),this.endCap.rebuildCapGeometry(this.path.vertices[this.path.vertices.length-1],e),this.profile.hasUV()&&this.options.generateUV)for(let i=0;i<this.profile.uvs.length;++i)this.uvData[2*i+0]=this.profile.uvs[i],this.uvData[2*i+1]=0}buildTopology(){const t=(t,e,i)=>this.emitTriangle(t,e,i);this._triangleCount=0;const e=this.profile.vertices.length,i=this.profile.numSegments,s=this.numExtrusionProfiles-1;let r=3*(2*(i*s));this.startCap.indexBufferStart=r,this.startCap.firstProfileVertexIndex=0,r+=this.startCap.getNumIndices(),this.endCap.indexBufferStart=r,this.endCap.firstProfileVertexIndex=e*(this.numExtrusionProfiles-1),r+=this.endCap.getNumIndices(),this.vertexIndices=new Uint32Array(r),this.normalIndices=new Uint32Array(r),this.pathVertexIndices=new Uint32Array(r),this.profile.hasUV()&&this.options.generateUV&&(this.uvIndices=new Uint32Array(r));for(let o=0;o<i;++o){const i=this.profile.vertexIndices[2*o],r=this.profile.vertexIndices[2*o+1];for(let o=0;o<s;++o){const s=o*e+i,h=(o+1)*e+r,n=o*e+r;t(s,(o+1)*e+i,h),t(s,h,n)}}this.startCap.buildTopology(this.path.vertices[0],t),this.endCap.buildTopology(this.path.vertices[this.path.vertices.length-1],t)}onPathChanged(){this._rebuildGeometry()}}class tt{constructor(t){this.builder=t}get xform(){return this.builder.path.xform}onPathChanged(){this.builder.onPathChanged()}}class et extends tt{constructor(t){super(t),this.vertexAttributePosition=null,this.vertexAttributeNormal=null,this.vertexAttributeColor=null,this.vertexAttributePosition=new Float32Array(3*this.builder.numVerticesTotal),this.vertexAttributeNormal=new Float32Array(3*this.builder.numNormalsTotal),this.vertexAttributeColor=new Uint8Array(4),this.vertexAttributeColor[0]=255,this.vertexAttributeColor[1]=255,this.vertexAttributeColor[2]=255,this.vertexAttributeColor[3]=255}bakeVertexColors(t){this.vertexAttributeColor[0]=255*t[0],this.vertexAttributeColor[1]=255*t[1],this.vertexAttributeColor[2]=255*t[2],this.vertexAttributeColor[3]=255*(t.length>3?t[3]:1)}bake(t){this.size=t;for(let e=0;e<this.builder.numVerticesTotal;++e){let i=this.builder.pathVertexData[e];const s=0===i||i===this.builder.path.vertices.length-1;i*=3;const r=st;N(r,this.builder.originData[i++],this.builder.originData[i++],this.builder.originData[i]);const o=4*e,h=nt,l=rt,u=at,d=lt,v=ut;let m=0,g=0;if(N(d,this.builder.profileRightAxisData[o],this.builder.profileRightAxisData[o+1],this.builder.profileRightAxisData[o+2]),N(v,this.builder.profileUpAxisData[o],this.builder.profileUpAxisData[o+1],this.builder.profileUpAxisData[o+2]),n(l,this.builder.profileVertexAndNormalData[o]*t[0],this.builder.profileVertexAndNormalData[o+1]*t[1]),s)I(u,v,d),m=this.builder.profileRightAxisData[o+3]*t[0],g=this.builder.profileUpAxisData[o+3];else{const t=ot,e=ht;n(t,this.builder.profileRightAxisData[o+3],this.builder.profileUpAxisData[o+3]);const i=x(t);c(t,t);const s=a(l,t);if(Math.abs(s)>i){n(e,-t[1],t[0]);const r=a(l,e);p(t,t,i*Math.sign(s)),p(e,e,r),f(l,t,e)}N(u,0,0,0)}N(h,d[0]*l[0]+v[0]*l[1],d[1]*l[0]+v[1]*l[1],d[2]*l[0]+v[2]*l[1]),this.vertexAttributePosition[3*e+0]=r[0]+h[0]+u[0]*m,this.vertexAttributePosition[3*e+1]=r[1]+h[1]+u[1]*m,this.vertexAttributePosition[3*e+2]=r[2]+h[2]+u[2]*m;const V=rt;n(V,this.builder.profileVertexAndNormalData[o+2],this.builder.profileVertexAndNormalData[o+3]),this.vertexAttributeNormal[3*e+0]=d[0]*V[0]+v[0]*V[1]+u[0]*g,this.vertexAttributeNormal[3*e+1]=d[1]*V[0]+v[1]*V[1]+u[1]*g,this.vertexAttributeNormal[3*e+2]=d[2]*V[0]+v[2]*V[1]+u[2]*g}}createGeometryData(){const t=[[O.POSITION,this.builder.vertexIndices],[O.NORMAL,this.builder.normalIndices]],e=[[O.POSITION,{size:3,data:this.vertexAttributePosition,exclusive:!0}],[O.NORMAL,{size:3,data:this.vertexAttributeNormal,exclusive:!0}]];if(this.vertexAttributeColor){const i=this.builder.vertexIndices.length;t.push([O.COLOR,new Uint32Array(i)]),e.push([O.COLOR,{size:4,data:this.vertexAttributeColor}])}return{vertexAttributes:e,indices:t}}onPathChanged(){super.onPathChanged(),this.bake(this.size)}intersect(t,e,i){const s=this.builder.vertexIndices,r={size:3,data:this.vertexAttributePosition},o=s.length/3;M(t,e,0,o,s,r,void 0,void 0,i)}}class it extends tt{constructor(t,e,i,s){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=i,this.opacityAttributeValue=s,this.vvData=null,this.baked=new et(t),this.vvData=new Float32Array(4*this.builder.path.vertices.length);for(let r=0;r<this.builder.path.vertices.length;++r){this.vvData[4*r+0]=e,this.vvData[4*r+1]=i,this.vvData[4*r+2]=s;const t=0===r||r===this.builder.path.vertices.length-1;this.vvData[4*r+3]=t?1:0}}createGeometryData(){return{vertexAttributes:[[O.POSITION,{size:3,data:this.builder.originData,exclusive:!0}],[O.PROFILERIGHT,{size:4,data:this.builder.profileRightAxisData,exclusive:!0}],[O.PROFILEUP,{size:4,data:this.builder.profileUpAxisData,exclusive:!0}],[O.PROFILEVERTEXANDNORMAL,{size:4,data:this.builder.profileVertexAndNormalData,exclusive:!0}],[O.FEATUREVALUE,{size:4,data:this.vvData,exclusive:!0}]],indices:[[O.POSITION,this.builder.pathVertexIndices],[O.PROFILERIGHT,this.builder.vertexIndices],[O.PROFILEUP,this.builder.vertexIndices],[O.PROFILEVERTEXANDNORMAL,this.builder.vertexIndices],[O.FEATUREVALUE,this.builder.pathVertexIndices]]}}}const st=U(),rt=d(),ot=d(),ht=d(),nt=U(),at=U(),lt=U(),ut=U(),pt=U(),ft=k(),ct=h();export{$ as Builder,Q as CapBuilder,H as Extruder,it as FastUpdatePathGeometry,q as MiterExtruder,W as NoCapBuilder,z as Path,tt as PathGeometryData,G as PathVertex,j as Profile,Z as RoundCapBuilder,X as SimpleExtruder,et as StaticPathGeometry,Y as TriangulationCapBuilder,J as computeMinimumRotationTangentFrame,k as makeFrame,B as profileSpaceToVertexSpace,w as vertexSpaceToProfileSpace};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutputOptions.js";import{TransparencyPassType as t}from"../lib/basicInterfaces.js";import r from"../lib/GLMaterial.js";import{Material as s,
|
|
5
|
+
import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutputOptions.js";import{TransparencyPassType as t}from"../lib/basicInterfaces.js";import r from"../lib/GLMaterial.js";import{Material as s,DefaultMaterialParameters as i}from"../lib/Material.js";import{RenderSlot as a}from"../lib/RenderSlot.js";import{DefaultBufferWriter as n,PositionUVLayout as o}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as p}from"./internal/MaterialUtil.js";import{CheckerBoardTechniqueConfiguration as u,CheckerBoardTechnique as h}from"../shaders/CheckerBoardTechnique.js";class l extends s{constructor(e){super(e,f),this.techniqueConfig=new u}dispose(){}getPassParameters(){return this.parameters}getTechniqueConfig(e,r){return this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.writeDepth=this.parameters.writeDepth,this.techniqueConfig.polygonOffset=this.parameters.polygonOffset,this.techniqueConfig.transparencyPassType=r?r.transparencyPassType:t.NONE,this.techniqueConfig.multipassTerrainEnabled=!!r&&r.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=!!r&&r.cullAboveGround,this.techniqueConfig}intersect(e,t,r,s,i,a,n){return p(e,t,s,i,a,void 0,n)}requiresSlot(e){let t=a.OPAQUE_MATERIAL;return this.parameters.transparent&&(t=this.parameters.writeDepth?a.TRANSPARENT_MATERIAL:a.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),e===t||e===a.DRAPED_MATERIAL}createGLMaterial(t){return t.output===e.Color||t.output===e.Alpha?new c(t):null}createBufferWriter(){return new n(o)}}class c extends r{updateParameters(e){return this.ensureTechnique(h,e)}beginSlot(e){return this.updateParameters(e)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}const f={size:[1,1],color1:[.75,.75,.75,1],color2:[.5,.5,.5,1],transparent:!1,writeDepth:!0,polygonOffset:!1,...i};export{l as CheckerBoardMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutputOptions.js";import{CullFaceOptions as t}from"../lib/basicInterfaces.js";import r from"../lib/GLMaterial.js";import{outputFromPass as s}from"../lib/GLMaterials.js";import{
|
|
5
|
+
import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutputOptions.js";import{CullFaceOptions as t}from"../lib/basicInterfaces.js";import r from"../lib/GLMaterial.js";import{outputFromPass as s}from"../lib/GLMaterials.js";import{DefaultMaterialParameters as i,Material as a}from"../lib/Material.js";import{OITPolygonOffsetLimit as n}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as o}from"../lib/RenderSlot.js";import{DefaultBufferWriter as l,PositionColorLayout as u}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as h}from"./internal/MaterialUtil.js";import{ColorMaterialTechniqueConfiguration as p,ColorMaterialTechnique as c}from"../shaders/ColorMaterialTechnique.js";class m extends a{constructor(e){super(e,d),this.supportsEdges=!0,this.techniqueConfig=new p}getTechniqueConfig(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.cullFace=this.parameters.cullFace,this.techniqueConfig.vertexColors=this.parameters.vertexColors,this.techniqueConfig.slicePlaneEnabled=this.parameters.slicePlaneEnabled,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.polygonOffset=this.parameters.polygonOffset,this.techniqueConfig.writeDepth=this.parameters.writeDepth,this.techniqueConfig.sceneHasOcludees=this.parameters.sceneHasOcludees,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.enableOffset=t.camera.relativeElevation<n,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,this.techniqueConfig}getPassParameters(){return this.parameters}intersect(e,t,r,s,i,a,n){h(e,t,s,i,a,void 0,n)}requiresSlot(t,r){if(t===o.DRAPED_MATERIAL)return!0;if(s(r)===e.Highlight)return t===o.OPAQUE_MATERIAL;return t===(this.parameters.transparent?this.parameters.writeDepth?o.TRANSPARENT_MATERIAL:o.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:o.OPAQUE_MATERIAL)}createGLMaterial(t){return t.output===e.Color||t.output===e.Alpha||t.output===e.Highlight||t.output===e.Depth&&this.parameters.writeLinearDepth?new f(t):null}createBufferWriter(){return new l(u)}}class f extends r{updateParameters(e){return this.ensureTechnique(c,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.sceneHasOcludees&&this._material.setParameters({sceneHasOcludees:e.hasOccludees})}beginSlot(t){return this._output!==e.Color&&this._output!==e.Alpha||this._updateOccludeeState(t),this.updateParameters(t)}bind(e,t){t.bindPass(this._material.getPassParameters(),e)}}const d={color:[1,1,1,1],transparent:!1,writeDepth:!0,writeLinearDepth:!1,vertexColors:!1,polygonOffset:!1,slicePlaneEnabled:!1,cullFace:t.None,sceneHasOcludees:!1,...i};export{m as ColorMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../../../../core/maybe.js";import{c as t}from"../../../../chunks/mat3f64.js";import{s as i,g as
|
|
5
|
+
import{isSome as e}from"../../../../core/maybe.js";import{c as t}from"../../../../chunks/mat3f64.js";import{s as i,g as r,n as s,f as a,l as n,a as o,d as l,t as c}from"../../../../chunks/vec3.js";import{c as h,f as u}from"../../../../chunks/vec3f64.js";import{ViewingMode as d}from"../../../ViewingMode.js";import{newLayout as p}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as m}from"../core/shaderLibrary/ShaderOutputOptions.js";import{NormalsDoubleSidedMode as f}from"../core/shaderLibrary/shading/Normals.glsl.js";import{defaultMaskAlphaCutoff as v}from"../core/shaderLibrary/util/AlphaDiscard.glsl.js";import{CullFaceOptions as g,AlphaDiscardMode as T}from"../lib/basicInterfaces.js";import C from"../lib/GLMaterialTexture.js";import{DefaultMaterialParameters as b,Material as O}from"../lib/Material.js";import{OITPolygonOffsetLimit as x}from"../lib/OrderIndependentTransparency.js";import{RenderPass as S}from"../lib/RenderPass.js";import{RenderSlot as A}from"../lib/RenderSlot.js";import{VertexAttribute as E}from"../lib/VertexAttribute.js";import{getVerticalOffsetObject3D as M}from"../lib/verticalOffsetUtils.js";import{writeDefaultAttributes as q}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as I,intersectTriangleGeometry as P}from"./internal/MaterialUtil.js";import{DefaultMaterialTechniqueConfiguration as L,DefaultMaterialTechnique as R}from"../shaders/DefaultMaterialTechnique.js";import{RealisticTreeTechnique as y}from"../shaders/RealisticTreeTechnique.js";class D extends O{constructor(e){super(e,w),this.supportsEdges=!0,this.techniqueConfig=new L,this.vertexBufferLayout=N(this.parameters),this.instanceBufferLayout=e.instanced?j(this.parameters):null}isVisibleInPass(e){return e!==S.MATERIAL_DEPTH_SHADOWMAP_ALL&&e!==S.MATERIAL_DEPTH_SHADOWMAP_DEFAULT&&e!==S.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const t=e.instanced,i=e.vertexColors,r=e.symbolColors,s=!!t&&t.indexOf("color")>-1,a=e.vvColorEnabled,n="replace"===e.colorMixMode,o=e.opacity>0,l=e.externalColor&&e.externalColor[3]>0;return i&&(s||a||r)?!!n||o:i?n?l:o:s||a||r?!!n||o:n?l:o}getTechniqueConfig(t,i){return this.techniqueConfig.output=t,this.techniqueConfig.hasNormalTexture=!!this.parameters.normalTextureId,this.techniqueConfig.hasColorTexture=!!this.parameters.textureId,this.techniqueConfig.vertexTangents=this.parameters.vertexTangents,this.techniqueConfig.instanced=!!this.parameters.instanced,this.techniqueConfig.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this.techniqueConfig.vvSize=this.parameters.vvSizeEnabled,this.techniqueConfig.verticalOffset=null!==this.parameters.verticalOffset,this.techniqueConfig.screenSizePerspective=null!==this.parameters.screenSizePerspective,this.techniqueConfig.slicePlaneEnabled=this.parameters.slicePlaneEnabled,this.techniqueConfig.sliceHighlightDisabled=this.parameters.sliceHighlightDisabled,this.techniqueConfig.alphaDiscardMode=this.parameters.textureAlphaMode,this.techniqueConfig.normalsTypeDerivate="screenDerivative"===this.parameters.normals,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.writeDepth=this.parameters.writeDepth,this.techniqueConfig.sceneHasOcludees=this.parameters.sceneHasOcludees,this.techniqueConfig.cullFace=this.parameters.slicePlaneEnabled?g.None:this.parameters.cullFace,this.techniqueConfig.multipassTerrainEnabled=i.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=i.cullAboveGround,this.techniqueConfig.hasModelTransformation=e(this.parameters.modelTransformation),t!==m.Color&&t!==m.Alpha||(this.techniqueConfig.vertexColors=this.parameters.vertexColors,this.techniqueConfig.symbolColors=this.parameters.symbolColors,this.parameters.treeRendering?this.techniqueConfig.doubleSidedMode=f.WindingOrder:this.techniqueConfig.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?f.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?f.WindingOrder:f.None,this.techniqueConfig.instancedColor=!!this.parameters.instanced&&this.parameters.instanced.indexOf("color")>-1,this.techniqueConfig.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this.techniqueConfig.receiveAmbientOcclusion=!!i.ssaoEnabled&&this.parameters.receiveSSAO,this.techniqueConfig.vvColor=this.parameters.vvColorEnabled,this.techniqueConfig.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this.techniqueConfig.usePBR=this.parameters.usePBR,this.techniqueConfig.hasMetalnessAndRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this.techniqueConfig.hasEmissionTexture=!!this.parameters.emissiveTextureId,this.techniqueConfig.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this.techniqueConfig.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this.techniqueConfig.isSchematic=this.parameters.usePBR&&this.parameters.isSchematic,this.techniqueConfig.transparencyPassType=i.transparencyPassType,this.techniqueConfig.enableOffset=i.camera.relativeElevation<x),this.techniqueConfig}intersect(e,t,h,u,p,m,f){if(null!==this.parameters.verticalOffset){const e=u.camera;i(F,h[12],h[13],h[14]);let t=null;switch(u.viewingMode){case d.Global:t=s(V,F);break;case d.Local:t=r(V,G)}let f=0;if(null!==this.parameters.verticalOffset){const i=a(U,F,e.eye),r=n(i),s=o(i,i,1/r);let c=null;this.parameters.screenSizePerspective&&(c=l(t,s)),f+=I(e,r,this.parameters.verticalOffset,c,this.parameters.screenSizePerspective)}o(t,t,f),c(k,t,u.transform.inverseRotation),p=a(H,p,k),m=a(z,m,k)}P(e,t,u,p,m,M(u.verticalOffset),f)}requiresSlot(e){return e===(this.parameters.transparent?this.parameters.writeDepth?A.TRANSPARENT_MATERIAL:A.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:A.OPAQUE_MATERIAL)||e===A.DRAPED_MATERIAL}createGLMaterial(e){return e.output===m.Color||e.output===m.Alpha||e.output===m.Depth||e.output===m.Normal||e.output===m.Shadow||e.output===m.Highlight?new _(e):null}createBufferWriter(){return new B(this.vertexBufferLayout,this.instanceBufferLayout)}}class _ extends C{constructor(e){super({...e,...e.material.parameters})}updateParameters(e){const t=this._material.parameters;return this.updateTexture(t.textureId),this.ensureTechnique(t.treeRendering?y:R,e)}_updateShadowState(e){e.shadowMappingEnabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMappingEnabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.sceneHasOcludees&&this._material.setParameters({sceneHasOcludees:e.hasOccludees})}beginSlot(e){return this._output!==m.Color&&this._output!==m.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.parameters,e),this.bindTextures(t.program)}}const w={textureId:void 0,initTextureTransparent:!1,isSchematic:!1,usePBR:!1,normalTextureId:void 0,vertexTangents:!1,occlusionTextureId:void 0,emissiveTextureId:void 0,metallicRoughnessTextureId:void 0,emissiveFactor:[0,0,0],mrrFactors:[0,1,.5],ambient:[.2,.2,.2],diffuse:[.8,.8,.8],externalColor:[1,1,1,1],colorMixMode:"multiply",opacity:1,layerOpacity:1,vertexColors:!1,symbolColors:!1,doubleSided:!1,doubleSidedType:"normal",cullFace:g.Back,instanced:void 0,instancedDoublePrecision:!1,normals:"default",receiveSSAO:!0,receiveShadows:!0,castShadows:!0,shadowMappingEnabled:!1,verticalOffset:null,screenSizePerspective:null,slicePlaneEnabled:!1,sliceHighlightDisabled:!1,offsetTransparentBackfaces:!1,vvSizeEnabled:!1,vvSizeMinSize:[1,1,1],vvSizeMaxSize:[100,100,100],vvSizeOffset:[0,0,0],vvSizeFactor:[1,1,1],vvSizeValue:[1,1,1],vvColorEnabled:!1,vvColorValues:[0,0,0,0,0,0,0,0],vvColorColors:[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],vvSymbolAnchor:[0,0,0],vvSymbolRotationMatrix:t(),modelTransformation:null,transparent:!1,writeDepth:!0,textureAlphaMode:T.Blend,textureAlphaCutoff:v,textureAlphaPremultiplied:!1,sceneHasOcludees:!1,...b};class B{constructor(e,t){this.vertexBufferLayout=e,this.instanceBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(E.POSITION).length}write(e,t,i,r){q(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,i,r)}}function N(e){const t=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId,i=p().vec3f(E.POSITION).vec3f(E.NORMAL);return e.vertexTangents&&i.vec4f(E.TANGENT),t&&i.vec2f(E.UV0),e.vertexColors&&i.vec4u8(E.COLOR),e.symbolColors&&i.vec4u8(E.SYMBOLCOLOR),i}function j(e){let t=p();return t=e.instancedDoublePrecision?t.vec3f(E.MODELORIGINHI).vec3f(E.MODELORIGINLO).mat3f(E.MODEL).mat3f(E.MODELNORMAL):t.mat4f(E.MODEL).mat4f(E.MODELNORMAL),e.instanced&&e.instanced.indexOf("color")>-1&&(t=t.vec4f(E.INSTANCECOLOR)),e.instanced&&e.instanced.indexOf("featureAttribute")>-1&&(t=t.vec4f(E.INSTANCEFEATUREATTRIBUTE)),t}const H=h(),z=h(),G=u(0,0,1),V=h(),k=h(),F=h(),U=h();export{D as DefaultMaterial,j as getInstanceBufferLayout};
|