@arcgis/core 5.1.0-next.51 → 5.1.0-next.53
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/applications/Components/imageryUtils.d.ts +6 -0
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/001492854799c35b53bb.js +1 -0
- package/assets/esri/core/workers/chunks/004f991251f09b36fb09.js +1 -0
- package/assets/esri/core/workers/chunks/009db7b459b18f6a668b.js +1 -0
- package/assets/esri/core/workers/chunks/027d733a99f50cadcf22.js +1 -0
- package/assets/esri/core/workers/chunks/03d85a706669aaf24d49.js +1 -0
- package/assets/esri/core/workers/chunks/0450133e81bce4b48b84.js +1 -0
- package/assets/esri/core/workers/chunks/07e791530677f7e70f32.js +30 -0
- package/assets/esri/core/workers/chunks/085778ecd39f46324a6b.js +1 -0
- package/assets/esri/core/workers/chunks/08dce0019b52042b01fa.js +1 -0
- package/assets/esri/core/workers/chunks/0d8294982853308225da.js +1 -0
- package/assets/esri/core/workers/chunks/0fc60b4c44c4e865b699.js +2 -0
- package/assets/esri/core/workers/chunks/156aecac067213642aae.js +1 -0
- package/assets/esri/core/workers/chunks/{942e4d69b140bc2f97c9.js → 15a45e26964c2eb381a6.js} +1 -1
- package/assets/esri/core/workers/chunks/184e9147f7a2f0ae5915.js +1 -0
- package/assets/esri/core/workers/chunks/199f70c0373f6008a545.js +1 -0
- package/assets/esri/core/workers/chunks/19f59a2a97c33ff92650.js +1 -0
- package/assets/esri/core/workers/chunks/{d2af5342fbe80e2d8c60.js → 20f9f3470cad47d01803.js} +1 -1
- package/assets/esri/core/workers/chunks/2757cf54656b5d318b11.js +1 -0
- package/assets/esri/core/workers/chunks/{54420b66fd53d6e19ba5.js → 278eecd729bed2832702.js} +1 -1
- package/assets/esri/core/workers/chunks/{a3174b23aabcef2fa98c.js → 29c91b5c9ddcea85f39a.js} +1 -1
- package/assets/esri/core/workers/chunks/2aaeaf022af8493281dc.js +1 -0
- package/assets/esri/core/workers/chunks/2b7d020367cb4ebb3c3d.js +1 -0
- package/assets/esri/core/workers/chunks/3104b10770903c265626.js +1 -0
- package/assets/esri/core/workers/chunks/33f00633131581e06328.js +1 -0
- package/assets/esri/core/workers/chunks/34fe4570eef9e73839b8.js +1 -0
- package/assets/esri/core/workers/chunks/{32a51ce8e1a362115c89.js → 354b309c8225336bc1e5.js} +1 -1
- package/assets/esri/core/workers/chunks/3874362bf7d43adc41bb.js +1 -0
- package/assets/esri/core/workers/chunks/38dc1c4b8721efd4a165.js +1 -0
- package/assets/esri/core/workers/chunks/{48267b67564107a7d901.js → 3c9e1ec94bbcbf494916.js} +31 -31
- package/assets/esri/core/workers/chunks/{333a019ea18d07f6a159.js → 40bcfc4f8efe7de7ec9d.js} +1 -1
- package/assets/esri/core/workers/chunks/42f3fdad1728433b3510.js +1 -0
- package/assets/esri/core/workers/chunks/436941ec88439667022e.js +1 -0
- package/assets/esri/core/workers/chunks/{25946077568ab14c7bfc.js → 440f76c397a813b0dcf9.js} +1 -1
- package/assets/esri/core/workers/chunks/4812482f28f7205b0938.js +1 -0
- package/assets/esri/core/workers/chunks/{48033fa4b1b815bc9ece.js → 4d54beab8ae5ff31e7b0.js} +1 -1
- package/assets/esri/core/workers/chunks/5317cbef0aac29761575.js +1 -0
- package/assets/esri/core/workers/chunks/54a9e17d6c0fef6a9146.js +1 -0
- package/assets/esri/core/workers/chunks/55985c9c48b8e1d1c634.js +1 -0
- package/assets/esri/core/workers/chunks/55bb5b7817c2963c8bfa.js +1 -0
- package/assets/esri/core/workers/chunks/5a573fa1012092328b88.js +1 -0
- package/assets/esri/core/workers/chunks/5f06a57b4f7d7de16bbf.js +1 -0
- package/assets/esri/core/workers/chunks/60ad54e5707d4414d8b9.js +1 -0
- package/assets/esri/core/workers/chunks/63b9e4a7dad358605c38.js +1 -0
- package/assets/esri/core/workers/chunks/{d0adf059085ddf7151dd.js → 64845b1f53eca9db1229.js} +1 -1
- package/assets/esri/core/workers/chunks/662932d2effd2b384b9e.js +1 -0
- package/assets/esri/core/workers/chunks/66d4cbb35d0c290150bf.js +1 -0
- package/assets/esri/core/workers/chunks/677d3674cb2c0c05fb7e.js +1 -0
- package/assets/esri/core/workers/chunks/7100c9038739121c2c4b.js +1 -0
- package/assets/esri/core/workers/chunks/794f604d4267e374f7dd.js +1 -0
- package/assets/esri/core/workers/chunks/7ae8f73c8e2afae98ecb.js +1 -0
- package/assets/esri/core/workers/chunks/7d4af7e2cb2f234e12eb.js +1 -0
- package/assets/esri/core/workers/chunks/7d56b2ac5030dd8b748e.js +1 -0
- package/assets/esri/core/workers/chunks/807b12ace0099300b9b9.js +1 -0
- package/assets/esri/core/workers/chunks/{b98dd9fc9a7e3ff6bd49.js → 816a4b03f2ea49238a6c.js} +1 -1
- package/assets/esri/core/workers/chunks/842b442cc012d0797333.js +1 -0
- package/assets/esri/core/workers/chunks/{8d03d45a5ec65590019d.js → 851dd71d28681d4eccfd.js} +1 -1
- package/assets/esri/core/workers/chunks/{88c6cc90606409b5c884.js → 87d2021e91d025a2a142.js} +1 -1
- package/assets/esri/core/workers/chunks/8903ff28896bd6f34b0d.js +1 -0
- package/assets/esri/core/workers/chunks/89e9bc8789b100316136.js +1 -0
- package/assets/esri/core/workers/chunks/8afe32d3db9669f972bc.js +1 -0
- package/assets/esri/core/workers/chunks/91fd28f50477d16e294e.js +1 -0
- package/assets/esri/core/workers/chunks/{278409028bc5af45b507.js → 93ceb74ac88ef460fe5f.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe7dec83e40014c55a6b.js → 96e799ca97989a6ed448.js} +1 -1
- package/assets/esri/core/workers/chunks/98011b93acf3d5f0b5a2.js +1 -0
- package/assets/esri/core/workers/chunks/{cd491c37ba1ac381178c.js → 987dc23fdc0a8c7150b9.js} +1 -1
- package/assets/esri/core/workers/chunks/{25509953f19fbc4949a1.js → 992e74570b76f3f9e52e.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1c5f69bd1400e66c635.js → 9ae90a4b281d4103e8bb.js} +1 -1
- package/assets/esri/core/workers/chunks/9c7fd5db0813bdc38582.js +1 -0
- package/assets/esri/core/workers/chunks/9db2ff1d4cbb5d1b623e.js +1 -0
- package/assets/esri/core/workers/chunks/9f272445c285ee9abb7b.js +1 -0
- package/assets/esri/core/workers/chunks/a2fee1611319665e6aed.js +1 -0
- package/assets/esri/core/workers/chunks/a462aa1c7b68efad6906.js +1 -0
- package/assets/esri/core/workers/chunks/a644e30f65347ce846ed.js +1 -0
- package/assets/esri/core/workers/chunks/a64daa4945923a178fe5.js +1 -0
- package/assets/esri/core/workers/chunks/{6c3916517664c9e8398f.js → a787fe09d3df9d4254ba.js} +1 -1
- package/assets/esri/core/workers/chunks/a85575a8d1da09280cd7.js +1 -0
- package/assets/esri/core/workers/chunks/a971e61336f455b953d5.js +1 -0
- package/assets/esri/core/workers/chunks/ac4f7309a249132c22da.js +1 -0
- package/assets/esri/core/workers/chunks/aeb1900cfdd0e51cc5f8.js +1 -0
- package/assets/esri/core/workers/chunks/b2b77598048818c957b7.js +1 -0
- package/assets/esri/core/workers/chunks/{3fa5f102b6f77c523a76.js → b3e5dcb530cef678c8f8.js} +1 -1
- package/assets/esri/core/workers/chunks/ba62f3aa811430787863.js +1 -0
- package/assets/esri/core/workers/chunks/c03d0091a6f385b9ce8d.js +1 -0
- package/assets/esri/core/workers/chunks/{5b5340312086d7b0ca97.js → c460ca93ed8e20d8b53a.js} +1 -1
- package/assets/esri/core/workers/chunks/c4a9006cc6d2938570e0.js +1 -0
- package/assets/esri/core/workers/chunks/c692ea68509bddbf7b42.js +1 -0
- package/assets/esri/core/workers/chunks/{a4a4ce33de6432ba4dc3.js → c6a0e770c1a89d3b5913.js} +1 -1
- package/assets/esri/core/workers/chunks/{d527a57717d118c11311.js → ccf845ac0ac354507a25.js} +1 -1
- package/assets/esri/core/workers/chunks/{73e384fd93cf22503d84.js → cdf6ad970dc1893dac58.js} +1 -1
- package/assets/esri/core/workers/chunks/dd319d5fe89b275e93cf.js +1 -0
- package/assets/esri/core/workers/chunks/df3e79b56c37156e7895.js +1 -0
- package/assets/esri/core/workers/chunks/df8b80b17e371c9be4e6.js +1 -0
- package/assets/esri/core/workers/chunks/e77198f8ab47441423c5.js +1 -0
- package/assets/esri/core/workers/chunks/e786da40a1c87bed64ca.js +1 -0
- package/assets/esri/core/workers/chunks/e8aafef6342c50340a27.js +1 -0
- package/assets/esri/core/workers/chunks/ec00348d74e29f48613a.js +1 -0
- package/assets/esri/core/workers/chunks/{284ce99af7bdd73dc7e9.js → ec65c9c72507ef9a9cf9.js} +1 -1
- package/assets/esri/core/workers/chunks/ec91d5081f423755cb07.js +1 -0
- package/assets/esri/core/workers/chunks/{eb36417edc11fa80e312.js → ee8cd91c27e9cdfc3b2e.js} +1 -1
- package/assets/esri/core/workers/chunks/{cdec811b66d98e76be9e.js → eedeff8b344ff699b0b9.js} +1 -1
- package/assets/esri/core/workers/chunks/f4201e7dcae224d0caf0.js +1 -0
- package/assets/esri/core/workers/chunks/f4d31d96681b649ddc95.js +1 -0
- package/assets/esri/core/workers/chunks/f7cc05fbfc97b4d36eba.js +1 -0
- package/assets/esri/core/workers/chunks/{6aba8c3bce5f68568e3a.js → f7fb121169b7e5a5adbc.js} +1 -1
- package/assets/esri/core/workers/chunks/f8eb14170f927aecfbc8.js +1 -0
- package/assets/esri/core/workers/chunks/f9d369a4683f88ee9d76.js +1 -0
- package/assets/esri/core/workers/chunks/fc534c94d55331578195.js +1 -0
- package/assets/esri/core/workers/chunks/{bde4edc4d21363e2163a.js → fcfaaced184f8da3e28d.js} +1 -1
- package/assets/esri/core/workers/chunks/{3e61e7805dc6ff284831.js → fdf8fe0f50a9ae548c16.js} +1 -1
- package/chunks/Fog.glsl.js +1 -1
- package/chunks/GlowBlur.glsl.js +2 -2
- package/chunks/GlowComposition.glsl.js +6 -6
- package/chunks/HUDMaterial.glsl.js +1 -1
- package/chunks/OITBlend.glsl.js +9 -9
- package/config.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/maybe.js +1 -1
- package/geometry/support/aaBoundingBox.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/knowledgeGraph/nodeMovementUtils.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/raster/datasets/FunctionRaster.js +1 -1
- package/layers/raster/datasets/pixelReader.js +1 -1
- package/layers/raster/functions/AspectFunction.js +1 -1
- package/layers/raster/functions/BaseRasterFunction.js +1 -1
- package/layers/raster/functions/ConvolutionFunction.js +1 -1
- package/layers/raster/functions/CurvatureFunction.js +1 -1
- package/layers/raster/functions/HillshadeFunction.js +1 -1
- package/layers/raster/functions/ShadedReliefFunction.js +1 -1
- package/layers/raster/functions/SlopeFunction.js +1 -1
- package/layers/raster/functions/StatisticsFunction.js +1 -1
- package/layers/raster/functions/pixelUtils.js +1 -1
- package/layers/support/capabilities.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/package.json +3 -3
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/support/Tiles3DBVH.js +2 -0
- package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
- package/views/3d/support/ElevationRange.js +1 -1
- package/views/3d/support/ResourceController.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl/ManagedFBO.d.ts +1 -0
- package/views/3d/webgl/ManagedFBOResource.d.ts +1 -0
- 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/ComponentMaterialGlobalParameters.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheUsage.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/fboFormatUtils.js +2 -0
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/fog/FogTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowBlurTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/Dithering.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +3 -3
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/oitResolution.glsl.js +1 -1
- package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
- package/views/3d/webgl.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/selection/types.d.ts +92 -1
- package/views/support/selectionUtils.js +1 -1
- package/views/webgl/InstanceCounter.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflowData.d.ts +2 -2
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.js +1 -1
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/04b04548d4eb0941a01e.js +0 -1
- package/assets/esri/core/workers/chunks/06223d5d8281e5af14c5.js +0 -1
- package/assets/esri/core/workers/chunks/07bdcb622ea59fdbb3a6.js +0 -1
- package/assets/esri/core/workers/chunks/0b661b90f7ee3ae23425.js +0 -1
- package/assets/esri/core/workers/chunks/0eb57ef4a1b387c951d6.js +0 -1
- package/assets/esri/core/workers/chunks/136859ef29a3269c4128.js +0 -1
- package/assets/esri/core/workers/chunks/167e4ff7cbc88b42db71.js +0 -1
- package/assets/esri/core/workers/chunks/1a481f3ae3146682eb00.js +0 -1
- package/assets/esri/core/workers/chunks/1e018de43becf66cceaa.js +0 -1
- package/assets/esri/core/workers/chunks/236b4ab3da0bc8f788a2.js +0 -1
- package/assets/esri/core/workers/chunks/2379c64b0ca30814a815.js +0 -1
- package/assets/esri/core/workers/chunks/34207774bc371e95ba3c.js +0 -1
- package/assets/esri/core/workers/chunks/35d115bde474c380c791.js +0 -1
- package/assets/esri/core/workers/chunks/380bb57bccc266d6442a.js +0 -1
- package/assets/esri/core/workers/chunks/3f6ebd82551c2000912e.js +0 -1
- package/assets/esri/core/workers/chunks/4577df99c92c7ec0f9de.js +0 -1
- package/assets/esri/core/workers/chunks/4869e2f35aaf6b058281.js +0 -1
- package/assets/esri/core/workers/chunks/4a4516bc5ec319c868cd.js +0 -2
- package/assets/esri/core/workers/chunks/4c6fc6d19fe519ce7bfc.js +0 -1
- package/assets/esri/core/workers/chunks/5351e71ce7839636d06d.js +0 -1
- package/assets/esri/core/workers/chunks/58f47dea6d8665611eff.js +0 -1
- package/assets/esri/core/workers/chunks/5b2fe488a461bc433f59.js +0 -1
- package/assets/esri/core/workers/chunks/5c0b3c76a7bc971c61dc.js +0 -1
- package/assets/esri/core/workers/chunks/5df9d2a255c9d63ae7df.js +0 -1
- package/assets/esri/core/workers/chunks/5f53d7d6bc9b67b2f357.js +0 -1
- package/assets/esri/core/workers/chunks/5ffe664eda334ad73175.js +0 -1
- package/assets/esri/core/workers/chunks/64da1ad9df9094ef5c12.js +0 -1
- package/assets/esri/core/workers/chunks/64fd3561bc94570ee954.js +0 -1
- package/assets/esri/core/workers/chunks/650614a9e4871714c42e.js +0 -1
- package/assets/esri/core/workers/chunks/666f201d222c50ab8428.js +0 -1
- package/assets/esri/core/workers/chunks/66e35e38aea978f91a0c.js +0 -1
- package/assets/esri/core/workers/chunks/696f645349249f26090c.js +0 -1
- package/assets/esri/core/workers/chunks/6d5bb00157e20ad90fc0.js +0 -1
- package/assets/esri/core/workers/chunks/70f0d66e5e6d5d2163f3.js +0 -1
- package/assets/esri/core/workers/chunks/7380177f16d914fdbc63.js +0 -1
- package/assets/esri/core/workers/chunks/768bbc910be6c65ac107.js +0 -1
- package/assets/esri/core/workers/chunks/76effcc35b3962cd5535.js +0 -1
- package/assets/esri/core/workers/chunks/777390e820b3824dc265.js +0 -1
- package/assets/esri/core/workers/chunks/7948d6f14ae44d346d88.js +0 -1
- package/assets/esri/core/workers/chunks/797bf402489b3677a5f7.js +0 -1
- package/assets/esri/core/workers/chunks/7a4cc1133e4410271b00.js +0 -1
- package/assets/esri/core/workers/chunks/7dba4121cdd20dbc4b20.js +0 -1
- package/assets/esri/core/workers/chunks/7dba4b04c148f03fdf21.js +0 -1
- package/assets/esri/core/workers/chunks/87c9a1fc9f2a392b78f5.js +0 -1
- package/assets/esri/core/workers/chunks/88426877d625ea333143.js +0 -1
- package/assets/esri/core/workers/chunks/8967a02f394a63f11030.js +0 -1
- package/assets/esri/core/workers/chunks/8c210529a28addb94ea0.js +0 -1
- package/assets/esri/core/workers/chunks/8d3c508995253cbe083f.js +0 -1
- package/assets/esri/core/workers/chunks/8e18ac7b22d8dca1e1e2.js +0 -1
- package/assets/esri/core/workers/chunks/8e3cb1c584951c3d1eb7.js +0 -1
- package/assets/esri/core/workers/chunks/908f171b9c512d738dea.js +0 -1
- package/assets/esri/core/workers/chunks/922484b43803ab4e4319.js +0 -1
- package/assets/esri/core/workers/chunks/947a715b608c8affd812.js +0 -1
- package/assets/esri/core/workers/chunks/9bd68abc6b5b07b2add3.js +0 -1
- package/assets/esri/core/workers/chunks/9e55f97291062985560b.js +0 -1
- package/assets/esri/core/workers/chunks/9e5f6ad08e54e4f49bf0.js +0 -1
- package/assets/esri/core/workers/chunks/a90883ff02c0cc6450c2.js +0 -1
- package/assets/esri/core/workers/chunks/ac9722a7897c994f11ab.js +0 -1
- package/assets/esri/core/workers/chunks/b1ac09d8fa340d194aa2.js +0 -1
- package/assets/esri/core/workers/chunks/c04c457f5295febb3c39.js +0 -1
- package/assets/esri/core/workers/chunks/cb2fbe585c0827eecf70.js +0 -1
- package/assets/esri/core/workers/chunks/cf74d1605ad2f21699e7.js +0 -1
- package/assets/esri/core/workers/chunks/d50e6681ecb9612e4528.js +0 -1
- package/assets/esri/core/workers/chunks/d6eddb94f5f2e9759bd0.js +0 -1
- package/assets/esri/core/workers/chunks/dcc3285e4ab2c38709bd.js +0 -1
- package/assets/esri/core/workers/chunks/e25bbd7cc553b1d2e208.js +0 -1
- package/assets/esri/core/workers/chunks/e72ca52d930afb5650af.js +0 -30
- package/assets/esri/core/workers/chunks/e96529e144c3268a04f7.js +0 -1
- package/assets/esri/core/workers/chunks/f379f94adbe79dc305a2.js +0 -1
- package/assets/esri/core/workers/chunks/f4e5163efa2a0567ee19.js +0 -1
- package/assets/esri/core/workers/chunks/f76833254f842fb0cd9a.js +0 -1
- package/assets/esri/core/workers/chunks/f8ff3c2dc00b0b27f72f.js +0 -1
- package/assets/esri/core/workers/chunks/f9abae8d07002fe04a08.js +0 -1
- package/assets/esri/core/workers/chunks/ff6c4f8420140b9f9577.js +0 -1
- package/assets/esri/core/workers/chunks/ffe9fa5111c149ddef49.js +0 -1
- /package/assets/esri/core/workers/chunks/{4a4516bc5ec319c868cd.js.LICENSE.txt → 0fc60b4c44c4e865b699.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import e from"../../../../core/Logger.js";import{getOrCreateMapValue as t}from"../../../../core/MapUtils.js";import{sub as n,normalize as o,dot as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as r,create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a,isEmpty as l,setEmpty as u,intersectsSphere as h,intersectsRay as c,copy as d,exactEquals as g}from"../../../../geometry/support/aaBoundingBox.js";import{fromValues as m}from"../../../../geometry/support/aaBoundingRect.js";import{earth as f}from"../../../../geometry/support/Ellipsoid.js";import{ElevationRange as p}from"../../support/ElevationRange.js";class w{static create(e,t){return"local"===e?new _(t):new b(t)}constructor(e,t){this.viewingMode=e,this.layerExtent=t,this._rootNode=null,this._intersectionGeneration=0,this._tileMap=new Map}destroy(){this._rootNode?.clear(),this._tileMap.clear()}_nextIntersectionGeneration(){return this._intersectionGeneration++,this._intersectionGeneration}addTile(e){const{mbsCenter:n,mbsRadius:o}=e,i=[this._ensureRootNode()],r=new Array,s=t(this._tileMap,e,()=>new Set),a=t=>{if(s.has(t))return;const n=t.addOwnTile(e);R(r,t.parent,n),s.add(t)};for(;i.length>0;){const t=i.pop();if(t.treeDepth>=H||e.mbsRadius>=.5*t.sideLength){a(t);continue}const{hPlane:r,vPlane:s}=t,l=V(n,o,r),u=V(n,o,s);0!==l||0!==u?M(t,l,u,(e,t)=>{i.push(this._ensureChild(e,t))}):a(t)}this._propagateSummaryUpdates(r)}removeTile(t){if(!this._rootNode)return void e.getLogger("Tiles3DBVH").error("Tiles3DBVH: Attempted to remove a tile that is not loaded (no root node)");const n=this._tileMap.get(t);if(!n||0===n.size)return void e.getLogger("Tiles3DBVH").error("Tiles3DBVH internal error: Attempted to remove a tile that is not loaded (not in tile map)");const o=new Array;this._tileMap.delete(t);for(const e of n){e.removeOwnTile(t);const n=e.updateOwnSummaries();R(o,e.parent,n)}this._propagateSummaryUpdates(o)}_propagateSummaryUpdates(e){if(0===e.length)return;e.sort((e,t)=>e.node.treeDepth-t.node.treeDepth);let t=new Map,n=-1;const o=()=>e.length>0?e[e.length-1].node.treeDepth:-1;for(;e.length>0||t.size>0;){const i=t.size>0?n:o(),r=t;for(t=new Map;e.length>0&&o()===i;){const{node:t,childrenUpdateKind:n}=e.pop();I(r,t,n)}for(const[e,n]of r){let o=0;for(let t=0;t<4;t++){const n=e.children[t];n&&n.isLeaf&&0===n.ownTiles.size&&(n.clear(),e.children[t]=null,o=3)}o|=e.updateSubtreeSummaries(n|o),I(t,e.parent,o)}t.size>0&&(n=i-1)}}forEachTileIntersectingRay(e,t,n,o){o?this._forEachTileIntersectingVerticalRay(e,t,n):this._forEachTileIntersectingRayGeneral(e,t,n)}_forEachTileIntersectingRayGeneral(e,t,i){const r=this._rootNode;if(!r)return;const s=this._nextIntersectionGeneration();n(j,t,e);const a=o(j,j),l=[{node:r,tRange:{tMin:0,tMax:Number.POSITIVE_INFINITY}}];for(;l.length>0;){const t=l.pop(),{node:n,tRange:o}=t,r=n.subtreeIntersectsRay(e,a,o);if(!r)continue;if(n.ownIntersectsRay(e,a,r))for(const l of n.ownTiles)l.bvhIntersectionGeneration!==s&&(l.bvhIntersectionGeneration=s,l.boundingVolumeIntersectsRay(e,a)&&i(l));const{hPlane:u,vPlane:h}=n;for(let i=0;i<4;i++){const t=n.children[i];if(null==t)continue;const r=0===i||1===i,s=y(e,a,y(e,a,o,h,!(0===i||2===i)),u,!r);s&&l.push({node:t,tRange:s})}}}_forEachTileIntersectingVerticalRay(e,t,i){if("global"!==this.viewingMode)return void this._forEachTileIntersectingRayGeneral(e,t,i);const r=this._rootNode;if(!r)return;const s=this._nextIntersectionGeneration();n(j,t,e);const a=o(j,j),l={tMin:0,tMax:Number.POSITIVE_INFINITY},u=(e,t)=>{const n=e.children[t];n&&h.push(n)},h=[r];for(;h.length>0;){const t=h.pop();if(!t.subtreeIntersectsRay(e,a,l))continue;if(null!=t.ownIntersectsRay(e,a,l))for(const n of t.ownTiles)n.bvhIntersectionGeneration!==s&&(n.bvhIntersectionGeneration=s,n.boundingVolumeIntersectsRay(e,a)&&i(n));if(t.isLeaf)continue;M(t,T(t.hPlane,e),T(t.vPlane,e),(t,n)=>{const o=t.children[n];o&&o.subtreeIntersectsRay(e,a,l)&&u(t,n)})}}getElevationRangeIntersectingSphere(e){const t=this._rootNode;if(!t||!t.subtreeIntersectsSphere(e))return null;const n=this._nextIntersectionGeneration();let o=null;const i=e=>{e.isEmpty||(o?o.expandElevationRange(e):o=new p(e.minElevation,e.maxElevation))},r=[t];for(;r.length>0;){const t=r.pop();if(!o?.contains(t.subtreeElevationRange))if(t.subtreeContainedBySphere(e))i(t.subtreeElevationRange);else{if(t.ownIntersectsSphere(e))for(const r of t.ownTiles){if(r.bvhIntersectionGeneration===n)continue;if(r.bvhIntersectionGeneration=n,!r.boundingVolumeIntersectsSphere(e))continue;const t=r.elevationRange;o?.contains(t)||i(t)}if(!t.isLeaf){M(t,V(e.center,e.radius,t.hPlane),V(e.center,e.radius,t.vPlane),(t,n)=>{const i=t.children[n];if(i&&i.subtreeIntersectsSphere(e)){if(o?.contains(i.subtreeElevationRange))return;r.push(i)}})}}}return o}}class _ extends w{constructor(e){super("local",e)}_ensureRootNode(){if(!this._rootNode){const e=this.layerExtent,t=Math.max(Math.abs(e[0]),Math.abs(e[1]),Math.abs(e[2]),Math.abs(e[3])),n=Math.log2(t),o=Math.ceil(n),i=2**Math.max(1,o),s=new v(null,0,m(-i,-i,i,i),new E(r(0,1,0),0),new E(r(1,0,0),0),2*i,a(-i,-i,-1/0,i,i,1/0));this._rootNode=s}return this._rootNode}_ensureChild(t,n){if(t.treeDepth>=H){const t="Internal error: attempted to create a child node for a node that is already at max depth";throw e.getLogger("Tiles3DBVH").error(t),new Error(t)}let o=t.children[n];if(null===o){const{extent:e,hPlane:i,vPlane:r,treeDepth:s,sideLength:l}=t,u=.5*(e[0]+e[2]),h=.5*(e[1]+e[3]),c=0===n||1===n,d=2===n||0===n,g=m(d?e[0]:u,c?e[1]:h,d?u:e[2],c?h:e[3]),f=new E(i.normal,-.5*(g[1]+g[3])),p=new E(r.normal,-.5*(g[0]+g[2]));o=new v(t,s+1,g,f,p,.5*l,a(g[0],g[1],-1/0,g[2],g[3],1/0)),t.children[n]=o}return o}}class b extends w{constructor(e){super("global",e)}_ensureRootNode(){if(!this._rootNode){const e=new v(null,0,m(-Math.PI,-Math.PI/2,Math.PI,Math.PI/2),new E(r(0,0,1),0),new E(r(1,0,0),0),Math.PI*f.radius,a(-1/0,-1/0,-1/0,1/0,1/0,1/0));this._rootNode=e}return this._rootNode}_ensureChild(t,n){if(t.treeDepth>=H){const t="Attempted to create a child node for a node that is already at max depth";throw e.getLogger("Tiles3DBVH").error(t),new Error(t)}let o=t.children[n];if(null===o){const{extent:e,treeDepth:i,sideLength:s}=t,a=.5*(e[0]+e[2]),l=.5*(e[1]+e[3]),u=0===n||1===n,h=2===n||0===n,c=m(h?e[0]:a,u?e[1]:l,h?a:e[2],u?l:e[3]),d=.5*(c[0]+c[2]),g=.5*(c[1]+c[3]),f=Math.cos(d),p=Math.sin(d),w=Math.cos(g),_=Math.sin(g),b=r(-_*f,-_*p,w),M=new E(b,0),R=new E(r(-p,f,0),0);o=new v(t,i+1,c,M,R,.5*s),t.children[n]=o}return o}}class v{constructor(e,t,n,o,i,r,s){this.parent=e,this._treeDepth=t,this.extent=n,this.hPlane=o,this.vPlane=i,this.sideLength=r,this.bounds=s,this._ownBoundingVolume=a(1/0,1/0,1/0,-1/0,-1/0,-1/0),this._subtreeBoundingVolume=a(1/0,1/0,1/0,-1/0,-1/0,-1/0),this._ownElevationRange=new p,this._subtreeElevationRange=new p,this.ownTiles=new Set,this.children=[null,null,null,null]}get ownBoundingVolume(){return this._ownBoundingVolume}get subtreeBoundingVolume(){return this._subtreeBoundingVolume}get subtreeElevationRange(){return this._subtreeElevationRange}subtreeContainedBySphere(e){const t=this._subtreeBoundingVolume;if(l(t))return!0;const{center:n,radius:o}=e,i=o**2;let r=0;for(let s=0;s<3;s++){if(r+=Math.max(Math.abs(t[s]-n[s]),Math.abs(t[s+3]-n[s]))**2,r>i)return!1}return!0}clear(){for(let e=0;e<4;e++)this.children[e]?.clear(),this.children[e]=null;this.ownTiles.clear(),u(this._ownBoundingVolume),u(this._subtreeBoundingVolume),this._ownElevationRange.initializeEmpty(),this._subtreeElevationRange.initializeEmpty()}get isLeaf(){return this.children.every(e=>null==e)}get treeDepth(){return this._treeDepth}subtreeIntersectsSphere(e){return h(this.subtreeBoundingVolume,e)}ownIntersectsSphere(e){return this.ownTiles.size>0&&h(this._ownBoundingVolume,e)}subtreeIntersectsRay(e,t,n){return c(this.subtreeBoundingVolume,e,t,n)}ownIntersectsRay(e,t,n){return this.ownTiles.size>0?c(this._ownBoundingVolume,e,t,n):null}addOwnTile(t){if(this.ownTiles.has(t)){const t="BVNode: Attempted to add a tile that is already in the node";return e.getLogger("Tiles3DBVH").error(t),0}this.ownTiles.add(t);return(x(this._ownBoundingVolume,t,this.bounds)&&B(this._subtreeBoundingVolume,this._ownBoundingVolume,this.bounds)?1:0)|(this._ownElevationRange.expandElevationRange(t.elevationRange)&&this._subtreeElevationRange.expandElevationRange(t.elevationRange)?2:0)}removeOwnTile(t){if(!this.ownTiles.has(t)){const t="BVNode: Attempted to remove a tile that is not in the node";return void e.getLogger("Tiles3DBVH").error(t)}this.ownTiles.delete(t)}updateOwnSummaries(){const e=(S(this._ownBoundingVolume,this.ownTiles,this.bounds)?1:0)|(D(this._ownElevationRange,this.ownTiles)?2:0);return this.updateSubtreeSummaries(e)}updateSubtreeSummaries(e){if(this.isLeaf&&0===this.ownTiles.size)return u(this._subtreeBoundingVolume),this._subtreeElevationRange.initializeEmpty(),3;let t=0;if(1&e){N(this._subtreeBoundingVolume,[this._ownBoundingVolume,...this.children.map(e=>e?.subtreeBoundingVolume).filter(e=>null!=e)],this.bounds)&&(t|=1)}if(2&e){P(this._subtreeElevationRange,[this._ownElevationRange,...this.children.filter(e=>null!=e).map(e=>e.subtreeElevationRange)])&&(t|=2)}return t}}function M(e,t,n,o){t<=0&&(n<=0&&o(e,0),n>=0&&o(e,1)),t>=0&&(n<=0&&o(e,2),n>=0&&o(e,3))}function R(e,t,n){null!=t&&0!==n&&e.push({node:t,childrenUpdateKind:n})}function I(e,t,n){if(null==t||0===n)return;const o=e.get(t)??0;e.set(t,o|n)}class E{constructor(e=[0,0,0],t=0){this.normal=e,this.distance=t}}function V(e,t,n){const o=i(n.normal,e)+n.distance;return o<0?Math.min(o+t,0):Math.max(o-t,0)}function T(e,t){return i(e.normal,t)+e.distance}function y(e,t,n,o,r){if(!n)return null;const s=1e-12,a=i(o.normal,t),l=T(o,e)+n.tMin*a;if(Math.abs(a)<s){return(r?l>=-s:l<=s)?n:null}const u=n.tMin-l/a,h=r===a>0?{tMin:Math.max(n.tMin,u),tMax:n.tMax}:{tMin:n.tMin,tMax:Math.min(n.tMax,u)};return h.tMin<=h.tMax?h:null}function x(e,t,n){const{mbsCenter:o,mbsRadius:i}=t;for(let r=0;r<3;r++)G[r]=o[r]-i,G[r+3]=o[r]+i;return B(e,G,n)}function B(e,t,n){if(l(t))return!1;let o=!1;for(let i=0;i<3;i++){const r=Math.max(n?.[i]??-1/0,t[i]),s=Math.min(n?.[i+3]??1/0,t[i+3]);r<e[i]&&(e[i]=r,o=!0),s>e[i+3]&&(e[i+3]=s,o=!0)}return o}function S(e,t,n){d(L,e),u(e);for(const o of t)x(e,o,n);return!g(e,L)}function N(e,t,n){d(L,e),u(e);for(const o of t)B(e,o,n);return!g(e,L)}function D(e,t){z.setElevationRange(e),e.initializeEmpty();for(const n of t)e.expandElevationRange(n.elevationRange);return!e.equals(z)}function P(e,t){z.setElevationRange(e),e.initializeEmpty();for(const n of t)e.expandElevationRange(n);return!e.equals(z)}const G=a(0,0,0,0,0,0),L=a(0,0,0,0,0,0),z=new p,j=s(),H=30;export{w as Tiles3DBVH};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{project as t}from"../../../../geometry/projectionUtils.js";import{fromExtent as i}from"../../../../geometry/support/aaBoundingRect.js";import{Tiles3DTarget as n}from"../i3s/Intersector.js";import{Tiles3DBVH as r}from"./Tiles3DBVH.js";import{ElevationRange as s}from"../../support/ElevationRange.js";import{IntersectorResult as o}from"../../webgl-engine/lib/IntersectorResult.js";import{MeshIntersectionOptions as l,computeInvDir as a,intersectAabbInvDir as c}from"../../webgl-engine/lib/RayIntersections.js";class d{constructor(e){this.layerView=e,this.type=8,this.slicePlaneEnabled=!1,this.isGround=!0,this.layerViewUid=e.uid;const n=e.view.viewingMode,s=e.layer.fullExtent,o=(s?t(s,e.view.renderSpatialReference):void 0)??e.view.extent,l=i(o);this._bvh=r.create(n,l)}destroy(){this._bvh.destroy()}addTile(e){this._bvh.addTile(e)}removeTile(e){this._bvh.removeTile(e)}intersect(e,t,i,r,s,d){if(e.options.filteredLayerViewUids.includes(this.layerView.uid))return;const{results:u,tolerance:h}=e,p=2===e.options.store,{componentObjectCollection:f}=this.layerView.view.stage.renderView,g=new l(h,d,e.options.normalRequired),v=a(i,r,m),w=(s,l,a)=>{if(l<0)return;if(null!=t&&!t(i,r,l))return;const c=e=>{const t=new n(this.layerView.uid);e.set(this.type,t,l,a)};if(this.isGround&&(null==u.ground.distance||l<u.ground.distance)&&c(u.ground),!e.options.isFiltered&&((null==u.min.distance||l<u.min.distance)&&c(u.min),(null==u.max.distance||l>u.max.distance)&&c(u.max),p)){const t=new o(e.ray);c(t),e.results.all.push(t)}};this._bvh.forEachTileIntersectingRay(i,r,e=>{const{componentObjects:t}=e;for(const n of t)c(n.aabbInWorldCoordinates,i,v,0)&&f.intersect(n,i,r,null,g,w)},d)}getElevationRange(e){return this._bvh.getElevationRangeIntersectingSphere(e)??new s(0,0)}}const m=e();export{d as Tiles3DMeshIntersectionHandler};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
class i{constructor(i=1/0,
|
|
2
|
+
class i{constructor(i=1/0,t=-1/0){this.minElevation=i,this.maxElevation=t}get elevationRangeValid(){return!Number.isNaN(this.minElevation)}get isEmpty(){return!(this.minElevation<=this.maxElevation)}contains(i){return this.minElevation<=i.minElevation&&this.maxElevation>=i.maxElevation}invalidateElevationRange(){this.minElevation=NaN}initializeEmpty(){this.minElevation=1/0,this.maxElevation=-1/0}expandElevationRange(i){const t=Math.min(this.minElevation,i.minElevation),a=Math.max(this.maxElevation,i.maxElevation),n=t!==this.minElevation||a!==this.maxElevation;return this.minElevation=t,this.maxElevation=a,n}expandElevationRangeValues(i,t){const a=Math.min(this.minElevation,i),n=Math.max(this.maxElevation,t),e=a!==this.minElevation||n!==this.maxElevation;return this.minElevation=a,this.maxElevation=n,e}setElevationRange(i){this.minElevation=i.minElevation,this.maxElevation=i.maxElevation}setElevationRangeValues(i,t){this.minElevation=i,this.maxElevation=t}equals(i){return this.minElevation===i.minElevation&&this.maxElevation===i.maxElevation}}export{i as ElevationRange};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{removeMaybe as s,destroyMaybe as i}from"../../../core/maybe.js";import{watch as o}from"../../../core/reactiveUtils.js";import{addFrameTask as a}from"../../../core/scheduling.js";import{signal as l}from"../../../core/signal.js";import{secondsFromMilliseconds as m}from"../../../core/time.js";import{property as n,subclass as d}from"../../../core/accessorSupport/decorators.js";import{newMemoryController as h}from"./MemoryController.js";import{ImmediateTask as u,newScheduler as p,TaskPriority as c}from"../../support/Scheduler.js";let _=class extends t{constructor(){super(...arguments),this.updating=!1}};function v(e){return new
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{removeMaybe as s,destroyMaybe as i}from"../../../core/maybe.js";import{watch as o}from"../../../core/reactiveUtils.js";import{addFrameTask as a}from"../../../core/scheduling.js";import{signal as l}from"../../../core/signal.js";import{secondsFromMilliseconds as m}from"../../../core/time.js";import{property as n,subclass as d}from"../../../core/accessorSupport/decorators.js";import{newMemoryController as h}from"./MemoryController.js";import{ImmediateTask as u,newScheduler as p,TaskPriority as c}from"../../support/Scheduler.js";let _=class extends t{constructor(){super(...arguments),this.updating=!1}};function v(e){return new y({view:e})}function g(e,t){return t&&2===e?1:e}e([n({readOnly:!0})],_.prototype,"updating",void 0),_=e([d("esri.views.3d.support.ResourceController.ResourceControllerMain")],_);let y=class extends _{constructor(){super(...arguments),this._immediateTask=u,this._normalTask=u,this._updatingObjects=l([]),this._frameTask=null}get immediate(){return this._immediateTask}get normal(){return this._normalTask}initialize(){this._scheduler=p(),this._memoryController=h(this.view),this.addHandles([o(()=>this.view.stationary,()=>this._stationaryChangedHandler())]),this._frameTask=a({update:e=>this._frame(e)}),this._immediateTask=this._scheduler.registerTask(c.RESOURCE_CONTROLLER_IMMEDIATE),this._normalTask=this._scheduler.registerTask(c.RESOURCE_CONTROLLER)}destroy(){this._immediateTask.remove(),this._normalTask.remove(),this._frameTask=s(this._frameTask),this._memoryController=i(this._memoryController),this._scheduler=i(this._scheduler),this.view=null}get updating(){return!(!this._memoryController?.updating&&!this._immediateTask?.updating)||this._updatingObjects?.value.some(e=>e.updating)}get scheduler(){return this._scheduler}get memoryController(){return this._memoryController}addUpdatingObject(e){const t=this._updatingObjects;return t.value=[...t.value,e],r(()=>{t.value=t.value.filter(t=>t!==e)})}_frame(e){this.view.suspended||this.view.stateManager&&(this.view.stateManager.step(m(e.deltaTime)),!this._scheduler)||(this._memoryController.update(),this.view.state&&(this._scheduler.state=g(this.view.state.mode,this.view.state.fading),this.view.state.fading=!1),this._scheduler.frame(e))}_stationaryChangedHandler(){this.memoryController.resetStableQuality()}};e([n()],y.prototype,"view",void 0),e([n()],y.prototype,"_scheduler",void 0),e([n()],y.prototype,"_memoryController",void 0),e([n()],y.prototype,"_immediateTask",void 0),e([n()],y.prototype,"_normalTask",void 0),e([n({readOnly:!0})],y.prototype,"updating",null),y=e([d("esri.views.3d.support.ResourceController")],y);export{g as applyFadingToSchedulerState,v as newResourceController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{signal as
|
|
2
|
+
import{signal as e}from"../../../../core/signal.js";class i{static{this.fadeInEase=e=>e*(2-e)}static{this.fadeOutEase=e=>e*e}constructor(i){this.layerView=i,this._numFadingTiles=e(0),this._tmpFullyFadedOutTiles=new Array}get numFadingTiles(){return this._numFadingTiles.value}fadeTile(e,i){const t=this._getTargetOpacity(i);if(e.fadeDirection=i,0===this.fadeDuration)return void this._instantTileFading(e,t);const a=e.opacityModifier;if(a!==t){const i=1-Math.abs(t-a);this._startTileFading(e,i)}else this._stopTileFading(e)}updateAllTileFading(e){const i=this._tmpFullyFadedOutTiles;i.length=0,this.layerView.tileHandles.forEach(t=>{this._updateTileFading(t,e)&&i.push(t)});i.length>0&&(this.layerView.updateGaussians(),this.layerView.notifyTileObbsChanged(i)),this._numFadingTiles.value>0&&this.layerView.view.stage?.renderView.requestRender(2)}onFadeDurationChanged(e){0===e&&this.numFadingTiles>0&&this._instantlyFullyFadeAllTiles()}isTileFadingOut(e){return null!=e.fadeProgress&&1===e.fadeDirection}onTileDiscarded(e){null!=e.fadeProgress&&this._numFadingTiles.value--}get updating(){return this._numFadingTiles.value>0}get fadeDuration(){return this.layerView.view.qualitySettings.fadeDuration}get fadingEnabled(){return 0!==this.fadeDuration}_startTileFading(e,i){null==e.fadeProgress&&this._numFadingTiles.value++,e.fadeProgress=i}_stopTileFading(e){null!=e.fadeProgress&&(1===e.fadeDirection&&this._onTileFullyFadedOut(e),this._numFadingTiles.value--,e.fadeProgress=null)}_updateTileFading(e,t){const{fadeProgress:a,fadeDirection:s}=e;if(null==a)return!1;const n=this._fadeDirectionToSign(s),l=n*this.fadeDuration,d=this._getTargetOpacity(s),r=t/Math.abs(l||1),u=Math.min(a+r,1),o=n*(1-(0===s?i.fadeInEase:i.fadeOutEase)(u)),g=1===u;if(e.opacityModifier=g?d:d-o,g){const i=1===s;return this._stopTileFading(e),this._updateOpacityModifier(e),i}return e.fadeProgress=u,this._updateOpacityModifier(e),!1}_updateOpacityModifier(e){const i=255*e.opacityModifier;for(let t=0;t<e.pageIds.length;t++){const a=e.pageIds[t];this.layerView.data.fadingTexture.updateBuffer(i,a)}}_instantTileFading(e,i){e.fadeProgress=null,e.opacityModifier=i,this._updateOpacityModifier(e),1===e.fadeDirection&&this._onTileFullyFadedOut(e)}_instantlyFullyFadeAllTiles(){const e=this._tmpFullyFadedOutTiles;e.length=0,this.layerView.tileHandles.forEach(i=>{if(null!=i.fadeProgress){const t=1===i.fadeDirection;this._instantTileFading(i,this._getTargetOpacity(i.fadeDirection)),t&&e.push(i)}});e.length>0&&(this.layerView.updateGaussians(),this.layerView.notifyTileObbsChanged(e)),this._numFadingTiles.value=0}_onTileFullyFadedOut(e){e.isVisible=!1,this.layerView.moveTileToCache(e)}_fadeDirectionToSign(e){return 0===e?1:-1}_getTargetOpacity(e){return 0===e?1:0}}export{i as GaussianSplatFadeHelper};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import r from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import{PixelType as i,SizedPixelFormat as s}from"../../../webgl/enums.js";import"../../../webgl/Util.js";import{initialSplatAtlasTexturePages as a}from"./GaussianSplatAtlasPages.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";class o{constructor(e){this.texture=null,this._fadeTextureCapacity=0,this._rctx=e}ensureCapacity(t){const o=this.texture;if(this._fadeTextureCapacity
|
|
2
|
+
import{reallocGrowthFactor as e}from"../../../../core/arrayUtils.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../webgl/BufferObject.js";import"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import r from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import{PixelType as i,SizedPixelFormat as s}from"../../../webgl/enums.js";import"../../../webgl/Util.js";import{initialSplatAtlasTexturePages as a}from"./GaussianSplatAtlasPages.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";class o{constructor(e){this.texture=null,this._fadeTextureCapacity=0,this._rctx=e}ensureCapacity(t){const o=this.texture;if(this._fadeTextureCapacity>=t&&o?.hasWebGLTextureObject)return;const f=Math.max(Math.ceil(t*e),a),[h,c]=this._evalTextureSize(f),p=h*c,l=this._fadeBuffer,m=new Uint8Array(p);l&&m.set(l.subarray(0,this._fadeTextureCapacity)),this._fadeBuffer=m,this._fadeTextureCapacity=p,this.texture?.dispose();const n=new u;n.width=h,n.height=c,n.pixelFormat=36244,n.dataType=i.UNSIGNED_BYTE,n.internalFormat=s.R8UI,n.unpackAlignment=1,n.wrapMode=33071,n.samplingMode=9728,n.isImmutable=!0,this.texture=new r(this._rctx,n)}updateTexture(e){this.ensureCapacity(e);const t=this.texture.descriptor.width,r=Math.ceil(e/t),i=t*r;this.texture.updateData(0,0,0,t,r,this._fadeBuffer.subarray(0,i))}updateBuffer(e,t){this.ensureCapacity(t+1),this._fadeBuffer&&(this._fadeBuffer[t]=e)}clear(){this._fadeBuffer=void 0,this._fadeTextureCapacity=0,this.texture?.dispose(),this.texture=null}destroy(){this.clear()}_evalTextureSize(e){const r=Math.ceil(Math.sqrt(e)),i=Math.ceil(e/r);return t(r,i)}}export{o as GaussianSplatFadeTexture};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{fromQuat as t,scale as e}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as r,conjugate as i,multiply as n}from"../../../core/libs/gl-matrix-2/math/quat.js";import{IDENTITY as o,create as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{set as c,transformQuat as f,dot as d,cross as u,len as l,scale as m,transformMat3 as _,add as g,sub as p,abs as b,max as M,min as j,length as S,scaleAndAdd as z,sign as x,multiply as y}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as C,freeze as q,create as A,UNIT_Z as P}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as Q}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{create as R}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as v}from"../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as w}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as D}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as H}from"../../../geometry/projection/projectBuffer.js";import{getProjector as F}from"../../../geometry/projection/projectors.js";import{getNormal as k}from"../../../geometry/support/plane.js";import{isPlateCarree as B}from"../../../geometry/support/spatialReferenceUtils.js";import{sv3d as U,sq4d as W}from"../../../geometry/support/vectorStacks.js";import{computeOBB as Z}from"./dito.js";import{Vertices as G}from"../webgl-engine/lib/Attribute.js";class O{constructor(t=C,e=pt,a=o){this._data=[t[0],t[1],t[2],e[0],e[1],e[2],a[0],a[1],a[2],a[3]]}clone(){return O.fromData(this._data)}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const e=new O;return e._copyFromData(t),e}static fromJSON(t){return new O(t.center,t.halfSize,t.quaternion)}copy(t){this._copyFromData(t.data)}_copyFromData(t){for(let e=0;e<10;++e)this._data[e]=t[e]}get center(){return c(U.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,e,a){this._data[0]=t,this._data[1]=e,this._data[2]=a}get halfSize(){return c(U.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return r(W.get(),this._data[6],this._data[7],this._data[8],this._data[9])}get quaternionConjugate(){return r(W.get(),-this._data[6],-this._data[7],-this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const e=this._data,a=r(T,e[6],e[7],e[8],e[9]);for(let s=0;s<8;++s){const r=t[s];r[0]=(1&s?-1:1)*e[3],r[1]=(2&s?-1:1)*e[4],r[2]=(4&s?-1:1)*e[5],f(r,r,a),r[0]+=e[0],r[1]+=e[1],r[2]+=e[2]}return t}getAxes(t){const e=this._data,a=r(T,e[6],e[7],e[8],e[9]);return f(t[0],[1,0,0],a),f(t[1],[0,1,0],a),f(t[2],[0,0,1],a),t}intersectsFrustum(t){const e=this.center,a=t.planes;for(const f of a){const t=k(f),a=this.projectedRadius(t);if(d(t,e)+f[3]-a>0)return!1}const s=this.getAxes(lt),r=t.points,i=this.halfSize;for(let f=0;f<3;++f){const t=s[f],a=-d(t,e),n=i[f];let o=!0,h=!0;for(const e of r){const s=d(e,t)+a;o&&=s>n,h&&=s<-n}if(o||h)return!1}if(this.getCorners(ut).some(e=>t.intersectsPoint(e)))return!0;const n=jt;for(let f=0;f<3;++f){const t=s[f];n[f]=d(t,e)}const o=t=>{for(let e=0;e<3;++e){const a=s[e],r=i[e],o=d(a,t)-n[e];if(o>r||o<-r)return!1}return!0};if(t.points.some(t=>o(t)))return!0;const h=t.lines,c=Mt;for(let f=0;f<8;++f){const t=h[f].direction;for(const a of s){u(c,t,a);const s=l(c);if(!(s>0))continue;m(c,c,1/s);const i=this.projectedRadius(c),n=d(e,c),o=n-i,h=n+i;let f=!1,_=!1,g=!0;for(const t of r){const e=d(c,t);if(e>h){if(_){g=!1;break}f=!0}else{if(!(e<o)){g=!1;break}if(f){g=!1;break}_=!0}}if(g)return!1}}return!0}intersectsFrustumConservativeApproximation(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],e=this._data[4],a=this._data[5];return Math.sqrt(t*t+e*e+a*a)}intersectsPoint(t){const e=this.getAxes(lt),a=this.halfSize,{center:s}=this;for(let r=0;r<3;++r){const i=e[r],n=a[r],o=d(i,t)-d(i,s);if(o>n||o<-n)return!1}return!0}intersectSphere(t){const{center:e,radius:a}=t,s=this._data,r=s[3],i=s[4],n=s[5],o=r+i+n+a,h=s[0]-e[0];if(Math.abs(h)>o)return!1;const c=s[1]-e[1];if(Math.abs(c)>o)return!1;const f=s[2]-e[2];if(Math.abs(f)>o)return!1;const d=-s[6],u=-s[7],l=-s[8],m=u*f-l*c,_=l*h-d*f,g=d*c-u*h,p=u*g-l*_,b=l*m-d*g,M=d*_-u*m,j=2*s[9],S=Math.abs(h+m*j+2*p),z=Math.abs(c+_*j+2*b),x=Math.abs(f+g*j+2*M),y=S-Math.min(S,r),C=z-Math.min(z,i),q=x-Math.min(x,n);return y*y+C*C+q*q<=a*a}intersectSphereWithMBS(t,e=this.radius){const a=this._data,{center:s,radius:r}=t,i=e+r,n=a[0]-s[0];if(n>i)return!1;const o=a[1]-s[1];if(o>i)return!1;const h=a[2]-s[2];if(h>i)return!1;if(n*n+o*o+h*h>i*i)return!1;const c=-a[6],f=-a[7],d=-a[8],u=f*h-d*o,l=d*n-c*h,m=c*o-f*n,_=f*m-d*l,g=d*u-c*m,p=c*l-f*u,b=2*a[9],M=Math.abs(n+u*b+2*_),j=Math.abs(o+l*b+2*g),S=Math.abs(h+m*b+2*p),z=M-Math.min(M,a[3]),x=j-Math.min(j,a[4]),y=S-Math.min(S,a[5]);return z*z+x*x+y*y<r*r}intersectPlane(t){const e=t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3],a=this.projectedRadius(k(t));return e>a?1:e<-a?-1:0}intersectRay(t,e,a=0){const s=this._data,r=T;r[0]=-s[6],r[1]=-s[7],r[2]=-s[8],r[3]=s[9],E[0]=t[0]-s[0],E[1]=t[1]-s[1],E[2]=t[2]-s[2];const i=f(E,E,T),n=f(I,e,T);let o=-1/0,h=1/0;const c=this.getHalfSize(ct);for(let f=0;f<3;f++){const t=i[f],e=n[f],s=c[f]+a;if(Math.abs(e)>1e-6){const a=(s-t)/e,r=(-s-t)/e;o=Math.max(o,Math.min(a,r)),h=Math.min(h,Math.max(a,r))}else if(t>s||t<-s)return!1}return o<=h}projectedArea(a,s,r,n){const o=this.getQuaternion(X);i(T,o),E[0]=a[0]-this._data[0],E[1]=a[1]-this._data[1],E[2]=a[2]-this._data[2],f(E,E,T);const h=this.getHalfSize(ct),d=E[0]<-h[0]?-1:E[0]>h[0]?1:0,u=E[1]<-h[1]?-1:E[1]>h[1]?1:0,l=E[2]<-h[2]?-1:E[2]>h[2]?1:0,m=Math.abs(d)+Math.abs(u)+Math.abs(l);if(0===m)return 1/0;const p=1===m?4:6,b=6*(d+3*u+9*l+13);t(ft,o),e(ft,ft,h);const M=this.getCenter(ot);for(let t=0;t<p;t++){const e=K[b+t];c(E,((1&e)<<1)-1,(2&e)-1,((4&e)>>1)-1),_(E,E,ft),g(J,M,E),J[3]=1,Q(J,J,s);const a=1/Math.max(1e-6,J[3]);V[2*t]=J[0]*a,V[2*t+1]=J[1]*a}const j=2*p-2;let S=V[0]*(V[3]-V[j+1])+V[j]*(V[1]-V[j-1]);for(let t=2;t<j;t+=2)S+=V[t]*(V[t+3]-V[t-1]);return Math.abs(S)*r*n*.125}projectedRadius(t){const e=this.getQuaternion(X);return i(T,e),f(E,t,T),Math.abs(E[0]*this._data[3])+Math.abs(E[1]*this._data[4])+Math.abs(E[2]*this._data[5])}minimumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]-this.projectedRadius(k(t))}maximumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]+this.projectedRadius(k(t))}toAaBoundingBox(e){const a=this.getQuaternion(X),s=t(ft,a),r=this._data[3]*Math.abs(s[0])+this._data[4]*Math.abs(s[3])+this._data[5]*Math.abs(s[6]),i=this._data[3]*Math.abs(s[1])+this._data[4]*Math.abs(s[4])+this._data[5]*Math.abs(s[7]),n=this._data[3]*Math.abs(s[2])+this._data[4]*Math.abs(s[5])+this._data[5]*Math.abs(s[8]);e[0]=this._data[0]-r,e[1]=this._data[1]-i,e[2]=this._data[2]-n,e[3]=this._data[0]+r,e[4]=this._data[1]+i,e[5]=this._data[2]+n}transform(t,e,a,s=0,r=w(a),i=w(e),n=F(e,i)){if(a===r)e.isGeographic?st(this,t,e,s,i):at(this,t,e,s,i,n);else if(e.isGeographic&&(a.isWebMercator||B(a)))$(e,this,a,t,s);else if(e.isWebMercator&&B(a))tt(e,this,a,t,s);else{const r=this.getCenter(ot);r[2]+=s,H(r,e,0,r,a,0),t.center=r,this!==t&&(t.quaternion=this.getQuaternion(X),t.halfSize=this.getHalfSize(ct))}}}const T=h(),X=h(),Y=h(),E=A(),I=A(),J=R();function N(t,e=new O){return Z(t,e),e}const V=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],K=(()=>{const t=new Int8Array(162);let e=0;const a=a=>{for(let s=0;s<a.length;s++)t[e+s]=a[s];e+=6};return a([6,2,3,1,5,4]),a([0,2,3,1,5,4]),a([0,2,3,7,5,4]),a([0,1,3,2,6,4]),a([0,1,3,2,0,0]),a([0,1,5,7,3,2]),a([0,1,3,7,6,4]),a([0,1,3,7,6,2]),a([0,1,5,7,6,2]),a([0,1,5,4,6,2]),a([0,1,5,4,0,0]),a([0,1,3,7,5,4]),a([0,2,6,4,0,0]),a([0,0,0,0,0,0]),a([1,3,7,5,0,0]),a([2,3,7,6,4,0]),a([2,3,7,6,0,0]),a([2,3,1,5,7,6]),a([0,1,5,7,6,2]),a([0,1,5,7,6,4]),a([0,1,3,7,6,4]),a([4,5,7,6,2,0]),a([4,5,7,6,0,0]),a([4,5,1,3,7,6]),a([0,2,3,7,5,4]),a([6,2,3,7,5,4]),a([6,2,3,1,5,4]),t})();function L(t,e,a,s,r){const n=t.getQuaternion(X);r.quaternion=n,i(T,n);const o=t.getCenter(ot),h=t.getHalfSize(ct);if(1===s){f(mt,o,T),b(_t,mt),j(gt,_t,h),p(gt,_t,gt);const s=S(gt);g(gt,_t,h);const i=S(gt);if(s<a)r.center=o,c(mt,a,a,a),r.halfSize=g(mt,h,mt);else{const n=i>0?1+e/i:1,o=s>0?1+a/s:1,c=(o+n)/2,d=(o-n)/2;m(gt,_t,d),r.halfSize=z(gt,gt,h,c),m(gt,_t,c),z(gt,gt,h,d),x(mt,mt),y(mt,gt,mt);const u=t.getQuaternion(Y);r.center=f(mt,mt,u)}}else{r.center=z(mt,o,P,(a+e)/2);const t=f(mt,P,T);b(t,t),r.halfSize=z(_t,h,t,(a-e)/2)}return r}function $(t,e,a,s,r){e.getCenter(ot),ot[2]+=r;const i=w(a);H(ot,t,0,ot,i,0),et(i,e,ot,a,s)}function tt(t,e,a,s,r){e.getCenter(ot),ot[2]+=r,et(t,e,ot,a,s)}function et(e,a,s,r,i){const n=a.getQuaternion(X),o=t(ft,n),h=a.getHalfSize(ct);for(let t=0;t<8;++t){for(let e=0;e<3;++e)nt[e]=h[e]*(t&1<<e?-1:1);for(let e=0;e<3;++e){let a=s[e];for(let t=0;t<3;++t)a+=nt[t]*o[3*t+e];rt[3*t+e]=a}}H(rt,e,0,rt,r,0,8),N(it,i)}function at(t,e,a,s,r=w(a),o=F(a,r)){t.getCorners(ut),t.getCenter(nt),nt[2]+=s,D(a,nt,dt,r),e.setCenter(dt[12],dt[13],dt[14]);const h=2*Math.sqrt(1+dt[0]+dt[5]+dt[10]);T[0]=(dt[6]-dt[9])/h,T[1]=(dt[8]-dt[2])/h,T[2]=(dt[1]-dt[4])/h,T[3]=.25*h;const d=t.getQuaternion(X);e.quaternion=n(T,T,d),i(T,T),c(_t,0,0,0);const u=e.getCenter(ht);for(const i of ut)i[2]+=s,o(i,0,i,0),p(mt,i,u),f(mt,mt,T),b(mt,mt),M(_t,_t,mt);e.halfSize=_t}function st(t,e,a,s,r=w(a)){const n=v(a),o=1+Math.max(0,s)/(n.radius+t.centerZ);t.getCenter(nt),nt[2]+=s,H(nt,a,0,nt,r,0),e.center=nt;const h=t.getQuaternion(X);e.quaternion=h,i(T,h),c(mt,0,0,1),f(mt,mt,T);const d=t.getHalfSize(ct);c(mt,d[0]*Math.abs(mt[0]),d[1]*Math.abs(mt[1]),d[2]*Math.abs(mt[2])),m(mt,mt,n.inverseFlattening),g(mt,d,mt),e.halfSize=m(mt,mt,o)}const rt=new Array(24),it=new G(rt,3),nt=A(),ot=A(),ht=A(),ct=A(),ft=a(),dt=s(),ut=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],lt=[A(),A(),A()],mt=A(),_t=A(),gt=A(),pt=q(-1,-1,-1);function bt(t){return Array.from(t)}const Mt=A(),jt=[0,0,0];export{O as Obb,N as compute,L as computeOffsetObb,bt as ensurePackedObbData};
|
|
2
|
+
import{fromQuat as t,scale as e}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as s}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as r,conjugate as i,multiply as n}from"../../../core/libs/gl-matrix-2/math/quat.js";import{IDENTITY as o,create as h}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{set as c,transformQuat as d,dot as f,cross as u,len as l,scale as m,transformMat3 as _,add as g,sub as p,abs as b,max as M,min as j,length as S,scaleAndAdd as z,sign as x,multiply as y}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as C,freeze as q,create as A,UNIT_Z as P}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as Q}from"../../../core/libs/gl-matrix-2/math/vec4.js";import{create as R}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as v}from"../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as w}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{computeTranslationToOriginAndRotation as D}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBuffer as H}from"../../../geometry/projection/projectBuffer.js";import{getProjector as F}from"../../../geometry/projection/projectors.js";import{getNormal as k}from"../../../geometry/support/plane.js";import{isPlateCarree as B}from"../../../geometry/support/spatialReferenceUtils.js";import{sv3d as Z,sq4d as U}from"../../../geometry/support/vectorStacks.js";import{computeOBB as W}from"./dito.js";import{Vertices as X}from"../webgl-engine/lib/Attribute.js";class Y{constructor(t=C,e=pt,a=o){this._data=[t[0],t[1],t[2],e[0],e[1],e[2],a[0],a[1],a[2],a[3]]}clone(){return Y.fromData(this._data)}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const e=new Y;return e._copyFromData(t),e}static fromJSON(t){return new Y(t.center,t.halfSize,t.quaternion)}copy(t){this._copyFromData(t.data)}_copyFromData(t){for(let e=0;e<10;++e)this._data[e]=t[e]}get center(){return c(Z.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,e,a){this._data[0]=t,this._data[1]=e,this._data[2]=a}get halfSize(){return c(Z.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return r(U.get(),this._data[6],this._data[7],this._data[8],this._data[9])}get quaternionConjugate(){return r(U.get(),-this._data[6],-this._data[7],-this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}getQuaternionConjugate(t){return t[0]=-this._data[6],t[1]=-this._data[7],t[2]=-this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const e=this._data,a=r(G,e[6],e[7],e[8],e[9]);for(let s=0;s<8;++s){const r=t[s];r[0]=(1&s?-1:1)*e[3],r[1]=(2&s?-1:1)*e[4],r[2]=(4&s?-1:1)*e[5],d(r,r,a),r[0]+=e[0],r[1]+=e[1],r[2]+=e[2]}return t}getAxes(t){const e=this._data,a=r(G,e[6],e[7],e[8],e[9]);return d(t[0],[1,0,0],a),d(t[1],[0,1,0],a),d(t[2],[0,0,1],a),t}intersectsFrustum(t){const{centerX:e,centerY:a,centerZ:s}=this,r=t.planes;for(const f of r){const t=k(f),r=this.projectedRadius(t);if(e*t[0]+a*t[1]+s*t[2]+f[3]-r>0)return!1}const i=this.getAxes(lt),n=t.points,o=this.halfSize;for(let u=0;u<3;++u){const t=i[u],r=-t[0]*e-t[1]*a-t[2]*s,h=o[u];let c=!0,d=!0;for(const e of n){const a=f(e,t)+r;c&&=a>h,d&&=a<-h}if(c||d)return!1}if(this.getCorners(ut).some(e=>t.intersectsPoint(e)))return!0;const h=jt;for(let f=0;f<3;++f){const t=i[f];h[f]=t[0]*e+t[1]*a+t[2]*s}const c=t=>{for(let e=0;e<3;++e){const a=i[e],s=o[e],r=a[0]*t[0]+a[1]*t[1]+a[2]*t[2]-h[e];if(r>s||r<-s)return!1}return!0};if(t.points.some(t=>c(t)))return!0;const d=t.lines,_=Mt;for(let g=0;g<8;++g){const t=d[g].direction;for(const r of i){u(_,t,r);const i=l(_);if(!(i>0))continue;m(_,_,1/i);const o=this.projectedRadius(_),h=_[0]*e+_[1]*a+_[2]*s,c=h-o,d=h+o;let g=!1,p=!1,b=!0;for(const t of n){const e=f(_,t);if(e>d){if(p){b=!1;break}g=!0}else{if(!(e<c)){b=!1;break}if(g){b=!1;break}p=!0}}if(b)return!1}}return!0}intersectsFrustumConservativeApproximation(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],e=this._data[4],a=this._data[5];return Math.sqrt(t*t+e*e+a*a)}intersectsPoint(t){const e=this.getAxes(lt),a=this.halfSize,{center:s}=this;for(let r=0;r<3;++r){const i=e[r],n=a[r],o=f(i,t)-f(i,s);if(o>n||o<-n)return!1}return!0}intersectSphere(t){const{center:e,radius:a}=t,s=this._data,r=s[3],i=s[4],n=s[5],o=r+i+n+a,h=s[0]-e[0];if(Math.abs(h)>o)return!1;const c=s[1]-e[1];if(Math.abs(c)>o)return!1;const d=s[2]-e[2];if(Math.abs(d)>o)return!1;const f=-s[6],u=-s[7],l=-s[8],m=u*d-l*c,_=l*h-f*d,g=f*c-u*h,p=u*g-l*_,b=l*m-f*g,M=f*_-u*m,j=2*s[9],S=Math.abs(h+m*j+2*p),z=Math.abs(c+_*j+2*b),x=Math.abs(d+g*j+2*M),y=S-Math.min(S,r),C=z-Math.min(z,i),q=x-Math.min(x,n);return y*y+C*C+q*q<=a*a}intersectSphereWithMBS(t,e=this.radius){const a=this._data,{center:s,radius:r}=t,i=e+r,n=a[0]-s[0];if(n>i)return!1;const o=a[1]-s[1];if(o>i)return!1;const h=a[2]-s[2];if(h>i)return!1;if(n*n+o*o+h*h>i*i)return!1;const c=-a[6],d=-a[7],f=-a[8],u=d*h-f*o,l=f*n-c*h,m=c*o-d*n,_=d*m-f*l,g=f*u-c*m,p=c*l-d*u,b=2*a[9],M=Math.abs(n+u*b+2*_),j=Math.abs(o+l*b+2*g),S=Math.abs(h+m*b+2*p),z=M-Math.min(M,a[3]),x=j-Math.min(j,a[4]),y=S-Math.min(S,a[5]);return z*z+x*x+y*y<r*r}intersectPlane(t){const e=t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3],a=this.projectedRadius(k(t));return e>a?1:e<-a?-1:0}intersectRay(t,e,a=0){const s=this._data,r=G;r[0]=-s[6],r[1]=-s[7],r[2]=-s[8],r[3]=s[9],E[0]=t[0]-s[0],E[1]=t[1]-s[1],E[2]=t[2]-s[2];const i=d(E,E,G),n=d(I,e,G);let o=-1/0,h=1/0;const c=this.getHalfSize(ct);for(let d=0;d<3;d++){const t=i[d],e=n[d],s=c[d]+a;if(Math.abs(e)>1e-6){const a=(s-t)/e,r=(-s-t)/e;o=Math.max(o,Math.min(a,r)),h=Math.min(h,Math.max(a,r))}else if(t>s||t<-s)return!1}return o<=h}projectedArea(a,s,r,n){const o=this.getQuaternion(O);i(G,o),E[0]=a[0]-this._data[0],E[1]=a[1]-this._data[1],E[2]=a[2]-this._data[2],d(E,E,G);const h=this.getHalfSize(ct),f=E[0]<-h[0]?-1:E[0]>h[0]?1:0,u=E[1]<-h[1]?-1:E[1]>h[1]?1:0,l=E[2]<-h[2]?-1:E[2]>h[2]?1:0,m=Math.abs(f)+Math.abs(u)+Math.abs(l);if(0===m)return 1/0;const p=1===m?4:6,b=6*(f+3*u+9*l+13);t(dt,o),e(dt,dt,h);const M=this.getCenter(ot);for(let t=0;t<p;t++){const e=K[b+t];c(E,((1&e)<<1)-1,(2&e)-1,((4&e)>>1)-1),_(E,E,dt),g(J,M,E),J[3]=1,Q(J,J,s);const a=1/Math.max(1e-6,J[3]);V[2*t]=J[0]*a,V[2*t+1]=J[1]*a}const j=2*p-2;let S=V[0]*(V[3]-V[j+1])+V[j]*(V[1]-V[j-1]);for(let t=2;t<j;t+=2)S+=V[t]*(V[t+3]-V[t-1]);return Math.abs(S)*r*n*.125}projectedRadius(t){const e=this.getQuaternion(O);return i(G,e),d(E,t,G),Math.abs(E[0]*this._data[3])+Math.abs(E[1]*this._data[4])+Math.abs(E[2]*this._data[5])}minimumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]-this.projectedRadius(k(t))}maximumDistancePlane(t){return t[0]*this._data[0]+t[1]*this._data[1]+t[2]*this._data[2]+t[3]+this.projectedRadius(k(t))}toAaBoundingBox(e){const a=this.getQuaternion(O),s=t(dt,a),r=this._data[3]*Math.abs(s[0])+this._data[4]*Math.abs(s[3])+this._data[5]*Math.abs(s[6]),i=this._data[3]*Math.abs(s[1])+this._data[4]*Math.abs(s[4])+this._data[5]*Math.abs(s[7]),n=this._data[3]*Math.abs(s[2])+this._data[4]*Math.abs(s[5])+this._data[5]*Math.abs(s[8]);e[0]=this._data[0]-r,e[1]=this._data[1]-i,e[2]=this._data[2]-n,e[3]=this._data[0]+r,e[4]=this._data[1]+i,e[5]=this._data[2]+n}transform(t,e,a,s=0,r=w(a),i=w(e),n=F(e,i)){if(a===r)e.isGeographic?st(this,t,e,s,i):at(this,t,e,s,i,n);else if(e.isGeographic&&(a.isWebMercator||B(a)))$(e,this,a,t,s);else if(e.isWebMercator&&B(a))tt(e,this,a,t,s);else{const r=this.getCenter(ot);r[2]+=s,H(r,e,0,r,a,0),t.center=r,this!==t&&(t.quaternion=this.getQuaternion(O),t.halfSize=this.getHalfSize(ct))}}}const G=h(),O=h(),T=h(),E=A(),I=A(),J=R();function N(t,e=new Y){return W(t,e),e}const V=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],K=(()=>{const t=new Int8Array(162);let e=0;const a=a=>{for(let s=0;s<a.length;s++)t[e+s]=a[s];e+=6};return a([6,2,3,1,5,4]),a([0,2,3,1,5,4]),a([0,2,3,7,5,4]),a([0,1,3,2,6,4]),a([0,1,3,2,0,0]),a([0,1,5,7,3,2]),a([0,1,3,7,6,4]),a([0,1,3,7,6,2]),a([0,1,5,7,6,2]),a([0,1,5,4,6,2]),a([0,1,5,4,0,0]),a([0,1,3,7,5,4]),a([0,2,6,4,0,0]),a([0,0,0,0,0,0]),a([1,3,7,5,0,0]),a([2,3,7,6,4,0]),a([2,3,7,6,0,0]),a([2,3,1,5,7,6]),a([0,1,5,7,6,2]),a([0,1,5,7,6,4]),a([0,1,3,7,6,4]),a([4,5,7,6,2,0]),a([4,5,7,6,0,0]),a([4,5,1,3,7,6]),a([0,2,3,7,5,4]),a([6,2,3,7,5,4]),a([6,2,3,1,5,4]),t})();function L(t,e,a,s,r){const n=t.getQuaternion(O);r.quaternion=n,i(G,n);const o=t.getCenter(ot),h=t.getHalfSize(ct);if(1===s){d(mt,o,G),b(_t,mt),j(gt,_t,h),p(gt,_t,gt);const s=S(gt);g(gt,_t,h);const i=S(gt);if(s<a)r.center=o,c(mt,a,a,a),r.halfSize=g(mt,h,mt);else{const n=i>0?1+e/i:1,o=s>0?1+a/s:1,c=(o+n)/2,f=(o-n)/2;m(gt,_t,f),r.halfSize=z(gt,gt,h,c),m(gt,_t,c),z(gt,gt,h,f),x(mt,mt),y(mt,gt,mt);const u=t.getQuaternion(T);r.center=d(mt,mt,u)}}else{r.center=z(mt,o,P,(a+e)/2);const t=d(mt,P,G);b(t,t),r.halfSize=z(_t,h,t,(a-e)/2)}return r}function $(t,e,a,s,r){e.getCenter(ot),ot[2]+=r;const i=w(a);H(ot,t,0,ot,i,0),et(i,e,ot,a,s)}function tt(t,e,a,s,r){e.getCenter(ot),ot[2]+=r,et(t,e,ot,a,s)}function et(e,a,s,r,i){const n=a.getQuaternion(O),o=t(dt,n),h=a.getHalfSize(ct);for(let t=0;t<8;++t){for(let e=0;e<3;++e)nt[e]=h[e]*(t&1<<e?-1:1);for(let e=0;e<3;++e){let a=s[e];for(let t=0;t<3;++t)a+=nt[t]*o[3*t+e];rt[3*t+e]=a}}H(rt,e,0,rt,r,0,8),N(it,i)}function at(t,e,a,s,r=w(a),o=F(a,r)){t.getCorners(ut),t.getCenter(nt),nt[2]+=s,D(a,nt,ft,r),e.setCenter(ft[12],ft[13],ft[14]);const h=2*Math.sqrt(1+ft[0]+ft[5]+ft[10]);G[0]=(ft[6]-ft[9])/h,G[1]=(ft[8]-ft[2])/h,G[2]=(ft[1]-ft[4])/h,G[3]=.25*h;const f=t.getQuaternion(O);e.quaternion=n(G,G,f),i(G,G),c(_t,0,0,0);const u=e.getCenter(ht);for(const i of ut)i[2]+=s,o(i,0,i,0),p(mt,i,u),d(mt,mt,G),b(mt,mt),M(_t,_t,mt);e.halfSize=_t}function st(t,e,a,s,r=w(a)){const n=v(a),o=1+Math.max(0,s)/(n.radius+t.centerZ);t.getCenter(nt),nt[2]+=s,H(nt,a,0,nt,r,0),e.center=nt;const h=t.getQuaternion(O);e.quaternion=h,i(G,h),c(mt,0,0,1),d(mt,mt,G);const f=t.getHalfSize(ct);c(mt,f[0]*Math.abs(mt[0]),f[1]*Math.abs(mt[1]),f[2]*Math.abs(mt[2])),m(mt,mt,n.inverseFlattening),g(mt,f,mt),e.halfSize=m(mt,mt,o)}const rt=new Array(24),it=new X(rt,3),nt=A(),ot=A(),ht=A(),ct=A(),dt=a(),ft=s(),ut=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],lt=[A(),A(),A()],mt=A(),_t=A(),gt=A(),pt=q(-1,-1,-1);function bt(t){return Array.from(t)}const Mt=A(),jt=[0,0,0];export{Y as Obb,N as compute,L as computeOffsetObb,bt as ensurePackedObbData};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{unique as r}from"../../../core/arrayUtils.js";import{EventEmitter as t}from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as s,everyMap as i}from"../../../core/MapUtils.js";import{disposeMaybe as n}from"../../../core/maybe.js";import a from"../../../core/PooledArray.js";import{watch as o,syncAndInitial as h,on as d,initial as l}from"../../../core/reactiveUtils.js";import{someSet as c}from"../../../core/SetUtils.js";import{property as u,subclass as p}from"../../../core/accessorSupport/decorators.js";import{ortho as _,fromTranslation as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{debugFlags as f}from"../support/debugFlags.js";import{Overlay as R}from"./Overlay.js";import{OverlayRenderTargets as v}from"./OverlayRenderTargets.js";import w from"../webgl/RenderCamera.js";import{SyncRenderPlugin as x}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as T,renderHighlightBuffer as b}from"../webgl-engine/effects/highlight/Highlight.js";import{GLMaterialRepository as S}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as O}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderContext as D,defaultRenderOccludedMask as C}from"../webgl-engine/lib/RenderContext.js";import{ShadowMap as P}from"../webgl-engine/lib/ShadowMap.js";import{T as j}from"../../../chunks/Texture.glsl.js";import{TextureTechnique as E}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as M}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{AmbientLight as F}from"../webgl-engine/lighting/Lightsources.js";import{O as W}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as V}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as q,noBudget as A}from"../../support/Scheduler.js";import G from"../../webgl/Texture.js";import{TextureDescriptor as k}from"../../webgl/TextureDescriptor.js";let I=class extends x{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new W,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new a,this._passParameters=new j,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new w,this.events=new t,this.longitudeCyclical=null,this.produces=new Map([[19,e=>10!==e||this.hasHighlights],[20,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;const{state:r,stage:s}=e.parent.view,i=s.renderer.fboCache,n=s.renderView.renderingContext,o=s.renderView.techniques;this._renderContext=new D(n,new P(i,r.viewingMode),o)}initialize(){const e=this._view,r=e.stage.renderView.waterTextures;this.addHandles([o(()=>r.updating,()=>this.events.emit("content-changed"),h),o(()=>this._spatialReference,e=>this._localOriginFactory=new O(e),h),d(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),o(()=>T(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,l),o(()=>e.state.highlights,r=>{this._bindParameters.highlights=r,this._bindParameters.highlightOrderMap=e.state.highlightOrderMap},l),e.resourceController.scheduler.registerTask(q.OVERLAY_RENDERER,this)]);const t=this._camera;t.near=1,t.far=1e4,t.relativeElevation=null,this._bindParameters.slot=19,this._bindParameters.camera=t,this._bindParameters.updateLighting(new F(y()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=n(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const r=new S(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:r},this._techniques.precompile(V)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||s(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const r of this._renderers.values()){const t=r.getMaterialRenderer(e);if(t)return t}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),r(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,r){const t=this._renderers.get(e);null!=t&&t.destroy(),this._renderers.set(e,r),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(o(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&c(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=c(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=c(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=c(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new v(this._stage.renderer.fboCache),this._overlays=[new R,new R]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){const r=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(r?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(e,()=>!0)}_onMaterialOrContentChanged(){this.renderOccludedFlags=s(this._renderers,e=>e.hasOccluders)?L:1}_processDrapeSources(e,r){let t=!1;for(const[s,i]of this._renderers){if(e.done)break;(s.destroyed||r(s))&&(i.commitChanges()&&(t=!0,e.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,t=!0,this._updateSortedDrapeSourceRenderers(),e.madeProgress()),this.compact(e),t&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=s(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let r=!1;for(const t of this._renderers.values()){if(e.done)break;r=t.compact(e)||r}return r&&this.notifyChange("updating"),r}hasHighlight(e){return s(this._renderers,r=>r.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(A,e=>1===e.updatePolicy)}get isEmpty(){return!f.OVERLAY_DRAW_DEBUG_TEXTURE&&i(this._renderers,e=>e.isEmpty)}get hasWater(){const e=s(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const r=this._overlays[0];for(const i of this._overlays)i.setupGeometryViews(this.longitudeCyclical);if(!r.hasSomeSizedView())return!1;const t=this._setOutput(this._renderTargets?.targets.find(r=>r.content===e)?.output??0);++this._techniques.precompiling;const s=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(t),s}_setOutput(e){const r=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=4===e?20:19,r}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let r=!1;return this._renderers.forEach(t=>r=t.updateAnimation(e)||r),r&&this.parent.requestRender(0),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const r=this._bindParameters;r.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const t of this._renderTargets.targets){if(1===t.content&&!this._needsColorWithoutRasterImage)continue;const{output:e}=t;this._setOutput(e),10===e&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null);const s=this._renderContext.renderOccludedMask;4===t.content&&(this._renderContext.renderOccludedMask=L),this._sortedRenderers.forAll(({drapeSource:e,renderer:r})=>{1===t.content&&0===e.drapeSourceType||4===t.content&&r.hasOnlyOccluders||r.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=s,r.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,r){if(!this._overlays||!this._renderTargets)return;for(const s of this._overlays)s.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const t=this.allSourcesOccluders;for(const s of this._renderTargets.targets){if(!(0===s.content&&this._hasDrapedFlowSource)&&!s.handleRenderRequest(r)||1===s.content&&!this._needsColorWithoutRasterImage||4===s.content&&t)continue;const e=this._drawTarget(0,s),i=this._drawTarget(1,s);(e||i)&&s.fbo.generateMipMap()}}_drawTarget(e,r){const t=this._overlays[e],s=t.canvasGeometries;if(0===s.numViews)return!1;const i=this._view.state.contentPixelRatio;this._screenToWorldRatio=i*t.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:n,content:a}=r;if(this.isEmpty||4===n&&!this.hasWater||!t.hasSomeSizedView())return!1;const{_rctx:o,_camera:h,_renderContext:d,_bindParameters:l}=this;if(h.pixelRatio=t.pixelRatio*i,this._setOutput(n),l.screenToWorldRatio=this._screenToWorldRatio,l.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===a&&(d.renderOccludedMask=L),!this.renders(a))return d.renderOccludedMask=C,!1;const{resolution:c}=t,u=0===e,p=u?0:c;o.setViewport(p,0,c,c),this._bindTargetFBO(r),u&&(10===n?o.gl.clearBufferuiv(o.gl.COLOR,0,[0,0,0,0]):(o.setClearColor(0,0,0,0),o.clear(16384)));if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==a&&2!==a){this._techniques.precompile(E,z);const r=this._techniques.get(E,z);for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],t),this._ensureDebugPatternResources(t.resolution,B[e]),o.bindTechnique(r,l,this._passParameters),o.screen.draw()}if(10===n){const{fboCache:t}=this._stage.renderer,s=this._resolution;this._bindTargetFBO(r),b(o,t,s,s,l,()=>this._renderAllGeometry(e,r),p)}else this._renderAllGeometry(e,r);return o.bindFramebuffer(null),d.renderOccludedMask=C,!0}get allSourcesOccluders(){return i(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,r){const t=this._overlays[e],s=t.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:i,renderer:n})=>{if(1===r.content&&0===i.drapeSourceType)return;const{fullOpacity:a}=i,o=null!=a&&a<1&&0===r.output&&this._bindTemporaryFBO();for(let e=0;e<s.numViews;e++)this._setViewParameters(s.extents[e],t),n.render(this._renderContext);if(o){this._bindTargetFBO(r),this._overlayParameters.texture=o.getTexture(),this._overlayParameters.opacity=a,this._overlayParameters.overlayIndex=e;const t=this._techniques.get(V);this._rctx.bindTechnique(t,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),o.release()}})}_bindTargetFBO(e){const r=this._resolution,t=2*r;e.fbo.ensureFramebuffer(t,r),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,r=2*e,t=this._stage.renderer.fboCache,s=t.acquire(r,e,"overlay tmp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clear(16384),s}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,r,t,s){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(const{renderer:n}of this._sortedRenderers)i=n.intersect?.(e,r,t,s,i)??i}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),r=e.length;this._renderers.forEach((t,s)=>{const i=e.indexOf(s.layer?.uid),n=i>=0,a=s.renderGroup??(n?0:1),o=s.drapeSourcePriorityOffset??0,h=r*a+(n?i:0)+o;this._sortedRenderers.push(new U(s,t,h))}),this._sortedRenderers.sort((e,r)=>e.index-r.index)}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],_(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),g(t.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,r){if(m(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let n=0;n<e;n++)for(let r=0;r<e;r++){const i=Math.floor(r/10),a=Math.floor(n/10);i<2||a<2||10*i>e-20||10*a>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&a?1&r^1&n?0:255:1&i^1&a?0:128)}const i=new k(e);i.samplingMode=9728,this._passParameters.texture=new G(this._rctx,i,t)}get test(){}};e([u()],I.prototype,"hasHighlights",void 0),e([u()],I.prototype,"renderOccludedFlags",void 0),e([u()],I.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([u({constructOnly:!0})],I.prototype,"parent",void 0),e([u({readOnly:!0})],I.prototype,"_techniques",null),e([u({type:Boolean,readOnly:!0})],I.prototype,"updating",null),e([u()],I.prototype,"isEmpty",null),I=e([p("esri.views.3d.terrain.OverlayRenderer")],I);class U{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const B=[[1,.5,.5],[.5,.5,1]],H=-2,L=4,z=new M;z.hasAlpha=!0;export{I as OverlayRenderer,H as drapedZ,L as overlayRenderOccludedFlag};
|
|
2
|
+
import{__decorate as e}from"tslib";import{unique as r}from"../../../core/arrayUtils.js";import{EventEmitter as t}from"../../../core/Evented.js";import"../../../core/has.js";import{someMap as s,everyMap as i}from"../../../core/MapUtils.js";import{disposeMaybe as n}from"../../../core/maybe.js";import a from"../../../core/PooledArray.js";import{watch as o,syncAndInitial as h,on as d,initial as l}from"../../../core/reactiveUtils.js";import{someSet as c}from"../../../core/SetUtils.js";import{property as u,subclass as p}from"../../../core/accessorSupport/decorators.js";import{ortho as _,fromTranslation as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{set as m}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ones as y}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{debugFlags as f}from"../support/debugFlags.js";import{Overlay as R}from"./Overlay.js";import{OverlayRenderTargets as v}from"./OverlayRenderTargets.js";import w from"../webgl/RenderCamera.js";import{SyncRenderPlugin as x}from"../webgl-engine/effects/RenderPlugin.js";import{trackHighlightOptions as T,renderHighlightBuffer as b}from"../webgl-engine/effects/highlight/Highlight.js";import{GLMaterialRepository as S}from"../webgl-engine/lib/GLMaterialRepository.js";import{GridLocalOriginFactory as O}from"../webgl-engine/lib/GridLocalOriginFactory.js";import{RenderContext as D,defaultRenderOccludedMask as C}from"../webgl-engine/lib/RenderContext.js";import{ShadowMap as P}from"../webgl-engine/lib/ShadowMap.js";import{T as j}from"../../../chunks/Texture.glsl.js";import{TextureTechnique as E}from"../webgl-engine/lib/TextureTechnique.js";import{TextureTechniqueConfiguration as M}from"../webgl-engine/lib/TextureTechniqueConfiguration.js";import{AmbientLight as F}from"../webgl-engine/lighting/Lightsources.js";import{O as W}from"../../../chunks/OverlayCompositing.glsl.js";import{OverlayCompositingTechnique as V}from"../webgl-engine/shaders/OverlayCompositingTechnique.js";import{TaskPriority as q}from"../../support/Scheduler.js";import A from"../../webgl/Texture.js";import{TextureDescriptor as G}from"../../webgl/TextureDescriptor.js";let k=class extends x{constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new W,this.hasHighlights=!1,this.renderOccludedFlags=1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new a,this._passParameters=new j,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new w,this.events=new t,this.longitudeCyclical=null,this.produces=new Map([[19,e=>10!==e||this.hasHighlights],[20,()=>this._hasWater]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1,this._hasDrapedFlowSource=!1;const{state:r,stage:s}=e.parent.view,i=s.renderer.fboCache,n=s.renderView.renderingContext,o=s.renderView.techniques;this._renderContext=new D(n,new P(i,r.viewingMode),o)}initialize(){const e=this._view,r=e.stage.renderView.waterTextures;this.addHandles([o(()=>r.updating,()=>this.events.emit("content-changed"),h),o(()=>this._spatialReference,e=>this._localOriginFactory=new O(e),h),d(()=>e.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0),o(()=>T(e.state.highlights),()=>this._sortedDrapeSourceRenderersDirty=!0,l),o(()=>e.state.highlights,r=>{this._bindParameters.highlights=r,this._bindParameters.highlightOrderMap=e.state.highlightOrderMap},l),e.resourceController.scheduler.registerTask(q.OVERLAY_RENDERER,this)]);const t=this._camera;t.near=1,t.far=1e4,t.relativeElevation=null,this._bindParameters.slot=19,this._bindParameters.camera=t,this._bindParameters.updateLighting(new F(y()),0,0,0)}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._passParameters.texture=n(this._passParameters.texture),this.disposeOverlays(),this._renderContext.destroy(),this._sortedRenderers.prune()}get _bindParameters(){return this._renderContext.bind}get _rctx(){return this._stage.renderView.renderingContext}get _view(){return this.parent.view}get _stage(){return this.parent.view.stage}get _spatialReference(){return this.parent.spatialReference}get _techniques(){return this._stage.renderView.techniques}get rctx(){return this._rctx}get materials(){return this._pluginContext.materials}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}set time(e){this._renderContext.time=e}get pluginContext(){return this._pluginContext}initializeRenderContext(e){const r=new S(this._view.stage.renderView.textures,this._techniques,()=>{this._onMaterialOrContentChanged(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed"));this._pluginContext={...e,materials:r},this._techniques.precompile(V)}uninitializeRenderContext(){}acquireTechniques(){return[]}render(){}get updating(){return this._sortedDrapeSourceRenderersDirty||s(this._renderers,e=>e.updating||e.canCompact)}get hasOverlays(){return null!=this._overlays&&null!=this._renderTargets}getMaterialRenderer(e){for(const r of this._renderers.values()){const t=r.getMaterialRenderer(e);if(t)return t}return null}get layers(){return this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers(),r(this._sortedRenderers.map(e=>e.drapeSource.layer).filter(e=>!!e))}registerDrapeSource(e,r){const t=this._renderers.get(e);null!=t&&t.destroy(),this._renderers.set(e,r),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(o(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e)}removeDrapeSourceRenderer(e){if(null==e)return;const r=this._renderers.get(e);null!=r&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),r.destroy())}computeValidity(){return this._renderTargets?.computeValidity()??0}releaseRenderTargets(e){this._renderTargets?.dispose(e)}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&c(e,e=>1===e.drapeTargetType)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=c(e,e=>1===e.drapeSourceType),this._hasDrapedRasterSource=c(e,e=>0===e.drapeSourceType),this._hasDrapedFlowSource=c(e,e=>2===e.drapeSourceType)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=this._hasDrapedFlowSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,r,t=this._bindParameters.overlayStretch){null==this._overlays&&(this._renderTargets=new v(this._stage.renderer.fboCache),this._overlays=[new R,new R]),this.ensureDrapeTargets(e),this.ensureDrapeSources(r),this._bindParameters.overlayStretch=t}disposeOverlays(){this._overlays=null,this._renderTargets?.dispose(1),this._renderTargets=null,this.events.emit("textures-disposed")}_useOverlayColorInsteadOfColorNoRasterImage(e){return 1===e&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource}getTexture(e){const r=this._useOverlayColorInsteadOfColorNoRasterImage(e);return this._renderTargets?.getTexture(r?0:e)}get readyToRun(){return this.updating}runTask(e){this._processDrapeSources(()=>!0,e)}_onMaterialOrContentChanged(){this.renderOccludedFlags=s(this._renderers,e=>e.hasOccluders)?H:1}_processDrapeSources(e,r){let t=!1;for(const[s,i]of this._renderers){if(r?.done)break;(s.destroyed||e(s))&&(i.commitChanges()&&(t=!0,r?.madeProgress()))}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,t=!0,this._updateSortedDrapeSourceRenderers(),r?.madeProgress()),r&&this.compact(r),t&&(null!=this._overlays&&0===this._renderers.size&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this._onMaterialOrContentChanged(),this.hasHighlights=s(this._renderers,e=>e.hasHighlights),this.events.emit("content-changed"))}compact(e){let r=!1;for(const t of this._renderers.values()){if(e.done)break;r=t.compact(e)||r}return r&&this.notifyChange("updating"),r}hasHighlight(e){return s(this._renderers,r=>r.hasHighlight(e))}processSyncDrapeSources(){this._processDrapeSources(e=>1===e.updatePolicy)}get isEmpty(){return!f.OVERLAY_DRAW_DEBUG_TEXTURE&&i(this._renderers,e=>e.isEmpty)}get hasWater(){const e=s(this._renderers,({hasWater:e})=>e);return e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water")),this._hasWater}renders(e){if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==e&&2!==e)return!0;if(!this._overlays)return!1;const r=this._overlays[0];for(const i of this._overlays)i.setupGeometryViews(this.longitudeCyclical);if(!r.hasSomeSizedView())return!1;const t=this._setOutput(this._renderTargets?.targets.find(r=>r.content===e)?.output??0);++this._techniques.precompiling;const s=this._sortedRenderers.some(({renderer:e})=>e.precompile(this._renderContext));return--this._techniques.precompiling,this._setOutput(t),s}_setOutput(e){const r=this._bindParameters.output;return this._bindParameters.output=e,this._bindParameters.slot=4===e?20:19,r}get mode(){return this.isEmpty?0:this.hasWater&&this.renders(3)?2:this._renderTargets?.getTexture(0)?1:0}updateAnimation(e){let r=!1;return this._renderers.forEach(t=>r=t.updateAnimation(e)||r),r&&this.parent.requestRender(0),r}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}precompileShaders(e){if(!this._overlays||!this._renderTargets)return!1;const r=this._bindParameters;r.alignPixelEnabled=e.alignPixelEnabled,++this._techniques.precompiling;for(const t of this._renderTargets.targets){if(1===t.content&&!this._needsColorWithoutRasterImage)continue;const{output:e}=t;this._setOutput(e),10===e&&(r.highlightMixTexture=r.highlights.length>1?this._rctx.emptyTexture:null);const s=this._renderContext.renderOccludedMask;4===t.content&&(this._renderContext.renderOccludedMask=H),this._sortedRenderers.forAll(({drapeSource:e,renderer:r})=>{1===t.content&&0===e.drapeSourceType||4===t.content&&r.hasOnlyOccluders||r.precompile(this._renderContext)}),this._renderContext.renderOccludedMask=s,r.highlightMixTexture=null}return--this._techniques.precompiling,!0}drawOverlays(e,r){if(!this._overlays||!this._renderTargets)return;for(const s of this._overlays)s.setupGeometryViews(this.longitudeCyclical);this._bindParameters.alignPixelEnabled=e.alignPixelEnabled;const t=this.allSourcesOccluders;for(const s of this._renderTargets.targets){if(!(0===s.content&&this._hasDrapedFlowSource)&&!s.handleRenderRequest(r)||1===s.content&&!this._needsColorWithoutRasterImage||4===s.content&&t)continue;const e=this._drawTarget(0,s),i=this._drawTarget(1,s);(e||i)&&s.fbo.generateMipMap()}}_drawTarget(e,r){const t=this._overlays[e],s=t.canvasGeometries;if(0===s.numViews)return!1;const i=this._view.state.contentPixelRatio;this._screenToWorldRatio=i*t.mapUnitsPerPixel/this._bindParameters.overlayStretch;const{output:n,content:a}=r;if(this.isEmpty||4===n&&!this.hasWater||!t.hasSomeSizedView())return!1;const{_rctx:o,_camera:h,_renderContext:d,_bindParameters:l}=this;if(h.pixelRatio=t.pixelRatio*i,this._setOutput(n),l.screenToWorldRatio=this._screenToWorldRatio,l.screenToPCSRatio=this._screenToWorldRatio*this.parent.worldToPCSRatio,4===a&&(d.renderOccludedMask=H),!this.renders(a))return d.renderOccludedMask=C,!1;const{resolution:c}=t,u=0===e,p=u?0:c;o.setViewport(p,0,c,c),this._bindTargetFBO(r),u&&(10===n?o.gl.clearBufferuiv(o.gl.COLOR,0,[0,0,0,0]):(o.setClearColor(0,0,0,0),o.clear(16384)));if(f.OVERLAY_DRAW_DEBUG_TEXTURE&&4!==a&&2!==a){this._techniques.precompile(E,L);const r=this._techniques.get(E,L);for(let i=0;i<s.numViews;i++)this._setViewParameters(s.extents[i],t),this._ensureDebugPatternResources(t.resolution,U[e]),o.bindTechnique(r,l,this._passParameters),o.screen.draw()}if(10===n){const{fboCache:t}=this._stage.renderer,s=this._resolution;this._bindTargetFBO(r),b(o,t,s,s,l,()=>this._renderAllGeometry(e,r),p)}else this._renderAllGeometry(e,r);return o.bindFramebuffer(null),d.renderOccludedMask=C,!0}get allSourcesOccluders(){return i(this._renderers,e=>e.hasOnlyOccluders)}_renderAllGeometry(e,r){const t=this._overlays[e],s=t.canvasGeometries;this._sortedRenderers.forAll(({drapeSource:i,renderer:n})=>{if(1===r.content&&0===i.drapeSourceType)return;const{fullOpacity:a}=i,o=null!=a&&a<1&&0===r.output&&this._bindTemporaryFBO();for(let e=0;e<s.numViews;e++)this._setViewParameters(s.extents[e],t),n.render(this._renderContext);if(o){this._bindTargetFBO(r),this._overlayParameters.texture=o.getTexture(),this._overlayParameters.opacity=a,this._overlayParameters.overlayIndex=e;const t=this._techniques.get(V);this._rctx.bindTechnique(t,this._bindParameters,this._overlayParameters),this._rctx.screen.draw(),o.release()}})}_bindTargetFBO(e){const r=this._resolution,t=2*r;e.fbo.ensureFramebuffer(t,r),e.fbo.bind(this._rctx)}_bindTemporaryFBO(){const e=this._resolution,r=2*e,t=this._stage.renderer.fboCache,s=t.acquire(r,e,"overlay tmp");return t.rctx.bindFramebuffer(s.fbo),t.rctx.clear(16384),s}get _resolution(){return this._overlays?.[0].resolution??0}notifyContentChanged(){this.events.emit("content-changed")}intersect(e,r,t,s){this._sortedDrapeSourceRenderersDirty&&this._updateSortedDrapeSourceRenderers();let i=0;for(const{renderer:n}of this._sortedRenderers)i=n.intersect?.(e,r,t,s,i)??i}_updateSortedDrapeSourceRenderers(){if(this._sortedRenderers.clear(),0===this._renderers.size)return;const e=this._view.map.allLayers.map(e=>e.uid),r=e.length;this._renderers.forEach((t,s)=>{const i=e.indexOf(s.layer?.uid),n=i>=0,a=s.renderGroup??(n?0:1),o=s.drapeSourcePriorityOffset??0,h=r*a+(n?i:0)+o;this._sortedRenderers.push(new I(s,t,h))}),this._sortedRenderers.sort((e,r)=>e.index-r.index)}_setViewParameters(e,r){const t=this._camera;t.viewport=[0,0,r.resolution,r.resolution],_(t.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],t.near,t.far),g(t.viewMatrix,[-e[0],-e[1],0])}_ensureDebugPatternResources(e,r){if(m(this._passParameters.color,r[0],r[1],r[2]),this._passParameters.texture)return;const t=new Uint8Array(e*e*4);let s=0;for(let n=0;n<e;n++)for(let r=0;r<e;r++){const i=Math.floor(r/10),a=Math.floor(n/10);i<2||a<2||10*i>e-20||10*a>e-20?(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=255):(t[s++]=255,t[s++]=255,t[s++]=255,t[s++]=1&i&&1&a?1&r^1&n?0:255:1&i^1&a?0:128)}const i=new G(e);i.samplingMode=9728,this._passParameters.texture=new A(this._rctx,i,t)}get test(){}};e([u()],k.prototype,"hasHighlights",void 0),e([u()],k.prototype,"renderOccludedFlags",void 0),e([u()],k.prototype,"_sortedDrapeSourceRenderersDirty",void 0),e([u({constructOnly:!0})],k.prototype,"parent",void 0),e([u({readOnly:!0})],k.prototype,"_techniques",null),e([u({type:Boolean,readOnly:!0})],k.prototype,"updating",null),e([u()],k.prototype,"isEmpty",null),k=e([p("esri.views.3d.terrain.OverlayRenderer")],k);class I{constructor(e,r,t){this.drapeSource=e,this.renderer=r,this.index=t}}const U=[[1,.5,.5],[.5,.5,1]],B=-2,H=4,L=new M;L.hasAlpha=!0;export{k as OverlayRenderer,B as drapedZ,H as overlayRenderOccludedFlag};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{MemCachePool as i}from"../../../core/MemCachePool.js";import r from"../../../core/ObjectPool.js";import{watch as s,sync as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../core/accessorSupport/decorators.js";import{subtract as o,set as c,dot as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as h,fromValues as u,create as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as g,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as p,set as m}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as y}from"../../../geometry/support/buffer/BufferView.js";import{overlayRenderOccludedFlag as b}from"./OverlayRenderer.js";import{PatchRenderData as x}from"./PatchRenderData.js";import{TerrainAttributesCache as T}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as R}from"./terrainUtils.js";import{TileRenderer as v}from"./TileRenderer.js";import{IteratorPreorder as O,fallsWithinLayerView as P,sortTiles as w,compareTiles as D}from"./tileUtils.js";import{getOverlayContentForOutputTerrain as S}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as B}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as E}from"../webgl-engine/lib/Attribute.js";import{IntersectorResult as F}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as j,MeshIntersectionOptions as q,intersectTriangles as C}from"../webgl-engine/lib/RayIntersections.js";import{TriangleIntersectionData as A}from"../webgl-engine/lib/TriangleIntersectionData.js";import{terrainId as M,getVerticalOffsetTerrain as G}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as U}from"../webgl-engine/materials/DrawParameters.js";import{T as k}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as I}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as N}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as L}from"../../webgl/enums.js";const V=7,z=10,H=200,Q=p();let W=class extends B{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return 1===this._stage.viewingMode}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,s,n,a){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=s,this._compressionTracker=n,this.type=7,this.isGround=!0,this._passParameters=new k,this._drawParameters=new U,this._renderDataPool=new r(()=>new x),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new O,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>1===this._desiredSlot],[6,()=>6===this._desiredSlot],[8,()=>8===this._desiredSlot],[10,()=>this._produces()&&this.renderOccludedFlags===b]]),this._tileSize=256,this._configuration=new N(1===t.viewingMode),this._tileTextureCache=new i((e,t)=>a.newCache(e,t),"TileTexture"),this.tileGeometryCache=new T(a)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(s(()=>this._overlayRenderer.renderOccludedFlags,()=>this.setNeedsRender(),n))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}get _oitEnabled(){return this._stage.renderer.oitEnabled}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get layerViewUid(){return M}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,32)}reuseTextureFromParent(e){const{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;const i=g(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;const{layerInfo:i,surface:r}=t;for(let s=0;s<i[1].length;s++){const i=r.layerViewByIndex(s,1);if(P(e,i)!==P(t,i))return!1}return!0}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,32===t?0:2),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[0])i.pendingUpdates&=-9;e.resetPendingUpdate(8);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=z-V,i=Math.max(0,Math.floor((e.level-t)/V)*V);if(this._isGlobal&&0===i)return h;for(;e.parent&&e.level>i;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new v(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=t(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&0!==this.transparency)return;const s=Z,n=J;o(s,r,i),c(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,l=e.results.max,h=e.results.ground,u=0===e.options.store,_=!!e.results.ground.target,g=G(e.verticalOffset),f=e.tolerance;let p,b=u&&null!=a.distance?a.distance:1/0;const x=e.options,T=x.normalRequired||!x.backfacesTerrain,R=new q(f,!1,T),v=c=>{const _=c.renderData;if(!_?.vao)return;const v=_.geometry;m(Q,v.boundingBox);const O=_.localOrigin;null!=g&&(g.localOrigin=O,g.applyToAabb(Q));const P=Q;if(K[0]=i[0]-O[0],K[1]=i[1]-O[1],K[2]=i[2]-O[2],!j(P,K,n,f,b))return;const w=(e,t,i)=>{e.set(this.type,c,t,i),b=u&&null!=a.distance?a.distance:1/0},D=(n,o,c)=>{if((!T||null!=c)&&n>=0&&(x.backfacesTerrain||d(c,s)<0)&&(x.invisibleTerrain||!x.selectionMode||null==t||t(i,r,n))){if((null==h.distance||n<h.distance)&&w(h,n,c),x.isFiltered)return;2===x.store&&(null==p?(p=new F(e.ray),w(p,n,c),e.results.all.push(p)):n<p.distance&&w(p,n,c)),(null==a.distance||n<a.distance)&&w(a,n,c),0!==x.store&&(null==l.distance||n>l.distance)&&w(l,n,c)}},S=X;o(S,r,O);const{indices:B,indexCount:q}=v,M=v.vertexAttributes,G=M.getField("position",y),U=new E(G.typedBuffer,3,M.stride/4),k=q/3;if(!g&&k>H){const e=c.renderData;e.intersectionData??=new A(B,k,U),e.intersectionData.intersectRay(K,S,R,D)}else C(K,S,0,k,B,U,g,R,D)},O=this._rootTiles;if(null!=O){(()=>{const t=this._tileIterator;t.reset(O);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==g&&!e.intersectsRay(i,s,f,b)||_&&this._useStencilForTile(e)?t.skipSubtree():v(e)})()}}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return this._oitEnabled?8:6;case 3:case 4:return null}}acquireTechniques(e){const{shadowMap:t,viewshedEnabled:i,cutFillEnabled:r,slot:s,hasEmission:n,hasFloatOit:a}=e.bind,l=!!has("enable-feature:terrain-shadows")&&t.enabled;if(l!==this._castShadows&&(this._castShadows=l,this._patchesByOriginDirty=!0),this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),3===this.transparency)return null;if(10===s){if(0===(e.renderOccludedMask&b))return null}else if(s!==this._desiredSlot)return null;const o=this._configuration;switch(o.screenSpaceReflections=o.cloudReflections=o.receiveShadows=o.receiveAmbientOcclusion=o.renderOccluded=o.hasHighlightMixTexture=o.hasEmission=!1,o.overlayMode=this._overlayRenderer.mode,o.hasFloatOit=a.value,e.output){case 0:case 1:case 2:{const{ssr:i,clouds:r,ssao:a}=e.bind;o.screenSpaceReflections=null!=i.lastFrameColor,o.cloudReflections=null!=r.data;const l=10===s;return o.receiveShadows=t.ready&&!l,o.renderOccluded=l,o.receiveAmbientOcclusion=!l&&null!=a,o.hasEmission=n,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:return this._acquireTechnique(e.output);case 11:return this._acquireTechnique(11);case 10:return o.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,this._passParameters.overlayContent=S(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const t=this._tileRenderer;let i;if(null!=e){const t=e.toUnitRGBA();i=u(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(i),this._allTiles.forAll(e=>t.updateTileTexture(e,0)),this._configuration.tileBlendInput=t.backgroundIsGrid?2:null!=t.backgroundColor?1:0,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)w(i,t);e.sort((e,t)=>D(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange("visibleTiles"),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i){const{rctx:r,bind:s}=e;r.bindTechnique(t,s,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;i.forEach(i=>{this._drawParameters.origin=i[0].renderData.localOrigin,t.program.bindDraw(s,this._passParameters,this._drawParameters);for(let r=0;r<i.length;r++)this._renderPatch(e,t,i[r],L.TRIANGLES,n,null===this._passParameters.overlayContent)}),r.bindVAO(null)}_renderMaterialPass(e,t){const{rctx:i,bind:r}=e,s=i.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const n=10===r.slot;n&&(s.bindTexture("tex",i.emptyTexture),s.setUniform3fv("textureOpacities",h),s.setUniform4fv("texOffsetAndScale",f));const a=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:h;1===this._configuration.tileBlendInput&&s.setUniform3fv("backgroundColor",a);const l=this._stencilEnabledLayerExtents.length>0,o=this.wireframe?L.LINES:L.TRIANGLES;this._configuration.textureFadingEnabled&&s.bindTexture("texNext",i.emptyTexture);const c=this._visiblePatchesByOrigin;for(const d of c.values()){const i=d[0].renderData.localOrigin;this._drawParameters.origin=i,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const r of d){const i=r.renderData,a=i.textureReference;if(null!=a){if(!n){s.setUniform4fv("texOffsetAndScale",a.offsetAndScale),s.bindTexture("tex",a.texture.texture);const e=i.textureFadeFactor,t=e<1?i.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(s.setUniform1f("fadeFactor",e),s.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),s.setUniform3fv("nextTexOpacities",t.opacities),s.bindTexture("texNext",t.texture.texture)):s.setUniform1f("fadeFactor",1),i.textureIsFading&&this.setNeedsRender(2),s.setUniform3fv("textureOpacities",a.opacities)}this._renderPatch(e,t,r,o,l),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}i.bindVAO(null)}_renderPatch(e,t,i,r,s,n=!1){const a=i.renderData,l=a.vao,o=l?.indexBuffer;if(!l||null==o)return void(R&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay);const{rctx:d,bind:h}=e;s&&(t.useStencil=this._useStencilForTile(i),d.setPipelineState(t.getPipeline(h)));const u=a.geometry.indexCount;d.bindVAO(l),c.assertCompatibleVertexAttributeLocations(l),d.drawElements(r,u,o.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(I,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([a({readOnly:!0})],W.prototype,"visibleTiles",null),e([a({readOnly:!0})],W.prototype,"_isGlobal",null),e([a()],W.prototype,"renderOccludedFlags",null),e([a({value:!1})],W.prototype,"renderingDisabled",null),e([a({value:!0})],W.prototype,"visible",null),e([a()],W.prototype,"renderPatchBorders",null),e([a()],W.prototype,"wireframe",null),W=e([l("esri.views.3d.terrain.TerrainRenderer")],W);const Z=_(),J=_(),K=_(),X=_();export{W as TerrainRenderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{MemCachePool as i}from"../../../core/MemCachePool.js";import r from"../../../core/ObjectPool.js";import{watch as s,sync as n}from"../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../core/accessorSupport/decorators.js";import{subtract as o,set as c,dot as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as h,fromValues as u,create as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as g,ZEROS as f}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as p,set as m}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as y}from"../../../geometry/support/buffer/BufferView.js";import{overlayRenderOccludedFlag as b}from"./OverlayRenderer.js";import{PatchRenderData as x}from"./PatchRenderData.js";import{TerrainAttributesCache as T}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as R}from"./terrainUtils.js";import{TileRenderer as v}from"./TileRenderer.js";import{IteratorPreorder as P,fallsWithinLayerView as O,sortTiles as w,compareTiles as D}from"./tileUtils.js";import{getOverlayContentForOutputTerrain as S}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as B}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as E}from"../webgl-engine/lib/Attribute.js";import{IntersectorResult as F}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as j,MeshIntersectionOptions as q,intersectTriangles as C}from"../webgl-engine/lib/RayIntersections.js";import{TriangleIntersectionData as A}from"../webgl-engine/lib/TriangleIntersectionData.js";import{terrainId as M,getVerticalOffsetTerrain as G}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as U}from"../webgl-engine/materials/DrawParameters.js";import{T as k}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as I}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as N}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as L}from"../../webgl/enums.js";const V=7,z=10,H=200,Q=p();let W=class extends B{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return 1===this._stage.viewingMode}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,s,n,a){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=s,this._compressionTracker=n,this.type=7,this.isGround=!0,this._passParameters=new k,this._drawParameters=new U,this._renderDataPool=new r(()=>new x),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new P,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=new Array,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>1===this._desiredSlot],[6,()=>6===this._desiredSlot],[8,()=>8===this._desiredSlot],[10,()=>this._produces()&&this.renderOccludedFlags===b]]),this._tileSize=256,this._configuration=new N(1===t.viewingMode),this._tileTextureCache=new i((e,t)=>a.newCache(e,t),"TileTexture"),this.tileGeometryCache=new T(a)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(s(()=>this._overlayRenderer.renderOccludedFlags,()=>this.setNeedsRender(),n))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}get _oitEnabled(){return this._stage.renderer.oitEnabled}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get layerViewUid(){return M}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,null!=this._tileRenderer&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),this.reuseTextureFromParent(e)||this.updateTileTexture(e,32)}reuseTextureFromParent(e){const{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;const i=g(1&e.lij[2]?.5:0,1&e.lij[1]?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,i)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;const{layerInfo:i,surface:r}=t;for(let s=0;s<i[1].length;s++){const i=r.layerViewByIndex(s,1);if(O(e,i)!==O(t,i))return!1}return!0}updateTileTexture(e,t){null!=this._tileRenderer&&(this._tileRenderer.updateTileTexture(e,32===t?0:2),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(const i of e.layerInfo[0])i.pendingUpdates&=-9;e.resetPendingUpdate(8);const t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const t=z-V,i=Math.max(0,Math.floor((e.level-t)/V)*V);if(this._isGlobal&&0===i)return h;for(;e.parent&&e.level>i;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new v(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=t(this._tileRenderer)}intersect(e,t,i,r){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&0!==this.transparency)return;const s=Z,n=J;o(s,r,i),c(n,1/s[0],1/s[1],1/s[2]);const a=e.results.min,l=e.results.max,h=e.results.ground,u=0===e.options.store,_=!!e.results.ground.target,g=G(e.verticalOffset),f=e.tolerance;let p,b=u&&null!=a.distance?a.distance:1/0;const x=e.options,T=x.normalRequired||!x.backfacesTerrain,R=new q(f,!1,T),v=c=>{const _=c.renderData;if(!_?.vao)return;const v=_.geometry;m(Q,v.boundingBox);const P=_.localOrigin;null!=g&&(g.localOrigin=P,g.applyToAabb(Q));const O=Q;if(K[0]=i[0]-P[0],K[1]=i[1]-P[1],K[2]=i[2]-P[2],!j(O,K,n,f,b))return;const w=(e,t,i)=>{e.set(this.type,c,t,i),b=u&&null!=a.distance?a.distance:1/0},D=(n,o,c)=>{if((!T||null!=c)&&n>=0&&(x.backfacesTerrain||d(c,s)<0)&&(x.invisibleTerrain||!x.selectionMode||null==t||t(i,r,n))){if((null==h.distance||n<h.distance)&&w(h,n,c),x.isFiltered)return;2===x.store&&(null==p?(p=new F(e.ray),w(p,n,c),e.results.all.push(p)):n<p.distance&&w(p,n,c)),(null==a.distance||n<a.distance)&&w(a,n,c),0!==x.store&&(null==l.distance||n>l.distance)&&w(l,n,c)}},S=X;o(S,r,P);const{indices:B,indexCount:q}=v,M=v.vertexAttributes,G=M.getField("position",y),U=new E(G.typedBuffer,3,M.stride/4),k=q/3;if(!g&&k>H){const e=c.renderData;e.intersectionData??=new A(B,k,U),e.intersectionData.intersectRay(K,S,R,D)}else C(K,S,0,k,B,U,g,R,D)},P=this._rootTiles;if(null!=P){(()=>{const t=this._tileIterator;t.reset(P);const r=e.options.invisibleTerrain;for(let e=t.next();e;e=t.next())!(e.visible||r&&e.intersectsClippingArea)||null==g&&!e.intersectsRay(i,s,f,b)||_&&this._useStencilForTile(e)?t.skipSubtree():v(e)})()}}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(const t of this._visiblePatchesByOrigin.values())for(const i of t)null!=i.renderData?.textureReference&&e.queriesForTile(i);e.process(),t.madeProgress()}}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return this._oitEnabled?8:6;case 3:case 4:return null}}acquireTechniques(e){const{shadowMap:t,viewshedEnabled:i,cutFillEnabled:r,slot:s,hasEmission:n,useFloatBlend:a}=e.bind,l=!!has("enable-feature:terrain-shadows")&&t.enabled;if(l!==this._castShadows&&(this._castShadows=l,this._patchesByOriginDirty=!0),this._inViewshed!==i&&(this._inViewshed=i,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),3===this.transparency)return null;if(10===s){if(0===(e.renderOccludedMask&b))return null}else if(s!==this._desiredSlot)return null;const o=this._configuration;switch(o.screenSpaceReflections=o.cloudReflections=o.receiveShadows=o.receiveAmbientOcclusion=o.renderOccluded=o.hasHighlightMixTexture=o.hasEmission=!1,o.overlayMode=this._overlayRenderer.mode,o.useFloatBlend=a.value,e.output){case 0:case 1:case 2:{const{ssr:i,clouds:r,ssao:a}=e.bind;o.screenSpaceReflections=null!=i.lastFrameColor,o.cloudReflections=null!=r.data;const l=10===s;return o.receiveShadows=t.ready&&!l,o.renderOccluded=l,o.receiveAmbientOcclusion=!l&&null!=a,o.hasEmission=n,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:return this._acquireTechnique(e.output);case 11:return this._acquireTechnique(11);case 10:return o.hasHighlightMixTexture=null!=e.bind.highlightMixTexture,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),t.useStencil=!1,this._passParameters.overlayContent=S(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{const i=e.bind.highlight?.name;i&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(i)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(null==this._tileRenderer)return;const t=this._tileRenderer;let i;if(null!=e){const t=e.toUnitRGBA();i=u(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(i),this._allTiles.forAll(e=>t.updateTileTexture(e,0)),this._configuration.tileBlendInput=t.backgroundIsGrid?2:null!=t.backgroundColor?1:0,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){const e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(const i of e)w(i,t);e.sort((e,t)=>D(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange("visibleTiles"),this._patchSortingDirty=!1}}_rebuildPatchGroups(){const e=this._rootTiles;if(null!=e){e[0]?.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){const t=this._tileIterator;for(t.resetOne(e);!t.done;){const e=t.next(),i=e.renderData;if(!i){this._numTilesCulled++;continue}const r=i.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let s=this._visiblePatchesByOrigin.get(r);s||(s=[],this._visiblePatchesByOrigin.set(r,s)),s.push(e),t.skipSubtree()}}_useStencilForTile(e){for(const t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,i){const{rctx:r,bind:s}=e;r.bindTechnique(t,s,this._passParameters);const n=this._stencilEnabledLayerExtents.length>0;i.forEach(i=>{this._drawParameters.origin=i[0].renderData.localOrigin,t.program.bindDraw(s,this._passParameters,this._drawParameters);for(let r=0;r<i.length;r++)this._renderPatch(e,t,i[r],L.TRIANGLES,n,null===this._passParameters.overlayContent)}),r.bindVAO(null)}_renderMaterialPass(e,t){const{rctx:i,bind:r}=e,s=i.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;const n=10===r.slot;n&&(s.bindTexture("tex",i.emptyTexture),s.setUniform3fv("textureOpacities",h),s.setUniform4fv("texOffsetAndScale",f));const a=null!=this._tileRenderer?.backgroundColor?this._tileRenderer.backgroundColor:h;1===this._configuration.tileBlendInput&&s.setUniform3fv("backgroundColor",a);const l=this._stencilEnabledLayerExtents.length>0,o=this.wireframe?L.LINES:L.TRIANGLES;this._configuration.textureFadingEnabled&&s.bindTexture("texNext",i.emptyTexture);const c=this._visiblePatchesByOrigin;for(const d of c.values()){const i=d[0].renderData.localOrigin;this._drawParameters.origin=i,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(const r of d){const i=r.renderData,a=i.textureReference;if(null!=a){if(!n){s.setUniform4fv("texOffsetAndScale",a.offsetAndScale),s.bindTexture("tex",a.texture.texture);const e=i.textureFadeFactor,t=e<1?i.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(s.setUniform1f("fadeFactor",e),s.setUniform4fv("nextTexOffsetAndScale",t.offsetAndScale),s.setUniform3fv("nextTexOpacities",t.opacities),s.bindTexture("texNext",t.texture.texture)):s.setUniform1f("fadeFactor",1),i.textureIsFading&&this.setNeedsRender(2),s.setUniform3fv("textureOpacities",a.opacities)}this._renderPatch(e,t,r,o,l),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}i.bindVAO(null)}_renderPatch(e,t,i,r,s,n=!1){const a=i.renderData,l=a.vao,o=l?.indexBuffer;if(!l||null==o)return void(R&&console.error("Rendered tile with no indices: ",i.lij," : ",a));const c=t.program;n||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(c,a.overlay);const{rctx:d,bind:h}=e;s&&(t.useStencil=this._useStencilForTile(i),d.setPipelineState(t.getPipeline(h)));const u=a.geometry.indexCount;d.bindVAO(l),c.assertCompatibleVertexAttributeLocations(l),d.drawElements(r,u,o.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv("overlayTexOffset",t.offsets),e.setUniform4fv("overlayTexScale",t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(I,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([a({readOnly:!0})],W.prototype,"visibleTiles",null),e([a({readOnly:!0})],W.prototype,"_isGlobal",null),e([a()],W.prototype,"renderOccludedFlags",null),e([a({value:!1})],W.prototype,"renderingDisabled",null),e([a({value:!0})],W.prototype,"visible",null),e([a()],W.prototype,"renderPatchBorders",null),e([a()],W.prototype,"wireframe",null),W=e([l("esri.views.3d.terrain.TerrainRenderer")],W);const Z=_(),J=_(),K=_(),X=_();export{W as TerrainRenderer};
|
|
@@ -83,6 +83,7 @@ export default abstract class ManagedFBO extends ManagedFBOResource {
|
|
|
83
83
|
*
|
|
84
84
|
* If more than one reference exists this will not have an effect.
|
|
85
85
|
*
|
|
86
|
+
* @returns true if the resource was released for reuse, i.e., the reference count reached zero.
|
|
86
87
|
* @since 5.0
|
|
87
88
|
*/
|
|
88
89
|
release(): boolean;
|
|
@@ -7,6 +7,7 @@ export default abstract class ManagedFBOResource extends Accessor {
|
|
|
7
7
|
*
|
|
8
8
|
* If more than one reference exists this will not have an effect.
|
|
9
9
|
*
|
|
10
|
+
* @returns true if the resource was released for reuse, i.e., the reference count reached zero.
|
|
10
11
|
* @since 5.0
|
|
11
12
|
*/
|
|
12
13
|
release(): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import i from"../../../../../core/Logger.js";import n from"../../../../../core/PooledArray.js";import{watch as o,sync as s}from"../../../../../core/reactiveUtils.js";import{isTypedArray as r}from"../../../../../core/typedArrayUtil.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{clone as l}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as m}from"../../../../../geometry/support/Indices.js";import{c as h}from"../../../../../chunks/vec3.js";import{c as p}from"../../../../../chunks/vec32.js";import{ComponentData as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import i from"../../../../../core/Logger.js";import n from"../../../../../core/PooledArray.js";import{watch as o,sync as s}from"../../../../../core/reactiveUtils.js";import{isTypedArray as r}from"../../../../../core/typedArrayUtil.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{clone as l}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as m}from"../../../../../geometry/support/Indices.js";import{c as h}from"../../../../../chunks/vec3.js";import{c as p}from"../../../../../chunks/vec32.js";import{ComponentData as d}from"./ComponentData.js";import{defaultComponentParameters as g,ComponentDrawParametersImplementation as f}from"./ComponentDrawParameters.js";import{ComponentObject as u}from"./ComponentObject.js";import{IntersectionGeometry as b}from"./IntersectionGeometry.js";import{RenderableMeta as v,Renderable as _}from"./Renderable.js";import{RenderGeometry as y}from"./RenderGeometry.js";import{RenderSubmitSystem as j}from"./RenderSubmitSystem.js";import{ComponentMaterialRepository as C}from"./Material/ComponentMaterialRepository.js";import{VertexArrayObject as w}from"../../lib/VertexArrayObject.js";import{getVerticalOffsetI3S as M}from"../../lib/verticalOffsetUtils.js";import{BufferManager as R}from"../../lib/TextureBackedBuffer/BufferManager.js";import{getComponentDataLayout as O,IndexGlLayout as x}from"../../materials/DefaultLayouts.js";import{BufferObject as A}from"../../../../webgl/BufferObject.js";import{PrimitiveType as D}from"../../../../webgl/enums.js";import{SamplerRepository as E}from"../../../../webgl/Sampler.js";import{VertexBuffer as B}from"../../../../webgl/VertexBuffer.js";const H=()=>i.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");let V=class extends t{constructor(e,t,i){super({}),this._renderPassManager=e,this._viewingMode=t,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._activeHighlightOptions=new Map,this._visible=new n,this._hidden=new n,this._renderSubmit=new j(this),this._renderPassManager.register(this._renderSubmit);const{rctx:r,bind:a}=e;this._componentBufferManager=new R(r,O());const l=2===this._viewingMode?0:i?1:2;this.materials=new C(a,l),this.samplers=new E(r.gl),this.addHandles(o(()=>a.useFloatBlend.value,()=>{this._visible.forAll(e=>e.updateMaterial(this.materials.globals)),this._hidden.forAll(e=>e.updateMaterial(this.materials.globals)),this._requestRender()},s))}destroy(){this._componentBufferManager.destroy(),this._componentBufferManager=null,this._visible.forAll(e=>e.destroy()),this._visible.prune(),this._hidden.forAll(e=>e.destroy()),this._hidden.prune(),this._renderSubmit.destroy(),this.samplers.dispose(),this.materials.destroy()}createObject(e,t){const{geometry:i}=e,n=new d(this._componentBufferManager,m(i.componentOffsets)),o=this._createRenderable(e,t,n),s=new b(this._viewingMode,i.positions,n,e.elevationAlignable),r=new u(this,e.transform,e.obb.clone(),n,o,s);return(r.visible?this._visible:this._hidden).push(r),r}destroyObject(e){const t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._requestRender()}setObjectVisibility(e,t){const i=e;t!==i.visible&&(t?(this._hidden.removeUnordered(i),this._visible.push(i)):(this._visible.removeUnordered(i),this._hidden.push(i)),i.visible=t,this._requestRender())}preSubmit(e){const{camera:t}=e;this._componentBufferManager.updateTextures(),this.visibleObjects.forAll(e=>e.updateCameraDerivedParameters(t))}getObjectOpacity(e){return e.renderable.drawParameters.opacity}updateObjectOpacity(e,t){const i=e;i.opacity!==t&&(i.updateOpacity(t),this._requestRender())}isSliceplaneEnabled(e){return e.renderable.material.slicePlaneEnabled}setAllComponentVisibilities(e,t){const i=e;i.componentData.visibility.reset(t),i.componentData.markVisibilityDirty(),this._requestRender()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){const t=e,{componentData:i}=t,n=i.visibility.componentCount;return{visible:n,invisible:i.count-n}}setComponentData(e,t){e.setComponentData(t,this._viewingMode),this._elevationRangeCacheVerticalOffset=NaN,this._requestRender()}getComponentAabb(e,t,i,n=!1){e.intersectionGeometry.getComponentAabb(t,i);const o=e,s=o.componentData.verticalOffsets;if(n||null==s)return i;const r=s[t];if(2===this._viewingMode||0===r)return i[2]+=r,i[5]+=r,i;const a=M(r);return a.localOrigin=o.transform.position,a.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,i){return e.intersectionGeometry.getComponentPositions(t,i)}expandRangeWithComponentObjectElevationRange(e,t,i,n){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==t||n.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);const o=e,{componentData:s}=o,r=s.count,{verticalOffsets:a}=s,{intersectionGeometry:l}=o,c=2===this._viewingMode,m=l.getComponentAabbs(),h=I;let p=1/0,d=-1/0;for(let g=0;g<r;g++){const e=6*g,s=a?.[g]??0;let r=1/0,l=-1/0;if(c)r=m[e+2]+s+t,l=m[e+5]+s+t;else{if(h[0]=m[e],h[1]=m[e+1],h[2]=m[e+2],h[3]=m[e+3],h[4]=m[e+4],h[5]=m[e+5],0!==s){const e=M(s);e.localOrigin=o.transform.position,e.applyToAabb(h)}const r=Math.max(Math.abs(h[3]),Math.abs(h[0])),a=Math.max(Math.abs(h[4]),Math.abs(h[1])),l=t+h[5]+i;n.expandElevationRangeValues(t+h[2],Math.sqrt(r*r+a*a+l*l)-i)}n.expandElevationRangeValues(r,l),p=Math.min(p,r),d=Math.max(d,l)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=p,this._elevationRangeCacheMax=d}intersect(e,t,i,n,o,s){const r=e,{transform:a,componentData:l,intersectionGeometry:c}=r;return null!=n&&(n.localOrigin=a.position),c.intersect(t,i,n,l.verticalOffsets,a,o,s)}addEdges(e,t,i,n,o){const s=e,{indices:r,positions:a}=s.intersectionGeometry,l=s.componentData.offsets;return t.addComponentObject(s,a,r,l,i,n,o)}async extractEdgeInformation(e,t,i){const n=e,o=n.componentData.visibility;if(o.allInvisible()){const{extractComponentsEdgeLocationsLayout:e}=await import("../../lib/edgeRendering/edgeProcessing.js");return{buffer:e.createBuffer(0),origin:[0,0,0]}}const{indices:s,positions:r}=n.intersectionGeometry,a=n.componentData.offsets,{EdgeInputBufferLayout:c}=await import("../../lib/edgeRendering/bufferLayouts.js"),m=c.createBuffer(r.length/3);p(m.position.typedBuffer,r,m.position.typedBufferStride,3),h(m.position,m.position,n.transform.rotationScale),this._setComponentIndices(m.componentIndex,s,a);const d=m.count,g=this._computeVisibilityIndices(s,o,a,d);return{origin:l(n.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:g,indicesLength:g.length,skipDeduplicate:!0,data:m,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,t,i){let n=0;for(let o=0;o<i.length-1;o++){const s=i[o],r=i[o+1];for(let i=s;i<r;i++){const o=t?t[i]:i;e.set(o,n)}n++}}_computeVisibilityIndices(e,t,i,n){if(e&&t.allVisible())return e;let o=0;t.forEachComponentRange((e,t)=>(o+=i[t]-i[e],!0));const s=r(e)?2===e?.BYTES_PER_ELEMENT||n<=65536?new Uint16Array(o):new Uint32Array(o):new Array(o);let a=0;return t.forEachComponentRange((t,n)=>{const o=i[t],r=i[n];for(let i=o;i<r;i++)s[a++]=e?e[i]:i;return!0}),s}addHighlight(e,t,i){const n=e,o=this._activeHighlightOptions.get(i)??0;this._activeHighlightOptions.set(i,o+1);n.addHighlight(t,i)&&this._requestRender()}removeHighlight(e,t,i){const n=e.removeHighlight(t,i);"notfound"!==n&&(this._removeActiveHighlight(i),n&&this._requestRender())}_removeActiveHighlight(e,t=1){const i=this._activeHighlightOptions.get(e);if(void 0===i)H().warn(`Removing non-existing highlight "${e}".`);else{const n=i-t;n<0&&H().warn(`Removing non-existing highlight "${e}".`),n<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,n)}}clearHighlights(e){const t=e,{componentData:i}=t,{componentHighlights:n}=t.componentData;if(n.size>0){for(const e of n)this._removeActiveHighlight(e[0],e[1][i.count]);t.clearHighlights(),this._requestRender()}}hasHighlight(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t,i){const n=this._renderPassManager.rctx,o=e.geometry,s=o.parameters.layout,{interleavedVertexData:r,indexData:a,vertexCount:l}=o.renderGeometryData,c=new B(n,s,r),m=a?A.createIndex(n,35044,a):null;let h=0;const p=[["geometry",c]];if(!t.isIntegratedMesh){const e=new Uint16Array(l);for(let n=0;n<i.count;n++){const t=i.offsets[n],o=i.offsets[n+1],s=i.materialDataIndices[n];if(null!=a)for(let i=t;i<o;i++){e[a[i]]=s}else for(let i=t;i<o;i++)e[i]=s}const t=new B(n,x,e.buffer);h+=t.usedMemory,p.push(["componentIndices",t])}const d=new w(n,new Map(p),m),u=new y(d,D.TRIANGLES,o.parameters,null!=m),b=this.materials.acquire(t,u.parameters,g),j=new v(c.usedMemory+h+(m?.usedMemory??0)),C=this.samplers.addFromTexture(t.baseColorTexture?.texture),M=new f(e,t,C);return new _(b,M,u,j)}_requestRender(){this._renderPassManager.requestRender()}};V=e([a("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection")],V);const I=c();export{V as ComponentObjectCollection};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{exactEquals as e}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as t}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ComponentTechnique as r}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as s}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as i}from"../../../core/material/MaterialBase.js";import{isColor as o}from"../../../core/shaderLibrary/ShaderOutput.js";class a extends i{constructor(e,t,r,i,o){super(),this.parameters=e,this.key=o,this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this.hasEmissions=u(e,r,i),this.materialPass=n(e,r),this._configuration=new s(i),this._initializeMaterialConfiguration(e,t,r,i)}destroy(){}acquireTechnique(e,t,s,i){const o=this._updateConfiguration(t,s);return e.get(r,o,i.layout)}_initializeMaterialConfiguration(e,t,r,s){const i=this._configuration;i.hasMetallicRoughnessTexture=null!=e.metallicRoughnessTexture,i.hasOcclusionTexture=null!=e.occlusionTexture,i.hasNormalTexture=null!=e.normalTexture,i.sphereDepthInterpolate=e.sphereDepthInterpolate&&i.spherical,i.ellipsoidMode=e.ellipsoidMode,i.doubleSidedMode=e.doubleSided?1:0,i.hasColorTexture=null!=e.baseColorTexture,i.cullFace=e.cullFace,i.alphaDiscardMode=e.alphaDiscardMode,i.hasVertexColors=t.hasVertexColors,i.textureCoordinateType=t.textureCoordinateType,i.shadeNormals=t.shadeNormals,i.normalType=t.hasNormals?1:2,i.
|
|
2
|
+
import{exactEquals as e}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as t}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ComponentTechnique as r}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as s}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as i}from"../../../core/material/MaterialBase.js";import{isColor as o}from"../../../core/shaderLibrary/ShaderOutput.js";class a extends i{constructor(e,t,r,i,o){super(),this.parameters=e,this.key=o,this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this.hasEmissions=u(e,r,i),this.materialPass=n(e,r),this._configuration=new s(i),this._initializeMaterialConfiguration(e,t,r,i)}destroy(){}acquireTechnique(e,t,s,i){const o=this._updateConfiguration(t,s);return e.get(r,o,i.layout)}_initializeMaterialConfiguration(e,t,r,s){const i=this._configuration;i.hasMetallicRoughnessTexture=null!=e.metallicRoughnessTexture,i.hasOcclusionTexture=null!=e.occlusionTexture,i.hasNormalTexture=null!=e.normalTexture,i.sphereDepthInterpolate=e.sphereDepthInterpolate&&i.spherical,i.ellipsoidMode=e.ellipsoidMode,i.doubleSidedMode=e.doubleSided?1:0,i.hasColorTexture=null!=e.baseColorTexture,i.cullFace=e.cullFace,i.alphaDiscardMode=e.alphaDiscardMode,i.hasVertexColors=t.hasVertexColors,i.textureCoordinateType=t.textureCoordinateType,i.shadeNormals=t.shadeNormals,i.normalType=t.hasNormals?1:2,i.polygonOffset=e.polygonOffset,i.vertexPositionRotationType=t.vertexPositionRotationType,i.vertexNormalRotationType=t.vertexNormalRotationType,i.componentDataType=r.componentDataType,i.emissionSource=c(e,r,s)}_updateConfiguration(e,t){const r=this._configuration,{identifier:s}=e,i=0===s;r.output=t.output,r.enableOITOffset=t.enableOITOffset,r.hasEmission=t.hasEmission&&i,r.renderOccluded=10===t.slot,r.terrainDepthTest=i&&t.terrainDepthTest,r.cullAboveTerrain=!!i&&t.cullAboveTerrain;const a=this.isIntegratedMesh?d(t)?h(t)?3:2:1:0;r.integratedMeshMode=a,r.pbrMode=3===a?4:this.usePBR?this.hasParametersFromSource?0!==r.shadeNormals&&this.isIntegratedMesh?0:2:1:0,r.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,r.isGroundSlice=r.hasSlicePlane&&this.isGround;const{materialPass:n}=this;r.transparent=i&&(1===n||2===n&&e.transparent||4===n)||r.isGroundSlice,r.hasHighlightMixTexture=2===s&&null!=t.highlightMixTexture,r.snowCover=i&&t.snowCover>0,r.vertexDiscardMode=i&&2===n?e.transparent?2:1:0;const l=o(t.output);return r.receiveAmbientOcclusion=l&&this.applySSAO&&!r.renderOccluded&&null!=t.ssao?.getTexture(),r.hasOccludees=l&&t.hasOccludees,r.receiveShadows=l&&t.shadowMap.ready,r.screenSpaceReflections=l&&null!=t.ssr.lastFrameColor,r.cloudReflections=l&&null!=t.clouds.data?.cubeMap?.colorTexture,r}}function n(e,t){const{alphaDiscardMode:r,isIntegratedMesh:s,slicePlaneEnabled:i}=e,{transparent:o,opaqueOverride:a}=t,n=e.opacity<1,l=e.baseColor[3]<1;if(s)return n||i?4:3;if(n)return 1;if(0===a)return 0;if(l||0===r||3===r)return 1;switch(o){case 2:return 0;case 0:return 1;case 1:return 2}}function l(r){return null!=r.emissionTexture||!e(r.emissiveBaseColor,t)}function u(e,t,r){const s=l(e);return r.hasEmissionSupport&&2!==t.emissiveOverride&&(s||2!==t.emissiveSourceOverride)}function c(e,t,r){const s=null!=e.emissionTexture,{emissiveSourceOverride:i}=t,o=1===i,a=2===i,n=u(e,t,r),c=l(e);return n?c?a?s?4:2:o?s?5:7:6:o?7:6:0}function h(e){return null!=e.overlay?.getTexture(3)}function d(e){return null!=e.overlay?.getTexture(1)}export{a as ComponentMaterial,c as calculateEmissionSource,u as calculateHasEmissions,l as calculateHasEmissiveBase,n as computeMaterialPass};
|
package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialGlobalParameters.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import has from"../../../../../../core/has.js";class s{constructor(s,i){this._bind=s,this.sphericalSR=i,this.
|
|
2
|
+
import has from"../../../../../../core/has.js";class s{constructor(s,i){this._bind=s,this.sphericalSR=i,this._hasEmissiveOIT8Bit=!has("disable-feature:emissive-8bit")}get hasEmissionSupport(){return this.useFloatBlend||this._hasEmissiveOIT8Bit}get useFloatBlend(){return this._bind.useFloatBlend.value}}export{s as ComponentMaterialGlobalParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{ComponentMaterial as e,computeMaterialPass as
|
|
2
|
+
import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{ComponentMaterial as e,computeMaterialPass as r,calculateHasEmissions as t,calculateEmissionSource as o}from"./ComponentMaterial.js";import{ComponentMaterialGlobalParameters as s}from"./ComponentMaterialGlobalParameters.js";class a{constructor(e,r){this._store=new Map,this.globals=new s(e,r)}destroy(){this._store.forEach(({material:e})=>e.destroy()),this._store.clear()}acquire(r,t,o){const s=this.globals,a=l(r,t,o,s),n=this._store.get(a);if(n)return n.refCount++,n.material.key,n.material;const i=new e(r,t,o,s,a);return this._store.set(a,{material:i,refCount:1}),i}release(e){const{key:r}=e,t=this._store.get(r);if(!t||t.refCount<1)throw new Error("Internal error in material repository");1===t.refCount?this._store.delete(r):t.refCount--}}function l(e,s,a,l){const n=r(e,a),i=t(e,a,l),u=o(e,a,l);return"|"+ +l.useFloatBlend+`|${+e.usePBR}|${+e.hasParametersFromSource}|${+e.isGround}`+`|${+e.slicePlaneEnabled}|${+e.isIntegratedMesh}|${+e.applySSAO}`+`|${+n}|${+a.componentDataType}|${+i}|${+u}`+`|${+e.sphereDepthInterpolate}|${+e.ellipsoidMode}|${+e.doubleSided}`+`|${+e.cullFace}|${+e.alphaDiscardMode}`+`|${+s.hasVertexColors}|${+s.textureCoordinateType}`+`|${+s.shadeNormals}|${+s.hasNormals}`+`|${e.polygonOffset}|${+s.vertexPositionRotationType}|${+s.vertexNormalRotationType}|`+ +(null!=e.baseColorTexture)+"|"+ +(null!=e.emissionTexture)+"|"+ +(null!=e.metallicRoughnessTexture)+"|"+ +(null!=e.occlusionTexture)+"|"+ +(null!=e.normalTexture)+"|"+ +a.emissiveOverride}export{a as ComponentMaterialRepository,l as makeMaterialKey};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{C as t}from"../../../../../../chunks/ComponentShader.glsl.js";import{isOITColor as i,isOITFrontFace as
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../../../core/accessorSupport/decorators.js";import{C as t}from"../../../../../../chunks/ComponentShader.glsl.js";import{isOITColor as i,isOITFrontFace as o}from"../../../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as n}from"../../../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l}from"../../../core/shaderTechnique/ShaderTechnique.js";import{depthTest as s,blending as a}from"../../../lib/OrderIndependentTransparency.js";import{stencilBaseAllZerosParams as p,stencilWriteMaskOn as d,replaceBitWhenDepthTestPasses as m}from"../../../lib/StencilUtils.js";import{IndexGlLayout as u}from"../../../materials/DefaultLayouts.js";import{oitPolygonOffset as c}from"../../../materials/PolygonOffset.js";import{makePipelineState as h,defaultColorWrite as f,defaultDepthWrite as g,premultipliedAlpha as b,cullingParams as j}from"../../../../../webgl/renderState.js";let P=class extends l{constructor(e,r,i){super(e,r,i.concat(u)),this.shader=new n(t,()=>import("./ComponentShader.glsl.js")),this.ignoreUnused=!0}getPipeline(e){return e.camera.aboveGround||null==this._belowGroundPipeline?super.getPipeline(e):this._belowGroundPipeline}initializePipeline(e){return this._belowGroundPipeline=0===e.integratedMeshMode?null:this._makePipeline(e,!0),this._makePipeline(e,!1)}_makePipeline(e,r){const{integratedMeshMode:t,output:n,transparent:l,cullFace:u,hasOccludees:P,renderOccluded:S}=e,w=0!==t,T=!i(n),O=o(n);let _=j(u);return r&&_&&(_={..._,mode:2304}),h({blending:S?b:l?a(n):null,culling:_,depthTest:S?null:s(n),depthWrite:S||!T&&!O?null:g,colorWrite:f,stencilWrite:!S&&w||P?d:null,stencilTest:w?m(1):P?p:null,polygonOffset:c(e)})}};P=e([r("esri.views.3d.webgl-engine.collections.Component.Material.ComponentTechnique")],P);export{P as ComponentTechnique};
|
package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as
|
|
2
|
+
import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.polygonOffset=0,this.vertexPositionRotationType=1,this.vertexNormalRotationType=0,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.transparent=!0,this.screenSpaceReflections=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.enableOITOffset=!1,this.sphereDepthInterpolate=!1,this.writeDepth=!0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.highStepCount=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=e.sphericalSR,this.useFloatBlend=e.useFloatBlend}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o()],s.prototype,"useFloatBlend",void 0),e([o({count:12})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:7})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o({count:5})],s.prototype,"polygonOffset",void 0),e([o({count:2})],s.prototype,"vertexPositionRotationType",void 0),e([o({count:2})],s.prototype,"vertexNormalRotationType",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"transparent",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"enableOITOffset",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import e from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as t}from"../../webgl/ManagedDepthTexture.js";import a from"../../webgl/ManagedFBO.js";import{isDepthFormat as r,formatString as c,DepthTextureFormats as h,ColorFormats as i}from"./FBOCacheFormats.js";import{FBOCacheUsage as s}from"./FBOCacheUsage.js";import{FBOPool as o}from"./FBOPool.js";import{DepthStencilAttachment as n,ColorAttachment0 as l}from"../../../webgl/enums.js";import{FramebufferObject as u}from"../../../webgl/FramebufferObject.js";import m from"../../../webgl/Texture.js";class d{constructor(e){this.rctx=e,this._interactive=!1,this._usage=new s,this._acquired=new Set,this._cache=new o(e.newCache,"FBOCache"),this._depthCache=new o(e.newCache,"DepthAttachmentCache"),this._colorCache=new o(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.(),this._usage.clear()}frameEnd(){const{debugCallback:e}=this;e&&(this._usage.summarize(),this._acquired.forEach(t=>e(t.name,t.fbo)))}get usedMemory(){return Array.from(this._acquired.values()).reduce((e,t)=>e+t.usedMemory,this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e,this._interactive=e}get interactive(){return this._interactive}acquire(e,t,h,i=5){const s=p(i,e,t);let o=this._cache.pop(s);const{rctx:m}=this;if(o){o.retain(),o.setName(h);const e=o.getAttachment(n);e&&(e.name=C);const t=o.getAttachment(l);t&&(t.name=_(0)),m.unbindTexture(o.fbo.colorTexture)}else{const c=new u(m),d=(a,r,c)=>{r??=5;const h=this._acquireColor(r,e,t,c??_(a-l));return this.rctx.unbindTexture(h.attachment),o.attachColor(h,a),h.release(),o},p=a=>{a??=13;const r=this.acquireDepth(a,e,t
|
|
2
|
+
import"../../../../core/has.js";import e from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthTexture as t}from"../../webgl/ManagedDepthTexture.js";import a from"../../webgl/ManagedFBO.js";import{isDepthFormat as r,formatString as c,DepthTextureFormats as h,ColorFormats as i}from"./FBOCacheFormats.js";import{FBOCacheUsage as s}from"./FBOCacheUsage.js";import{FBOPool as o}from"./FBOPool.js";import{DepthStencilAttachment as n,ColorAttachment0 as l}from"../../../webgl/enums.js";import{FramebufferObject as u}from"../../../webgl/FramebufferObject.js";import m from"../../../webgl/Texture.js";class d{constructor(e){this.rctx=e,this._interactive=!1,this._usage=new s,this._acquired=new Set,this._cache=new o(e.newCache,"FBOCache"),this._depthCache=new o(e.newCache,"DepthAttachmentCache"),this._colorCache=new o(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.(),this._usage.clear()}frameEnd(){const{debugCallback:e}=this;e&&(this._usage.summarize(),this._acquired.forEach(t=>e(t.name,t.fbo)))}get usedMemory(){return Array.from(this._acquired.values()).reduce((e,t)=>e+t.usedMemory,this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e,this._interactive=e}get interactive(){return this._interactive}acquire(e,t,h,i=5){const s=p(i,e,t);let o=this._cache.pop(s);const{rctx:m}=this;if(o){o.retain(),o.setName(h);const e=o.getAttachment(n);e&&(e.name=C);const t=o.getAttachment(l);t&&(t.name=_(0)),m.unbindTexture(o.fbo.colorTexture)}else{const c=new u(m),d=(a,r,c)=>{r??=5;const h=this._acquireColor(r,e,t,c??_(a-l));return this.rctx.unbindTexture(h.attachment),o.attachColor(h,a),h.release(),o},p=a=>{a??=13;const r=this.acquireDepth(a,e,t,`${o.name} ${C}`);return o.attachDepth(r),r.release(),o},f=()=>{if(!o)return;this.debugCallback?.(o.name,o.fbo),this._acquired.delete(o);const e=r(i);e&&null!=o.getAttachment(n)||!e&&null!=o.getAttachment(l)?(e?(o.fbo?.invalidateAttachments([n]),o.detachAllColors()):(o.fbo?.invalidateAttachments([l]),o.detachAllButColor0()),this._trackRelease(o),this._cache.put(o)):o.dispose()};o=new a(s,h,c,d,p,f),r(i)?o.acquireDepth(i):o.acquireColor(l,i)}return this._trackAcquire(o,"f "+c(i),e,t),this._trackHandle(o)}acquireDepth(e,a,r,i){const s=p(e,a,r);let o=this._depthCache.pop(s);if(o)o.retain(),o.attachment.setShadowFiltering(!1);else{const c=new m(this.rctx,{...h[e],width:a,height:r});o=new t(s,c,()=>{this._trackRelease(o),this._depthCache.put(o)})}return o.name=i,this._trackAcquire(o,"d "+c(e),a,r),o}_acquireColor(t,a,r,h){const s=p(t,a,r);let o=this._colorCache.pop(s);if(o)o.retain();else{const c=new m(this.rctx,{...i[t],width:a,height:r,isImmutable:!0});o=new e(s,c,()=>{this._trackRelease(o),this._colorCache.put(o)})}return o.name=h,this._trackAcquire(o,"c "+c(t),a,r),o}_trackHandle(e){return this._acquired.add(e),e}_trackAcquire(e,t,a,r){this.debugCallback&&this._usage.add(e,t,a,r)}_trackRelease(e){this.debugCallback&&this._usage.remove(e)}get test(){return null}}function _(e=0){return`color${e}`}const C="depth";function p(e,t,a){return`${t}x${a}:${e}`}export{d as FBOCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
class
|
|
2
|
+
class a{constructor(){this._usage=new Map,this._pad=0}clear(){this._usage.clear()}add(a,s,t,o){const r=this._usage.get(a);r?(r[2]=!0,r[3].push(a.name)):this._usage.set(a,[s,`${t}x${o}`,!0,[a.name]]),this._pad=Math.max(this._pad,e(this._usage)),console.log(Array.from(this._usage.values()).map(([a,e,s,t])=>(s?t[t.length-1]:"").padStart(this._pad," ")).join(" | "))}remove(a){const e=this._usage.get(a);e&&(e[2]=!1)}summarize(){const a=e(this._usage);console.log(Array.from(this._usage.values()).map(([e,s])=>s.padStart(a," ")).join(" | ")),console.log(Array.from(this._usage.keys()).map(({usedMemory:e})=>`${(e/1024/1024).toFixed(1)}MB`.padStart(a," ")).join(" | ")),console.log(Array.from(this._usage.values()).map(([e])=>e.padStart(a," ")).join(" | ")),console.log("Total",(Array.from(this._usage.keys()).reduce((a,{usedMemory:e})=>a+e,0)/1024/1024).toFixed(1),"MB")}}function e(a){return Array.from(a.values()).reduce((a,[e,s,t,o])=>Math.max(e.length,s.length,o.reduce((a,e)=>Math.max(a,e.length),a)),0)}export{a as FBOCacheUsage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as o}from"tslib";import{ShaderTechniqueConfiguration as t,parameter as s}from"../shaderTechnique/ShaderTechniqueConfiguration.js";class
|
|
2
|
+
import{__decorate as o}from"tslib";import{ShaderTechniqueConfiguration as t,parameter as s}from"../shaderTechnique/ShaderTechniqueConfiguration.js";class e extends t{constructor(){super(...arguments),this.output=0,this.hasEmission=!1,this.useFloatBlend=!0}}o([s({count:12})],e.prototype,"output",void 0),o([s()],e.prototype,"hasEmission",void 0),o([s()],e.prototype,"useFloatBlend",void 0);export{e as ShaderOutputConfiguration};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{clamp as e}from"../../../../../../core/mathUtils.js";import{isColor as s}from"../ShaderOutput.js";import{VertexTextureCoordinates as i}from"../attributes/VertexTextureCoordinates.glsl.js";import{Gamma as o}from"../shading/Gamma.glsl.js";import{Float3DrawUniform as r}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as m}from"../../shaderModules/Float3PassUniform.js";import{FloatDrawUniform as t}from"../../shaderModules/FloatDrawUniform.js";import{FloatPassUniform as n}from"../../shaderModules/FloatPassUniform.js";import{If as a,glsl as l}from"../../shaderModules/glsl.js";import{Texture2DDrawUniform as v}from"../../shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as u}from"../../shaderModules/Texture2DPassUniform.js";import{floatBlendReductionFactor as f}from"../../../shaders/oitResolution.glsl.js";const d=1,c=1;function g(d,g){if(!s(g.output))return;d.fragment.include(o);const{emissionSource:x,hasEmissiveTextureTransform:p,bindType:h,useFloatBlend:j}=g,T=3===x||4===x||5===x;T&&(d.include(i,g),d.fragment.uniforms.add(1===h?new u("texEmission",e=>e.textureEmissive):new v("texEmission",e=>e.textureEmissive)));const w=2===x||T;w&&d.fragment.uniforms.add(1===h?new m("emissiveBaseColor",e=>e.emissiveBaseColor):new r("emissiveBaseColor",e=>e.emissiveBaseColor));const C=0!==x;if(C&&!(7===x||6===x||4===x||5===x)){const s=s=>null!=s?j?s:e(s,0,f):0;d.fragment.uniforms.add(1===h?new n("emissiveStrength",e=>s(e.emissiveStrength)):new t("emissiveStrength",e=>s(e.emissiveStrength)))}const F=7===x,b=5===x,S=1===x||6===x||F;d.fragment.code.add(l`
|
|
3
3
|
vec4 getEmissions(vec3 symbolColor) {
|
|
4
|
-
vec4 emissions = ${
|
|
5
|
-
${
|
|
6
|
-
${
|
|
4
|
+
vec4 emissions = ${w?b?"emissiveSource == 0 ? vec4(emissiveBaseColor, 1.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(emissiveBaseColor, 1.0)":S?F?"emissiveSource == 0 ? vec4(0.0): vec4(linearizeGamma(symbolColor), 1.0)":"vec4(linearizeGamma(symbolColor), 1.0)":"vec4(0.0)"};
|
|
5
|
+
${a(T,`${a(b,`if(emissiveSource == 0) {\n vec4 emissiveFromTex = textureLookup(texEmission, ${p?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);\n }`,`vec4 emissiveFromTex = textureLookup(texEmission, ${p?"emissiveUV":"vuv0"});\n emissions *= vec4(linearizeGamma(emissiveFromTex.rgb), emissiveFromTex.a);`)}\n emissions.w = emissions.rgb == vec3(0.0) ? 0.0: emissions.w;`)}
|
|
6
|
+
${a(C,`emissions.rgb *= emissiveStrength * ${l.float(c)};`)}
|
|
7
7
|
return emissions;
|
|
8
8
|
}
|
|
9
|
-
`)}export{
|
|
9
|
+
`)}export{g as Emissions,c as emissiveStrengthBoost,d as emissiveStrengthDefault};
|