@arcgis/core 4.25.0-next.20220718 → 4.25.0-next.20220721
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/Camera.js +1 -1
- package/analysis/DimensioningAnalysis.js +1 -1
- package/analysis/LineOfSightAnalysis.js +1 -1
- package/analysis/SliceAnalysis.js +1 -1
- package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
- package/arcade/functions/featuresetgeom.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/1751de504354d98ac3fd.js +1 -0
- package/assets/esri/core/workers/chunks/1f4f1896880bfa6801c5.js +1 -0
- package/assets/esri/core/workers/chunks/290cd411d0d18b1d0efd.js +1 -0
- package/assets/esri/core/workers/chunks/{ab3bd5fecdb97f2d690e.js → 3b5be512567d9c1c6fe6.js} +1 -1
- package/assets/esri/core/workers/chunks/{c3236a7058e64ea3b939.js → 3c9da9b88777700879aa.js} +1 -1
- package/assets/esri/core/workers/chunks/{f96e8724ae3458f5e262.js → 4a7aa1b9de61eb013647.js} +1 -1
- package/assets/esri/core/workers/chunks/4cb64ccb5fba126f9a66.js +1 -0
- package/assets/esri/core/workers/chunks/{68f19e58aae01791944e.js → 579ba109718bc2554008.js} +1 -1
- package/assets/esri/core/workers/chunks/59845b02b07a8ed7ce81.js +1 -0
- package/assets/esri/core/workers/chunks/{c705f907ce60a646d9aa.js → 652d36523efbe5c9ebb2.js} +1 -1
- package/assets/esri/core/workers/chunks/888d8e4471c9a2cd5009.js +1 -0
- package/assets/esri/core/workers/chunks/9493a8e5d6001b6bf275.js +1 -0
- package/assets/esri/core/workers/chunks/9d824cdfbcdf3cb3246f.js +1 -0
- package/assets/esri/core/workers/chunks/bf348f6f52701fa6016e.js +987 -0
- package/assets/esri/core/workers/chunks/d02881954c0cc0d39dfb.js +1 -0
- package/assets/esri/core/workers/chunks/{1ecbf642debc2207b762.js → da54483123f377e9b3e1.js} +1 -1
- package/assets/esri/core/workers/chunks/{61b71b8e028eda10ccab.js → e4ad2cf5d6bded02e392.js} +1 -1
- package/assets/esri/core/workers/chunks/{3bfab05ae07ac18a75fe.js → f298a70f3b6f27675d53.js} +1 -1
- package/assets/esri/core/workers/chunks/{d499cce61c1c5c367380.js → f40290cfad3fe6fb4ef9.js} +1 -1
- package/assets/esri/layers/support/rasterFormats/lerc-wasm.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Tooltip.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/ComponentShader.glsl.js +39 -33
- package/chunks/Laserlines.glsl.js +4 -4
- package/chunks/Precipitation.glsl.js +2 -2
- package/chunks/RibbonLine.glsl.js +46 -44
- package/chunks/Stars.glsl.js +2 -2
- package/chunks/Terrain.glsl.js +25 -17
- package/chunks/boundedPlane.js +1 -1
- package/chunks/lerc-wasm.js +1 -1
- package/chunks/mat2d.js +1 -1
- package/chunks/quatf32.js +1 -1
- package/core/BidiEngine.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/libs/gl-matrix-2/factories/quatf32.js +1 -1
- package/core/libs/gl-matrix-2/math/mat2d.js +1 -1
- package/core/perspectiveUtils.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/reactiveUtils.js +1 -1
- package/core/unitUtils.js +1 -1
- package/geometry/projection.js +1 -1
- package/geometry/projectionEllipsoid.js +1 -1
- package/geometry/support/MeshTexture.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/coordinateSystem.js +1 -1
- package/geometry/support/geodesicUtils.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/index.js +1 -1
- package/geometry/support/meshUtils/loadExternal.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/geometry/support/scaleUtils.js +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/interfaces.d.ts +3 -33
- package/layers/FeatureLayer.js +1 -1
- package/layers/effects/parser.js +1 -1
- package/layers/graphics/hydratedFeatures.js +1 -1
- package/layers/graphics/sources/support/sourceUtils.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/ogc/wfsUtils.js +1 -1
- package/layers/support/ContingentValue.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/PixelBlock.js +1 -1
- package/layers/support/kmlUtils.js +1 -1
- package/layers/support/rasterDatasets/CloudRaster.js +1 -1
- package/layers/support/rasterDatasets/EphemeralBlockCache.js +1 -1
- package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
- package/layers/support/rasterDatasets/multipartParser.js +1 -1
- package/layers/support/rasterFormats/ImageCanvasDecoder.js +1 -1
- package/layers/support/rasterFormats/JpgPlus.js +1 -1
- package/layers/support/rasterFormats/Lerc.js +1 -1
- package/layers/support/rasterFormats/RasterCodec.js +1 -1
- package/layers/support/rasterFormats/Raw.js +1 -1
- package/layers/support/rasterFormats/TiffTags.js +1 -1
- package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/package.json +1 -1
- package/renderers/RasterShadedReliefRenderer.js +1 -1
- package/renderers/RasterStretchRenderer.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/renderers/support/AuthoringInfo.js +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/query/operations/queryTopFeatures.js +1 -1
- package/rest/support/DirectionsFeatureSet.js +1 -1
- package/rest/support/ImageHistogramParameters.js +1 -1
- package/rest/support/ImageSampleParameters.js +1 -1
- package/smartMapping/labels/clusters.js +1 -1
- package/smartMapping/renderers/relationship.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/support/basemapUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/LabelSymbol3D.js +1 -1
- package/symbols/PointSymbol3D.js +1 -1
- package/symbols/cim/CIMCursor.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/symbols/support/webStyleSymbolUtils.js +1 -1
- package/views/2d/ViewState.js +1 -1
- package/views/2d/engine/vectorTiles/Feature.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
- package/views/2d/engine/webgl/SDFConverter.js +1 -1
- package/views/2d/engine/webgl/TurboLine.js +1 -1
- package/views/2d/engine/webgl/brushes/BrushClip.js +1 -1
- package/views/2d/engine/webgl/brushes/BrushOverlay.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushLine.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushText.js +1 -1
- package/views/2d/engine/webgl/collisions/MetricReader.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/FreeList.js +1 -1
- package/views/2d/engine/webgl/mesh/heuristics.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicLineTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicMarkerTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLDynamicTextTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLMarkerTemplate.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/input/MapViewInputManager.js +1 -1
- package/views/2d/layers/features/createSymbolSchema.js +1 -1
- package/views/2d/viewpointUtils.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/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightVisualization.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechniqueConfiguration.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/FogTechnique.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateObjectSymbol3DAdapter.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/lineUtils.js +1 -1
- package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/IDBCache.js +1 -1
- package/views/3d/layers/i3s/IDBMockCache.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/state/ViewState.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/Overlay.js +1 -1
- package/views/3d/terrain/OverlayRenderTarget.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TilingSchemeLogic.js +1 -1
- package/views/3d/terrain/interfaces.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js +9 -0
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +18 -17
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +5 -0
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/MapView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/analysis/analysisViewUtils.js +1 -1
- package/views/animation/pointToPoint/apex/planning.js +1 -1
- package/views/draw/PolygonDrawAction.js +1 -1
- package/views/draw/PolylineDrawAction.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/input/handlers/LatestPointer.js +1 -1
- package/views/input/handlers/MultiTouch.js +5 -0
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileCache.js +1 -1
- package/views/interactive/tooltip/Tooltip.js +1 -1
- package/views/interactive/tooltip/support/measurements.js +1 -1
- package/views/layers/GroupLayerView.js +1 -1
- package/views/navigation/FilteredFiniteDifference.js +1 -1
- package/views/navigation/MomentumEstimator.js +1 -1
- package/views/navigation/PanPlanarMomentumEstimator.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/navigation/RotationMomentumEstimator.js +1 -1
- package/views/support/GroundViewElevationSampler.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/screenshotUtils.js +1 -1
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/capabilities/Capabilities.js +1 -1
- package/views/webgl/capabilities.js +1 -1
- package/views/webgl/renderState.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineInput.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/ElevationProfile/support/chartUtils.js +1 -1
- package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Widget.js +1 -1
- package/assets/esri/core/workers/chunks/04ea469cb081e181ca82.js +0 -1
- package/assets/esri/core/workers/chunks/16c2626ca47132700519.js +0 -1
- package/assets/esri/core/workers/chunks/1e4e5d147263e98536bc.js +0 -1
- package/assets/esri/core/workers/chunks/35083def3c658d1ae9ff.js +0 -1
- package/assets/esri/core/workers/chunks/40032d2bf404a46b8f80.js +0 -1
- package/assets/esri/core/workers/chunks/613e82a3e13442685ac4.js +0 -1
- package/assets/esri/core/workers/chunks/64b4f1dbf61439cde801.js +0 -1
- package/assets/esri/core/workers/chunks/abd68b7ba3be4696611c.js +0 -1
- package/assets/esri/core/workers/chunks/b8a062c0c9c626acf61e.js +0 -982
- package/assets/esri/core/workers/chunks/e08686088be0aaca1a99.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Handles.js";import{destroyMaybe as s,isSome as r}from"../../../core/maybe.js";import{watch as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{canProjectToWGS84ComparableLonLat as a}from"../../../geometry/projection.js";import{equals as c}from"../../../geometry/support/aaBoundingRect.js";import{isMars as h,isMoon as p}from"../../../geometry/support/spatialReferenceUtils.js";import{isTiledLayer as d}from"../../../layers/support/layerUtils.js";import{ViewingMode as m}from"../../ViewingMode.js";import{
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import i from"../../../core/Handles.js";import{destroyMaybe as s,isSome as r}from"../../../core/maybe.js";import{watch as o}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{canProjectToWGS84ComparableLonLat as a}from"../../../geometry/projection.js";import{equals as c}from"../../../geometry/support/aaBoundingRect.js";import{isMars as h,isMoon as p}from"../../../geometry/support/spatialReferenceUtils.js";import{isTiledLayer as d}from"../../../layers/support/layerUtils.js";import{ViewingMode as m}from"../../ViewingMode.js";import{isProjectableRasterLayer as y,getTiledLayerInfo as u}from"./terrainUtils.js";import{TilingScheme as S}from"./TilingScheme.js";let g=class extends t{constructor(e){super(e),this._handles=new i}initialize(){this._handles.add(this.layers.on("change",(()=>this._update()))),this._handles.add(o((()=>this.extentHelper.layerViewsExtent),(()=>this._setAdHocTilingScheme()))),this._update(),this.tilingSchemeLocked||this._setAdHocTilingScheme()}destroy(){this._handles=s(this._handles),this._waitTask=null}_update(){if(this._waitTask=null,this.tilingSchemeLocked)return;let e;if(this.layers.some((t=>!(!d(t)||t.isRejected())&&(!(t.isFulfilled()&&!f(t,this.viewSpatialReference,this.viewingMode))&&(e=t,!("vector-tile"===t?.type||y(t)))))),e)if(e.isResolved()){const t=u(e,this.viewSpatialReference,this.viewingMode);if(r(t)){const e=new S(t.tileInfo);this._lockTilingScheme(e)}}else this._updateWhen(e)}_updateWhen(e){const t=e.when().catch((()=>{})).then((()=>{t!==this._waitTask||this.destroyed||this._update()}));this._waitTask=t}_lockTilingScheme(e){if(this.viewingMode===m.Global){const t=e.levels.length-1;e.spatialReference.isWebMercator?e=S.makeWebMercatorAuxiliarySphere(t):a(e.spatialReference)&&(e=S.makeGCSWithTileSize(e.spatialReference,e.pixelSize,t))}this.tilingSchemeLocked=!0,this.tilingScheme=e,this.extentHelper.tilingScheme=this.tilingScheme,this._updateTiledLayerExtent(),this._handles.removeAll(),this._handles.add(o((()=>this.extentHelper.tiledLayersExtent),(()=>this._updateTiledLayerExtent())))}_updateTiledLayerExtent(){this._set("extent",this.extentHelper.tiledLayersExtent)}_setAdHocTilingScheme(){if(this.viewingMode===m.Global){const e=this.extentHelper.viewSpatialReference,t=a(e)||h(e)||p(e);e.isWebMercator?this.tilingScheme=S.WebMercatorAuxiliarySphere:t&&(this.tilingScheme=S.makeGCSWithTileSize(e,256)),this._set("extent",this.extentHelper.layerViewsExtent)}else{const e=this.extentHelper.layerViewsExtent;r(e)&&!c(e,this.extent)&&(this.tilingScheme=S.fromExtent(e,this.extentHelper.viewSpatialReference),this._set("extent",e))}}get test(){return{lockTilingScheme:e=>this._lockTilingScheme(e),done:!this._waitTask}}};function f(e,t,i){return r(u(e,t,i))}e([n()],g.prototype,"tilingScheme",void 0),e([n({readOnly:!0})],g.prototype,"extent",void 0),e([n({value:!1})],g.prototype,"tilingSchemeLocked",void 0),e([n({constructOnly:!0})],g.prototype,"viewSpatialReference",void 0),e([n({constructOnly:!0})],g.prototype,"layers",void 0),e([n({constructOnly:!0})],g.prototype,"extentHelper",void 0),e([n({constructOnly:!0})],g.prototype,"viewingMode",void 0),g=e([l("esri.views.3d.terrain.TilingSchemeLogic")],g);export{g as TilingSchemeLogic};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
var T,
|
|
5
|
+
var O,T,E,S,H,A;!function(O){O[O.INNER=0]="INNER",O[O.OUTER=1]="OUTER"}(O||(O={})),function(O){O[O.REGULAR=0]="REGULAR",O[O.HAS_NORTH_POLE=1]="HAS_NORTH_POLE",O[O.HAS_SOUTH_POLE=2]="HAS_SOUTH_POLE",O[O.HAS_BOTH_POLES=3]="HAS_BOTH_POLES"}(T||(T={})),function(O){O[O.NORTH=0]="NORTH",O[O.NORTH_EAST=1]="NORTH_EAST",O[O.EAST=2]="EAST",O[O.SOUTH_EAST=3]="SOUTH_EAST",O[O.SOUTH=4]="SOUTH",O[O.SOUTH_WEST=5]="SOUTH_WEST",O[O.WEST=6]="WEST",O[O.NORTH_WEST=7]="NORTH_WEST"}(E||(E={})),function(O){O[O.OFF=0]="OFF",O[O.ON=1]="ON"}(S||(S={})),function(O){O[O.Color=0]="Color",O[O.ColorNoRasterImage=1]="ColorNoRasterImage",O[O.Highlight=2]="Highlight",O[O.Water=3]="Water",O[O.Occluded=4]="Occluded",O[O.ObjectAndLayerIdColor=5]="ObjectAndLayerIdColor"}(H||(H={})),function(O){O[O.FADING=0]="FADING",O[O.IMMEDIATE=1]="IMMEDIATE",O[O.UNFADED=2]="UNFADED"}(A||(A={}));export{S as LODSnapping,E as NeighborIndex,O as OverlayIndex,T as PatchType,H as RenderTargetType,A as TextureUpdate};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{AutoDisposable as i,autoDispose as o}from"../../lib/AutoDisposable.js";class s extends i{constructor(){super(...arguments),this.visible=t.Hidden}}var t;e([o()],s.prototype,"renderable",void 0),e([o()],s.prototype,"components",void 0),function(e){e[e.Hidden=0]="Hidden",e[e.Visible=1]="Visible"}(t||(t={}));export{s as ComponentObject,t as State};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as t}from"../../../../../core/maybe.js";import n from"../../../../../core/PooledArray.js";import{h as e,e as o}from"../../../../../chunks/mat3.js";import{c as r}from"../../../../../chunks/mat3f64.js";import{c as a}from"../../../../../chunks/quat.js";import{a as s}from"../../../../../chunks/quatf64.js";import{e as f,w as c,q as l,
|
|
5
|
+
import{isSome as t}from"../../../../../core/maybe.js";import n from"../../../../../core/PooledArray.js";import{h as e,e as o}from"../../../../../chunks/mat3.js";import{c as r}from"../../../../../chunks/mat3f64.js";import{c as a}from"../../../../../chunks/quat.js";import{a as s}from"../../../../../chunks/quatf64.js";import{e as f,w as c,q as l,s as u,h as i,c as h,t as m,a as p}from"../../../../../chunks/vec3.js";import{c as b}from"../../../../../chunks/vec3f64.js";import{signedDistance as j}from"../../../../../geometry/support/plane.js";import{projectedRadius as d,intersectPlane as g}from"../../../support/orientedBoundingBox.js";import{empty as k,within as w,union as z}from"../../lib/depthRange.js";function S(n,e){const o=k(),{eye:r,frustum:a,viewForward:s}=n;e.forAll((n=>{const e=t(n.offsetObb)?n.offsetObb:n.obb,l=f(c(E,e.center,r),s),u=d(e,s);if(w(o,l-u)&&w(o,l+u))return;const i=R(e,a);if(-1===i)return;if(0===i)return y.far=l+u,y.near=l-u,void z(o,y);const h=q.pushNew();h.near=l-u,h.far=l+u,h.mask=i,h.object=n}));for(let l=0;l<q.length;l++){const n=q.data[l];if(w(o,n.near)&&w(o,n.far))continue;y.far=n.far,y.near=1/0;const e=M(t(n.object.offsetObb)?n.object.offsetObb:n.object.obb,r,A,(t=>{let e=x;for(let o=0;o<P&&t.length>0;o++){if(0==(n.mask&1<<o))continue;B(a[o],t,e);const r=t;t=e,e=r}for(let n=0;n<t.length;n+=3){u(v,t.data[n+0],t.data[n+1],t.data[n+2]);const e=f(c(v,v,r),s);y.near=Math.min(y.near,e)}}));0===e&&(y.near=0),z(o,y)}return q.length=0,o}const q=new n({allocator:t=>t||{near:1/0,far:-1/0,mask:0,object:null},deallocator:t=>(t.object=null,t)}),y=k(),v=b(),O=b(),A=new n({deallocator:null}),x=new n({deallocator:null});function B(t,n,e){e.length=0;const o=n.length-3;F(v,n,o);const r=j(t,v);r<=0&&(e.push(v[0]),e.push(v[1]),e.push(v[2]));let a=0,s=r;for(;a<o;a+=3){F(O,n,a);const o=j(t,O);if(s*o<0){i(v,O,v,o/(o-s)),I(e,v)}o<=0&&I(e,O),s=o,h(v,O)}if(s*r<0){F(O,n,o);i(v,O,v,r/(r-s)),I(e,v)}}function F(t,n,e){return u(t,n.data[e+0],n.data[e+1],n.data[e+2])}function I(t,n){t.push(n[0]),t.push(n[1]),t.push(n[2])}function M(t,n,r,s){a(D,t.quaternion),c(E,n,t.center),l(E,E,D);const f=8*((E[0]<-t.halfSize[0]?-1:E[0]>t.halfSize[0]?1:0)+3*(E[1]<-t.halfSize[1]?-1:E[1]>t.halfSize[1]?1:0)+9*(E[2]<-t.halfSize[2]?-1:E[2]>t.halfSize[2]?1:0)+13),i=N[f];if(0===i)return i;e(C,t.quaternion),o(C,C,t.halfSize);const h=(n,e)=>{const o=N[f+e+1];return u(n,((1&o)<<1)-1,(2&o)-1,((4&o)>>1)-1),m(n,n,C),p(n,t.center,n)};return r.length=0,I(r,h(G,0)),I(r,h(H,1)),I(r,h(E,2)),I(r,h(J,3)),s(r),1===i?i:(r.length=0,I(r,G),I(r,J),I(r,h(E,4)),I(r,h(K,5)),s(r),2===i||(r.length=0,I(r,G),I(r,K),I(r,h(E,6)),I(r,H),s(r)),i)}const N=(()=>{const t=new Int8Array(216);let n=0;const e=e=>{for(let o=0;o<e.length;o++)t[n+o]=e[o];n+=8};return e([3,0,6,2,3,1,5,4]),e([2,0,2,3,1,5,4,0]),e([3,1,0,2,3,7,5,4]),e([2,0,1,3,2,6,4,0]),e([1,0,1,3,2,0,0,0]),e([2,1,5,7,3,2,0,0]),e([3,2,0,1,3,7,6,4]),e([2,2,0,1,3,7,6,0]),e([3,3,0,1,5,7,6,2]),e([2,0,1,5,4,6,2,0]),e([1,0,1,5,4,0,0,0]),e([2,1,3,7,5,4,0,0]),e([1,0,2,6,4,0,0,0]),e([0,0,0,0,0,0,0,0]),e([1,1,3,7,5,0,0,0]),e([2,2,3,7,6,4,0,0]),e([1,2,3,7,6,0,0,0]),e([2,3,1,5,7,6,2,0]),e([3,4,0,1,5,7,6,2]),e([2,5,7,6,4,0,1,0]),e([3,5,0,1,3,7,6,4]),e([2,4,5,7,6,2,0,0]),e([1,4,5,7,6,0,0,0]),e([2,5,1,3,7,6,4,0]),e([3,6,0,2,3,7,5,4]),e([2,6,2,3,7,5,4,0]),e([3,7,6,2,3,1,5,4]),t})(),P=4;function R(t,n){let e=0;for(let o=0;o<P;o++){const r=g(t,n[o]);if(r>0)return-1;0===r&&(e|=1<<o)}return e}const C=r(),D=s(),E=b(),G=b(),H=b(),J=b(),K=b();export{S as computeDepthRange};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{releaseMaybe as t,isSome as r,isNone as s}from"../../../../../../core/maybe.js";import{g as o,t as a}from"../../../../../../chunks/mat3.js";import{a as i}from"../../../../../../chunks/mat3f32.js";import{F as n}from"../../../../../../chunks/vec3.js";import{f as l}from"../../../../../../chunks/vec3f32.js";import{v as h}from"../../../../../../chunks/vec4.js";import{f as u}from"../../../../../../chunks/vec4f32.js";import{ColorMixModeEnum as p}from"../../../../layers/support/symbolColorUtils.js";import{OverlayIndex as c,RenderTargetType as d}from"../../../../terrain/interfaces.js";import{ComponentTechnique as m}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as g,IntegratedMeshMode as T}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as y}from"./shader/ComponentData.glsl.js";import{g as x}from"../../../../../../chunks/ComponentShader.glsl.js";import{VertexDiscardMode as f}from"./shader/VertexDiscardByOpacity.glsl.js";import{parameter as v,parameterBlock as M,MaterialBase as b,MaterialParameterBlock as O}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as C,MaterialSubPass as w}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as P}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as S}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as N}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as A}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{defaultMaskAlphaCutoff as D}from"../../../core/shaderLibrary/util/AlphaCutoff.js";import{EllipsoidMode as q}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as R}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as j,CullFaceOptions as E}from"../../../lib/basicInterfaces.js";import{TransparencyPassType as I}from"../../../lib/TransparencyPassType.js";class F extends b{constructor(e,t){super(),this.toMapSpace=t,this.baseColor=u(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=l(1,1,.5),this.emissiveFactor=l(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.objectOpacity=1,this.commonMaterialParameters=new W,this.componentParameters=new B,this.textureAlphaCutoff=D,this.alphaDiscardMode=j.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=q.Earth,this.hasOccludees=!1,this._techniqueConfiguration=new g;const r=new R(e.position),s=i(e.rotationScale);o(s,s),this.transformNormalGlobalFromModel=a(s,s),this.transformWorldFromModelTL=r.low,this.transformWorldFromModelTH=r.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this._technique=t(this._technique),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get texture(){return r(this.baseColorTexture)?this.baseColorTexture.glTexture:null}get textureMetallicRoughness(){return r(this.metallicRoughnessTexture)?this.metallicRoughnessTexture.glTexture:null}get textureEmissive(){return r(this.emissionTexture)?this.emissionTexture.glTexture:null}get textureOcclusion(){return r(this.occlusionTexture)?this.occlusionTexture.glTexture:null}get textureNormal(){return r(this.normalTexture)?this.normalTexture.glTexture:null}prepareTechnique(e,t,o,a){const i=this._techniqueConfiguration;i.hasVertexColors=a.colors,i.hasNormals=a.normals,i.textureCoordinateType=a.textureCoordinates,i.hasMetalnessAndRoughnessTexture=r(this.metallicRoughnessTexture),i.hasEmissionTexture=r(this.emissionTexture),i.hasOcclusionTexture=r(this.occlusionTexture),i.hasNormalTexture=r(this.normalTexture),i.transparencyPassType=t.identifier===C.Material&&null!=o.transparencyPassType?o.transparencyPassType:I.NONE,i.hasMultipassTerrain=t.identifier===C.Material&&null!=o.multipassTerrain&&o.multipassTerrain.enabled,i.cullAboveGround=t.identifier===C.Material&&null!=o.multipassTerrain&&o.multipassTerrain.cullAboveGround,i.ellipsoidMode=this.ellipsoidMode,i.componentData=this.componentParameters.type,i.cullFace=this.commonMaterialParameters.cullFace,i.doubleSidedMode=this.commonMaterialParameters.doubleSided?N.View:N.None,i.hasBaseColorTexture=r(this.baseColorTexture);const n=this._computeWhichMaterialPass();i.blendingEnabled=n===k.Transparent||n===k.OpaqueAndTransparent,i.alphaDiscardMode=this.alphaDiscardMode,i.integratedMeshMode=this.isIntegratedMesh?U(o)?x(o)?T.ColorOverlayWithWater:T.ColorOverlay:T.NoOverlay:T.None,i.isGround=this.isIntegratedMesh,i.hasPolygonOffset=this.polygonOffsetEnabled;const l=this.hasParametersFromSource&&s(this.baseColorTexture);return i.pbrMode=i.integratedMeshMode===T.ColorOverlayWithWater?A.WaterOnIntegratedMesh:this.usePBR?l?A.Schematic:A.Normal:A.Disabled,i.normalType=i.integratedMeshMode===T.None?i.hasNormals?S.CompressedAttribute:S.ScreenDerivative:S.Ground,i.hasSlicePlane=r(o.slicePlane)&&this.commonMaterialParameters.hasSlicePlane,t.identifier===C.ShadowMap?(i.output=P.Shadow,i.vertexDiscardMode=f.None):t.identifier===C.Highlight?(i.output=P.Highlight,i.vertexDiscardMode=f.None):(this._computeWhichMaterialPass()===k.OpaqueAndTransparent?i.vertexDiscardMode=t.transparent?f.Opaque:f.Transparent:i.vertexDiscardMode=f.None,i.output=L(t.subPass),t.subPass===w.Alpha&&(i.hasOccludees=o.hasOccludees),t.subPass===w.Color?(i.receiveAmbientOcclusion=o.ssaoHelper.ready,i.hasOccludees=o.hasOccludees,i.receiveShadows=o.shadowMap.ready,i.hasScreenSpaceReflections=o.ssr.enabled,i.hasCloudsReflections=r(o.clouds.data)):(i.receiveAmbientOcclusion=!1,i.receiveShadows=!1),i.snowCover=this.hasSnowCover(o)),this._technique=e.releaseAndAcquire(m,i,this._technique),this._setClean(),this._technique}hasSnowCover(e){return r(e.weather)&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}submit(e,t,s){if(0===this.objectOpacity)return;const o=s.renderable.geometry,a=s.components,i=s.renderable.meta.cameraDepthSquared,n=a.geometryRanges,l=a.highlightRanges,h=a.defaultShadowMapRanges;switch(this._computeWhichMaterialPass()){case k.Opaque:e.materialOpaque.submitDraw(this,o,n,i);break;case k.Transparent:e.materialTransparent.submitDraw(this,o,n,i);break;case k.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,o,n,i),e.materialTransparent.submitDraw(this,o,n,i);break;case k.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,o,n,i),H(t)&&e.highlightIntegratedMesh.submitDraw(this,o,n,i)}const u=this.componentParameters.castShadows!==V.None;u&&e.shadowMap.submitDraw(this,o,n,i),r(l)&&(e.highlight.submitDraw(this,o,l,i),u&&e.highlightShadowMap.submitDraw(this,o,l,i)),u&&r(h)&&e.defaultShadowMap.submitDraw(this,o,h,i)}_computeWhichMaterialPass(){return this.isIntegratedMesh?k.IntegratedMesh:this.objectOpacity<1?k.Transparent:this.componentParameters.opaqueOverride===V.All?k.Opaque:this.baseColor[3]<1||this.alphaDiscardMode===j.Blend||this.alphaDiscardMode===j.MaskBlend?k.Transparent:this.componentParameters.transparent===V.None?k.Opaque:this.componentParameters.transparent===V.All?k.Transparent:k.OpaqueAndTransparent}}var _,k,V;e([v({vectorOps:h})],F.prototype,"baseColor",void 0),e([v()],F.prototype,"usePBR",void 0),e([v()],F.prototype,"hasParametersFromSource",void 0),e([v({vectorOps:n})],F.prototype,"mrrFactors",void 0),e([v({vectorOps:n})],F.prototype,"emissiveFactor",void 0),e([v({dispose:!0})],F.prototype,"baseColorTexture",void 0),e([v({dispose:!0})],F.prototype,"metallicRoughnessTexture",void 0),e([v({dispose:!0})],F.prototype,"emissionTexture",void 0),e([v({dispose:!0})],F.prototype,"occlusionTexture",void 0),e([v({dispose:!0})],F.prototype,"normalTexture",void 0),e([v()],F.prototype,"objectOpacity",void 0),e([M()],F.prototype,"commonMaterialParameters",void 0),e([M()],F.prototype,"componentParameters",void 0),e([v()],F.prototype,"textureAlphaCutoff",void 0),e([v()],F.prototype,"alphaDiscardMode",void 0),e([v()],F.prototype,"isIntegratedMesh",void 0),e([v()],F.prototype,"polygonOffsetEnabled",void 0),e([v()],F.prototype,"ellipsoidMode",void 0),e([v()],F.prototype,"hasOccludees",void 0),function(e){e[e.VERTEX=0]="VERTEX",e[e.GROUND=1]="GROUND",e[e.SCREEN_DERIVATIVE=2]="SCREEN_DERIVATIVE"}(_||(_={})),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(k||(k={}));class W extends O{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=E.Back,this.hasSlicePlane=!0}}e([v()],W.prototype,"doubleSided",void 0),e([v()],W.prototype,"cullFace",void 0),e([v()],W.prototype,"hasSlicePlane",void 0);class B extends O{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=p.Multiply,this.castShadows=V.All}get transparent(){return this.externalColor[3]<1?V.All:V.None}get opaqueOverride(){return this.externalColorMixMode===p.Replace&&1===this.externalColor[3]?V.All:V.None}get visible(){return this.externalColor[3]>0?V.All:V.None}get type(){return y.Uniform}}e([v({vectorOps:h})],B.prototype,"externalColor",void 0),e([v()],B.prototype,"externalColorMixMode",void 0),e([v()],B.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(V||(V={}));class G extends O{constructor(){super(...arguments),this.texture=null,this.transparent=V.None,this.opaqueOverride=V.None,this.castShadows=V.None}get type(){return y.Varying}}function L(e){switch(e){case w.Color:return P.Color;case w.Alpha:return P.Alpha;case w.Depth:return P.Depth;case w.Normal:return P.Normal}}function H(e){return 0!==e.overlays.length&&r(e.overlays[c.INNER].getValidTexture(d.Highlight))}function U(e){return 0!==e.overlays.length&&r(e.overlays[c.INNER].getColorTextureNoRasterImage())}e([v()],G.prototype,"texture",void 0),e([v()],G.prototype,"transparent",void 0),e([v()],G.prototype,"opaqueOverride",void 0),e([v()],G.prototype,"castShadows",void 0);export{W as CommonMaterialParameters,F as ComponentMaterial,V as ComponentParameterSummary,B as ComponentParametersUniform,G as ComponentParametersVarying,_ as ShadingNormalSource};
|
|
5
|
+
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{releaseMaybe as t,isSome as r,isNone as s}from"../../../../../../core/maybe.js";import{g as o,t as a}from"../../../../../../chunks/mat3.js";import{a as i}from"../../../../../../chunks/mat3f32.js";import{F as n}from"../../../../../../chunks/vec3.js";import{f as l}from"../../../../../../chunks/vec3f32.js";import{v as h}from"../../../../../../chunks/vec4.js";import{f as u}from"../../../../../../chunks/vec4f32.js";import{ColorMixModeEnum as p}from"../../../../layers/support/symbolColorUtils.js";import{OverlayIndex as c,RenderTargetType as d}from"../../../../terrain/interfaces.js";import{ComponentTechnique as m}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as g,IntegratedMeshMode as y}from"./ComponentTechniqueConfiguration.js";import{ComponentDataType as T}from"./shader/ComponentData.glsl.js";import{g as x}from"../../../../../../chunks/ComponentShader.glsl.js";import{VertexDiscardMode as b}from"./shader/VertexDiscardByOpacity.glsl.js";import{MaterialBase as f,parameter as v,parameterBlock as M,MaterialParameterBlock as O}from"../../../core/material/MaterialBase.js";import{RenderPassIdentifier as C,MaterialSubPass as w}from"../../../core/renderPasses/AllRenderPasses.js";import{ShaderOutput as P}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as S}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as N}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as A}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{defaultMaskAlphaCutoff as j}from"../../../core/shaderLibrary/util/AlphaCutoff.js";import{EllipsoidMode as D}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{TwoVectorPosition as q}from"../../../core/util/TwoVectorPosition.js";import{AlphaDiscardMode as R,CullFaceOptions as I}from"../../../lib/basicInterfaces.js";import{TransparencyPassType as E}from"../../../lib/TransparencyPassType.js";class F extends f{constructor(e,t){super(),this.toMapSpace=t,this.baseColor=u(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=l(1,1,.5),this.emissiveFactor=l(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.objectOpacity=1,this.commonMaterialParameters=new W,this.componentParameters=new L,this.textureAlphaCutoff=j,this.alphaDiscardMode=R.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=D.Earth,this.hasOccludees=!1,this._techniqueConfiguration=new g;const r=new q(e.position),s=i(e.rotationScale);o(s,s),this.transformNormalGlobalFromModel=a(s,s),this.transformWorldFromModelTL=r.low,this.transformWorldFromModelTH=r.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this._technique=t(this._technique),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get texture(){return r(this.baseColorTexture)?this.baseColorTexture.glTexture:null}get textureMetallicRoughness(){return r(this.metallicRoughnessTexture)?this.metallicRoughnessTexture.glTexture:null}get textureEmissive(){return r(this.emissionTexture)?this.emissionTexture.glTexture:null}get textureOcclusion(){return r(this.occlusionTexture)?this.occlusionTexture.glTexture:null}get textureNormal(){return r(this.normalTexture)?this.normalTexture.glTexture:null}prepareTechnique(e,t,o,a){const i=this._techniqueConfiguration;i.hasVertexColors=a.colors,i.hasNormals=a.normals,i.textureCoordinateType=a.textureCoordinates,i.hasMetalnessAndRoughnessTexture=r(this.metallicRoughnessTexture),i.hasEmissionTexture=r(this.emissionTexture),i.hasOcclusionTexture=r(this.occlusionTexture),i.hasNormalTexture=r(this.normalTexture),i.transparencyPassType=t.identifier===C.Material&&null!=o.transparencyPassType?o.transparencyPassType:E.NONE,i.hasMultipassTerrain=t.identifier===C.Material&&null!=o.multipassTerrain&&o.multipassTerrain.enabled,i.cullAboveGround=t.identifier===C.Material&&null!=o.multipassTerrain&&o.multipassTerrain.cullAboveGround,i.ellipsoidMode=this.ellipsoidMode,i.componentData=this.componentParameters.type,i.cullFace=this.commonMaterialParameters.cullFace,i.doubleSidedMode=this.commonMaterialParameters.doubleSided?N.View:N.None,i.hasBaseColorTexture=r(this.baseColorTexture);const n=this._computeWhichMaterialPass();i.blendingEnabled=n===k.Transparent||n===k.OpaqueAndTransparent,i.alphaDiscardMode=this.alphaDiscardMode,i.integratedMeshMode=this.isIntegratedMesh?U(o)?x(o)?y.ColorOverlayWithWater:y.ColorOverlay:y.NoOverlay:y.None,i.isGround=this.isIntegratedMesh,i.hasPolygonOffset=this.polygonOffsetEnabled;const l=this.hasParametersFromSource&&s(this.baseColorTexture);return i.pbrMode=i.integratedMeshMode===y.ColorOverlayWithWater?A.WaterOnIntegratedMesh:this.usePBR?l?A.Schematic:A.Normal:A.Disabled,i.normalType=i.integratedMeshMode===y.None?i.hasNormals?S.CompressedAttribute:S.ScreenDerivative:S.Ground,i.hasSlicePlane=r(o.slicePlane)&&this.commonMaterialParameters.hasSlicePlane,t.identifier===C.ShadowMap?(i.output=P.Shadow,i.vertexDiscardMode=b.None):t.identifier===C.Highlight?(i.output=P.Highlight,i.vertexDiscardMode=b.None):(this._computeWhichMaterialPass()===k.OpaqueAndTransparent?i.vertexDiscardMode=t.transparent?b.Opaque:b.Transparent:i.vertexDiscardMode=b.None,i.output=G(t.subPass),t.subPass===w.Alpha&&(i.hasOccludees=o.hasOccludees),t.subPass===w.Color?(i.receiveAmbientOcclusion=o.ssaoHelper.ready,i.hasOccludees=o.hasOccludees,i.receiveShadows=o.shadowMap.ready,i.hasScreenSpaceReflections=o.ssr.enabled,i.hasCloudsReflections=r(o.clouds.data)):(i.receiveAmbientOcclusion=!1,i.receiveShadows=!1),i.snowCover=this.hasSnowCover(o),t.subPass===w.ObjectAndLayerIdColor&&(i.objectAndLayerIdColor=!0)),this._technique=e.releaseAndAcquire(m,i,this._technique),this._setClean(),this._technique}hasSnowCover(e){return r(e.weather)&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}submit(e,t,s){if(0===this.objectOpacity)return;const o=s.renderable.geometry,a=s.components,i=s.renderable.meta.cameraDepthSquared,n=a.geometryRanges,l=a.highlightRanges,h=a.defaultShadowMapRanges;switch(this._computeWhichMaterialPass()){case k.Opaque:e.materialOpaque.submitDraw(this,o,n,i);break;case k.Transparent:e.materialTransparent.submitDraw(this,o,n,i);break;case k.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,o,n,i),e.materialTransparent.submitDraw(this,o,n,i);break;case k.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,o,n,i),H(t)&&e.highlightIntegratedMesh.submitDraw(this,o,n,i)}const u=this.componentParameters.castShadows!==V.None;u&&e.shadowMap.submitDraw(this,o,n,i),r(l)&&(e.highlight.submitDraw(this,o,l,i),u&&e.highlightShadowMap.submitDraw(this,o,l,i)),u&&r(h)&&e.defaultShadowMap.submitDraw(this,o,h,i)}_computeWhichMaterialPass(){return this.isIntegratedMesh?k.IntegratedMesh:this.objectOpacity<1?k.Transparent:this.componentParameters.opaqueOverride===V.All?k.Opaque:this.baseColor[3]<1||this.alphaDiscardMode===R.Blend||this.alphaDiscardMode===R.MaskBlend?k.Transparent:this.componentParameters.transparent===V.None?k.Opaque:this.componentParameters.transparent===V.All?k.Transparent:k.OpaqueAndTransparent}}var _,k,V;e([v({vectorOps:h})],F.prototype,"baseColor",void 0),e([v()],F.prototype,"usePBR",void 0),e([v()],F.prototype,"hasParametersFromSource",void 0),e([v({vectorOps:n})],F.prototype,"mrrFactors",void 0),e([v({vectorOps:n})],F.prototype,"emissiveFactor",void 0),e([v({dispose:!0})],F.prototype,"baseColorTexture",void 0),e([v({dispose:!0})],F.prototype,"metallicRoughnessTexture",void 0),e([v({dispose:!0})],F.prototype,"emissionTexture",void 0),e([v({dispose:!0})],F.prototype,"occlusionTexture",void 0),e([v({dispose:!0})],F.prototype,"normalTexture",void 0),e([v()],F.prototype,"objectOpacity",void 0),e([M()],F.prototype,"commonMaterialParameters",void 0),e([M()],F.prototype,"componentParameters",void 0),e([v()],F.prototype,"textureAlphaCutoff",void 0),e([v()],F.prototype,"alphaDiscardMode",void 0),e([v()],F.prototype,"isIntegratedMesh",void 0),e([v()],F.prototype,"polygonOffsetEnabled",void 0),e([v()],F.prototype,"ellipsoidMode",void 0),e([v()],F.prototype,"hasOccludees",void 0),function(e){e[e.VERTEX=0]="VERTEX",e[e.GROUND=1]="GROUND",e[e.SCREEN_DERIVATIVE=2]="SCREEN_DERIVATIVE"}(_||(_={})),function(e){e[e.Opaque=0]="Opaque",e[e.Transparent=1]="Transparent",e[e.OpaqueAndTransparent=2]="OpaqueAndTransparent",e[e.IntegratedMesh=3]="IntegratedMesh"}(k||(k={}));class W extends O{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=I.Back,this.hasSlicePlane=!0}}e([v()],W.prototype,"doubleSided",void 0),e([v()],W.prototype,"cullFace",void 0),e([v()],W.prototype,"hasSlicePlane",void 0);class L extends O{constructor(){super(...arguments),this.externalColor=u(1,1,1,1),this.externalColorMixMode=p.Multiply,this.castShadows=V.All}get transparent(){return this.externalColor[3]<1?V.All:V.None}get opaqueOverride(){return this.externalColorMixMode===p.Replace&&1===this.externalColor[3]?V.All:V.None}get visible(){return this.externalColor[3]>0?V.All:V.None}get type(){return T.Uniform}}e([v({vectorOps:h})],L.prototype,"externalColor",void 0),e([v()],L.prototype,"externalColorMixMode",void 0),e([v()],L.prototype,"castShadows",void 0),function(e){e[e.All=0]="All",e[e.Some=1]="Some",e[e.None=2]="None"}(V||(V={}));class B extends O{constructor(){super(...arguments),this.texture=null,this.transparent=V.None,this.opaqueOverride=V.None,this.castShadows=V.None}get type(){return T.Varying}}function G(e){switch(e){case w.Color:return P.Color;case w.Alpha:return P.Alpha;case w.Depth:return P.Depth;case w.Normal:return P.Normal;case w.ObjectAndLayerIdColor:return P.ObjectAndLayerIdColor}}function H(e){return 0!==e.overlays.length&&r(e.overlays[c.INNER].getValidTexture(d.Highlight))}function U(e){return 0!==e.overlays.length&&r(e.overlays[c.INNER].getColorTextureNoRasterImage())}e([v()],B.prototype,"texture",void 0),e([v()],B.prototype,"transparent",void 0),e([v()],B.prototype,"opaqueOverride",void 0),e([v()],B.prototype,"castShadows",void 0);export{W as CommonMaterialParameters,F as ComponentMaterial,V as ComponentParameterSummary,L as ComponentParametersUniform,B as ComponentParametersVarying,_ as ShadingNormalSource};
|
package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../../../../chunks/tslib.es6.js";import{ComponentDataType as e}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as t}from"./shader/VertexDiscardByOpacity.glsl.js";import{ShaderOutput as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as s}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as i}from"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as a}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as p}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as n}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{BindType as d}from"../../../core/shaderTechnique/BindType.js";import{parameter as l,ShaderTechniqueConfiguration as
|
|
5
|
+
import{_ as o}from"../../../../../../chunks/tslib.es6.js";import{ComponentDataType as e}from"./shader/ComponentData.glsl.js";import{VertexDiscardMode as t}from"./shader/VertexDiscardByOpacity.glsl.js";import{ShaderOutput as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as s}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as i}from"../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as a}from"../../../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as p}from"../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{EllipsoidMode as n}from"../../../core/shaderLibrary/util/EllipsoidMode.js";import{BindType as d}from"../../../core/shaderTechnique/BindType.js";import{parameter as l,ShaderTechniqueConfiguration as c}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{CullFaceOptions as h,AlphaDiscardMode as u}from"../../../lib/basicInterfaces.js";import{TransparencyPassType as y}from"../../../lib/TransparencyPassType.js";var v,T;!function(o){o[o.None=0]="None",o[o.Transparent=1]="Transparent",o[o.Opaque=2]="Opaque",o[o.COUNT=3]="COUNT"}(v||(v={})),function(o){o[o.None=0]="None",o[o.NoOverlay=1]="NoOverlay",o[o.ColorOverlay=2]="ColorOverlay",o[o.ColorOverlayWithWater=3]="ColorOverlayWithWater",o[o.COUNT=4]="COUNT"}(T||(T={}));class m extends c{constructor(){super(...arguments),this.output=r.Color,this.textureCoordinateType=i.None,this.componentData=e.Uniform,this.cullFace=h.Back,this.vertexDiscardMode=t.None,this.doubleSidedMode=a.WindingOrder,this.alphaDiscardMode=u.Opaque,this.integratedMeshMode=T.None,this.transparencyPassType=y.NONE,this.ellipsoidMode=n.Earth,this.pbrMode=p.Disabled,this.normalType=s.Attribute,this.spherical=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasVertexColors=!1,this.hasNormals=!1,this.hasSlicePlane=!1,this.hasBaseColorTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.hasScreenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetalnessAndRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.isGround=!1,this.hasCloudsReflections=!0,this.snowCover=!1,this.objectAndLayerIdColor=!1}}o([l({count:r.COUNT})],m.prototype,"output",void 0),o([l({count:i.COUNT})],m.prototype,"textureCoordinateType",void 0),o([l({count:e.COUNT})],m.prototype,"componentData",void 0),o([l({count:h.COUNT})],m.prototype,"cullFace",void 0),o([l({count:t.COUNT})],m.prototype,"vertexDiscardMode",void 0),o([l({count:a.COUNT})],m.prototype,"doubleSidedMode",void 0),o([l({count:u.COUNT})],m.prototype,"alphaDiscardMode",void 0),o([l({count:T.COUNT})],m.prototype,"integratedMeshMode",void 0),o([l({count:y.COUNT})],m.prototype,"transparencyPassType",void 0),o([l({count:n.COUNT})],m.prototype,"ellipsoidMode",void 0),o([l({count:p.COUNT})],m.prototype,"pbrMode",void 0),o([l({count:s.COUNT})],m.prototype,"normalType",void 0),o([l()],m.prototype,"spherical",void 0),o([l()],m.prototype,"doublePrecisionRequiresObfuscation",void 0),o([l()],m.prototype,"hasVertexColors",void 0),o([l()],m.prototype,"hasNormals",void 0),o([l()],m.prototype,"hasSlicePlane",void 0),o([l()],m.prototype,"hasBaseColorTexture",void 0),o([l()],m.prototype,"receiveAmbientOcclusion",void 0),o([l()],m.prototype,"receiveShadows",void 0),o([l()],m.prototype,"blendingEnabled",void 0),o([l()],m.prototype,"hasScreenSpaceReflections",void 0),o([l()],m.prototype,"hasPolygonOffset",void 0),o([l()],m.prototype,"hasMetalnessAndRoughnessTexture",void 0),o([l()],m.prototype,"hasEmissionTexture",void 0),o([l()],m.prototype,"hasOcclusionTexture",void 0),o([l()],m.prototype,"hasNormalTexture",void 0),o([l()],m.prototype,"hasOccludees",void 0),o([l()],m.prototype,"hasMultipassTerrain",void 0),o([l()],m.prototype,"cullAboveGround",void 0),o([l()],m.prototype,"isGround",void 0),o([l()],m.prototype,"hasCloudsReflections",void 0),o([l()],m.prototype,"snowCover",void 0),o([l()],m.prototype,"objectAndLayerIdColor",void 0),o([l({constValue:d.Draw})],m.prototype,"pbrTextureBindType",void 0),o([l({constValue:!0})],m.prototype,"hasSliceHighlight",void 0),o([l({constValue:!1})],m.prototype,"hasSliceInVertexProgram",void 0),o([l({constValue:!1})],m.prototype,"useCustomDTRExponentForWater",void 0),o([l({constValue:!1})],m.prototype,"hasVertexTangents",void 0),o([l({constValue:!0})],m.prototype,"supportsTextureAtlas",void 0),o([l({constValue:!1})],m.prototype,"highStepCount",void 0),o([l({constValue:!1})],m.prototype,"instancedDoublePrecision",void 0),o([l({constValue:!0})],m.prototype,"useFillLights",void 0),o([l({constValue:!1})],m.prototype,"objectAndLayerIdColorInstanced",void 0);export{m as ComponentTechniqueConfiguration,T as IntegratedMeshMode,v as PassDiscardMode};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../../../../geometry/support/Ellipsoid.js";import"../../../../../terrain/interfaces.js";import"../ComponentTechniqueConfiguration.js";import"./ComponentData.glsl.js";import"./VertexDiscardByOpacity.glsl.js";import"../../../../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../../../../core/shaderLibrary/ShaderOutput.js";import"../../../../core/shaderLibrary/Slice.glsl.js";import"../../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import"../../../../core/shaderLibrary/output/OutputDepth.glsl.js";import"../../../../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../../../../core/shaderLibrary/output/ReadLinearDepth.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeShadingNormal.glsl.js";import"../../../../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../../../../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../../../../core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import"../../../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../../../../core/shaderLibrary/terrain/Overlay.glsl.js";import"../../../../core/shaderLibrary/util/AlphaCutoff.js";import"../../../../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../../../../core/shaderLibrary/util/EllipsoidMode.js";import"../../../../core/shaderModules/Float3PassUniform.js";import"../../../../core/shaderModules/FloatPassUniform.js";import"../../../../core/shaderModules/interfaces.js";import"../../../../core/shaderModules/ShaderBuilder.js";import"../../../../core/shaderModules/Texture2DPassUniform.js";import"../../../../lib/TransparencyPassType.js";export{b as build,g as getOverlayNormalTexture}from"../../../../../../../chunks/ComponentShader.glsl.js";
|
|
5
|
+
import"../../../../../../../geometry/support/Ellipsoid.js";import"../../../../../terrain/interfaces.js";import"../ComponentTechniqueConfiguration.js";import"./ComponentData.glsl.js";import"./VertexDiscardByOpacity.glsl.js";import"../../../../core/shaderLibrary/ForwardLinearDepth.glsl.js";import"../../../../core/shaderLibrary/ShaderOutput.js";import"../../../../core/shaderLibrary/Slice.glsl.js";import"../../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import"../../../../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../../../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexNormal.glsl.js";import"../../../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import"../../../../core/shaderLibrary/output/OutputDepth.glsl.js";import"../../../../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../../../../core/shaderLibrary/output/ReadLinearDepth.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeMaterialColor.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeNormalTexture.glsl.js";import"../../../../core/shaderLibrary/shading/ComputeShadingNormal.glsl.js";import"../../../../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../../../../core/shaderLibrary/shading/MultipassTerrainTest.glsl.js";import"../../../../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import"../../../../core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js";import"../../../../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../../../../core/shaderLibrary/terrain/Overlay.glsl.js";import"../../../../core/shaderLibrary/util/AlphaCutoff.js";import"../../../../core/shaderLibrary/util/AlphaDiscard.glsl.js";import"../../../../core/shaderLibrary/util/EllipsoidMode.js";import"../../../../core/shaderModules/Float3PassUniform.js";import"../../../../core/shaderModules/FloatPassUniform.js";import"../../../../core/shaderModules/interfaces.js";import"../../../../core/shaderModules/ShaderBuilder.js";import"../../../../core/shaderModules/Texture2DPassUniform.js";import"../../../../lib/TransparencyPassType.js";export{b as build,g as getOverlayNormalTexture}from"../../../../../../../chunks/ComponentShader.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/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as s}from"../../../../../chunks/tslib.es6.js";import{
|
|
5
|
+
import{_ as s}from"../../../../../chunks/tslib.es6.js";import{AutoDisposable as t,autoDispose as i}from"../../lib/AutoDisposable.js";class o extends t{constructor(s,t,i,o){super(),this.primitiveType=t,this.parameters=i,this.indexed=o,this.vao=s}}s([i()],o.prototype,"vao",void 0);export{o as RenderGeometry};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{c as t}from"../../../../../chunks/vec3f64.js";import{VertexNormalPassParameters as
|
|
5
|
+
import{c as t}from"../../../../../chunks/vec3f64.js";import{VertexNormalPassParameters as r,VertexNormalDrawParameters as e}from"../shaderLibrary/attributes/VertexNormal.glsl.js";class s extends r{constructor(){super(...arguments),this.slicePlaneLocalOrigin=t(),this.origin=this.slicePlaneLocalOrigin}}class i extends e{}var a,o;!function(t){t[t.Material=0]="Material",t[t.ShadowMap=1]="ShadowMap",t[t.Highlight=2]="Highlight"}(a||(a={})),function(t){t[t.Color=0]="Color",t[t.Alpha=1]="Alpha",t[t.Depth=2]="Depth",t[t.Normal=3]="Normal",t[t.ObjectAndLayerIdColor=4]="ObjectAndLayerIdColor"}(o||(o={}));class l extends s{constructor(){super(...arguments),this.identifier=a.Material,this.transparent=!1,this.integratedMesh=!1}}class n extends s{constructor(){super(...arguments),this.identifier=a.ShadowMap}}class c extends s{constructor(){super(...arguments),this.identifier=a.Highlight}}export{i as DrawParameters,c as HighlightPassParameters,l as MaterialPassParameters,o as MaterialSubPass,s as PassParameters,a as RenderPassIdentifier,n as ShadowMapPassParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as s}from"../../../../../core/maybe.js";import{f as a,t as e,g as t}from"../../../../../chunks/mat3.js";import{c as r}from"../../../../../chunks/mat3f64.js";import{c as i}from"../../../../../chunks/mat4.js";import{s as h,c as m}from"../../../../../chunks/vec3.js";import{c as n}from"../../../../../chunks/vec3f64.js";import{MaterialPassParameters as o,ShadowMapPassParameters as P,HighlightPassParameters as l,MaterialSubPass as
|
|
5
|
+
import{isSome as s}from"../../../../../core/maybe.js";import{f as a,t as e,g as t}from"../../../../../chunks/mat3.js";import{c as r}from"../../../../../chunks/mat3f64.js";import{c as i}from"../../../../../chunks/mat4.js";import{s as h,c as m}from"../../../../../chunks/vec3.js";import{c as n}from"../../../../../chunks/vec3f64.js";import{MaterialPassParameters as o,ShadowMapPassParameters as P,HighlightPassParameters as l,MaterialSubPass as d,RenderPassIdentifier as p}from"./AllRenderPasses.js";import{RenderPass as c,RenderPassSorting as u}from"./RenderPass.js";import{ShaderOutput as _}from"../shaderLibrary/ShaderOutput.js";import{TwoVectorPosition as g}from"../util/TwoVectorPosition.js";import{union as b}from"../../lib/depthRange.js";import{RenderSlot as w}from"../../lib/RenderSlot.js";class f{constructor(s,a){this.rctx=s,this.shaderTechniqueRepository=a,this.canRender=!0,this._materialPassParameters=new o,this._shadowPassParameters=new P,this._highlightPassParameters=new l,this._systems=new Set,this._passes={materialOpaque:new c(s,a),materialTransparent:new c(s,a,u.BackToFront),materialIntegratedMesh:new c(s,a),shadowMap:new c(s,a),highlight:new c(s,a),highlightIntegratedMesh:new c(s,a),highlightShadowMap:new c(s,a),defaultShadowMap:new c(s,a)}}register(s){this._systems.add(s)}prepareRender(s){if(0!==this._systems.size){for(const s of Object.values(this._passes))s.prepareSubmit();this._systems.forEach((a=>a.submit(this._passes,s.bindParameters)));for(const s of Object.values(this._passes))s.finishSubmit();this.shaderTechniqueRepository.frameUpdate()}}render(s){if(0!==this._systems.size)switch(this._configure(s),s.bindParameters.slot){case w.OPAQUE_MATERIAL:switch(s.output){case _.Color:return this._materialPassParameters.subPass=d.Color,this._passes.materialOpaque.dispatch(this._materialPassParameters,s.bindParameters);case _.Depth:return this._materialPassParameters.subPass=d.Depth,this._passes.materialOpaque.dispatch(this._materialPassParameters,s.bindParameters);case _.Normal:return this._materialPassParameters.subPass=d.Normal,this._passes.materialOpaque.dispatch(this._materialPassParameters,s.bindParameters);case _.Highlight:return this._passes.highlight.dispatch(this._highlightPassParameters,s.bindParameters);case _.Shadow:return this._passes.shadowMap.dispatch(this._shadowPassParameters,s.bindParameters);case _.ShadowHighlight:return this._passes.highlightShadowMap.dispatch(this._shadowPassParameters,s.bindParameters);case _.ShadowExludeHighlight:return this._passes.defaultShadowMap.dispatch(this._shadowPassParameters,s.bindParameters);case _.ObjectAndLayerIdColor:return this._materialPassParameters.subPass=d.ObjectAndLayerIdColor,this._passes.materialOpaque.dispatch(this._materialPassParameters,s.bindParameters)}return;case w.TRANSPARENT_MATERIAL:switch(s.output){case _.Color:return this._materialPassParameters.subPass=d.Color,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters);case _.Alpha:return this._materialPassParameters.subPass=d.Alpha,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters);case _.Depth:return this._materialPassParameters.subPass=d.Depth,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters);case _.Normal:return this._materialPassParameters.subPass=d.Normal,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters);case _.ObjectAndLayerIdColor:return this._materialPassParameters.subPass=d.ObjectAndLayerIdColor,this._passes.materialTransparent.dispatch(this._materialPassParameters,s.bindParameters)}return;case w.INTEGRATED_MESH:switch(s.output){case _.Color:return this._materialPassParameters.subPass=d.Color,this._passes.materialIntegratedMesh.dispatch(this._materialPassParameters,s.bindParameters);case _.Depth:return this._materialPassParameters.subPass=d.Depth,this._passes.materialIntegratedMesh.dispatch(this._materialPassParameters,s.bindParameters);case _.Normal:return this._materialPassParameters.subPass=d.Normal,this._passes.materialIntegratedMesh.dispatch(this._materialPassParameters,s.bindParameters);case _.Highlight:return this._passes.highlightIntegratedMesh.dispatch(this._highlightPassParameters,s.bindParameters);case _.ObjectAndLayerIdColor:return this._materialPassParameters.subPass=d.ObjectAndLayerIdColor,this._passes.materialIntegratedMesh.dispatch(this._materialPassParameters,s.bindParameters)}return}}notifyDirty(){this._context.requestRender()}slots(){return[w.OPAQUE_MATERIAL,w.TRANSPARENT_MATERIAL,w.INTEGRATED_MESH]}initializeRenderContext(s){this._context=s}uninitializeRenderContext(){}queryDepthRange(a){const e={near:1/0,far:-1/0};return this._systems.forEach((t=>{const r=t.queryShadowCasterDepthRange(a);s(r)&&b(e,r,e)})),e}_configure(s){const a=s.output===_.Shadow||s.output===_.ShadowHighlight||s.output===_.ShadowExludeHighlight?this._shadowPassParameters:s.output===_.Highlight?this._highlightPassParameters:this._materialPassParameters;this._updateParameters(s,a)}_updateParameters(s,r){const n=s.bindParameters.camera,o=n.viewInverseTransposeMatrix;h(T,o[3],o[7],o[11]),A.set(T),m(r.transformWorldFromViewTH,A.high),m(r.transformWorldFromViewTL,A.low),m(r.slicePlaneLocalOrigin,T),a(r.transformViewFromCameraRelativeRS,n.viewMatrix),i(r.transformProjFromView,n.projectionMatrix),r.identifier===p.Material&&(this._materialPassParameters.transparent=s.bindParameters.slot===w.TRANSPARENT_MATERIAL,this._materialPassParameters.integratedMesh=s.bindParameters.slot===w.INTEGRATED_MESH,e(R,r.transformViewFromCameraRelativeRS),t(r.transformNormalViewFromGlobal,R))}get needsHighlight(){return this._passes.highlight.count>0||this._passes.highlightIntegratedMesh.count>0}get needsTransparentPass(){return this._passes.materialTransparent.count>0}}const T=n(),R=r(),A=new g;export{f as RenderPassManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
var h;!function(h){h[h.Color=0]="Color",h[h.Depth=1]="Depth",h[h.Normal=2]="Normal",h[h.Shadow=3]="Shadow",h[h.ShadowHighlight=4]="ShadowHighlight",h[h.ShadowExludeHighlight=5]="ShadowExludeHighlight",h[h.Highlight=6]="Highlight",h[h.Alpha=7]="Alpha",h[h.
|
|
5
|
+
var h;!function(h){h[h.Color=0]="Color",h[h.Depth=1]="Depth",h[h.Normal=2]="Normal",h[h.Shadow=3]="Shadow",h[h.ShadowHighlight=4]="ShadowHighlight",h[h.ShadowExludeHighlight=5]="ShadowExludeHighlight",h[h.Highlight=6]="Highlight",h[h.Alpha=7]="Alpha",h[h.ObjectAndLayerIdColor=8]="ObjectAndLayerIdColor",h[h.COUNT=9]="COUNT"}(h||(h={}));export{h as ShaderOutput};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{unwrap as e,isNone as s,isSome as i}from"../../../../../core/maybe.js";import{h as a}from"../../../../../chunks/mat4.js";import{c as o}from"../../../../../chunks/mat4f64.js";import{
|
|
5
|
+
import{unwrap as e,isNone as s,isSome as i}from"../../../../../core/maybe.js";import{h as a}from"../../../../../chunks/mat4.js";import{c as o}from"../../../../../chunks/mat4f64.js";import{m as c,a as r,b as l,s as t}from"../../../../../chunks/vec3.js";import{Z as n,c as f}from"../../../../../chunks/vec3f64.js";import{Float3DrawUniform as d}from"../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as _}from"../shaderModules/Float3PassUniform.js";import{NoParameters as P,glsl as h}from"../shaderModules/interfaces.js";class m extends P{constructor(e){super(),this.slicePlaneLocalOrigin=e}}function p(s,i){H(s,i,[new _("slicePlaneOrigin",((e,s)=>v(i,e,s))),new _("slicePlaneBasis1",((s,a)=>B(i,s,a,e(a.slicePlane)?.basis1))),new _("slicePlaneBasis2",((s,a)=>B(i,s,a,e(a.slicePlane)?.basis2)))])}function u(s,i){H(s,i,[new d("slicePlaneOrigin",((e,s)=>v(i,e,s))),new d("slicePlaneBasis1",((s,a)=>B(i,s,a,e(a.slicePlane)?.basis1))),new d("slicePlaneBasis2",((s,a)=>B(i,s,a,e(a.slicePlane)?.basis2)))])}function H(e,s,i){if(!s.hasSlicePlane){const i=h`#define rejectBySlice(_pos_) false
|
|
6
6
|
#define discardBySlice(_pos_) {}
|
|
7
7
|
#define highlightSlice(_color_, _pos_) (_color_)`;return s.hasSliceInVertexProgram&&e.vertex.code.add(i),void e.fragment.code.add(i)}e.extensions.add("GL_OES_standard_derivatives"),s.hasSliceInVertexProgram&&e.vertex.uniforms.add(i),e.fragment.uniforms.add(i);const a=h`struct SliceFactors {
|
|
8
8
|
float front;
|
|
@@ -62,4 +62,4 @@ return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGH
|
|
|
62
62
|
}`,c=s.hasSliceHighlight?h`
|
|
63
63
|
${o}
|
|
64
64
|
#define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
|
|
65
|
-
`:h`#define highlightSlice(_color_, _pos_) (_color_)`;s.hasSliceInVertexProgram&&e.vertex.code.add(a),e.fragment.code.add(a),e.fragment.code.add(c)}function g(e,s,i){return e.instancedDoublePrecision?
|
|
65
|
+
`:h`#define highlightSlice(_color_, _pos_) (_color_)`;s.hasSliceInVertexProgram&&e.vertex.code.add(a),e.fragment.code.add(a),e.fragment.code.add(c)}function g(e,s,i){return e.instancedDoublePrecision?t(S,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]):s.slicePlaneLocalOrigin}function I(e,s){return i(e)?l(L,s.origin,e):s.origin}function b(e,s,o){return e.hasSliceTranslatedView?i(s)?a(T,o.camera.viewMatrix,s):o.camera.viewMatrix:null}function v(e,a,o){if(s(o.slicePlane))return n;const r=g(e,a,o),l=I(r,o.slicePlane),t=b(e,r,o);return i(t)?c(L,l,t):l}function B(e,a,o,t){if(s(t)||s(o.slicePlane))return n;const f=g(e,a,o),d=I(f,o.slicePlane),_=b(e,f,o);return i(_)?(r(G,t,d),c(L,d,_),c(G,G,_),l(G,G,L)):t}const S=f(),L=f(),G=f(),T=o();export{u as SliceDraw,p as SlicePass,m as SlicePlaneParameters};
|
package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{s as r}from"../../../../../../chunks/vec3.js";import{c as i}from"../../../../../../chunks/vec3f64.js";import{ShaderOutput as o}from"../ShaderOutput.js";import{DoublePrecision as n}from"../util/DoublePrecision.glsl.js";import{Float3DrawUniform as a}from"../../shaderModules/Float3DrawUniform.js";import{glsl as s}from"../../shaderModules/interfaces.js";import{Matrix4PassUniform as t}from"../../shaderModules/Matrix4PassUniform.js";import{
|
|
5
|
+
import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{s as r}from"../../../../../../chunks/vec3.js";import{c as i}from"../../../../../../chunks/vec3f64.js";import{ShaderOutput as o}from"../ShaderOutput.js";import{DoublePrecision as n}from"../util/DoublePrecision.glsl.js";import{Float3DrawUniform as a}from"../../shaderModules/Float3DrawUniform.js";import{glsl as s}from"../../shaderModules/interfaces.js";import{Matrix4PassUniform as t}from"../../shaderModules/Matrix4PassUniform.js";import{ShaderTechniqueConfiguration as c,parameter as d}from"../../shaderTechnique/ShaderTechniqueConfiguration.js";import{VertexAttribute as m}from"../../../lib/VertexAttribute.js";import{encodeDoubleHi as l,encodeDoubleLo as u}from"../../../../../webgl/doublePrecisionUtils.js";class v extends c{constructor(){super(...arguments),this.instancedDoublePrecision=!1}}function p(e,i){i.instanced&&i.instancedDoublePrecision&&(e.attributes.add(m.MODELORIGINHI,"vec3"),e.attributes.add(m.MODELORIGINLO,"vec3"),e.attributes.add(m.MODEL,"mat3"),e.attributes.add(m.MODELNORMAL,"mat3"));const c=e.vertex;i.instancedDoublePrecision&&(c.include(n,i),c.uniforms.add(new a("viewOriginHi",((e,i)=>l(r(x,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]),x)))),c.uniforms.add(new a("viewOriginLo",((e,i)=>u(r(x,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]),x))))),c.code.add(s`
|
|
6
6
|
vec3 calculateVPos() {
|
|
7
7
|
${i.instancedDoublePrecision?"return model * localPosition().xyz;":"return localPosition().xyz;"}
|
|
8
8
|
}
|
|
@@ -25,4 +25,4 @@ import{_ as e}from"../../../../../../chunks/tslib.es6.js";import{s as r}from"../
|
|
|
25
25
|
${i.instancedDoublePrecision?"return vec4(modelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
|
|
26
26
|
|
|
27
27
|
}
|
|
28
|
-
`)}e([
|
|
28
|
+
`)}e([d()],v.prototype,"instancedDoublePrecision",void 0);const x=i();export{v as InstancedDoubleConfiguration,p as InstancedDoublePrecision};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{ShaderOutput as o}from"../ShaderOutput.js";import{glsl as r}from"../../shaderModules/interfaces.js";import{VertexAttribute as e}from"../../../lib/VertexAttribute.js";function d(d,t){const a=t.output===o.ObjectAndLayerIdColor,n=t.objectAndLayerIdColorInstanced;a&&(d.varyings.add("objectAndLayerIdColorVarying","vec4"),n?d.attributes.add(e.OBJECTANDLAYERIDCOLOR_INSTANCED,"vec4"):d.attributes.add(e.OBJECTANDLAYERIDCOLOR,"vec4")),d.vertex.code.add(r`
|
|
6
|
+
void forwardObjectAndLayerIdColor() {
|
|
7
|
+
${a?n?r`objectAndLayerIdColorVarying = objectAndLayerIdColor_instanced * 0.003921568627451;`:r`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;`:r``} }`),d.fragment.code.add(r`
|
|
8
|
+
void outputObjectAndLayerIdColor() {
|
|
9
|
+
${a?r`gl_FragColor = objectAndLayerIdColorVarying;`:r``} }`)}export{d as ObjectAndLayerIdColor};
|
package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js
CHANGED
|
@@ -2,59 +2,60 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as o}from"../../../../../../core/maybe.js";import{I as r}from"../../../../../../chunks/mat4f64.js";import{ShaderOutput as e}from"../ShaderOutput.js";import{SliceDraw as t}from"../Slice.glsl.js";import{Transform as i}from"../Transform.glsl.js";import{NormalAttribute as a,NormalAttributeType as s}from"../attributes/NormalAttribute.glsl.js";import{
|
|
5
|
+
import{isSome as o}from"../../../../../../core/maybe.js";import{I as r}from"../../../../../../chunks/mat4f64.js";import{ShaderOutput as e}from"../ShaderOutput.js";import{SliceDraw as t}from"../Slice.glsl.js";import{Transform as i}from"../Transform.glsl.js";import{NormalAttribute as a,NormalAttributeType as s}from"../attributes/NormalAttribute.glsl.js";import{ObjectAndLayerIdColor as l}from"../attributes/ObjectAndLayerIdColor.glsl.js";import{TextureCoordinateAttribute as d}from"../attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormal as n}from"../attributes/VertexNormal.glsl.js";import{OutputDepth as u}from"../output/OutputDepth.glsl.js";import{OutputHighlight as m}from"../output/OutputHighlight.glsl.js";import{VisualVariables as c}from"../shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as p}from"../util/AlphaDiscard.glsl.js";import{addProjViewLocalOrigin as v}from"../util/View.glsl.js";import{Float2PassUniform as f}from"../../shaderModules/Float2PassUniform.js";import{glsl as g}from"../../shaderModules/interfaces.js";import{Matrix4PassUniform as h}from"../../shaderModules/Matrix4PassUniform.js";import{Texture2DPassUniform as x}from"../../shaderModules/Texture2DPassUniform.js";function j(j,C){const w=j.vertex.code,O=j.fragment.code,b=C.hasModelTransformation;switch(b&&j.vertex.uniforms.add(new h("model",(e=>o(e.modelTransformation)?e.modelTransformation:r))),C.output){case e.Depth:case e.Shadow:case e.ShadowHighlight:case e.ShadowExludeHighlight:case e.ObjectAndLayerIdColor:v(j,C),j.include(i,C),j.include(d,C),j.include(c,C),j.include(u,C),j.include(t,C),j.include(l,C),j.vertex.uniforms.add(new f("nearFar",((o,r)=>r.camera.nearFar))),j.varyings.add("depth","float"),C.hasColorTexture&&j.fragment.uniforms.add(new x("tex",(o=>o.texture))),w.add(g`
|
|
6
6
|
void main(void) {
|
|
7
7
|
vpos = calculateVPos();
|
|
8
8
|
vpos = subtractOrigin(vpos);
|
|
9
9
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
10
|
-
gl_Position = transformPositionWithDepth(proj, view, ${
|
|
10
|
+
gl_Position = transformPositionWithDepth(proj, view, ${b?"model,":""} vpos, nearFar, depth);
|
|
11
11
|
forwardTextureCoordinates();
|
|
12
|
+
forwardObjectAndLayerIdColor();
|
|
12
13
|
}
|
|
13
|
-
`),
|
|
14
|
+
`),j.include(p,C),O.add(g`
|
|
14
15
|
void main(void) {
|
|
15
16
|
discardBySlice(vpos);
|
|
16
|
-
${
|
|
17
|
+
${C.hasColorTexture?g`
|
|
17
18
|
vec4 texColor = texture2D(tex, vuv0);
|
|
18
19
|
discardOrAdjustAlpha(texColor);`:""}
|
|
19
|
-
outputDepth(depth)
|
|
20
|
+
${C.output===e.ObjectAndLayerIdColor?g`outputObjectAndLayerIdColor();`:g`outputDepth(depth);`}
|
|
20
21
|
}
|
|
21
|
-
`);break;case e.Normal:
|
|
22
|
+
`);break;case e.Normal:v(j,C),j.include(i,C),j.include(a,C),j.include(n,C),j.include(d,C),j.include(c,C),C.hasColorTexture&&j.fragment.uniforms.add(new x("tex",(o=>o.texture))),j.varyings.add("vPositionView","vec3"),w.add(g`
|
|
22
23
|
void main(void) {
|
|
23
24
|
vpos = calculateVPos();
|
|
24
25
|
vpos = subtractOrigin(vpos);
|
|
25
|
-
${
|
|
26
|
+
${C.normalType===s.Attribute?g`
|
|
26
27
|
vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:""}
|
|
27
28
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
28
|
-
gl_Position = transformPosition(proj, view, ${
|
|
29
|
+
gl_Position = transformPosition(proj, view, ${b?"model,":""} vpos);
|
|
29
30
|
forwardTextureCoordinates();
|
|
30
31
|
}
|
|
31
|
-
`),
|
|
32
|
+
`),j.include(t,C),j.include(p,C),O.add(g`
|
|
32
33
|
void main() {
|
|
33
34
|
discardBySlice(vpos);
|
|
34
|
-
${
|
|
35
|
+
${C.hasColorTexture?g`
|
|
35
36
|
vec4 texColor = texture2D(tex, vuv0);
|
|
36
37
|
discardOrAdjustAlpha(texColor);`:""}
|
|
37
38
|
|
|
38
|
-
${
|
|
39
|
-
vec3 normal = screenDerivativeNormal(vPositionView);`:
|
|
39
|
+
${C.normalType===s.ScreenDerivative?g`
|
|
40
|
+
vec3 normal = screenDerivativeNormal(vPositionView);`:g`
|
|
40
41
|
vec3 normal = normalize(vNormalWorld);
|
|
41
42
|
if (gl_FrontFacing == false) normal = -normal;`}
|
|
42
43
|
gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);
|
|
43
44
|
}
|
|
44
|
-
`);break;case e.Highlight:
|
|
45
|
+
`);break;case e.Highlight:v(j,C),j.include(i,C),j.include(d,C),j.include(c,C),C.hasColorTexture&&j.fragment.uniforms.add(new x("tex",(o=>o.texture))),w.add(g`
|
|
45
46
|
void main(void) {
|
|
46
47
|
vpos = calculateVPos();
|
|
47
48
|
vpos = subtractOrigin(vpos);
|
|
48
49
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
49
|
-
gl_Position = transformPosition(proj, view, ${
|
|
50
|
+
gl_Position = transformPosition(proj, view, ${b?"model,":""} vpos);
|
|
50
51
|
forwardTextureCoordinates();
|
|
51
52
|
}
|
|
52
|
-
`),
|
|
53
|
+
`),j.include(t,C),j.include(p,C),j.include(m),O.add(g`
|
|
53
54
|
void main() {
|
|
54
55
|
discardBySlice(vpos);
|
|
55
|
-
${
|
|
56
|
+
${C.hasColorTexture?g`
|
|
56
57
|
vec4 texColor = texture2D(tex, vuv0);
|
|
57
58
|
discardOrAdjustAlpha(texColor);`:""}
|
|
58
59
|
outputHighlight();
|
|
59
60
|
}
|
|
60
|
-
`)}}export{
|
|
61
|
+
`)}}export{j as DefaultMaterialAuxiliaryPasses};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{VertexAttribute as O}from"./VertexAttribute.js";const E=new Map([[O.POSITION,0],[O.NORMAL,1],[O.UV0,2],[O.COLOR,3],[O.SIZE,4],[O.TANGENT,4],[O.AUXPOS1,5],[O.SYMBOLCOLOR,5],[O.AUXPOS2,6],[O.FEATUREATTRIBUTE,6],[O.INSTANCEFEATUREATTRIBUTE,6],[O.INSTANCECOLOR,7],[O.MODEL,8],[O.MODELNORMAL,12],[O.MODELORIGINHI,11],[O.MODELORIGINLO,15]]);export{E as Default3D};
|
|
5
|
+
import{VertexAttribute as O}from"./VertexAttribute.js";const E=new Map([[O.POSITION,0],[O.NORMAL,1],[O.UV0,2],[O.COLOR,3],[O.SIZE,4],[O.TANGENT,4],[O.AUXPOS1,5],[O.SYMBOLCOLOR,5],[O.AUXPOS2,6],[O.FEATUREATTRIBUTE,6],[O.INSTANCEFEATUREATTRIBUTE,6],[O.OBJECTANDLAYERIDCOLOR,6],[O.OBJECTANDLAYERIDCOLOR_INSTANCED,6],[O.INSTANCECOLOR,7],[O.MODEL,8],[O.MODELNORMAL,12],[O.MODELORIGINHI,11],[O.MODELORIGINLO,15]]);export{E as Default3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as t}from"../../../../core/maybe.js";import{PrimitiveType as e}from"./basicInterfaces.js";import{BoundingInfo as i}from"./BoundingInfo.js";import{ContentObject as n}from"./ContentObject.js";import{ContentObjectType as s}from"./ContentObjectType.js";import{generateDefaultIndexArray as r,computeAttachmentOriginTriangles as o,computeAttachmentOriginPoints as u}from"./geometryDataUtils.js";import{assert as h}from"./Util.js";import{VertexAttribute as c}from"./VertexAttribute.js";class g extends n{constructor(t,i=[],n=e.Triangle,o=-1){super(),this._primitiveType=n,this.
|
|
5
|
+
import{isNone as t}from"../../../../core/maybe.js";import{PrimitiveType as e}from"./basicInterfaces.js";import{BoundingInfo as i}from"./BoundingInfo.js";import{ContentObject as n}from"./ContentObject.js";import{ContentObjectType as s}from"./ContentObjectType.js";import{generateDefaultIndexArray as r,computeAttachmentOriginTriangles as o,computeAttachmentOriginPoints as u}from"./geometryDataUtils.js";import{assert as h}from"./Util.js";import{VertexAttribute as c}from"./VertexAttribute.js";class g extends n{constructor(t,i=[],n=e.Triangle,o=null,u=-1){super(),this._primitiveType=n,this.objectAndLayerIdColor=o,this.edgeIndicesLength=u,this.type=s.Geometry,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[e,s]of t)s&&this._vertexAttributes.set(e,{...s});if(null==i||0===i.length){const t=d(this._vertexAttributes),e=r(t);this.edgeIndicesLength=this.edgeIndicesLength<0?t:this.edgeIndicesLength;for(const i of this._vertexAttributes.keys())this._indices.set(i,e)}else for(const[e,s]of i)s&&(this._indices.set(e,l(s)),e===c.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}cloneShallow(){const t=new g([],void 0,this._primitiveType,this.objectAndLayerIdColor,void 0),{_vertexAttributes:e,_indices:i}=t;return this._vertexAttributes.forEach(((t,i)=>{e.set(i,t)})),this._indices.forEach(((t,e)=>{i.set(e,t)})),t.screenToWorldRatio=this.screenToWorldRatio,t._boundingInfo=this._boundingInfo,t}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(t){const e=this._vertexAttributes.get(t);return e&&!e.exclusive&&(e.data=Array.from(e.data),e.exclusive=!0),e}get indices(){return this._indices}get indexCount(){const t=this._indices.values().next().value;return t?t.length:0}get primitiveType(){return this._primitiveType}get faceCount(){return this.indexCount/3}get boundingInfo(){return t(this._boundingInfo)&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(t){return this.primitiveType===e.Triangle?this._computeAttachmentOriginTriangles(t):this._computeAttachmentOriginPoints(t)}_computeAttachmentOriginTriangles(t){const e=this.indices.get(c.POSITION),i=this.vertexAttributes.get(c.POSITION);return o(i,e,t)}_computeAttachmentOriginPoints(t){const e=this.indices.get(c.POSITION),i=this.vertexAttributes.get(c.POSITION);return u(i,e,t)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const t=this.indices.get(c.POSITION);if(!t||0===t.length)return null;const n=this.primitiveType===e.Triangle?3:1;h(t.length%n==0,"Indexing error: "+t.length+" not divisible by "+n);const s=r(t.length/n),o=this.vertexAttributes.get(c.POSITION);return o?new i(s,n,t,o):null}}function d(t){const e=t.values().next().value;return null==e?0:e.data.length/e.size}function l(t){if(t.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT)return t;for(const e of t)if(e>=65536)return t;return new Uint16Array(t)}export{g as Geometry};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as t,unwrapOr as r}from"../../../../core/maybe.js";import{c as s}from"../../../../chunks/mat4.js";import{c as i,I as e}from"../../../../chunks/mat4f64.js";import{a,m as n,g as o,l as h,c as d,n as c}from"../../../../chunks/vec3.js";import{c as l,U as m}from"../../../../chunks/vec3f64.js";import{t as f}from"../../../../chunks/vec4.js";import{c as y}from"../../../../chunks/vec4f64.js";import{create as u,fromPoints as p,copy as g}from"../../../../geometry/support/ray.js";import{ViewingMode as _}from"../../../ViewingMode.js";import{IntersectorOptions as O,
|
|
5
|
+
import{isSome as t,unwrapOr as r}from"../../../../core/maybe.js";import{c as s}from"../../../../chunks/mat4.js";import{c as i,I as e}from"../../../../chunks/mat4f64.js";import{a,m as n,g as o,l as h,c as d,n as c}from"../../../../chunks/vec3.js";import{c as l,U as m}from"../../../../chunks/vec3f64.js";import{t as f}from"../../../../chunks/vec4.js";import{c as y}from"../../../../chunks/vec4f64.js";import{create as u,fromPoints as p,copy as g}from"../../../../geometry/support/ray.js";import{ViewingMode as _}from"../../../ViewingMode.js";import{IntersectorOptions as O,StoreResults as L,IntersectorType as j}from"./IntersectorInterfaces.js";import{isValidIntersectorResult as E}from"./intersectorUtils.js";import{IntersectorTransform as v,getVerticalOffsetObject3D as w}from"./verticalOffsetUtils.js";import{isInstanceHidden as b}from"../materials/renderers/utils.js";const A=1e-5;class T{constructor(t){this.options=new O,this._results=new I,this.transform=new v,this.tolerance=A,this.verticalOffset=null,this._ray=u(),this._rayEnd=l(),this._rayBeginTransformed=l(),this._rayEndTransformed=l(),this.viewingMode=t??_.Global}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(t,r,s){this.resetWithRay(p(t,r,this._ray),s)}resetWithRay(t,r){this.camera=r,t!==this._ray&&g(t,this._ray),0!==this.options.verticalOffset?this.viewingMode===_.Local?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null,a(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray)}intersect(r=null,s,i,e,a){this.point=s,this.filterPredicate=e,this.tolerance=i??A;const n=w(this.verticalOffset);if(t(r)&&r.length>0){const s=a?t=>{a(t)&&this.intersectObject(t)}:t=>{this.intersectObject(t)};for(const i of r){const r=i.getSpatialQueryAccelerator&&i.getSpatialQueryAccelerator();t(r)?(t(n)?r.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,s,n):r.forEachAlongRay(this._ray.origin,this._ray.direction,s),this.options.selectionMode&&this.options.hud&&r.forEachDegenerateObject(s)):i.objects.forAll((t=>s(t)))}}this.sortResults()}intersectObject(r){const s=r.geometryRecords;if(!s)return;const i=r.transformation,a=w(this.verticalOffset);for(const o of s){const{geometry:s,material:h,instanceParameters:d}=o;if(b(d))continue;const c=s.id;this.transform.setAndInvalidateLazyTransforms(i,o.getShaderTransformation()),n(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),n(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const l=this.transform.transform;t(a)&&(a.objectTransform=this.transform),h.intersect(s,d,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,((s,i,a,n,o,h)=>{if(s>=0){if(t(this.filterPredicate)&&!this.filterPredicate(this._ray.origin,this._rayEnd,s))return;const d=n?this._results.hud:this._results,m=n?n=>{const d={object:r,geometryId:c,triangleNr:a,center:t(h)?[h[0],h[1],h[2]]:null};n.set(j.HUD,d,s,i,e,o)}:t=>t.set(j.OBJECT,{object:r,geometryId:c,triangleNr:a},s,i,l,o);if((null==d.min.drapedLayerOrder||o>=d.min.drapedLayerOrder)&&(null==d.min.dist||s<d.min.dist)&&m(d.min),this.options.store!==L.MIN&&(null==d.max.drapedLayerOrder||o<d.max.drapedLayerOrder)&&(null==d.max.dist||s>d.max.dist)&&m(d.max),this.options.store===L.ALL)if(n){const t=new M(this._ray);m(t),this._results.hud.all.push(t)}else{const t=new N(this._ray);m(t),this._results.all.push(t)}}}),o.shaderTransformation)}}sortResults(t=this._results.all){t.sort(((t,s)=>t.dist!==s.dist?r(t.dist,0)-r(s.dist,0):t.drapedLayerOrder!==s.drapedLayerOrder?r(t.drapedLayerOrder,Number.MAX_VALUE)-r(s.drapedLayerOrder,Number.MAX_VALUE):r(s.drapedLayerGraphicOrder,Number.MIN_VALUE)-r(t.drapedLayerGraphicOrder,Number.MIN_VALUE)))}}function x(t){return new T(t)}class I{constructor(){this.min=new N(u()),this.max=new N(u()),this.hud={min:new M(u()),max:new M(u()),all:new Array},this.ground=new N(u()),this.all=[]}init(t){this.min.init(t),this.max.init(t),this.ground.init(t),this.all.length=0,this.hud.min.init(t),this.hud.max.init(t),this.hud.all.length=0}}class N{constructor(t){this.intersector=j.OBJECT,this.normal=l(),this.transformation=i(),this._ray=u(),this.init(t)}get ray(){return this._ray}get distanceInRenderSpace(){return t(this.dist)?(o(B,this.ray.direction,this.dist),h(B)):null}getIntersectionPoint(t){return!!E(this)&&(o(B,this.ray.direction,this.dist),a(t,this.ray.origin,B),!0)}getTransformedNormal(t){return d(R,this.normal),R[3]=0,f(R,R,this.transformation),d(t,R),c(t,t)}init(t){this.dist=null,this.target=null,this.drapedLayerOrder=null,this.drapedLayerGraphicOrder=null,this.intersector=j.OBJECT,g(t,this._ray)}set(t,i,a,n,o,h,c){this.intersector=t,this.dist=a,d(this.normal,r(n,m)),s(this.transformation,r(o,e)),this.target=i,this.drapedLayerOrder=h,this.drapedLayerGraphicOrder=c}copy(t){g(t.ray,this._ray),this.intersector=t.intersector,this.dist=t.dist,this.target=t.target,this.drapedLayerOrder=t.drapedLayerOrder,this.drapedLayerGraphicOrder=t.drapedLayerGraphicOrder,d(this.normal,t.normal),s(this.transformation,t.transformation)}}class M extends N{constructor(){super(...arguments),this.intersector=j.HUD}}function U(t){return new N(t)}const B=l(),R=y();export{A as DEFAULT_TOLERANCE,x as newIntersector,U as newIntersectorResult};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import e from"../../../../core/Logger.js";import{f as r}from"../../../../chunks/vec4f64.js";import{BufferViewVec4u8 as o}from"../../../../geometry/support/buffer/BufferView.js";class t{}class i{constructor(){this.colorZero=new o(new ArrayBuffer(4)),this._uidToRenderColor=new Map,this._colorToUID=new Map,this._layerUidToGraphicsUidToObjectId=new Map,this._layerUidToId=new Map}setUidToObjectAndLayerId(e,r,o,t){if(!(e&&r&&o&&t))return;this._layerUidToId.set(t,o);let i=this._layerUidToGraphicsUidToObjectId.get(t);i||(i=new Map,this._layerUidToGraphicsUidToObjectId.set(t,i)),i.set(r,e)}getObjectAndLayerIdColor(e){const o=this.getObjectAndLayerIdColorArray(e);return r(o.get(0,1),o.get(0,2),o.get(0,3),255)}getObjectAndLayerIdColorArray(e){if(!e.layerUid||!e.graphicUid)return this.colorZero;let r=this._uidToRenderColor.get(e.layerUid);r||(r=new Map,this._uidToRenderColor.set(e.layerUid,r));let t=r.get(e.graphicUid);if(!t){for(;!t;){const e=Math.floor(16777214*Math.random())+1;this._colorToUID.has(e)||(t=e)}if(t>16777215)throw new Error("Object ID Overflow");r.set(e.graphicUid,t),this._colorToUID.set(t,e)}const i=new ArrayBuffer(4);new DataView(i).setUint32(0,t,!1);return new o(i)}getColorToObjectAndLayerIdMapping(){const r=new Map;for(const[o,t]of this._colorToUID.entries()){const i=this._layerUidToGraphicsUidToObjectId.get(t.layerUid);let a=null;i?(a=i.get(t.graphicUid),a||e.getLogger(this.declaredClass).warn("getColorMapping: no entry found for graphicsId "+t.graphicUid)):e.getLogger(this.declaredClass).warn("getColorMapping: no entry found for layerUid "+t.layerUid);const d=this._layerUidToId.get(t.layerUid);d||e.getLogger(this.declaredClass).warn("no layerId found for uid "+t.layerUid),a&&d&&r.set(o,{oid:a,lid:d})}return r}}export{t as GraphicAndLayerUID,i as ObjectAndLayerIdRenderHelper};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../../../../core/maybe.js";import t from"../../../../core/ObjectPool.js";import n from"../../../../core/PooledArray.js";import{g as o,a as s,d as r,c as i,h}from"../../../../chunks/vec3.js";import{f as a,c as d}from"../../../../chunks/vec3f64.js";import{intersectsSphere as l}from"../../../../geometry/support/frustum.js";import{wrap as c}from"../../../../geometry/support/ray.js";import{h as u,a as f,g as _,j as m,c as p}from"../../../../chunks/sphere.js";import{rayBoxTest as b}from"./Util.js";class g{constructor(e,t){this._objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new O,this._objectCount=0,t&&(void 0!==t.maximumObjectsPerNode&&(this._maximumObjectsPerNode=t.maximumObjectsPerNode),void 0!==t.maximumDepth&&(this._maximumDepth=t.maximumDepth))}get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}destroy(){this._degenerateObjects.clear(),O.clearPool(),B[0]=null,w.prune(),W.prune()}add(e,t=e.length){this._objectCount+=t,this._grow(e,t);const n=O.acquire();for(let o=0;o<t;o++){const t=e[o];this._isDegenerate(t)?this._degenerateObjects.add(t):(n.init(this._root),this._add(t,n))}O.release(n)}remove(t,n=null){this._objectCount-=t.length;const o=O.acquire();for(const s of t){const t=e(n)?n:u(this._objectToBoundingSphere(s),C);z(t[3])?(o.init(this._root),this._remove(s,t,o)):this._degenerateObjects.delete(s)}O.release(o),this._shrink()}update(e,t){if(!z(t[3])&&this._isDegenerate(e))return;const n=R(e);this.remove(n,t),this.add(n)}forEachAlongRay(e,t,n){const o=c(e,t);this._forEachNode(this._root,(e=>{if(!this._intersectsNode(o,e))return!1;const t=e.node;return t.terminals.forAll((e=>{this._intersectsObject(o,e)&&n(e)})),null!==t.residents&&t.residents.forAll((e=>{this._intersectsObject(o,e)&&n(e)})),!0}))}forEachAlongRayWithVerticalOffset(e,t,n,o){const s=c(e,t);this._forEachNode(this._root,(e=>{if(!this._intersectsNodeWithOffset(s,e,o))return!1;const t=e.node;return t.terminals.forAll((e=>{this._intersectsObjectWithOffset(s,e,o)&&n(e)})),null!==t.residents&&t.residents.forAll((e=>{this._intersectsObjectWithOffset(s,e,o)&&n(e)})),!0}))}forEach(e){this._forEachNode(this._root,(t=>{const n=t.node;return n.terminals.forAll(e),null!==n.residents&&n.residents.forAll(e),!0})),this._degenerateObjects.forEach(e)}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}findClosest(e,t,n,r=(()=>!0),i=1/0){let h=1/0,a=1/0,d=null;const c=E(e,t),u=o=>{if(--i,!r(o))return;const s=this._objectToBoundingSphere(o);if(!l(n,s))return;const c=M(e,t,_(s)),u=c-s[3],f=c+s[3];u<h&&(h=u,a=f,d=o)};return this._forEachNodeDepthOrdered(this._root,(r=>{if(i<=0||!l(n,r.bounds))return!1;o(F,c,r.halfSize),s(F,F,r.bounds);if(M(e,t,F)>a)return!1;const h=r.node;return h.terminals.forAll((e=>u(e))),null!==h.residents&&h.residents.forAll((e=>u(e))),!0}),e,t),d}forEachInDepthRange(e,t,n,r,i,h,a){let d=-1/0,c=1/0;const u={setRange:e=>{n===g.DepthOrder.FRONT_TO_BACK?(d=Math.max(d,e.near),c=Math.min(c,e.far)):(d=Math.max(d,-e.far),c=Math.min(c,-e.near))}};u.setRange(r);const f=M(t,n,e),m=E(t,n),p=E(t,-n),b=e=>{if(!a(e))return;const o=this._objectToBoundingSphere(e),s=_(o),r=M(t,n,s)-f,m=r-o[3],p=r+o[3];m>c||p<d||!l(h,o)||i(e,u)};this._forEachNodeDepthOrdered(this._root,(e=>{if(!l(h,e.bounds))return!1;o(F,m,e.halfSize),s(F,F,e.bounds);if(M(t,n,F)-f>c)return!1;o(F,p,e.halfSize),s(F,F,e.bounds);if(M(t,n,F)-f<d)return!1;const r=e.node;return r.terminals.forAll((e=>b(e))),null!==r.residents&&r.residents.forAll((e=>b(e))),!0}),t,n)}forEachNode(e){this._forEachNode(this._root,(t=>e(t.node,t.bounds,t.halfSize)))}forEachNeighbor(e,t){const n=f(t),o=_(t),s=t=>{const s=this._objectToBoundingSphere(t),i=f(s),h=n+i;r(_(s),o)-h*h<=0&&e(t)};this._forEachNode(this._root,(e=>{const t=f(e.bounds),i=n+t;if(r(_(e.bounds),o)-i*i>0)return!1;const h=e.node;return h.terminals.forAll((e=>s(e))),null!==h.residents&&h.residents.forAll((e=>s(e))),!0})),this.forEachDegenerateObject(s)}_intersectsNode(e,t){return x(t.bounds,2*-t.halfSize,k),x(t.bounds,2*t.halfSize,q),b(e.origin,e.direction,k,q)}_intersectsNodeWithOffset(e,t,n){return x(t.bounds,2*-t.halfSize,k),x(t.bounds,2*t.halfSize,q),n.applyToMinMax(k,q),b(e.origin,e.direction,k,q)}_intersectsObject(e,t){const n=this._objectToBoundingSphere(t);return!(n[3]>0)||m(n,e)}_intersectsObjectWithOffset(e,t,n){const o=this._objectToBoundingSphere(t);return!(o[3]>0)||m(n.applyToBoundingSphere(o),e)}_forEachNode(e,t){let n=O.acquire().init(e);const o=[n];for(;0!==o.length;){if(n=o.pop(),t(n)&&!n.isLeaf())for(let e=0;e<n.node.children.length;e++){n.node.children[e]&&o.push(O.acquire().init(n).advance(e))}O.release(n)}}_forEachNodeDepthOrdered(e,t,n,o=g.DepthOrder.FRONT_TO_BACK){let s=O.acquire().init(e);const r=[s];for(T(n,o,V);0!==r.length;){if(s=r.pop(),t(s)&&!s.isLeaf())for(let e=7;e>=0;--e){const t=V[e];s.node.children[t]&&r.push(O.acquire().init(s).advance(t))}O.release(s)}}_remove(e,t,n){w.clear();const o=n.advanceTo(t,((e,t)=>{w.push(e.node),w.push(t)}))?n.node.terminals:n.node.residents;if(o.removeUnordered(e),0===o.length)for(let s=w.length-2;s>=0;s-=2){const e=w.data[s],t=w.data[s+1];if(!this._purge(e,t))break}}_nodeIsEmpty(e){if(0!==e.terminals.length)return!1;if(null!==e.residents)return 0===e.residents.length;for(let t=0;t<e.children.length;t++)if(e.children[t])return!1;return!0}_purge(e,t){return t>=0&&(e.children[t]=null),!!this._nodeIsEmpty(e)&&(null===e.residents&&(e.residents=new n({shrink:!0})),!0)}_add(e,t){t.advanceTo(this._objectToBoundingSphere(e))?t.node.terminals.push(e):(t.node.residents.push(e),t.node.residents.length>this._maximumObjectsPerNode&&t.depth<this._maximumDepth&&this._split(t))}_split(e){const t=e.node.residents;e.node.residents=null;for(let n=0;n<t.length;n++){const o=O.acquire().init(e);this._add(t.getItemAt(n),o),O.release(o)}}_grow(e,t){if(0!==t&&(N(e,t,(e=>this._objectToBoundingSphere(e)),I),z(I[3])&&!this._fitsInsideTree(I)))if(this._nodeIsEmpty(this._root.node))u(I,this._root.bounds),this._root.halfSize=1.25*I[3];else{const e=this._rootBoundsForRootAsSubNode(I);this._placingRootViolatesMaxDepth(e)?this._rebuildTree(I,e):this._growRootAsSubNode(e),O.release(e)}}_rebuildTree(e,t){i(P,t.bounds),P[3]=t.halfSize,N([e,P],2,(e=>e),L);const n=O.acquire().init(this._root);this._root.initFrom(null,L,1.25*L[3]),this._forEachNode(n,(e=>(this.add(e.node.terminals.data,e.node.terminals.length),null!==e.node.residents&&this.add(e.node.residents.data,e.node.residents.length),!0))),O.release(n)}_placingRootViolatesMaxDepth(e){const t=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return this._forEachNode(this._root,(e=>(n=Math.max(n,e.depth),n+t<=this._maximumDepth))),n+t>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const t=e[3],n=e;let o=-1/0;const s=this._root.bounds,r=this._root.halfSize;for(let i=0;i<3;i++){const e=s[i]-r-(n[i]-t),h=n[i]+t-(s[i]+r),a=Math.max(0,Math.ceil(e/(2*r))),d=Math.max(0,Math.ceil(h/(2*r)))+1,l=2**Math.ceil(Math.log(a+d)*Math.LOG2E);o=Math.max(o,l),K[i].min=a,K[i].max=d}for(let i=0;i<3;i++){let e=K[i].min,t=K[i].max;const n=(o-(e+t))/2;e+=Math.ceil(n),t+=Math.floor(n);const h=s[i]-r-e*r*2;y[i]=h+(t+e)*r}return y[3]=o*r*v,O.acquire().initFrom(null,y,o*r,0)}_growRootAsSubNode(e){const t=this._root.node;i(I,this._root.bounds),I[3]=this._root.halfSize,this._root.init(e),e.advanceTo(I,null,!0),e.node.children=t.children,e.node.residents=t.residents,e.node.terminals=t.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(-1===e)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let e=null;const t=this._root.node.children;let n=0,o=0;for(;o<t.length&&null==e;)n=o++,e=t[n];for(;o<t.length;)if(t[o++])return-1;return n}_isDegenerate(e){return!z(this._objectToBoundingSphere(e)[3])}_fitsInsideTree(e){const t=this._root.bounds,n=this._root.halfSize;return e[3]<=n&&e[0]>=t[0]-n&&e[0]<=t[0]+n&&e[1]>=t[1]-n&&e[1]<=t[1]+n&&e[2]>=t[2]-n&&e[2]<=t[2]+n}}class O{constructor(){this.bounds=p(),this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(t,n,o,s=this.depth){return this.node=e(t)?t:O.createEmptyNode(),e(n)&&u(n,this.bounds),this.halfSize=o,this.depth=s,this}advance(e){let t=this.node.children[e];t||(t=O.createEmptyNode(),this.node.children[e]=t),this.node=t,this.halfSize/=2,this.depth++;const n=A[e];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.bounds[3]=this.halfSize*v,this}advanceTo(e,t,n=!1){for(;;){if(this.isTerminalFor(e))return t&&t(this,-1),!0;if(this.isLeaf()){if(!n)return t&&t(this,-1),!1;this.node.residents=null}const o=this._childIndex(e);t&&t(this,o),this.advance(o)}}isLeaf(){return null!=this.node.residents}isTerminalFor(e){return e[3]>this.halfSize/2}_childIndex(e){const t=this.bounds;return(t[0]<e[0]?1:0)+(t[1]<e[1]?2:0)+(t[2]<e[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new n({shrink:!0}),residents:new n({shrink:!0})}}static acquire(){return O._pool.acquire()}static release(e){O._pool.release(e)}static clearPool(){O._pool.prune()}}function j(e,t){e[0]=Math.min(e[0],t[0]-t[3]),e[1]=Math.min(e[1],t[1]-t[3]),e[2]=Math.min(e[2],t[2]-t[3])}function S(e,t){e[0]=Math.max(e[0],t[0]+t[3]),e[1]=Math.max(e[1],t[1]+t[3]),e[2]=Math.max(e[2],t[2]+t[3])}function x(e,t,n){n[0]=e[0]+t,n[1]=e[1]+t,n[2]=e[2]+t}function N(e,t,n,o){if(1===t){const t=n(e[0]);u(t,o)}else{k[0]=1/0,k[1]=1/0,k[2]=1/0,q[0]=-1/0,q[1]=-1/0,q[2]=-1/0;for(let o=0;o<t;o++){const t=n(e[o]);z(t[3])&&(j(k,t),S(q,t))}h(o,k,q,.5),o[3]=Math.max(q[0]-k[0],q[1]-k[1],q[2]-k[2])/2}}function T(e,t,n){if(!W.length)for(let o=0;o<8;++o)W.push({index:0,distance:0});for(let o=0;o<8;++o){const n=A[o];W.data[o].index=o,W.data[o].distance=M(e,t,n)}W.sort(((e,t)=>e.distance-t.distance));for(let o=0;o<8;++o)n[o]=W.data[o].index}function E(e,t){let n=1/0,o=null;for(let s=0;s<8;++s){const r=M(e,t,D[s]);r<n&&(n=r,o=D[s])}return o}function M(e,t,n){return t*(e[0]*n[0]+e[1]*n[1]+e[2]*n[2])}function z(e){return!isNaN(e)&&e!==-1/0&&e!==1/0&&e>0}O._pool=new t(O),function(e){var t;(t=e.DepthOrder||(e.DepthOrder={}))[t.FRONT_TO_BACK=1]="FRONT_TO_BACK",t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(g||(g={}));const A=[a(-1,-1,-1),a(1,-1,-1),a(-1,1,-1),a(1,1,-1),a(-1,-1,1),a(1,-1,1),a(-1,1,1),a(1,1,1)],D=[a(-1,-1,-1),a(-1,-1,1),a(-1,1,-1),a(-1,1,1),a(1,-1,-1),a(1,-1,1),a(1,1,-1),a(1,1,1)],v=Math.sqrt(3),B=[null];function R(e){return B[0]=e,B}const y=p(),F=d(),k=d(),q=d(),w=new n,C=p(),I=p(),P=p(),L=p(),K=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],W=new n,V=[0,0,0,0,0,0,0,0],G=g;export{G as default};
|
|
5
|
+
import{isSome as e}from"../../../../core/maybe.js";import t from"../../../../core/ObjectPool.js";import n from"../../../../core/PooledArray.js";import{g as o,a as s,d as r,c as i,h}from"../../../../chunks/vec3.js";import{c as a,f as d}from"../../../../chunks/vec3f64.js";import{intersectsSphere as l}from"../../../../geometry/support/frustum.js";import{wrap as c}from"../../../../geometry/support/ray.js";import{h as u,a as f,g as _,j as m,c as p}from"../../../../chunks/sphere.js";import{rayBoxTest as b}from"./Util.js";class g{constructor(e,t){this._objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new O,this._objectCount=0,t&&(void 0!==t.maximumObjectsPerNode&&(this._maximumObjectsPerNode=t.maximumObjectsPerNode),void 0!==t.maximumDepth&&(this._maximumDepth=t.maximumDepth))}get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}destroy(){this._degenerateObjects.clear(),O.clearPool(),B[0]=null,w.prune(),W.prune()}add(e,t=e.length){this._objectCount+=t,this._grow(e,t);const n=O.acquire();for(let o=0;o<t;o++){const t=e[o];this._isDegenerate(t)?this._degenerateObjects.add(t):(n.init(this._root),this._add(t,n))}O.release(n)}remove(t,n=null){this._objectCount-=t.length;const o=O.acquire();for(const s of t){const t=e(n)?n:u(this._objectToBoundingSphere(s),C);z(t[3])?(o.init(this._root),this._remove(s,t,o)):this._degenerateObjects.delete(s)}O.release(o),this._shrink()}update(e,t){if(!z(t[3])&&this._isDegenerate(e))return;const n=R(e);this.remove(n,t),this.add(n)}forEachAlongRay(e,t,n){const o=c(e,t);this._forEachNode(this._root,(e=>{if(!this._intersectsNode(o,e))return!1;const t=e.node;return t.terminals.forAll((e=>{this._intersectsObject(o,e)&&n(e)})),null!==t.residents&&t.residents.forAll((e=>{this._intersectsObject(o,e)&&n(e)})),!0}))}forEachAlongRayWithVerticalOffset(e,t,n,o){const s=c(e,t);this._forEachNode(this._root,(e=>{if(!this._intersectsNodeWithOffset(s,e,o))return!1;const t=e.node;return t.terminals.forAll((e=>{this._intersectsObjectWithOffset(s,e,o)&&n(e)})),null!==t.residents&&t.residents.forAll((e=>{this._intersectsObjectWithOffset(s,e,o)&&n(e)})),!0}))}forEach(e){this._forEachNode(this._root,(t=>{const n=t.node;return n.terminals.forAll(e),null!==n.residents&&n.residents.forAll(e),!0})),this._degenerateObjects.forEach(e)}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}findClosest(e,t,n,r=(()=>!0),i=1/0){let h=1/0,a=1/0,d=null;const c=E(e,t),u=o=>{if(--i,!r(o))return;const s=this._objectToBoundingSphere(o);if(!l(n,s))return;const c=M(e,t,_(s)),u=c-s[3],f=c+s[3];u<h&&(h=u,a=f,d=o)};return this._forEachNodeDepthOrdered(this._root,(r=>{if(i<=0||!l(n,r.bounds))return!1;o(F,c,r.halfSize),s(F,F,r.bounds);if(M(e,t,F)>a)return!1;const h=r.node;return h.terminals.forAll((e=>u(e))),null!==h.residents&&h.residents.forAll((e=>u(e))),!0}),e,t),d}forEachInDepthRange(e,t,n,r,i,h,a){let d=-1/0,c=1/0;const u={setRange:e=>{n===g.DepthOrder.FRONT_TO_BACK?(d=Math.max(d,e.near),c=Math.min(c,e.far)):(d=Math.max(d,-e.far),c=Math.min(c,-e.near))}};u.setRange(r);const f=M(t,n,e),m=E(t,n),p=E(t,-n),b=e=>{if(!a(e))return;const o=this._objectToBoundingSphere(e),s=_(o),r=M(t,n,s)-f,m=r-o[3],p=r+o[3];m>c||p<d||!l(h,o)||i(e,u)};this._forEachNodeDepthOrdered(this._root,(e=>{if(!l(h,e.bounds))return!1;o(F,m,e.halfSize),s(F,F,e.bounds);if(M(t,n,F)-f>c)return!1;o(F,p,e.halfSize),s(F,F,e.bounds);if(M(t,n,F)-f<d)return!1;const r=e.node;return r.terminals.forAll((e=>b(e))),null!==r.residents&&r.residents.forAll((e=>b(e))),!0}),t,n)}forEachNode(e){this._forEachNode(this._root,(t=>e(t.node,t.bounds,t.halfSize)))}forEachNeighbor(e,t){const n=f(t),o=_(t),s=t=>{const s=this._objectToBoundingSphere(t),i=f(s),h=n+i;r(_(s),o)-h*h<=0&&e(t)};this._forEachNode(this._root,(e=>{const t=f(e.bounds),i=n+t;if(r(_(e.bounds),o)-i*i>0)return!1;const h=e.node;return h.terminals.forAll((e=>s(e))),null!==h.residents&&h.residents.forAll((e=>s(e))),!0})),this.forEachDegenerateObject(s)}_intersectsNode(e,t){return x(t.bounds,2*-t.halfSize,k),x(t.bounds,2*t.halfSize,q),b(e.origin,e.direction,k,q)}_intersectsNodeWithOffset(e,t,n){return x(t.bounds,2*-t.halfSize,k),x(t.bounds,2*t.halfSize,q),n.applyToMinMax(k,q),b(e.origin,e.direction,k,q)}_intersectsObject(e,t){const n=this._objectToBoundingSphere(t);return!(n[3]>0)||m(n,e)}_intersectsObjectWithOffset(e,t,n){const o=this._objectToBoundingSphere(t);return!(o[3]>0)||m(n.applyToBoundingSphere(o),e)}_forEachNode(e,t){let n=O.acquire().init(e);const o=[n];for(;0!==o.length;){if(n=o.pop(),t(n)&&!n.isLeaf())for(let e=0;e<n.node.children.length;e++){n.node.children[e]&&o.push(O.acquire().init(n).advance(e))}O.release(n)}}_forEachNodeDepthOrdered(e,t,n,o=g.DepthOrder.FRONT_TO_BACK){let s=O.acquire().init(e);const r=[s];for(T(n,o,V);0!==r.length;){if(s=r.pop(),t(s)&&!s.isLeaf())for(let e=7;e>=0;--e){const t=V[e];s.node.children[t]&&r.push(O.acquire().init(s).advance(t))}O.release(s)}}_remove(e,t,n){w.clear();const o=n.advanceTo(t,((e,t)=>{w.push(e.node),w.push(t)}))?n.node.terminals:n.node.residents;if(o.removeUnordered(e),0===o.length)for(let s=w.length-2;s>=0;s-=2){const e=w.data[s],t=w.data[s+1];if(!this._purge(e,t))break}}_nodeIsEmpty(e){if(0!==e.terminals.length)return!1;if(null!==e.residents)return 0===e.residents.length;for(let t=0;t<e.children.length;t++)if(e.children[t])return!1;return!0}_purge(e,t){return t>=0&&(e.children[t]=null),!!this._nodeIsEmpty(e)&&(null===e.residents&&(e.residents=new n({shrink:!0})),!0)}_add(e,t){t.advanceTo(this._objectToBoundingSphere(e))?t.node.terminals.push(e):(t.node.residents.push(e),t.node.residents.length>this._maximumObjectsPerNode&&t.depth<this._maximumDepth&&this._split(t))}_split(e){const t=e.node.residents;e.node.residents=null;for(let n=0;n<t.length;n++){const o=O.acquire().init(e);this._add(t.getItemAt(n),o),O.release(o)}}_grow(e,t){if(0!==t&&(N(e,t,(e=>this._objectToBoundingSphere(e)),I),z(I[3])&&!this._fitsInsideTree(I)))if(this._nodeIsEmpty(this._root.node))u(I,this._root.bounds),this._root.halfSize=1.25*I[3];else{const e=this._rootBoundsForRootAsSubNode(I);this._placingRootViolatesMaxDepth(e)?this._rebuildTree(I,e):this._growRootAsSubNode(e),O.release(e)}}_rebuildTree(e,t){i(P,t.bounds),P[3]=t.halfSize,N([e,P],2,(e=>e),L);const n=O.acquire().init(this._root);this._root.initFrom(null,L,1.25*L[3]),this._forEachNode(n,(e=>(this.add(e.node.terminals.data,e.node.terminals.length),null!==e.node.residents&&this.add(e.node.residents.data,e.node.residents.length),!0))),O.release(n)}_placingRootViolatesMaxDepth(e){const t=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return this._forEachNode(this._root,(e=>(n=Math.max(n,e.depth),n+t<=this._maximumDepth))),n+t>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const t=e[3],n=e;let o=-1/0;const s=this._root.bounds,r=this._root.halfSize;for(let i=0;i<3;i++){const e=s[i]-r-(n[i]-t),h=n[i]+t-(s[i]+r),a=Math.max(0,Math.ceil(e/(2*r))),d=Math.max(0,Math.ceil(h/(2*r)))+1,l=2**Math.ceil(Math.log(a+d)*Math.LOG2E);o=Math.max(o,l),K[i].min=a,K[i].max=d}for(let i=0;i<3;i++){let e=K[i].min,t=K[i].max;const n=(o-(e+t))/2;e+=Math.ceil(n),t+=Math.floor(n);const h=s[i]-r-e*r*2;y[i]=h+(t+e)*r}return y[3]=o*r*v,O.acquire().initFrom(null,y,o*r,0)}_growRootAsSubNode(e){const t=this._root.node;i(I,this._root.bounds),I[3]=this._root.halfSize,this._root.init(e),e.advanceTo(I,null,!0),e.node.children=t.children,e.node.residents=t.residents,e.node.terminals=t.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(-1===e)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let e=null;const t=this._root.node.children;let n=0,o=0;for(;o<t.length&&null==e;)n=o++,e=t[n];for(;o<t.length;)if(t[o++])return-1;return n}_isDegenerate(e){return!z(this._objectToBoundingSphere(e)[3])}_fitsInsideTree(e){const t=this._root.bounds,n=this._root.halfSize;return e[3]<=n&&e[0]>=t[0]-n&&e[0]<=t[0]+n&&e[1]>=t[1]-n&&e[1]<=t[1]+n&&e[2]>=t[2]-n&&e[2]<=t[2]+n}}class O{constructor(){this.bounds=p(),this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(t,n,o,s=this.depth){return this.node=e(t)?t:O.createEmptyNode(),e(n)&&u(n,this.bounds),this.halfSize=o,this.depth=s,this}advance(e){let t=this.node.children[e];t||(t=O.createEmptyNode(),this.node.children[e]=t),this.node=t,this.halfSize/=2,this.depth++;const n=A[e];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.bounds[3]=this.halfSize*v,this}advanceTo(e,t,n=!1){for(;;){if(this.isTerminalFor(e))return t&&t(this,-1),!0;if(this.isLeaf()){if(!n)return t&&t(this,-1),!1;this.node.residents=null}const o=this._childIndex(e);t&&t(this,o),this.advance(o)}}isLeaf(){return null!=this.node.residents}isTerminalFor(e){return e[3]>this.halfSize/2}_childIndex(e){const t=this.bounds;return(t[0]<e[0]?1:0)+(t[1]<e[1]?2:0)+(t[2]<e[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new n({shrink:!0}),residents:new n({shrink:!0})}}static acquire(){return O._pool.acquire()}static release(e){O._pool.release(e)}static clearPool(){O._pool.prune()}}function j(e,t){e[0]=Math.min(e[0],t[0]-t[3]),e[1]=Math.min(e[1],t[1]-t[3]),e[2]=Math.min(e[2],t[2]-t[3])}function S(e,t){e[0]=Math.max(e[0],t[0]+t[3]),e[1]=Math.max(e[1],t[1]+t[3]),e[2]=Math.max(e[2],t[2]+t[3])}function x(e,t,n){n[0]=e[0]+t,n[1]=e[1]+t,n[2]=e[2]+t}function N(e,t,n,o){if(1===t){const t=n(e[0]);u(t,o)}else{k[0]=1/0,k[1]=1/0,k[2]=1/0,q[0]=-1/0,q[1]=-1/0,q[2]=-1/0;for(let o=0;o<t;o++){const t=n(e[o]);z(t[3])&&(j(k,t),S(q,t))}h(o,k,q,.5),o[3]=Math.max(q[0]-k[0],q[1]-k[1],q[2]-k[2])/2}}function T(e,t,n){if(!W.length)for(let o=0;o<8;++o)W.push({index:0,distance:0});for(let o=0;o<8;++o){const n=A[o];W.data[o].index=o,W.data[o].distance=M(e,t,n)}W.sort(((e,t)=>e.distance-t.distance));for(let o=0;o<8;++o)n[o]=W.data[o].index}function E(e,t){let n=1/0,o=null;for(let s=0;s<8;++s){const r=M(e,t,D[s]);r<n&&(n=r,o=D[s])}return o}function M(e,t,n){return t*(e[0]*n[0]+e[1]*n[1]+e[2]*n[2])}function z(e){return!isNaN(e)&&e!==-1/0&&e!==1/0&&e>0}O._pool=new t(O),function(e){var t;(t=e.DepthOrder||(e.DepthOrder={}))[t.FRONT_TO_BACK=1]="FRONT_TO_BACK",t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(g||(g={}));const A=[d(-1,-1,-1),d(1,-1,-1),d(-1,1,-1),d(1,1,-1),d(-1,-1,1),d(1,-1,1),d(-1,1,1),d(1,1,1)],D=[d(-1,-1,-1),d(-1,-1,1),d(-1,1,-1),d(-1,1,1),d(1,-1,-1),d(1,-1,1),d(1,1,-1),d(1,1,1)],v=Math.sqrt(3),B=[null];function R(e){return B[0]=e,B}const y=p(),F=a(),k=a(),q=a(),w=new n,C=p(),I=p(),P=p(),L=p(),K=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],W=new n,V=[0,0,0,0,0,0,0,0],G=g;export{G as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../../../../core/maybe.js";import{RenderTargetHelper as t}from"./RenderTargetHelper.js";import{TransparencyPassType as r}from"./TransparencyPassType.js";import{AlphaMode as i,CompositingFunction as o}from"../shaders/CompositingTechniqueConfiguration.js";import{ContextType as s}from"../../../webgl/context-util.js";import{
|
|
5
|
+
import{isSome as e}from"../../../../core/maybe.js";import{RenderTargetHelper as t}from"./RenderTargetHelper.js";import{TransparencyPassType as r}from"./TransparencyPassType.js";import{AlphaMode as i,CompositingFunction as o}from"../shaders/CompositingTechniqueConfiguration.js";import{ContextType as s}from"../../../webgl/context-util.js";import{TextureSamplingMode as a,SizedPixelFormat as h,PixelFormat as n,PixelType as l,ClearBufferBit as g}from"../../../webgl/enums.js";class T{constructor(e,r){this._rctx=e,this._compositingHelper=r,this._mainColorTarget=0,this._dimensions={width:4,height:4},this._needLastFrameColorTexture=!1,this._background={type:"color",color:[0,0,0,1]};const i=e.type===s.WEBGL2;this._renderTargetHelper=new t(e);const o=this._renderTargetHelper;this.mainColorTargets=[o.registerColorTarget({name:"mainColorTarget0"}),o.registerColorTarget({name:"mainColorTarget1"})],this.frontFaceTarget=o.registerColorTarget({name:"frontFaceTarget"});const g=e=>o.registerColorTarget({name:e,dataType:l.FLOAT,internalFormat:i?h.RGBA32F:n.RGBA,samplingMode:a.NEAREST});this.colorFloatTarget=g("colorFloatTarget"),this.alphaFloatTarget=g("alphaFloatTarget"),this.mainDepth=o.registerDepthTarget({name:"mainDepth"}),this.linearDepth=o.registerColorTarget({name:"linearDepth",samplingMode:a.NEAREST}),this.terrainLinearDepth=o.registerColorTarget({name:"terrainLinearDepth"}),this.geometryLinearDepth=o.registerColorTarget({name:"geometryLinearDepth"}),this.normal=o.registerColorTarget({name:"normal"}),this.highlight=o.registerColorTarget({name:"highlight",internalFormat:i?h.RGBA4:n.RGBA,dataType:l.UNSIGNED_SHORT_4_4_4_4}),this.hudVisibility=o.registerColorTarget({name:"hudVisibility",internalFormat:i?h.RGBA4:n.RGBA,dataType:l.UNSIGNED_SHORT_4_4_4_4}),this.tmpColor=o.registerColorTarget({name:"tmpColor"}),this.tmpDepth=o.registerDepthTarget({name:"tmpDepth"}),this.hudColor=o.registerColorTarget({name:"hudColor"})}dispose(){this._renderTargetHelper.dispose()}get width(){return this._dimensions.width}get height(){return this._dimensions.height}set background(e){this._background=e}get background(){return this._background}get currentColorTarget(){return this.mainColorTargets[this._mainColorTarget]}get previousColorTarget(){return this.mainColorTargets[1-this._mainColorTarget]}get framebuffer(){return this.getFramebuffer(this.currentColorTarget,this.mainDepth)}getFramebuffer(e,t){return this._renderTargetHelper.getFramebuffer(this._dimensions,e,t)}get colorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.currentColorTarget)}get depthTexture(){return this._renderTargetHelper.getAllocatedDepthTexture(this.mainDepth)}get linearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.linearDepth)}get terrainLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.terrainLinearDepth)}get geometryLinearDepthTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.geometryLinearDepth)}get lastFrameColorTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.previousColorTarget)}get normalTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.normal)}get highlightTexture(){return this._renderTargetHelper.getAllocatedColorTexture(this.highlight)}get hudVisibilityTexture(){return this._getColorTexture(this.hudVisibility)}get tmpColorTexture(){return this._getColorTexture(this.tmpColor)}get hudColorTexture(){return this._getColorTexture(this.hudColor)}get mainColorTexture(){return this._getColorTexture(this.currentColorTarget)}advanceCurrentRenderTarget(){this._mainColorTarget=0===this._mainColorTarget&&this._needLastFrameColorTexture?1:0}initializeFrame(e){const t=this._rctx;this._dimensions.width=e.fullWidth,this._dimensions.height=e.fullHeight,this.bindTarget(this.currentColorTarget,this.mainDepth),t.setClearStencil(0);const r=this._background.color;t.setClearColor(r[0]*r[3],r[1]*r[3],r[2]*r[3],r[3]),t.clearSafe(g.COLOR_BUFFER_BIT|g.DEPTH_BUFFER_BIT|g.STENCIL_BUFFER_BIT)}composite(t){e(this.colorTexture)&&this._compositingHelper.composite(t,this.colorTexture,i.None)}renderTmpAndCompositeToMain(e,t,r,i=!1){this.renderToTargets(e,this.tmpColor,i?this.tmpDepth:this.mainDepth,p),this._compositingHelper.composite(t,this._getColorTexture(this.tmpColor),r)}renderHUDVisibility(e,t=!1){this.renderToTargets(e,this.hudVisibility,t?this.tmpDepth:this.mainDepth,m)}compositeTransparentTerrainOntoHUDVisibility(e){this.renderToTargets((()=>this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.None,1,o.TransparentToHUDVisibility)),this.hudVisibility,this.tmpDepth)}renderOITPass(e,t,i){let o,s;switch(t){case r.Color:o=this.colorFloatTarget,s=[0,0,0,0];break;case r.Alpha:o=this.alphaFloatTarget,s=[1,1,1,1];break;case r.FrontFace:o=this.frontFaceTarget,s=[0,0,0,0]}i?this.renderToTargets(e,o,this.tmpDepth,s,!0,!0):this.renderToTargets(e,o,this.mainDepth,s,!1)}compositeTransparentTerrainOntoMain(e){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.PremultipliedAlpha)}compositeOccludedOntoMain(e,t){this.bindFramebuffer(),this._compositingHelper.composite(e,this._getColorTexture(this.tmpColor),i.PremultipliedAlpha,t)}compositeTransparentOntoOpaque(e,t){t?(this.bindTarget(this.hudColor,this.tmpDepth),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clearSafe(g.COLOR_BUFFER_BIT)):this.bindFramebuffer(),this._compositingHelper.compositeTransparent(e,this._getColorTexture(this.colorFloatTarget),this._getColorTexture(this.alphaFloatTarget),this._getColorTexture(this.frontFaceTarget))}bindFramebuffer(){this._rctx.bindFramebuffer(this.framebuffer)}renderDepthDetached(e){this.bindTarget(this.currentColorTarget),e(),this.bindTarget(this.currentColorTarget,this.mainDepth)}disposeTarget(e){this._renderTargetHelper.disposeTargetResource(e)}set needLastFrameColorTexture(e){!e&&this._needLastFrameColorTexture&&(this._mainColorTarget=0,this.disposeTarget(this.mainColorTargets[1])),this._needLastFrameColorTexture=e}get needLastFrameColorTexture(){return this._needLastFrameColorTexture}renderToFBO(e,t,r=!1,i=!1){const o=this._rctx;let s=0;if(t){const e=1e-13,r=Math.max(e,t[3]);o.setClearColor(t[0],t[1],t[2],r),s|=g.COLOR_BUFFER_BIT}r&&(s|=g.DEPTH_BUFFER_BIT),!1===i?i=0:(!0===i&&(i=255),s|=g.STENCIL_BUFFER_BIT),s&&o.clearSafe(s,i),e(),o.gl.flush(),this.bindTarget(this.currentColorTarget,this.mainDepth)}renderToTargets(e,t,r,i,o=!1,s=!1){const a=this.bindTarget(t,r);return this.renderToFBO(e,i,o,s),a}bindTarget(e,t){const r=this._renderTargetHelper.getFramebuffer(this._dimensions,e,t);return this._rctx.bindFramebuffer(r),r}_getColorTexture(e){return this._renderTargetHelper.getColorTexture(e,this._dimensions)}get gpuMemoryUsage(){let e=0;return this._renderTargetHelper&&(e+=this._renderTargetHelper.gpuMemoryUsage),e}}const p=[0,0,0,0],m=[0,1,0,1];export{T as OffscreenRendering};
|