@arcgis/core 4.33.0-next.20250131 → 4.33.0-next.20250201
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/WebScene.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade/geometry/unitConversion.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{b68bddd0c4ca91493543.js → 06d489a44d88e38fb140.js} +1 -1
- package/assets/esri/core/workers/chunks/{4696278d033907a067c7.js → 085462ba3da7849fc296.js} +1 -1
- package/assets/esri/core/workers/chunks/0a19e1aec6a5502e391a.js +1 -0
- package/assets/esri/core/workers/chunks/{7a273e6e411f6cc31b3f.js → 326a3f50e585e492b673.js} +1 -1
- package/assets/esri/core/workers/chunks/4decfae8bc5e80878bdd.js +1 -0
- package/assets/esri/core/workers/chunks/{e0de91eacf3a3b7eda55.js → 5b20ee64248f2d5c937f.js} +1 -1
- package/assets/esri/core/workers/chunks/{bef27448b341e429eb31.js → 692b3d03346f030aa649.js} +7 -7
- package/assets/esri/core/workers/chunks/6ec108bd955e064256b5.js +1 -0
- package/assets/esri/core/workers/chunks/c94ec324ecad77c53a87.js +1 -0
- package/assets/esri/core/workers/chunks/{ef6afba80fa2086ec104.js → e9f7953938b9bc8e8abe.js} +1 -1
- package/assets/esri/core/workers/chunks/fb1a89f753057f889971.js +314 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +4 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ar.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bg.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_bs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ca.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_cs.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_da.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_de.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_el.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_en.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_es.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_et.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_fr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_he.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_hu.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_id.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_it.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ja.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ko.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lt.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_lv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_nl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_no.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-BR.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_pt-PT.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ro.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_ru.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sl.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_sv.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_th.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_tr.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_uk.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_vi.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-CN.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-HK.json +1 -1
- package/assets/esri/widgets/Directions/t9n/Directions_zh-TW.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ar.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bg.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_bs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ca.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_cs.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_da.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_de.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_el.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_es.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_et.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_fr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_he.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_hu.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_id.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_it.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ja.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ko.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lt.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_lv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_nl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_no.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ro.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_ru.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sl.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_sv.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_th.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_tr.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_uk.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_vi.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureForm/t9n/FeatureForm_zh-TW.json +1 -1
- package/geometry/support/typeUtils.js +1 -1
- package/interfaces.d.ts +154 -7
- package/layers/FeatureLayer.js +1 -1
- package/layers/support/rasterFieldUtils.js +1 -1
- package/package.json +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/geometryUtils.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
- package/views/3d/environment/CloudsRenderer.js +1 -1
- package/views/3d/environment/CloudsTechnique.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/FogTechnique.js +1 -1
- package/views/3d/environment/LocalAtmosphere.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/environment/NoiseTextureAtlas.js +1 -1
- package/views/3d/environment/NoiseTextureAtlasTechnique.js +1 -1
- package/views/3d/environment/Precipitation.js +1 -1
- package/views/3d/environment/PrecipitationTechnique.js +1 -1
- package/views/3d/environment/SimpleAtmosphereTechnique.js +1 -1
- package/views/3d/interactive/editingTools/media/ControlPointOperations.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandEncoder.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
- package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/terrain/BlendLayersTechnique.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomBlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomDepthAdjustTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/haze/HazeCompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/haze/HazeTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightApplyTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightDownsampleTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/HighlightToSingleTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/SingleHighlightApplyTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/SingleHighlightBlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlineTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/MagnifierTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAABlendWeightsTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAABlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAAEdgeDetectTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAOBlurTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAOTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
- package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.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/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
- package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.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/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDCompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OverlayCompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.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/ShadowCastAccumulateTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ViewshedTechnique.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/helpMessageUtils.js +1 -1
- package/views/draw/support/tooltipUtils.js +1 -1
- package/views/interactive/keybindings.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
- package/views/interactive/tooltip/infos/DrawCircleTooltipInfo.js +1 -1
- package/views/interactive/tooltip/infos/DrawMultipointTooltipInfo.js +5 -0
- package/views/interactive/tooltip/infos/DrawRectangleTooltipInfo.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/layers/MediaLayerView.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.d.ts +4 -0
- package/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.js +1 -1
- package/widgets/support/widget.d.ts +9 -0
- package/assets/esri/core/workers/chunks/0bafa546602b776caf2f.js +0 -1
- package/assets/esri/core/workers/chunks/258b46b58a4860942f7c.js +0 -1
- package/assets/esri/core/workers/chunks/69ab4b780f7223cfd7dd.js +0 -1
- package/assets/esri/core/workers/chunks/83edac97a52b26ead1ea.js +0 -314
- package/assets/esri/core/workers/chunks/9ffa27d0517bad84572e.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import n from"../../../../../core/Logger.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as o,destroyMaybe as a}from"../../../../../core/maybe.js";import{isAbortError as c,onAbortOrThrow as l}from"../../../../../core/promiseUtils.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as u,transpose as m,invert as g}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as _,c as b,a as y,f as j}from"../../../../../chunks/vec32.js";import{create as O,clone as w}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as E}from"../../../../../core/support/UpdatingHandles.js";import{a as v,g as x}from"../../../../../chunks/sphere.js";import{c as M}from"../../../../../chunks/vec33.js";import{ViewingMode as R}from"../../../../ViewingMode.js";import{encodeElevationOffset as T}from"../../collections/Component/Material/shader/ComponentData.glsl.js";import{TwoVectorPosition as A}from"../../core/util/TwoVectorPosition.js";import{Attribute as C}from"../Attribute.js";import{GridLocalOriginFactory as D}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as P}from"../localOriginHelper.js";import{LocalOriginManager as U}from"../LocalOriginManager.js";import{Object3D as L}from"../Object3D.js";import{VertexArrayObject as k}from"../VertexArrayObject.js";import{VertexAttribute as I}from"../VertexAttribute.js";import{VertexLayout as S,EdgeInputBufferLayout as B,vertexAttributeLocations as V,glVertexLayout as q}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as H,SilhouetteEdgeBufferWriter as G}from"./edgeBufferWriters.js";import{EdgeRenderer as N,lineWidthFractionFactor as W,extensionLengthOffset as z}from"./EdgeRenderer.js";import{EdgePassParameters as F}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as K}from"./EdgeWorkerHandle.js";import"./interfaces.js";import{generateStrokesTexture as J}from"./strokes.js";import{determineRendererType as Q,determineEdgeTransparency as X,determineObjectTransparency as Y,fillComponentBufferIndices as Z}from"./util.js";import{BufferManager as $}from"../TextureBackedBuffer/BufferManager.js";import{EdgeSilhouette as ee}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{BufferObject as te}from"../../../../webgl/BufferObject.js";import{Usage as re}from"../../../../webgl/enums.js";const se=128;let ne=class extends t{constructor(e){super(e),this._updatingHandles=new E,this._objectEntries=new Map,this._pendingDeletions=new Map,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=O(),this._localOrigins=new U(new D(e.renderSR));const t=S.createBuffer(4);for(let r=0;r<4;r++)t.sideness.set(r,0,0===r||3===r?0:1),t.sideness.set(r,1,0===r||1===r?0:1);this._verticesBufferObject=te.createVertex(e.rctx,re.STATIC_DRAW,t.buffer)}initialize(){this._worker=new K(this.schedule),this._componentColorManager=new $(this.rctx,3)}destroy(){this.destroyed||(this._objectEntries.forEach((e=>this._discardObjectEntry(e))),this._objectEntries.clear(),this._pendingDeletions.forEach((e=>this._discardObjectEntry(e))),this._pendingDeletions.clear(),this._strokesTexture=o(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._worker.destroy(),this._verticesBufferObject.dispose(),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",we))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,n,i,o){if(this.hasObject(e))return this._getObjectMemoryUsage(e);let a;const c=new ae(null,new Promise((e=>a=e)),e.obb.center,e.obb.radius);this._objectEntries.set(e,c);const l=await this._updatingHandles.addPromise(this._addComponentGeometry(e.transform,c,t,r,s,n,i,o));return this.setNeedsRender(),a(),l}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void n.getLogger(this).warn("Attempt to add an object to a destroyed instance");const i=new AbortController;let o;const a=e.boundingVolumeWorldSpace.bounds,l=new ae(i,new Promise((e=>o=e)),v(a),x(a)),d=this._objectEntries.get(e);d&&(this._pendingDeletions.has(e)?this._discardObjectEntry(d):this._pendingDeletions.set(e,d)),this._objectEntries.set(e,l);try{const n=new Array;if(e.geometries.length>1&&oe(e))n.push(this._addObjectMergedGeometries(e,l,t,r,s));else for(const i of e.geometries)i.material.supportsEdges&&n.push(this._addGeometry(e,l,i,t,r,s));await this._updatingHandles.addPromise(Promise.all(n)),this._removePendingDeletion(e)}catch(h){c(h)?this._discardObjectEntry(l):this._removePendingDeletion(e)}finally{this.setNeedsRender(),o()}}removeObject(e){const t=this._objectEntries.get(e);this._objectEntries.delete(e),this._discardObjectEntry(t),this._removePendingDeletion(e)}_removePendingDeletion(e){const t=this._pendingDeletions.get(e);this._pendingDeletions.delete(e),this._discardObjectEntry(t)}async _getObjectEntry(e){const t=this._objectEntries.get(e);if(!t)throw new Error("no object");return await t.loaded,null==t.loaded?null:t}fastUpdateObject3DEdgesTransform(e){if(this.destroyed)return!1;const t=this._objectEntries.get(e);if(!t)return!1;const{geometries:r}=e,{renderables:s}=t;if(0===r.length||0===s.length)return!0;if(s.length>1)return!1;const[n]=s,i=n.transform;if(!(i instanceof de))return!1;const[o]=r;if(o.localOrigin!==i.origin.origin)return!1;const a=p(),c=this._computeModelTransformWithLocalOrigin(e,o,a);return n.transform=new de(a,c),this.setNeedsRender(),!0}_discardObjectEntry(e){e&&(e.abort?.abort(),e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._objectEntries.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(null==r)return;const s=Array.isArray(t)?e=>t[e]:()=>t;r.renderables.forEach((e=>{const t=e.components.meta.length;for(let r=0;r<t;r++){const t=s(r),n=e.components.meta[r],i=n.index;n.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(i,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async _getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return t?t.renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0):0}async updateAllComponentMaterials(e,t,r,s){const n=e instanceof L,i=Q(t),o=N.getKey(i,r,n),a=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=a&&(a.renderables.forEach((e=>{if(o!==e.rendererKey){const t=this._renderers.get(e.rendererKey),s=this._acquireRenderer(i,r,n);t.removeRenderable(e),--t.refCount,e.rendererKey=o,s.addRenderable(e)}if(Array.isArray(t))for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];else e.components.meta[0].material=t;s&&me(e.components),this._updateTransparency(e)})),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&this._updateAllVerticalOffsets(r,t)}_updateAllVerticalOffsets(e,t){e.renderables.forEach((e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;me(e.components)})),this.setNeedsRender()}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));r&&(r.renderables.forEach((e=>e.visible=t)),this.setNeedsRender())}render(e,t){if(null==this._componentColorManager)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=O(),n=new A;let i=0,o=0;if(this._renderers.forEach((r=>{0!==r.refCount?(++this.techniques.precompiling,r.forEachRenderable((t=>{t.visible&&(i+=t.statistics.averageEdgeLength,o++,t.regular&&r.acquireTechnique(e,!1).release(),t.silhouette&&r.acquireTechnique(e,!0).release())}),t),--this.techniques.precompiling):this._renderers.delete(r.key)})),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===o)return;const a=new F(40*i/o,t);_(s,r[3],r[7],r[11]),n.set(s),b(a.transformWorldFromViewTH,n.high),b(a.transformWorldFromViewTL,n.low),u(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),m(Oe,a.transformViewFromCameraRelativeRS),g(a.transformNormalViewFromGlobal,Oe),a.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this._renderers.forEach((t=>{ge(t,e,a),fe(t,e,a)}))}_updateTransparency(e){const t=X(e.components.meta),r=Y(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedShaderTransformation(t,r);const s=null!=t.localOrigin?this._localOrigins.register(t.localOrigin):this._localOrigins.acquire(_(this._tmpModelPosition,r[12],r[13],r[14]));return t.localOrigin=s.origin,P(s.origin.vec3,r),s}_createComponentBuffers(e){if(null==this._componentColorManager)return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length);for(let n=0;n<e.length;n++){const s=e[n],i=r.acquireIndex();t.push({index:i,verticalOffset:0,material:s})}const s=new ce(r,t);return me(s),s}_extractEdges(e,t,r,s,n,i,o=i.length){return o<se&&(n=!0),this._worker.process({data:r,indices:i,indicesLength:o,writerSettings:t,skipDeduplicate:s},e,n)}_createRenderable(e,t,r,s,n){const i=t=>new le(new k(this.rctx,V,new Map([["vertices",q],["instances",t===ee.REGULAR?H.glLayout:G.glLayout]]),new Map([["vertices",this._verticesBufferObject],["instances",te.createVertex(this.rctx,re.STATIC_DRAW,t===ee.REGULAR?e.regular.instancesData.buffer:e.silhouette.instancesData.buffer)]])),t===ee.REGULAR?e.regular.lodInfo:e.silhouette.lodInfo),o=e.regular.lodInfo.lengths.length>0?i(ee.REGULAR):null,a=e.silhouette.lodInfo.lengths.length>0?i(ee.SILHOUETTE):null,c=(o?.vao.cachedMemory??0)+(a?.vao.cachedMemory??0);return new he(o,a,{gpuMemoryUsage:c,externalMemoryUsage:n,averageEdgeLength:e.averageEdgeLength},r,X(t.meta),Y(t.meta),t,s)}async _addGeometry(e,t,r,s,n,i){if(r.edgeIndicesLength<=0)return;const o=r.attributes.get(I.POSITION),a=p(),c=this._computeModelTransformWithLocalOrigin(e,r,a),l=new je(o,a,c);return this._addPositionData(t,l,r.edgeIndicesLength,s,n,i)}async _addPositionData(e,t,r,s,n,i=!1){if(null==e.loaded)return;const o=this._createComponentBuffers([s]);if(null==o)return;const a=this._acquireRenderer(s.type,n,!0),{modelTransform:c,origin:l}=t,d=t.position.indices,h=t.position,u=h.data.length/h.size,m=B.createBuffer(u);for(let p=0;p<u;p++)m.position.set(p,0,h.data[p*h.size]),m.position.set(p,1,h.data[p*h.size+1]),m.position.set(p,2,h.data[p*h.size+2]);Z(o.meta,[0,m.componentIndex.count],m.componentIndex);const g=await this._updatingHandles.addPromise(this._extractEdges(e.abort?.signal||this._workerAbort.signal,a.writerSettings,m,!1,i,d,r));if(null==e.loaded)return;const f=this._createRenderable(g,o,new de(c,l),a.key,!1);e.renderables.push(f),a.addRenderable(f),this._gpuMemoryUsage+=f.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,n,i,o,a){if(null==t.loaded)return 0;const c=this._createComponentBuffers(i);if(null==c)return 0;const l=Q(i),d=this._acquireRenderer(l,o||!1,!1),h=B.createBuffer(r.length/3);M(h.position.typedBuffer,r,h.position.typedBufferStride,3),Z(c.meta,n,h.componentIndex,s);const u=!0,m=d.writerSettings,g=await this._updatingHandles.addPromise(this._extractEdges(this._workerAbort.signal,m,h,u,!1,s));if(null==t.loaded)return 0;const f=this._createRenderable(g,c,e,d.key,!0);return t.renderables.push(f),d.addRenderable(f),this._updateAllVerticalOffsets(t,a),f.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,n){const i=new Map;let o=0,a=0,c=null;const l=e.geometries.filter((e=>{if(e.edgeIndicesLength<=0||!e.material.supportsEdges)return!1;!c&&e.localOrigin&&(c=e);const t=e.attributes.get(I.POSITION);return a+=t.data.length/t.size,o+=e.edgeIndicesLength,!0}));if(0===l.length)return;const d=a>=65536?Uint32Array:Uint16Array,h=o?new d(o):null,u=[];let m=0;l.forEach((e=>{const t=e.attributes.get(I.POSITION),r=t.indices;let s=i.get(t.data);if(null==s){s=u.length/3;for(let e=0;e<t.data.length;e+=t.size)u.push(t.data[e]),u.push(t.data[e+1]),u.push(t.data[e+2]);i.set(t.data,s)}for(let n=0;n<e.edgeIndicesLength;n++)h[m++]=s+r[n]}));const g=c||e.geometries[0],f=p(),_=this._computeModelTransformWithLocalOrigin(e,g,f);for(let p=0;p<e.geometries.length;p++)e.geometries[p].localOrigin=_.origin;const b=new je(new C(u,h,3),f,_);await this._updatingHandles.addPromise(this._addPositionData(t,b,h.length,r,s,n))}_acquireRenderer(e,t,r){const s=N.getKey(e,t,r);let n=this._renderers.get(s);return null==this._strokesTexture&&(this._strokesTexture=J(this.rctx)),n||(n=new N(this.rctx,this.techniques,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:this.viewingMode===R.Global}),this._renderers.set(s,n)),++n.refCount,n}_removeRenderable(e){ie(e.regular),ie(e.silhouette);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=O(),n=e=>{y(s,e.center,t);const n=j(s,r),i=e.radius,o=n<-i?1/0:n<i?0:n-i;e.renderables.forEach((e=>e.distanceToCamera=o))};this._objectEntries.forEach(n),this._pendingDeletions.forEach(n)}get test(){}};function ie(e){e?.vao&&(e.vao.vertexBuffers.get("instances")?.dispose(),e.vao.disposeVAOOnly(),e.vao=null)}function oe(e){let t=null,s=null;for(const n of e.geometries){if(n.material.supportsEdges){if(t){if(!r(t,n.transformation))return!1}else t=n.transformation;if(s||null==n.localOrigin){if(null!=s?.localOrigin&&null!=n.localOrigin&&s.localOrigin.id!==n.localOrigin.id)return!1}else s=n}}return!0}e([d({constructOnly:!0})],ne.prototype,"rctx",void 0),e([d({constructOnly:!0})],ne.prototype,"renderSR",void 0),e([d({constructOnly:!0})],ne.prototype,"viewingMode",void 0),e([d({constructOnly:!0})],ne.prototype,"techniques",void 0),e([d({constructOnly:!0})],ne.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],ne.prototype,"schedule",void 0),e([d({readOnly:!0})],ne.prototype,"_updatingHandles",void 0),e([d({readOnly:!0})],ne.prototype,"updating",null),ne=e([h("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],ne);class ae{constructor(e,t,r,s){this.abort=e,this.radius=s,this.renderables=new Array;const n=e?l(e.signal,(()=>e.abort())):null;this.loaded=t,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0),this.abort=null,n?.remove()})),this.center=w(r)}}class ce{constructor(e,t){this.buffer=e,this.meta=t}}class le{constructor(e,t){this.vao=e,this.lod=t}}class de{constructor(e,t){this.modelMatrix=e,this.origin=t}}class he{constructor(e,t,r,s,n,i,o,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=n,this.objectTransparency=i,this.components=o,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class ue extends he{}function me(e){const{meta:t,buffer:r}=e,s=new Uint8Array(4);for(let n=0;n<t.length;n++){const e=t[n].material,o=t[n].index,a=i(Math.round(e.size*W),0,255),c=i(e.extensionLength,-128,255-z)+z,l=255*e.opacity,d=e.color,h=255*d[0],u=255*d[1],m=255*d[2],g=255*d[3];r.textureBuffer.setData(o,0,h,u,m,g),r.textureBuffer.setData(o,1,a,c,e.type,l),T(t[n].verticalOffset,s),r.textureBuffer.setData(o,2,s[0],s[1],s[2],s[3])}}function ge(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable((i=>{if(!pe(i)||!i.visible)return;s??=e.acquireTechnique(t,!1),n??=e.rctx.bindTechnique(s,t,r);const a=ye(i.regular.lod.lengths,i.distanceToCamera,o);e.renderRegularEdges(n,i,r,t,a)}),i),s?.release()}function fe(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable((i=>{if(!be(i)||!i.visible)return;s??=e.acquireTechnique(t,!0),n??=e.rctx.bindTechnique(s,t,r);const a=ye(i.silhouette.lod.lengths,i.distanceToCamera,o);e.renderSilhouetteEdges(n,i,r,t,a)}),i),s?.release()}function pe(e){return null!=e.regular}class _e extends he{}function be(e){return null!=e.silhouette}function ye(e,t,r){const n=t*r,i=s(e,n,!0);return-1===i?n<e[0]?e.length:0:e.length-i}class je{constructor(e,t,r){this.position=e,this.modelTransform=t,this.origin=r}}const Oe=f(),we=()=>Promise.reject();export{ne as EdgeView,de as LegacyTransform,ue as RegularRenderable,he as Renderable,_e as SilhouetteRenderable};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Accessor.js";import{equals as r,binaryIndexOf as s}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import n from"../../../../../core/Logger.js";import{clamp as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as o,destroyMaybe as a}from"../../../../../core/maybe.js";import{isAbortError as c,onAbortOrThrow as l}from"../../../../../core/promiseUtils.js";import{property as d}from"../../../../../core/accessorSupport/decorators/property.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as u,transpose as m,invert as g}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as f}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as p}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as _,c as b,a as y,f as j}from"../../../../../chunks/vec32.js";import{create as O,clone as w}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as E}from"../../../../../core/support/UpdatingHandles.js";import{a as v,g as x}from"../../../../../chunks/sphere.js";import{c as M}from"../../../../../chunks/vec33.js";import{ViewingMode as R}from"../../../../ViewingMode.js";import{encodeElevationOffset as T}from"../../collections/Component/Material/shader/ComponentData.glsl.js";import{TwoVectorPosition as A}from"../../core/util/TwoVectorPosition.js";import{Attribute as C}from"../Attribute.js";import{GridLocalOriginFactory as D}from"../GridLocalOriginFactory.js";import{applyToModelMatrix as P}from"../localOriginHelper.js";import{LocalOriginManager as U}from"../LocalOriginManager.js";import{Object3D as L}from"../Object3D.js";import{VertexArrayObject as k}from"../VertexArrayObject.js";import{VertexAttribute as I}from"../VertexAttribute.js";import{VertexLayout as S,EdgeInputBufferLayout as B,vertexAttributeLocations as V,glVertexLayout as q}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as H,SilhouetteEdgeBufferWriter as G}from"./edgeBufferWriters.js";import{EdgeRenderer as N,lineWidthFractionFactor as W,extensionLengthOffset as z}from"./EdgeRenderer.js";import{EdgePassParameters as F}from"./EdgeShaderParameters.js";import{EdgeWorkerHandle as K}from"./EdgeWorkerHandle.js";import"./interfaces.js";import{generateStrokesTexture as J}from"./strokes.js";import{determineRendererType as Q,determineEdgeTransparency as X,determineObjectTransparency as Y,fillComponentBufferIndices as Z}from"./util.js";import{BufferManager as $}from"../TextureBackedBuffer/BufferManager.js";import{EdgeSilhouette as ee}from"../../shaders/sources/edgeRenderer/EdgeUtil.glsl.js";import{BufferObject as te}from"../../../../webgl/BufferObject.js";import{Usage as re}from"../../../../webgl/enums.js";const se=128;let ne=class extends t{constructor(e){super(e),this._updatingHandles=new E,this._objectEntries=new Map,this._pendingDeletions=new Map,this._renderers=new Map,this._gpuMemoryUsage=0,this._workerAbort=new AbortController,this._tmpModelPosition=O(),this._localOrigins=new U(new D(e.renderSR));const t=S.createBuffer(4);for(let r=0;r<4;r++)t.sideness.set(r,0,0===r||3===r?0:1),t.sideness.set(r,1,0===r||1===r?0:1);this._verticesBufferObject=te.createVertex(e.rctx,re.STATIC_DRAW,t.buffer)}initialize(){this._worker=new K(this.schedule),this._componentColorManager=new $(this.rctx,3)}destroy(){this.destroyed||(this._objectEntries.forEach((e=>this._discardObjectEntry(e))),this._objectEntries.clear(),this._pendingDeletions.forEach((e=>this._discardObjectEntry(e))),this._pendingDeletions.clear(),this._strokesTexture=o(this._strokesTexture),this._componentColorManager=a(this._componentColorManager),this._workerAbort.abort(),this._worker.destroy(),this._verticesBufferObject.dispose(),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",we))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,t,r,s,n,i,o){if(this.hasObject(e))return this._getObjectMemoryUsage(e);let a;const c=new ae(null,new Promise((e=>a=e)),e.obb.center,e.obb.radius);this._objectEntries.set(e,c);const l=await this._updatingHandles.addPromise(this._addComponentGeometry(e.transform,c,t,r,s,n,i,o));return this.setNeedsRender(),a(),l}async addOrUpdateObject3D(e,t,r,s){if(this.destroyed)return void n.getLogger(this).warn("Attempt to add an object to a destroyed instance");const i=new AbortController;let o;const a=e.boundingVolumeWorldSpace.bounds,l=new ae(i,new Promise((e=>o=e)),v(a),x(a)),d=this._objectEntries.get(e);d&&(this._pendingDeletions.has(e)?this._discardObjectEntry(d):this._pendingDeletions.set(e,d)),this._objectEntries.set(e,l);try{const n=new Array;if(e.geometries.length>1&&oe(e))n.push(this._addObjectMergedGeometries(e,l,t,r,s));else for(const i of e.geometries)i.material.supportsEdges&&n.push(this._addGeometry(e,l,i,t,r,s));await this._updatingHandles.addPromise(Promise.all(n)),this._removePendingDeletion(e)}catch(h){c(h)?this._discardObjectEntry(l):this._removePendingDeletion(e)}finally{this.setNeedsRender(),o()}}removeObject(e){const t=this._objectEntries.get(e);this._objectEntries.delete(e),this._discardObjectEntry(t),this._removePendingDeletion(e)}_removePendingDeletion(e){const t=this._pendingDeletions.get(e);this._pendingDeletions.delete(e),this._discardObjectEntry(t)}async _getObjectEntry(e){const t=this._objectEntries.get(e);if(!t)throw new Error("no object");return await t.loaded,null==t.loaded?null:t}fastUpdateObject3DEdgesTransform(e){if(this.destroyed)return!1;const t=this._objectEntries.get(e);if(!t)return!1;const{geometries:r}=e,{renderables:s}=t;if(0===r.length||0===s.length)return!0;if(s.length>1)return!1;const[n]=s,i=n.transform;if(!(i instanceof de))return!1;const[o]=r;if(o.localOrigin!==i.origin.origin)return!1;const a=p(),c=this._computeModelTransformWithLocalOrigin(e,o,a);return n.transform=new de(a,c),this.setNeedsRender(),!0}_discardObjectEntry(e){e&&(e.abort?.abort(),e.renderables.length&&(e.renderables.forEach((e=>this._removeRenderable(e))),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._objectEntries.has(e)}async updateAllComponentOpacities(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(null==r)return;const s=Array.isArray(t)?e=>t[e]:()=>t;r.renderables.forEach((e=>{const t=e.components.meta.length;for(let r=0;r<t;r++){const t=s(r),n=e.components.meta[r],i=n.index;n.material.opacity=t,e.components.buffer.textureBuffer.setDataElement(i,1,3,255*t)}this._updateTransparency(e)})),this.setNeedsRender()}async _getObjectMemoryUsage(e){const t=await this._getObjectEntry(e);return t?t.renderables.reduce(((e,t)=>e+t.statistics.gpuMemoryUsage),0):0}async updateAllComponentMaterials(e,t,r,s){const n=e instanceof L,i=Q(t),o=N.getKey(i,r,n),a=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=a&&(a.renderables.forEach((e=>{if(o!==e.rendererKey){const t=this._renderers.get(e.rendererKey),s=this._acquireRenderer(i,r,n);t.removeRenderable(e),--t.refCount,e.rendererKey=o,s.addRenderable(e)}if(Array.isArray(t))for(let r=0;r<t.length;r++)e.components.meta[r].material=t[r];else e.components.meta[0].material=t;s&&me(e.components),this._updateTransparency(e)})),this.setNeedsRender())}async updateAllVerticalOffsets(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));null!=r&&this._updateAllVerticalOffsets(r,t)}_updateAllVerticalOffsets(e,t){e.renderables.forEach((e=>{const r=e.components.meta;for(let s=0;s<r.length;s++)e.components.meta[s].verticalOffset=t?.[s]??0;me(e.components)})),this.setNeedsRender()}async updateObjectVisibility(e,t){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));r&&(r.renderables.forEach((e=>e.visible=t)),this.setNeedsRender())}render(e,t){if(null==this._componentColorManager)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,s=O(),n=new A;let i=0,o=0;if(this._renderers.forEach((r=>{0!==r.refCount?(++this.techniques.precompiling,r.forEachRenderable((t=>{t.visible&&(i+=t.statistics.averageEdgeLength,o++,t.regular&&r.acquireTechnique(e,!1),t.silhouette&&r.acquireTechnique(e,!0))}),t),--this.techniques.precompiling):this._renderers.delete(r.key)})),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),0===o)return;const a=new F(40*i/o,t);_(s,r[3],r[7],r[11]),n.set(s),b(a.transformWorldFromViewTH,n.high),b(a.transformWorldFromViewTL,n.low),u(a.transformViewFromCameraRelativeRS,e.camera.viewMatrix),m(Oe,a.transformViewFromCameraRelativeRS),g(a.transformNormalViewFromGlobal,Oe),a.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this._renderers.forEach((t=>{ge(t,e,a),fe(t,e,a)}))}_updateTransparency(e){const t=X(e.components.meta),r=Y(e.components.meta);t===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=t,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,t,r){e.getCombinedShaderTransformation(t,r);const s=null!=t.localOrigin?this._localOrigins.register(t.localOrigin):this._localOrigins.acquire(_(this._tmpModelPosition,r[12],r[13],r[14]));return t.localOrigin=s.origin,P(s.origin.vec3,r),s}_createComponentBuffers(e){if(null==this._componentColorManager)return null;const t=new Array,r=this._componentColorManager.getBuffer(e.length);for(let n=0;n<e.length;n++){const s=e[n],i=r.acquireIndex();t.push({index:i,verticalOffset:0,material:s})}const s=new ce(r,t);return me(s),s}_extractEdges(e,t,r,s,n,i,o=i.length){return o<se&&(n=!0),this._worker.process({data:r,indices:i,indicesLength:o,writerSettings:t,skipDeduplicate:s},e,n)}_createRenderable(e,t,r,s,n){const i=t=>new le(new k(this.rctx,V,new Map([["vertices",q],["instances",t===ee.REGULAR?H.glLayout:G.glLayout]]),new Map([["vertices",this._verticesBufferObject],["instances",te.createVertex(this.rctx,re.STATIC_DRAW,t===ee.REGULAR?e.regular.instancesData.buffer:e.silhouette.instancesData.buffer)]])),t===ee.REGULAR?e.regular.lodInfo:e.silhouette.lodInfo),o=e.regular.lodInfo.lengths.length>0?i(ee.REGULAR):null,a=e.silhouette.lodInfo.lengths.length>0?i(ee.SILHOUETTE):null,c=(o?.vao.cachedMemory??0)+(a?.vao.cachedMemory??0);return new he(o,a,{gpuMemoryUsage:c,externalMemoryUsage:n,averageEdgeLength:e.averageEdgeLength},r,X(t.meta),Y(t.meta),t,s)}async _addGeometry(e,t,r,s,n,i){if(r.edgeIndicesLength<=0)return;const o=r.attributes.get(I.POSITION),a=p(),c=this._computeModelTransformWithLocalOrigin(e,r,a),l=new je(o,a,c);return this._addPositionData(t,l,r.edgeIndicesLength,s,n,i)}async _addPositionData(e,t,r,s,n,i=!1){if(null==e.loaded)return;const o=this._createComponentBuffers([s]);if(null==o)return;const a=this._acquireRenderer(s.type,n,!0),{modelTransform:c,origin:l}=t,d=t.position.indices,h=t.position,u=h.data.length/h.size,m=B.createBuffer(u);for(let p=0;p<u;p++)m.position.set(p,0,h.data[p*h.size]),m.position.set(p,1,h.data[p*h.size+1]),m.position.set(p,2,h.data[p*h.size+2]);Z(o.meta,[0,m.componentIndex.count],m.componentIndex);const g=await this._updatingHandles.addPromise(this._extractEdges(e.abort?.signal||this._workerAbort.signal,a.writerSettings,m,!1,i,d,r));if(null==e.loaded)return;const f=this._createRenderable(g,o,new de(c,l),a.key,!1);e.renderables.push(f),a.addRenderable(f),this._gpuMemoryUsage+=f.statistics.gpuMemoryUsage}async _addComponentGeometry(e,t,r,s,n,i,o,a){if(null==t.loaded)return 0;const c=this._createComponentBuffers(i);if(null==c)return 0;const l=Q(i),d=this._acquireRenderer(l,o||!1,!1),h=B.createBuffer(r.length/3);M(h.position.typedBuffer,r,h.position.typedBufferStride,3),Z(c.meta,n,h.componentIndex,s);const u=!0,m=d.writerSettings,g=await this._updatingHandles.addPromise(this._extractEdges(this._workerAbort.signal,m,h,u,!1,s));if(null==t.loaded)return 0;const f=this._createRenderable(g,c,e,d.key,!0);return t.renderables.push(f),d.addRenderable(f),this._updateAllVerticalOffsets(t,a),f.statistics.gpuMemoryUsage}async _addObjectMergedGeometries(e,t,r,s,n){const i=new Map;let o=0,a=0,c=null;const l=e.geometries.filter((e=>{if(e.edgeIndicesLength<=0||!e.material.supportsEdges)return!1;!c&&e.localOrigin&&(c=e);const t=e.attributes.get(I.POSITION);return a+=t.data.length/t.size,o+=e.edgeIndicesLength,!0}));if(0===l.length)return;const d=a>=65536?Uint32Array:Uint16Array,h=o?new d(o):null,u=[];let m=0;l.forEach((e=>{const t=e.attributes.get(I.POSITION),r=t.indices;let s=i.get(t.data);if(null==s){s=u.length/3;for(let e=0;e<t.data.length;e+=t.size)u.push(t.data[e]),u.push(t.data[e+1]),u.push(t.data[e+2]);i.set(t.data,s)}for(let n=0;n<e.edgeIndicesLength;n++)h[m++]=s+r[n]}));const g=c||e.geometries[0],f=p(),_=this._computeModelTransformWithLocalOrigin(e,g,f);for(let p=0;p<e.geometries.length;p++)e.geometries[p].localOrigin=_.origin;const b=new je(new C(u,h,3),f,_);await this._updatingHandles.addPromise(this._addPositionData(t,b,h.length,r,s,n))}_acquireRenderer(e,t,r){const s=N.getKey(e,t,r);let n=this._renderers.get(s);return null==this._strokesTexture&&(this._strokesTexture=J(this.rctx)),n||(n=new N(this.rctx,this.techniques,{type:e,hasSlicePlane:t,strokesTexture:this._strokesTexture,legacy:r,spherical:this.viewingMode===R.Global}),this._renderers.set(s,n)),++n.refCount,n}_removeRenderable(e){ie(e.regular),ie(e.silhouette);const t=this._renderers.get(e.rendererKey);if(t){t.removeRenderable(e),--t.refCount,this._localOrigins.release(e.transform.origin),this._gpuMemoryUsage-=e.statistics.externalMemoryUsage?0:e.statistics.gpuMemoryUsage;for(const t of e.components.meta)e.components.buffer.releaseIndex(t.index)}}_updateObjectCameraDistances(e){const t=e.camera.eye,r=e.camera.viewForward,s=O(),n=e=>{y(s,e.center,t);const n=j(s,r),i=e.radius,o=n<-i?1/0:n<i?0:n-i;e.renderables.forEach((e=>e.distanceToCamera=o))};this._objectEntries.forEach(n),this._pendingDeletions.forEach(n)}get test(){}};function ie(e){e?.vao&&(e.vao.vertexBuffers.get("instances")?.dispose(),e.vao.disposeVAOOnly(),e.vao=null)}function oe(e){let t=null,s=null;for(const n of e.geometries){if(n.material.supportsEdges){if(t){if(!r(t,n.transformation))return!1}else t=n.transformation;if(s||null==n.localOrigin){if(null!=s?.localOrigin&&null!=n.localOrigin&&s.localOrigin.id!==n.localOrigin.id)return!1}else s=n}}return!0}e([d({constructOnly:!0})],ne.prototype,"rctx",void 0),e([d({constructOnly:!0})],ne.prototype,"renderSR",void 0),e([d({constructOnly:!0})],ne.prototype,"viewingMode",void 0),e([d({constructOnly:!0})],ne.prototype,"techniques",void 0),e([d({constructOnly:!0})],ne.prototype,"setNeedsRender",void 0),e([d({constructOnly:!0})],ne.prototype,"schedule",void 0),e([d({readOnly:!0})],ne.prototype,"_updatingHandles",void 0),e([d({readOnly:!0})],ne.prototype,"updating",null),ne=e([h("esri.views.3d.webgl-engine.lib.edgeRendering.EdgeView")],ne);class ae{constructor(e,t,r,s){this.abort=e,this.radius=s,this.renderables=new Array;const n=e?l(e.signal,(()=>e.abort())):null;this.loaded=t,this.loaded.then((()=>{null!=this.loaded&&(this.loaded=!0),this.abort=null,n?.remove()})),this.center=w(r)}}class ce{constructor(e,t){this.buffer=e,this.meta=t}}class le{constructor(e,t){this.vao=e,this.lod=t}}class de{constructor(e,t){this.modelMatrix=e,this.origin=t}}class he{constructor(e,t,r,s,n,i,o,a){this.regular=e,this.silhouette=t,this.statistics=r,this.transform=s,this.edgeTransparency=n,this.objectTransparency=i,this.components=o,this.rendererKey=a,this.distanceToCamera=0,this.visible=!0}}class ue extends he{}function me(e){const{meta:t,buffer:r}=e,s=new Uint8Array(4);for(let n=0;n<t.length;n++){const e=t[n].material,o=t[n].index,a=i(Math.round(e.size*W),0,255),c=i(e.extensionLength,-128,255-z)+z,l=255*e.opacity,d=e.color,h=255*d[0],u=255*d[1],m=255*d[2],g=255*d[3];r.textureBuffer.setData(o,0,h,u,m,g),r.textureBuffer.setData(o,1,a,c,e.type,l),T(t[n].verticalOffset,s),r.textureBuffer.setData(o,2,s[0],s[1],s[2],s[3])}}function ge(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable((i=>{if(!pe(i)||!i.visible)return;s??=e.acquireTechnique(t,!1),n??=e.rctx.bindTechnique(s,t,r);const a=ye(i.regular.lod.lengths,i.distanceToCamera,o);e.renderRegularEdges(n,i,r,t,a)}),i)}function fe(e,t,r){let s,n;const i=r.transparency,o=t.camera.perScreenPixelRatio;e.forEachRenderable((i=>{if(!be(i)||!i.visible)return;s??=e.acquireTechnique(t,!0),n??=e.rctx.bindTechnique(s,t,r);const a=ye(i.silhouette.lod.lengths,i.distanceToCamera,o);e.renderSilhouetteEdges(n,i,r,t,a)}),i)}function pe(e){return null!=e.regular}class _e extends he{}function be(e){return null!=e.silhouette}function ye(e,t,r){const n=t*r,i=s(e,n,!0);return-1===i?n<e[0]?e.length:0:e.length-i}class je{constructor(e,t,r){this.position=e,this.modelTransform=t,this.origin=r}}const Oe=f(),we=()=>Promise.reject();export{ne as EdgeView,de as LegacyTransform,ue as RegularRenderable,he as Renderable,_e as SilhouetteRenderable};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getScaling as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{diameter as t}from"../../../../geometry/support/aaBoundingBox.js";import{g as n}from"../../../../chunks/sphere.js";import{isPclIntersectorResult as i,isI3sIntersectorResult as
|
|
5
|
+
import{getScaling as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{diameter as t}from"../../../../geometry/support/aaBoundingBox.js";import{g as n}from"../../../../chunks/sphere.js";import{isPclIntersectorResult as i,isI3sIntersectorResult as a,isVoxelIntersectorResult as l,isTiles3DIntersectorResult as c}from"../../layers/i3s/Intersector.js";import{isTerrainIntersectorResult as u,isOverlayIntersectorResult as o}from"../../terrain/Intersector.js";import{isObjectIntersectorResult as s,isHudIntersectorResult as g}from"./intersectorUtils.js";import{isLodIntersectorResult as p}from"./lodRendering/Intersector.js";function f(r,e){return s(r)||g(r)?b(r.target?.object,e):u(r)?e.map?.ground:i(r)||a(r)||o(r)||l(r)?b(r.target,e):null}function h(r,e){const t=y(r,e);return null!=t&&"graphic"===t.type?t.graphic:null}function y(r,e){if(null==r)return null;if(s(r)||g(r))return m(r.target?.object,e);if(i(r)){const e=r.target.createGraphic();return{type:"graphic",graphic:e,layer:e.layer}}if(l(r)){const e=r.target.createVoxelGraphic();return{type:"graphic",graphic:e,layer:e.layer}}if(c(r)){const e=r.target.createTiles3DGraphic();return{type:"graphic",graphic:e,layer:e.layer}}return o(r)||p(r)?m(r.target,e):a(r)?V(r.target,e):null}async function d(r,e){if(null==r)return null;if(s(r)||g(r))return U(r.target?.object,e);if(i(r)){const e=r.target.createGraphic();return{type:"graphic",graphic:e,layer:e.layer}}if(l(r)){const e=r.target.createVoxelGraphic();return{type:"graphic",graphic:e,layer:e.layer}}if(c(r)){const e=r.target.createTiles3DGraphic();return{type:"graphic",graphic:e,layer:e.layer}}return o(r)||p(r)?U(r.target,e):a(r)?V(r.target,e):null}function m(r,e){if(null==r?.graphicUid)return null;const t=b(r,e);if(null==t)return null;if(t===e.graphics)return null==e.graphicsView||"number"!=typeof r.graphicUid?null:e.graphicsView.getHit(r.graphicUid);const n=e.allLayerViews.find((r=>r.layer===t));return!n||n.suspended||null==r.graphicUid?null:"getHit"in n?n.getHit(r.graphicUid):null}async function U(r,e){if(null==r?.graphicUid)return null;const t=b(r,e);if(null==t)return null;if(t===e.graphics)return null==e.graphicsView||"number"!=typeof r.graphicUid?null:await e.graphicsView.getHitAsync(r.graphicUid);const n=e.allLayerViews.find((r=>r.layer===t));return!n||n.suspended||null==r.graphicUid?null:"getHitAsync"in n?await n.getHitAsync(r.graphicUid):null}function V(r,e){const t=b(r,e);if(null==t)return null;const n=e.allLayerViews.find((r=>r.layer===t));return n&&!n.suspended&&"getGraphicFromIntersectorTarget"in n?w(n.getGraphicFromIntersectorTarget(r)):null}function j(r,e){const t=b(r,e);if(null==t)return null;const n=e.allLayerViews.find((r=>r.layer===t));return n&&!n.suspended&&"getAABBFromIntersectorTarget"in n?n.getAABBFromIntersectorTarget(r):null}function w(r){return null!=r?{type:"graphic",graphic:r,layer:r.layer}:null}function b(r,e){return null==r?.layerUid?null:null!=e.graphicsView&&r.layerUid===e.graphicsView.processor.layer.id?e.graphics:e.map.allLayers.find((e=>e.uid===r.layerUid))}function G(e,i){if(s(e)||g(e))return n(e.target.object.boundingVolumeWorldSpace.bounds);if(p(e)){r(A,e.transformation);const t=Math.max(A[0],A[1],A[2]);return e.target.baseBoundingSphere.radius*t}if(a(e)){const r=j(e.target,i);return r?.5*t(r):null}return null}function x(r){return!s(r)&&!g(r)&&(p(r)?r.target.numLodLevels>1:!!a(r))}const A=e();export{G as getIntersectedFeatureBSRadius,x as hasLod,h as toGraphic,y as toHit,d as toHitAsync,f as toOwner};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{unique as e}from"../../../../../core/arrayUtils.js";import{baseTypedArrayMemory as t,estimateNumberArrayMemory as r}from"../../../../../core/memoryEstimations.js";import{newIntersectorResult as s}from"../Intersector.js";import{IntersectorType as n,StoreResults as i}from"../IntersectorInterfaces.js";import{VertexAttribute as o}from"../VertexAttribute.js";import{LodTarget as u}from"./Intersector.js";class m{constructor(e,t,r,s){this.material=e,this.bufferWriter=e.createBufferWriter(),this.vertexBufferLayout=this.bufferWriter.vertexBufferLayout,this.buffer=t,this.elementCount=r,this.boundingInfo=s}get numTriangles(){return this.elementCount/3}get numVertices(){return this.elementCount}computeUsedMemory(){return this.buffer.byteLength+t}getRenderGeometry(){return this}intersect(e,t,r,s,n,i,o,u){const m=this.bufferWriter,a=this.buffer;m.intersect(a,e,r,s,((r,s,m,a,l)=>c(r,s,m,l,e,t,i,o,n,u)))}}class a{constructor(e){this.engineGeometry=e}get material(){return this.engineGeometry.material}get numVertices(){return this.engineGeometry.attributes.get(o.POSITION).indices.length}get numTriangles(){return this.engineGeometry.indexCount/3}get boundingInfo(){return this.engineGeometry.boundingInfo}computeUsedMemory(){return Array.from(this.engineGeometry.attributes.values()).reduce(((e,t)=>e+r(t.data,t.indices)),0)}getRenderGeometry(){const e=this.material,t=this.engineGeometry,r=t.attributes,s=t.boundingInfo,n=e.createBufferWriter(),i=n.vertexBufferLayout,o=n.elementCount(r),u=i.createBuffer(o);return n.write(null,null,r,null,u,0),new m(e,u.buffer,o,s)}intersect(e,t,r,s,n,i,o,u){const m=this.engineGeometry;this.material.intersect(m,e.transform.transform,e,r,s,((r,s,m,a,l)=>c(r,s,m,l,e,t,i,o,n,u)))}}function c(e,t,r,o,m,a,c,l,f,h){if(e<0)return;if(a&&!a(m.rayBegin,m.rayEnd,e))return;const g=new u(c.layerUid,c.graphicUid(f),r,l,h);if((null==m.results.min.drapedLayerOrder||o>=m.results.min.drapedLayerOrder)&&(null==m.results.min.dist||e<m.results.min.dist)&&m.results.min.set(n.LOD,g,e,t,m.transform.transform,o),m.options.store!==i.MIN&&(null==m.results.max.drapedLayerOrder||o>=m.results.max.drapedLayerOrder)&&(null==m.results.max.dist||e>m.results.max.dist)&&m.results.max.set(n.LOD,g,e,t,m.transform.transform,o),m.options.store===i.ALL){const r=s(m.results.min.ray);r.set(n.LOD,g,e,t,m.transform.transform,o),m.results.all.push(r)}}class l{constructor(e,t=null){this.geometry=e,this.textures=t}get material(){return this.geometry.material}get numTriangles(){return this.geometry.numTriangles}}class f{constructor(t,r,s){this.components=t,this.minScreenSpaceRadius=r,this.pivotOffset=s;const n=e(this.components.map((e=>e.geometry)));this.numVertices=n.reduce(((e,t)=>e+t.numVertices),0)}}class h{constructor(e){this.levels=e,this.levels.sort(((e,t)=>e.minScreenSpaceRadius===t.minScreenSpaceRadius?e.numVertices-t.numVertices:e.minScreenSpaceRadius-t.minScreenSpaceRadius))}getMaterials(){const t=[];return this.levels.forEach((e=>e.components.forEach((e=>t.push(e.geometry.material))))),e(t)}getTextures(){const t=new Array;return this.levels.forEach((e=>e.components.forEach((e=>{null!=e.textures&&t.push(...e.textures)})))),e(t)}getGeometries(){const t=new Array;return this.levels.forEach((e=>e.components.forEach((e=>{t.push(e.geometry)})))),e(t)}getEngineGeometries(){return this.getGeometries().map((e=>e.engineGeometry)).filter((e=>null!=e))}computeUsedMemory(){const e=this.getGeometries(),t=this.getTextures(),r=e.reduce(((e,t)=>e+t.computeUsedMemory()),0);return t.reduce(((e,t)=>e+t.memoryEstimate),0)+r}}export{a as LodComponentEngineGeometry,m as LodComponentRenderGeometry,l as LodComponentResources,f as LodLevelResources,h as LodResources};
|
|
5
|
+
import{unique as e}from"../../../../../core/arrayUtils.js";import{baseTypedArrayMemory as t,estimateNumberArrayMemory as r}from"../../../../../core/memoryEstimations.js";import{newIntersectorResult as s}from"../Intersector.js";import{IntersectorType as n,StoreResults as i}from"../IntersectorInterfaces.js";import{VertexAttribute as o}from"../VertexAttribute.js";import{LodTarget as u}from"./Intersector.js";class m{constructor(e,t,r,s){this.material=e,this.bufferWriter=e.createBufferWriter(),this.vertexBufferLayout=this.bufferWriter.vertexBufferLayout,this.buffer=t,this.elementCount=r,this.boundingInfo=s}get numTriangles(){return this.elementCount/3}get numVertices(){return this.elementCount}computeUsedMemory(){return this.buffer.byteLength+t}getRenderGeometry(){return this}intersect(e,t,r,s,n,i,o,u){const m=this.bufferWriter,a=this.buffer;m.intersect(a,this.material.parameters,null,e,r,s,((r,s,m,a,l)=>c(r,s,m,l,e,t,i,o,n,u)))}}class a{constructor(e){this.engineGeometry=e}get material(){return this.engineGeometry.material}get numVertices(){return this.engineGeometry.attributes.get(o.POSITION).indices.length}get numTriangles(){return this.engineGeometry.indexCount/3}get boundingInfo(){return this.engineGeometry.boundingInfo}computeUsedMemory(){return Array.from(this.engineGeometry.attributes.values()).reduce(((e,t)=>e+r(t.data,t.indices)),0)}getRenderGeometry(){const e=this.material,t=this.engineGeometry,r=t.attributes,s=t.boundingInfo,n=e.createBufferWriter(),i=n.vertexBufferLayout,o=n.elementCount(r),u=i.createBuffer(o);return n.write(null,null,r,null,u,0),new m(e,u.buffer,o,s)}intersect(e,t,r,s,n,i,o,u){const m=this.engineGeometry;this.material.intersect(m,e.transform.transform,e,r,s,((r,s,m,a,l)=>c(r,s,m,l,e,t,i,o,n,u)))}}function c(e,t,r,o,m,a,c,l,f,h){if(e<0)return;if(a&&!a(m.rayBegin,m.rayEnd,e))return;const g=new u(c.layerUid,c.graphicUid(f),r,l,h);if((null==m.results.min.drapedLayerOrder||o>=m.results.min.drapedLayerOrder)&&(null==m.results.min.dist||e<m.results.min.dist)&&m.results.min.set(n.LOD,g,e,t,m.transform.transform,o),m.options.store!==i.MIN&&(null==m.results.max.drapedLayerOrder||o>=m.results.max.drapedLayerOrder)&&(null==m.results.max.dist||e>m.results.max.dist)&&m.results.max.set(n.LOD,g,e,t,m.transform.transform,o),m.options.store===i.ALL){const r=s(m.results.min.ray);r.set(n.LOD,g,e,t,m.transform.transform,o),m.results.all.push(r)}}class l{constructor(e,t=null){this.geometry=e,this.textures=t}get material(){return this.geometry.material}get numTriangles(){return this.geometry.numTriangles}}class f{constructor(t,r,s){this.components=t,this.minScreenSpaceRadius=r,this.pivotOffset=s;const n=e(this.components.map((e=>e.geometry)));this.numVertices=n.reduce(((e,t)=>e+t.numVertices),0)}}class h{constructor(e){this.levels=e,this.levels.sort(((e,t)=>e.minScreenSpaceRadius===t.minScreenSpaceRadius?e.numVertices-t.numVertices:e.minScreenSpaceRadius-t.minScreenSpaceRadius))}getMaterials(){const t=[];return this.levels.forEach((e=>e.components.forEach((e=>t.push(e.geometry.material))))),e(t)}getTextures(){const t=new Array;return this.levels.forEach((e=>e.components.forEach((e=>{null!=e.textures&&t.push(...e.textures)})))),e(t)}getGeometries(){const t=new Array;return this.levels.forEach((e=>e.components.forEach((e=>{t.push(e.geometry)})))),e(t)}getEngineGeometries(){return this.getGeometries().map((e=>e.engineGeometry)).filter((e=>null!=e))}computeUsedMemory(){const e=this.getGeometries(),t=this.getTextures(),r=e.reduce(((e,t)=>e+t.computeUsedMemory()),0);return t.reduce(((e,t)=>e+t.memoryEstimate),0)+r}}export{a as LodComponentEngineGeometry,m as LodComponentRenderGeometry,l as LodComponentResources,f as LodLevelResources,h as LodResources};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as e}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as i}from"../core/shaderLibrary/util/AlphaCutoff.js";import s from"../lib/GLMaterial.js";import{MaterialParameters as o}from"../lib/Material.js";import{RenderSlot as a}from"../lib/RenderSlot.js";import{DefaultBufferWriter as n}from"./DefaultBufferWriter.js";import{PositionUVLayout as h}from"./DefaultLayouts.js";import{TriangleMaterial as p}from"./TriangleMaterial.js";import{CheckerBoardTechnique as f}from"../shaders/CheckerBoardTechnique.js";import{CheckerBoardTechniqueConfiguration as c}from"../shaders/CheckerBoardTechniqueConfiguration.js";class
|
|
5
|
+
import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as e}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as i}from"../core/shaderLibrary/util/AlphaCutoff.js";import s from"../lib/GLMaterial.js";import{MaterialParameters as o}from"../lib/Material.js";import{RenderSlot as a}from"../lib/RenderSlot.js";import{DefaultBufferWriter as n}from"./DefaultBufferWriter.js";import{PositionUVLayout as h}from"./DefaultLayouts.js";import{TriangleMaterial as p}from"./TriangleMaterial.js";import{CheckerBoardTechnique as f}from"../shaders/CheckerBoardTechnique.js";import{CheckerBoardTechniqueConfiguration as c}from"../shaders/CheckerBoardTechniqueConfiguration.js";class l extends p{constructor(r){super(r,m),this._configuration=new c,this.produces=new Map([[a.OPAQUE_MATERIAL,r=>e(r)&&!this.transparent],[a.TRANSPARENT_MATERIAL,r=>e(r)&&this.transparent&&this.parameters.writeDepth],[a.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,r=>e(r)&&this.transparent&&!this.parameters.writeDepth]])}getConfiguration(r,t){return this._configuration.transparent=this.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}get visible(){return this.parameters.color1[3]>=i||this.parameters.color2[3]>=i}get transparent(){return this.parameters.color1[3]<1||this.parameters.color2[3]<1}createGLMaterial(r){return new u(r)}createBufferWriter(){return new n(h)}}class u extends s{beginSlot(r){return this.getTechnique(f,r)}}class m extends o{constructor(){super(...arguments),this.size=r(1,1),this.color1=t(.75,.75,.75,1),this.color2=t(.5,.5,.5,1),this.writeDepth=!0,this.polygonOffset=!1}}export{l as CheckerBoardMaterial,m as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmissionOrOID as e,isDepth as s,is2DGeometryOutput as i,isColorOrColorEmission as a,ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as n}from"../core/shaderLibrary/util/AlphaCutoff.js";import{olidEnabled as h}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as p}from"../lib/basicInterfaces.js";import l from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{VertexAttribute as f}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as m}from"./DefaultBufferWriter.js";import{TriangleMaterial as _}from"./TriangleMaterial.js";import{VisualVariablePassParameters as
|
|
5
|
+
import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmissionOrOID as e,isDepth as s,is2DGeometryOutput as i,isColorOrColorEmission as a,ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as n}from"../core/shaderLibrary/util/AlphaCutoff.js";import{olidEnabled as h}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as p}from"../lib/basicInterfaces.js";import l from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{VertexAttribute as f}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as m}from"./DefaultBufferWriter.js";import{TriangleMaterial as _}from"./TriangleMaterial.js";import{VisualVariablePassParameters as g}from"./VisualVariablePassParameters.js";import{ColorMaterialTechnique as T}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as O}from"../shaders/ColorMaterialTechniqueConfiguration.js";class A extends _{constructor(t){super(t,P),this._configuration=new O,this.supportsEdges=!0,this.produces=new Map([[c.OPAQUE_MATERIAL,t=>this._isOpaqueMaterialPass(t)],[c.OPAQUE_MATERIAL_WITHOUT_NORMALS,t=>this._isOpaqueNoSSAODepthPass(t)],[c.TRANSPARENT_MATERIAL,t=>e(t)&&this._transparent&&this.parameters.writeDepth],[c.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,t=>s(t)&&this._transparent&&this.parameters.writeDepth],[c.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,t=>e(t)&&this._transparent&&!this.parameters.writeDepth],[c.DRAPED_MATERIAL,t=>i(t)]])}getConfiguration(t,r){return this._configuration.output=t,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this._transparent,this._configuration.discardInvisibleFragments=this._transparent&&!this._isOpaquePass(t)&&this.parameters.discardInvisibleFragments,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=r.hasOccludees,this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation<u,this._configuration.terrainDepthTest=r.terrainDepthTest&&a(t),this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.draped=this.parameters.draped,this._configuration}get visible(){return this.parameters.color[3]>=n}get _transparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}_isOpaquePass(t){return this._isOpaqueMaterialPass(t)||this._isOpaqueNoSSAODepthPass(t)}_isOpaqueMaterialPass(t){return t===o.Highlight||e(t)&&!this._transparent}_isOpaqueNoSSAODepthPass(t){return s(t)&&this.parameters.writeDepth&&!this._transparent}createGLMaterial(t){return new d(t)}createBufferWriter(){const t=r().vec3f(f.POSITION);return h()&&t.vec4u8(f.OBJECTANDLAYERIDCOLOR),this.parameters.vvColor?t.f32(f.COLORFEATUREATTRIBUTE):t.vec4u8(f.COLOR),new m(t)}}class d extends l{beginSlot(t){return this.getTechnique(T,t)}}class P extends g{constructor(){super(...arguments),this.color=t,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=p.None,this.draped=!1,this.discardInvisibleFragments=!1}}export{A as ColorMaterial,P as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{a as e}from"../../../../chunks/vec32.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BufferViewVec3f as r}from"../../../../geometry/support/buffer/BufferView.js";import{intersectRenderGeometryTriangles as o}from"../lib/RayIntersections.js";import{VertexAttribute as i}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as s}from"./internal/bufferWriterUtils.js";class f{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get(i.POSITION).indices.length}write(e,t,r,o,i,f){s(r,o,this.vertexBufferLayout,e,t,i,f)}intersect(t,s,f,
|
|
5
|
+
import{a as e}from"../../../../chunks/vec32.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BufferViewVec3f as r}from"../../../../geometry/support/buffer/BufferView.js";import{intersectRenderGeometryTriangles as o}from"../lib/RayIntersections.js";import{VertexAttribute as i}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as s}from"./internal/bufferWriterUtils.js";class f{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.get(i.POSITION).indices.length}write(e,t,r,o,i,f){s(r,o,this.vertexBufferLayout,e,t,i,f)}intersect(t,s,f,n,c,m,l){const a=this.vertexBufferLayout.createView(t).getField(i.POSITION,r);if(null==a)return;const p=e(u,m,c),y=0,b=a.count/3,d=n.options.normalRequired,j=(e,t,r)=>{l(e,r,t,!1)};o(c,p,y,b,a.typedBuffer,a.typedBufferStride,d,j)}}const u=t();export{f as DefaultBufferWriter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{p as e,i as r,c as t,n as i,d as s,l as a,h as o,f as n,q as c}from"../../../../chunks/vec32.js";import{ZEROS as l,create as u,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as f}from"../../../ViewingMode.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import{is3DGeometryOutputMRT as p,isShadowRelatedOutput as d,is3DGeometryOutput as g,ShaderOutput as T,isColorOrColorEmission as x}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as _}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{EmissionSource as v}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as b}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as S}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{alphaCutoff as O}from"../core/shaderLibrary/util/AlphaCutoff.js";import{olidEnabled as M}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as w}from"../lib/basicInterfaces.js";import{GLTextureMaterial as R}from"../lib/GLTextureMaterial.js";import{Material as y}from"../lib/Material.js";import{OITPolygonOffsetLimit as C}from"../lib/OrderIndependentTransparency.js";import{intersectTriangleGeometry as A}from"../lib/RayIntersections.js";import{RenderSlot as I}from"../lib/RenderSlot.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{getVerticalOffsetObject3D as j}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as L}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as D}from"./internal/MaterialUtil.js";import{DefaultMaterialTechnique as N,DefaultMaterialPassParameters as E}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as V}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as B}from"../shaders/RealisticTreeTechnique.js";class
|
|
5
|
+
import{p as e,i as r,c as t,n as i,d as s,l as a,h as o,f as n,q as c}from"../../../../chunks/vec32.js";import{ZEROS as l,create as u,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ViewingMode as f}from"../../../ViewingMode.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import{is3DGeometryOutputMRT as p,isShadowRelatedOutput as d,is3DGeometryOutput as g,ShaderOutput as T,isColorOrColorEmission as x}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as _}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{EmissionSource as v}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as b}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as S}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{alphaCutoff as O}from"../core/shaderLibrary/util/AlphaCutoff.js";import{olidEnabled as M}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as w}from"../lib/basicInterfaces.js";import{GLTextureMaterial as R}from"../lib/GLTextureMaterial.js";import{Material as y}from"../lib/Material.js";import{OITPolygonOffsetLimit as C}from"../lib/OrderIndependentTransparency.js";import{intersectTriangleGeometry as A}from"../lib/RayIntersections.js";import{RenderSlot as I}from"../lib/RenderSlot.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{getVerticalOffsetObject3D as j}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as L}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as D}from"./internal/MaterialUtil.js";import{DefaultMaterialTechnique as N,DefaultMaterialPassParameters as E}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as V}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as B}from"../shaders/RealisticTreeTechnique.js";class z extends y{constructor(e,r){super(e,U),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[I.OPAQUE_MATERIAL,e=>(p(e)||d(e))&&!this.parameters.transparent],[I.TRANSPARENT_MATERIAL,e=>(p(e)||d(e))&&this.parameters.transparent&&this.parameters.writeDepth],[I.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>(g(e)||d(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=k(this.parameters),this._configuration=new V(r.spherical,r.doublePrecisionRequiresObfuscation)}isVisibleForOutput(e){return e!==T.Shadow&&e!==T.ShadowExcludeHighlight&&e!==T.ShadowHighlight||this.parameters.castShadows}get visible(){const e=this.parameters;if(e.layerOpacity<O)return!1;const{hasInstancedColor:r,hasVertexColors:t,hasSymbolColors:i,vvColor:s}=e,a=r||s||i,o="replace"===e.colorMixMode,n=e.opacity>=O;if(t&&a)return o||n;const c=e.externalColor&&e.externalColor[3]>=O;return t?o?c:n:a?o||n:o?c:n}get hasEmissions(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveFactor,l)}getConfiguration(e,r){const t=this.parameters,{treeRendering:i,doubleSided:s,doubleSidedType:a}=t;return this._configuration.output=e,this._configuration.hasNormalTexture=!i&&!!t.normalTextureId,this._configuration.hasColorTexture=!!t.textureId,this._configuration.hasVertexTangents=!i&&t.hasVertexTangents,this._configuration.instanced=t.isInstanced,this._configuration.instancedDoublePrecision=t.instancedDoublePrecision,this._configuration.vvSize=!!t.vvSize,this._configuration.hasVerticalOffset=null!=t.verticalOffset,this._configuration.hasScreenSizePerspective=null!=t.screenSizePerspective,this._configuration.hasSlicePlane=t.hasSlicePlane,this._configuration.alphaDiscardMode=t.textureAlphaMode,this._configuration.normalType=i?_.Attribute:t.normalType,this._configuration.transparent=t.transparent,this._configuration.writeDepth=t.writeDepth,null!=t.customDepthTest&&(this._configuration.customDepthTest=t.customDepthTest),this._configuration.hasOccludees=r.hasOccludees,this._configuration.cullFace=t.hasSlicePlane?w.None:t.cullFace,this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.hasModelTransformation=!i&&null!=t.modelTransformation,this._configuration.hasVertexColors=t.hasVertexColors,this._configuration.hasSymbolColors=t.hasSymbolColors,this._configuration.doubleSidedMode=i?b.WindingOrder:s&&"normal"===a?b.View:s&&"winding-order"===a?b.WindingOrder:b.None,this._configuration.instancedColor=t.hasInstancedColor,x(e)?(this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.receiveShadows=t.receiveShadows,this._configuration.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=r.ssao):(this._configuration.terrainDepthTest=!1,this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1),this._configuration.vvColor=!!t.vvColor,this._configuration.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,this._configuration.pbrMode=t.usePBR?t.isSchematic?S.Schematic:S.Normal:S.Disabled,this._configuration.hasMetallicRoughnessTexture=!i&&!!t.metallicRoughnessTextureId,this._configuration.emissionSource=i?v.None:null!=t.emissiveTextureId?v.Texture:t.usePBR?v.Value:v.None,this._configuration.hasOcclusionTexture=!i&&!!t.occlusionTextureId,this._configuration.offsetBackfaces=!(!t.transparent||!t.offsetTransparentBackfaces),this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation<C,this._configuration.snowCover=W(r),this._configuration.hasColorTextureTransform=!!t.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix,this._configuration}intersect(e,l,u,h,m,p){if(null!=this.parameters.verticalOffset){const e=u.camera;r(Q,l[12],l[13],l[14]);let p=null;switch(u.viewingMode){case f.Global:p=i(Y,Q);break;case f.Local:p=t(Y,H)}let d=0;const g=s(K,Q,e.eye),T=a(g),x=o(g,g,1/T);let _=null;this.parameters.screenSizePerspective&&(_=n(p,x)),d+=D(e,T,this.parameters.verticalOffset,_??0,this.parameters.screenSizePerspective),o(p,p,d),c(J,p,u.transform.inverseRotation),h=s(F,h,J),m=s(G,m,J)}A(e,u,h,m,j(u.verticalOffset),p)}createGLMaterial(e){return new q(e)}createBufferWriter(){return new L(this._vertexBufferLayout)}}class q extends R{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const i=e.camera.viewInverseTransposeMatrix;return r(t.origin,i[3],i[7],i[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?B:N,e)}}class U extends E{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}}function W(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}function k(e){const r=m().vec3f(P.POSITION);e.normalType===_.Compressed?r.vec2i16(P.NORMALCOMPRESSED,{glNormalized:!0}):r.vec3f(P.NORMAL),e.hasVertexTangents&&r.vec4f(P.TANGENT);return(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&r.vec2f(P.UV0),e.hasVertexColors&&r.vec4u8(P.COLOR),e.hasSymbolColors&&r.vec4u8(P.SYMBOLCOLOR),M()&&r.vec4u8(P.OBJECTANDLAYERIDCOLOR),r}const F=u(),G=u(),H=h(0,0,1),Y=u(),J=u(),Q=u(),K=u();export{q as DefaultGLMaterial,z as DefaultMaterial,U as DefaultMaterialParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as o,rotate as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as c,fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as f,t as h,n as p,d as u,h as m,c as d,l as g,j as O,g as S,q as T,f as b}from"../../../../chunks/vec32.js";import{create as v,fromValues as A}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as E,create as _,freeze as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMat4 as R}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as x}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as C}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as P}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as y}from"../../support/debugFlags.js";import{newLayout as D}from"../../support/buffer/InterleavedLayout.js";import{isColorEmissionHighlightOrOID as F,isColorOrColorEmission as L}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as j}from"../core/shaderLibrary/hud/HUD.glsl.js";import{alphaCutoff as N}from"../core/shaderLibrary/util/AlphaCutoff.js";import{olidEnabled as z}from"../effects/geometry/olidUtils.js";import{GLTextureMaterial as U,GLTextureMaterialBindParameters as M}from"../lib/GLTextureMaterial.js";import{Material as w,RenderOccludedFlag as B}from"../lib/Material.js";import{RenderSlot as V}from"../lib/RenderSlot.js";import{applyScaleFactor as q,applyPrecomputedScaleFactor as G,precomputeScaleFactor as H}from"../lib/screenSizePerspectiveUtils.js";import{assert as W}from"../lib/Util.js";import{VertexAttribute as X}from"../lib/VertexAttribute.js";import{ScaleInfo as Y}from"./ScaleInfo.js";import{writePosition as Z,writeNormal as k,writeColor as J,writeBufferFloat as K,writeBufferVec4 as Q,writeBufferVec4Zeros as $,writeObjectAndLayerIdColor as ee}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as te}from"./internal/MaterialUtil.js";import{c as se}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as ie}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as re}from"../shaders/HUDMaterialTechniqueConfiguration.js";class ae extends w{constructor(e,t){super(e,ye),this.produces=new Map([[V.HUD_MATERIAL,e=>F(e)&&!this.parameters.drawAsLabel],[V.LABEL_MATERIAL,e=>F(e)&&this.parameters.drawAsLabel],[V.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[V.DRAPED_MATERIAL,e=>this.parameters.draped&&F(e)]]),this._visible=!0,this._configuration=new re(t)}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.draped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===V.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||t.slot===V.OCCLUSION_PIXELS,L(e)&&(this._configuration.debugDrawLabelBorder=!!y.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,i,a,o,n){const{options:{selectionMode:c,hud:l,excludeLabels:S},point:T,camera:b}=i,{parameters:A}=this;if(!c||!l||S&&A.isLabel||!e.visible||!T)return;const{scaleX:E,scaleY:_}=this._getScreenScale(e,b.pixelRatio);s(Te,t),e.attributes.has(X.FEATUREATTRIBUTE)&&le(Te);const I=e.attributes.get(X.POSITION),R=e.attributes.get(X.SIZE),x=e.attributes.get(X.NORMAL),C=e.attributes.get(X.ROTATION),P=e.attributes.get(X.CENTEROFFSETANDDISTANCE);W(I.size>=3);const y=se(A),D="screen"===this.parameters.centerOffsetUnits;for(let s=0;s<I.data.length/I.size;s++){const e=s*I.size;f(pe,I.data[e],I.data[e+1],I.data[e+2]),h(pe,pe,t),h(pe,pe,b.viewMatrix);const a=s*P.size;if(f(Ae,P.data[a],P.data[a+1],P.data[a+2]),!D&&(pe[0]+=Ae[0],pe[1]+=Ae[1],0!==Ae[2])){const e=Ae[2];p(Ae,pe),u(pe,pe,m(Ae,Ae,e))}const o=s*x.size;if(f(ue,x.data[o],x.data[o+1],x.data[o+2]),ce(ue,Te,b,Ie),this._applyVerticalOffsetTransformationView(pe,Ie,b,he),b.applyProjection(pe,me),me[0]>-1){D&&(Ae[0]||Ae[1])&&(me[0]+=Ae[0]*b.pixelRatio,0!==Ae[1]&&(me[1]+=q(Ae[1],he.factorAlignment)*b.pixelRatio),b.unapplyProjection(me,pe)),me[0]+=this.parameters.screenOffset[0]*b.pixelRatio,me[1]+=this.parameters.screenOffset[1]*b.pixelRatio,me[0]=Math.floor(me[0]),me[1]=Math.floor(me[1]);const e=s*R.size;Ce[0]=R.data[e],Ce[1]=R.data[e+1],G(Ce,he.factor,Ce);const t=Re*b.pixelRatio;let a=0;if(A.textureIsSignedDistanceField){a=Math.min(A.outlineSize,.5*Ce[0])*b.pixelRatio/2}Ce[0]*=E,Ce[1]*=_;const o=s*C.size,c=A.rotation+C.data[o];if(fe(T,me[0],me[1],Ce,t,a,c,A,y)){const e=i.ray;if(h(ge,pe,r(ve,b.viewMatrix)),me[0]=T[0],me[1]=T[1],b.unprojectFromRenderScreen(me,pe)){const t=v();d(t,e.direction);const s=1/g(t);m(t,t,s);n(O(e.origin,pe)*s,t,-1,!0,1,ge)}}}}}intersectDraped(e,t,s,i,r,a){const o=e.attributes.get(X.POSITION),n=e.attributes.get(X.SIZE),c=e.attributes.get(X.ROTATION),l=this.parameters,f=se(l),{scaleX:h,scaleY:p}=this._getScreenScale(e,e.screenToWorldRatio),u=xe*e.screenToWorldRatio;for(let m=0;m<o.data.length/o.size;m++){const t=m*o.size,s=o.data[t],d=o.data[t+1],g=m*n.size;Ce[0]=n.data[g],Ce[1]=n.data[g+1];let O=0;if(l.textureIsSignedDistanceField){O=Math.min(l.outlineSize,.5*Ce[0])*e.screenToWorldRatio/2}Ce[0]*=h,Ce[1]*=p;const S=m*c.size,T=l.rotation+c.data[S];fe(i,s,d,Ce,u,O,T,l,f)&&r(a.dist,a.normal,-1,!1)}}createBufferWriter(){return new Le}_updateScaleInfo(e,t,s){const i=this.parameters;null!=i.screenSizePerspective?H(s,t,i.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minScaleFactor=0),null!=i.screenSizePerspectiveAlignment?H(s,t,i.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minScaleFactor=e.factor.minScaleFactor)}applyShaderOffsetsView(e,t,s,i,r,a,o){const n=ce(t,s,r,Ie);return this._applyVerticalGroundOffsetView(e,n,r,o),this._applyVerticalOffsetTransformationView(o,n,r,a),this._applyPolygonOffsetView(o,n,i[3],r,o),this._applyCenterOffsetView(o,i,o),o}applyShaderOffsetsNDC(e,t,s,i,r){return this._applyCenterOffsetNDC(e,t,s,i),null!=r&&d(r,i),this._applyPolygonOffsetNDC(i,t,s,i),i}_applyPolygonOffsetView(t,s,i,r,a){const o=r.aboveGround?1:-1;let n=Math.sign(i);0===n&&(n=o);const c=o*n;if(this.parameters.shaderPolygonOffset<=0)return d(a,t);const l=e(Math.abs(s.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/r.viewport[2];return m(a,t,c>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,s,i){const r=g(e),a=s.aboveGround?1:-1,o=s.computeRenderPixelSizeAtDist(r)*j,n=m(pe,t.normal,a*o);return S(i,e,n),i}_applyVerticalOffsetTransformationView(e,t,s,i){const r=this.parameters;if(!r.verticalOffset?.screenLength){if(r.screenSizePerspective||r.screenSizePerspectiveAlignment){const s=g(e);this._updateScaleInfo(i,s,t.cosAngle)}else i.factor.scale=1,i.factorAlignment.scale=1;return e}const a=g(e),o=r.screenSizePerspectiveAlignment??r.screenSizePerspective,n=te(s,a,r.verticalOffset,t.cosAngle,o);return this._updateScaleInfo(i,a,t.cosAngle),m(t.normal,t.normal,n),S(e,e,t.normal)}_applyCenterOffsetView(e,t,s){const i="screen"!==this.parameters.centerOffsetUnits;return s!==e&&d(s,e),i&&(s[0]+=t[0],s[1]+=t[1],t[2]&&(p(ue,s),S(s,s,m(ue,ue,t[2])))),s}_applyCenterOffsetNDC(e,t,s,i){const r="screen"!==this.parameters.centerOffsetUnits;return i!==e&&d(i,e),r||(i[0]+=t[0]/s.fullWidth*2,i[1]+=t[1]/s.fullHeight*2),i}_applyPolygonOffsetNDC(e,t,s,i){const r=this.parameters.shaderPolygonOffset;if(e!==i&&d(i,e),r){const e=s.aboveGround?1:-1,a=e*Math.sign(t[3]);i[2]-=(a||e)*r}return i}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:s}=this.parameters,i=e[3]>=N||t>=N&&s[3]>=N;return this._visible&&i}createGLMaterial(e){return new oe(e)}calculateRelativeScreenBounds(e,t,s=x()){return ne(this.parameters,e,t,s),s[2]=s[0]+e[0],s[3]=s[1]+e[1],s}_getScreenScale(e,t){const s=e.attributes.get(X.FEATUREATTRIBUTE);if(null==s)return{scaleX:t,scaleY:t};const i=E(s.data,_e);return P(Ee,this.parameters,i),{scaleX:Ee[0]*t,scaleY:Ee[1]*t}}}class oe extends U{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.acquireTechnique(ie,e)}}function ne(e,t,s,i){i[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*s,i[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*s}function ce(e,t,i,r){return R(t)&&(t=s(be,t)),T(r.normal,e,t),h(r.normal,r.normal,i.viewInverseTransposeMatrix),r.cosAngle=b(de,Pe),r}function le(e){const t=e[0],s=e[1],i=e[2],r=e[3],a=e[4],o=e[5],n=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+s*s+i*i),h=1/Math.sqrt(r*r+a*a+o*o),p=1/Math.sqrt(n*n+c*c+l*l);return e[0]=t*f,e[1]=s*f,e[2]=i*f,e[3]=r*h,e[4]=a*h,e[5]=o*h,e[6]=n*p,e[7]=c*p,e[8]=l*p,e}function fe(e,s,i,r,a,c,l,f,h){let p=s-a-r[0]*h[0],u=p+r[0]+2*a,m=i-a-r[1]*h[1],d=m+r[1]+2*a;const g=f.distanceFieldBoundingBox;return f.textureIsSignedDistanceField&&null!=g&&(p+=r[0]*g[0],m+=r[1]*g[1],u-=r[0]*(1-g[2]),d-=r[1]*(1-g[3]),p-=c,u+=c,m-=c,d+=c),o(Se,s,i),n(Oe,e,Se,t(l)),Oe[0]>p&&Oe[0]<u&&Oe[1]>m&&Oe[1]<d}const he=new Y,pe=v(),ue=v(),me=_(),de=v(),ge=v(),Oe=c(),Se=c(),Te=i(),be=i(),ve=a(),Ae=v(),Ee=v(),_e=_(),Ie={normal:de,cosAngle:0},Re=1,xe=2,Ce=[0,0],Pe=A(0,0,1);class ye extends M{constructor(){super(...arguments),this.renderOccluded=B.Occlude,this.isDecoration=!1,this.color=I(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=I(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=_(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusEffect="none",this.draped=!1,this.isLabel=!1}}const De=D().vec3f(X.POSITION).vec3f(X.NORMAL).vec2f(X.UV0).vec4u8(X.COLOR).vec2f(X.SIZE).f32(X.ROTATION).vec4f(X.CENTEROFFSETANDDISTANCE).vec4f(X.FEATUREATTRIBUTE),Fe=De.clone().vec4u8(X.OBJECTANDLAYERIDCOLOR);class Le{constructor(){this.vertexBufferLayout=z()?Fe:De}elementCount(e){return 6*e.get(X.POSITION).indices.length}write(e,t,s,i,r,a){Z(s.get(X.POSITION),e,r.position,a,6),k(s.get(X.NORMAL),t,r.normal,a,6);const o=s.get(X.UV0)?.data;let n=0,c=0,l=1,f=1;o&&o.length>=4&&(n=o[0],c=o[1],l=o[2],f=o[3]),l=Math.min(1.99999,l+1),f=Math.min(1.99999,f+1);let h=s.get(X.POSITION).indices.length,p=a;const u=r.uv0;for(let O=0;O<h;++O)u.set(p,0,n),u.set(p,1,c),p++,u.set(p,0,l),u.set(p,1,c),p++,u.set(p,0,l),u.set(p,1,f),p++,u.set(p,0,l),u.set(p,1,f),p++,u.set(p,0,n),u.set(p,1,f),p++,u.set(p,0,n),u.set(p,1,c),p++;J(s.get(X.COLOR),4,r.color,a,6);const{data:m,indices:d}=s.get(X.SIZE);h=d.length;const g=r.size;p=a;for(let O=0;O<h;++O){const e=m[2*d[O]],t=m[2*d[O]+1];for(let s=0;s<6;++s)g.set(p,0,e),g.set(p,1,t),p++}if(K(s.get(X.ROTATION),r.rotation,a,6),s.get(X.CENTEROFFSETANDDISTANCE)?Q(s.get(X.CENTEROFFSETANDDISTANCE),r.centerOffsetAndDistance,a,6):$(r.centerOffsetAndDistance,a,6*h),s.get(X.FEATUREATTRIBUTE)?Q(s.get(X.FEATUREATTRIBUTE),r.featureAttribute,a,6):$(r.featureAttribute,a,6*h),null!=i){const e=s.get(X.POSITION)?.indices;if(e){const t=e.length,s=r.getField(X.OBJECTANDLAYERIDCOLOR,C);ee(i,s,t,a,6)}}}}export{ae as HUDMaterial,ye as Parameters};
|
|
5
|
+
import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l,fromValues as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{i as f,t as u,n as p,d as h,h as m,c as d,l as g,j as O,g as T,q as S,f as A}from"../../../../chunks/vec32.js";import{create as b,fromValues as E}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as v,create as R,freeze as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMat4 as x}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as F}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as _,BufferViewVec3f as C,BufferViewFloat as P,BufferViewVec2f as D,BufferViewVec4f as y}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as N}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as L}from"../../support/debugFlags.js";import{newLayout as j}from"../../support/buffer/InterleavedLayout.js";import{isColorEmissionHighlightOrOID as M,isColorOrColorEmission as U}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as z}from"../core/shaderLibrary/hud/HUD.glsl.js";import{alphaCutoff as w}from"../core/shaderLibrary/util/AlphaCutoff.js";import{olidEnabled as B}from"../effects/geometry/olidUtils.js";import{GLTextureMaterial as V,GLTextureMaterialBindParameters as q}from"../lib/GLTextureMaterial.js";import{Material as X,RenderOccludedFlag as G}from"../lib/Material.js";import{RenderSlot as H}from"../lib/RenderSlot.js";import{applyScaleFactor as W,applyPrecomputedScaleFactor as Y,precomputeScaleFactor as Z}from"../lib/screenSizePerspectiveUtils.js";import{assert as k}from"../lib/Util.js";import{VertexAttribute as J}from"../lib/VertexAttribute.js";import{ScaleInfo as K}from"./ScaleInfo.js";import{writePosition as Q,writeNormal as $,writeColor as ee,writeBufferFloat as te,writeBufferVec4 as ie,writeBufferVec4Zeros as se,writeObjectAndLayerIdColor as re}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as ae}from"./internal/MaterialUtil.js";import{c as ne}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as oe}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as le}from"../shaders/HUDMaterialTechniqueConfiguration.js";class ce extends X{constructor(e,t){super(e,Me),this.produces=new Map([[H.HUD_MATERIAL,e=>M(e)&&!this.parameters.drawAsLabel],[H.LABEL_MATERIAL,e=>M(e)&&this.parameters.drawAsLabel],[H.OCCLUSION_PIXELS,()=>this.parameters.occlusionTest],[H.DRAPED_MATERIAL,e=>this.parameters.draped&&M(e)]]),this._visible=!0,this._configuration=new le(t)}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.draped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=t.slot===H.OCCLUSION_PIXELS,this._configuration.occludedFragmentFade=this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||t.slot===H.OCCLUSION_PIXELS,U(e)&&(this._configuration.debugDrawLabelBorder=!!L.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:T},point:S,camera:A}=s,{parameters:E}=this;if(!l||!c||T&&E.isLabel||!e.visible||!S)return;const R=e.attributes.get(J.FEATUREATTRIBUTE),I=null==R?null:v(R.data,Ce),{scaleX:x,scaleY:F}=Be(I,E,A.pixelRatio);i(ve,t),e.attributes.has(J.FEATUREATTRIBUTE)&&he(ve);const _=e.attributes.get(J.POSITION),C=e.attributes.get(J.SIZE),P=e.attributes.get(J.NORMAL),D=e.attributes.get(J.ROTATION),y=e.attributes.get(J.CENTEROFFSETANDDISTANCE);k(_.size>=3);const N=ne(E),L="screen"===this.parameters.centerOffsetUnits;for(let i=0;i<_.data.length/_.size;i++){const e=i*_.size;f(ge,_.data[e],_.data[e+1],_.data[e+2]),u(ge,ge,t),u(ge,ge,A.viewMatrix);const a=i*y.size;if(f(Fe,y.data[a],y.data[a+1],y.data[a+2]),!L&&(ge[0]+=Fe[0],ge[1]+=Fe[1],0!==Fe[2])){const e=Fe[2];p(Fe,ge),h(ge,ge,m(Fe,Fe,e))}const n=i*P.size;if(f(Oe,P.data[n],P.data[n+1],P.data[n+2]),pe(Oe,ve,A,Pe),Ve(this.parameters,ge,Pe,A,de),A.applyProjection(ge,Te),Te[0]>-1){L&&(Fe[0]||Fe[1])&&(Te[0]+=Fe[0]*A.pixelRatio,0!==Fe[1]&&(Te[1]+=W(Fe[1],de.factorAlignment)*A.pixelRatio),A.unapplyProjection(Te,ge)),Te[0]+=this.parameters.screenOffset[0]*A.pixelRatio,Te[1]+=this.parameters.screenOffset[1]*A.pixelRatio,Te[0]=Math.floor(Te[0]),Te[1]=Math.floor(Te[1]);const e=i*C.size;Ne[0]=C.data[e],Ne[1]=C.data[e+1],Y(Ne,de.factor,Ne);const t=De*A.pixelRatio;let a=0;if(E.textureIsSignedDistanceField){a=Math.min(E.outlineSize,.5*Ne[0])*A.pixelRatio/2}Ne[0]*=x,Ne[1]*=F;const n=i*D.size,l=E.rotation+D.data[n];if(me(S,Te[0],Te[1],Ne,t,a,l,E,N)){const e=s.ray;if(u(Ae,ge,r(Ie,A.viewMatrix)),Te[0]=S[0],Te[1]=S[1],A.unprojectFromRenderScreen(Te,ge)){const t=b();d(t,e.direction);const i=1/g(t);m(t,t,i);o(O(e.origin,ge)*i,t,-1,!0,1,Ae)}}}}}intersectDraped(e,t,i,s,r,a){const n=e.attributes.get(J.POSITION),o=e.attributes.get(J.SIZE),l=e.attributes.get(J.ROTATION),c=this.parameters,f=ne(c),u=e.attributes.get(J.FEATUREATTRIBUTE),p=null==u?null:v(u.data,Ce),{scaleX:h,scaleY:m}=Be(p,c,e.screenToWorldRatio),d=ye*e.screenToWorldRatio;for(let g=0;g<n.data.length/n.size;g++){const t=g*n.size,i=n.data[t],u=n.data[t+1],p=g*o.size;Ne[0]=o.data[p],Ne[1]=o.data[p+1];let O=0;if(c.textureIsSignedDistanceField){O=Math.min(c.outlineSize,.5*Ne[0])*e.screenToWorldRatio/2}Ne[0]*=h,Ne[1]*=m;const T=g*l.size,S=c.rotation+l.data[T];me(s,i,u,Ne,d,O,S,c,f)&&r(a.dist,a.normal,-1,!1)}}createBufferWriter(){return new we}applyShaderOffsetsView(e,t,i,s,r,a,n){const o=pe(t,i,r,Pe);return this._applyVerticalGroundOffsetView(e,o,r,n),Ve(this.parameters,n,o,r,a),this._applyPolygonOffsetView(n,o,s[3],r,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,t,i,s,r){return this._applyCenterOffsetNDC(e,t,i,s),null!=r&&d(r,s),this._applyPolygonOffsetNDC(s,t,i,s),s}_applyPolygonOffsetView(t,i,s,r,a){const n=r.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return d(a,t);const c=e(Math.abs(i.cosAngle),.01,1),f=1-Math.sqrt(1-c*c)/c/r.viewport[2];return m(a,t,l>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,i,s){const r=g(e),a=i.aboveGround?1:-1,n=i.computeRenderPixelSizeAtDist(r)*z,o=m(ge,t.normal,a*n);return T(s,e,o),s}_applyCenterOffsetView(e,t,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&d(i,e),s&&(i[0]+=t[0],i[1]+=t[1],t[2]&&(p(Oe,i),T(i,i,m(Oe,Oe,t[2])))),i}_applyCenterOffsetNDC(e,t,i,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&d(s,e),r||(s[0]+=t[0]/i.fullWidth*2,s[1]+=t[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,i,s){const r=this.parameters.shaderPolygonOffset;if(e!==s&&d(s,e),r){const e=i.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*r}return s}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:i}=this.parameters,s=e[3]>=w||t>=w&&i[3]>=w;return this._visible&&s}createGLMaterial(e){return new fe(e)}calculateRelativeScreenBounds(e,t,i=F()){return ue(this.parameters,e,t,i),i[2]=i[0]+e[0],i[3]=i[1]+e[1],i}}class fe extends V{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(oe,e)}}function ue(e,t,i,s){s[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*i,s[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*i}function pe(e,t,s,r){return x(t)&&(t=i(Re,t)),S(r.normal,e,t),u(r.normal,r.normal,s.viewInverseTransposeMatrix),r.cosAngle=A(Se,je),r}function he(e){const t=e[0],i=e[1],s=e[2],r=e[3],a=e[4],n=e[5],o=e[6],l=e[7],c=e[8],f=1/Math.sqrt(t*t+i*i+s*s),u=1/Math.sqrt(r*r+a*a+n*n),p=1/Math.sqrt(o*o+l*l+c*c);return e[0]=t*f,e[1]=i*f,e[2]=s*f,e[3]=r*u,e[4]=a*u,e[5]=n*u,e[6]=o*p,e[7]=l*p,e[8]=c*p,e}function me(e,i,s,r,a,l,c,f,u){let p=i-a-r[0]*u[0],h=p+r[0]+2*a,m=s-a-r[1]*u[1],d=m+r[1]+2*a;const g=f.distanceFieldBoundingBox;return f.textureIsSignedDistanceField&&null!=g&&(p+=r[0]*g[0],m+=r[1]*g[1],h-=r[0]*(1-g[2]),d-=r[1]*(1-g[3]),p-=l,h+=l,m-=l,d+=l),n(Ee,i,s),o(be,e,Ee,t(c)),be[0]>p&&be[0]<h&&be[1]>m&&be[1]<d}const de=new K,ge=b(),Oe=b(),Te=R(),Se=b(),Ae=b(),be=l(),Ee=l(),ve=s(),Re=s(),Ie=a(),xe=R(),Fe=b(),_e=b(),Ce=R(),Pe={normal:Se,cosAngle:0},De=1,ye=2,Ne=c(0,0),Le=6,je=E(0,0,1);class Me extends q{constructor(){super(...arguments),this.renderOccluded=G.Occlude,this.isDecoration=!1,this.color=I(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=c(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=I(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=R(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusEffect="none",this.draped=!1,this.isLabel=!1}}const Ue=j().vec3f(J.POSITION).vec3f(J.NORMAL).vec2f(J.UV0).vec4u8(J.COLOR).vec2f(J.SIZE).f32(J.ROTATION).vec4f(J.CENTEROFFSETANDDISTANCE).vec4f(J.FEATUREATTRIBUTE),ze=Ue.clone().vec4u8(J.OBJECTANDLAYERIDCOLOR);class we{constructor(){this.vertexBufferLayout=B()?ze:Ue}elementCount(e){return e.get(J.POSITION).indices.length*Le}write(e,t,i,s,r,a){Q(i.get(J.POSITION),e,r.position,a,Le),$(i.get(J.NORMAL),t,r.normal,a,Le);const n=i.get(J.UV0)?.data;let o=0,l=0,c=1,f=1;n&&n.length>=4&&(o=n[0],l=n[1],c=n[2],f=n[3]),c=Math.min(1.99999,c+1),f=Math.min(1.99999,f+1);let u=i.get(J.POSITION).indices.length,p=a;const h=r.uv0;for(let O=0;O<u;++O)h.set(p,0,o),h.set(p,1,l),p++,h.set(p,0,c),h.set(p,1,l),p++,h.set(p,0,c),h.set(p,1,f),p++,h.set(p,0,c),h.set(p,1,f),p++,h.set(p,0,o),h.set(p,1,f),p++,h.set(p,0,o),h.set(p,1,l),p++;ee(i.get(J.COLOR),4,r.color,a,Le);const{data:m,indices:d}=i.get(J.SIZE);u=d.length;const g=r.size;p=a;for(let O=0;O<u;++O){const e=m[2*d[O]],t=m[2*d[O]+1];for(let i=0;i<Le;++i)g.set(p,0,e),g.set(p,1,t),p++}if(te(i.get(J.ROTATION),r.rotation,a,Le),i.get(J.CENTEROFFSETANDDISTANCE)?ie(i.get(J.CENTEROFFSETANDDISTANCE),r.centerOffsetAndDistance,a,Le):se(r.centerOffsetAndDistance,a,u*Le),i.get(J.FEATUREATTRIBUTE)?ie(i.get(J.FEATUREATTRIBUTE),r.featureAttribute,a,Le):se(r.featureAttribute,a,u*Le),null!=s){const e=i.get(J.POSITION)?.indices;if(e){const t=e.length,i=r.getField(J.OBJECTANDLAYERIDCOLOR,_);re(s,i,t,a,Le)}}}intersect(e,t,i,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:S},point:A,camera:E}=s;if(!l||!c||S&&t.isLabel||!A)return;const v=this.vertexBufferLayout.createView(e),R=v.getField(J.POSITION,C),I=v.getField(J.NORMAL,C),x=v.getField(J.ROTATION,P),F=v.getField(J.SIZE,D),_=v.getField(J.FEATUREATTRIBUTE,y),N=v.getField(J.CENTEROFFSETANDDISTANCE,y),L="screen"===t.centerOffsetUnits,j=ne(t);if(null==R||null==I||null==x||null==F||null==N)return;const M=null==_?null:_.getVec(0,Ce),{scaleX:U,scaleY:z}=Be(M,t,E.pixelRatio),w=R.count/Le;for(let C=0;C<w;C++){const e=C*Le;if(R.getVec(e,ge),null!=i&&T(ge,ge,i),u(ge,ge,E.viewMatrix),N.getVec(e,xe),f(Fe,xe[0],xe[1],xe[2]),!L&&(ge[0]+=Fe[0],ge[1]+=Fe[1],0!==Fe[2])){const e=Fe[2];p(Fe,ge),h(ge,ge,m(Fe,Fe,e))}if(I.getVec(e,Oe),pe(Oe,ve,E,Pe),Ve(t,ge,Pe,E,de),E.applyProjection(ge,Te),Te[0]>-1){L&&(Fe[0]||Fe[1])&&(Te[0]+=Fe[0]*E.pixelRatio,0!==Fe[1]&&(Te[1]+=W(Fe[1],de.factorAlignment)*E.pixelRatio),E.unapplyProjection(Te,ge)),Te[0]+=t.screenOffset[0]*E.pixelRatio,Te[1]+=t.screenOffset[1]*E.pixelRatio,Te[0]=Math.floor(Te[0]),Te[1]=Math.floor(Te[1]),F.getVec(e,Ne),Y(Ne,de.factor,Ne);const i=De*E.pixelRatio;let a=0;if(t.textureIsSignedDistanceField){a=Math.min(t.outlineSize,.5*Ne[0])*E.pixelRatio/2}Ne[0]*=U,Ne[1]*=z;const n=x.get(e),l=t.rotation+n;if(me(A,Te[0],Te[1],Ne,i,a,l,t,j)){const e=s.ray;if(u(Ae,ge,r(Ie,E.viewMatrix)),Te[0]=A[0],Te[1]=A[1],E.unprojectFromRenderScreen(Te,ge)){const t=b();d(t,e.direction);const i=1/g(t);m(t,t,i);o(O(e.origin,ge)*i,t,C,!0,1,Ae)}}}}}}function Be(e,t,i){return null==e||null==t.vvSize?{scaleX:i,scaleY:i}:(N(_e,t,e),{scaleX:_e[0]*i,scaleY:_e[1]*i})}function Ve(e,t,i,s,r){if(!e.verticalOffset?.screenLength){if(e.screenSizePerspective||e.screenSizePerspectiveAlignment){qe(e,r,g(t),i.cosAngle)}else r.factor.scale=1,r.factorAlignment.scale=1;return t}const a=g(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=ae(s,a,e.verticalOffset,i.cosAngle,n);return qe(e,r,a,i.cosAngle),m(i.normal,i.normal,o),T(t,t,i.normal)}function qe(e,t,i,s){null!=e.screenSizePerspective?Z(s,i,e.screenSizePerspective,t.factor):(t.factor.scale=1,t.factor.factor=0,t.factor.minScaleFactor=0),null!=e.screenSizePerspectiveAlignment?Z(s,i,e.screenSizePerspectiveAlignment,t.factorAlignment):(t.factorAlignment.factor=t.factor.factor,t.factorAlignment.scale=t.factor.scale,t.factorAlignment.minScaleFactor=t.factor.minScaleFactor)}export{ce as HUDMaterial,Me as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import o from"../lib/GLMaterial.js";import{Material as a}from"../lib/Material.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{VertexAttribute as u}from"../lib/VertexAttribute.js";import{writePosition as l,writeBufferFloat as c}from"./internal/bufferWriterUtils.js";import{HeatmapDensityPassParameters as f,HeatmapDensityTechnique as m}from"../shaders/HeatmapDensityTechnique.js";import{HeatmapDensityTechniqueConfiguration as p}from"../shaders/HeatmapDensityTechniqueConfiguration.js";const h=2;class T extends f{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class
|
|
5
|
+
import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import o from"../lib/GLMaterial.js";import{Material as a}from"../lib/Material.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{VertexAttribute as u}from"../lib/VertexAttribute.js";import{writePosition as l,writeBufferFloat as c}from"./internal/bufferWriterUtils.js";import{HeatmapDensityPassParameters as f,HeatmapDensityTechnique as m}from"../shaders/HeatmapDensityTechnique.js";import{HeatmapDensityTechniqueConfiguration as p}from"../shaders/HeatmapDensityTechniqueConfiguration.js";const h=2;class T extends f{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class g extends a{constructor(t){super(t,T),this.produces=new Map([[n.DRAPED_MATERIAL,t=>t===i.Color]]),this._configuration=new p}getConfiguration(){return this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats,this._configuration}get visible(){return!0}createGLMaterial(t){return new d(t)}intersect(){}intersectDraped(r,s,i,o,a,n){const l=r.attributes.get(u.POSITION),{parameters:c}=this,{searchRadius:f}=c,{screenToWorldRatio:m}=r,p=f*m+h*m,T=p*p,g=l.data.length/l.size;for(let u=0;u<g;u++){const r=u*l.size,s=t(j,l.data[r],l.data[r+1]);e(s,o)<T&&a(n.dist,n.normal,-1,!1)}}createBufferWriter(){return new b(this.parameters.isAttributeDriven?I:A)}}class d extends o{beginSlot(t){return this.getTechnique(m,t)}}class b{constructor(t){this.vertexBufferLayout=t}elementCount(t){return t.get(u.POSITION).indices.length*v}write(t,e,r,s,i,o){l(r.get(u.POSITION),t,i.position,o,v);const a=r.get(u.POSITION).indices.length,n=i.uv0;let f=o;for(let u=0;u<a;++u)n.setValues(f++,-1,-1),n.setValues(f++,1,-1),n.setValues(f++,1,1),n.setValues(f++,1,1),n.setValues(f++,-1,1),n.setValues(f++,-1,-1);const m=u.FEATUREATTRIBUTE in i?i.featureAttribute:null;m&&c(r.get(u.FEATUREATTRIBUTE),m,o,v)}}const A=s().vec3f(u.POSITION).vec2f(u.UV0),I=A.clone().f32(u.FEATUREATTRIBUTE),v=6,j=r();export{g as HeatmapDensityMaterial,T as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOID as t,isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as i}from"../lib/basicInterfaces.js";import{GLTextureMaterial as s}from"../lib/GLTextureMaterial.js";import{MaterialParameters as a}from"../lib/Material.js";import{OITPolygonOffsetLimit as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{assert as u}from"../lib/Util.js";import{VertexAttribute as
|
|
5
|
+
import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOID as t,isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as i}from"../lib/basicInterfaces.js";import{GLTextureMaterial as s}from"../lib/GLTextureMaterial.js";import{MaterialParameters as a}from"../lib/Material.js";import{OITPolygonOffsetLimit as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{assert as u}from"../lib/Util.js";import{VertexAttribute as l}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as p}from"./DefaultBufferWriter.js";import{PositionUVLayout as c}from"./DefaultLayouts.js";import{TriangleMaterial as h}from"./TriangleMaterial.js";import{writeBufferFloat as f,writeDefaultAttribute as m}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocations as T,ImageMaterialTechnique as g}from"../shaders/ImageMaterialTechnique.js";import{ImageMaterialTechniqueConfiguration as d}from"../shaders/ImageMaterialTechniqueConfiguration.js";class I extends h{constructor(e){super(e,b),this._configuration=new d,this.vertexAttributeLocations=T,this.supportsEdges=!0,this.produces=new Map([[n.OPAQUE_MATERIAL,e=>t(e)],[n.TRANSPARENT_MATERIAL,e=>r(e)&&this.parameters.writeDepth],[n.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>r(e)&&!this.parameters.writeDepth],[n.DRAPED_MATERIAL,e=>r(e)||t(e)]])}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=t.hasOccludees,this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.camera.relativeElevation<o,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.perspectiveInterpolation=this.parameters.perspectiveInterpolation,this._configuration}get visible(){return!0}createGLMaterial(e){return new _(e)}createBufferWriter(){const e=c.clone();return this.parameters.perspectiveInterpolation&&e.f32(l.PERSPECTIVEDIVIDE),new E(e)}}class _ extends s{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique(g,e)}}class E extends p{write(t,r,i,s,a,o){for(const n of this.vertexBufferLayout.fields.keys()){const s=i.get(n);if(s)if(n===l.PERSPECTIVEDIVIDE){u(1===s.size);const t=a.getField(n,e);t&&f(s,t,o)}else m(n,s,t,r,a,o)}}}class b extends a{constructor(){super(...arguments),this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=i.None,this.opacity=1,this.textureId=null,this.initTextureTransparent=!0,this.perspectiveInterpolation=!1}}export{I as ImageMaterial,b as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as s}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as n}from"../core/shaderLibrary/util/AlphaCutoff.js";import o from"../lib/GLMaterial.js";import{Material as a,MaterialParameters as c}from"../lib/Material.js";import{RenderSlot as l}from"../lib/RenderSlot.js";import{VertexAttribute as f}from"../lib/VertexAttribute.js";import{writePosition as h,writeNormal as u,writeBufferVec4 as m}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";class g extends a{constructor(e,t){super(e,T),this.produces=new Map([[l.LINE_CALLOUTS,e=>s(e)],[l.LINE_CALLOUTS_HUD_DEPTH,e=>s(e)]]),this._configuration=new d(t),this._uniqueMaterialIdentifier=O(this.parameters)}passParameters(){return this.parameters}getConfiguration(e,t){const r=t.slot===l.LINE_CALLOUTS_HUD_DEPTH;return this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=r,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration}get visible(){return this.parameters.color[3]>=n||(this.parameters.borderColor?.[3]??0)>=n}intersect(){}createGLMaterial(e){return new S(e)}createBufferWriter(){return new b}validateParameters(e){this._uniqueMaterialIdentifier=O(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function O({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,occlusionTest:o,shaderPolygonOffset:a,hudDepthAlignStart:c,centerOffsetUnits:l,hasSlicePlane:f,screenSizePerspective:h,verticalOffset:u,borderColor:m}){return e`${t}:${r}:${i}:[${s}]:${n}:${o}:${a}:${c}:${l}:${f}:${null!=h}:{${u.screenLength}:${u.minWorldLength}:${u.maxWorldLength}}:[${m}]`}class S extends o{beginSlot(e){return this.
|
|
5
|
+
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as s}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as n}from"../core/shaderLibrary/util/AlphaCutoff.js";import o from"../lib/GLMaterial.js";import{Material as a,MaterialParameters as c}from"../lib/Material.js";import{RenderSlot as l}from"../lib/RenderSlot.js";import{VertexAttribute as f}from"../lib/VertexAttribute.js";import{writePosition as h,writeNormal as u,writeBufferVec4 as m}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as p}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as d}from"../shaders/LineCalloutTechniqueConfiguration.js";class g extends a{constructor(e,t){super(e,T),this.produces=new Map([[l.LINE_CALLOUTS,e=>s(e)],[l.LINE_CALLOUTS_HUD_DEPTH,e=>s(e)]]),this._configuration=new d(t),this._uniqueMaterialIdentifier=O(this.parameters)}passParameters(){return this.parameters}getConfiguration(e,t){const r=t.slot===l.LINE_CALLOUTS_HUD_DEPTH;return this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=r,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration}get visible(){return this.parameters.color[3]>=n||(this.parameters.borderColor?.[3]??0)>=n}intersect(){}createGLMaterial(e){return new S(e)}createBufferWriter(){return new b}validateParameters(e){this._uniqueMaterialIdentifier=O(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function O({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,occlusionTest:o,shaderPolygonOffset:a,hudDepthAlignStart:c,centerOffsetUnits:l,hasSlicePlane:f,screenSizePerspective:h,verticalOffset:u,borderColor:m}){return e`${t}:${r}:${i}:[${s}]:${n}:${o}:${a}:${c}:${l}:${f}:${null!=h}:{${u.screenLength}:${u.minWorldLength}:${u.maxWorldLength}}:[${m}]`}class S extends o{beginSlot(e){return this.getTechnique(p,e)}}class T extends c{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=r(0,0,0,1),this.size=1,this.occlusionTest=!1,this.shaderPolygonOffset=1e-5,this.hudDepthAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}const L=i().vec3f(f.POSITION).vec3f(f.NORMAL).vec2f(f.UV0).vec4f(f.CENTEROFFSETANDDISTANCE),_=[t(0,0),t(1,0),t(0,1),t(1,0),t(1,1),t(0,1)];class b{constructor(){this.vertexBufferLayout=L}elementCount(e){return 6*e.get(f.POSITION).indices.length}write(e,t,r,i,s,n){h(r.get(f.POSITION),e,s.position,n,6),u(r.get(f.NORMAL),t,s.normal,n,6),m(r.get(f.CENTEROFFSETANDDISTANCE),s.centerOffsetAndDistance,n,6);for(let o=0;o<_.length;++o)s.uv0.setVec(n+o,_[o])}}export{g as LineCalloutMaterial,T as Parameters,O as uniqueMaterialIdentifier};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{i as e,I as t,t as r}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as s,isColor as n,isDepth as o,isColorHighlightOrDepth as h,isColorOrColorEmission as c}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as m}from"../core/shaderLibrary/util/AlphaCutoff.js";import{GLTextureMaterial as p}from"../lib/GLTextureMaterial.js";import{Material as l,RenderOccludedFlag as u}from"../lib/Material.js";import{RenderSlot as T}from"../lib/RenderSlot.js";import{VertexAttribute as d}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as f}from"./VisualVariablePassParameters.js";import{vertexAttributeLocations as A,LineMarkerTechnique as _}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as v,LineMarkerSpace as E,LineMarkerAnchor as
|
|
5
|
+
import{i as e,I as t,t as r}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as s,isColor as n,isDepth as o,isColorHighlightOrDepth as h,isColorOrColorEmission as c}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as m}from"../core/shaderLibrary/util/AlphaCutoff.js";import{GLTextureMaterial as p}from"../lib/GLTextureMaterial.js";import{Material as l,RenderOccludedFlag as u}from"../lib/Material.js";import{RenderSlot as T}from"../lib/RenderSlot.js";import{VertexAttribute as d}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as f}from"./VisualVariablePassParameters.js";import{vertexAttributeLocations as A,LineMarkerTechnique as _}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as v,LineMarkerSpace as E,LineMarkerAnchor as g}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as O}from"../shaders/RibbonLineTechniqueConfiguration.js";class S extends l{constructor(e){super(e,I),this._configuration=new v,this.vertexAttributeLocations=A,this.produces=new Map([[T.OPAQUE_MATERIAL,e=>e===s.Highlight||n(e)&&this.parameters.renderOccluded===u.OccludeAndTransparentStencil],[T.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>o(e)],[T.OCCLUDER_MATERIAL,e=>h(e)&&this.parameters.renderOccluded===u.OccludeAndTransparentStencil],[T.TRANSPARENT_OCCLUDER_MATERIAL,e=>h(e)&&this.parameters.renderOccluded===u.OccludeAndTransparentStencil],[T.TRANSPARENT_MATERIAL,e=>n(e)&&this.parameters.writeDepth],[T.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>n(e)&&!this.parameters.writeDepth],[T.DRAPED_MATERIAL,e=>c(e)||e===s.Highlight]]),this._layout=this.createLayout()}getConfiguration(e,t){return this._configuration.output=e,this._configuration.space=t.slot===T.DRAPED_MATERIAL?E.Draped:this.parameters.worldSpace?E.World:E.Screen,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==O.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=t.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.occluder=this.parameters.renderOccluded===u.OccludeAndTransparentStencil,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest&&c(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}get visible(){return this.parameters.color[3]>=m}intersect(){}createLayout(){const e=a().vec3f(d.POSITION).vec3f(d.PREVPOSITION).vec2f(d.UV0);return this.parameters.worldSpace&&e.vec3f(d.NORMAL),this.parameters.vvSize?e.f32(d.SIZEFEATUREATTRIBUTE):e.f32(d.SIZE),this.parameters.vvColor?e.f32(d.COLORFEATUREATTRIBUTE):e.vec4f(d.COLOR),this.parameters.vvOpacity&&e.f32(d.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new P(this._layout,this.parameters)}createGLMaterial(e){return new R(e)}}class R extends p{constructor(){super(...arguments),this._markerPrimitive=null}dispose(){super.dispose(),this._markerTextures.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this._material.setParameters(this.textureBindParameters),this.getTechnique(_,e)}}class I extends f{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=O.BUTT,this.anchor=g.Center,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.markerTexture=null}}class P{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,a,s,n,o,h){const c=s.get(d.POSITION).data,m=c.length/3;let p=[1,0,0];const l=s.get(d.NORMAL);this._parameters.worldSpace&&null!=l&&(p=l.data);let u=1,T=0;this._parameters.vvSize?T=s.get(d.SIZEFEATUREATTRIBUTE).data[0]:s.has(d.SIZE)&&(u=s.get(d.SIZE).data[0]);let f=[1,1,1,1],A=0;this._parameters.vvColor?A=s.get(d.COLORFEATUREATTRIBUTE).data[0]:s.has(d.COLOR)&&(f=s.get(d.COLOR).data);let _=0;this._parameters.vvOpacity&&(_=s.get(d.OPACITYFEATUREATTRIBUTE).data[0]);const v=new Float32Array(o.buffer);let E=h*(this.vertexBufferLayout.stride/4);const g=(e,t,r,i)=>{if(v[E++]=e[0],v[E++]=e[1],v[E++]=e[2],v[E++]=t[0],v[E++]=t[1],v[E++]=t[2],v[E++]=r[0],v[E++]=r[1],this._parameters.worldSpace&&(v[E++]=p[0],v[E++]=p[1],v[E++]=p[2]),this._parameters.vvSize?v[E++]=T:v[E++]=u,this._parameters.vvColor)v[E++]=A;else{const e=Math.min(4*i,f.length-4);v[E++]=f[e],v[E++]=f[e+1],v[E++]=f[e+2],v[E++]=f[e+3]}this._parameters.vvOpacity&&(v[E++]=_)};let O;!function(e){e[e.ASCENDING=1]="ASCENDING",e[e.DESCENDING=-1]="DESCENDING"}(O||(O={}));const S=(a,s)=>{const n=e(L,c[3*a],c[3*a+1],c[3*a+2]),o=C;let h=a+s;do{e(o,c[3*h],c[3*h+1],c[3*h+2]),h+=s}while(t(n,o)&&h>=0&&h<m);i&&(r(n,n,i),r(o,o,i)),g(n,o,[-1,-1],a),g(n,o,[1,-1],a),g(n,o,[1,1],a),g(n,o,[-1,-1],a),g(n,o,[1,1],a),g(n,o,[-1,1],a)},R=this._parameters.placement;"begin"!==R&&"begin-end"!==R||S(0,O.ASCENDING),"end"!==R&&"begin-end"!==R||S(m-1,O.DESCENDING)}}const L=i(),C=i();export{S as LineMarkerMaterial,I as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{i as t,n as e,d as r,e as s,j as o,t as i}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as l}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as u}from"../core/shaderLibrary/util/AlphaCutoff.js";import f from"../lib/GLMaterial.js";import{Material as p,MaterialParameters as h}from"../lib/Material.js";import{RenderSlot as m}from"../lib/RenderSlot.js";import{VertexAttribute as d}from"../lib/VertexAttribute.js";import{vertexAttributeLocations as g,MeasurementArrowTechnique as O}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as A}from"../shaders/MeasurementArrowTechniqueConfiguration.js";class b extends p{constructor(t){super(t,T),this._configuration=new A,this.vertexAttributeLocations=g,this.produces=new Map([[m.OPAQUE_MATERIAL,t=>!this._transparent&&l(t)],[m.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,t=>this._transparent&&l(t)]])}getConfiguration(t,e){return this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this._transparent,this._configuration.oitPass=e.oitPass,this._configuration}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=u||e[3]>=u||r[3]>=u}intersect(){}createGLMaterial(t){return new v(t)}createBufferWriter(){return new E}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class v extends f{beginSlot(t){return this.
|
|
5
|
+
import{i as t,n as e,d as r,e as s,j as o,t as i}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmission as l}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as u}from"../core/shaderLibrary/util/AlphaCutoff.js";import f from"../lib/GLMaterial.js";import{Material as p,MaterialParameters as h}from"../lib/Material.js";import{RenderSlot as m}from"../lib/RenderSlot.js";import{VertexAttribute as d}from"../lib/VertexAttribute.js";import{vertexAttributeLocations as g,MeasurementArrowTechnique as O}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as A}from"../shaders/MeasurementArrowTechniqueConfiguration.js";class b extends p{constructor(t){super(t,T),this._configuration=new A,this.vertexAttributeLocations=g,this.produces=new Map([[m.OPAQUE_MATERIAL,t=>!this._transparent&&l(t)],[m.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,t=>this._transparent&&l(t)]])}getConfiguration(t,e){return this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this._transparent,this._configuration.oitPass=e.oitPass,this._configuration}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=u||e[3]>=u||r[3]>=u}intersect(){}createGLMaterial(t){return new v(t)}createBufferWriter(){return new E}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class v extends f{beginSlot(t){return this.getTechnique(O,t)}}class T extends h{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1,this.polygonOffset=!1}}const j=c().vec3f(d.POSITION).vec3f(d.NORMAL).vec2f(d.UV0).f32(d.LENGTH),C=n(),L=n(),_=n(),M=n(),w=n();class E{constructor(){this.vertexBufferLayout=j}elementCount(t){return 2*(t.get(d.POSITION).indices.length/2+1)}write(n,a,c,l,u,f){const{data:p,indices:h}=c.get(d.POSITION),m=c.get(d.NORMAL).data,g=p.length/3;h&&h.length!==2*(g-1)&&console.warn("MeasurementArrowMaterial does not support indices");const O=C,A=L,b=_,v=M,T=w,j=u.position,E=u.normal,I=u.uv0;let x=0;for(let d=0;d<g;++d){const c=3*d;if(t(O,p[c],p[c+1],p[c+2]),d<g-1){const o=3*(d+1);t(A,p[o],p[o+1],p[o+2]),t(T,m[o],m[o+1],m[o+2]),e(T,T),r(b,A,O),e(b,b),s(v,T,b),e(v,v)}const l=o(O,A);n&&a&&(i(O,O,n),i(A,A,n),i(v,v,a));const u=f+2*d,h=u+1;j.setVec(u,O),j.setVec(h,O),E.setVec(u,v),E.setVec(h,v),I.set(u,0,x),I.set(u,1,-1),I.set(h,0,x),I.set(h,1,1),d<g-1&&(x+=l)}const N=u.length;for(let t=0;t<2*g;++t)N.set(f+t,x)}}export{b as MeasurementArrowMaterial,T as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as t}from"../../../../core/screenUtils.js";import{copy as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as i,f as a,h as n,g as c,c as m,l,j as
|
|
5
|
+
import e from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as t}from"../../../../core/screenUtils.js";import{copy as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{i as s,d as i,f as a,h as n,g as c,c as m,l,j as f}from"../../../../chunks/vec32.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{PlaneIndex as h}from"../../../../geometry/support/frustum.js";import{create as g,distance2 as d,fromPoints as j,closestLineSegmentPoint as b}from"../../../../geometry/support/lineSegment.js";import{create as A,fromPoints as S,signedDistance as L,getNormal as x}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOID as y}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as N}from"../core/shaderLibrary/util/AlphaCutoff.js";import R from"../lib/GLMaterial.js";import{Material as v,MaterialParameters as E}from"../lib/Material.js";import{RenderSlot as M}from"../lib/RenderSlot.js";import{isTranslationMatrix as T}from"../lib/Util.js";import{VertexAttribute as _}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as w}from"./DefaultBufferWriter.js";import{PositionColorLayout as O,PositionLayout as V}from"./DefaultLayouts.js";import{NativeLineTechnique as C}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as P}from"../shaders/NativeLineTechniqueConfiguration.js";class U extends v{constructor(e){super(e,q),this._configuration=new P,this.produces=new Map([[M.OPAQUE_MATERIAL,e=>y(e)]])}getConfiguration(e,r){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=r.hasOccludees,this._configuration}get visible(){return this.parameters.color[3]>=N}intersect(r,t,u,p,g,A){if(!u.options.selectionMode||!r.visible)return;if(!T(t))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const y=r.attributes.get(_.POSITION).data,N=u.camera,R=H;o(R,u.point);const v=2;s(J[0],R[0]-v,R[1]+v,0),s(J[1],R[0]+v,R[1]+v,0),s(J[2],R[0]+v,R[1]-v,0),s(J[3],R[0]-v,R[1]-v,0);for(let e=0;e<4;e++)if(!N.unprojectFromRenderScreen(J[e],K[e]))return;S(N.eye,K[0],K[1],Y),S(N.eye,K[1],K[2],$),S(N.eye,K[2],K[3],ee),S(N.eye,K[3],K[0],re);let E=Number.MAX_VALUE,M=0;for(let e=0;e<y.length-5;e+=3){if(B[0]=y[e]+t[12],B[1]=y[e+1]+t[13],B[2]=y[e+2]+t[14],D[0]=y[e+3]+t[12],D[1]=y[e+4]+t[13],D[2]=y[e+5]+t[14],L(Y,B)<0&&L(Y,D)<0||L($,B)<0&&L($,D)<0||L(ee,B)<0&&L(ee,D)<0||L(re,B)<0&&L(re,D)<0)continue;if(N.projectToRenderScreen(B,G),N.projectToRenderScreen(D,k),G[2]<0&&k[2]>0){i(W,B,D);const e=N.frustum,r=-L(e[h.NEAR],B)/a(W,x(e[h.NEAR]));n(W,W,r),c(B,B,W),N.projectToRenderScreen(B,G)}else if(G[2]>0&&k[2]<0){i(W,D,B);const e=N.frustum,r=-L(e[h.NEAR],D)/a(W,x(e[h.NEAR]));n(W,W,r),c(D,D,W),N.projectToRenderScreen(D,k)}else if(G[2]<0&&k[2]<0)continue;G[2]=0,k[2]=0;const r=d(j(G,k,Z),R);r<E&&(E=r,m(F,B),m(Q,D),M=e/3)}const w=u.rayBegin,O=u.rayEnd;if(E<v*v){let e=Number.MAX_VALUE;if(b(j(F,Q,Z),j(w,O,z),X)){i(X,X,w);const r=l(X);n(X,X,1/r),e=r/f(w,O)}A(e,X,M,!1)}}intersectDraped(e,t,o,s,i,a){if(!o.options.selectionMode)return;const n=e.attributes.get(_.POSITION).data,c=e.attributes.get(_.SIZE),m=c?c.data[0]:0,l=s[0],f=s[1],u=((m+1)/2+4)*e.screenToWorldRatio;let p=Number.MAX_VALUE,h=0;for(let g=0;g<n.length-5;g+=3){const e=n[g],t=n[g+1],o=l-e,s=f-t,i=n[g+3]-e,a=n[g+4]-t,c=r((i*o+a*s)/(i*i+a*a),0,1),m=i*c-o,u=a*c-s,d=m*m+u*u;d<p&&(p=d,h=g/3)}p<u*u&&i(a.dist,a.normal,h,!1)}createGLMaterial(e){return new I(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?O:V;return new w(e)}}class I extends R{beginSlot(e){return this.getTechnique(C,e)}}class q extends E{constructor(){super(...arguments),this.color=p,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const B=u(),D=u(),W=u(),X=u(),G=t(),k=t(),F=u(),Q=u(),Z=g(),z=g(),H=u(),J=[t(),t(),t(),t()],K=[u(),u(),u(),u()],Y=A(),$=A(),ee=A(),re=A();export{U as NativeLineMaterial,q as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as e}from"../../../../core/mathUtils.js";import{p as t}from"../../../../chunks/vec32.js";import{ZEROS as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as a,is3DGeometryOutputMRT as o,isColorOrColorEmission as n,ShaderOutput as
|
|
5
|
+
import{clamp as e}from"../../../../core/mathUtils.js";import{p as t}from"../../../../chunks/vec32.js";import{ZEROS as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as a,is3DGeometryOutputMRT as o,isColorOrColorEmission as n,ShaderOutput as h}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as c}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as u}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as m}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{alphaCutoff as p}from"../core/shaderLibrary/util/AlphaCutoff.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import f from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as _}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as A}from"./DefaultBufferWriter.js";import{vertexAttributeLocations as P,PathTechnique as R,PathPassParameters as j}from"./PathTechnique.js";import{PathTechniqueConfiguration as y}from"./PathTechniqueConfiguration.js";class L extends d{constructor(e,t){super(e,M),this._vertexBufferLayout=O(),this.vertexAttributeLocations=P,this.supportsEdges=!0,this.produces=new Map([[S.OPAQUE_MATERIAL,e=>(this.parameters.castShadows&&a(e)||o(e))&&!this.parameters.transparent],[S.TRANSPARENT_MATERIAL,e=>(this.parameters.castShadows&&a(e)||o(e))&&this.parameters.transparent]]),this._configuration=new y(t.spherical,t.doublePrecisionRequiresObfuscation)}get hasEmissions(){return!t(this.parameters.emissiveFactor,r)}getConfiguration(e,t){return this._configuration.output=e,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.hasOccludees=t.hasOccludees,n(e)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?u.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?u.WindingOrder:u.None,this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?m.Schematic:m.Disabled,this._configuration.emissionSource=this.parameters.usePBR?c.Value:c.None,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}isVisibleForOutput(e){return e!==h.Shadow&&e!==h.ShadowExcludeHighlight&&e!==h.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=p}intersect(t,r,s,a,o,n){const h=t;if(!b(h))return;const c=h.path,u=[this.parameters.size[0],this.parameters.size[1]];if(this.parameters.vvSize){const{offset:t,factor:r,minSize:i,maxSize:s}=this.parameters.vvSize,a=c.sizeAttributeValue;u[0]*=e(t[0]+a*r[0],i[0],s[0]),u[1]*=e(t[2]+a*r[2],i[2],s[2])}const m=new g(!1,s.options.normalRequired),p=Math.max(u[0],u[1]),l=t.boundingInfo;if(null==l)return void E(c,u,a,o,m,n);const f=i(l.bbMin[0]-p,l.bbMin[1]-p,l.bbMin[2]-p,l.bbMax[0]+p,l.bbMax[1]+p,l.bbMax[2]+p),d=[o[0]-a[0],o[1]-a[1],o[2]-a[2]],S=Math.sqrt(d[0]*d[0]+d[1]*d[1]+d[2]*d[2]),_=[S/d[0],S/d[1],S/d[2]];v(f,a,_,s.tolerance)&&E(c,u,a,o,m,n)}createBufferWriter(){return new A(this._vertexBufferLayout)}createGLMaterial(e){return new T(e)}}function O(){const e=s().vec3f(_.POSITION).vec4f(_.PROFILERIGHT).vec4f(_.PROFILEUP).vec4f(_.PROFILEVERTEXANDNORMAL).vec4f(_.FEATUREVALUE);return l()&&e.vec4u8(_.OBJECTANDLAYERIDCOLOR),e}class T extends f{beginSlot(e){return this.getTechnique(R,e)}}function E(e,t,r,i,s,a){e.baked.size&&e.baked.size[0]===t[0]&&e.baked.size[1]===t[1]||e.baked.bake(t),e.baked.intersect(r,i,s,a)}class M extends j{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.transparent=!1,this.usePBR=!1}}export{M as Parameters,L as PathMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{freeze as e,create as r,ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColorOrColorEmission as s,ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as l}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as o}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as n}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as u}from"../lib/OITPass.js";import{blending as m,oitDepthTest as c,getDrawBuffers as h,OITPolygonOffset as p}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as d,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{advancedMRRFactors as O}from"./pbrUtils.js";import{P as j}from"../../../../chunks/Path.glsl.js";import{SpecialDrawBuffers as P}from"../../../webgl/enums.js";import{makePipelineState as g,frontFaceCullingParams as E,defaultDepthWrite as T,defaultColorWrite as x}from"../../../webgl/renderState.js";class N extends l{constructor(){super(...arguments),this.ambient=e(.2,.2,.2),this.diffuse=e(.8,.8,.8),this.specular=e(0,0,0),this.opacity=1,this.origin=r(),this.modelTransformation=null,this.mrrFactors=O,this.emissiveFactor=t,this.texture=null,this.textureNormal=null,this.textureEmissive=null,this.textureOcclusion=null,this.textureMetallicRoughness=null}}class R extends a{constructor(e,r
|
|
5
|
+
import{freeze as e,create as r,ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColorOrColorEmission as s,ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as l}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as o}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as n}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as u}from"../lib/OITPass.js";import{blending as m,oitDepthTest as c,getDrawBuffers as h,OITPolygonOffset as p}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as d,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{advancedMRRFactors as O}from"./pbrUtils.js";import{P as j}from"../../../../chunks/Path.glsl.js";import{SpecialDrawBuffers as P}from"../../../webgl/enums.js";import{makePipelineState as g,frontFaceCullingParams as E,defaultDepthWrite as T,defaultColorWrite as x}from"../../../webgl/renderState.js";class N extends l{constructor(){super(...arguments),this.ambient=e(.2,.2,.2),this.diffuse=e(.8,.8,.8),this.specular=e(0,0,0),this.opacity=1,this.origin=r(),this.modelTransformation=null,this.mrrFactors=O,this.emissiveFactor=t,this.texture=null,this.textureNormal=null,this.textureEmissive=null,this.textureOcclusion=null,this.textureMetallicRoughness=null}}class R extends a{constructor(e,r){super(e,r,new n(j,(()=>import("../shaders/Path.glsl.js"))),L)}initializePipeline(e){const{output:r,transparent:t,hasSlicePlane:l,doubleSidedMode:n,hasOccludees:a,oitPass:b}=e,O=b===u.NONE,j=b===u.FrontFace;return g({blending:s(r)&&t?m(b):null,culling:l&&!t&&n!==o.None?E:null,depthTest:{func:c(b)},depthWrite:O||j?T:null,drawBuffers:r===i.Depth?{buffers:[P.NONE]}:h(b,r),colorWrite:x,stencilWrite:a?d:null,stencilTest:a?f:null,polygonOffset:O||j?null:p})}}const L=new Map([[b.POSITION,0],[b.PROFILERIGHT,1],[b.PROFILEUP,2],[b.PROFILEVERTEXANDNORMAL,3],[b.FEATUREVALUE,4],[b.OBJECTANDLAYERIDCOLOR,5]]);export{N as PathPassParameters,R as PathTechnique,L as vertexAttributeLocations};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{fromValues as
|
|
5
|
+
import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewMat3f as e,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as i,isColorOrColorEmission as o,isDepth as a,isColorEmissionHighlightOrOID as n}from"../core/shaderLibrary/ShaderOutput.js";import{alphaCutoff as f}from"../core/shaderLibrary/util/AlphaCutoff.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as c}from"../lib/basicInterfaces.js";import u from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as h}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{assert as m}from"../lib/Util.js";import{VertexAttribute as d}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as g}from"./DefaultBufferWriter.js";import{Style as A}from"./PatternStyle.js";import{TriangleMaterial as T}from"./TriangleMaterial.js";import{VisualVariablePassParameters as b}from"./VisualVariablePassParameters.js";import{writeDefaultAttributes as v,writeBufferVec4 as O}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocationsOID as _,vertexAttributeLocations as j,PatternTechnique as C}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as E}from"../shaders/PatternTechniqueConfiguration.js";class P extends T{constructor(t){super(t,I),this._configuration=new E,this.vertexAttributeLocations=l()?_:j,this.supportsEdges=!0,this.produces=new Map([[p.OPAQUE_MATERIAL,t=>i(t)],[p.TRANSPARENT_MATERIAL,t=>o(t)],[p.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,t=>a(t)],[p.DRAPED_MATERIAL,t=>this.parameters.draped&&n(t)]])}getConfiguration(t,e){return this._configuration.output=t,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.style=this.parameters.style,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=e.oitPass,this._configuration.enableOffset=e.camera.relativeElevation<h,this._configuration.terrainDepthTest=e.terrainDepthTest&&o(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration}get visible(){return this.parameters.color[3]>=f}createGLMaterial(t){return new R(t)}createBufferWriter(){const t=s().vec3f(d.POSITION).vec4f(d.UVMAPSPACE);return this.parameters.draped||t.mat3f(d.BOUNDINGRECT),this.parameters.vvColor?t.f32(d.COLORFEATUREATTRIBUTE):t.vec4u8(d.COLOR),l()&&t.vec4u8(d.OBJECTANDLAYERIDCOLOR),new y(t)}}class R extends u{beginSlot(t){return this.getTechnique(C,t)}}class y extends g{write(t,s,i,o,a,n){v(i,o,this.vertexBufferLayout,t,s,a,n);for(const f of this.vertexBufferLayout.fields.keys()){const s=i.get(f),o=s?.indices;if(s&&o)switch(f){case d.UVMAPSPACE:{m(4===s.size);const t=a.getField(f,r);t&&O(s,t,n);break}case d.BOUNDINGRECT:{m(9===s.size);const r=a.getField(f,e);r&&L(s,t,r,n);break}}}}}function L(t,e,r,s){const{data:i,indices:o}=t,a=e,n=r.typedBuffer,f=r.typedBufferStride,l=o.length;s*=f;for(let c=0;c<l;++c){const t=9*o[c],e=i[t],r=i[t+1],l=i[t+2];n[s]=a[0]*e+a[4]*r+a[8]*l+a[12],n[s+1]=a[1]*e+a[5]*r+a[9]*l+a[13],n[s+2]=a[2]*e+a[6]*r+a[10]*l+a[14];for(let o=3;o<9;++o)n[s+o]=i[t+o];s+=f}}class I extends b{constructor(){super(...arguments),this.color=t(1,1,1,1),this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=c.None,this.hasOccludees=!1,this.style=A.Cross,this.draped=!0}}export{I as Parameters,P as PatternMaterial};
|