@arcgis/core 5.0.0-next.36 → 5.0.0-next.38
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/WebLinkChart.js +1 -1
- package/analysis/ShadowCast/types.d.ts +2 -0
- package/applications/Components/analysisUtils.d.ts +1 -0
- package/applications/Components/analysisUtils.js +1 -1
- package/applications/Components/testUtils.d.ts +4 -0
- package/applications/Components/testUtils.js +5 -0
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/actions/AttributeFilter.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/SpatialFilter.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
- package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
- package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/014dbe6fa93a277b08f7.js +1 -0
- package/assets/esri/core/workers/chunks/{51355866a0dcf41cfded.js → 0a5427127634738aa239.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7c721de93bc8688e13c.js → 1d4ea8db272655c0608c.js} +1 -1
- package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +1 -0
- package/assets/esri/core/workers/chunks/1de216d9850c39c1735d.js +1 -0
- package/assets/esri/core/workers/chunks/262232437d37a7460b11.js +1 -0
- package/assets/esri/core/workers/chunks/2795e491f803654413d2.js +1 -0
- package/assets/esri/core/workers/chunks/2f9129003f77bfeab2f9.js +1 -0
- package/assets/esri/core/workers/chunks/{1817cf11e85afca947d3.js → 328106e181e5957ceaa5.js} +1 -1
- package/assets/esri/core/workers/chunks/{d3db7244fac7398cc700.js → 4b6a44c6265c8959abd8.js} +1 -1
- package/assets/esri/core/workers/chunks/50ffb22c48fadd36c748.js +1 -0
- package/assets/esri/core/workers/chunks/{f1ac1c8b1331ec79e898.js → 59ce992d3a5e7c32b9fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{8a946cbc816f373c136b.js → 5e30acfda04f7fc2b676.js} +1 -1
- package/assets/esri/core/workers/chunks/6330d8767ba1d5329daa.js +1 -0
- package/assets/esri/core/workers/chunks/{3f03165487c1c2340fff.js → 690a40d2eef52bfc149f.js} +1 -1
- package/assets/esri/core/workers/chunks/{dd34d56caafa38d4b8e4.js → 7aa730e5ac7b268e3c98.js} +1 -1
- package/assets/esri/core/workers/chunks/{b451dc416eebd0931ef8.js → 7ab237d19b84d89ff483.js} +7 -7
- package/assets/esri/core/workers/chunks/{1fa55d4c4b092a98bdd7.js → b56c07c0b43cb1999070.js} +1 -1
- package/assets/esri/core/workers/chunks/{bfb9cbe59d36d18f9157.js → cda5c95fd49b8901f7d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9e7cc5d853908ab5b2f.js → ce99abfdcd71ff9e4e36.js} +1 -1
- package/assets/esri/core/workers/chunks/{726a797f5df7eeee0b3d.js → d786b17cc9062b1450ac.js} +1 -1
- package/assets/esri/core/workers/chunks/{52c8687b473c9953c2f2.js → d9958654c6438f28237b.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e76fbd3c874300fc4a7.js → de3da4d31a7529761565.js} +1 -1
- package/assets/esri/core/workers/chunks/{eb6218634a492667506a.js → e501d68a1464805c4b4e.js} +1 -1
- package/assets/esri/core/workers/chunks/{33431e8131f6017de2f9.js → e7f4d135ef9665de1468.js} +1 -1
- package/assets/esri/core/workers/chunks/{d8623f5f13a084e439c2.js → e9bc3c6482ba778c9349.js} +37 -37
- package/assets/esri/core/workers/chunks/{7420fa18ba12014b22ea.js → ee67c8a7c1f8b482cd99.js} +1 -1
- package/assets/esri/core/workers/chunks/{abb05a903440d97a6a74.js → f441fc74451330384fb0.js} +1 -1
- package/assets/esri/core/workers/chunks/f609b256df9eb3803464.js +1 -0
- package/assets/esri/core/workers/chunks/f97a7cb367634353177d.js +1 -0
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ComponentShader.glsl.js +2 -2
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/Laserlines.glsl.js +1 -1
- package/chunks/Path.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +34 -36
- package/chunks/WaterSurface.glsl.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/vec32.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/iteratorUtils.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +59 -5
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/csvUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +5 -5
- package/support/revision.js +1 -1
- package/support/tests/meshUtils.js +5 -0
- package/support/tests/serviceMockDependencies.js +5 -0
- package/support/tests/setupServiceMocksMesh.js +5 -0
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
- package/views/2d/interactive/SegmentLabels2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsParameters.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/interactive/SegmentLabels3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/ImagerySubView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.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/TileCompositor.js +1 -1
- package/views/3d/webgl/RenderCamera.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/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +4 -7
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +19 -15
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +14 -14
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +16 -37
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +8 -8
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Normals.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +5 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayoutField.js +5 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +5 -0
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/triangleIntersectionUtils.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/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/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +9 -10
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.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/BreakpointsOwner.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/ToolViewManager.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileVisualizationUtils.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geodesicLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/webmap/utils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/assets/esri/core/workers/chunks/11687718c8635eb7bf37.js +0 -1
- package/assets/esri/core/workers/chunks/15c1a48e8cd2a8882d85.js +0 -1
- package/assets/esri/core/workers/chunks/1b9e7d416c9f00e020bb.js +0 -1
- package/assets/esri/core/workers/chunks/24a3c6f0154787968724.js +0 -1
- package/assets/esri/core/workers/chunks/5000a37fba27464d10ca.js +0 -1
- package/assets/esri/core/workers/chunks/951a3442d4342539f2ea.js +0 -1
- package/assets/esri/core/workers/chunks/b075d3714fab0591d67c.js +0 -1
- package/assets/esri/core/workers/chunks/d8975dd7b85b5d065ee4.js +0 -1
- package/assets/esri/core/workers/chunks/e0a74250d22fa1d7dc18.js +0 -1
- package/assets/esri/core/workers/chunks/f43e1e1a1b2eb737e00c.js +0 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/FastApproximateTrigonometry.glsl.js +0 -26
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as l,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as u,p as f,n as p,e as h,j as m,d,b as g,D as b,i as v,a as x,t as S,g as y}from"../../../../chunks/vec32.js";import{create as O,fromValues as z}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as _,create as P,freeze as j}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMat4 as M}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as D}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as V}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as R}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as A}from"../../support/debugFlags.js";import{isColorHighlightOrOID as C,isColor as w}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as F}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as T,GLTextureMaterial as L}from"../lib/GLTextureMaterial.js";import{Material as E}from"../lib/Material.js";import{SeparateScreenSizePerspectiveEvaluators as U}from"../lib/screenSizePerspectiveUtils.js";import{assert as B}from"../lib/Util.js";import{writePosition as I,writeNormal as q,writeColor as G,writeBufferVec2 as W,writeBufferFloat as H,writeBufferVec4 as N,writeBufferVec4Zeros as X,writeOlidColor as Y}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as k}from"./internal/MaterialUtil.js";import{c as J,f as K}from"../../../../chunks/HUDMaterial.glsl.js";import{baseLayout as Q,getInstanceLayout as Z,HUDMaterialTechnique as $}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as ee}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as te}from"../../../../webscene/support/AlphaCutoff.js";class ie extends E{constructor(e,t){super(e,De),this.produces=new Map([[13,e=>C(e)&&!this.parameters.drawAsLabel],[14,e=>C(e)&&this.parameters.drawAsLabel],[12,()=>this.parameters.occlusionTest],[18,e=>this.parameters.draped&&C(e)]]),this._visible=!0,this._configuration=new ee(t)}getConfiguration(e,t){const i=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=i,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.hasVVSize=!!this.parameters.vvSize,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.occlusionPass=12===t.slot,this._configuration.occludedFragmentFade=!i&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||12===t.slot,w(e)&&(this._configuration.debugDrawLabelBorder=!!A.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:v},point:x,camera:S}=s,{parameters:y}=this;if(!l||!c||v&&y.isLabel||!e.visible||!x||!S)return;const z=e.attributes.get("featureAttribute"),P=null==z?null:_(z.data,Oe),{scaleX:j,scaleY:M}=Re(P,y,S.pixelRatio);i(ge,t),e.attributes.has("featureAttribute")&&ne(ge);const D=e.attributes.get("position"),V=e.attributes.get("size"),R=e.attributes.get("normal"),A=e.attributes.get("rotation"),C=e.attributes.get("centerOffsetAndDistance");B(D.size>=3);const w=J(y),F="screen"===this.parameters.centerOffsetUnits;for(let i=0;i<D.data.length/D.size;i++){const e=i*D.size;u(ce,D.data[e],D.data[e+1],D.data[e+2]),f(ce,ce,t),f(ce,ce,S.viewMatrix);const a=i*C.size;if(u(Se,C.data[a],C.data[a+1],C.data[a+2]),!F&&(ce[0]+=Se[0],ce[1]+=Se[1],0!==Se[2])){const e=Se[2];p(Se,ce),h(ce,ce,m(Se,Se,e))}const n=i*R.size;if(u(ue,R.data[n],R.data[n+1],R.data[n+2]),ae(ue,ge,S,ze),Ae(this.parameters,ce,ze,S,le),S.applyProjection(ce,fe),fe[0]>-1){F&&(Se[0]||Se[1])&&(fe[0]+=Se[0]*S.pixelRatio,0!==Se[1]&&(fe[1]+=le.alignmentEvaluator.apply(Se[1])*S.pixelRatio),S.unapplyProjection(fe,ce)),fe[0]+=this.parameters.screenOffset[0]*S.pixelRatio,fe[1]+=this.parameters.screenOffset[1]*S.pixelRatio,fe[0]=Math.floor(fe[0]),fe[1]=Math.floor(fe[1]);const e=i*V.size;je[0]=V.data[e],je[1]=V.data[e+1],le.evaluator.applyVec2(je,je);const t=_e*S.pixelRatio;let a=0;if(y.textureIsSignedDistanceField){a=Math.min(y.outlineSize,.5*je[0])*S.pixelRatio/2}je[0]*=j,je[1]*=M;const n=i*A.size,l=y.rotation+A.data[n];if(oe(x,fe[0],fe[1],je,t,a,l,y,w)){const e=s.ray;if(f(he,ce,r(ve,S.viewMatrix)),fe[0]=x[0],fe[1]=x[1],S.unprojectFromRenderScreen(fe,ce)){const t=O();d(t,e.direction);const i=1/g(t);m(t,t,i);o(b(e.origin,ce)*i,t,-1,he)}}}}}intersectDraped(e,t,i,s,r){const a=e.attributes.get("position"),n=e.attributes.get("size"),o=e.attributes.get("rotation"),l=this.parameters,c=J(l),u=e.attributes.get("featureAttribute"),f=null==u?null:_(u.data,Oe),{scaleX:p,scaleY:h}=Re(f,l,e.screenToWorldRatio),m=Pe*e.screenToWorldRatio;for(let d=0;d<a.data.length/a.size;d++){const t=d*a.size,u=a.data[t],f=a.data[t+1],g=d*n.size;je[0]=n.data[g],je[1]=n.data[g+1];let b=0;if(l.textureIsSignedDistanceField){b=Math.min(l.outlineSize,.5*je[0])*e.screenToWorldRatio/2}je[0]*=p,je[1]*=h;const v=d*o.size,x=l.rotation+o.data[v];oe(i,u,f,je,m,b,x,l,c)&&s(r.distance,r.normal,-1)}}createBufferWriter(){return new Ve}applyShaderOffsetsView(e,t,i,s,r,a,n){const o=ae(t,i,r,ze);return this._applyVerticalGroundOffsetView(e,o,r,n),Ae(this.parameters,n,o,r,a),this._applyPolygonOffsetView(n,o,s[3],r,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,t,i,s,r){return this._applyCenterOffsetNDC(e,t,i,s),null!=r&&d(r,s),this._applyPolygonOffsetNDC(s,t,i,s),s}_applyPolygonOffsetView(t,i,s,r,a){const n=r.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return d(a,t);const c=e(Math.abs(i.cosAngle),.01,1),u=1-Math.sqrt(1-c*c)/c/r.viewport[2];return m(a,t,l>0?u:1/u),a}_applyVerticalGroundOffsetView(e,t,i,s){const r=g(e),a=i.aboveGround?1:-1,n=i.computeRenderPixelSizeAtDist(r)*F,o=m(ce,t.normal,a*n);return v(s,e,o),s}_applyCenterOffsetView(e,t,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&d(i,e),s&&(i[0]+=t[0],i[1]+=t[1],t[2]&&(p(ue,i),x(i,i,m(ue,ue,t[2])))),i}_applyCenterOffsetNDC(e,t,i,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&d(s,e),r||(s[0]+=t[0]/i.fullWidth*2,s[1]+=t[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,i,s){const r=this.parameters.shaderPolygonOffset;if(e!==s&&d(s,e),r){const e=i.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*r}return s}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:i}=this.parameters,s=e[3]>=te||t>=te&&i[3]>=te;return this._visible&&s}createGLMaterial(e){return new se(e)}calculateRelativeScreenBounds(e,t,i=D()){return re(this.parameters,e,t,i),i[2]=i[0]+e[0],i[3]=i[1]+e[1],i}}class se extends L{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique($,e)}}function re(e,t,i,s){s[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*i,s[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*i}function ae(e,t,s,r){return M(t)&&(t=i(be,t)),S(r.normal,e,t),f(r.normal,r.normal,s.viewInverseTransposeMatrix),r.cosAngle=y(pe,Me),r}function ne(e){const t=e[0],i=e[1],s=e[2],r=e[3],a=e[4],n=e[5],o=e[6],l=e[7],c=e[8],u=1/Math.sqrt(t*t+i*i+s*s),f=1/Math.sqrt(r*r+a*a+n*n),p=1/Math.sqrt(o*o+l*l+c*c);return e[0]=t*u,e[1]=i*u,e[2]=s*u,e[3]=r*f,e[4]=a*f,e[5]=n*f,e[6]=o*p,e[7]=l*p,e[8]=c*p,e}function oe(e,i,s,r,a,l,c,u,f){let p=i-a-r[0]*f[0],h=p+r[0]+2*a,m=s-a-r[1]*f[1],d=m+r[1]+2*a;const g=u.distanceFieldBoundingBox;return u.textureIsSignedDistanceField&&null!=g&&(p+=r[0]*g[0],m+=r[1]*g[1],h-=r[0]*(1-g[2]),d-=r[1]*(1-g[3]),p-=l,h+=l,m-=l,d+=l),n(de,i,s),o(me,e,de,t(c)),me[0]>p&&me[0]<h&&me[1]>m&&me[1]<d}const le=new U,ce=O(),ue=O(),fe=P(),pe=O(),he=O(),me=c(),de=c(),ge=s(),be=s(),ve=a(),xe=P(),Se=O(),ye=O(),Oe=P(),ze={normal:pe,cosAngle:0},_e=1,Pe=2,je=l(0,0),Me=z(0,0,1);class De extends T{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1,this.color=j(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=j(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=P(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Ve{constructor(){this.layout=Q,this.instanceLayout=Z()}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,i,s,r,a){const{position:n,normal:o,color:l,size:c,rotation:u,centerOffsetAndDistance:f,featureAttribute:p,uvi:h}=r;I(i.get("position"),e,n,a),q(i.get("normal"),t,o,a);const m=i.get("position").indices.length;let d=0,g=0,b=K,v=K;const x=i.get("uvi")?.data;x&&x.length>=4&&(d=x[0],g=x[1],b=x[2],v=x[3]);for(let S=0;S<m;++S){const e=a+S;h.setValues(e,d,g,b,v)}if(G(i.get("color"),4,l,a),W(i.get("size"),c,a),H(i.get("rotation"),u,a),i.get("centerOffsetAndDistance")?N(i.get("centerOffsetAndDistance"),f,a):X(f,a,m),i.get("featureAttribute")?N(i.get("featureAttribute"),p,a):X(p,a,m),null!=s){const e=i.get("position")?.indices;if(e){const t=e.length,i=r.getField("olidColor",V);Y(s,i,t,a)}}return{numVerticesPerItem:1,numItems:m}}writeBaseInstance(e,t){const{uv0:i}=t;W(e.get("uv0"),i,0)}intersect(e,t,i,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:x},point:S,camera:y}=s;if(!l||!c||x&&t.isLabel||!S)return;const z=this.instanceLayout.createView(e),{position:_,normal:P,rotation:j,size:M,featureAttribute:D,centerOffsetAndDistance:V}=z,R="screen"===t.centerOffsetUnits,A=J(t);if(null==_||null==P||null==j||null==M||null==V||null==y)return;const C=null==D?null:D.getVec(0,Oe),{scaleX:w,scaleY:F}=Re(C,t,y.pixelRatio),T=_.count;for(let L=0;L<T;L++){if(_.getVec(L,ce),null!=i&&v(ce,ce,i),f(ce,ce,y.viewMatrix),V.getVec(L,xe),u(Se,xe[0],xe[1],xe[2]),!R&&(ce[0]+=Se[0],ce[1]+=Se[1],0!==Se[2])){const e=Se[2];p(Se,ce),h(ce,ce,m(Se,Se,e))}if(P.getVec(L,ue),ae(ue,ge,y,ze),Ae(t,ce,ze,y,le),y.applyProjection(ce,fe),fe[0]>-1){R&&(Se[0]||Se[1])&&(fe[0]+=Se[0]*y.pixelRatio,0!==Se[1]&&(fe[1]+=le.alignmentEvaluator.apply(Se[1])*y.pixelRatio),y.unapplyProjection(fe,ce)),fe[0]+=t.screenOffset[0]*y.pixelRatio,fe[1]+=t.screenOffset[1]*y.pixelRatio,fe[0]=Math.floor(fe[0]),fe[1]=Math.floor(fe[1]),M.getVec(L,je),le.evaluator.applyVec2(je,je);const e=_e*y.pixelRatio;let i=0;if(t.textureIsSignedDistanceField){i=Math.min(t.outlineSize,.5*je[0])*y.pixelRatio/2}je[0]*=w,je[1]*=F;const a=j.get(L),n=t.rotation+a;if(oe(S,fe[0],fe[1],je,e,i,n,t,A)){const e=s.ray;if(f(he,ce,r(ve,y.viewMatrix)),fe[0]=S[0],fe[1]=S[1],y.unprojectFromRenderScreen(fe,ce)){const t=O();d(t,e.direction);const i=1/g(t);m(t,t,i);o(b(e.origin,ce)*i,t,L,he)}}}}}}function Re(e,t,i){return null==e||null==t.vvSize?{scaleX:i,scaleY:i}:(R(ye,t,e),{scaleX:ye[0]*i,scaleY:ye[1]*i})}function Ae(e,t,i,s,r){if(!e.verticalOffset?.screenLength){const s=g(t);return r.update(i.cosAngle,s,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),t}const a=g(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=k(s,a,e.verticalOffset,i.cosAngle,n,e.screenSizePerspectiveMinPixelReferenceSize);return r.update(i.cosAngle,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),m(i.normal,i.normal,o),v(t,t,i.normal)}export{ie as HUDMaterial,De as Parameters};
|
|
5
|
+
import{clamp as e,deg2rad as t}from"../../../../core/mathUtils.js";import{fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as n,rotate as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as l,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{h as u,p as f,n as p,e as h,j as m,d,b as g,C as b,i as v,a as x,t as S,g as y}from"../../../../chunks/vec32.js";import{create as O,fromValues as z}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromArray as _,create as P,freeze as j}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMat4 as M}from"../../../../core/libs/gl-matrix-2/types/mat4.js";import{create as V}from"../../../../geometry/support/aaBoundingRect.js";import{BufferViewVec4u8 as C}from"../../../../geometry/support/buffer/BufferView.js";import{evaluateModelTransformScale as D}from"../../layers/support/FastSymbolUpdates.js";import{debugFlags as R}from"../../support/debugFlags.js";import{isColorHighlightOrOID as A,isColor as w}from"../core/shaderLibrary/ShaderOutput.js";import{HUDVerticalPixelOffset as F}from"../core/shaderLibrary/hud/HUD.glsl.js";import{GLTextureMaterialBindParameters as T,GLTextureMaterial as L}from"../lib/GLTextureMaterial.js";import{Material as E}from"../lib/Material.js";import{SeparateScreenSizePerspectiveEvaluators as U}from"../lib/screenSizePerspectiveUtils.js";import{assert as B}from"../lib/Util.js";import{writePosition as I,writeNormal as q,writeColor as G,writeBufferVec2 as W,writeBufferFloat as H,writeBufferVec4 as N,writeBufferVec4Zeros as X,writeOlidColor as Y}from"./internal/bufferWriterUtils.js";import{verticalOffsetAtDistance as k}from"./internal/MaterialUtil.js";import{c as J,f as K}from"../../../../chunks/HUDMaterial.glsl.js";import{baseLayout as Q,getInstanceLayout as Z,HUDMaterialTechnique as $}from"../shaders/HUDMaterialTechnique.js";import{HUDMaterialTechniqueConfiguration as ee}from"../shaders/HUDMaterialTechniqueConfiguration.js";import{alphaCutoff as te}from"../../../../webscene/support/AlphaCutoff.js";class ie extends E{constructor(e,t){super(e,Ve),this.produces=new Map([[14,e=>A(e)&&!this.parameters.drawAsLabel],[15,e=>A(e)&&this.parameters.drawAsLabel],[13,()=>this.parameters.occlusionTest],[19,e=>this.parameters.draped&&A(e)]]),this._visible=!0,this._configuration=new ee(t)}getConfiguration(e,t){const i=this.parameters.draped;return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=i,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.hasRotation=this.parameters.hasRotation,this._configuration.hasVVSize=!!this.parameters.vvSize,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.occlusionPass=13===t.slot,this._configuration.occludedFragmentFade=!i&&this.parameters.occludedFragmentFade,this._configuration.horizonCullingEnabled=this.parameters.horizonCullingEnabled,this._configuration.isFocused=this.parameters.isFocused,this._configuration.depthTestEnabled=this.parameters.depthEnabled||13===t.slot,w(e)&&(this._configuration.debugDrawLabelBorder=!!R.LABELS_SHOW_BORDER),this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}intersect(e,t,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:v},point:x,camera:S}=s,{parameters:y}=this;if(!l||!c||v&&y.isLabel||!e.visible||!x||!S)return;const z=e.attributes.get("featureAttribute"),P=null==z?null:_(z.data,Oe),{scaleX:j,scaleY:M}=De(P,y,S.pixelRatio);i(ge,t),e.attributes.has("featureAttribute")&&ne(ge);const V=e.attributes.get("position"),C=e.attributes.get("size"),D=e.attributes.get("normal"),R=e.attributes.get("rotation"),A=e.attributes.get("centerOffsetAndDistance");B(V.size>=3);const w=J(y),F="screen"===this.parameters.centerOffsetUnits;for(let i=0;i<V.data.length/V.size;i++){const e=i*V.size;u(ce,V.data[e],V.data[e+1],V.data[e+2]),f(ce,ce,t),f(ce,ce,S.viewMatrix);const a=i*A.size;if(u(Se,A.data[a],A.data[a+1],A.data[a+2]),!F&&(ce[0]+=Se[0],ce[1]+=Se[1],0!==Se[2])){const e=Se[2];p(Se,ce),h(ce,ce,m(Se,Se,e))}const n=i*D.size;if(u(ue,D.data[n],D.data[n+1],D.data[n+2]),ae(ue,ge,S,ze),Re(this.parameters,ce,ze,S,le),S.applyProjection(ce,fe),fe[0]>-1){F&&(Se[0]||Se[1])&&(fe[0]+=Se[0]*S.pixelRatio,0!==Se[1]&&(fe[1]+=le.alignmentEvaluator.apply(Se[1])*S.pixelRatio),S.unapplyProjection(fe,ce)),fe[0]+=this.parameters.screenOffset[0]*S.pixelRatio,fe[1]+=this.parameters.screenOffset[1]*S.pixelRatio,fe[0]=Math.floor(fe[0]),fe[1]=Math.floor(fe[1]);const e=i*C.size;je[0]=C.data[e],je[1]=C.data[e+1],le.evaluator.applyVec2(je,je);const t=_e*S.pixelRatio;let a=0;if(y.textureIsSignedDistanceField){a=Math.min(y.outlineSize,.5*je[0])*S.pixelRatio/2}je[0]*=j,je[1]*=M;const n=i*R.size,l=y.rotation+R.data[n];if(oe(x,fe[0],fe[1],je,t,a,l,y,w)){const e=s.ray;if(f(he,ce,r(ve,S.viewMatrix)),fe[0]=x[0],fe[1]=x[1],S.unprojectFromRenderScreen(fe,ce)){const t=O();d(t,e.direction);const i=1/g(t);m(t,t,i);o(b(e.origin,ce)*i,t,-1,he)}}}}}intersectDraped(e,t,i,s,r){const a=e.attributes.get("position"),n=e.attributes.get("size"),o=e.attributes.get("rotation"),l=this.parameters,c=J(l),u=e.attributes.get("featureAttribute"),f=null==u?null:_(u.data,Oe),{scaleX:p,scaleY:h}=De(f,l,e.screenToWorldRatio),m=Pe*e.screenToWorldRatio;for(let d=0;d<a.data.length/a.size;d++){const t=d*a.size,u=a.data[t],f=a.data[t+1],g=d*n.size;je[0]=n.data[g],je[1]=n.data[g+1];let b=0;if(l.textureIsSignedDistanceField){b=Math.min(l.outlineSize,.5*je[0])*e.screenToWorldRatio/2}je[0]*=p,je[1]*=h;const v=d*o.size,x=l.rotation+o.data[v];oe(i,u,f,je,m,b,x,l,c)&&s(r.distance,r.normal,-1)}}createBufferWriter(){return new Ce}applyShaderOffsetsView(e,t,i,s,r,a,n){const o=ae(t,i,r,ze);return this._applyVerticalGroundOffsetView(e,o,r,n),Re(this.parameters,n,o,r,a),this._applyPolygonOffsetView(n,o,s[3],r,n),this._applyCenterOffsetView(n,s,n),n}applyShaderOffsetsNDC(e,t,i,s,r){return this._applyCenterOffsetNDC(e,t,i,s),null!=r&&d(r,s),this._applyPolygonOffsetNDC(s,t,i,s),s}_applyPolygonOffsetView(t,i,s,r,a){const n=r.aboveGround?1:-1;let o=Math.sign(s);0===o&&(o=n);const l=n*o;if(this.parameters.shaderPolygonOffset<=0)return d(a,t);const c=e(Math.abs(i.cosAngle),.01,1),u=1-Math.sqrt(1-c*c)/c/r.viewport[2];return m(a,t,l>0?u:1/u),a}_applyVerticalGroundOffsetView(e,t,i,s){const r=g(e),a=i.aboveGround?1:-1,n=i.computeRenderPixelSizeAtDist(r)*F,o=m(ce,t.normal,a*n);return v(s,e,o),s}_applyCenterOffsetView(e,t,i){const s="screen"!==this.parameters.centerOffsetUnits;return i!==e&&d(i,e),s&&(i[0]+=t[0],i[1]+=t[1],t[2]&&(p(ue,i),x(i,i,m(ue,ue,t[2])))),i}_applyCenterOffsetNDC(e,t,i,s){const r="screen"!==this.parameters.centerOffsetUnits;return s!==e&&d(s,e),r||(s[0]+=t[0]/i.fullWidth*2,s[1]+=t[1]/i.fullHeight*2),s}_applyPolygonOffsetNDC(e,t,i,s){const r=this.parameters.shaderPolygonOffset;if(e!==s&&d(s,e),r){const e=i.aboveGround?1:-1,a=e*Math.sign(t[3]);s[2]-=(a||e)*r}return s}set visible(e){this._visible=e}get visible(){const{color:e,outlineSize:t,outlineColor:i}=this.parameters,s=e[3]>=te||t>=te&&i[3]>=te;return this._visible&&s}createGLMaterial(e){return new se(e)}calculateRelativeScreenBounds(e,t,i=V()){return re(this.parameters,e,t,i),i[2]=i[0]+e[0],i[3]=i[1]+e[1],i}}class se extends L{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.getTechnique($,e)}}function re(e,t,i,s){s[0]=e.anchorPosition[0]*-t[0]+e.screenOffset[0]*i,s[1]=e.anchorPosition[1]*-t[1]+e.screenOffset[1]*i}function ae(e,t,s,r){return M(t)&&(t=i(be,t)),S(r.normal,e,t),f(r.normal,r.normal,s.viewInverseTransposeMatrix),r.cosAngle=y(pe,Me),r}function ne(e){const t=e[0],i=e[1],s=e[2],r=e[3],a=e[4],n=e[5],o=e[6],l=e[7],c=e[8],u=1/Math.sqrt(t*t+i*i+s*s),f=1/Math.sqrt(r*r+a*a+n*n),p=1/Math.sqrt(o*o+l*l+c*c);return e[0]=t*u,e[1]=i*u,e[2]=s*u,e[3]=r*f,e[4]=a*f,e[5]=n*f,e[6]=o*p,e[7]=l*p,e[8]=c*p,e}function oe(e,i,s,r,a,l,c,u,f){let p=i-a-r[0]*f[0],h=p+r[0]+2*a,m=s-a-r[1]*f[1],d=m+r[1]+2*a;const g=u.distanceFieldBoundingBox;return u.textureIsSignedDistanceField&&null!=g&&(p+=r[0]*g[0],m+=r[1]*g[1],h-=r[0]*(1-g[2]),d-=r[1]*(1-g[3]),p-=l,h+=l,m-=l,d+=l),n(de,i,s),o(me,e,de,t(c)),me[0]>p&&me[0]<h&&me[1]>m&&me[1]<d}const le=new U,ce=O(),ue=O(),fe=P(),pe=O(),he=O(),me=c(),de=c(),ge=s(),be=s(),ve=a(),xe=P(),Se=O(),ye=O(),Oe=P(),ze={normal:pe,cosAngle:0},_e=1,Pe=2,je=l(0,0),Me=z(0,0,1);class Ve extends T{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1,this.color=j(1,1,1,1),this.polygonOffset=!1,this.anchorPosition=l(.5,.5),this.screenOffset=[0,0],this.shaderPolygonOffset=1e-5,this.textureIsSignedDistanceField=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.outlineColor=j(1,1,1,1),this.outlineSize=0,this.distanceFieldBoundingBox=P(),this.rotation=0,this.hasRotation=!1,this.vvSizeEnabled=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.hasSlicePlane=!1,this.pixelSnappingEnabled=!0,this.occlusionTest=!0,this.occludedFragmentFade=!1,this.horizonCullingEnabled=!1,this.centerOffsetUnits="world",this.drawAsLabel=!1,this.depthEnabled=!0,this.isFocused=!0,this.focusStyle="bright",this.draped=!1,this.isLabel=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class Ce{constructor(){this.layout=Q,this.instanceLayout=Z()}elementCount(e){return e.get("position").indices.length}elementCountBaseInstance(e){return e.get("uv0").indices.length}write(e,t,i,s,r,a){const{position:n,normal:o,color:l,size:c,rotation:u,centerOffsetAndDistance:f,featureAttribute:p,uvi:h}=r;I(i.get("position"),e,n,a),q(i.get("normal"),t,o,a);const m=i.get("position").indices.length;let d=0,g=0,b=K,v=K;const x=i.get("uvi")?.data;x&&x.length>=4&&(d=x[0],g=x[1],b=x[2],v=x[3]);for(let S=0;S<m;++S){const e=a+S;h.setValues(e,d,g,b,v)}if(G(i.get("color"),4,l,a),W(i.get("size"),c,a),H(i.get("rotation"),u,a),i.get("centerOffsetAndDistance")?N(i.get("centerOffsetAndDistance"),f,a):X(f,a,m),i.get("featureAttribute")?N(i.get("featureAttribute"),p,a):X(p,a,m),null!=s){const e=i.get("position")?.indices;if(e){const t=e.length,i=r.getField("olidColor",C);Y(s,i,t,a)}}return{numVerticesPerItem:1,numItems:m}}writeBaseInstance(e,t){const{uv0:i}=t;W(e.get("uv0"),i,0)}intersect(e,t,i,s,a,n,o){const{options:{selectionMode:l,hud:c,excludeLabels:x},point:S,camera:y}=s;if(!l||!c||x&&t.isLabel||!S)return;const z=this.instanceLayout.createView(e),{position:_,normal:P,rotation:j,size:M,featureAttribute:V,centerOffsetAndDistance:C}=z,D="screen"===t.centerOffsetUnits,R=J(t);if(null==_||null==P||null==j||null==M||null==C||null==y)return;const A=null==V?null:V.getVec(0,Oe),{scaleX:w,scaleY:F}=De(A,t,y.pixelRatio),T=_.count;for(let L=0;L<T;L++){if(_.getVec(L,ce),null!=i&&v(ce,ce,i),f(ce,ce,y.viewMatrix),C.getVec(L,xe),u(Se,xe[0],xe[1],xe[2]),!D&&(ce[0]+=Se[0],ce[1]+=Se[1],0!==Se[2])){const e=Se[2];p(Se,ce),h(ce,ce,m(Se,Se,e))}if(P.getVec(L,ue),ae(ue,ge,y,ze),Re(t,ce,ze,y,le),y.applyProjection(ce,fe),fe[0]>-1){D&&(Se[0]||Se[1])&&(fe[0]+=Se[0]*y.pixelRatio,0!==Se[1]&&(fe[1]+=le.alignmentEvaluator.apply(Se[1])*y.pixelRatio),y.unapplyProjection(fe,ce)),fe[0]+=t.screenOffset[0]*y.pixelRatio,fe[1]+=t.screenOffset[1]*y.pixelRatio,fe[0]=Math.floor(fe[0]),fe[1]=Math.floor(fe[1]),M.getVec(L,je),le.evaluator.applyVec2(je,je);const e=_e*y.pixelRatio;let i=0;if(t.textureIsSignedDistanceField){i=Math.min(t.outlineSize,.5*je[0])*y.pixelRatio/2}je[0]*=w,je[1]*=F;const a=j.get(L),n=t.rotation+a;if(oe(S,fe[0],fe[1],je,e,i,n,t,R)){const e=s.ray;if(f(he,ce,r(ve,y.viewMatrix)),fe[0]=S[0],fe[1]=S[1],y.unprojectFromRenderScreen(fe,ce)){const t=O();d(t,e.direction);const i=1/g(t);m(t,t,i);o(b(e.origin,ce)*i,t,L,he)}}}}}}function De(e,t,i){return null==e||null==t.vvSize?{scaleX:i,scaleY:i}:(D(ye,t,e),{scaleX:ye[0]*i,scaleY:ye[1]*i})}function Re(e,t,i,s,r){if(!e.verticalOffset?.screenLength){const s=g(t);return r.update(i.cosAngle,s,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),t}const a=g(t),n=e.screenSizePerspectiveAlignment??e.screenSizePerspective,o=k(s,a,e.verticalOffset,i.cosAngle,n,e.screenSizePerspectiveMinPixelReferenceSize);return r.update(i.cosAngle,a,e.screenSizePerspective,e.screenSizePerspectiveMinPixelReferenceSize,e.screenSizePerspectiveAlignment,null),m(i.normal,i.normal,o),v(t,t,i.normal)}export{ie as HUDMaterial,Ve 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import r from"../lib/GLMaterial.js";import{Material as i}from"../lib/Material.js";import{writePosition as n,writeBufferFloat as a}from"./internal/bufferWriterUtils.js";import{attributeDrivenInstanceLayout as o,instanceLayout as u,HeatmapDensityPassParameters as c,HeatmapDensityTechnique as l,baseLayout as f}from"../shaders/HeatmapDensityTechnique.js";import{HeatmapDensityTechniqueConfiguration as m}from"../shaders/HeatmapDensityTechniqueConfiguration.js";const h=2;class p extends c{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class g extends i{constructor(t){super(t,p),this.visible=!0,this.produces=new Map([[
|
|
5
|
+
import{set as t,squaredDistance as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import r from"../lib/GLMaterial.js";import{Material as i}from"../lib/Material.js";import{writePosition as n,writeBufferFloat as a}from"./internal/bufferWriterUtils.js";import{attributeDrivenInstanceLayout as o,instanceLayout as u,HeatmapDensityPassParameters as c,HeatmapDensityTechnique as l,baseLayout as f}from"../shaders/HeatmapDensityTechnique.js";import{HeatmapDensityTechniqueConfiguration as m}from"../shaders/HeatmapDensityTechniqueConfiguration.js";const h=2;class p extends c{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class g extends i{constructor(t){super(t,p),this.visible=!0,this.produces=new Map([[19,t=>0===t]]),this._configuration=new m}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats,this._configuration}createGLMaterial(t){return new b(t)}intersect(){}intersectDraped(s,r,i,n,a){const o=s.attributes.get("position"),{parameters:u}=this,{searchRadius:c}=u,{screenToWorldRatio:l}=s,f=c*l+h*l,m=f*f,p=o.data.length/o.size;for(let h=0;h<p;h++){const s=h*o.size,r=t(v,o.data[s],o.data[s+1]);e(r,i)<m&&n(a.distance,a.normal,-1)}}createBufferWriter(){return new d(this.parameters.isAttributeDriven?o:u)}}class b extends r{beginSlot(t){return this.getTechnique(l,t)}}class d{constructor(t){this.instanceLayout=t,this.layout=f}elementCount(t){return t.get("position").indices.length}elementCountBaseInstance(){return 4}write(t,e,s,r,i,o){n(s.get("position"),t,i.position,o);const u="featureAttribute"in i?i.featureAttribute:null;return u&&a(s.get("featureAttribute"),u,o),null}writeBaseInstance(t,e){const s=e.uv0;s.setValues(0,-1,-1),s.setValues(1,-1,1),s.setValues(2,1,-1),s.setValues(3,1,1)}}const v=s();export{g as HeatmapDensityMaterial,p as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOID as t,isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{isUpdatableTexture as s}from"../lib/IManagedTexture.js";import{MaterialParameters as a}from"../lib/Material.js";import{assert as o}from"../lib/Util.js";import{DefaultBufferWriter as n}from"./DefaultBufferWriter.js";import{TriangleMaterial as u}from"./TriangleMaterial.js";import{writeBufferFloat as p,writeAttribute as h}from"./internal/bufferWriterUtils.js";import{getLayout as c,ImageMaterialTechnique as l}from"../shaders/ImageMaterialTechnique.js";import{ImageMaterialTechniqueConfiguration as f}from"../shaders/ImageMaterialTechniqueConfiguration.js";class m extends u{constructor(e){super(e,x),this.supportsEdges=!0,this.visible=!0,this.produces=new Map([[2,e=>t(e)],[4,e=>r(e)&&this.parameters.writeDepth],[
|
|
5
|
+
import{BufferViewFloat as e}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOID as t,isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import i from"../lib/GLMaterial.js";import{isUpdatableTexture as s}from"../lib/IManagedTexture.js";import{MaterialParameters as a}from"../lib/Material.js";import{assert as o}from"../lib/Util.js";import{DefaultBufferWriter as n}from"./DefaultBufferWriter.js";import{TriangleMaterial as u}from"./TriangleMaterial.js";import{writeBufferFloat as p,writeAttribute as h}from"./internal/bufferWriterUtils.js";import{getLayout as c,ImageMaterialTechnique as l}from"../shaders/ImageMaterialTechnique.js";import{ImageMaterialTechniqueConfiguration as f}from"../shaders/ImageMaterialTechniqueConfiguration.js";class m extends u{constructor(e){super(e,x),this.supportsEdges=!0,this.visible=!0,this.produces=new Map([[2,e=>t(e)],[4,e=>r(e)&&this.parameters.writeDepth],[9,e=>r(e)&&!this.parameters.writeDepth],[19,e=>r(e)||t(e)]]),this._configuration=new f(e.draped)}dispose(){this.setParameters({texture:void 0})}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=t.hasOccludees,this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.enableOffset,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.perspectiveInterpolation=this.parameters.perspectiveInterpolation,this._configuration}createGLMaterial(e){return new g(e)}createBufferWriter(){return new d(c(this.parameters))}}class g extends i{constructor(e){super({...e,...e.material.parameters}),this.parameters=e;const t=this._material.parameters.managedTexture;s(t)&&e.textures.updater.add(t)}dispose(){this.parameters.textures.updater.remove(this._material.parameters.managedTexture)}beginSlot(e){return this.getTechnique(l,e)}}class d extends n{write(t,r,i,s,a,n){for(const u of this.layout.fields.keys()){const s=i.get(u);if(s)if("perspectiveDivide"===u){o(1===s.size);const t=a.getField(u,e);t&&p(s,t,n)}else h(u,s,t,r,a,n)}return null}}class x extends a{constructor(e,t){super(),this.managedTexture=e,this.draped=t,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=0,this.opacity=1,this.perspectiveInterpolation=!1}get texture(){return this.managedTexture.texture}}export{m as ImageMaterial,x 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import s from"../lib/GLMaterial.js";import{Material as n,MaterialParameters as o}from"../lib/Material.js";import{writePosition as a,writeNormal as c,writeBufferVec4 as l}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h,layout as u}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as f}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as p}from"../../../../webscene/support/AlphaCutoff.js";class m extends n{constructor(e,t){super(e,S),this.intersectDraped=void 0,this.produces=new Map([[
|
|
5
|
+
import{safeToString as e}from"../../../../core/string.js";import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{fromValues as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import s from"../lib/GLMaterial.js";import{Material as n,MaterialParameters as o}from"../lib/Material.js";import{writePosition as a,writeNormal as c,writeBufferVec4 as l}from"./internal/bufferWriterUtils.js";import{LineCalloutTechnique as h,layout as u}from"../shaders/LineCalloutTechnique.js";import{LineCalloutTechniqueConfiguration as f}from"../shaders/LineCalloutTechniqueConfiguration.js";import{alphaCutoff as p}from"../../../../webscene/support/AlphaCutoff.js";class m extends n{constructor(e,t){super(e,S),this.intersectDraped=void 0,this.produces=new Map([[16,e=>i(e)],[17,e=>i(e)]]),this._configuration=new f(t),this._uniqueMaterialIdentifier=g(this.parameters)}passParameters(){return this.parameters}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hudDepth=17===t.slot,this._configuration.hudDepthAlignStart=!!this.parameters.hudDepthAlignStart,this._configuration.screenCenterOffsetUnitsEnabled="screen"===this.parameters.centerOffsetUnits,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration}get visible(){return this.parameters.color[3]>=p||(this.parameters.borderColor?.[3]??0)>=p}intersect(){}createGLMaterial(e){return new d(e)}createBufferWriter(){return new $}validateParameters(e){this._uniqueMaterialIdentifier=g(e)}get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}}function g({renderOccluded:t,isDecoration:r,horizontalScreenOffset:i,color:s,size:n,occlusionTest:o,shaderPolygonOffset:a,hudDepthAlignStart:c,centerOffsetUnits:l,hasSlicePlane:h,screenSizePerspective:u,verticalOffset:f,borderColor:p}){return e`${t}:${r}:${i}:[${s}]:${n}:${o}:${a}:${c}:${l}:${h}:${null!=u}:{${f?.screenLength}:${f?.minWorldLength}:${f?.maxWorldLength}}:[${p}]`}class d extends s{beginSlot(e){return this.getTechnique(h,e)}}class S extends o{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=r(0,0,0,1),this.size=1,this.occlusionTest=!1,this.shaderPolygonOffset=1e-5,this.hudDepthAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}}const O=[t(0,0),t(1,0),t(0,1),t(1,0),t(1,1),t(0,1)];class ${constructor(){this.layout=u}elementCount(e){return 6*e.get("position").indices.length}write(e,t,r,i,s,n){a(r.get("position"),e,s.position,n,6),c(r.get("normal"),t,s.normal,n,6),l(r.get("centerOffsetAndDistance"),s.centerOffsetAndDistance,n,6);for(let o=0;o<O.length;++o)s.uv0.setVec(n+o,O[o]);return null}}export{m as LineCalloutMaterial,S as Parameters,g as uniqueMaterialIdentifier};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{h as e,
|
|
5
|
+
import{h as e,F as t,p as r}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeFloat16Array as s}from"../../../../geometry/support/float16.js";import{isColor as a,isDepth as o,isColorHighlightOIDOrDepth as n}from"../core/shaderLibrary/ShaderOutput.js";import h from"../lib/GLMaterial.js";import{Material as c}from"../lib/Material.js";import{VisualVariablePassParameters as p}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as l}from"./internal/bufferWriterUtils.js";import{getLayout as m,LineMarkerTechnique as u}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as d}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as f}from"../../../../webscene/support/AlphaCutoff.js";class g extends c{constructor(e,t){super(e,v),this.produces=new Map([[2,e=>8===e||a(e)&&8===this.parameters.renderOccluded],[3,e=>o(e)],[11,e=>n(e)&&8===this.parameters.renderOccluded],[12,e=>n(e)&&8===this.parameters.renderOccluded],[4,e=>a(e)&&this.parameters.writeDepth],[9,e=>a(e)&&!this.parameters.writeDepth],[19,e=>a(e)||8===e]]),this.intersectDraped=void 0,this._configuration=new d(t)}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.space=19===t.slot?0:this.parameters.worldSpace?2:1,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=0!==this.parameters.cap,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=t.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest&&a(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration}get visible(){return this.parameters.color[3]>=f}intersect(){}createBufferWriter(){return new S(m(this.parameters),this.parameters)}createGLMaterial(e){return new _(e)}}class _ extends h{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(u,e)}}class v extends p{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=0,this.anchor=0,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class S{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,a,o,n,h,c){const p=o.get("position").data,m=p.length/3;let u=[1,0,0];const d=o.get("normal");this._parameters.worldSpace&&null!=d&&(u=d.data);let f=1,g=0;this._parameters.vvSize?g=o.get("sizeFeatureAttribute").data[0]:o.has("size")&&(f=o.get("size").data[0]);let _=[1,1,1,1],v=0;this._parameters.vvColor?v=o.get("colorFeatureAttribute").data[0]:o.has("color")&&(_=o.get("color").data);let S=0;this._parameters.vvOpacity&&(S=o.get("opacityFeatureAttribute").data[0]);const P=new Float32Array(h.buffer),T=s(h.buffer),k=new Uint8Array(h.buffer);let O=c*(this.layout.stride/4);const V=P.BYTES_PER_ELEMENT/T.BYTES_PER_ELEMENT,j=4/V,y=(e,t,r,i)=>{P[O++]=e[0],P[O++]=e[1],P[O++]=e[2],l(t,e,T,O*V),O+=j;let s=O*V;if(T[s++]=r[0],T[s++]=r[1],O=Math.ceil(s/V),this._parameters.vvColor)P[O++]=v;else{const e=Math.min(4*i,_.length-4),t=4*O++;k[t]=255*_[e],k[t+1]=255*_[e+1],k[t+2]=255*_[e+2],k[t+3]=255*_[e+3]}this._parameters.vvOpacity&&(P[O++]=S),s=O*V,this._parameters.vvSize?(P[O++]=g,s+=2):T[s++]=f,this._parameters.worldSpace&&(T[s++]=u[0],T[s++]=u[1],T[s++]=u[2]),O=Math.ceil(s/V)},M=(s,a)=>{const o=e(b,p[3*s],p[3*s+1],p[3*s+2]),n=w;let h=s+a;do{e(n,p[3*h],p[3*h+1],p[3*h+2]),h+=a}while(t(o,n)&&h>=0&&h<m);i&&(r(o,o,i),r(n,n,i)),y(o,n,[-1,-1],s),y(o,n,[1,-1],s),y(o,n,[1,1],s),y(o,n,[-1,-1],s),y(o,n,[1,1],s),y(o,n,[-1,1],s)},C=this._parameters.placement;return"begin"!==C&&"begin-end"!==C||M(0,1),"end"!==C&&"begin-end"!==C||M(m-1,-1),null}}const b=i(),w=i();export{g as LineMarkerMaterial,v 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{h as t,n as e,e as r,f as s,
|
|
5
|
+
import{h as t,n as e,e as r,f as s,C as o,p as i}from"../../../../chunks/vec32.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as c}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as u,MaterialParameters as p}from"../lib/Material.js";import{MeasurementArrowTechnique as h,layout as f}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as m}from"../shaders/MeasurementArrowTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class d extends u{constructor(t){super(t,w),this._configuration=new m,this.intersectDraped=void 0,this.produces=new Map([[2,t=>!this._transparent&&c(t)],[9,t=>this._transparent&&c(t)]])}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this._transparent,this._configuration.oitPass=e.oitPass,this._configuration}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=g||e[3]>=g||r[3]>=g}intersect(){}createGLMaterial(t){return new C(t)}createBufferWriter(){return new O}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class C extends l{beginSlot(t){return this.getTechnique(h,t)}}class w 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 _=n(),b=n(),j=n(),v=n(),M=n();class O{constructor(){this.layout=f}elementCount(t){return 2*(t.get("position").indices.length/2+1)}write(n,a,c,l,u,p){const{data:h,indices:f}=c.get("position"),m=c.get("normal").data,g=h.length/3;f&&f.length!==2*(g-1)&&console.warn("MeasurementArrowMaterial does not support indices");const d=_,C=b,w=j,O=v,x=M,y=u.position,A=u.normal,E=u.uv0;let L=0;for(let _=0;_<g;++_){const c=3*_;if(t(d,h[c],h[c+1],h[c+2]),_<g-1){const o=3*(_+1);t(C,h[o],h[o+1],h[o+2]),t(x,m[o],m[o+1],m[o+2]),e(x,x),r(w,C,d),e(w,w),s(O,x,w),e(O,O)}const l=o(d,C);n&&a&&(i(d,d,n),i(C,C,n),i(O,O,a));const u=p+2*_,f=u+1;y.setVec(u,d),y.setVec(f,d),A.setVec(u,O),A.setVec(f,O),E.set(u,0,L),E.set(u,1,-1),E.set(f,0,L),E.set(f,1,1),_<g-1&&(L+=l)}const V=u.length;for(let t=0;t<2*g;++t)V.set(p+t,L);return null}}export{d as MeasurementArrowMaterial,w 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{h as i,e as s,g as n,j as a,i as c,d as l,b as m,
|
|
5
|
+
import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r}from"../../../../core/screenUtils.js";import{copy as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{h as i,e as s,g as n,j as a,i as c,d as l,b as m,C as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as h,fromPoints as g,create as d,closestLineSegmentPoint as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as b,create as x,signedDistance as L,getNormal as v}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOID as y}from"../core/shaderLibrary/ShaderOutput.js";import S from"../lib/GLMaterial.js";import{Material as M,MaterialParameters as _}from"../lib/Material.js";import{isTranslationMatrix as w}from"../lib/Util.js";import{DefaultBufferWriter as C}from"./DefaultBufferWriter.js";import{PositionColorLayout as T,PositionLayout as A}from"./DefaultLayouts.js";import{NativeLineTechnique as V}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as N}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class U extends M{constructor(e){super(e,P),this._configuration=new N,this.produces=new Map([[2,e=>y(e)]])}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=t.hasOccludees,this._configuration}get visible(){return this.parameters.color[3]>=R}intersect(t,r,f,p,d,x){const{options:y,camera:S,rayBegin:M,rayEnd:_}=f;if(!y.selectionMode||!t.visible||!S)return;if(!w(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const C=t.attributes.get("position").data,T=H;o(T,f.point);const A=2;i(I[0],T[0]-A,T[1]+A,0),i(I[1],T[0]+A,T[1]+A,0),i(I[2],T[0]+A,T[1]-A,0),i(I[3],T[0]-A,T[1]-A,0);for(let e=0;e<4;e++)if(!S.unprojectFromRenderScreen(I[e],J[e]))return;b(S.eye,J[0],J[1],K),b(S.eye,J[1],J[2],Q),b(S.eye,J[2],J[3],Y),b(S.eye,J[3],J[0],Z);let V=Number.MAX_VALUE,N=0;for(let e=0;e<C.length-5;e+=3){if(q[0]=C[e]+r[12],q[1]=C[e+1]+r[13],q[2]=C[e+2]+r[14],B[0]=C[e+3]+r[12],B[1]=C[e+4]+r[13],B[2]=C[e+5]+r[14],L(K,q)<0&&L(K,B)<0||L(Q,q)<0&&L(Q,B)<0||L(Y,q)<0&&L(Y,B)<0||L(Z,q)<0&&L(Z,B)<0)continue;const t=S.projectToRenderScreen(q,W),o=S.projectToRenderScreen(B,X);if(null==t||null==o)continue;if(t[2]<0&&o[2]>0){s(D,q,B);const e=S.frustum,r=-L(e[4],q)/n(D,v(e[4]));if(a(D,D,r),c(q,q,D),!S.projectToRenderScreen(q,t))continue}else if(t[2]>0&&o[2]<0){s(D,B,q);const e=S.frustum,t=-L(e[4],B)/n(D,v(e[4]));if(a(D,D,t),c(B,B,D),!S.projectToRenderScreen(B,o))continue}else if(t[2]<0&&o[2]<0)continue;t[2]=0,o[2]=0;const i=h(g(t,o,z),T);i<V&&(V=i,l(G,q),l(k,B),N=e/3)}if(V<A*A){let e=Number.MAX_VALUE;if(j(g(G,k,z),g(M,_,F),O)){s(O,O,M);const t=m(O);a(O,O,1/t),e=t/u(M,_)}x(e,O,N)}}intersectDraped(e,r,o,i,s){if(!r.options.selectionMode)return;const n=e.attributes.get("position").data,a=e.attributes.get("size"),c=a?a.data[0]:0,l=o[0],m=o[1],u=((c+1)/2+4)*e.screenToWorldRatio;let f=Number.MAX_VALUE,p=0;for(let h=0;h<n.length-5;h+=3){const e=n[h],r=n[h+1],o=l-e,i=m-r,s=n[h+3]-e,a=n[h+4]-r,c=t((s*o+a*i)/(s*s+a*a),0,1),u=s*c-o,g=a*c-i,d=u*u+g*g;d<f&&(f=d,p=h/3)}f<u*u&&i(s.distance,s.normal,p)}createGLMaterial(e){return new E(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?T:A;return new C(e)}}class E extends S{beginSlot(e){return this.getTechnique(V,e)}}class P extends _{constructor(){super(...arguments),this.color=p,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const q=f(),B=f(),D=f(),O=f(),W=r(),X=r(),G=f(),k=f(),z=d(),F=d(),H=f(),I=[r(),r(),r(),r()],J=[f(),f(),f(),f()],K=x(),Q=x(),Y=x(),Z=x();export{U as NativeLineMaterial,P as Parameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewMat3f as e,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOID as s,isColor as i,isDepth as o,isColorHighlightOrOID as a}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{assert as f}from"../lib/Util.js";import{DefaultBufferWriter as c}from"./DefaultBufferWriter.js";import{TriangleMaterial as l}from"./TriangleMaterial.js";import{VisualVariablePassParameters as h}from"./VisualVariablePassParameters.js";import{writeAttributes as u,writeBufferVec4 as p}from"./internal/bufferWriterUtils.js";import{getLayout as m,PatternTechnique as g}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as d}from"../shaders/PatternTechniqueConfiguration.js";import{alphaCutoff as b}from"../../../../webscene/support/AlphaCutoff.js";class _ extends l{constructor(t){super(t,v),this._configuration=new d,this.supportsEdges=!0,this.produces=new Map([[2,t=>s(t)],[4,t=>i(t)],[5,t=>o(t)],[
|
|
5
|
+
import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewMat3f as e,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOID as s,isColor as i,isDepth as o,isColorHighlightOrOID as a}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{assert as f}from"../lib/Util.js";import{DefaultBufferWriter as c}from"./DefaultBufferWriter.js";import{TriangleMaterial as l}from"./TriangleMaterial.js";import{VisualVariablePassParameters as h}from"./VisualVariablePassParameters.js";import{writeAttributes as u,writeBufferVec4 as p}from"./internal/bufferWriterUtils.js";import{getLayout as m,PatternTechnique as g}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as d}from"../shaders/PatternTechniqueConfiguration.js";import{alphaCutoff as b}from"../../../../webscene/support/AlphaCutoff.js";class _ extends l{constructor(t){super(t,v),this._configuration=new d,this.supportsEdges=!0,this.produces=new Map([[2,t=>s(t)],[4,t=>i(t)],[5,t=>o(t)],[19,t=>this.parameters.draped&&a(t)]])}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.style=this.parameters.style,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=e.oitPass,this._configuration.enableOffset=e.enableOffset,this._configuration.terrainDepthTest=e.terrainDepthTest&&i(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration}get visible(){return this.parameters.color[3]>=b}createGLMaterial(t){return new y(t)}createBufferWriter(){return new j(m(this.parameters))}}class y extends n{beginSlot(t){return this.getTechnique(g,t)}}class j extends c{write(t,s,i,o,a,n){const c=u(i,o,this.layout,t,s,a,n);for(const l of this.layout.fields.keys()){const s=i.get(l),o=s?.indices;if(s&&o)switch(l){case"uvMapSpace":{f(4===s.size);const t=a.getField(l,r);t&&p(s,t,n);break}case"boundingRect":{f(9===s.size);const r=a.getField(l,e);r&&C(s,t,r,n);break}}}return c}}function C(t,e,r,s){const{data:i,indices:o}=t,a=e,n=r.typedBuffer,f=r.typedBufferStride,c=o.length;s*=f;for(let l=0;l<c;++l){const t=9*o[l],e=i[t],r=i[t+1],c=i[t+2];n[s]=a[0]*e+a[4]*r+a[8]*c+a[12],n[s+1]=a[1]*e+a[5]*r+a[9]*c+a[13],n[s+2]=a[2]*e+a[6]*r+a[10]*c+a[14];for(let o=3;o<9;++o)n[s+o]=i[t+o];s+=f}}class v extends h{constructor(){super(...arguments),this.color=t(1,1,1,1),this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=0,this.hasOccludees=!1,this.style=2,this.draped=!0}}export{v as Parameters,_ 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../../../../core/Logger.js";import{clamp as e}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as r}from"../../../../core/time.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{h as a,e as n,g as o,j as l,i as h,d as c,b as m,D as p,p as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as d}from"../../../../chunks/vec42.js";import{ONES as g,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as _}from"../../../../geometry/support/float16.js";import{distance2 as S,fromPoints as v,create as P,closestLineSegmentPoint as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as E,create as w,signedDistance as y,getNormal as T}from"../../../../geometry/support/plane.js";import{isHighlightOrOID as z,isColor as A,isDepth as C,isColorHighlightOIDOrDepth as O,is2DGeometryOutput as L}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as M}from"../effects/geometry/olidUtils.js";import V from"../lib/GLMaterial.js";import{Material as R}from"../lib/Material.js";import{isTranslationMatrix as x}from"../lib/Util.js";import{VisualVariablePassParameters as F}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as k}from"./internal/bufferWriterUtils.js";import{r as N}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as U,RibbonLineTechnique as D}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as B}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";class J extends R{constructor(t,e){super(t,q),this.produces=new Map([[2,t=>z(t)||A(t)&&8===this.parameters.renderOccluded],[3,t=>C(t)],[10,t=>O(t)&&8===this.parameters.renderOccluded],[11,t=>O(t)&&8===this.parameters.renderOccluded],[4,t=>A(t)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,t=>A(t)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,t=>L(t)]]),this._configuration=new B(e)}getConfiguration(t,e){super.getConfiguration(t,e,this._configuration),this._configuration.oitPass=e.oitPass,this._configuration.draped=18===e.slot;const i=null!=this.parameters.stipplePattern&&8!==t;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&H(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.terrainDepthTest=e.terrainDepthTest&&A(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.hasEmissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}setParameters(t,e){t.animation=this.parameters.animation,super.setParameters(t,e)}intersectDraped({attributes:t,screenToWorldRatio:i},r,s,a,n){if(!r.options.selectionMode)return;const o=t.get("size");let l=this.parameters.width;if(this.parameters.vvSize){const i=t.get("sizeFeatureAttribute").data[0];Number.isNaN(i)?l*=this.parameters.vvSize.fallback[0]:l*=e(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const h=s[0],c=s[1],m=(l/2+4)*i;let p=Number.MAX_VALUE,u=0;const f=t.get("position").data,d=I(this.parameters,t)?f.length-2:f.length-5;for(let g=0;g<d;g+=3){const t=f[g],i=f[g+1],r=(g+3)%f.length,s=h-t,a=c-i,n=f[r]-t,o=f[r+1]-i,l=e((n*s+o*a)/(n*n+o*o),0,1),m=n*l-s,d=o*l-a,b=m*m+d*d;b<p&&(p=b,u=g/3)}p<m*m&&a(n.distance,n.normal,u)}intersect(i,r,u,f,d,g){const{options:b,camera:_,rayBegin:P,rayEnd:w}=u;if(!b.selectionMode||!i.visible||!_)return;if(!x(r))return void t.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const z=i.attributes,A=z.get("position").data;let C=this.parameters.width;if(this.parameters.vvSize){const t=z.get("sizeFeatureAttribute").data[0];Number.isNaN(t)||(C*=e(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else z.has("size")&&(C*=z.get("size").data[0]);const O=tt;s(O,u.point);const L=C*_.pixelRatio/2+4*_.pixelRatio;a(mt[0],O[0]-L,O[1]+L,0),a(mt[1],O[0]+L,O[1]+L,0),a(mt[2],O[0]+L,O[1]-L,0),a(mt[3],O[0]-L,O[1]-L,0);for(let t=0;t<4;t++)if(!_.unprojectFromRenderScreen(mt[t],pt[t]))return;E(_.eye,pt[0],pt[1],ut),E(_.eye,pt[1],pt[2],ft),E(_.eye,pt[2],pt[3],dt),E(_.eye,pt[3],pt[0],gt);let M=Number.MAX_VALUE,V=0;const R=I(this.parameters,z)?A.length-2:A.length-5;for(let t=0;t<R;t+=3){K[0]=A[t]+r[12],K[1]=A[t+1]+r[13],K[2]=A[t+2]+r[14];const e=(t+3)%A.length;if(Q[0]=A[e]+r[12],Q[1]=A[e+1]+r[13],Q[2]=A[e+2]+r[14],y(ut,K)<0&&y(ut,Q)<0||y(ft,K)<0&&y(ft,Q)<0||y(dt,K)<0&&y(dt,Q)<0||y(gt,K)<0&&y(gt,Q)<0)continue;const i=_.projectToRenderScreen(K,et),s=_.projectToRenderScreen(Q,it);if(null==i||null==s)continue;if(i[2]<0&&s[2]>0){n(Z,K,Q);const t=_.frustum,e=-y(t[4],K)/o(Z,T(t[4]));if(l(Z,Z,e),h(K,K,Z),!_.projectToRenderScreen(K,i))continue}else if(i[2]>0&&s[2]<0){n(Z,Q,K);const t=_.frustum,e=-y(t[4],Q)/o(Z,T(t[4]));if(l(Z,Z,e),h(Q,Q,Z),!_.projectToRenderScreen(Q,s))continue}else if(i[2]<0&&s[2]<0)continue;i[2]=0,s[2]=0;const a=S(v(i,s,at),O);a<M&&(M=a,c(rt,K),c(st,Q),V=t/3)}if(M<L*L){let t=Number.MAX_VALUE;if(j(v(rt,st,at),v(P,w,nt),$)){n($,$,P);const e=m($);l($,$,1/e),t=e/p(P,w)}g(t,$,V)}}get hasEmissions(){return this.parameters.emissiveStrength>0}createBufferWriter(){return new X(U(this.parameters),this.parameters)}createGLMaterial(t){return new Y(t)}validateParameters(t){"miter"!==t.join&&(t.miterLimit=0),null!=t.markerParameters&&(t.markerScale=t.markerParameters.width/t.width)}update(t){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:r(t.time)},!1),0!==t.dt)}}class Y extends V{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(t){const e=this._material.parameters.stipplePattern;return this._stipplePattern!==e&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(e,this._stipplePattern)}),this._stipplePattern=e),this.getTechnique(D,t)}}class q extends F{constructor(){super(...arguments),this.width=0,this.color=g,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=0,this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=0,this.endTime=1/0,this.fadeInTime=0,this.fadeOutTime=1/0,this.emissiveStrength=0}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}}class X{constructor(t,e){this.layout=t,this._parameters=e;const i=e.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=i;break;case"round":this.numJoinSubdivisions=N+i}}_isClosed(t){return I(this._parameters,t)}allocate(t){return this.layout.createBuffer(t)}elementCount(t){const e=2,i=t.get("position").indices.length/2+1,r=this._isClosed(t);let s=r?2:2*e;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(t,e,i,r,s,n){const o=this.layout,l=i.get("position"),h=l.indices,m=l.data.length/3,f=i.get("distanceToStart")?.data;h&&h.length!==2*(m-1)&&console.warn("RibbonLineMaterial does not support indices");const g=o.fields.has("sizeFeatureAttribute");let b=1,S=null;if(g){const t=i.get("sizeFeatureAttribute");1===t.data.length?b=t.data[0]:S=t.data}else b=i.get("size")?.data[0]??1;let v=[1,1,1,1],P=0,j=null;const E=o.fields.has("colorFeatureAttribute");if(E){const t=i.get("colorFeatureAttribute");1===t.data.length?P=t.data[0]:j=t.data}else v=i.get("color")?.data??v;const w=i.get("timeStamps")?.data,y=w&&o.fields.has("timeStamps"),T=o.fields.has("opacityFeatureAttribute");let z=0,A=null;if(T){const t=i.get("opacityFeatureAttribute");1===t.data.length?z=t.data[0]:A=t.data}const C=new Float32Array(s.buffer),O=_(s.buffer),L=new Uint8Array(s.buffer),V=o.stride/4;let R=n*V;const x=R;let F=0;const N=f?(t,e,i)=>F=f[i]:(t,e,i)=>F+=p(t,e),U=C.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,D=4/U,B=M(),W=(t,e,i,s,a,n,o,l)=>{C[R++]=e[0],C[R++]=e[1],C[R++]=e[2],k(t,e,O,R*U),R+=D,k(i,e,O,R*U),R+=D,C[R++]=l;let h=R*U;if(O[h++]=a,O[h++]=n,R=Math.ceil(h/U),E)C[R]=j?.[o]??P;else{const t=Math.min(4*o,v.length-4),e=4*R;L[e]=255*v[t],L[e+1]=255*v[t+1],L[e+2]=255*v[t+2],L[e+3]=255*v[t+3]}if(R++,C[R++]=S?.[o]??b,T&&(C[R++]=A?.[o]??z),B){let t=4*R;r?(L[t++]=r[0],L[t++]=r[1],L[t++]=r[2],L[t++]=r[3]):(L[t++]=0,L[t++]=0,L[t++]=0,L[t++]=0),R=Math.ceil(.25*t)}y&&(h=R*U,O[h++]=s[0],O[h++]=s[1],O[h++]=s[2],O[h++]=s[3],R=Math.ceil(h/U))};R+=V,a(lt,l.data[0],l.data[1],l.data[2]),y&&d(ct,w[0],w[1],w[2],w[3]),t&&u(lt,lt,t);const J=this._isClosed(i);if(J){const e=l.data.length-3;a(ot,l.data[e],l.data[e+1],l.data[e+2]),t&&u(ot,ot,t)}else a(ht,l.data[3],l.data[4],l.data[5]),t&&u(ht,ht,t),W(lt,lt,ht,ct,1,-4,0,0),W(lt,lt,ht,ct,1,4,0,0),c(ot,lt),c(lt,ht),y&&d(ct,w[4],w[5],w[6],w[7]);const Y=J?0:1,q=J?m:m-1;for(let p=Y;p<q;p++){const e=(p+1)%m*3;a(ht,l.data[e],l.data[e+1],l.data[e+2]),t&&u(ht,ht,t),N(ot,lt,p),W(ot,lt,ht,ct,0,-1,p,F),W(ot,lt,ht,ct,0,1,p,F);const i=this.numJoinSubdivisions;for(let t=0;t<i;++t){const e=(t+1)/(i+1);W(ot,lt,ht,ct,e,-1,p,F),W(ot,lt,ht,ct,e,1,p,F)}if(W(ot,lt,ht,ct,1,-2,p,F),W(ot,lt,ht,ct,1,2,p,F),c(ot,lt),c(lt,ht),y){const t=(p+1)%m*4;d(ct,w[t],w[t+1],w[t+2],w[t+3])}}J?(a(ht,l.data[3],l.data[4],l.data[5]),t&&u(ht,ht,t),F=N(ot,lt,q),W(ot,lt,ht,ct,0,-1,Y,F),W(ot,lt,ht,ct,0,1,Y,F)):(F=N(ot,lt,q),W(ot,lt,lt,ct,0,-5,q,F),W(ot,lt,lt,ct,0,5,q,F)),G(C,x+V,C,x,V);return R=G(C,R-V,C,R,V),this._parameters.wireframe&&this._addWireframeVertices(s,x,R,V),null}_addWireframeVertices(t,e,i,r){const s=new Float32Array(t.buffer,i*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(t.buffer,e*Float32Array.BYTES_PER_ELEMENT,i-e);let n=0;const o=t=>n=G(a,t,s,n,r);for(let l=0;l<a.length-1;l+=2*r)o(l),o(l+2*r),o(l+1*r),o(l+2*r),o(l+1*r),o(l+3*r)}}function G(t,e,i,r,s){for(let a=0;a<s;a++)i[r++]=t[e++];return r}function I(t,e){if(!t.isClosed)return!1;return e.get("position").indices.length>2}function H(t){return 1===t.anchor&&t.hideOnShortSegments&&"begin-end"===t.placement&&t.worldSpace}const K=f(),Q=f(),Z=f(),$=f(),tt=f(),et=i(),it=i(),rt=f(),st=f(),at=P(),nt=P(),ot=f(),lt=f(),ht=f(),ct=b(),mt=[i(),i(),i(),i()],pt=[f(),f(),f(),f()],ut=w(),ft=w(),dt=w(),gt=w();export{q as Parameters,J as RibbonLineMaterial};
|
|
5
|
+
import t from"../../../../core/Logger.js";import{clamp as e}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as r}from"../../../../core/time.js";import{copy as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{h as a,e as n,g as o,j as l,i as h,d as c,b as m,C as p,p as u}from"../../../../chunks/vec32.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as d}from"../../../../chunks/vec42.js";import{ONES as g,create as b}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as _}from"../../../../geometry/support/float16.js";import{distance2 as S,fromPoints as v,create as P,closestLineSegmentPoint as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as E,create as w,signedDistance as y,getNormal as T}from"../../../../geometry/support/plane.js";import{isHighlightOrOID as z,isColor as A,isDepth as C,isColorHighlightOIDOrDepth as O,is2DGeometryOutput as L}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as M}from"../effects/geometry/olidUtils.js";import V from"../lib/GLMaterial.js";import{Material as R}from"../lib/Material.js";import{isTranslationMatrix as x}from"../lib/Util.js";import{VisualVariablePassParameters as F}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as k}from"./internal/bufferWriterUtils.js";import{r as N}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as U,RibbonLineTechnique as D}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as B}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";class J extends R{constructor(t,e){super(t,q),this.produces=new Map([[2,t=>z(t)||A(t)&&8===this.parameters.renderOccluded],[3,t=>C(t)],[11,t=>O(t)&&8===this.parameters.renderOccluded],[12,t=>O(t)&&8===this.parameters.renderOccluded],[4,t=>A(t)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[9,t=>A(t)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[19,t=>L(t)]]),this._configuration=new B(e)}getConfiguration(t,e){super.getConfiguration(t,e,this._configuration),this._configuration.oitPass=e.oitPass,this._configuration.draped=19===e.slot;const i=null!=this.parameters.stipplePattern&&8!==t;return this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&H(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.terrainDepthTest=e.terrainDepthTest&&A(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.hasEmissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration}get visible(){return this.parameters.color[3]>=W||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>W}setParameters(t,e){t.animation=this.parameters.animation,super.setParameters(t,e)}intersectDraped({attributes:t,screenToWorldRatio:i},r,s,a,n){if(!r.options.selectionMode)return;const o=t.get("size");let l=this.parameters.width;if(this.parameters.vvSize){const i=t.get("sizeFeatureAttribute").data[0];Number.isNaN(i)?l*=this.parameters.vvSize.fallback[0]:l*=e(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const h=s[0],c=s[1],m=(l/2+4)*i;let p=Number.MAX_VALUE,u=0;const f=t.get("position").data,d=I(this.parameters,t)?f.length-2:f.length-5;for(let g=0;g<d;g+=3){const t=f[g],i=f[g+1],r=(g+3)%f.length,s=h-t,a=c-i,n=f[r]-t,o=f[r+1]-i,l=e((n*s+o*a)/(n*n+o*o),0,1),m=n*l-s,d=o*l-a,b=m*m+d*d;b<p&&(p=b,u=g/3)}p<m*m&&a(n.distance,n.normal,u)}intersect(i,r,u,f,d,g){const{options:b,camera:_,rayBegin:P,rayEnd:w}=u;if(!b.selectionMode||!i.visible||!_)return;if(!x(r))return void t.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const z=i.attributes,A=z.get("position").data;let C=this.parameters.width;if(this.parameters.vvSize){const t=z.get("sizeFeatureAttribute").data[0];Number.isNaN(t)||(C*=e(this.parameters.vvSize.offset[0]+t*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0]))}else z.has("size")&&(C*=z.get("size").data[0]);const O=tt;s(O,u.point);const L=C*_.pixelRatio/2+4*_.pixelRatio;a(mt[0],O[0]-L,O[1]+L,0),a(mt[1],O[0]+L,O[1]+L,0),a(mt[2],O[0]+L,O[1]-L,0),a(mt[3],O[0]-L,O[1]-L,0);for(let t=0;t<4;t++)if(!_.unprojectFromRenderScreen(mt[t],pt[t]))return;E(_.eye,pt[0],pt[1],ut),E(_.eye,pt[1],pt[2],ft),E(_.eye,pt[2],pt[3],dt),E(_.eye,pt[3],pt[0],gt);let M=Number.MAX_VALUE,V=0;const R=I(this.parameters,z)?A.length-2:A.length-5;for(let t=0;t<R;t+=3){K[0]=A[t]+r[12],K[1]=A[t+1]+r[13],K[2]=A[t+2]+r[14];const e=(t+3)%A.length;if(Q[0]=A[e]+r[12],Q[1]=A[e+1]+r[13],Q[2]=A[e+2]+r[14],y(ut,K)<0&&y(ut,Q)<0||y(ft,K)<0&&y(ft,Q)<0||y(dt,K)<0&&y(dt,Q)<0||y(gt,K)<0&&y(gt,Q)<0)continue;const i=_.projectToRenderScreen(K,et),s=_.projectToRenderScreen(Q,it);if(null==i||null==s)continue;if(i[2]<0&&s[2]>0){n(Z,K,Q);const t=_.frustum,e=-y(t[4],K)/o(Z,T(t[4]));if(l(Z,Z,e),h(K,K,Z),!_.projectToRenderScreen(K,i))continue}else if(i[2]>0&&s[2]<0){n(Z,Q,K);const t=_.frustum,e=-y(t[4],Q)/o(Z,T(t[4]));if(l(Z,Z,e),h(Q,Q,Z),!_.projectToRenderScreen(Q,s))continue}else if(i[2]<0&&s[2]<0)continue;i[2]=0,s[2]=0;const a=S(v(i,s,at),O);a<M&&(M=a,c(rt,K),c(st,Q),V=t/3)}if(M<L*L){let t=Number.MAX_VALUE;if(j(v(rt,st,at),v(P,w,nt),$)){n($,$,P);const e=m($);l($,$,1/e),t=e/p(P,w)}g(t,$,V)}}get hasEmissions(){return this.parameters.emissiveStrength>0}createBufferWriter(){return new X(U(this.parameters),this.parameters)}createGLMaterial(t){return new Y(t)}validateParameters(t){"miter"!==t.join&&(t.miterLimit=0),null!=t.markerParameters&&(t.markerScale=t.markerParameters.width/t.width)}update(t){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:r(t.time)},!1),0!==t.dt)}}class Y extends V{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(t){const e=this._material.parameters.stipplePattern;return this._stipplePattern!==e&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(e,this._stipplePattern)}),this._stipplePattern=e),this.getTechnique(D,t)}}class q extends F{constructor(){super(...arguments),this.width=0,this.color=g,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.hasPolygonOffset=!1,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=0,this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=0,this.endTime=1/0,this.fadeInTime=0,this.fadeOutTime=1/0,this.emissiveStrength=0}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}}class X{constructor(t,e){this.layout=t,this._parameters=e;const i=e.stipplePattern?1:0;switch(this._parameters.join){case"miter":case"bevel":this.numJoinSubdivisions=i;break;case"round":this.numJoinSubdivisions=N+i}}_isClosed(t){return I(this._parameters,t)}allocate(t){return this.layout.createBuffer(t)}elementCount(t){const e=2,i=t.get("position").indices.length/2+1,r=this._isClosed(t);let s=r?2:2*e;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(t,e,i,r,s,n){const o=this.layout,l=i.get("position"),h=l.indices,m=l.data.length/3,f=i.get("distanceToStart")?.data;h&&h.length!==2*(m-1)&&console.warn("RibbonLineMaterial does not support indices");const g=o.fields.has("sizeFeatureAttribute");let b=1,S=null;if(g){const t=i.get("sizeFeatureAttribute");1===t.data.length?b=t.data[0]:S=t.data}else b=i.get("size")?.data[0]??1;let v=[1,1,1,1],P=0,j=null;const E=o.fields.has("colorFeatureAttribute");if(E){const t=i.get("colorFeatureAttribute");1===t.data.length?P=t.data[0]:j=t.data}else v=i.get("color")?.data??v;const w=i.get("timeStamps")?.data,y=w&&o.fields.has("timeStamps"),T=o.fields.has("opacityFeatureAttribute");let z=0,A=null;if(T){const t=i.get("opacityFeatureAttribute");1===t.data.length?z=t.data[0]:A=t.data}const C=new Float32Array(s.buffer),O=_(s.buffer),L=new Uint8Array(s.buffer),V=o.stride/4;let R=n*V;const x=R;let F=0;const N=f?(t,e,i)=>F=f[i]:(t,e,i)=>F+=p(t,e),U=C.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,D=4/U,B=M(),W=(t,e,i,s,a,n,o,l)=>{C[R++]=e[0],C[R++]=e[1],C[R++]=e[2],k(t,e,O,R*U),R+=D,k(i,e,O,R*U),R+=D,C[R++]=l;let h=R*U;if(O[h++]=a,O[h++]=n,R=Math.ceil(h/U),E)C[R]=j?.[o]??P;else{const t=Math.min(4*o,v.length-4),e=4*R;L[e]=255*v[t],L[e+1]=255*v[t+1],L[e+2]=255*v[t+2],L[e+3]=255*v[t+3]}if(R++,C[R++]=S?.[o]??b,T&&(C[R++]=A?.[o]??z),B){let t=4*R;r?(L[t++]=r[0],L[t++]=r[1],L[t++]=r[2],L[t++]=r[3]):(L[t++]=0,L[t++]=0,L[t++]=0,L[t++]=0),R=Math.ceil(.25*t)}y&&(h=R*U,O[h++]=s[0],O[h++]=s[1],O[h++]=s[2],O[h++]=s[3],R=Math.ceil(h/U))};R+=V,a(lt,l.data[0],l.data[1],l.data[2]),y&&d(ct,w[0],w[1],w[2],w[3]),t&&u(lt,lt,t);const J=this._isClosed(i);if(J){const e=l.data.length-3;a(ot,l.data[e],l.data[e+1],l.data[e+2]),t&&u(ot,ot,t)}else a(ht,l.data[3],l.data[4],l.data[5]),t&&u(ht,ht,t),W(lt,lt,ht,ct,1,-4,0,0),W(lt,lt,ht,ct,1,4,0,0),c(ot,lt),c(lt,ht),y&&d(ct,w[4],w[5],w[6],w[7]);const Y=J?0:1,q=J?m:m-1;for(let p=Y;p<q;p++){const e=(p+1)%m*3;a(ht,l.data[e],l.data[e+1],l.data[e+2]),t&&u(ht,ht,t),N(ot,lt,p),W(ot,lt,ht,ct,0,-1,p,F),W(ot,lt,ht,ct,0,1,p,F);const i=this.numJoinSubdivisions;for(let t=0;t<i;++t){const e=(t+1)/(i+1);W(ot,lt,ht,ct,e,-1,p,F),W(ot,lt,ht,ct,e,1,p,F)}if(W(ot,lt,ht,ct,1,-2,p,F),W(ot,lt,ht,ct,1,2,p,F),c(ot,lt),c(lt,ht),y){const t=(p+1)%m*4;d(ct,w[t],w[t+1],w[t+2],w[t+3])}}J?(a(ht,l.data[3],l.data[4],l.data[5]),t&&u(ht,ht,t),F=N(ot,lt,q),W(ot,lt,ht,ct,0,-1,Y,F),W(ot,lt,ht,ct,0,1,Y,F)):(F=N(ot,lt,q),W(ot,lt,lt,ct,0,-5,q,F),W(ot,lt,lt,ct,0,5,q,F)),G(C,x+V,C,x,V);return R=G(C,R-V,C,R,V),this._parameters.wireframe&&this._addWireframeVertices(s,x,R,V),null}_addWireframeVertices(t,e,i,r){const s=new Float32Array(t.buffer,i*Float32Array.BYTES_PER_ELEMENT),a=new Float32Array(t.buffer,e*Float32Array.BYTES_PER_ELEMENT,i-e);let n=0;const o=t=>n=G(a,t,s,n,r);for(let l=0;l<a.length-1;l+=2*r)o(l),o(l+2*r),o(l+1*r),o(l+2*r),o(l+1*r),o(l+3*r)}}function G(t,e,i,r,s){for(let a=0;a<s;a++)i[r++]=t[e++];return r}function I(t,e){if(!t.isClosed)return!1;return e.get("position").indices.length>2}function H(t){return 1===t.anchor&&t.hideOnShortSegments&&"begin-end"===t.placement&&t.worldSpace}const K=f(),Q=f(),Z=f(),$=f(),tt=f(),et=i(),it=i(),rt=f(),st=f(),at=P(),nt=P(),ot=f(),lt=f(),ht=f(),ct=b(),mt=[i(),i(),i(),i()],pt=[f(),f(),f(),f()],ut=w(),ft=w(),dt=w(),gt=w();export{q as Parameters,J 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{h as e,j as t,i as r,n as s}from"../../../../chunks/vec32.js";import{fromValues as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as o,scale as p}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{isColorOrOID as h,isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import u from"../lib/GLMaterial.js";import{Material as f,MaterialParameters as m}from"../lib/Material.js";import{intersectTriangleGeometry as g}from"../lib/RayIntersections.js";import{assert as d}from"../lib/Util.js";import{writeAttributes as b,writePosition as _}from"./internal/bufferWriterUtils.js";import{getLayout as S,ShadedColorMaterialTechnique as j}from"../shaders/ShadedColorMaterialTechnique.js";import{ShadedColorMaterialTechniqueConfiguration as w}from"../shaders/ShadedColorMaterialTechniqueConfiguration.js";import{alphaCutoff as T}from"../../../../webscene/support/AlphaCutoff.js";class x extends f{constructor(e){super(e,D),this._configuration=new w,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,e=>8===e||h(e)&&!this.parameters.transparent],[4,e=>h(e)&&this.parameters.transparent&&this.parameters.writeDepth],[9,e=>h(e)&&this.parameters.transparent&&!this.parameters.writeDepth]])}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),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.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest&&l(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}get visible(){return this.parameters.color[3]>=T}intersect(e,t,r,s,i,a){this._intersect(e,r,s,i,a)}intersectDraped(e,t,r,s){return this._pp0[0]=this._pp1[0]=r[0],this._pp0[1]=this._pp1[1]=r[1],this._intersect(e,t,this._pp0,this._pp1,s)}_intersect(s,i,a,n,c){if(this.parameters.screenSizeEnabled){const h=s.attributes.get("offset"),l={applyToVertex:(s,a,n,o)=>{const p=e(E,h.data[3*o],h.data[3*o+1],h.data[3*o+2]),c=e(M,s,a,n);return t(p,p,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(p)??1)),r(c,c,p),[c[0],c[1],c[2]]},applyToAabb:e=>{const t=o(e,E);return p(e,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(t)??1))}};g(s,i,a,n,l,c)}else g(s,i,a,n,void 0,c)}createGLMaterial(e){return new z(e)}createBufferWriter(){return new y(S(this.parameters))}}class z extends u{beginSlot(e){return this.getTechnique(j,e)}}class D extends m{constructor(){super(...arguments),this.color=n(1,1,1,1),this.shadingTint=n(0,0,0,.25),this.shadingDirection=s(a(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=0,this.screenSizeEnabled=!1,this.shadingEnabled=!0}get transparent(){return this.color[3]<1||this.forceTransparentMode}}class y{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,s,i,a){const n=b(r,s,this.layout,e,t,i,a),o=i.getField("offset",c);if(o&&r.has("offset")){const e=r.get("offset");d(3===e.size),_(e,t,o,a)}return n}}const E=a(),M=a();export{D as Parameters,x as ShadedColorMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{InstancedDoubleConfiguration as e}from"../core/shaderLibrary/attributes/InstancedDoubleConfiguration.js";import t from"../lib/GLMaterial.js";import{DefaultBufferWriter as i}from"./DefaultBufferWriter.js";import{PositionUvLayout as s}from"./DefaultLayouts.js";import{TriangleMaterial as o}from"./TriangleMaterial.js";import{SlicePlaneMaterialPassParameters as a,SlicePlaneMaterialTechnique as n}from"../shaders/SlicePlaneMaterialTechnique.js";class u extends o{constructor(t){super(t,f),this.visible=!0,this.produces=new Map([[
|
|
5
|
+
import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{InstancedDoubleConfiguration as e}from"../core/shaderLibrary/attributes/InstancedDoubleConfiguration.js";import t from"../lib/GLMaterial.js";import{DefaultBufferWriter as i}from"./DefaultBufferWriter.js";import{PositionUvLayout as s}from"./DefaultLayouts.js";import{TriangleMaterial as o}from"./TriangleMaterial.js";import{SlicePlaneMaterialPassParameters as a,SlicePlaneMaterialTechnique as n}from"../shaders/SlicePlaneMaterialTechnique.js";class u extends o{constructor(t){super(t,f),this.visible=!0,this.produces=new Map([[9,e=>r(e)]]),this._configuration=new e}createGLMaterial(r){return new c(r)}createBufferWriter(){return new i(s)}getConfiguration(){return this._configuration}}class c extends t{constructor(r){super(r)}beginSlot(r){return this.getTechnique(n,r)}}class f extends a{constructor(){super(...arguments),this.renderOccluded=1,this.isDecoration=!1}}export{f as Parameters,u 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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as a,isHighlightOrOID as s}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as o}from"../effects/geometry/olidUtils.js";import{MaterialParameters as n}from"../lib/Material.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{PositionUvf32OlidLayout as c,PositionUvf32Layout as l}from"./DefaultLayouts.js";import{TriangleMaterial as f}from"./TriangleMaterial.js";import{WaterGLMaterial as m}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as p}from"./WaterTechniqueConfiguration.js";class u extends f{constructor(t,e){super(t,d),this.visible=!0,this.produces=new Map([[2,t=>a(t)&&!this.parameters.transparent||s(t)],[4,t=>a(t)&&this.parameters.transparent||s(t)],[
|
|
5
|
+
import"../../../../core/has.js";import{secondsFromMilliseconds as t}from"../../../../core/time.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as a,isHighlightOrOID as s}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as o}from"../effects/geometry/olidUtils.js";import{MaterialParameters as n}from"../lib/Material.js";import{DefaultBufferWriter as h}from"./DefaultBufferWriter.js";import{PositionUvf32OlidLayout as c,PositionUvf32Layout as l}from"./DefaultLayouts.js";import{TriangleMaterial as f}from"./TriangleMaterial.js";import{WaterGLMaterial as m}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as p}from"./WaterTechniqueConfiguration.js";class u extends f{constructor(t,e){super(t,d),this.visible=!0,this.produces=new Map([[2,t=>a(t)&&!this.parameters.transparent||s(t)],[4,t=>a(t)&&this.parameters.transparent||s(t)],[19,t=>this.parameters.draped&&a(t)||2===t||s(t)],[20,t=>2===t]]),this._configuration=new p(e.spherical)}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.writeDepth=!0,this._configuration.receiveShadows=a(t)&&e.shadowMap.enabled,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.screenSpaceReflections=null!=e.ssr.lastFrameColor,this._configuration.cloudReflections=null!=e.clouds.data,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=e.oitPass,this._configuration.enableOffset=e.enableOffset,this._configuration.terrainDepthTest=e.terrainDepthTest&&a(t),this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration}update(e){return this.setParameters({timeElapsed:t(e.time)*this.parameters.animationSpeed},!1),this._animationEnabled(e.camera)&&e.dt>0}_animationEnabled(t){const e=Math.min(t.relativeElevation,t.distance);return Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*e<g}createGLMaterial(t){return new m(t)}createBufferWriter(){return new h(o()?c:l)}get test(){}}class d extends n{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=e(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=i(0,0,0,0),this.transparent=!0,this.hasSlicePlane=!1,this.draped=!1,this.origin=r(),this.modelTransformation=null}}const g=35e3;export{d as Parameters,u as WaterMaterial};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{property as i,subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{GLMaterials as r}from"../../lib/GLMaterials.js";import{DrawParameters as n}from"../DrawParameters.js";import{defaultHighlightName as o}from"../../../../support/HighlightDefaults.js";let h=class extends e{constructor(t){super(t),this._glMaterials=null,this._drawParameters=new n,this._highlightNames=new Set,this._produces=new Map}initialize(){this._updateProduces()}destroy(){this.uninitializeRenderContext()}get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(t){return this._highlightNames.has(t)}get produces(){return this._produces}_updateProduces(){this.material.produces.forEach((t,e)=>{this._produces.set(e,e=>!(0===this.dataByBaseInstance.size||!(8!==e&&4!==e||this._hasHighlights))&&t(e))})}initializeRenderContext(t){this._glMaterials=new r(this.material,t.materials)}uninitializeRenderContext(){this._glMaterials=s(this._glMaterials)}acquireTechniques(t){if(!this.material.shouldRender(t))return null;const{output:e,bind:s}=t,i=this.material.produces.get(s.slot);if(!i?.(e))return null;const{highlight:a,slot:r}=s,n=4===e,h=8===e,l=h||n,d=a?.name;if(l&&(0===this._highlightNames.size||h&&d&&!this._highlightNames.has(d)))return null;const u=t=>h&&!!d&&!t.has(d),c=5===e,g=!(l||c);for(const m of this.dataByBaseInstance.values())for(const i of m.dataByOrigin.values())for(const a of i.buffers){if(u(a.highlightNames))continue;const i=n?a.drawCommandsHighlights.get(o):l?d?a.drawCommandsHighlights.get(d):a.drawCommandsHighlights.size>0:((c&&a.needsMultipleCommands?a.drawCommandsShadowHighlightRest:a.drawCommandsDefault)||null)?.length??!1,h=g&&a.drawCommandsOccludees||null;if(i||h?.length){const i=this._glMaterials.load(t.rctx,r,e),a=i?.beginSlot(s);if(a)return a}}return null}render(t,e){const{output:s,bind:i}=t,{
|
|
5
|
+
import{__decorate as t}from"tslib";import e from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{property as i,subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{GLMaterials as r}from"../../lib/GLMaterials.js";import{DrawParameters as n}from"../DrawParameters.js";import{defaultHighlightName as o}from"../../../../support/HighlightDefaults.js";let h=class extends e{constructor(t){super(t),this._glMaterials=null,this._drawParameters=new n,this._highlightNames=new Set,this._produces=new Map}initialize(){this._updateProduces()}destroy(){this.uninitializeRenderContext()}get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(t){return this._highlightNames.has(t)}get produces(){return this._produces}_updateProduces(){this.material.produces.forEach((t,e)=>{this._produces.set(e,e=>!(0===this.dataByBaseInstance.size||!(8!==e&&4!==e||this._hasHighlights))&&t(e))})}initializeRenderContext(t){this._glMaterials=new r(this.material,t.materials)}uninitializeRenderContext(){this._glMaterials=s(this._glMaterials)}acquireTechniques(t){if(!this.material.shouldRender(t))return null;const{output:e,bind:s}=t,i=this.material.produces.get(s.slot);if(!i?.(e))return null;const{highlight:a,slot:r}=s,n=4===e,h=8===e,l=h||n,d=a?.name;if(l&&(0===this._highlightNames.size||h&&d&&!this._highlightNames.has(d)))return null;const u=t=>h&&!!d&&!t.has(d),c=5===e,g=!(l||c);for(const m of this.dataByBaseInstance.values())for(const i of m.dataByOrigin.values())for(const a of i.buffers){if(u(a.highlightNames))continue;const i=n?a.drawCommandsHighlights.get(o):l?d?a.drawCommandsHighlights.get(d):a.drawCommandsHighlights.size>0:((c&&a.needsMultipleCommands?a.drawCommandsShadowHighlightRest:a.drawCommandsDefault)||null)?.length??!1,h=g&&a.drawCommandsOccludees||null;if(i||h?.length){const i=this._glMaterials.load(t.rctx,r,e),a=i?.beginSlot(s);if(a)return a}}return null}render(t,e){const{output:s,bind:i}=t,{highlight:a}=i,r=8===s,n=a?.name??"";if(r&&!a)return;const h=4===s,g=r||h,m=5===s,w=!(g||m),{rctx:_}=t;_.runAppleAmdDriverHelper();const C=_.bindTechnique(e,i,this.material.parameters);for(const b of this.dataByBaseInstance.values()){const{baseInstanceData:t}=b,s=null!=t,a=s?c:u,y=s?d:l;for(const l of b.dataByOrigin.values()){this._drawParameters.origin=l.origin;for(const s of l.buffers){if(r&&(!s.hasHighlights||!s.drawCommandsHighlights.has(n)))continue;if(h&&(!s.hasHighlights||!s.drawCommandsHighlights.has(o)))continue;const l=y(s),d=f(l,s.needsMultipleCommands,n,h,g,m),u=p(l,w);(d?.length||u?.length)&&(C.bindDraw(i,this.material.parameters,this._drawParameters),a(_,s,t,e,d,u,i))}}}}updateHighlights(){const{_highlightNames:t}=this;t.clear();for(const e of this.dataByBaseInstance.values())for(const s of e.dataByOrigin.values())for(const e of s.buffers)for(const s of e.highlightNames)t.add(s);this._updateProduces()}get test(){}};t([i({constructOnly:!0})],h.prototype,"material",void 0),t([i({constructOnly:!0})],h.prototype,"dataByBaseInstance",void 0),h=t([a("esri.views.3d.webgl-engine.materials.renderers.VaoRenderer")],h);const l=t=>t,d=t=>t.instancedCommandVAOs,u=(t,{vao:e},s,i,a,r,n)=>{i.ensureAttributeLocations(e),t.bindVAO(e),g(t,i,a,n,!1),g(t,i,r,n,!0)},c=(t,e,{baseCommand:s},i,a,r,n)=>{m(t,i,s,a,n,!1),m(t,i,s,r,n,!0)};function g(t,e,s,i,a){if(s?.length){t.setPipelineState(e.getPipeline(i,a));for(const i of s)t.drawArrays(e.primitiveType,i.first,i.count)}}function m(t,e,{first:s,count:i},a,r,n){if(a?.length){t.setPipelineState(e.getPipeline(r,n));for(const{vao:r,instanceCount:n}of a)e.ensureAttributeLocations(r),t.bindVAO(r),t.drawArraysInstanced(e.primitiveType,s,i,n)}}function f(t,e,s,i,a,r){const n=a&&!i?t.drawCommandsHighlights.get(s)??null:null;return i?t.drawCommandsHighlights.get(o):a?n:r&&e?t.drawCommandsShadowHighlightRest:t.drawCommandsDefault}function p(t,e){return e&&t.drawCommandsOccludees||null}export{h as VaoRenderer};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{nextHighestPowerOfTwo as t}from"../../../../../core/mathUtils.js";import{copy as e,invert as r,transpose as a}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as
|
|
5
|
+
import{nextHighestPowerOfTwo as t}from"../../../../../core/mathUtils.js";import{copy as e,invert as r,transpose as a}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as n}from"../../../support/buffer/glUtil.js";import{assert as o}from"../../lib/Util.js";import{VertexArrayObject as i}from"../../lib/VertexArrayObject.js";import{DrawCommand as f}from"./DrawCommand.js";import{BaseInstanceData as u}from"./PerBaseInstanceData.js";import{VertexBuffer as c}from"../../../../webgl/VertexBuffer.js";class l{constructor(t,e){this._rctx=e,this._bufferWriter=t.createBufferWriter(),this._vaoCache=e.getVaoCache(n(this._bufferWriter.layout))}maxElements(t){return Math.floor(b/this._targetStrideBytes(t))}_targetStrideBytes(t){return this._targetLayout(t)?.stride??0}_targetLayout(t){return"geometry"===t?this._bufferWriter.layout:this._bufferWriter.instanceLayout}endElement(t){return Math.floor((t.vao?.getByteLength(t.targetBuffer)??0)/this._targetStrideBytes(t.targetBuffer))}evaluateBufferAllocation(t,e,r,a){const s=this._targetStrideBytes(a.targetBuffer),n=e.reduce((t,{geometry:e})=>t+this.elementCount(e),0),o=r.reduce((t,{geometry:e})=>t+this.elementCount(e),0),i=Math.min((t+n-o)*s,b),f=a.vao?.buffer(a.targetBuffer),u=f?.sizeBytes??0;return i>h&&i<u/2?0:i>u?1:2}deleteBuffer(t){if("instances"===t.targetBuffer)return t.instancedCommandVAOs?.dispose(),t.vao?.buffer("instances")?.dispose(),t.vao?.disposeVAOOnly(),void(t.vao=null);this._vaoCache.deleteVao(t.vao)}createBaseInstanceData(t){const{_bufferWriter:e}=this;if(null==t||null==e.writeBaseInstance||null==e.elementCountBaseInstance)return null;const r=e.layout,a=e.elementCountBaseInstance(t.attributes),s=a*this._targetStrideBytes("geometry"),o=new c(this._rctx,n(r));o.setSize(Math.ceil(s));const i=B(s),l=r.createView(i.buffer);e.writeBaseInstance(t.attributes,l),o.setSubData(i,0,0,s);const m=new f;return m.first=0,m.count=a,new u(t,o,m)}_allocateInstanceBuffer(t){const e=this._bufferWriter.instanceLayout;o(null!=e,"Trying to allocate an instance buffer, but the BufferWriter does not support instancing");const r=t*this._targetStrideBytes("instances"),a=new c(this._rctx,n(e,1));return a.setSize(d(r)),a}_createInstancedVao(t,e){return new i(this._rctx,new Map([["geometry",t],["instances",e]]))}reallocateBuffer(t,e,r){if(this.deleteBuffer(e),null!=t){const e=t.baseInstanceBuffer,a=this._allocateInstanceBuffer(r);return this._createInstancedVao(e,a)}const a=r*this._targetStrideBytes("geometry");return this._vaoCache.newVao(d(a))}elementCount(t){return this._bufferWriter.elementCount(t.attributes)}canGrow(t,e){const{targetBuffer:r,vao:a}=t;if(null==a)return!0;const s=e*this._targetStrideBytes(r);return a.getByteLength(r)<d(b-h)&&s>a.getByteLength(r)}clearHoles(t,{vao:e,targetBuffer:r}){const a=this._targetStrideBytes(r),s=t.reduce((t,e)=>Math.max(t,e.numElements),0)*a,n=B(s);n.fill(0,0,s);const o=e.buffer(r);for(const i of t)o?.setSubData(n,i.from*a,0,i.numElements*a)}clearHolesMetal(t,e,r,{vao:a,targetBuffer:s}){const n=this._targetStrideBytes(s),o=(r-e)*n,i=B(o),f=this._targetLayout(s).createView(i.buffer);i.fill(0,0,o);for(const u of t){if(!(u.from>=e&&u.to<=r))continue;const t=u.from-e;this._writeGeometry(u.geometry,f,t)}a.buffer(s)?.setSubData(i,e*n,0,o)}writeRandomInstances(t,e,{vao:r,targetBuffer:a}){const s=this._targetStrideBytes(a),n=B(t*s),o=this._targetLayout(a).createView(n.buffer);let i=0,f=0,u=0;const c=r.buffer(a);for(const m of e){if(!(u===m.from)){const t=u-f;t>0&&c?.setSubData(n,f*s,0,t*s),f=m.from,i=0}this._writeGeometry(m.geometry,o,i),i+=m.numElements,u=m.to}const l=u-f;l>0&&c?.setSubData(n,f*s,0,l*s)}writeInstanceRangeMetal(t,e,r,{vao:a,targetBuffer:s}){const n=this._targetStrideBytes(s),o=t-e,i=o*n,f=B(i),u=this._targetLayout(s).createView(f.buffer);f.fill(0,0,i);for(const c of r){if(!(c.from>=e&&c.to<=t))continue;const r=c.from-e;this._writeGeometry(c.geometry,u,r)}o>0&&a.buffer(s)?.setSubData(f,e*n,0,i)}rebuildInstances(t,e,{vao:r,targetBuffer:a}){const s=this._targetStrideBytes(a),n=B(t*s),o=this._targetLayout(a).createView(n.buffer);let i=0;for(const f of e){this._writeGeometry(f.geometry,o,i);const t=i;i+=this.elementCount(f.geometry.geometry),f.from=t,f.to=i}return r?.buffer(a)?.setSubData(n,0,0,i*s),i}updateInstance(t,{vao:e,targetBuffer:r}){const{_bufferWriter:a}=this,s=this._targetStrideBytes(r),n=B(a.elementCount(t.geometry.geometry.attributes)*s),o=this._targetLayout(r).createView(n.buffer);this._writeGeometry(t.geometry,o,0),e.buffer(r)?.setSubData(n,t.from*s,0,t.numElements*s)}updateInstancesMetal(t){for(const[e,r]of t){let t=1/0,a=-1/0;for(const e of r)t=Math.min(t,e.from),a=Math.max(a,e.to);this.writeInstanceRangeMetal(a,t,e.instances.values(),e)}}_writeGeometry(t,s,n){const{_bufferWriter:o}=this;null!=o&&(e(m,t.transformation),m[12]-=t.localOrigin.vec3[0],m[13]-=t.localOrigin.vec3[1],m[14]-=t.localOrigin.vec3[2],r(g,m),a(g,g),o.write(m,g,t.geometry.attributes,t.geometry.olidColor,s,n))}static prune(){_=new Uint8Array(h)}}const m=s(),g=s(),h=262144,y=1024,b=16777216;let _=new Uint8Array(h);function B(t){return _.byteLength<t&&(_=new Uint8Array(t)),_}function d(e){return e<=y?y:e<h?t(e):Math.max(Math.min(Math.ceil(1.5*e/h)*h,b),e)}export{l as VaoWriter};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as a}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as c,depthWrite as p,depthTest as u,blending as m,drawBuffers as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as d,stencilBaseAllZerosParams as h,stencilWriteMaskOn as g}from"../lib/StencilUtils.js";import{VisualVariablePassParameters as j}from"../materials/VisualVariablePassParameters.js";import{C as b}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as P,defaultColorWrite as S,cullingParams as T}from"../../../webgl/renderState.js";class v extends j{constructor(){super(...arguments),this.color=t}}let y=class extends l{constructor(e,r){super(e,r,w(r).locations),this.shader=new s(b,()=>import("./ColorMaterial.glsl.js"))}_createPipeline(e,r){const{oitPass:t,output:o,hasEmission:s,transparent:l,cullFace:a,draped:j,hasOccludees:b,polygonOffset:v}=e,y=0===t;return P({blending:i(o)&&l?m(t):null,culling:T(a),depthTest:j?null:u(t),depthWrite:p(e),drawBuffers:n(o,f(t,s)),colorWrite:S,stencilWrite:b?g:null,stencilTest:b?r?d:h:null,polygonOffset:y?v?C:null:c(e)})}initializePipeline(e){return this._occludeePipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}getPipeline(e){return
|
|
5
|
+
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as l,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as a}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as c,depthWrite as p,depthTest as u,blending as m,drawBuffers as f}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as d,stencilBaseAllZerosParams as h,stencilWriteMaskOn as g}from"../lib/StencilUtils.js";import{VisualVariablePassParameters as j}from"../materials/VisualVariablePassParameters.js";import{C as b}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as P,defaultColorWrite as S,cullingParams as T}from"../../../webgl/renderState.js";class v extends j{constructor(){super(...arguments),this.color=t}}let y=class extends l{constructor(e,r){super(e,r,w(r).locations),this.shader=new s(b,()=>import("./ColorMaterial.glsl.js"))}_createPipeline(e,r){const{oitPass:t,output:o,hasEmission:s,transparent:l,cullFace:a,draped:j,hasOccludees:b,polygonOffset:v}=e,y=0===t;return P({blending:i(o)&&l?m(t):null,culling:T(a),depthTest:j?null:u(t),depthWrite:p(e),drawBuffers:n(o,f(t,s)),colorWrite:S,stencilWrite:b?g:null,stencilTest:b?r?d:h:null,polygonOffset:y?v?C:null:c(e)})}initializePipeline(e){return this._occludeePipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}getPipeline(e,r){return r?this._occludeePipelineState:super.getPipeline(e)}};y=e([r("esri.views.3d.webgl-engine.shaders.ColorMaterialTechnique")],y);const C={factor:1,units:1};function w(e){const r=o().vec3f("position");return a()&&r.vec4u8("olidColor"),e.hasVVColor?r.f32("colorFeatureAttribute"):r.vec4u8("color"),r.freeze()}export{v as ColorMaterialPassParameters,y as ColorMaterialTechnique,w as getLayout};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as i,freeze as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as n}from"../../support/buffer/InterleavedLayout.js";import{isColor as a}from"../core/shaderLibrary/ShaderOutput.js";import{VertexNormalPassParameters as c,VertexNormalDrawParameters as h}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as u}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as p,depthOnlyOutputBuffersOr as m}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as d}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as f,depthWrite as v,depthTest as b,blending as g,drawBuffers as S}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as y,stencilBaseAllZerosParams as j,stencilWriteMaskOn as x}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as C}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as P}from"../materials/pbrUtils.js";import{D as T}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as O,cullingParams as w,defaultColorWrite as D}from"../../../webgl/renderState.js";import{fromLayouts as V}from"../../../webgl/VertexAttributeLocations.js";import{alphaCutoff as A}from"../../../../webscene/support/AlphaCutoff.js";class M extends c{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=P,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=i,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=s(.2,.2,.2),this.diffuse=s(.8,.8,.8),this.externalColor=o(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=A,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class k extends h{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let z=class extends p{constructor(e,t){const i=[l(R(t))];t.instanced&&t.instancedDoublePrecision&&i.push(l(C(t))),super(e,t,V(i)),this.shader=new u(T,()=>import("./DefaultMaterial.glsl.js"))}_makePipeline(e,t){const{oitPass:i,output:s,hasEmission:r,transparent:o,cullFace:l,customDepthTest:n,hasOccludees:c}=e;return O({blending:a(s)&&o?g(i):null,culling:L(e)?w(l):null,depthTest:b(i,F(n)),depthWrite:v(e),drawBuffers:m(s,S(i,r)),colorWrite:D,stencilWrite:c?x:null,stencilTest:c?t?y:j:null,polygonOffset:f(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return
|
|
5
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as i,freeze as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as n}from"../../support/buffer/InterleavedLayout.js";import{isColor as a}from"../core/shaderLibrary/ShaderOutput.js";import{VertexNormalPassParameters as c,VertexNormalDrawParameters as h}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as u}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as p,depthOnlyOutputBuffersOr as m}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as d}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as f,depthWrite as v,depthTest as b,blending as g,drawBuffers as S}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as y,stencilBaseAllZerosParams as j,stencilWriteMaskOn as x}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as C}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as P}from"../materials/pbrUtils.js";import{D as T}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as O,cullingParams as w,defaultColorWrite as D}from"../../../webgl/renderState.js";import{fromLayouts as V}from"../../../webgl/VertexAttributeLocations.js";import{alphaCutoff as A}from"../../../../webscene/support/AlphaCutoff.js";class M extends c{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=P,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=i,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=s(.2,.2,.2),this.diffuse=s(.8,.8,.8),this.externalColor=o(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=A,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class k extends h{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let z=class extends p{constructor(e,t){const i=[l(R(t))];t.instanced&&t.instancedDoublePrecision&&i.push(l(C(t))),super(e,t,V(i)),this.shader=new u(T,()=>import("./DefaultMaterial.glsl.js"))}_makePipeline(e,t){const{oitPass:i,output:s,hasEmission:r,transparent:o,cullFace:l,customDepthTest:n,hasOccludees:c}=e;return O({blending:a(s)&&o?g(i):null,culling:L(e)?w(l):null,depthTest:b(i,F(n)),depthWrite:v(e),drawBuffers:m(s,S(i,r)),colorWrite:D,stencilWrite:c?x:null,stencilTest:c?t?y:j:null,polygonOffset:f(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function F(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function L(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function R(e){const t=n().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&d()&&t.vec4u8("olidColor"),t}z=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],z);export{k as DefaultMaterialDrawParameters,M as DefaultMaterialPassParameters,z as DefaultMaterialTechnique,R as getLayout};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/libs/gl-matrix-2/
|
|
5
|
+
import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/NormalUtils.glsl.js";import"../core/shaderLibrary/shading/TerrainDepthTest.glsl.js";import"../core/shaderLibrary/util/ComputeCovariance.glsl.js";import"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float3BindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/IntegerPassUniform.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DUintPassUniform.js";import"./GaussianSplatTechniqueConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{G as GaussianSplatPassParameters,b as build}from"../../../../chunks/GaussianSplat.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{ShaderTechniqueConfiguration as e,parameter as
|
|
5
|
+
import{__decorate as t}from"tslib";import{ShaderTechniqueConfiguration as e,parameter as i}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class o extends e{constructor(t,e=!1){super(),this.spherical=t,this.depthPass=e,this.alphaCutoff=1,this.fadingEnabled=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.receiveAmbientOcclusion=!1,this.pbrMode=0,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!0}}function r(t){switch(t){case 2:return.005;case 0:return.05;default:return.01}}t([i({count:3})],o.prototype,"alphaCutoff",void 0),t([i()],o.prototype,"fadingEnabled",void 0),t([i()],o.prototype,"terrainDepthTest",void 0),t([i()],o.prototype,"cullAboveTerrain",void 0),t([i()],o.prototype,"receiveAmbientOcclusion",void 0);export{o as GaussianSplatTechniqueConfiguration,r as getGaussianSplatAlphaCutoffValue};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{oitPolygonOffset as l,drawBuffers as o,depthWrite as n,depthTest as a,blending as p}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as c,stencilBaseAllZerosParams as u,stencilWriteMaskOn as m}from"../lib/StencilUtils.js";import{PositionUvLayout as d}from"../materials/DefaultLayouts.js";import{I as h}from"../../../../chunks/ImageMaterial.glsl.js";import{makePipelineState as f,defaultColorWrite as g,cullingParams as j}from"../../../webgl/renderState.js";let P=class extends s{constructor(e,t){super(e,t,S(t).locations),this.shader=new i(h,()=>import("./ImageMaterial.glsl.js"))}_getPipelineState(e,t){const{oitPass:i,output:s,hasEmission:d,hasOccludees:h,cullFace:P}=e;return f({blending:r(s)?p(i,!0):null,culling:j(P),depthTest:a(i),depthWrite:n(e),drawBuffers:o(i,d),colorWrite:g,stencilWrite:h?m:null,stencilTest:h?t?c:u:null,polygonOffset:l(e)})}initializePipeline(e){return this._occludeePipeline=this._getPipelineState(e,!0),this._getPipelineState(e,!1)}getPipeline(e){return
|
|
5
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{oitPolygonOffset as l,drawBuffers as o,depthWrite as n,depthTest as a,blending as p}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as c,stencilBaseAllZerosParams as u,stencilWriteMaskOn as m}from"../lib/StencilUtils.js";import{PositionUvLayout as d}from"../materials/DefaultLayouts.js";import{I as h}from"../../../../chunks/ImageMaterial.glsl.js";import{makePipelineState as f,defaultColorWrite as g,cullingParams as j}from"../../../webgl/renderState.js";let P=class extends s{constructor(e,t){super(e,t,S(t).locations),this.shader=new i(h,()=>import("./ImageMaterial.glsl.js"))}_getPipelineState(e,t){const{oitPass:i,output:s,hasEmission:d,hasOccludees:h,cullFace:P}=e;return f({blending:r(s)?p(i,!0):null,culling:j(P),depthTest:a(i),depthWrite:n(e),drawBuffers:o(i,d),colorWrite:g,stencilWrite:h?m:null,stencilTest:h?t?c:u:null,polygonOffset:l(e)})}initializePipeline(e){return this._occludeePipeline=this._getPipelineState(e,!0),this._getPipelineState(e,!1)}getPipeline(e,t){return t?this._occludeePipeline:super.getPipeline(e)}};function S(e){let t=d;return e.perspectiveInterpolation&&(t=t.clone().f32("perspectiveDivide")),t}P=e([t("esri.views.3d.webgl-engine.shaders.ImageMaterialTechnique")],P);export{P as ImageMaterialTechnique,S as getLayout};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as l}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as o,depthTest as c,blending as p,drawBuffers as a}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as d,stencilWriteMaskOn as h,stencilToolTransparentOccluderParams as f,depthCompareAlways as m,stencilToolMaskOccluderParams as P,stencilWriteMaskOff as T,depthCompareLess as b}from"../lib/StencilUtils.js";import{L as g}from"../../../../chunks/LineMarker.glsl.js";import{makePipelineState as W,defaultColorWrite as _,unpremultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";let j=class extends s{constructor(e,t){super(e,t,k(t).locations),this.shader=new l(g,()=>import("./LineMarker.glsl.js"))}_makePipelineState(e,t){const{output:i,hasEmission:l,oitPass:s,space:f,hasOccludees:m}=e;return W({blending:r(i)?p(s):null,depthTest:0===f?null:c(s),depthWrite:o(e),drawBuffers:n(i,a(s,l)),colorWrite:_,stencilWrite:m?h:null,stencilTest:m?t?u:d:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=W({blending:S,depthTest:m,depthWrite:null,colorWrite:_,stencilWrite:null,stencilTest:f}),this._occluderPipelineOpaque=W({blending:S,depthTest:m,depthWrite:null,colorWrite:_,stencilWrite:T,stencilTest:P}),this._occluderPipelineMaskWrite=W({blending:null,depthTest:b,depthWrite:null,colorWrite:null,stencilWrite:h,stencilTest:u})):this._occluderPipelineTransparent=this._occluderPipelineOpaque=this._occluderPipelineMaskWrite=null,this._occludeePipelineState=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){return
|
|
5
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{newLayout as i}from"../../support/buffer/InterleavedLayout.js";import{isColor as r}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as l}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s,depthOnlyOutputBuffersOr as n}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as o,depthTest as c,blending as p,drawBuffers as a}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as u,stencilBaseAllZerosParams as d,stencilWriteMaskOn as h,stencilToolTransparentOccluderParams as f,depthCompareAlways as m,stencilToolMaskOccluderParams as P,stencilWriteMaskOff as T,depthCompareLess as b}from"../lib/StencilUtils.js";import{L as g}from"../../../../chunks/LineMarker.glsl.js";import{makePipelineState as W,defaultColorWrite as _,unpremultipliedAlphaToPremultipliedAlpha as S}from"../../../webgl/renderState.js";let j=class extends s{constructor(e,t){super(e,t,k(t).locations),this.shader=new l(g,()=>import("./LineMarker.glsl.js"))}_makePipelineState(e,t){const{output:i,hasEmission:l,oitPass:s,space:f,hasOccludees:m}=e;return W({blending:r(i)?p(s):null,depthTest:0===f?null:c(s),depthWrite:o(e),drawBuffers:n(i,a(s,l)),colorWrite:_,stencilWrite:m?h:null,stencilTest:m?t?u:d:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(e){return e.occluder?(this._occluderPipelineTransparent=W({blending:S,depthTest:m,depthWrite:null,colorWrite:_,stencilWrite:null,stencilTest:f}),this._occluderPipelineOpaque=W({blending:S,depthTest:m,depthWrite:null,colorWrite:_,stencilWrite:T,stencilTest:P}),this._occluderPipelineMaskWrite=W({blending:null,depthTest:b,depthWrite:null,colorWrite:null,stencilWrite:h,stencilTest:u})):this._occluderPipelineTransparent=this._occluderPipelineOpaque=this._occluderPipelineMaskWrite=null,this._occludeePipelineState=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:12===e.occluder?this._occluderPipelineTransparent??super.getPipeline(e):11===e.occluder?this._occluderPipelineOpaque??super.getPipeline(e):this._occluderPipelineMaskWrite??super.getPipeline(e)}};function k(e){const t=i().vec3f("position").vec4f16("previousDelta").vec2f16("uv0");return e.hasVVColor?t.f32("colorFeatureAttribute"):t.vec4u8("color",{glNormalized:!0}),e.hasVVOpacity&&t.f32("opacityFeatureAttribute"),e.hasVVSize?t.f32("sizeFeatureAttribute"):t.f16("size"),e.worldSpace&&t.vec3f16("normal"),t.freeze()}j=e([t("esri.views.3d.webgl-engine.shaders.LineMarkerTechnique")],j);export{j as LineMarkerTechnique,k as getLayout};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as t}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{drawBuffers as o}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as l,stencilBaseAllZerosParams as n,stencilWriteMaskOn as a,depthCompareLess as p}from"../lib/StencilUtils.js";import{PositionColorLayout as c,PositionLayout as u}from"../materials/DefaultLayouts.js";import{N as m}from"../../../../chunks/NativeLine.glsl.js";import{PrimitiveType as d}from"../../../webgl/enums.js";import{makePipelineState as h,defaultColorWrite as f,defaultDepthWrite as j,unpremultipliedAlphaToPremultipliedAlpha as b}from"../../../webgl/renderState.js";let g=class extends s{constructor(e,r){super(e,r,r.hasVertexColors?c.locations:u.locations),this.shader=new t(m,()=>import("./NativeLine.glsl.js")),this.primitiveType=d.LINES}initializePipeline(e){const{hasOccludees:r,output:t,hasEmission:s,transparent:c,oitPass:u}=e,m=(e,i=null,t=null)=>h({blending:i,depthTest:p,depthWrite:t,colorWrite:f,stencilWrite:r?a:null,stencilTest:r?e?l:n:null,drawBuffers:o(u,s)});return i(t)?(this._occludeePipeline=m(!0,c?b:null,j),m(!1,c?b:null,j)):m(!1)}getPipeline(e){return
|
|
5
|
+
import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as t}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{drawBuffers as o}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as l,stencilBaseAllZerosParams as n,stencilWriteMaskOn as a,depthCompareLess as p}from"../lib/StencilUtils.js";import{PositionColorLayout as c,PositionLayout as u}from"../materials/DefaultLayouts.js";import{N as m}from"../../../../chunks/NativeLine.glsl.js";import{PrimitiveType as d}from"../../../webgl/enums.js";import{makePipelineState as h,defaultColorWrite as f,defaultDepthWrite as j,unpremultipliedAlphaToPremultipliedAlpha as b}from"../../../webgl/renderState.js";let g=class extends s{constructor(e,r){super(e,r,r.hasVertexColors?c.locations:u.locations),this.shader=new t(m,()=>import("./NativeLine.glsl.js")),this.primitiveType=d.LINES}initializePipeline(e){const{hasOccludees:r,output:t,hasEmission:s,transparent:c,oitPass:u}=e,m=(e,i=null,t=null)=>h({blending:i,depthTest:p,depthWrite:t,colorWrite:f,stencilWrite:r?a:null,stencilTest:r?e?l:n:null,drawBuffers:o(u,s)});return i(t)?(this._occludeePipeline=m(!0,c?b:null,j),m(!1,c?b:null,j)):m(!1)}getPipeline(e,r){return r?this._occludeePipeline:super.getPipeline(e)}};g=e([r("esri.views.3d.webgl-engine.shaders.NativeLineTechnique")],g);export{g as NativeLineTechnique};
|