@arcgis/core 4.25.0-next.20220705 → 4.25.0-next.20220708
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/TimeExtent.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0703495557b0df6878c5.js +1 -0
- package/assets/esri/core/workers/chunks/1570676351a313f1841b.js +1 -0
- package/assets/esri/core/workers/chunks/{695f90305478f5024fa7.js → 1ecbf642debc2207b762.js} +1 -1
- package/assets/esri/core/workers/chunks/{30dbdf2aa1bc8e61cad4.js → 268e7b46202fc1decf9f.js} +1 -1
- package/assets/esri/core/workers/chunks/{47d78b4f7117554acecf.js → 357a27203f5d8fa152de.js} +1 -1
- package/assets/esri/core/workers/chunks/35dfba25a9077ab5dbaf.js +982 -0
- package/assets/esri/core/workers/chunks/377354a81e402edf3077.js +1 -0
- package/assets/esri/core/workers/chunks/3a42d96ea3b59d33bfe8.js +1 -0
- package/assets/esri/core/workers/chunks/3a61e4ab83183f5526a7.js +1 -0
- package/assets/esri/core/workers/chunks/{3790f0362b6f27ee798b.js → 3ee5e8d00cd3bc47a9fa.js} +1 -1
- package/assets/esri/core/workers/chunks/425d1fabc713a598139c.js +1 -0
- package/assets/esri/core/workers/chunks/425e16862feccb467191.js +1 -0
- package/assets/esri/core/workers/chunks/{bbe51b49fe7093e47306.js → 48c8ac9a22190c2b890c.js} +1 -1
- package/assets/esri/core/workers/chunks/4a364bc073fdc7c1b563.js +1 -0
- package/assets/esri/core/workers/chunks/4ca6ada7a4ccde5b5a24.js +1 -0
- package/assets/esri/core/workers/chunks/{905130ff0118962c8140.js → 61b71b8e028eda10ccab.js} +1 -1
- package/assets/esri/core/workers/chunks/{b34cffd5c45d3a8134bc.js → 69f57ad2227e59b323e8.js} +1 -1
- package/assets/esri/core/workers/chunks/{290899b47a52f8b28a9c.js → 791220164501a791b2cd.js} +1 -1
- package/assets/esri/core/workers/chunks/792b4b0a43b4bbbc14ab.js +1 -0
- package/assets/esri/core/workers/chunks/7b32b8e8ebe48ae0dae2.js +1 -0
- package/assets/esri/core/workers/chunks/7f00125b02bb7211de43.js +1 -0
- package/assets/esri/core/workers/chunks/81074accfce5f109f909.js +1 -0
- package/assets/esri/core/workers/chunks/{594d7fdb80ad9cdedb85.js → 823e25dbc70e71257b6e.js} +1 -1
- package/assets/esri/core/workers/chunks/92e43e05265dfc8173a0.js +1 -0
- package/assets/esri/core/workers/chunks/{40fa9b28ca882a70813a.js → 92f7415c2e40e320addc.js} +1 -1
- package/assets/esri/core/workers/chunks/{9520b32d5d53ea9cd0d3.js → 9341e9e1fe0f6800aa44.js} +1 -1
- package/assets/esri/core/workers/chunks/95451d6405729a9f50c7.js +1 -0
- package/assets/esri/core/workers/chunks/{910a2ffb4328f8ee7a0d.js → 95cb9cd08941c28ebd85.js} +1 -1
- package/assets/esri/core/workers/chunks/{97f32af5893c86f6444c.js → 9b9a40b84640f00a1dcb.js} +1 -1
- package/assets/esri/core/workers/chunks/{77c6ba5ea85915d9078c.js → ac07c732aca6e67232f8.js} +1 -1
- package/assets/esri/core/workers/chunks/ae8e87da97411cff3783.js +1 -0
- package/assets/esri/core/workers/chunks/{65161a874595b0a34aa1.js → b312dd3027492007d75e.js} +1 -1
- package/assets/esri/core/workers/chunks/{83c9da68d6dbc77f60e5.js → beead2b06c994b4e61af.js} +1 -1
- package/assets/esri/core/workers/chunks/{5e20fd8b7c9497f2da1f.js → bfb08d3e2208c6178af9.js} +1 -1
- package/assets/esri/core/workers/chunks/{04e5486f0d8d4c6bd8a2.js → c3236a7058e64ea3b939.js} +1 -1
- package/assets/esri/core/workers/chunks/c4e9c71be6299c60c539.js +1 -0
- package/assets/esri/core/workers/chunks/c705f907ce60a646d9aa.js +1 -0
- package/assets/esri/core/workers/chunks/ce6abfafa0171b9c8d81.js +1 -0
- package/assets/esri/core/workers/chunks/{08a5c5a33a7c7c6852e5.js → d00b0f8236f1526099d4.js} +1 -1
- package/assets/esri/core/workers/chunks/d13951412a57e1af6208.js +1 -0
- package/assets/esri/core/workers/chunks/ecaf8f030026e41e1d1a.js +1 -0
- package/assets/esri/core/workers/chunks/f328a6cd4b7d8c653fc7.js +1 -0
- package/assets/esri/core/workers/chunks/f6a6178d4df029ff010d.js +1 -0
- package/assets/esri/core/workers/chunks/fde2301c6cd97a3cfb86.js +1 -0
- package/assets/esri/core/workers/chunks/fe84bcdfd9028b5e7ef6.js +1 -0
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +4 -0
- package/assets/esri/themes/base/widgets/_LayerList.scss +4 -0
- 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/chunks/CheckerBoard.glsl.js +2 -2
- package/chunks/ColorMaterial.glsl.js +9 -9
- package/chunks/ComponentShader.glsl.js +33 -33
- package/chunks/DefaultMaterial.glsl.js +35 -35
- package/chunks/HUDMaterial.glsl.js +11 -11
- package/chunks/ImageMaterial.glsl.js +5 -5
- package/chunks/LineMarker.glsl.js +17 -17
- package/chunks/NativeLine.glsl.js +3 -3
- package/chunks/Path.glsl.js +28 -28
- package/chunks/Pattern.glsl.js +9 -9
- package/chunks/PointRenderer.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +4 -4
- package/chunks/RibbonLine.glsl.js +1 -1
- package/chunks/ShadedColorMaterial.glsl.js +1 -1
- package/chunks/SimpleAtmosphere.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +92 -92
- package/chunks/WaterSurface.glsl.js +22 -22
- package/chunks/common.js +1 -1
- package/chunks/mat2.js +1 -1
- package/chunks/mat2d.js +1 -1
- package/chunks/mat3.js +1 -1
- package/chunks/mat4.js +1 -1
- package/chunks/quat.js +1 -1
- package/chunks/quat2.js +1 -1
- package/chunks/vec2.js +1 -1
- package/chunks/vec3.js +1 -1
- package/chunks/vec4.js +1 -1
- package/core/Message.js +1 -1
- package/core/accessorSupport/tracking.js +1 -1
- package/core/libs/gl-matrix-2/math/common.js +1 -1
- package/core/libs/gl-matrix-2/math/vec2.js +1 -1
- package/core/pbf.js +1 -1
- package/core/quantity.js +0 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/support/scaleUtils.js +1 -1
- package/identity/IdentityForm.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/identity/OAuthCredential.js +1 -1
- package/interfaces.d.ts +3347 -190
- package/intl/date.js +1 -1
- package/intl/duration.js +1 -1
- package/intl/messages.js +1 -1
- package/intl/substitute.js +1 -1
- package/kernel.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/support/ControlPointsGeoreference.d.ts +4 -0
- package/layers/support/ControlPointsGeoreference.js +5 -0
- package/layers/support/CornersGeoreference.js +1 -1
- package/layers/support/ElevationSamplerData.js +5 -0
- package/layers/support/ElevationTile.js +1 -1
- package/layers/support/ExportImageServiceParameters.js +1 -1
- package/layers/support/MediaElementBase.js +1 -1
- package/layers/support/imageryRendererUtils.js +1 -1
- package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
- package/package.json +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/request.js +1 -1
- package/rest/route/utils.js +1 -1
- package/rest/serviceArea.js +1 -1
- package/rest/support/ServiceAreaParameters.js +1 -1
- package/rest/support/ServiceAreaSolveResult.js +1 -1
- package/smartMapping/raster/renderers/classBreaks.js +1 -1
- package/smartMapping/raster/renderers/uniqueValue.js +1 -1
- package/support/apiKeyUtils.js +1 -1
- package/support/requestUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/MapNotesLayerView2D.js +1 -1
- package/views/2d/navigation/actions/Pinch.js +1 -1
- package/views/2d/tiling/TileCache.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/environment/CloudsCompositionTechnique.js +1 -1
- package/views/3d/environment/CloudsTechnique.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/FogTechnique.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/environment/SimpleAtmosphereTechniqueConfiguration.js +1 -1
- package/views/3d/environment/StarsTechnique.js +1 -1
- package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/ImageryLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +5 -0
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/LaserlinePathData.js +1 -1
- package/views/3d/support/ResourceController.js +1 -1
- package/views/3d/terrain/BlendLayersTechnique.js +1 -1
- package/views/3d/terrain/ElevationData.js +1 -1
- package/views/3d/terrain/GeometryState.js +1 -1
- package/views/3d/terrain/OverlayRenderTarget.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
- package/views/3d/terrain/TerrainConst.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputConfiguration.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +11 -11
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +55 -55
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/BlendWeightsTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/BlurTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/EdgeDetectTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/TransparencyPassType.js +5 -0
- package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.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/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.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/HighlightApplyTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightBlurTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightDownsampleTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRendererTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRendererTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/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/ShadowHighlightTechnique.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/TerrainTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingConstraint.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/interactive/support/viewUtils.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/support/geometry2dUtils.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/Zoom/ZoomConditions3D.js +1 -1
- package/widgets/Zoom/ZoomViewModel.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/support/widgetUtils.js +1 -1
- package/assets/esri/core/workers/chunks/06a7f58260225f52f8e6.js +0 -1
- package/assets/esri/core/workers/chunks/0e00741d35cdbf48e72d.js +0 -1
- package/assets/esri/core/workers/chunks/1ebb29ceabc81509646c.js +0 -1
- package/assets/esri/core/workers/chunks/24f7a3df08c3a2d3795c.js +0 -1
- package/assets/esri/core/workers/chunks/39a754713a48d46618bd.js +0 -1
- package/assets/esri/core/workers/chunks/462163f31fa134b7b216.js +0 -1
- package/assets/esri/core/workers/chunks/4bfcb7350ca492767a45.js +0 -1
- package/assets/esri/core/workers/chunks/5470cb0c3f670957c22c.js +0 -1
- package/assets/esri/core/workers/chunks/6889d698a2c796ed1ce6.js +0 -1
- package/assets/esri/core/workers/chunks/869310ef4c98542bf9df.js +0 -1
- package/assets/esri/core/workers/chunks/8ebaad46e2fe8925e3b0.js +0 -1
- package/assets/esri/core/workers/chunks/98c519ac806cc55bc19b.js +0 -1
- package/assets/esri/core/workers/chunks/9d07969fbea13aa5b03c.js +0 -1
- package/assets/esri/core/workers/chunks/9e6ce879ec0da884b9b8.js +0 -1
- package/assets/esri/core/workers/chunks/abd1bd74ba571e39ab5a.js +0 -1
- package/assets/esri/core/workers/chunks/b26ea76e3f41b45756e0.js +0 -1
- package/assets/esri/core/workers/chunks/c2286d97539066c8549a.js +0 -1
- package/assets/esri/core/workers/chunks/c495a66978d67c7e17f3.js +0 -1
- package/assets/esri/core/workers/chunks/c7fa92daca3f6e91734e.js +0 -987
- package/assets/esri/core/workers/chunks/c9e890b4be9d01c13efe.js +0 -1
- package/assets/esri/core/workers/chunks/dda5ea7f8d35e257815c.js +0 -1
- package/assets/esri/core/workers/chunks/e153e89c8a15c2f036ef.js +0 -1
- package/assets/esri/core/workers/chunks/e201ffcca7321771ee20.js +0 -1
- package/assets/esri/core/workers/chunks/e5b5b93e707173a4c883.js +0 -1
- package/assets/esri/core/workers/chunks/f7d1f75b6aa3ef566d74.js +0 -1
- package/assets/esri/core/workers/chunks/fde9e9683335fa6c8236.js +0 -1
- package/core/queryUtils.js +0 -5
- package/views/3d/layers/graphics/Graphics3DFilterVisibility.js +0 -5
- package/views/3d/layers/support/HeatmapFilterVisibility.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputOptions.js +0 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/HeaderComment.glsl.js +0 -10
- package/views/3d/webgl-engine/lib/RenderPass.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../../../../core/maybe.js";import{s as t,c as r,n as
|
|
5
|
+
import{isSome as e}from"../../../../core/maybe.js";import{s as t,c as r,n as a,b as s,l as i,g as o,e as n,t as h}from"../../../../chunks/vec3.js";import{c,f as l}from"../../../../chunks/vec3f64.js";import{ViewingMode as u}from"../../../ViewingMode.js";import{newLayout as m}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as p}from"../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as d}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as f}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as g}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{CullFaceOptions as T}from"../lib/basicInterfaces.js";import{GLTextureMaterial as _}from"../lib/GLTextureMaterial.js";import{Material as v}from"../lib/Material.js";import{OITPolygonOffsetLimit as b}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as O}from"../lib/VertexAttribute.js";import{getVerticalOffsetObject3D as x}from"../lib/verticalOffsetUtils.js";import{writeDefaultAttributes as w}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as A,intersectTriangleGeometry as M}from"./internal/MaterialUtil.js";import{DefaultMaterialTechnique as y,DefaultMaterialPassParameters as L}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as E}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as I}from"../shaders/RealisticTreeTechnique.js";class R extends v{constructor(e){super(e,D),this.supportsEdges=!0,this._configuration=new E,this.vertexBufferLayout=j(this.parameters),this.instanceBufferLayout=e.instanced?B(this.parameters):null}isVisibleForOutput(e){return e!==p.Shadow&&e!==p.ShadowExludeHighlight&&e!==p.ShadowHighlight||this.parameters.castShadows}isVisible(){const t=this.parameters;if(!super.isVisible()||0===t.layerOpacity)return!1;const{instanced:r,hasVertexColors:a,hasSymbolColors:s,vvColorEnabled:i}=t,o=e(r)&&r.includes("color"),n="replace"===t.colorMixMode,h=t.opacity>0,c=t.externalColor&&t.externalColor[3]>0;return a&&(o||i||s)?!!n||h:a?n?c:h:o||i||s?!!n||h:n?c:h}getConfiguration(t,r){return this._configuration.output=t,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=!!this.parameters.instanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.hasVerticalOffset=e(this.parameters.verticalOffset),this._configuration.hasScreenSizePerspective=e(this.parameters.screenSizePerspective),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType="screenDerivative"===this.parameters.normals?d.ScreenDerivative:d.Attribute,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,e(this.parameters.customDepthTest)&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?T.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=r.multipassTerrain.enabled,this._configuration.cullAboveGround=r.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=e(this.parameters.modelTransformation),t!==p.Color&&t!==p.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=f.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?f.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?f.WindingOrder:f.None,this._configuration.instancedColor=e(this.parameters.instanced)&&this.parameters.instanced.includes("color"),this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!r.ssaoHelper.ready&&this.parameters.receiveSSAO,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?g.Schematic:g.Normal:g.Disabled,this._configuration.hasMetalnessAndRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.enableOffset=r.camera.relativeElevation<b,this._configuration.snowCover=this.hasSnowCover(r)),this._configuration}hasSnowCover(t){return e(t.weather)&&t.weatherVisible&&"snowy"===t.weather.type&&"enabled"===t.weather.snowCover}intersect(c,l,m,p,d,f,g){if(e(this.parameters.verticalOffset)){const e=p.camera;t(k,m[12],m[13],m[14]);let c=null;switch(p.viewingMode){case u.Global:c=a(U,k);break;case u.Local:c=r(U,G)}let l=0;const g=s(q,k,e.eye),T=i(g),_=o(g,g,1/T);let v=null;this.parameters.screenSizePerspective&&(v=n(c,_)),l+=A(e,T,this.parameters.verticalOffset,v,this.parameters.screenSizePerspective),o(c,c,l),h(z,c,p.transform.inverseRotation),d=s(V,d,z),f=s(H,f,z)}M(c,l,p,d,f,x(p.verticalOffset),g)}requiresSlot(e,t){if(t===p.Color||t===p.Alpha||t===p.Depth||t===p.Normal||t===p.Shadow||t===p.ShadowHighlight||t===p.ShadowExludeHighlight||t===p.Highlight){return e===(this.parameters.transparent?this.parameters.writeDepth?S.TRANSPARENT_MATERIAL:S.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:S.OPAQUE_MATERIAL)||e===S.DRAPED_MATERIAL}return!1}createGLMaterial(e){return new C(e)}createBufferWriter(){return new N(this.vertexBufferLayout,this.instanceBufferLayout)}}class C extends _{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){const r=this._material.parameters;this.updateTexture(r.textureId);const a=e.camera.viewInverseTransposeMatrix;return t(r.origin,a[3],a[7],a[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(r.treeRendering?I:y,e)}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==p.Color&&this._output!==p.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this._updateParameters(e)}}class P extends L{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}}const D=new P;class N{constructor(e,t){this.vertexBufferLayout=e,this.instanceBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(O.POSITION).length}write(e,t,r,a){w(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,a)}}function j(e){const t=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId,r=m().vec3f(O.POSITION).vec3f(O.NORMAL);return e.hasVertexTangents&&r.vec4f(O.TANGENT),t&&r.vec2f(O.UV0),e.hasVertexColors&&r.vec4u8(O.COLOR),e.hasSymbolColors&&r.vec4u8(O.SYMBOLCOLOR),r}function B(t){let r=m();return r=t.instancedDoublePrecision?r.vec3f(O.MODELORIGINHI).vec3f(O.MODELORIGINLO).mat3f(O.MODEL).mat3f(O.MODELNORMAL):r.mat4f(O.MODEL).mat4f(O.MODELNORMAL),e(t.instanced)&&t.instanced.includes("color")&&(r=r.vec4f(O.INSTANCECOLOR)),e(t.instanced)&&t.instanced.includes("featureAttribute")&&(r=r.vec4f(O.INSTANCEFEATUREATTRIBUTE)),r}const V=c(),H=c(),G=l(0,0,1),U=c(),z=c(),k=c(),q=c();export{C as DefaultGLMaterial,R as DefaultMaterial,P as DefaultMaterialParameters,B as getInstanceBufferLayout};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as o}from"../../../../chunks/tslib.es6.js";import{BindType as e}from"../core/shaderTechnique/BindType.js";import{parameter as t,ShaderTechniqueConfiguration as r}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class s extends r{}o([t({constValue:!0})],s.prototype,"hasSliceHighlight",void 0),o([t({constValue:!1})],s.prototype,"hasSliceInVertexProgram",void 0),o([t({constValue:!1})],s.prototype,"instancedDoublePrecision",void 0),o([t({constValue:!1})],s.prototype,"isGround",void 0),o([t({constValue:!1})],s.prototype,"hasModelTransformation",void 0),o([t({constValue:e.Pass})],s.prototype,"pbrTextureBindType",void 0);export{s as DefaultTechniqueConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as e}from"../../../../core/mathUtils.js";import{isSome as t,unwrapOr as r}from"../../../../core/maybe.js";import{f as s}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{a}from"../../../../chunks/mat4.js";import{c as n}from"../../../../chunks/mat4f64.js";import{c as o}from"../../../../chunks/vec2.js";import{a as c,f as l}from"../../../../chunks/vec2f64.js";import{s as f,m as u,n as h,b as p,g as m,c as d,l as g,i as O,t as S,e as v,a as A}from"../../../../chunks/vec3.js";import{c as P,f as b}from"../../../../chunks/vec3f64.js";import{c as x,f as _}from"../../../../chunks/vec4f64.js";import{isMat4 as y}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as I}from"../../../../geometry/support/aaBoundingRect.js";import{newLayout as z}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as T}from"../core/shaderLibrary/ShaderOutputOptions.js";import{HUDSpace as C}from"../core/shaderLibrary/hud/HUD.glsl.js";import{computeAttachmentOriginPoints as M}from"../lib/geometryDataUtils.js";import{GLTextureMaterial as j,GLTextureMaterialBindParameters as U}from"../lib/GLTextureMaterial.js";import{Material as w,RenderOccludedFlag as D}from"../lib/Material.js";import{RenderSlot as L}from"../lib/RenderSlot.js";import{applyScaleFactor as E,applyPrecomputedScaleFactor as R,precomputeScaleFactor as V}from"../lib/screenSizePerspectiveUtils.js";import{assert as N}from"../lib/Util.js";import{VertexAttribute as G}from"../lib/VertexAttribute.js";import{writePosition as H,writeNormal as B,writeColor as X,writeBufferVec4 as k}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as q}from"./internal/MaterialUtil.js";import{isInstanceHidden as F}from"./renderers/utils.js";import{c as W}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as Z}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as J}from"../shaders/HUDMaterialTechniqueConfiguration.js";class K extends w{constructor(e){super(e,new ve),this._configuration=new J}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?C.Screen:C.World,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.isDraped=this.parameters.isDraped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.vvSize=!!this.parameters.vvSizeEnabled,this._configuration.vvColor=!!this.parameters.vvColorEnabled,e===T.Color&&(this._configuration.debugDrawLabelBorder=!!this.parameters.debugDrawLabelBorder),e===T.Highlight&&(this._configuration.binaryHighlightOcclusionEnabled=this.parameters.binaryHighlightOcclusion),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassGeometry=t.multipassGeometry.enabled,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,r,s,i,a,n,o,c,l){t(l)?this._intersectDrapedHudGeometry(e,n,o,c,l):this._intersectHudGeometry(e,r,s,i,o,c)}_intersectDrapedHudGeometry(e,r,s,i,a){const n=e.vertexAttributes.get(G.POSITION),o=e.vertexAttributes.get(G.SIZE),c=this.parameters,l=W(c);let f=1,u=1;if(t(i)){const e=i(me);f=e[0],u=e[5]}f*=e.screenToWorldRatio,u*=e.screenToWorldRatio;const h=ge*e.screenToWorldRatio;for(let t=0;t<n.data.length/n.size;t++){const i=t*n.size,p=n.data[i],m=n.data[i+1],d=t*o.size;let g;Oe[0]=o.data[d]*f,Oe[1]=o.data[d+1]*u,c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),te(r,p,m,Oe,h,g,c,l)&&s(a.dist,a.normal,-1,!1)}}_intersectHudGeometry(e,r,i,n,o,c){if(!n.options.selectionMode||!n.options.hud||F(r))return;const l=this.parameters;let S=1,v=1;if(s(le,i),t(c)){const e=c(me);S=e[0],v=e[5],ee(le)}const A=e.vertexAttributes.get(G.POSITION),b=e.vertexAttributes.get(G.SIZE),x=e.vertexAttributes.get(G.NORMAL),_=e.vertexAttributes.get(G.AUXPOS1);N(A.size>=3);const y=n.point,I=n.camera,z=W(l);S*=I.pixelRatio,v*=I.pixelRatio;const T="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<A.data.length/A.size;t++){const e=t*A.size;f(ie,A.data[e],A.data[e+1],A.data[e+2]),u(ie,ie,i);const r=t*b.size;Oe[0]=b.data[r]*S,Oe[1]=b.data[r+1]*v,u(ie,ie,I.viewMatrix);const s=t*_.size;if(f(he,_.data[s+0],_.data[s+1],_.data[s+2]),!T&&(ie[0]+=he[0],ie[1]+=he[1],0!==he[2])){const e=he[2];h(he,ie),p(ie,ie,m(he,he,e))}const c=t*x.size;if(f(ae,x.data[c],x.data[c+1],x.data[c+2]),this._normalAndViewAngle(ae,le,I,pe),this._applyVerticalOffsetTransformationView(ie,pe,I,re),I.applyProjection(ie,ne),ne[0]>-1){ne[0]=Math.floor(ne[0]),ne[1]=Math.floor(ne[1]),T&&(he[0]||he[1])&&(ne[0]+=he[0],0!==he[1]&&(ne[1]+=E(he[1],re.factorAlignment)),I.unapplyProjection(ne,ie)),ne[0]+=this.parameters.screenOffset[0],ne[1]+=this.parameters.screenOffset[1],R(Oe,re.factor,Oe);const e=de*I.pixelRatio;let t;if(l.textureIsSignedDistanceField&&(t=l.outlineSize*I.pixelRatio/2),te(y,ne[0],ne[1],Oe,e,t,l,z)){const e=n.ray;if(u(ce,ie,a(ue,I.viewMatrix)),ne[0]=y[0],ne[1]=y[1],I.unprojectFromRenderScreen(ne,ie)){const t=P();d(t,e.direction);const r=1/g(t);m(t,t,r);o(O(e.origin,ie)*r,t,-1,!0,1,ce)}}}}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const s=r.get(G.POSITION),i=e.indices.get(G.POSITION);return M(s,i,t)}createBufferWriter(){return new Pe(this)}_normalAndViewAngle(e,t,r,i){return y(t)&&(t=s(fe,t)),S(i.normal,e,t),u(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=v(oe,Se),i}_updateScaleInfo(e,r,s){const i=this.parameters;t(i.screenSizePerspective)?V(s,r,i.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minPixelSize=0,e.factor.paddingPixels=0),t(i.screenSizePerspectiveAlignment)?V(s,r,i.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minPixelSize=e.factor.minPixelSize,e.factorAlignment.paddingPixels=e.factor.paddingPixels)}applyShaderOffsetsView(e,t,r,s,i,a,n){const o=this._normalAndViewAngle(t,r,i,pe);return this._applyVerticalGroundOffsetView(e,o,i,n),this._applyVerticalOffsetTransformationView(n,o,i,a),this._applyPolygonOffsetView(n,o,s[3],i,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,r,s,i,a){return this._applyCenterOffsetNDC(e,r,s,i),t(a)&&d(a,i),this._applyPolygonOffsetNDC(i,r,s,i),i}_applyPolygonOffsetView(t,r,s,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const c=n*o;if(this.parameters.shaderPolygonOffset<=0)return d(a,t);const l=e(Math.abs(r.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/i.viewport[2];return m(a,t,c>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,r,s){const i=g(e),a=r.aboveGround?1:-1,n=.5*r.computeRenderPixelSizeAtDist(i),o=m(ie,t.normal,a*n);return A(s,e,o),s}_applyVerticalOffsetTransformationView(e,t,s,i){const a=this.parameters;if(!a.verticalOffset||!a.verticalOffset.screenLength){if(a.screenSizePerspective||a.screenSizePerspectiveAlignment){const r=g(e);this._updateScaleInfo(i,r,t.cosAngle)}else i.factor.scale=1,i.factorAlignment.scale=1;return e}const n=g(e),o=r(a.screenSizePerspectiveAlignment,a.screenSizePerspective),c=q(s,n,a.verticalOffset,t.cosAngle,o);return this._updateScaleInfo(i,n,t.cosAngle),m(t.normal,t.normal,c),A(e,e,t.normal)}_applyCenterOffsetView(e,t,r){const s="screen"!==this.parameters.centerOffsetUnits;return r!==e&&d(r,e),s&&(r[0]+=t[0],r[1]+=t[1],t[2]&&(h(ae,r),A(r,r,m(ae,ae,t[2])))),r}_applyCenterOffsetNDC(e,t,r,s){const i="screen"!==this.parameters.centerOffsetUnits;return s!==e&&d(s,e),i||(s[0]+=t[0]/r.fullWidth*2,s[1]+=t[1]/r.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,r,s){const i=this.parameters.shaderPolygonOffset;if(e!==s&&d(s,e),i){const e=r.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*i}return s}requiresSlot(e){if(e===L.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:t,occlusionTest:r}=this.parameters;return e===(t?L.LABEL_MATERIAL:L.HUD_MATERIAL)||r&&e===L.OCCLUSION_PIXELS}createGLMaterial(e){return e.output===T.Color||e.output===T.Alpha?new Y(e):e.output===T.Highlight?new Q(e):null}calculateRelativeScreenBounds(e,t,r=I()){return $(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class Q extends j{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(Z,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}class Y extends Q{_isOcclusionSlot(e){return e.slot===L.OCCLUSION_PIXELS&&this._material.parameters.occlusionTest&&(this._output===T.Color||this._output===T.Alpha)}selectProgram(e){return this.ensureTechnique(Z,e,this._isOcclusionSlot(e)?T.Occlusion:this._output)}}function $(e,t,r,s=se){return o(s,e.anchorPosition),s[0]*=-t[0],s[1]*=-t[1],s[0]+=e.screenOffset[0]*r,s[1]+=e.screenOffset[1]*r,s}function ee(e){const t=e[0],r=e[1],s=e[2],i=e[3],a=e[4],n=e[5],o=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+r*r+s*s),u=1/Math.sqrt(i*i+a*a+n*n),h=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=r*f,e[2]=s*f,e[3]=i*u,e[4]=a*u,e[5]=n*u,e[6]=o*h,e[7]=c*h,e[8]=l*h,e}function te(e,r,s,i,a,n,o,c){let l=r-a-(c[0]>0?i[0]*c[0]:0),f=l+i[0]+2*a,u=s-a-(c[1]>0?i[1]*c[1]:0),h=u+i[1]+2*a;const p=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&t(p)&&(l+=i[0]*p[0],u+=i[1]*p[1],f-=i[0]*(1-p[2]),h-=i[1]*(1-p[3]),l-=n,f+=n,u-=n,h+=n),e[0]>l&&e[0]<f&&e[1]>u&&e[1]<h}const re={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},factorAlignment:{scale:0,factor:0,minPixelSize:0,paddingPixels:0}},se=c(),ie=P(),ae=P(),ne=x(),oe=P(),ce=P(),le=i(),fe=i(),ue=n(),he=P(),pe={normal:oe,cosAngle:0},me=n(),de=1,ge=2,Oe=[0,0],Se=b(0,0,1);class ve extends U{constructor(){super(...arguments),this.renderOccluded=D.Occlude,this.color=_(1,1,1,1),this.texCoordScale=[1,1],this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.outlineColor=_(1,1,1,1),this.outlineSize=0,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.binaryHighlightOcclusion=!0,this.debugDrawLabelBorder=!1,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.isDraped=!1}}const Ae=z().vec3f(G.POSITION).vec3f(G.NORMAL).vec2f(G.UV0).vec4u8(G.COLOR).vec2f(G.SIZE).vec4f(G.AUXPOS1).vec4f(G.AUXPOS2);class Pe{constructor(e){this._material=e,this.vertexBufferLayout=Ae}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 6*e.indices.get(G.POSITION).length}write(e,t,r,s){H(t.indices.get(G.POSITION),t.vertexAttributes.get(G.POSITION).data,e.transformation,r.position,s,6),B(t.indices.get(G.NORMAL),t.vertexAttributes.get(G.NORMAL).data,e.invTranspTransformation,r.normal,s,6);{const e=t.vertexAttributes.get(G.UV0).data;let i,a,n,o;if(null==e||e.length<4){const e=this._material.parameters;i=0,a=0,n=e.texCoordScale[0],o=e.texCoordScale[1]}else i=e[0],a=e[1],n=e[2],o=e[3];n=Math.min(1.99999,n+1),o=Math.min(1.99999,o+1);const c=t.indices.get(G.POSITION).length,l=r.uv0;let f=s;for(let t=0;t<c;++t)l.set(f,0,i),l.set(f,1,a),f+=1,l.set(f,0,n),l.set(f,1,a),f+=1,l.set(f,0,n),l.set(f,1,o),f+=1,l.set(f,0,n),l.set(f,1,o),f+=1,l.set(f,0,i),l.set(f,1,o),f+=1,l.set(f,0,i),l.set(f,1,a),f+=1}X(t.indices.get(G.COLOR),t.vertexAttributes.get(G.COLOR).data,4,r.color,s,6);{const e=t.indices.get(G.SIZE),i=t.vertexAttributes.get(G.SIZE).data,a=e.length,n=r.size;let o=s;for(let t=0;t<a;++t){const r=i[2*e[t]],s=i[2*e[t]+1];for(let e=0;e<6;++e)n.set(o,0,r),n.set(o,1,s),o+=1}}t.indices.get(G.AUXPOS1)&&t.vertexAttributes.get(G.AUXPOS1)&&k(t.indices.get(G.AUXPOS1),t.vertexAttributes.get(G.AUXPOS1).data,r.auxpos1,s,6),t.indices.get(G.AUXPOS2)&&t.vertexAttributes.get(G.AUXPOS2)&&k(t.indices.get(G.AUXPOS2),t.vertexAttributes.get(G.AUXPOS2).data,r.auxpos2,s,6)}}export{K as HUDMaterial,ve as Parameters};
|
|
5
|
+
import{clamp as e}from"../../../../core/mathUtils.js";import{isSome as t,unwrapOr as r}from"../../../../core/maybe.js";import{f as s}from"../../../../chunks/mat3.js";import{c as i}from"../../../../chunks/mat3f64.js";import{a}from"../../../../chunks/mat4.js";import{c as n}from"../../../../chunks/mat4f64.js";import{c as o}from"../../../../chunks/vec2.js";import{a as c,f as l}from"../../../../chunks/vec2f64.js";import{s as f,m as u,n as h,b as p,g as m,c as d,l as g,i as S,t as O,e as v,a as A}from"../../../../chunks/vec3.js";import{c as P,f as b}from"../../../../chunks/vec3f64.js";import{c as x,f as _}from"../../../../chunks/vec4f64.js";import{isMat4 as y}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as I}from"../../../../geometry/support/aaBoundingRect.js";import{newLayout as z}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as T}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as C}from"../core/shaderLibrary/hud/HUD.glsl.js";import{computeAttachmentOriginPoints as M}from"../lib/geometryDataUtils.js";import{GLTextureMaterial as j,GLTextureMaterialBindParameters as U}from"../lib/GLTextureMaterial.js";import{Material as w,RenderOccludedFlag as D}from"../lib/Material.js";import{RenderSlot as L}from"../lib/RenderSlot.js";import{applyScaleFactor as E,applyPrecomputedScaleFactor as R,precomputeScaleFactor as V}from"../lib/screenSizePerspectiveUtils.js";import{assert as N}from"../lib/Util.js";import{VertexAttribute as G}from"../lib/VertexAttribute.js";import{writePosition as H,writeNormal as B,writeColor as X,writeBufferVec4 as k}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as F}from"./internal/MaterialUtil.js";import{isInstanceHidden as q}from"./renderers/utils.js";import{c as W}from"../../../../chunks/HUDMaterial.glsl.js";import{HUDMaterialTechnique as Z}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as J}from"../shaders/HUDMaterialTechniqueConfiguration.js";class K extends w{constructor(e){super(e,new Oe),this._configuration=new J}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?C.Screen:C.World,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.isDraped=this.parameters.isDraped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.vvSize=!!this.parameters.vvSizeEnabled,this._configuration.vvColor=!!this.parameters.vvColorEnabled,this._configuration.occlusionPass=t.slot===L.OCCLUSION_PIXELS&&this.parameters.occlusionTest&&(e===T.Color||e===T.Alpha),e===T.Color&&(this._configuration.debugDrawLabelBorder=!!this.parameters.debugDrawLabelBorder),e===T.Highlight&&(this._configuration.binaryHighlightOcclusionEnabled=this.parameters.binaryHighlightOcclusion),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassGeometry=t.multipassGeometry.enabled,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,r,s,i,a,n,o,c,l){t(l)?this._intersectDrapedHudGeometry(e,n,o,c,l):this._intersectHudGeometry(e,r,s,i,o,c)}_intersectDrapedHudGeometry(e,r,s,i,a){const n=e.vertexAttributes.get(G.POSITION),o=e.vertexAttributes.get(G.SIZE),c=this.parameters,l=W(c);let f=1,u=1;if(t(i)){const e=i(pe);f=e[0],u=e[5]}f*=e.screenToWorldRatio,u*=e.screenToWorldRatio;const h=de*e.screenToWorldRatio;for(let t=0;t<n.data.length/n.size;t++){const i=t*n.size,p=n.data[i],m=n.data[i+1],d=t*o.size;let g;ge[0]=o.data[d]*f,ge[1]=o.data[d+1]*u,c.textureIsSignedDistanceField&&(g=c.outlineSize*e.screenToWorldRatio/2),ee(r,p,m,ge,h,g,c,l)&&s(a.dist,a.normal,-1,!1)}}_intersectHudGeometry(e,r,i,n,o,c){if(!n.options.selectionMode||!n.options.hud||q(r))return;const l=this.parameters;let O=1,v=1;if(s(ce,i),t(c)){const e=c(pe);O=e[0],v=e[5],$(ce)}const A=e.vertexAttributes.get(G.POSITION),b=e.vertexAttributes.get(G.SIZE),x=e.vertexAttributes.get(G.NORMAL),_=e.vertexAttributes.get(G.AUXPOS1);N(A.size>=3);const y=n.point,I=n.camera,z=W(l);O*=I.pixelRatio,v*=I.pixelRatio;const T="screen"===this.parameters.centerOffsetUnits;for(let t=0;t<A.data.length/A.size;t++){const e=t*A.size;f(se,A.data[e],A.data[e+1],A.data[e+2]),u(se,se,i);const r=t*b.size;ge[0]=b.data[r]*O,ge[1]=b.data[r+1]*v,u(se,se,I.viewMatrix);const s=t*_.size;if(f(ue,_.data[s+0],_.data[s+1],_.data[s+2]),!T&&(se[0]+=ue[0],se[1]+=ue[1],0!==ue[2])){const e=ue[2];h(ue,se),p(se,se,m(ue,ue,e))}const c=t*x.size;if(f(ie,x.data[c],x.data[c+1],x.data[c+2]),this._normalAndViewAngle(ie,ce,I,he),this._applyVerticalOffsetTransformationView(se,he,I,te),I.applyProjection(se,ae),ae[0]>-1){ae[0]=Math.floor(ae[0]),ae[1]=Math.floor(ae[1]),T&&(ue[0]||ue[1])&&(ae[0]+=ue[0],0!==ue[1]&&(ae[1]+=E(ue[1],te.factorAlignment)),I.unapplyProjection(ae,se)),ae[0]+=this.parameters.screenOffset[0],ae[1]+=this.parameters.screenOffset[1],R(ge,te.factor,ge);const e=me*I.pixelRatio;let t;if(l.textureIsSignedDistanceField&&(t=l.outlineSize*I.pixelRatio/2),ee(y,ae[0],ae[1],ge,e,t,l,z)){const e=n.ray;if(u(oe,se,a(fe,I.viewMatrix)),ae[0]=y[0],ae[1]=y[1],I.unprojectFromRenderScreen(ae,se)){const t=P();d(t,e.direction);const r=1/g(t);m(t,t,r);o(S(e.origin,se)*r,t,-1,!0,1,oe)}}}}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const s=r.get(G.POSITION),i=e.indices.get(G.POSITION);return M(s,i,t)}createBufferWriter(){return new Ae(this)}_normalAndViewAngle(e,t,r,i){return y(t)&&(t=s(le,t)),O(i.normal,e,t),u(i.normal,i.normal,r.viewInverseTransposeMatrix),i.cosAngle=v(ne,Se),i}_updateScaleInfo(e,r,s){const i=this.parameters;t(i.screenSizePerspective)?V(s,r,i.screenSizePerspective,e.factor):(e.factor.scale=1,e.factor.factor=0,e.factor.minPixelSize=0,e.factor.paddingPixels=0),t(i.screenSizePerspectiveAlignment)?V(s,r,i.screenSizePerspectiveAlignment,e.factorAlignment):(e.factorAlignment.factor=e.factor.factor,e.factorAlignment.scale=e.factor.scale,e.factorAlignment.minPixelSize=e.factor.minPixelSize,e.factorAlignment.paddingPixels=e.factor.paddingPixels)}applyShaderOffsetsView(e,t,r,s,i,a,n){const o=this._normalAndViewAngle(t,r,i,he);return this._applyVerticalGroundOffsetView(e,o,i,n),this._applyVerticalOffsetTransformationView(n,o,i,a),this._applyPolygonOffsetView(n,o,s[3],i,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,r,s,i,a){return this._applyCenterOffsetNDC(e,r,s,i),t(a)&&d(a,i),this._applyPolygonOffsetNDC(i,r,s,i),i}_applyPolygonOffsetView(t,r,s,i,a){const n=i.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const c=n*o;if(this.parameters.shaderPolygonOffset<=0)return d(a,t);const l=e(Math.abs(r.cosAngle),.01,1),f=1-Math.sqrt(1-l*l)/l/i.viewport[2];return m(a,t,c>0?f:1/f),a}_applyVerticalGroundOffsetView(e,t,r,s){const i=g(e),a=r.aboveGround?1:-1,n=.5*r.computeRenderPixelSizeAtDist(i),o=m(se,t.normal,a*n);return A(s,e,o),s}_applyVerticalOffsetTransformationView(e,t,s,i){const a=this.parameters;if(!a.verticalOffset||!a.verticalOffset.screenLength){if(a.screenSizePerspective||a.screenSizePerspectiveAlignment){const r=g(e);this._updateScaleInfo(i,r,t.cosAngle)}else i.factor.scale=1,i.factorAlignment.scale=1;return e}const n=g(e),o=r(a.screenSizePerspectiveAlignment,a.screenSizePerspective),c=F(s,n,a.verticalOffset,t.cosAngle,o);return this._updateScaleInfo(i,n,t.cosAngle),m(t.normal,t.normal,c),A(e,e,t.normal)}_applyCenterOffsetView(e,t,r){const s="screen"!==this.parameters.centerOffsetUnits;return r!==e&&d(r,e),s&&(r[0]+=t[0],r[1]+=t[1],t[2]&&(h(ie,r),A(r,r,m(ie,ie,t[2])))),r}_applyCenterOffsetNDC(e,t,r,s){const i="screen"!==this.parameters.centerOffsetUnits;return s!==e&&d(s,e),i||(s[0]+=t[0]/r.fullWidth*2,s[1]+=t[1]/r.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,r,s){const i=this.parameters.shaderPolygonOffset;if(e!==s&&d(s,e),i){const e=r.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*i}return s}requiresSlot(e,t){if(t===T.Color||t===T.Alpha||t===T.Highlight){if(e===L.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:t,occlusionTest:r}=this.parameters;return e===(t?L.LABEL_MATERIAL:L.HUD_MATERIAL)||r&&e===L.OCCLUSION_PIXELS}return!1}createGLMaterial(e){return new Q(e)}calculateRelativeScreenBounds(e,t,r=I()){return Y(this.parameters,e,t,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}}class Q extends j{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(Z,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}}function Y(e,t,r,s=re){return o(s,e.anchorPosition),s[0]*=-t[0],s[1]*=-t[1],s[0]+=e.screenOffset[0]*r,s[1]+=e.screenOffset[1]*r,s}function $(e){const t=e[0],r=e[1],s=e[2],i=e[3],a=e[4],n=e[5],o=e[6],c=e[7],l=e[8],f=1/Math.sqrt(t*t+r*r+s*s),u=1/Math.sqrt(i*i+a*a+n*n),h=1/Math.sqrt(o*o+c*c+l*l);return e[0]=t*f,e[1]=r*f,e[2]=s*f,e[3]=i*u,e[4]=a*u,e[5]=n*u,e[6]=o*h,e[7]=c*h,e[8]=l*h,e}function ee(e,r,s,i,a,n,o,c){let l=r-a-(c[0]>0?i[0]*c[0]:0),f=l+i[0]+2*a,u=s-a-(c[1]>0?i[1]*c[1]:0),h=u+i[1]+2*a;const p=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&t(p)&&(l+=i[0]*p[0],u+=i[1]*p[1],f-=i[0]*(1-p[2]),h-=i[1]*(1-p[3]),l-=n,f+=n,u-=n,h+=n),e[0]>l&&e[0]<f&&e[1]>u&&e[1]<h}const te={factor:{scale:0,factor:0,minPixelSize:0,paddingPixels:0},factorAlignment:{scale:0,factor:0,minPixelSize:0,paddingPixels:0}},re=c(),se=P(),ie=P(),ae=x(),ne=P(),oe=P(),ce=i(),le=i(),fe=n(),ue=P(),he={normal:ne,cosAngle:0},pe=n(),me=1,de=2,ge=[0,0],Se=b(0,0,1);class Oe extends U{constructor(){super(...arguments),this.renderOccluded=D.Occlude,this.color=_(1,1,1,1),this.texCoordScale=[1,1],this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.outlineColor=_(1,1,1,1),this.outlineSize=0,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.binaryHighlightOcclusion=!0,this.debugDrawLabelBorder=!1,this.centerOffsetUnits="world",this.drawInSecondSlot=!1,this.depthEnabled=!0,this.isDraped=!1}}const ve=z().vec3f(G.POSITION).vec3f(G.NORMAL).vec2f(G.UV0).vec4u8(G.COLOR).vec2f(G.SIZE).vec4f(G.AUXPOS1).vec4f(G.AUXPOS2);class Ae{constructor(e){this._material=e,this.vertexBufferLayout=ve}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 6*e.indices.get(G.POSITION).length}write(e,t,r,s){H(t.indices.get(G.POSITION),t.vertexAttributes.get(G.POSITION).data,e.transformation,r.position,s,6),B(t.indices.get(G.NORMAL),t.vertexAttributes.get(G.NORMAL).data,e.invTranspTransformation,r.normal,s,6);{const e=t.vertexAttributes.get(G.UV0).data;let i,a,n,o;if(null==e||e.length<4){const e=this._material.parameters;i=0,a=0,n=e.texCoordScale[0],o=e.texCoordScale[1]}else i=e[0],a=e[1],n=e[2],o=e[3];n=Math.min(1.99999,n+1),o=Math.min(1.99999,o+1);const c=t.indices.get(G.POSITION).length,l=r.uv0;let f=s;for(let t=0;t<c;++t)l.set(f,0,i),l.set(f,1,a),f+=1,l.set(f,0,n),l.set(f,1,a),f+=1,l.set(f,0,n),l.set(f,1,o),f+=1,l.set(f,0,n),l.set(f,1,o),f+=1,l.set(f,0,i),l.set(f,1,o),f+=1,l.set(f,0,i),l.set(f,1,a),f+=1}X(t.indices.get(G.COLOR),t.vertexAttributes.get(G.COLOR).data,4,r.color,s,6);{const e=t.indices.get(G.SIZE),i=t.vertexAttributes.get(G.SIZE).data,a=e.length,n=r.size;let o=s;for(let t=0;t<a;++t){const r=i[2*e[t]],s=i[2*e[t]+1];for(let e=0;e<6;++e)n.set(o,0,r),n.set(o,1,s),o+=1}}t.indices.get(G.AUXPOS1)&&t.vertexAttributes.get(G.AUXPOS1)&&k(t.indices.get(G.AUXPOS1),t.vertexAttributes.get(G.AUXPOS1).data,r.auxpos1,s,6),t.indices.get(G.AUXPOS2)&&t.vertexAttributes.get(G.AUXPOS2)&&k(t.indices.get(G.AUXPOS2),t.vertexAttributes.get(G.AUXPOS2).data,r.auxpos2,s,6)}}export{K as HUDMaterial,Oe 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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as t}from"../../../../core/maybe.js";import{s as e,
|
|
5
|
+
import{isNone as t}from"../../../../core/maybe.js";import{s as e,k as r}from"../../../../chunks/vec2.js";import{a as s}from"../../../../chunks/vec2f64.js";import{isVec2 as i}from"../../../../core/libs/gl-matrix-2/types/vec2.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as a}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{Material as u}from"../lib/Material.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{VertexAttribute as l}from"../lib/VertexAttribute.js";import{writePosition as f,writeBufferFloat as m}from"./internal/bufferWriterUtils.js";import{HeatmapDensityPassParameters as p,HeatmapDensityTechniqueConfiguration as h,HeatmapDensityTechnique as d}from"../shaders/HeatmapDensityTechnique.js";export{RadiusMode}from"../shaders/HeatmapDensityTechnique.js";const T=2;class b extends p{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class A extends u{constructor(t){super(t,new b),this._configuration=new h}requiresSlot(t,e){return t===c.DRAPED_MATERIAL&&e===a.Color}getConfiguration(){return this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats,this._configuration}createGLMaterial(t){return new g(t)}intersect(s,o,a,n,u,c,f,m,p){if(t(p)||!i(c))return;const h=s.vertexAttributes.get(l.POSITION),{parameters:d}=this,{searchRadius:b}=d,{screenToWorldRatio:A}=s,g=b*A+T*A,I=g*g,v=h.data.length/h.size;for(let t=0;t<v;t++){const s=t*h.size,i=e(R,h.data[s],h.data[s+1]);r(i,c)<I&&f(p.dist,p.normal,-1,!1)}}createBufferWriter(){return new I(this.parameters.isAttributeDriven?j:v)}}class g extends n{beginSlot(t){return this.ensureTechnique(d,t)}}class I{constructor(t){this.vertexBufferLayout=t}allocate(t){return this.vertexBufferLayout.createBuffer(t)}elementCount(t){return t.indices.get(l.POSITION).length*O}write(t,e,r,s){f(e.indices.get(l.POSITION),e.vertexAttributes.get(l.POSITION).data,t.transformation,r.position,s,O);const i=e.indices.get(l.POSITION).length,o=r.uv0;let a=s;for(let u=0;u<i;++u)o.setValues(a++,-1,-1),o.setValues(a++,1,-1),o.setValues(a++,1,1),o.setValues(a++,1,1),o.setValues(a++,-1,1),o.setValues(a++,-1,-1);const n="featureAttribute"in r?r.featureAttribute:null;n&&m(e.indices.get(l.FEATUREATTRIBUTE),e.vertexAttributes.get(l.FEATUREATTRIBUTE).data,n,s,O)}}const v=o().vec3f(l.POSITION).vec2f(l.UV0),j=v.clone().f32(l.FEATUREATTRIBUTE),O=6;function x(t){return t instanceof A}const R=s();export{A as HeatmapDensityMaterial,b as HeatmapDensityMaterialParameters,x as isHeatMapDensityMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ShaderOutput as
|
|
5
|
+
import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as t}from"../lib/basicInterfaces.js";import{GLTextureMaterial as r}from"../lib/GLTextureMaterial.js";import{Material as a,MaterialParameters as s}from"../lib/Material.js";import{OITPolygonOffsetLimit as i}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as n}from"../lib/RenderSlot.js";import{DefaultBufferWriter as u,PositionUVLayout as o}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as h}from"./internal/MaterialUtil.js";import{ImageMaterialTechniqueConfiguration as l,ImageMaterialTechnique as c}from"../shaders/ImageMaterialTechnique.js";class p extends a{constructor(e){super(e,new d),this.supportsEdges=!0,this._configuration=new l}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<i,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,t,r,a,s,i,n){h(e,t,a,s,i,void 0,n)}requiresSlot(t,r){if(r===e.Color||r===e.Alpha||r===e.Highlight){if(t===n.DRAPED_MATERIAL)return!0;if(r===e.Highlight)return t===n.OPAQUE_MATERIAL;return t===(this.parameters.transparent?this.parameters.writeDepth?n.TRANSPARENT_MATERIAL:n.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:n.OPAQUE_MATERIAL)}return!1}createGLMaterial(e){return new m(e)}createBufferWriter(){return new u(o)}}class m extends r{constructor(e){super({...e,...e.material.parameters})}_updateParameters(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(c,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&(this._material.setParameters({hasOccludees:e.hasOccludees}),this._updateParameters(e))}beginSlot(t){return this._output!==e.Color&&this._output!==e.Alpha||this._updateOccludeeState(t),this._updateParameters(t)}}class d extends s{constructor(){super(...arguments),this.transparent=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=t.None,this.hasOccludees=!1,this.opacity=1,this.textureId=null,this.initTextureTransparent=!0}}export{p as ImageMaterial,d 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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../../../../core/maybe.js";import{f as t}from"../../../../chunks/vec2f32.js";import{Z as r}from"../../../../chunks/vec2f64.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as s}from"../core/shaderLibrary/
|
|
5
|
+
import{isSome as e}from"../../../../core/maybe.js";import{f as t}from"../../../../chunks/vec2f32.js";import{Z as r}from"../../../../chunks/vec2f64.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutput.js";import{HUDSpace as n}from"../core/shaderLibrary/hud/HUD.glsl.js";import a from"../lib/GLMaterial.js";import{Material as o,MaterialParameters as u}from"../lib/Material.js";import{RenderSlot as f}from"../lib/RenderSlot.js";import{VertexAttribute as c}from"../lib/VertexAttribute.js";import{writePosition as l,writeNormal as h,writeBufferVec4 as m}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as d}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as p}from"../shaders/LineCalloutTechniqueConfiguration.js";class g extends o{constructor(e){super(e,new S),this._configuration=new p,this._uniqueMaterialIdentifier=g.uniqueMaterialIdentifier(this.parameters)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}getPassParameters(){return this.parameters}getConfiguration(t,r){const i=r?.slot!==f.LINE_CALLOUTS;return this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=e(this.parameters.verticalOffset),this._configuration.hasScreenSizePerspective=e(this.parameters.screenSizePerspective),this._configuration.depthHudEnabled=i,this._configuration.depthHudAlignStartEnabled=!!this.parameters.depthHUDAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits?n.Screen:n.World,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasMultipassGeometry=r.multipassGeometry.enabled,this._configuration}intersect(){}requiresSlot(e,t){if(t===s.Color)switch(e){case f.LINE_CALLOUTS:case f.LINE_CALLOUTS_HUD_DEPTH:return!0}return!1}createGLMaterial(e){return new O(e)}createBufferWriter(){return new b}validateParameters(e){const t=g.uniqueMaterialIdentifier(e);t!==this._uniqueMaterialIdentifier&&(this._uniqueMaterialIdentifier=t)}static uniqueMaterialIdentifier(e){return JSON.stringify({screenOffset:e.screenOffset||[0,0],centerOffsetUnits:e.centerOffsetUnits||"world"})}}class O extends a{beginSlot(e){return this.ensureTechnique(d,e)}}class S extends u{constructor(){super(...arguments),this.screenOffset=r,this.color=[0,0,0,1],this.size=1,this.occlusionTest=!1,this.shaderPolygonOffset=1e-5,this.depthHUDAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}const L=i().vec3f(c.POSITION).vec3f(c.NORMAL).vec2f(c.UV0).vec4f(c.AUXPOS1),I=[t(0,0),t(1,0),t(0,1),t(1,0),t(1,1),t(0,1)];class b{constructor(){this.vertexBufferLayout=L}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return 6*e.indices.get(c.POSITION).length}write(e,t,r,i){l(t.indices.get(c.POSITION),t.vertexAttributes.get(c.POSITION).data,e.transformation,r.position,i,6),h(t.indices.get(c.NORMAL),t.vertexAttributes.get(c.NORMAL).data,e.invTranspTransformation,r.normal,i,6),m(t.indices.get(c.AUXPOS1),t.vertexAttributes.get(c.AUXPOS1).data,r.auxpos1,i,6);for(let s=0;s<I.length;++s)r.uv0.setVec(i+s,I[s])}}export{g as LineCalloutMaterial,S 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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{s as
|
|
5
|
+
import{s as e,z as t,m as r}from"../../../../chunks/vec3.js";import{c as a}from"../../../../chunks/vec3f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as n}from"../lib/GLTextureMaterial.js";import{Material as o,RenderOccludedFlag as u}from"../lib/Material.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{VertexAttribute as h}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as l}from"./VisualVariablePassParameters.js";import{vertexAttributeLocations as p,LineMarkerTechnique as d}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as m}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as E}from"../shaders/RibbonLineTechniqueConfiguration.js";class A extends o{constructor(e){super(e,new f),this._vertexAttributeLocations=p,this._configuration=new m,this.layout=this.createLayout()}dispose(){}getConfiguration(e,t){return this._configuration.output=e,this._configuration.draped=t.slot===c.DRAPED_MATERIAL,this._configuration.hasCap=this.parameters.cap!==E.BUTT,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.vvOpacity=this.parameters.vvOpacityEnabled,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.occluder=this.parameters.renderOccluded===u.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(){}createLayout(){const e=s().vec3f(h.POSITION).vec2f(h.UV0).vec3f(h.AUXPOS1);return this.parameters.vvSizeEnabled?e.f32(h.SIZEFEATUREATTRIBUTE):e.f32(h.SIZE),this.parameters.vvColorEnabled?e.f32(h.COLORFEATUREATTRIBUTE):e.vec4f(h.COLOR),this.parameters.vvOpacityEnabled&&e.f32(h.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new v(this.layout,this.parameters)}requiresSlot(e,t){if(t===i.Color||t===i.Alpha||t===i.Highlight||t===i.Depth){if(e===c.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===u.OccludeAndTransparentStencil)return e===c.OPAQUE_MATERIAL||e===c.OCCLUDER_MATERIAL||e===c.TRANSPARENT_OCCLUDER_MATERIAL;if(t===i.Color||t===i.Alpha){return e===(this.parameters.writeDepth?c.TRANSPARENT_MATERIAL:c.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===c.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new T(e)}}class T extends n{_updateParameters(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(d,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==i.Color&&this._output!==i.Alpha||this._updateOccludeeState(e),this._updateParameters(e)}}class f extends l{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.placement="end",this.cap=E.BUTT,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.hasOccludees=!1}}class v{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(a,s,i,n){const o=s.vertexAttributes.get(h.POSITION).data,u=o.length/3;let c=1,l=0;this._parameters.vvSizeEnabled?l=s.vertexAttributes.get(h.SIZEFEATUREATTRIBUTE).data[0]:s.vertexAttributes.has(h.SIZE)&&(c=s.vertexAttributes.get(h.SIZE).data[0]);let p=[1,1,1,1],d=0;this._parameters.vvColorEnabled?d=s.vertexAttributes.get(h.COLORFEATUREATTRIBUTE).data[0]:s.vertexAttributes.has(h.COLOR)&&(p=s.vertexAttributes.get(h.COLOR).data);let m=0;this._parameters.vvOpacityEnabled&&(m=s.vertexAttributes.get(h.OPACITYFEATUREATTRIBUTE).data[0]);const E=a.transformation,A=new Float32Array(i.buffer);let T=n*(this.vertexBufferLayout.stride/4);const f=(e,t,r,a)=>{if(A[T++]=e[0],A[T++]=e[1],A[T++]=e[2],A[T++]=r[0],A[T++]=r[1],A[T++]=t[0],A[T++]=t[1],A[T++]=t[2],this._parameters.vvSizeEnabled?A[T++]=l:A[T++]=c,this._parameters.vvColorEnabled)A[T++]=d;else{const e=Math.min(4*a,p.length-4);A[T++]=p[e+0],A[T++]=p[e+1],A[T++]=p[e+2],A[T++]=p[e+3]}this._parameters.vvOpacityEnabled&&(A[T++]=m)};let v;!function(e){e[e.ASCENDING=1]="ASCENDING",e[e.DESCENDING=-1]="DESCENDING"}(v||(v={}));const O=(a,s)=>{const i=e(_,o[3*a],o[3*a+1],o[3*a+2]),n=b;let c=a+s;do{e(n,o[3*c],o[3*c+1],o[3*c+2]),c+=s}while(t(i,n)&&c>=0&&c<u);E&&(r(i,i,E),r(n,n,E)),f(i,n,[-1,-1],a),f(i,n,[1,-1],a),f(i,n,[1,1],a),f(i,n,[-1,-1],a),f(i,n,[1,1],a),f(i,n,[-1,1],a)},R=this._parameters.placement;"begin"!==R&&"begin-end"!==R||O(0,v.ASCENDING),"end"!==R&&"begin-end"!==R||O(u-1,v.DESCENDING)}}const _=a(),b=a();export{A as LineMarkerMaterial,f 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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{s as t,n as e,b as r,f as s,i as o,m as
|
|
5
|
+
import{s as t,n as e,b as r,f as s,i as o,m as i}from"../../../../chunks/vec3.js";import{c as n}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{newLayout as c}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as u}from"../core/shaderLibrary/ShaderOutput.js";import f from"../lib/GLMaterial.js";import{Material as l,MaterialParameters as p}from"../lib/Material.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{MeasurementArrowTechniqueConfiguration as d,MeasurementArrowTechnique as g}from"../shaders/MeasurementArrowTechnique.js";class O extends l{constructor(t){super(t,new b),this._configuration=new d}getConfiguration(t,e){return this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this.parameters.stripeEvenColor[3]<1||this.parameters.stripeOddColor[3]<1||this.parameters.outlineColor[3]<1,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration}dispose(){}intersect(){}requiresSlot(t,e){return e===u.Color&&t===h.OPAQUE_MATERIAL}createGLMaterial(t){return new v(t)}createBufferWriter(){return new L}}class v extends f{beginSlot(t){return this.ensureTechnique(g,t)}}class b extends p{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 y=c().vec3f(m.POSITION).vec3f(m.NORMAL).vec2f(m.UV0).f32(m.AUXPOS1),A=n(),T=n(),j=n(),x=n(),I=n();class L{constructor(){this.vertexBufferLayout=y}allocate(t){return this.vertexBufferLayout.createBuffer(t)}elementCount(t){return 2*(t.indices.get(m.POSITION).length/2+1)}write(n,a,c,u){const f=a.vertexAttributes.get(m.POSITION).data,l=a.vertexAttributes.get(m.NORMAL).data,p=f.length/3,h=a&&a.indices&&a.indices.get(m.POSITION);h&&h.length!==2*(p-1)&&console.warn("MeasurementArrowMaterial does not support indices");const d=A,g=T,O=j,v=x,b=I,y=n.transformation,L=n.invTranspTransformation,S=c.position,w=c.normal,C=c.uv0;let M=0;for(let m=0;m<p;++m){const n=3*m;if(t(d,f[n],f[n+1],f[n+2]),m<p-1){const o=3*(m+1);t(g,f[o],f[o+1],f[o+2]),t(b,l[o],l[o+1],l[o+2]),e(b,b),r(O,g,d),e(O,O),s(v,b,O),e(v,v)}const a=o(d,g);y&&L&&(i(d,d,y),i(g,g,y),i(v,v,L));const c=u+2*m,h=c+1;S.setVec(c,d),S.setVec(h,d),w.setVec(c,v),w.setVec(h,v),C.set(c,0,M),C.set(c,1,-1),C.set(h,0,M),C.set(h,1,1),m<p-1&&(M+=a)}const P=c.auxpos1;for(let t=0;t<2*p;++t)P.set(u+t,M)}}export{O as MeasurementArrowMaterial,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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Logger.js";import{isSome as t,isNone as r}from"../../../../core/maybe.js";import{createRenderScreenPointArray3 as s}from"../../../../core/screenUtils.js";import{c as i}from"../../../../chunks/vec2.js";import{s as o,b as n,e as a,g as
|
|
5
|
+
import e from"../../../../core/Logger.js";import{isSome as t,isNone as r}from"../../../../core/maybe.js";import{createRenderScreenPointArray3 as s}from"../../../../core/screenUtils.js";import{c as i}from"../../../../chunks/vec2.js";import{s as o,b as n,e as a,g as c,a as l,c as u,l as p,i as f,m}from"../../../../chunks/vec3.js";import{c as h}from"../../../../chunks/vec3f64.js";import{O as d}from"../../../../chunks/vec4f64.js";import{PlaneIndex as g}from"../../../../geometry/support/frustum.js";import{create as _,distance2 as A,fromPoints as O,closestLineSegmentPoint as T}from"../../../../geometry/support/lineSegment.js";import{create as S,fromPoints as P,signedDistance as j,normal as y}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as b,BufferViewVec2f as x}from"../../../../geometry/support/buffer/BufferView.js";import{ShaderOutput as v}from"../core/shaderLibrary/ShaderOutput.js";import{computeAttachmentOriginLines as R}from"../lib/geometryDataUtils.js";import N from"../lib/GLMaterial.js";import{Material as E,MaterialParameters as I}from"../lib/Material.js";import{RenderSlot as L}from"../lib/RenderSlot.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{VertexAttribute as C}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as U}from"./internal/bufferWriterUtils.js";import{PositionColorLayout as B,PositionLayout as V,DefaultBufferWriter as M}from"./internal/DefaultBufferWriter.js";import{intersectDrapedRenderLineGeometry as D}from"./internal/MaterialUtil.js";import{isInstanceHidden as k}from"./renderers/utils.js";import{NativeLineTechnique as q}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as G}from"../shaders/NativeLineTechniqueConfiguration.js";var X;!function(e){e[e.START=0]="START",e[e.END=1]="END"}(X||(X={}));class F extends E{constructor(e){super(e,new Q),this._configuration=new G}getConfiguration(e,r){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.draped=r.slot===L.DRAPED_MATERIAL;const s=t(this.parameters.stipplePattern);return this._configuration.stippleEnabled=s,this._configuration.stippleOffColorEnabled=s&&t(this.parameters.stippleOffColor),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.stipplePreferContinuous=this.parameters.stipplePreferContinuous,this._configuration}intersect(e,r,s,i,o,n,a,c,l){t(l)?D(e,i,l,n,1,a):this._intersectLineGeometry(e,r,s,i,a)}_intersectLineGeometry(t,r,s,m,h){if(!m.options.selectionMode||k(r))return;if(!w(s))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const d=t.vertexAttributes.get(C.POSITION).data,_=m.camera,S=ie;i(S,m.point);const b=2;o(oe[0],S[0]-b,S[1]+b,0),o(oe[1],S[0]+b,S[1]+b,0),o(oe[2],S[0]+b,S[1]-b,0),o(oe[3],S[0]-b,S[1]-b,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(oe[e],ne[e]))return;P(_.eye,ne[0],ne[1],ae),P(_.eye,ne[1],ne[2],ce),P(_.eye,ne[2],ne[3],le),P(_.eye,ne[3],ne[0],ue);let x=Number.MAX_VALUE,v=0;for(let e=0;e<d.length-5;e+=3){if(z[0]=d[e]+s[12],z[1]=d[e+1]+s[13],z[2]=d[e+2]+s[14],J[0]=d[e+3]+s[12],J[1]=d[e+4]+s[13],J[2]=d[e+5]+s[14],j(ae,z)<0&&j(ae,J)<0||j(ce,z)<0&&j(ce,J)<0||j(le,z)<0&&j(le,J)<0||j(ue,z)<0&&j(ue,J)<0)continue;if(_.projectToRenderScreen(z,Z),_.projectToRenderScreen(J,$),Z[2]<0&&$[2]>0){n(K,z,J);const e=_.frustum,t=-j(e[g.NEAR],z)/a(K,y(e[g.NEAR]));c(K,K,t),l(z,z,K),_.projectToRenderScreen(z,Z)}else if(Z[2]>0&&$[2]<0){n(K,J,z);const e=_.frustum,t=-j(e[g.NEAR],J)/a(K,y(e[g.NEAR]));c(K,K,t),l(J,J,K),_.projectToRenderScreen(J,$)}else if(Z[2]<0&&$[2]<0)continue;Z[2]=0,$[2]=0;const t=A(O(Z,$,re),S);t<x&&(x=t,u(ee,z),u(te,J),v=e/3)}const R=m.rayBegin,N=m.rayEnd;if(x<b*b){let e=Number.MAX_VALUE;if(T(O(ee,te,re),O(R,N,se),Y)){n(Y,Y,R);const t=p(Y);c(Y,Y,1/t),e=t/f(R,N)}h(e,Y,v,!1)}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const s=r.get(C.POSITION);return R(s,null,!1,t)}requiresSlot(e,t){return!(t!==v.Color&&t!==v.Highlight||e!==L.OPAQUE_MATERIAL&&e!==L.DRAPED_MATERIAL)}createGLMaterial(e){return new W(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?B:V;return r(this.parameters.stipplePattern)?new M(e):new H(e.clone().vec3f(C.AUXPOS1).vec2f(C.UV0))}}class W extends N{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===v.Color&&this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters(this._stippleTextureRepository.swap(this._stipplePattern,t)),this._stipplePattern=t),this.ensureTechnique(q,e)}}class H{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(C.POSITION).length}write(e,t,r,s){U(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,s),this._writeAuxpos1(e,t,r,s),this._writeUV0(e,t,r,s)}_writeAuxpos1(e,t,r,s){const i=r.getField(C.AUXPOS1,b),o=t.indices.get(C.POSITION),n=t.vertexAttributes.get(C.POSITION).data,a=e.transformation,c=i.typedBufferStride,l=i.typedBuffer;s*=c;for(let u=0;u<o.length-1;u+=2)for(const e of[1,0]){const t=3*o[u+e],r=n[t],i=n[t+1],p=n[t+2],f=a[0]*r+a[4]*i+a[8]*p+a[12],m=a[1]*r+a[5]*i+a[9]*p+a[13],h=a[2]*r+a[6]*i+a[10]*p+a[14];l[s]=f,l[s+1]=m,l[s+2]=h,s+=c}}_writeUV0(e,t,r,s){const i=r.getField(C.UV0,x),n=t.indices.get(C.POSITION),a=t.vertexAttributes.get(C.POSITION).data,c=t.vertexAttributes.get(C.DISTANCETOSTART)?.data,l=e.transformation,p=i.typedBufferStride,h=i.typedBuffer;let d=0;h[s*=p]=X.START,h[s+1]=d,s+=p;const g=3*n[0],_=o(z,a[g],a[g+1],a[g+2]);l&&m(_,_,l);const A=J,O=n.length-1;let T=1;const S=c?(e,t,r)=>d=c[r]:(e,t,r)=>d+=f(e,t);for(let f=1;f<O;f+=2){const e=3*n[f];o(A,a[e],a[e+1],a[e+2]),l&&m(A,A,l),S(_,A,T++);for(let t=0;t<2;++t)h[s]=1-t,h[s+1]=d,s+=p;u(_,A)}const P=3*n[O];o(A,a[P],a[P+1],a[P+2]),l&&m(A,A,l),S(_,A,T),h[s]=X.END,h[s+1]=d}}class Q extends I{constructor(){super(...arguments),this.color=d,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1,this.stipplePreferContinuous=!0,this.hasOccludees=!1,this.stippleTexture=null}}const z=h(),J=h(),K=h(),Y=h(),Z=s(),$=s(),ee=h(),te=h(),re=_(),se=_(),ie=h(),oe=[s(),s(),s(),s()],ne=[h(),h(),h(),h()],ae=S(),ce=S(),le=S(),ue=S();export{F 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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as e}from"../../../../core/mathUtils.js";import{isNone as t}from"../../../../core/maybe.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec4f as i}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as
|
|
5
|
+
import{clamp as e}from"../../../../core/mathUtils.js";import{isNone as t}from"../../../../core/maybe.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec4f as i}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutput.js";import{NormalsDoubleSidedMode as o}from"../core/shaderLibrary/shading/Normals.glsl.js";import{computeAttachmentOriginLines as n}from"../lib/geometryDataUtils.js";import h from"../lib/GLMaterial.js";import{Material as u}from"../lib/Material.js";import{isPathGeometry as c}from"../lib/PathGeometry.js";import{RenderSlot as l}from"../lib/RenderSlot.js";import{assert as d}from"../lib/Util.js";import{VertexAttribute as p}from"../lib/VertexAttribute.js";import{vertexAttributeLocations as m,PathTechniqueConfiguration as f,PathTechnique as b,PathPassParameters as v}from"./PathTechnique.js";import{writeDefaultAttributes as S,writeBufferVec4 as g}from"./internal/bufferWriterUtils.js";import{intersectAabbInvDir as E}from"./internal/MaterialUtil.js";class A extends u{constructor(e){super(e,new _),this.supportsEdges=!0,this._vertexAttributeLocations=m,this._configuration=new f,this.vertexBufferLayout=A.getVertexBufferLayout(this.parameters)}getConfiguration(e,t){return this._configuration.output=e,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.vvOpacity=this.parameters.vvOpacityEnabled,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.hasOccludees=this.parameters.hasOccludees,e!==s.Color&&e!==s.Alpha||(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?o.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?o.WindingOrder:o.None,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.ready&&this.parameters.receiveSSAO),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}isVisibleForOutput(e){return e!==s.Shadow&&e!==s.ShadowExludeHighlight&&e!==s.ShadowHighlight||this.parameters.castShadows}isVisible(){return super.isVisible()&&this.parameters.opacity>0}intersect(i,a,s,o,n,h,u){const l=i;if(!c(l))return;const d=l.path,p=[this.parameters.size[0],this.parameters.size[1]];if(this.parameters.vvSizeEnabled){const t=this.parameters.vvSizeOffset,r=this.parameters.vvSizeFactor,i=this.parameters.vvSizeMinSize,a=this.parameters.vvSizeMaxSize,s=d.sizeAttributeValue;p[0]*=e(t[0]+s*r[0],i[0],a[0]),p[1]*=e(t[2]+s*r[2],i[2],a[2])}const m=Math.max(p[0],p[1]),f=i.boundingInfo;if(t(f))return void this._intersectTriangles(d,p,n,h,u);const b=r(f.bbMin[0]-m,f.bbMin[1]-m,f.bbMin[2]-m,f.bbMax[0]+m,f.bbMax[1]+m,f.bbMax[2]+m),v=[h[0]-n[0],h[1]-n[1],h[2]-n[2]],S=Math.sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]),g=[S/v[0],S/v[1],S/v[2]];E(b,n,g,o.tolerance)&&this._intersectTriangles(d,p,n,h,u)}_intersectTriangles(e,t,r,i,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,a)}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return null;const i=r.get(p.POSITION);return n(i,null,!1,t)}createBufferWriter(){return new w(this.vertexBufferLayout)}requiresSlot(e,t){switch(t){case s.Shadow:case s.ShadowHighlight:case s.ShadowExludeHighlight:if(!this.parameters.castShadows)return!1;case s.Color:case s.Alpha:case s.Depth:case s.Normal:case s.Highlight:return e===(this.parameters.transparent?l.TRANSPARENT_MATERIAL:l.OPAQUE_MATERIAL)||e===l.DRAPED_MATERIAL;default:return!1}}createGLMaterial(e){return new O(e)}static getVertexBufferLayout(e){let t=a().vec3f(p.POSITION).vec4f(p.PROFILERIGHT).vec4f(p.PROFILEUP).vec4f(p.PROFILEVERTEXANDNORMAL);return(e.vvColorEnabled||e.vvSizeEnabled||e.vvOpacityEnabled)&&(t=t.vec4f(p.FEATUREVALUE)),t}}class O extends h{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}_updateShadowState(e){(t(this.technique)||e.shadowMap.enabled!==this.technique.configuration.receiveShadows)&&this._material.setParameters({receiveShadows:e.shadowMap.enabled})}beginSlot(e){return this._output!==s.Color&&this._output!==s.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this.ensureTechnique(b,e)}}class _ extends v{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.receiveSSAO=!0,this.receiveShadows=!1,this.castShadows=!0,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1}}class w{constructor(e){this.vertexBufferLayout=e}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(p.POSITION).length}write(e,t,r,a){const s=e=>{if(t.vertexAttributes.has(e)){const s=t.vertexAttributes.get(e),o=t.indices.get(e);d(4===s.size);const n=r.getField(e,i);if(!n)throw new Error("unable to acquire view for "+e);g(o,s.data,n,a)}};s(p.PROFILERIGHT),s(p.PROFILEUP),s(p.PROFILEVERTEXANDNORMAL),this.vertexBufferLayout.hasField(p.FEATUREVALUE)&&s(p.FEATUREVALUE),S(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,a)}}export{A as PathMaterial,_ as PathMaterialParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{f as o}from"../../../../chunks/vec3f64.js";import{ViewingMode as t}from"../../../ViewingMode.js";import{ShaderOutput as
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{f as o}from"../../../../chunks/vec3f64.js";import{ViewingMode as t}from"../../../ViewingMode.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as i}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as s}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as a}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{doublePrecisionRequiresObfuscation as n}from"../core/shaderLibrary/util/DoublePrecision.glsl.js";import{ReloadableShaderModule as l}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as p}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as c}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{blendingDefault as u,oitBlending as d,oitDepthTest as h,OITPolygonOffset as m}from"../lib/OrderIndependentTransparency.js";import{Program as v}from"../lib/Program.js";import{stencilWriteMaskOn as y,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{TransparencyPassType as b}from"../lib/TransparencyPassType.js";import{VertexAttribute as g}from"../lib/VertexAttribute.js";import{DefaultTechniqueConfiguration as P}from"./DefaultTechniqueConfiguration.js";import{P as O}from"../../../../chunks/Path.glsl.js";import{makePipelineState as T,frontFaceCullingParams as j,defaultDepthWriteParams as S,defaultColorWriteParams as N}from"../../../webgl/renderState.js";const R=new Map([[g.POSITION,0],[g.PROFILERIGHT,1],[g.PROFILEUP,2],[g.PROFILEVERTEXANDNORMAL,3],[g.FEATUREVALUE,4]]);class C extends i{constructor(){super(...arguments),this.ambient=o(.2,.2,.2),this.diffuse=o(.8,.8,.8),this.specular=o(0,0,0),this.opacity=1}}class E extends p{initializeConfiguration(e,o){o.spherical=e.viewingMode===t.Global,o.doublePrecisionRequiresObfuscation=n(e.rctx)}initializeProgram(e){return new v(e.rctx,E.shader.get().build(this.configuration),R)}initializePipeline(){const e=this.configuration.transparencyPassType,o=this.configuration,t=e===b.NONE,i=e===b.FrontFace;return T({blending:o.output!==r.Color&&o.output!==r.Alpha||!o.transparent?null:t?u:d(e),culling:o.hasSlicePlane&&!o.transparent&&!(o.doubleSidedMode===s.None)&&j,depthTest:{func:h(e)},depthWrite:t||i?S:null,colorWrite:N,stencilWrite:o.hasOccludees?y:null,stencilTest:o.hasOccludees?f:null,polygonOffset:t||i?null:m})}}E.shader=new l(O,(()=>import("../shaders/Path.glsl.js")));class L extends P{constructor(){super(...arguments),this.output=r.Color,this.doubleSidedMode=s.None,this.transparencyPassType=b.NONE,this.spherical=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.doublePrecisionRequiresObfuscation=!1}}e([c({count:r.COUNT})],L.prototype,"output",void 0),e([c({count:s.COUNT})],L.prototype,"doubleSidedMode",void 0),e([c({count:b.COUNT})],L.prototype,"transparencyPassType",void 0),e([c()],L.prototype,"spherical",void 0),e([c()],L.prototype,"receiveShadows",void 0),e([c()],L.prototype,"receiveAmbientOcclusion",void 0),e([c()],L.prototype,"vvSize",void 0),e([c()],L.prototype,"vvColor",void 0),e([c()],L.prototype,"vvOpacity",void 0),e([c()],L.prototype,"hasSlicePlane",void 0),e([c()],L.prototype,"transparent",void 0),e([c()],L.prototype,"hasOccludees",void 0),e([c()],L.prototype,"hasMultipassTerrain",void 0),e([c()],L.prototype,"cullAboveGround",void 0),e([c()],L.prototype,"doublePrecisionRequiresObfuscation",void 0),e([c({constValue:a.Disabled})],L.prototype,"pbrMode",void 0),e([c({constValue:!0})],L.prototype,"hasVvInstancing",void 0),e([c({constValue:!1})],L.prototype,"useCustomDTRExponentForWater",void 0),e([c({constValue:!1})],L.prototype,"useFillLights",void 0);export{C as PathPassParameters,E as PathTechnique,L as PathTechniqueConfiguration,R 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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{f as t}from"../../../../chunks/vec4f64.js";import{BufferViewMat3f as e,BufferViewVec4f as r,BufferViewVec4u8 as i,BufferViewVec3f as s}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as o}from"../core/shaderLibrary/
|
|
5
|
+
import{f as t}from"../../../../chunks/vec4f64.js";import{BufferViewMat3f as e,BufferViewVec4f as r,BufferViewVec4u8 as i,BufferViewVec3f as s}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as n}from"../lib/basicInterfaces.js";import c from"../lib/GLMaterial.js";import{Material as h,MaterialParameters as l}from"../lib/Material.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{assert as f}from"../lib/Util.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{Style as d}from"./PatternStyle.js";import{writeBufferVec4 as g,writeColor as _,writePosition as A}from"./internal/bufferWriterUtils.js";import{DefaultBufferWriter as b}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as O}from"./internal/MaterialUtil.js";import{vertexAttributeLocations as T,PatternTechniqueConfiguration as P,PatternTechnique as S}from"../shaders/PatternTechnique.js";class y extends h{constructor(t){super(t,new j),this.supportsEdges=!0,this._vertexAttributeLocations=T,this._configuration=new P}getConfiguration(t,e){return this._configuration.output=t,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.style=this.parameters.style,this._configuration.patternSpacing=this.parameters.patternSpacing,this._configuration.lineWidth=this.parameters.lineWidth,this._configuration.draped=this.parameters.draped,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration.enableOffset=e.camera.relativeElevation<u,this._configuration.hasMultipassTerrain=e.multipassTerrain.enabled,this._configuration.cullAboveGround=e.multipassTerrain.cullAboveGround,this._configuration}intersect(t,e,r,i,s,a,o){O(t,e,i,s,a,void 0,o)}requiresSlot(t,e){if(e===o.Color||e===o.Alpha||e===o.Highlight||e===o.Depth&&this.parameters.writeLinearDepth){if(t===p.DRAPED_MATERIAL)return!0;if(e===o.Highlight)return t===p.OPAQUE_MATERIAL;return t===(this.parameters.writeDepth?p.TRANSPARENT_MATERIAL:p.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return!1}createGLMaterial(t){return new E(t)}createBufferWriter(){const t=a().vec3f(m.POSITION).vec4u8(m.COLOR).vec4f(m.UVMAPSPACE);return this.parameters.draped||t.mat3f(m.BOUNDINGRECT),new R(t)}}class E extends c{_updateParameters(t){return this.ensureTechnique(S,t)}_updateOccludeeState(t){t.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:t.hasOccludees})}beginSlot(t){return this._output!==o.Color&&this._output!==o.Alpha||this._updateOccludeeState(t),this._updateParameters(t)}}class R extends b{write(t,a,o,n){for(const c of this.vertexBufferLayout.fieldNames){const h=a.vertexAttributes.get(c),l=a.indices.get(c);if(h&&l)switch(c){case m.POSITION:{f(3===h.size);const e=o.getField(c,s);e&&A(l,h.data,t.transformation,e,n);break}case m.COLOR:{f(3===h.size||4===h.size);const t=o.getField(c,i);t&&_(l,h.data,h.size,t,n);break}case m.UVMAPSPACE:{f(4===h.size);const t=o.getField(c,r);t&&g(l,h.data,t,n);break}case m.BOUNDINGRECT:{f(9===h.size);const r=o.getField(c,e);r&&this.writeBoundingRect(l,h.data,t.transformation,r,n);break}}}}writeBoundingRect(t,e,r,i,s){const a=r,o=i.typedBuffer,n=i.typedBufferStride,c=t.length;s*=n;for(let h=0;h<c;++h){const r=9*t[h],i=e[r],c=e[r+1],l=e[r+2];o[s]=a[0]*i+a[4]*c+a[8]*l+a[12],o[s+1]=a[1]*i+a[5]*c+a[9]*l+a[13],o[s+2]=a[2]*i+a[6]*c+a[10]*l+a[14];for(let t=3;t<9;++t)o[s+t]=e[r+t];s+=n}}}class j extends l{constructor(){super(...arguments),this.color=t(1,1,1,1),this.writeDepth=!0,this.writeLinearDepth=!1,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=n.None,this.hasOccludees=!1,this.style=d.Cross,this.patternSpacing=10,this.lineWidth=1,this.draped=!0}}export{j as Parameters,y as PatternMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../core/Logger.js";import{clamp as e}from"../../../../core/mathUtils.js";import{isSome as r}from"../../../../core/maybe.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{c as s}from"../../../../chunks/vec2.js";import{s as a,b as n,e as o,g as l,a as c,c as h,l as u,i as p,m}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{O as T}from"../../../../chunks/vec4f64.js";import{PlaneIndex as _}from"../../../../geometry/support/frustum.js";import{create as d,distance2 as E,fromPoints as A,closestLineSegmentPoint as v}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as S,signedDistance as O,normal as I}from"../../../../geometry/support/plane.js";import{newLayout as g}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as b}from"../core/shaderLibrary/ShaderOutputOptions.js";import{computeAttachmentOriginLines as L}from"../lib/geometryDataUtils.js";import P from"../lib/GLMaterial.js";import{outputFromPass as N}from"../lib/GLMaterials.js";import{Material as C,RenderOccludedFlag as y}from"../lib/Material.js";import{RenderSlot as D}from"../lib/RenderSlot.js";import{isTranslationMatrix as j}from"../lib/Util.js";import{VertexAttribute as U}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{isInstanceHidden as F}from"./renderers/utils.js";import{N as M}from"../../../../chunks/RibbonLine.glsl.js";import{ribbonVertexAttributeLocations as w,RibbonLineTechnique as G}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as J,CapType as z}from"../shaders/RibbonLineTechniqueConfiguration.js";var B;!function(t){t[t.LEFT_JOIN_START=-2]="LEFT_JOIN_START",t[t.LEFT_JOIN_END=-1]="LEFT_JOIN_END",t[t.LEFT_CAP_START=-4]="LEFT_CAP_START",t[t.LEFT_CAP_END=-5]="LEFT_CAP_END",t[t.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",t[t.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",t[t.RIGHT_CAP_START=4]="RIGHT_CAP_START",t[t.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(B||(B={}));class H extends C{constructor(t){super(t,new V),this._configuration=new J,this._vertexAttributeLocations=w,this._layout=this.createLayout()}isClosed(t,e){return q(this.parameters,t,e)}getConfiguration(t,e){this._configuration.output=t,this._configuration.draped=e.slot===D.DRAPED_MATERIAL;const i=r(this.parameters.stipplePattern)&&t!==b.Highlight;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&r(this.parameters.stippleOffColor),this._configuration.stippleScaleWithLineWidth=i&&this.parameters.stippleScaleWithLineWidth,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.vvOpacity=this.parameters.vvOpacityEnabled,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&r(this.parameters.innerColor),this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===y.OccludeAndTransparentStencil,this._configuration.transparencyPassType=e.transparencyPassType,this._configuration.hasMultipassTerrain=e.multipassTerrain.enabled,this._configuration.cullAboveGround=e.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersect(t,e,i,s,a,n,o,l,c){r(c)?this._intersectDrapedLineGeometry(t,s,c,n,o):this._intersectLineGeometry(t,e,i,s,o)}_intersectDrapedLineGeometry(t,r,i,s,a){if(!r.options.selectionMode)return;const n=t.vertexAttributes.get(U.POSITION).data,o=t.vertexAttributes.get(U.SIZE);let l=this.parameters.width;if(this.parameters.vvSizeEnabled){const r=t.vertexAttributes.get(U.SIZEFEATUREATTRIBUTE).data[0];l*=e(this.parameters.vvSizeOffset[0]+r*this.parameters.vvSizeFactor[0],this.parameters.vvSizeMinSize[0],this.parameters.vvSizeMaxSize[0])}else o&&(l*=o.data[0]);const c=s[0],h=s[1],u=(l/2+4)*t.screenToWorldRatio;let p=Number.MAX_VALUE,m=0;for(let f=0;f<n.length-5;f+=3){const t=n[f],r=n[f+1],i=c-t,s=h-r,a=n[f+3]-t,o=n[f+4]-r,l=e((a*i+o*s)/(a*a+o*o),0,1),u=a*l-i,T=o*l-s,_=u*u+T*T;_<p&&(p=_,m=f/3)}p<u*u&&a(i.dist,i.normal,m,!1)}_intersectLineGeometry(r,i,m,f,T){if(!f.options.selectionMode||F(i))return;if(!j(m))return void t.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const d=r.vertexAttributes,R=d.get(U.POSITION).data;let g=this.parameters.width;if(this.parameters.vvSizeEnabled){const t=d.get(U.SIZEFEATUREATTRIBUTE).data[0];g*=e(this.parameters.vvSizeOffset[0]+t*this.parameters.vvSizeFactor[0],this.parameters.vvSizeMinSize[0],this.parameters.vvSizeMaxSize[0])}else d.has(U.SIZE)&&(g*=d.get(U.SIZE).data[0]);const b=f.camera,L=tt;s(L,f.point);const P=g*b.pixelRatio/2+4*b.pixelRatio;a(ht[0],L[0]-P,L[1]+P,0),a(ht[1],L[0]+P,L[1]+P,0),a(ht[2],L[0]+P,L[1]-P,0),a(ht[3],L[0]-P,L[1]-P,0);for(let t=0;t<4;t++)if(!b.unprojectFromRenderScreen(ht[t],ut[t]))return;S(b.eye,ut[0],ut[1],pt),S(b.eye,ut[1],ut[2],mt),S(b.eye,ut[2],ut[3],ft),S(b.eye,ut[3],ut[0],Tt);let N=Number.MAX_VALUE,C=0;const y=X(this.parameters,d,r.indices)?R.length-2:R.length-5;for(let t=0;t<y;t+=3){Y[0]=R[t]+m[12],Y[1]=R[t+1]+m[13],Y[2]=R[t+2]+m[14];const e=(t+3)%R.length;if(Q[0]=R[e]+m[12],Q[1]=R[e+1]+m[13],Q[2]=R[e+2]+m[14],O(pt,Y)<0&&O(pt,Q)<0||O(mt,Y)<0&&O(mt,Q)<0||O(ft,Y)<0&&O(ft,Q)<0||O(Tt,Y)<0&&O(Tt,Q)<0)continue;if(b.projectToRenderScreen(Y,et),b.projectToRenderScreen(Q,rt),et[2]<0&&rt[2]>0){n(K,Y,Q);const t=b.frustum,e=-O(t[_.NEAR],Y)/o(K,I(t[_.NEAR]));l(K,K,e),c(Y,Y,K),b.projectToRenderScreen(Y,et)}else if(et[2]>0&&rt[2]<0){n(K,Q,Y);const t=b.frustum,e=-O(t[_.NEAR],Q)/o(K,I(t[_.NEAR]));l(K,K,e),c(Q,Q,K),b.projectToRenderScreen(Q,rt)}else if(et[2]<0&&rt[2]<0)continue;et[2]=0,rt[2]=0;const r=E(A(et,rt,at),L);r<N&&(N=r,h(it,Y),h(st,Q),C=t/3)}const D=f.rayBegin,x=f.rayEnd;if(N<P*P){let t=Number.MAX_VALUE;if(v(A(it,st,at),A(D,x,nt),$)){n($,$,D);const e=u($);l($,$,1/e),t=e/p(D,x)}T(t,$,C,!1)}}computeAttachmentOrigin(t,e){const r=t.vertexAttributes;if(!r)return!1;const i=t.indices,s=r.get(U.POSITION);return L(s,i?i.get(U.POSITION):null,i&&X(this.parameters,r,i),e)}createLayout(){const t=g().vec3f(U.POSITION).f32(U.SUBDIVISIONFACTOR).vec2f(U.UV0).vec3f(U.AUXPOS1).vec3f(U.AUXPOS2);return this.parameters.vvSizeEnabled?t.f32(U.SIZEFEATUREATTRIBUTE):t.f32(U.SIZE),this.parameters.vvColorEnabled?t.f32(U.COLORFEATUREATTRIBUTE):t.vec4f(U.COLOR),this.parameters.vvOpacityEnabled&&t.f32(U.OPACITYFEATUREATTRIBUTE),t}createBufferWriter(){return new Z(this._layout,this.parameters)}requiresSlot(t,e){if(t===D.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===y.OccludeAndTransparentStencil)return t===D.OPAQUE_MATERIAL||t===D.OCCLUDER_MATERIAL||t===D.TRANSPARENT_OCCLUDER_MATERIAL;const r=N(e);if(r===b.Color||r===b.Alpha){return t===(this.parameters.writeDepth?D.TRANSPARENT_MATERIAL:D.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return t===D.OPAQUE_MATERIAL}createGLMaterial(t){return t.output===b.Color||t.output===b.Alpha||t.output===b.Highlight||t.output===b.Depth?new W(t):null}validateParameters(t){"miter"!==t.join&&(t.miterLimit=0)}}class W extends P{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(t){t.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:t.hasOccludees})}beginSlot(t){this._output!==b.Color&&this._output!==b.Alpha||this._updateOccludeeState(t);const e=this._material.parameters.stipplePattern;return this._stipplePattern!==e&&(this._material.setParameters(this._stippleTextureRepository.swap(this._stipplePattern,e)),this._stipplePattern=e),this.ensureTechnique(G,t)}}class V extends x{constructor(){super(...arguments),this.width=0,this.color=T,this.join="miter",this.cap=z.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stippleScaleWithLineWidth=!1,this.stipplePreferContinuous=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.hasOccludees=!1,this.wireframe=!1}}class Z{constructor(t,e){this._parameters=e,this.numJoinSubdivisions=0,this.vertexBufferLayout=t;const r=e.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=M+r}}_isClosed(t){return X(this._parameters,t.vertexAttributes,t.indices)}allocate(t){return this.vertexBufferLayout.createBuffer(t)}elementCount(t){const e=2,r=t.indices.get(U.POSITION).length/2+1,i=this._isClosed(t);let s=i?2:2*e;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(t,e,r,i){const s=ot,n=lt,o=ct,l=e.vertexAttributes.get(U.POSITION).data,c=e.indices&&e.indices.get(U.POSITION),u=e.vertexAttributes.get(U.DISTANCETOSTART)?.data;c&&c.length!==2*(l.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let f=1,T=0;this._parameters.vvSizeEnabled?T=e.vertexAttributes.get(U.SIZEFEATUREATTRIBUTE).data[0]:e.vertexAttributes.has(U.SIZE)&&(f=e.vertexAttributes.get(U.SIZE).data[0]);let _=[1,1,1,1],d=0;this._parameters.vvColorEnabled?d=e.vertexAttributes.get(U.COLORFEATUREATTRIBUTE).data[0]:e.vertexAttributes.has(U.COLOR)&&(_=e.vertexAttributes.get(U.COLOR).data);let E=0;this._parameters.vvOpacityEnabled&&(E=e.vertexAttributes.get(U.OPACITYFEATUREATTRIBUTE).data[0]);const A=l.length/3,v=t.transformation,R=new Float32Array(r.buffer),S=this.vertexBufferLayout.stride/4;let O=i*S;const I=O;let g=0;const b=u?(t,e,r)=>g=u[r]:(t,e,r)=>g+=p(t,e),L=(t,e,r,i,s,a,n)=>{if(R[O++]=e[0],R[O++]=e[1],R[O++]=e[2],R[O++]=i,R[O++]=n,R[O++]=s,R[O++]=t[0],R[O++]=t[1],R[O++]=t[2],R[O++]=r[0],R[O++]=r[1],R[O++]=r[2],this._parameters.vvSizeEnabled?R[O++]=T:R[O++]=f,this._parameters.vvColorEnabled)R[O++]=d;else{const t=Math.min(4*a,_.length-4);R[O++]=_[t+0],R[O++]=_[t+1],R[O++]=_[t+2],R[O++]=_[t+3]}this._parameters.vvOpacityEnabled&&(R[O++]=E)};O+=S,a(n,l[0],l[1],l[2]),v&&m(n,n,v);const P=this._isClosed(e);if(P){const t=l.length-3;a(s,l[t],l[t+1],l[t+2]),v&&m(s,s,v)}else a(o,l[3],l[4],l[5]),v&&m(o,o,v),L(n,n,o,1,B.LEFT_CAP_START,0,0),L(n,n,o,1,B.RIGHT_CAP_START,0,0),h(s,n),h(n,o);const N=P?0:1,C=P?A:A-1;for(let p=N;p<C;p++){const t=(p+1)%A*3;a(o,l[t+0],l[t+1],l[t+2]),v&&m(o,o,v),b(s,n,p),L(s,n,o,0,B.LEFT_JOIN_END,p,g),L(s,n,o,0,B.RIGHT_JOIN_END,p,g);const e=this.numJoinSubdivisions;for(let r=0;r<e;++r){const t=(r+1)/(e+1);L(s,n,o,t,B.LEFT_JOIN_END,p,g),L(s,n,o,t,B.RIGHT_JOIN_END,p,g)}L(s,n,o,1,B.LEFT_JOIN_START,p,g),L(s,n,o,1,B.RIGHT_JOIN_START,p,g),h(s,n),h(n,o)}P?(a(o,l[3],l[4],l[5]),v&&m(o,o,v),g=b(s,n,C),L(s,n,o,0,B.LEFT_JOIN_END,N,g),L(s,n,o,0,B.RIGHT_JOIN_END,N,g)):(g=b(s,n,C),L(s,n,n,0,B.LEFT_CAP_END,C,g),L(s,n,n,0,B.RIGHT_CAP_END,C,g)),k(R,I+S,R,I,S);O=k(R,O-S,R,O,S),this._parameters.wireframe&&this._addWireframeVertices(r,I,O,S)}_addWireframeVertices(t,e,r,i){const s=new Float32Array(t.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(t.buffer,e*Float32Array.BYTES_PER_ELEMENT,r-e);let n=0;const o=t=>n=k(a,t,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function k(t,e,r,i,s){for(let a=0;a<s;a++)r[i++]=t[e++];return i}function X(t,e,r){return q(t,e.get(U.POSITION).data,r?r.get(U.POSITION):null)}function q(t,e,r){return!!t.isClosed&&(r?r.length>2:e.length>6)}const Y=f(),Q=f(),K=f(),$=f(),tt=f(),et=i(),rt=i(),it=f(),st=f(),at=d(),nt=d(),ot=f(),lt=f(),ct=f(),ht=[i(),i(),i(),i()],ut=[f(),f(),f(),f()],pt=R(),mt=R(),ft=R(),Tt=R();export{V as Parameters,H as RibbonLineMaterial};
|
|
5
|
+
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{isSome as r}from"../../../../core/maybe.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{c as s}from"../../../../chunks/vec2.js";import{s as a,b as n,e as o,g as l,a as c,c as h,l as p,i as u,m}from"../../../../chunks/vec3.js";import{c as f}from"../../../../chunks/vec3f64.js";import{O as T}from"../../../../chunks/vec4f64.js";import{PlaneIndex as _}from"../../../../geometry/support/frustum.js";import{create as d,distance2 as E,fromPoints as A,closestLineSegmentPoint as v}from"../../../../geometry/support/lineSegment.js";import{create as R,fromPoints as S,signedDistance as I,normal as O}from"../../../../geometry/support/plane.js";import{newLayout as g}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as b}from"../core/shaderLibrary/ShaderOutput.js";import{computeAttachmentOriginLines as P}from"../lib/geometryDataUtils.js";import L from"../lib/GLMaterial.js";import{Material as N,RenderOccludedFlag as C}from"../lib/Material.js";import{RenderSlot as y}from"../lib/RenderSlot.js";import{isTranslationMatrix as D}from"../lib/Util.js";import{VertexAttribute as j}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as U}from"./VisualVariablePassParameters.js";import{isInstanceHidden as x}from"./renderers/utils.js";import{N as F}from"../../../../chunks/RibbonLine.glsl.js";import{vertexAttributeLocations as M,RibbonLineTechnique as w}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as G,CapType as J}from"../shaders/RibbonLineTechniqueConfiguration.js";var z;!function(e){e[e.LEFT_JOIN_START=-2]="LEFT_JOIN_START",e[e.LEFT_JOIN_END=-1]="LEFT_JOIN_END",e[e.LEFT_CAP_START=-4]="LEFT_CAP_START",e[e.LEFT_CAP_END=-5]="LEFT_CAP_END",e[e.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",e[e.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",e[e.RIGHT_CAP_START=4]="RIGHT_CAP_START",e[e.RIGHT_CAP_END=5]="RIGHT_CAP_END"}(z||(z={}));class B extends N{constructor(e){super(e,new W),this._configuration=new G,this._vertexAttributeLocations=M,this._layout=this.createLayout()}isClosed(e,t){return X(this.parameters,e,t)}getConfiguration(e,t){this._configuration.output=e,this._configuration.draped=t.slot===y.DRAPED_MATERIAL;const i=r(this.parameters.stipplePattern)&&e!==b.Highlight;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&r(this.parameters.stippleOffColor),this._configuration.stippleScaleWithLineWidth=i&&this.parameters.stippleScaleWithLineWidth,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.vvOpacity=this.parameters.vvOpacityEnabled,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&r(this.parameters.innerColor),this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===C.OccludeAndTransparentStencil,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersect(e,t,i,s,a,n,o,l,c){r(c)?this._intersectDrapedLineGeometry(e,s,c,n,o):this._intersectLineGeometry(e,t,i,s,o)}_intersectDrapedLineGeometry(e,r,i,s,a){if(!r.options.selectionMode)return;const n=e.vertexAttributes.get(j.POSITION).data,o=e.vertexAttributes.get(j.SIZE);let l=this.parameters.width;if(this.parameters.vvSizeEnabled){const r=e.vertexAttributes.get(j.SIZEFEATUREATTRIBUTE).data[0];l*=t(this.parameters.vvSizeOffset[0]+r*this.parameters.vvSizeFactor[0],this.parameters.vvSizeMinSize[0],this.parameters.vvSizeMaxSize[0])}else o&&(l*=o.data[0]);const c=s[0],h=s[1],p=(l/2+4)*e.screenToWorldRatio;let u=Number.MAX_VALUE,m=0;for(let f=0;f<n.length-5;f+=3){const e=n[f],r=n[f+1],i=c-e,s=h-r,a=n[f+3]-e,o=n[f+4]-r,l=t((a*i+o*s)/(a*a+o*o),0,1),p=a*l-i,T=o*l-s,_=p*p+T*T;_<u&&(u=_,m=f/3)}u<p*p&&a(i.dist,i.normal,m,!1)}_intersectLineGeometry(r,i,m,f,T){if(!f.options.selectionMode||x(i))return;if(!D(m))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const d=r.vertexAttributes,R=d.get(j.POSITION).data;let g=this.parameters.width;if(this.parameters.vvSizeEnabled){const e=d.get(j.SIZEFEATUREATTRIBUTE).data[0];g*=t(this.parameters.vvSizeOffset[0]+e*this.parameters.vvSizeFactor[0],this.parameters.vvSizeMinSize[0],this.parameters.vvSizeMaxSize[0])}else d.has(j.SIZE)&&(g*=d.get(j.SIZE).data[0]);const b=f.camera,P=$;s(P,f.point);const L=g*b.pixelRatio/2+4*b.pixelRatio;a(ce[0],P[0]-L,P[1]+L,0),a(ce[1],P[0]+L,P[1]+L,0),a(ce[2],P[0]+L,P[1]-L,0),a(ce[3],P[0]-L,P[1]-L,0);for(let e=0;e<4;e++)if(!b.unprojectFromRenderScreen(ce[e],he[e]))return;S(b.eye,he[0],he[1],pe),S(b.eye,he[1],he[2],ue),S(b.eye,he[2],he[3],me),S(b.eye,he[3],he[0],fe);let N=Number.MAX_VALUE,C=0;const y=k(this.parameters,d,r.indices)?R.length-2:R.length-5;for(let e=0;e<y;e+=3){q[0]=R[e]+m[12],q[1]=R[e+1]+m[13],q[2]=R[e+2]+m[14];const t=(e+3)%R.length;if(Y[0]=R[t]+m[12],Y[1]=R[t+1]+m[13],Y[2]=R[t+2]+m[14],I(pe,q)<0&&I(pe,Y)<0||I(ue,q)<0&&I(ue,Y)<0||I(me,q)<0&&I(me,Y)<0||I(fe,q)<0&&I(fe,Y)<0)continue;if(b.projectToRenderScreen(q,ee),b.projectToRenderScreen(Y,te),ee[2]<0&&te[2]>0){n(Q,q,Y);const e=b.frustum,t=-I(e[_.NEAR],q)/o(Q,O(e[_.NEAR]));l(Q,Q,t),c(q,q,Q),b.projectToRenderScreen(q,ee)}else if(ee[2]>0&&te[2]<0){n(Q,Y,q);const e=b.frustum,t=-I(e[_.NEAR],Y)/o(Q,O(e[_.NEAR]));l(Q,Q,t),c(Y,Y,Q),b.projectToRenderScreen(Y,te)}else if(ee[2]<0&&te[2]<0)continue;ee[2]=0,te[2]=0;const r=E(A(ee,te,se),P);r<N&&(N=r,h(re,q),h(ie,Y),C=e/3)}const U=f.rayBegin,F=f.rayEnd;if(N<L*L){let e=Number.MAX_VALUE;if(v(A(re,ie,se),A(U,F,ae),K)){n(K,K,U);const t=p(K);l(K,K,1/t),e=t/u(U,F)}T(e,K,C,!1)}}computeAttachmentOrigin(e,t){const r=e.vertexAttributes;if(!r)return!1;const i=e.indices,s=r.get(j.POSITION);return P(s,i?i.get(j.POSITION):null,i&&k(this.parameters,r,i),t)}createLayout(){const e=g().vec3f(j.POSITION).f32(j.SUBDIVISIONFACTOR).vec2f(j.UV0).vec3f(j.AUXPOS1).vec3f(j.AUXPOS2);return this.parameters.vvSizeEnabled?e.f32(j.SIZEFEATUREATTRIBUTE):e.f32(j.SIZE),this.parameters.vvColorEnabled?e.f32(j.COLORFEATUREATTRIBUTE):e.vec4f(j.COLOR),this.parameters.vvOpacityEnabled&&e.f32(j.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new V(this._layout,this.parameters)}requiresSlot(e,t){if(t===b.Color||t===b.Alpha||t===b.Highlight||t===b.Depth){if(e===y.DRAPED_MATERIAL)return!0;if(this.parameters.renderOccluded===C.OccludeAndTransparentStencil)return e===y.OPAQUE_MATERIAL||e===y.OCCLUDER_MATERIAL||e===y.TRANSPARENT_OCCLUDER_MATERIAL;if(t===b.Color||t===b.Alpha){return e===(this.parameters.writeDepth?y.TRANSPARENT_MATERIAL:y.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL)}return e===y.OPAQUE_MATERIAL}return!1}createGLMaterial(e){return new H(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0)}}class H extends L{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextureRepository.release(this._stipplePattern),this._stipplePattern=null}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==b.Color&&this._output!==b.Alpha||this._updateOccludeeState(e);const t=this._material.parameters.stipplePattern;return this._stipplePattern!==t&&(this._material.setParameters(this._stippleTextureRepository.swap(this._stipplePattern,t)),this._stipplePattern=t),this.ensureTechnique(w,e)}}class W extends U{constructor(){super(...arguments),this.width=0,this.color=T,this.join="miter",this.cap=J.BUTT,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stippleScaleWithLineWidth=!1,this.stipplePreferContinuous=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.hasOccludees=!1,this.wireframe=!1}}class V{constructor(e,t){this._parameters=t,this.numJoinSubdivisions=0,this.vertexBufferLayout=e;const r=t.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=r;break;case"round":this.numJoinSubdivisions=F+r}}_isClosed(e){return k(this._parameters,e.vertexAttributes,e.indices)}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){const t=2,r=e.indices.get(j.POSITION).length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i){const s=ne,n=oe,o=le,l=t.vertexAttributes.get(j.POSITION).data,c=t.indices&&t.indices.get(j.POSITION),p=t.vertexAttributes.get(j.DISTANCETOSTART)?.data;c&&c.length!==2*(l.length/3-1)&&console.warn("RibbonLineMaterial does not support indices");let f=1,T=0;this._parameters.vvSizeEnabled?T=t.vertexAttributes.get(j.SIZEFEATUREATTRIBUTE).data[0]:t.vertexAttributes.has(j.SIZE)&&(f=t.vertexAttributes.get(j.SIZE).data[0]);let _=[1,1,1,1],d=0;this._parameters.vvColorEnabled?d=t.vertexAttributes.get(j.COLORFEATUREATTRIBUTE).data[0]:t.vertexAttributes.has(j.COLOR)&&(_=t.vertexAttributes.get(j.COLOR).data);let E=0;this._parameters.vvOpacityEnabled&&(E=t.vertexAttributes.get(j.OPACITYFEATUREATTRIBUTE).data[0]);const A=l.length/3,v=e.transformation,R=new Float32Array(r.buffer),S=this.vertexBufferLayout.stride/4;let I=i*S;const O=I;let g=0;const b=p?(e,t,r)=>g=p[r]:(e,t,r)=>g+=u(e,t),P=(e,t,r,i,s,a,n)=>{if(R[I++]=t[0],R[I++]=t[1],R[I++]=t[2],R[I++]=i,R[I++]=n,R[I++]=s,R[I++]=e[0],R[I++]=e[1],R[I++]=e[2],R[I++]=r[0],R[I++]=r[1],R[I++]=r[2],this._parameters.vvSizeEnabled?R[I++]=T:R[I++]=f,this._parameters.vvColorEnabled)R[I++]=d;else{const e=Math.min(4*a,_.length-4);R[I++]=_[e+0],R[I++]=_[e+1],R[I++]=_[e+2],R[I++]=_[e+3]}this._parameters.vvOpacityEnabled&&(R[I++]=E)};I+=S,a(n,l[0],l[1],l[2]),v&&m(n,n,v);const L=this._isClosed(t);if(L){const e=l.length-3;a(s,l[e],l[e+1],l[e+2]),v&&m(s,s,v)}else a(o,l[3],l[4],l[5]),v&&m(o,o,v),P(n,n,o,1,z.LEFT_CAP_START,0,0),P(n,n,o,1,z.RIGHT_CAP_START,0,0),h(s,n),h(n,o);const N=L?0:1,C=L?A:A-1;for(let u=N;u<C;u++){const e=(u+1)%A*3;a(o,l[e+0],l[e+1],l[e+2]),v&&m(o,o,v),b(s,n,u),P(s,n,o,0,z.LEFT_JOIN_END,u,g),P(s,n,o,0,z.RIGHT_JOIN_END,u,g);const t=this.numJoinSubdivisions;for(let r=0;r<t;++r){const e=(r+1)/(t+1);P(s,n,o,e,z.LEFT_JOIN_END,u,g),P(s,n,o,e,z.RIGHT_JOIN_END,u,g)}P(s,n,o,1,z.LEFT_JOIN_START,u,g),P(s,n,o,1,z.RIGHT_JOIN_START,u,g),h(s,n),h(n,o)}L?(a(o,l[3],l[4],l[5]),v&&m(o,o,v),g=b(s,n,C),P(s,n,o,0,z.LEFT_JOIN_END,N,g),P(s,n,o,0,z.RIGHT_JOIN_END,N,g)):(g=b(s,n,C),P(s,n,n,0,z.LEFT_CAP_END,C,g),P(s,n,n,0,z.RIGHT_CAP_END,C,g)),Z(R,O+S,R,O,S);I=Z(R,I-S,R,I,S),this._parameters.wireframe&&this._addWireframeVertices(r,O,I,S)}_addWireframeVertices(e,t,r,i){const s=new Float32Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,r-t);let n=0;const o=e=>n=Z(a,e,s,n,i);for(let l=0;l<a.length-1;l+=2*i)o(l),o(l+2*i),o(l+1*i),o(l+2*i),o(l+1*i),o(l+3*i)}}function Z(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function k(e,t,r){return X(e,t.get(j.POSITION).data,r?r.get(j.POSITION):null)}function X(e,t,r){return!!e.isClosed&&(r?r.length>2:t.length>6)}const q=f(),Y=f(),Q=f(),K=f(),$=f(),ee=i(),te=i(),re=f(),ie=f(),se=d(),ae=d(),ne=f(),oe=f(),le=f(),ce=[i(),i(),i(),i()],he=[f(),f(),f(),f()],pe=R(),ue=R(),me=R(),fe=R();export{W as Parameters,B as RibbonLineMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{n as e,s as t,g as r,a as i}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{center as n,scale as o}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as u}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as l}from"../core/shaderLibrary/
|
|
5
|
+
import{n as e,s as t,g as r,a as i}from"../../../../chunks/vec3.js";import{c as s}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{center as n,scale as o}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as u}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as l}from"../core/shaderLibrary/ShaderOutput.js";import{CullFaceOptions as h}from"../lib/basicInterfaces.js";import f from"../lib/GLMaterial.js";import{Material as p,MaterialParameters as m}from"../lib/Material.js";import{RenderSlot as d}from"../lib/RenderSlot.js";import{assert as S}from"../lib/Util.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{writeDefaultAttributes as E,writePosition as T}from"./internal/bufferWriterUtils.js";import{intersectTriangleGeometry as g}from"./internal/MaterialUtil.js";import{ShadedColorMaterialTechniqueConfiguration as A,vertexAttributeLocations as v,ShadedColorMaterialTechnique as _}from"../shaders/ShadedColorMaterialTechnique.js";class F extends p{constructor(e){super(e,new j),this.supportsEdges=!0,this._configuration=new A,this._vertexAttributeLocations=v}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,s,a,c,u,l,h){if(this.parameters.screenSizeEnabled){const a=e.vertexAttributes.get(b.OFFSET),f={applyToVertex:(e,s,n,o)=>{const u=t(w,a.data[3*o+0],a.data[3*o+1],a.data[3*o+2]),l=t(z,e,s,n);return r(u,u,this.parameters.screenSizeScale*c.camera.computeRenderPixelSizeAt(u)),i(l,l,u),[l[0],l[1],l[2]]},applyToAabb:e=>{const t=n(e,w);return o(e,this.parameters.screenSizeScale*c.camera.computeRenderPixelSizeAt(t))}};g(e,s,c,u,l,f,h)}else g(e,s,c,u,l,void 0,h)}requiresSlot(e,t){if(t===l.Highlight)return e===d.OPAQUE_MATERIAL;if(t===l.Color||t===l.Alpha){let t=d.OPAQUE_MATERIAL;return this.parameters.transparent&&(t=this.parameters.writeDepth?d.TRANSPARENT_MATERIAL:d.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),e===t||e===d.DRAPED_MATERIAL}return!1}createGLMaterial(e){return new x(e)}createBufferWriter(){return new O(this.parameters.screenSizeEnabled)}}class x extends f{beginSlot(e){return this.ensureTechnique(_,e)}}class j extends m{constructor(){super(...arguments),this.color=a(1,1,1,1),this.shadingTint=a(0,0,0,.25),this.shadingDirection=e(s(),[.5,-.5,-.5]),this.screenSizeScale=14,this.transparent=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=h.None,this.screenSizeEnabled=!1,this.shadingEnabled=!0}}class O{constructor(e){this.screenSizeEnabled=e;const t=u().vec3f(b.POSITION).vec3f(b.NORMAL);this.screenSizeEnabled&&t.vec3f(b.OFFSET),this.vertexBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(b.POSITION).length}write(e,t,r,i){if(E(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,i),this.screenSizeEnabled){if(!t.vertexAttributes.has(b.OFFSET))throw new Error(`${b.OFFSET} vertex attribute required for screenSizeEnabled ShadedColorMaterial`);{const s=t.vertexAttributes.get(b.OFFSET),a=t.indices.get(b.OFFSET);S(3===s.size);const n=r.getField(b.OFFSET,c);if(!n)throw new Error("unable to acquire view for "+b.OFFSET);T(a,s.data,e.invTranspTransformation,n,i)}}}}const w=s(),z=s();export{F as ShadedColorMaterial,j as ShadedColorMaterialParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{unwrap as r}from"../../../../core/maybe.js";import{ShaderOutput as e}from"../core/shaderLibrary/
|
|
5
|
+
import{unwrap as r}from"../../../../core/maybe.js";import{ShaderOutput as e}from"../core/shaderLibrary/ShaderOutput.js";import{ShaderTechniqueConfiguration as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import i from"../lib/GLMaterial.js";import{Material as o,RenderOccludedFlag as n}from"../lib/Material.js";import{RenderSlot as s}from"../lib/RenderSlot.js";import{DefaultBufferWriter as u,PositionUVLayout as a}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as c}from"./internal/MaterialUtil.js";import{SlicePlaneMaterialTechnique as l,SlicePlaneMaterialPassParameters as m}from"../shaders/SlicePlaneMaterialTechnique.js";class f extends o{constructor(r){super(r,new d),this._configuration=new t}intersect(r,e,t,i,o,n,s){return c(r,e,i,o,n,void 0,s)}createBufferWriter(){return new u(a)}requiresSlot(r,t){return t===e.Color&&r===s.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL}createGLMaterial(r){return new h(r)}getConfiguration(){return this._configuration}}class h extends i{constructor(r){super(r),this.ensureTechnique(l,null)}beginSlot(){return r(this.technique)}}class d extends m{constructor(){super(...arguments),this.renderOccluded=n.Occlude}}export{d as Parameters,f as SlicePlaneMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../../../../core/maybe.js";import{ShaderOutput as t}from"../core/shaderLibrary/
|
|
5
|
+
import{isSome as e}from"../../../../core/maybe.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import a from"../lib/GLMaterial.js";import{WaterTechnique as s}from"./WaterTechnique.js";class r extends a{_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.receiveShadows&&this._material.setParameters({receiveShadows:e.shadowMap.enabled})}_updateSSRState(e){e.ssr.enabled!==this._material.parameters.hasScreenSpaceReflections&&this._material.setParameters({hasScreenSpaceReflections:e.ssr.enabled})}_updateCloudsReflectionState(t){const a=e(t.clouds.data);a!==this._material.parameters.hasCloudsReflections&&this._material.setParameters({hasCloudsReflections:a})}ensureResources(e){return this._techniqueRepository.constructionContext.waterTextureRepository.ensureResources(e)}beginSlot(e){return this._output===t.Color&&(this._updateShadowState(e),this._updateSSRState(e),this._updateCloudsReflectionState(e)),this._material.setParameters(this._techniqueRepository.constructionContext.waterTextureRepository.passParameters),this.ensureTechnique(s,e)}}export{r as WaterGLMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{secondsFromMilliseconds as e}from"../../../../core/time.js";import{f as t}from"../../../../chunks/vec2f64.js";import{f as r}from"../../../../chunks/vec4f64.js";import{ShaderOutput as i}from"../core/shaderLibrary/
|
|
5
|
+
import{secondsFromMilliseconds as e}from"../../../../core/time.js";import{f as t}from"../../../../chunks/vec2f64.js";import{f as r}from"../../../../chunks/vec4f64.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{AnimationTimer as a}from"../lib/AnimationTimer.js";import{Material as s,MaterialParameters as n}from"../lib/Material.js";import{OITPolygonOffsetLimit as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{WaterGLMaterial as c}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as p}from"./WaterTechnique.js";import{DefaultBufferWriter as l,PositionUVLayout as m}from"./internal/DefaultBufferWriter.js";import{intersectTriangleGeometry as u}from"./internal/MaterialUtil.js";class f extends s{constructor(e){super(e,new d),this._configuration=new p,this.animation=new a}getConfiguration(e,t){return this._configuration.output=e,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.hasScreenSpaceReflections=this.parameters.hasScreenSpaceReflections,this._configuration.hasCloudsReflections=this.parameters.hasCloudsReflections,this._configuration.isDraped=this.parameters.isDraped,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<o,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}update(t){const r=Math.min(t.camera.relativeElevation,t.camera.distance);this.animation.enabled=Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*r<A;const i=this.animation.advance(t);return this.setParameters({timeElapsed:e(this.animation.time)*this.parameters.animationSpeed},!1),this.animation.enabled&&i}intersect(e,t,r,i,a,s,n){u(e,t,i,a,s,void 0,n)}requiresSlot(e,t){switch(t){case i.Normal:return e===h.DRAPED_WATER;case i.Color:if(this.parameters.isDraped)return e===h.DRAPED_MATERIAL;break;case i.Alpha:break;case i.Highlight:return e===h.OPAQUE_MATERIAL||e===h.DRAPED_MATERIAL;default:return!1}let r=h.OPAQUE_MATERIAL;return this.parameters.transparent&&(r=this.parameters.writeDepth?h.TRANSPARENT_MATERIAL:h.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),e===r}createGLMaterial(e){return new c(e)}createBufferWriter(){return new l(m)}}class d extends n{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=t(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=r(0,0,0,0),this.transparent=!0,this.writeDepth=!0,this.hasSlicePlane=!1,this.isDraped=!1,this.receiveShadows=!0,this.hasScreenSpaceReflections=!1,this.hasCloudsReflections=!1}}const A=35e3;export{f as WaterMaterial,d as WaterMaterialParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{ViewingMode as t}from"../../../ViewingMode.js";import{ShaderOutput as
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{ViewingMode as t}from"../../../ViewingMode.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{PBRMode as o}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{WaterDistortionPassParameters as i}from"../core/shaderLibrary/shading/WaterDistortion.glsl.js";import{doublePrecisionRequiresObfuscation as s}from"../core/shaderLibrary/util/DoublePrecision.glsl.js";import{ReloadableShaderModule as a}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as n}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as p}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{Default3D as l}from"../lib/DefaultVertexAttributeLocations.js";import{blendingDefault as c,oitBlending as u,oitDepthTest as h,oitDepthWrite as d,getOITPolygonOffset as f}from"../lib/OrderIndependentTransparency.js";import{Program as m}from"../lib/Program.js";import{TransparencyPassType as y}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as b}from"./DefaultTechniqueConfiguration.js";import{W as g}from"../../../../chunks/WaterSurface.glsl.js";import{makePipelineState as v,defaultDepthWriteParams as S,defaultColorWriteParams as T}from"../../../webgl/renderState.js";class j extends i{}class P extends n{initializeConfiguration(e,r){r.spherical=e.viewingMode===t.Global,r.doublePrecisionRequiresObfuscation=s(e.rctx)}initializeProgram(e){return new m(e.rctx,P.shader.get().build(this.configuration),l)}_setPipelineState(e){const t=this.configuration,o=e===y.NONE,i=e===y.FrontFace;return v({blending:t.output!==r.Normal&&t.output!==r.Highlight&&t.transparent?o?c:u(e):null,depthTest:{func:h(e)},depthWrite:o?t.writeDepth&&S:d(e),colorWrite:T,polygonOffset:o||i?null:f(t.enableOffset)})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}P.shader=new a(g,(()=>import("../shaders/WaterSurface.glsl.js")));class O extends b{constructor(){super(...arguments),this.output=r.Color,this.transparencyPassType=y.NONE,this.spherical=!1,this.receiveShadows=!1,this.hasSlicePlane=!1,this.transparent=!1,this.enableOffset=!0,this.writeDepth=!1,this.hasScreenSpaceReflections=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasCloudsReflections=!1,this.isDraped=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1}}e([p({count:r.COUNT})],O.prototype,"output",void 0),e([p({count:y.COUNT})],O.prototype,"transparencyPassType",void 0),e([p()],O.prototype,"spherical",void 0),e([p()],O.prototype,"receiveShadows",void 0),e([p()],O.prototype,"hasSlicePlane",void 0),e([p()],O.prototype,"transparent",void 0),e([p()],O.prototype,"enableOffset",void 0),e([p()],O.prototype,"writeDepth",void 0),e([p()],O.prototype,"hasScreenSpaceReflections",void 0),e([p()],O.prototype,"doublePrecisionRequiresObfuscation",void 0),e([p()],O.prototype,"hasCloudsReflections",void 0),e([p()],O.prototype,"isDraped",void 0),e([p()],O.prototype,"hasMultipassTerrain",void 0),e([p()],O.prototype,"cullAboveGround",void 0),e([p({constValue:o.Water})],O.prototype,"pbrMode",void 0),e([p({constValue:!0})],O.prototype,"useCustomDTRExponentForWater",void 0),e([p({constValue:!0})],O.prototype,"highStepCount",void 0),e([p({constValue:!1})],O.prototype,"useFillLights",void 0);export{j as WaterMaterialPassParameters,P as WaterTechnique,O as WaterTechniqueConfiguration};
|