@arcgis/core 6.0.0-next.26 → 6.0.0-next.28
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/Map.d.ts +6 -0
- package/analysis/AreaMeasurementAnalysis.d.ts +4 -2
- package/analysis/DirectLineMeasurementAnalysis.d.ts +8 -4
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0363d29fc665d169ebc4.js +1 -0
- package/assets/esri/core/workers/chunks/037c67ef5c4398d5954d.js +1 -0
- package/assets/esri/core/workers/chunks/03f33cb78b5405ab7e23.js +1 -0
- package/assets/esri/core/workers/chunks/07b726a46864501b90a0.js +1 -0
- package/assets/esri/core/workers/chunks/0864da8f8f147016cf1c.js +1 -0
- package/assets/esri/core/workers/chunks/{768389f7f8dba6080df7.js → 0cc7fba402a93e6d2455.js} +2 -2
- package/assets/esri/core/workers/chunks/0cfdeb53fb7d5532cf01.js +1 -0
- package/assets/esri/core/workers/chunks/112ed86f812e4400a7e0.js +1 -0
- package/assets/esri/core/workers/chunks/177f353ce72133e2eeed.js +1 -0
- package/assets/esri/core/workers/chunks/1dc6f093028530a492e6.js +1 -0
- package/assets/esri/core/workers/chunks/2294254af2c6afb560ee.js +1 -0
- package/assets/esri/core/workers/chunks/23a4806b4cdf7cc32e4d.js +1 -0
- package/assets/esri/core/workers/chunks/2447d2e2a4a3ab8fcf94.js +1 -0
- package/assets/esri/core/workers/chunks/271ae7deccb94112c2df.js +1 -0
- package/assets/esri/core/workers/chunks/2df37a9a95ceebb87a5f.js +1 -0
- package/assets/esri/core/workers/chunks/2e00c155e447e4930442.js +1 -0
- package/assets/esri/core/workers/chunks/2e9a1673b1d51aa082b6.js +1 -0
- package/assets/esri/core/workers/chunks/344f5334ad95c7974349.js +1 -0
- package/assets/esri/core/workers/chunks/348f1def9cd2ddf92e87.js +1 -0
- package/assets/esri/core/workers/chunks/{8e4206068c6953bb7df2.js → 3a47fc97c400fca2c736.js} +1 -1
- package/assets/esri/core/workers/chunks/47c97640ec525676918b.js +1 -0
- package/assets/esri/core/workers/chunks/50763ea061d5fb3f2e49.js +1 -0
- package/assets/esri/core/workers/chunks/518ab22f80c3300bcfff.js +1 -0
- package/assets/esri/core/workers/chunks/58609bf94f72bc4f1952.js +1 -0
- package/assets/esri/core/workers/chunks/586a929bc037e23857af.js +1 -0
- package/assets/esri/core/workers/chunks/58d10e0b35968680fd9f.js +1 -0
- package/assets/esri/core/workers/chunks/59bc55880e6fd8ce20c0.js +1 -0
- package/assets/esri/core/workers/chunks/{7c75a8ee266c36baa902.js → 5eec1c1162779574f46e.js} +1 -1
- package/assets/esri/core/workers/chunks/62a0abcf45a2bd14ecbe.js +1 -0
- package/assets/esri/core/workers/chunks/63c4412c16d8a44a5668.js +1 -0
- package/assets/esri/core/workers/chunks/6b4c3411f63a9ad9354c.js +1 -0
- package/assets/esri/core/workers/chunks/{f528ac5c648ca6a98582.js → 711cfb84659cb4437679.js} +1 -1
- package/assets/esri/core/workers/chunks/{9dd1fc56eb1ea6eb705e.js → 76e27e36050a3dd9d249.js} +1 -1
- package/assets/esri/core/workers/chunks/76f877e2d2493d56afab.js +1 -0
- package/assets/esri/core/workers/chunks/77463141652bf1ca6fb2.js +1 -0
- package/assets/esri/core/workers/chunks/7d3f7940815fa5dc244e.js +1 -0
- package/assets/esri/core/workers/chunks/914a0b5d9fef683cdf9c.js +1 -0
- package/assets/esri/core/workers/chunks/96f87c8efd4b11b37686.js +1 -0
- package/assets/esri/core/workers/chunks/97ec46605f16333144b7.js +1 -0
- package/assets/esri/core/workers/chunks/{7b482afb9fd1229f5707.js → 9934e8e19f94e9169eea.js} +1 -1
- package/assets/esri/core/workers/chunks/99f51d5d9da6e9bfc430.js +1 -0
- package/assets/esri/core/workers/chunks/9aebe876b1a2fb075f9c.js +1 -0
- package/assets/esri/core/workers/chunks/9c3db7a7c05fa0e81f0a.js +1 -0
- package/assets/esri/core/workers/chunks/{6f1d6453184e0a1530ad.js → 9c4961213ac6ec283dd9.js} +25 -25
- package/assets/esri/core/workers/chunks/a2cc53ad1a514167e4b8.js +1 -0
- package/assets/esri/core/workers/chunks/a33ba23aee3f8f40200f.js +1 -0
- package/assets/esri/core/workers/chunks/{45ba4aa87a4732198596.js → b13d8f4e4e80ef00b1bd.js} +1 -1
- package/assets/esri/core/workers/chunks/b3801d58c024224917df.js +1 -0
- package/assets/esri/core/workers/chunks/b3aa29589dcfb5b93106.js +1 -0
- package/assets/esri/core/workers/chunks/b3dbcf43f136ba2dadc5.js +1 -0
- package/assets/esri/core/workers/chunks/b9596d862da1ec342cd3.js +1 -0
- package/assets/esri/core/workers/chunks/bc1fcc9c897461e68e29.js +1 -0
- package/assets/esri/core/workers/chunks/{8b4e9fd88c0c313416d4.js → be04f40f8b403befd0ef.js} +1 -1
- package/assets/esri/core/workers/chunks/{150e7a7bd5df25693da7.js → c90388932a7825d9d933.js} +1 -1
- package/assets/esri/core/workers/chunks/ca21786e519c914fc9e1.js +1 -0
- package/assets/esri/core/workers/chunks/cdb5c26fed7d9a97db49.js +1 -0
- package/assets/esri/core/workers/chunks/cdf0c7706d3e1221f49b.js +1 -0
- package/assets/esri/core/workers/chunks/d63e181f0e48bde73395.js +1 -0
- package/assets/esri/core/workers/chunks/d77888c84a8b49478807.js +1 -0
- package/assets/esri/core/workers/chunks/d7f2f1708d2a2668676c.js +1 -0
- package/assets/esri/core/workers/chunks/{13c64087be3b2985a21b.js → dbda982485d3fe26c729.js} +1 -1
- package/assets/esri/core/workers/chunks/dc7aa0a1eb6c6e361f9f.js +1 -0
- package/assets/esri/core/workers/chunks/ec1c4d66142b6efb0e8b.js +1 -0
- package/assets/esri/core/workers/chunks/ef2c3febcceedc44b3ac.js +1 -0
- package/assets/esri/core/workers/chunks/f08a2a262a3b55149396.js +1 -0
- package/assets/esri/core/workers/chunks/f2d56f5c15d5977e1d19.js +1 -0
- package/assets/esri/core/workers/chunks/ffe2077a9df7c838ea27.js +1 -0
- package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
- package/chunks/BlendLayers.glsl.js +1 -1
- package/chunks/Component.glsl.js +9 -12
- package/chunks/GaussianSplat.glsl.js +65 -21
- package/chunks/GaussianSplatDepth.glsl.js +45 -4
- package/chunks/GaussianSplatShadow.glsl.js +73 -19
- package/chunks/GlobalIllumination.glsl.js +17 -47
- package/chunks/LineMarker.glsl.js +32 -31
- package/chunks/OITAddEmission.glsl.js +1 -1
- package/chunks/RasterColorizer.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +36 -36
- package/chunks/Terrain.glsl.js +3 -4
- package/chunks/Water.glsl.js +22 -23
- package/config.js +1 -1
- package/core/ReentrantObjectPool.js +1 -1
- package/core/memoryEstimations.js +1 -1
- package/core/workers/workers.js +2 -2
- package/core/workers.d.ts +1 -1
- package/form/elements/inputs/DynamicChoiceInput.d.ts +2 -2
- package/form/elements/inputs.d.ts +126 -25
- package/form/elements/inputs.js +1 -1
- package/form/elements.d.ts +1 -0
- package/geometry/operators/containsOperator.d.ts +1 -1
- package/geometry/operators/densifyOperator.d.ts +1 -1
- package/geometry/operators/differenceOperator.d.ts +6 -4
- package/geometry/operators/distanceOperator.d.ts +1 -1
- package/geometry/operators/geodesicProximityOperator.d.ts +8 -8
- package/geometry/operators/graphicBufferOperator.d.ts +6 -6
- package/geometry/operators/integrateOperator.d.ts +2 -2
- package/geometry/operators/intersectsOperator.d.ts +3 -3
- package/geometry/operators/linesToPolygonsOperator.d.ts +2 -2
- package/geometry/operators/locateBetweenOperator.d.ts +2 -2
- package/geometry/operators/minimumBoundingCircleOperator.d.ts +1 -1
- package/geometry/operators/multiPartToSinglePartOperator.d.ts +2 -2
- package/geometry/operators/polygonSlicerOperator.d.ts +2 -2
- package/geometry/operators/projectOperator.d.ts +2 -2
- package/geometry/operators/proximityOperator.d.ts +15 -15
- package/geometry/operators/shapePreservingProjectOperator.d.ts +2 -2
- package/geometry/operators/simplifyOperator.d.ts +2 -2
- package/geometry/operators/support/GeographicTransformationStep.d.ts +3 -3
- package/geometry/operators/support/Transformation.d.ts +8 -8
- package/geometry/operators/support/geographicTransformationUtils.d.ts +3 -3
- package/geometry/operators/symmetricDifferenceOperator.d.ts +2 -2
- package/geometry/operators/withinOperator.d.ts +3 -3
- package/geometry/support/Indices.js +1 -1
- package/graphic/MapNotesGraphicOrigin.d.ts +1 -0
- package/kernel.js +1 -1
- package/layers/GeospatialPDFLayer.d.ts +2 -2
- package/layers/GeospatialPDFLayer.js +1 -1
- package/layers/MapNotesLayer.d.ts +3 -2
- package/layers/ParquetLayer.d.ts +1 -1
- package/layers/VectorTileLayer.d.ts +10 -1
- package/layers/buildingSublayers/BuildingGroupSublayer.d.ts +2 -1
- package/layers/geospatialPDF/CIM2DLayerview.js +2 -0
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/SublayersOwner.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/support/Sublayer.d.ts +2 -2
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/package.json +3 -3
- package/popup/FeaturesModel.js +1 -1
- package/popup/support/featureUtils.js +1 -1
- package/rest/featureService/FeatureService.d.ts +0 -5
- package/rest/networks/support/TraceLocation.d.ts +2 -1
- package/rest/networks/support/TraceResult.d.ts +0 -4
- package/rest/support/AttributeBinsQuery.d.ts +3 -2
- package/rest/support/ImageGPSInfoParameters.d.ts +2 -1
- package/rest/support/OutDistance.d.ts +2 -2
- package/rest/support/Query.d.ts +3 -2
- package/rest/support/TopFeaturesQuery.d.ts +2 -1
- package/rest/support/types.d.ts +10 -1
- package/smartMapping/raster/renderers/flow.d.ts +2 -1
- package/smartMapping/renderers/color.d.ts +11 -8
- package/smartMapping/renderers/location.d.ts +7 -4
- package/smartMapping/renderers/predominance.d.ts +7 -4
- package/smartMapping/renderers/relationship.d.ts +7 -4
- package/smartMapping/renderers/size.d.ts +6 -4
- package/smartMapping/renderers/type.d.ts +7 -4
- package/smartMapping/renderers/types.d.ts +15 -0
- package/smartMapping/renderers/univariateColorSize.d.ts +4 -2
- package/smartMapping/statistics/histogramForTimeSeries.js +1 -1
- package/smartMapping/statistics/summaryStatisticsForTimeSeries.js +1 -1
- package/smartMapping/symbology/flow.d.ts +2 -1
- package/smartMapping/symbology/types.d.ts +2 -1
- package/support/BasemapStyle.d.ts +2 -2
- package/symbols/cim/CIMCursor.js +1 -1
- package/symbols/cim/types.d.ts +7 -9
- package/tables/elements.d.ts +1 -0
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack.js +1 -1
- package/views/2d/engine/webgl/textureUtils.js +1 -1
- package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
- package/views/3d/analysis/support/projectionUtils.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +15 -2
- package/views/3d/environment/VirtualLighting.d.ts +15 -2
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/ground/GroundMouseWheelMove.js +2 -0
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/layers/GeospatialPDFLayerView3D.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DBufferGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayerBase.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicCreationContext.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DStageObjectGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/layers/support/featureReference.js +1 -1
- package/views/3d/navigation/Navigation3D.js +1 -1
- package/views/3d/state/controllers/GroundMouseWheelController.js +2 -0
- package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/terrain/BlendLayers.glsl.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/RasterColorizer.glsl.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/terrain/TextureReference.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderInfo.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTangent.glsl.js +7 -8
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +25 -25
- package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/forwardLocalUp.glsl.js +6 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/getLocalUp.glsl.js +4 -0
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/{TileBackground.glsl.js → blendLayers.glsl.js} +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +8 -2
- package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
- package/views/3d/webgl-engine/lib/DirtyEvents.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.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/TextureBackedBuffer/TextureBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/geometryMemoryUtils.js +2 -0
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatDepth.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +61 -108
- package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/DrawScreenTool.js +1 -1
- package/views/input/types.d.ts +2 -4
- package/views/interactive/options/LabelOptions.d.ts +5 -5
- package/views/interactive/options/SnappingOptions.d.ts +2 -2
- package/views/selection/SelectionOperation.js +1 -1
- package/views/selection/types.d.ts +43 -3
- package/views/support/layerViewUtils.js +1 -1
- package/views/support/selectionUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +0 -1
- package/widgets/Editor/VisibleElements.d.ts +4 -0
- package/widgets/Editor.d.ts +2 -0
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
- package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
- package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +2 -2
- package/widgets/PanoramicViewer/utils.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Search/LayerSearchSource.d.ts +1 -1
- package/widgets/Sketch/VisibleElements.d.ts +4 -0
- package/widgets/Sketch.d.ts +2 -0
- package/widgets/support/SelectionList/GroupLayerItem.d.ts +6 -0
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/ItemBase.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +6 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.d.ts +8 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0320cbd825f9a4222042.js +0 -1
- package/assets/esri/core/workers/chunks/067de1910190da228291.js +0 -1
- package/assets/esri/core/workers/chunks/09bd5df07eab80ae7b15.js +0 -1
- package/assets/esri/core/workers/chunks/164e74d586297946a717.js +0 -1
- package/assets/esri/core/workers/chunks/1c0c5cb13c2590aae906.js +0 -1
- package/assets/esri/core/workers/chunks/1c77de1e79860f8d2228.js +0 -1
- package/assets/esri/core/workers/chunks/24dac4970526a4e0ae63.js +0 -1
- package/assets/esri/core/workers/chunks/2acf2952cef69e382a35.js +0 -1
- package/assets/esri/core/workers/chunks/30dcf2cfb31cb70de7df.js +0 -1
- package/assets/esri/core/workers/chunks/371e2ddb88cc6b9a41e8.js +0 -1
- package/assets/esri/core/workers/chunks/42f6194633c2d879c8da.js +0 -1
- package/assets/esri/core/workers/chunks/44f90e75c1dc3d726a95.js +0 -1
- package/assets/esri/core/workers/chunks/4abd3753cd9b80e4d937.js +0 -1
- package/assets/esri/core/workers/chunks/4bb9a5f4ca944d3fc206.js +0 -1
- package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +0 -1
- package/assets/esri/core/workers/chunks/4d93bed14945e3d34d5c.js +0 -1
- package/assets/esri/core/workers/chunks/4e3f651ac76fcd53df2b.js +0 -1
- package/assets/esri/core/workers/chunks/505227797bcf2a1d908d.js +0 -1
- package/assets/esri/core/workers/chunks/58da3f8cf0f7f6a7e4fa.js +0 -1
- package/assets/esri/core/workers/chunks/5a19a9c3e01d3d415188.js +0 -1
- package/assets/esri/core/workers/chunks/5a830bc35adbedd33783.js +0 -1
- package/assets/esri/core/workers/chunks/6db0f8fe1402643fbe1a.js +0 -1
- package/assets/esri/core/workers/chunks/7124ad8dc5ad40dc66f3.js +0 -1
- package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +0 -1
- package/assets/esri/core/workers/chunks/7c631e2947243e2c9bde.js +0 -1
- package/assets/esri/core/workers/chunks/7f0f9dddc44b1f1600f0.js +0 -1
- package/assets/esri/core/workers/chunks/7fb7493f483cd9878bfa.js +0 -1
- package/assets/esri/core/workers/chunks/8e310e9cb9d84ac3ca2f.js +0 -1
- package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +0 -1
- package/assets/esri/core/workers/chunks/99a0a434ea2162166754.js +0 -1
- package/assets/esri/core/workers/chunks/9afc87474cef1fc4fe4a.js +0 -1
- package/assets/esri/core/workers/chunks/9cbde13e536676767900.js +0 -1
- package/assets/esri/core/workers/chunks/9cd3fcb5fca6f9dbbcd8.js +0 -1
- package/assets/esri/core/workers/chunks/a025ee38d402504193df.js +0 -1
- package/assets/esri/core/workers/chunks/a4b822ee45810c4c292a.js +0 -1
- package/assets/esri/core/workers/chunks/a51576d84edca88e41dd.js +0 -1
- package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +0 -1
- package/assets/esri/core/workers/chunks/ace41659a5ca0e5abfc3.js +0 -1
- package/assets/esri/core/workers/chunks/b01804aa6c47a220a603.js +0 -1
- package/assets/esri/core/workers/chunks/b3273f847405799e3362.js +0 -1
- package/assets/esri/core/workers/chunks/ba3d5abff65aefcb8dee.js +0 -1
- package/assets/esri/core/workers/chunks/bca6b469940b7b954123.js +0 -1
- package/assets/esri/core/workers/chunks/c0d7ae314ebfad1e3791.js +0 -1
- package/assets/esri/core/workers/chunks/c337fc0e6dc69c233e6d.js +0 -1
- package/assets/esri/core/workers/chunks/c8eae00b0ec87d8b2ff3.js +0 -1
- package/assets/esri/core/workers/chunks/cd9aa950cb74b09008fe.js +0 -1
- package/assets/esri/core/workers/chunks/e0d9dc97985561320bd4.js +0 -1
- package/assets/esri/core/workers/chunks/e2775b4b753306dc8477.js +0 -1
- package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +0 -1
- package/assets/esri/core/workers/chunks/ebbf425af348e6ede814.js +0 -1
- package/assets/esri/core/workers/chunks/efc53007cd2e4991d7d4.js +0 -1
- package/assets/esri/core/workers/chunks/f46e92c67986c8c09bdd.js +0 -1
- package/assets/esri/core/workers/chunks/f8bc474434fd365ab174.js +0 -1
- package/assets/esri/core/workers/chunks/f8d2225f333524ce1d88.js +0 -1
- package/assets/esri/core/workers/chunks/f95a1f878c9c1146180e.js +0 -1
- package/assets/esri/core/workers/chunks/fb37f0848196c28b7fd7.js +0 -1
- /package/assets/esri/core/workers/chunks/{768389f7f8dba6080df7.js.LICENSE.txt → 0cc7fba402a93e6d2455.js.LICENSE.txt} +0 -0
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{EvaluateAmbientLighting as e}from"./EvaluateAmbientLighting.glsl.js";import{EvaluateAmbientOcclusion as t}from"./EvaluateAmbientOcclusion.glsl.js";import{Gamma as n}from"./Gamma.glsl.js";import{mainLightDirection as r,lightingGlobalFactor as i,mainLightIntensity as a,lightingSpecularStrength as o,lightingEnvironmentStrength as s}from"./lightingUniforms.js";import{applyShading as c}from"./MainLighting.glsl.js";import{PhysicallyBasedRendering as l}from"./PhysicallyBasedRendering.glsl.js";import{PiUtils as u}from"./PiUtils.glsl.js";import{ReadGlobalIllumination as d}from"./ReadGlobalIllumination.glsl.js";import{BooleanBindUniform as f}from"../../shaderModules/BooleanBindUniform.js";import{
|
|
2
|
+
import{EvaluateAmbientLighting as e}from"./EvaluateAmbientLighting.glsl.js";import{EvaluateAmbientOcclusion as t}from"./EvaluateAmbientOcclusion.glsl.js";import{Gamma as n}from"./Gamma.glsl.js";import{mainLightDirection as r,lightingGlobalFactor as i,mainLightIntensity as a,lightingSpecularStrength as o,lightingEnvironmentStrength as s}from"./lightingUniforms.js";import{applyShading as c}from"./MainLighting.glsl.js";import{PhysicallyBasedRendering as l}from"./PhysicallyBasedRendering.glsl.js";import{PiUtils as u}from"./PiUtils.glsl.js";import{ReadGlobalIllumination as d}from"./ReadGlobalIllumination.glsl.js";import{BooleanBindUniform as f}from"../../shaderModules/BooleanBindUniform.js";import{glsl as p,If as m}from"../../shaderModules/glsl.js";import{ambientBoost as h}from"../../../lighting/SceneLighting.js";import{BlackLevelLightSoftCompression as g}from"../../../shaders/BlackLevelLightSoftCompression.glsl.js";import{ToneMapping as _}from"../../../shaders/ToneMapping.glsl.js";function v(e){e.constants.add(`ambientBoostFactor`,`float`,h)}function y(h,y){let{pbrMode:b,spherical:x,hasColorTexture:S,receiveGlobalIllumination:C}=y;h.include(n),h.include(d,y),h.include(t,y),b!==0&&h.include(l,y),h.include(e),h.include(u),h.include(_,y);let w=!(b===2&&!S);w&&h.include(g),v(h),h.uniforms.add(r,i).code.add(p`
|
|
3
3
|
float additionalDirectedAmbientLight(float lightAlignment) {
|
|
4
4
|
return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
float additionalDirectedAmbientLight(vec3 vPosWorld) {
|
|
8
|
-
float lightAlignment = dot(${
|
|
8
|
+
float lightAlignment = dot(${x?p`normalize(vPosWorld)`:p`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
|
|
9
9
|
return smoothstep(0.0, 1.0, clamp(lightAlignment * 2.5, 0.0, 1.0));
|
|
10
10
|
}
|
|
11
|
-
`),
|
|
11
|
+
`),h.uniforms.add(a).code.add(p`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
|
|
12
12
|
float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
|
|
13
13
|
return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
|
|
14
|
-
}`);let
|
|
14
|
+
}`);let T=C?`globalIlluminationOcclusion`:`ssao`;switch(h.constants.add(`globalIlluminationDirectFactor`,`float`,C?.55:0),h.constants.add(`globalIlluminationAmbientFactor`,`float`,C?.85:1),h.constants.add(`mainLightIrradianceScale`,`float`,C?.75:1),h.constants.add(`ambientIrradianceScale`,`float`,C?1.5:1),C?(h.constants.add(`globalIlluminationOcclusionBoost`,`float`,1.2),h.constants.add(`globalIlluminationEmissionBoost`,`float`,2.25),h.constants.add(`globalIlluminationEmissionCompressionWeight`,`float`,.75),h.code.add(p`vec3 evaluateGlobalIlluminationOcclusion() {
|
|
15
15
|
return min(globalIlluminationOcclusionBoost * readGlobalIlluminationOcclusion(), 1.0);
|
|
16
16
|
}
|
|
17
17
|
vec3 evaluateGlobalIlluminationEmission(vec3 albedoLinear) {
|
|
18
18
|
vec3 emission = globalIlluminationEmissionBoost * (0.75 * albedoLinear + 0.25) * readGlobalIlluminationEmission().rgb;
|
|
19
19
|
vec3 compressedEmission = emission / (emission + 1.0);
|
|
20
20
|
return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWeight);
|
|
21
|
-
}`)):(
|
|
21
|
+
}`)):(h.constants.add(`factorDirect`,`float`,0),h.constants.add(`factorAmbient`,`float`,1)),b){case 0:case 4:case 3:h.include(c),h.code.add(p`
|
|
22
22
|
vec3 evaluateSceneLighting(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
|
|
23
23
|
vec3 viewDirection, vec3 upDirection) {
|
|
24
|
-
${
|
|
24
|
+
${m(C,`vec3 globalIlluminationOcclusion = evaluateGlobalIlluminationOcclusion();`)}
|
|
25
25
|
|
|
26
26
|
vec3 mainLighting = mainLightIrradianceScale * applyShading(normal, shadow);
|
|
27
|
-
vec3 ambientLighting = ambientIrradianceScale * calculateAmbientIrradiance(normal) * (1.0 - ${
|
|
27
|
+
vec3 ambientLighting = ambientIrradianceScale * calculateAmbientIrradiance(normal) * (1.0 - ${T});
|
|
28
28
|
vec3 albedoLinear = linearizeGamma(albedo);
|
|
29
29
|
|
|
30
30
|
vec3 totalLight = mainLighting + ambientLighting + additionalLight;
|
|
31
31
|
totalLight = min(totalLight, vec3(PI));
|
|
32
32
|
vec3 linearColor = vec3((albedoLinear / PI) * totalLight);
|
|
33
|
-
${
|
|
33
|
+
${m(C,`linearColor += evaluateGlobalIlluminationEmission(albedoLinear);`)}
|
|
34
34
|
return delinearizeGamma(linearColor);
|
|
35
35
|
}
|
|
36
|
-
`);break;case 1:case 2:
|
|
36
|
+
`);break;case 1:case 2:h.constants.add(`groundReflectance`,`float`,C?.35:.2),h.code.add(p`
|
|
37
37
|
const float fillLightIntensity = 0.25;
|
|
38
38
|
const float horizonLightDiffusion = 0.4;
|
|
39
39
|
|
|
@@ -41,8 +41,8 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
|
|
|
41
41
|
vec3 viewDirection, vec3 upDirection) {
|
|
42
42
|
PBRShadingInfo inputs;
|
|
43
43
|
calculatePBRInputs(inputs, normal, viewDirection, upDirection, albedo);
|
|
44
|
-
${
|
|
45
|
-
`),
|
|
44
|
+
${m(C,`vec3 globalIlluminationOcclusion = evaluateGlobalIlluminationOcclusion();`)}
|
|
45
|
+
`),y.useFillLights?h.uniforms.add(new f(`hasFillLights`,e=>e.enableFillLights)):h.constants.add(`hasFillLights`,`bool`,!1),h.code.add(p`
|
|
46
46
|
vec3 ambientDir = vec3( 5.0 * upDirection[1] - upDirection[0] * upDirection[2],
|
|
47
47
|
-5.0 * upDirection[0] - upDirection[2] * upDirection[1],
|
|
48
48
|
upDirection[1] * upDirection[1] + upDirection[0] * upDirection[0]);
|
|
@@ -53,8 +53,8 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
|
|
|
53
53
|
// Calculate the irradiance components: sun, fill lights and the sky.
|
|
54
54
|
// Applying AO to both direct and ambient lighting enhances depth perception.
|
|
55
55
|
// This is an artistic choice; physically, AO should only attenuate ambient lighting.
|
|
56
|
-
vec3 directOcclusionFactor = mix(vec3(1.0), vec3(1.0 - ${
|
|
57
|
-
vec3 ambientOcclusionFactor = mix(vec3(1.0), vec3(1.0 - ${
|
|
56
|
+
vec3 directOcclusionFactor = mix(vec3(1.0), vec3(1.0 - ${T}), globalIlluminationDirectFactor);
|
|
57
|
+
vec3 ambientOcclusionFactor = mix(vec3(1.0), vec3(1.0 - ${T}), globalIlluminationAmbientFactor);
|
|
58
58
|
vec3 mainLightIrradianceComponent = mainLightIrradianceScale * inputs.NdotL * (1.0 - shadow) * mainLightIntensity * directOcclusionFactor;
|
|
59
59
|
vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity * directOcclusionFactor;
|
|
60
60
|
// calculate ambient irradiance for localView and additionalLight for globalView
|
|
@@ -64,7 +64,7 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
|
|
|
64
64
|
inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
|
|
65
65
|
// Assemble the overall irradiance of the ground that illuminates the surface. for this we use the simple model that changes only the sky irradiance by the groundReflectance
|
|
66
66
|
inputs.groundIrradianceToSurface = groundReflectance * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
|
|
67
|
-
`),
|
|
67
|
+
`),h.uniforms.add(o,s).code.add(p`
|
|
68
68
|
vec3 horizonRingDir = inputs.RdotUP * upDirection - inputs.reflectedView;
|
|
69
69
|
vec3 horizonRingH = normalize(horizonRingDir - viewDirection);
|
|
70
70
|
inputs.NdotH_Horizon = dot(normal, horizonRingH);
|
|
@@ -73,7 +73,7 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
|
|
|
73
73
|
vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity;
|
|
74
74
|
|
|
75
75
|
// calculateAmbientRadiance for localView and additionalLight for global view
|
|
76
|
-
vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance() * (1.0 - ${
|
|
76
|
+
vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance() * (1.0 - ${T}) + additionalLight;
|
|
77
77
|
float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotUP + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0));
|
|
78
78
|
|
|
79
79
|
// Assemble the overall radiance of the sky that illuminates the surface
|
|
@@ -84,19 +84,19 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
|
|
|
84
84
|
|
|
85
85
|
// Calculate average ambient radiance - This is used in the gamut mapping process to determine the black level for compression
|
|
86
86
|
inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + groundReflectance);
|
|
87
|
-
`),
|
|
87
|
+
`),h.constants.add(`additionalAmbientIrradianceFactor`,`float`,.02),h.code.add(p`
|
|
88
88
|
vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
|
|
89
89
|
float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
90
90
|
vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
|
|
91
91
|
vec3 linearColor = reflectedColorComponent + additionalMaterialReflectanceComponent;
|
|
92
92
|
|
|
93
|
-
${
|
|
93
|
+
${m(C,`linearColor += evaluateGlobalIlluminationEmission(inputs.albedoLinear);`)}
|
|
94
94
|
|
|
95
|
-
${
|
|
95
|
+
${w?`linearColor = blackLevelSoftCompression(linearColor, inputs.averageAmbientRadiance);`:`linearColor = max(vec3(0.0), linearColor - 0.005 * inputs.averageAmbientRadiance);`}
|
|
96
96
|
|
|
97
97
|
return delinearizeGamma(linearColor);
|
|
98
98
|
}
|
|
99
|
-
`);break;case 5:case 6:
|
|
99
|
+
`);break;case 5:case 6:h.constants.add(`terrainSpecularity`,`float`,C?.35:.5),h.uniforms.add(r,a).code.add(p`
|
|
100
100
|
const float roughnessTerrain = 0.5;
|
|
101
101
|
|
|
102
102
|
vec3 evaluateSceneLighting(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
|
|
@@ -104,12 +104,12 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
|
|
|
104
104
|
PBRShadingInfo inputs;
|
|
105
105
|
calculateSimplifiedInputs(inputs, normal, viewDirection, upDirection, albedo);
|
|
106
106
|
|
|
107
|
-
${
|
|
107
|
+
${m(C,`vec3 globalIlluminationOcclusion = evaluateGlobalIlluminationOcclusion();`)}
|
|
108
108
|
|
|
109
109
|
// Applying AO to both direct and ambient lighting enhances depth perception.
|
|
110
110
|
// This is an artistic choice; physically, AO should only attenuate ambient lighting.
|
|
111
|
-
vec3 directOcclusionFactor = mix(vec3(1.0), vec3(1.0 - ${
|
|
112
|
-
vec3 ambientOcclusionFactor = mix(vec3(1.0), vec3(1.0 - ${
|
|
111
|
+
vec3 directOcclusionFactor = mix(vec3(1.0), vec3(1.0 - ${T}), globalIlluminationDirectFactor);
|
|
112
|
+
vec3 ambientOcclusionFactor = mix(vec3(1.0), vec3(1.0 - ${T}), globalIlluminationAmbientFactor);
|
|
113
113
|
vec3 mainLightIrradianceComponent = mainLightIrradianceScale * (1.0 - shadow) * inputs.NdotL * mainLightIntensity * directOcclusionFactor;
|
|
114
114
|
vec3 ambientLightIrradianceComponent = ambientIrradianceScale * calculateAmbientIrradiance(normal) * ambientOcclusionFactor + additionalLight;
|
|
115
115
|
vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent;
|
|
@@ -124,11 +124,11 @@ return mix(emission, compressedEmission, globalIlluminationEmissionCompressionWe
|
|
|
124
124
|
|
|
125
125
|
vec3 linearColor = diffuseColor + specularComponent;
|
|
126
126
|
|
|
127
|
-
${
|
|
127
|
+
${m(C,`linearColor += evaluateGlobalIlluminationEmission(inputs.albedoLinear);`)}
|
|
128
128
|
|
|
129
129
|
return delinearizeGamma(linearColor);
|
|
130
130
|
}
|
|
131
|
-
`);break;case 7:
|
|
131
|
+
`);break;case 7:h.code.add(p`vec3 evaluateSceneLighting(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
|
|
132
132
|
vec3 viewDirection, vec3 upDirection) {
|
|
133
133
|
return albedo;
|
|
134
|
-
}`)}}export{
|
|
134
|
+
}`)}}export{y as EvaluateSceneLighting,v as addAmbientBoostFactor};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
3
|
-
vec3 getLocalUp(in vec3 pos) { return normalize(pos); }`:`vec3 getLocalUp(in vec3 pos, in vec3 origin) { return vec3(0.0, 0.0, 1.0); }
|
|
4
|
-
vec3 getLocalUp(in vec3 pos) { return vec3(0.0, 0.0, 1.0); }`),n?t.code.add(e`mat3 getTBNMatrix(in vec3 n) {
|
|
2
|
+
import{getLocalUp as e}from"./getLocalUp.glsl.js";import{glsl as t}from"../../shaderModules/glsl.js";function n(n,r){n.include(e,r),r.spherical?n.code.add(t`mat3 getTBNMatrix(in vec3 n) {
|
|
5
3
|
vec3 t = normalize(cross(vec3(0.0, 0.0, 1.0), n));
|
|
6
4
|
vec3 b = normalize(cross(n, t));
|
|
7
5
|
return mat3(t, b, n);
|
|
8
|
-
}`):
|
|
6
|
+
}`):n.code.add(t`mat3 getTBNMatrix(in vec3 n) {
|
|
9
7
|
vec3 t = vec3(1.0, 0.0, 0.0);
|
|
10
8
|
vec3 b = normalize(cross(n, t));
|
|
11
9
|
return mat3(t, b, n);
|
|
12
|
-
}`)}export{
|
|
10
|
+
}`)}export{n as NormalUtils};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
import{UNIT_Z as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getLocalUp as t}from"./getLocalUp.glsl.js";import{If as n,glsl as r}from"../../shaderModules/glsl.js";function i(i,a){let{vertex:o,fragment:s,varyings:c}=i,{spherical:l}=a;l?(o.include(t,a),c.add(`upNormal`,`vec3`)):s.constants.add(`upNormal`,`vec3`,e),o.code.add(r`
|
|
3
|
+
void forwardLocalUp(vec3 pos, vec3 origin) {
|
|
4
|
+
${n(l,r`upNormal = getLocalUp(pos, origin);`)}
|
|
5
|
+
}
|
|
6
|
+
`)}export{i as forwardLocalUp};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
function e(e,{spherical:t}){e.code.add(t?`vec3 getLocalUp(in vec3 pos, in vec3 origin) { return normalize(pos + origin); }
|
|
3
|
+
vec3 getLocalUp(in vec3 pos) { return normalize(pos); }`:`vec3 getLocalUp(in vec3 pos, in vec3 origin) { return vec3(0.0, 0.0, 1.0); }
|
|
4
|
+
vec3 getLocalUp(in vec3 pos) { return vec3(0.0, 0.0, 1.0); }`)}export{e as getLocalUp};
|
|
@@ -9,7 +9,7 @@ import{ReadShadowMapPassParameters as e}from"../shading/readShadow.glsl.js";impo
|
|
|
9
9
|
if (opacities.y <= 0.0) {
|
|
10
10
|
return color * opacities.z * opacities.x;
|
|
11
11
|
}
|
|
12
|
-
vec4 bg = vec4(${_
|
|
12
|
+
vec4 bg = vec4(${_?`backgroundColor`:`gridColor(uv)`} * opacities.y, opacities.y);
|
|
13
13
|
vec4 layer = color * opacities.z;
|
|
14
14
|
return (bg * (1.0 - layer.a) + layer) * opacities.x;
|
|
15
15
|
`,`return color;`)}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{ZEROS as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BackgroundGrid as t}from"./BackgroundGrid.glsl.js";import{BlendModes as n}from"../util/BlendModes.glsl.js";import{Float3PassUniform as r}from"../../shaderModules/Float3PassUniform.js";import{FloatPassUniform as i}from"../../shaderModules/FloatPassUniform.js";import{
|
|
2
|
+
import{ZEROS as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BackgroundGrid as t}from"./BackgroundGrid.glsl.js";import{BlendModes as n}from"../util/BlendModes.glsl.js";import{Float3PassUniform as r}from"../../shaderModules/Float3PassUniform.js";import{FloatPassUniform as i}from"../../shaderModules/FloatPassUniform.js";import{If as a,glsl as o}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as s}from"../../shaderModules/Texture2DPassUniform.js";import{NoParameters as c}from"../../../../../webgl/NoParameters.js";class l extends c{constructor(){super(...arguments),this.baseOpacity=1,this.backgroundColor=e,this.fboTexture=null}}function u(e,c){let{output:l,blendMode:u,applyBaseOpacity:d,premultipliedAlphaSource:f}=c,p=e.fragment;d&&p.uniforms.add(new i(`baseOpacity`,e=>e.baseOpacity)),p.include(n,c);let m=``;switch(l){case 4:case 0:m=`vec4(0.0)`;break;case 2:p.uniforms.add(new r(`backgroundColor`,e=>e.backgroundColor)),m=`vec4(backgroundColor, 1.0)`;break;case 3:p.include(t),m=`vec4(gridColor(uv), 1.0)`;break;case 1:p.uniforms.add(new s(`fboColor`,e=>e.fboTexture)),m=`texelFetch(fboColor, ivec2(gl_FragCoord.xy), 0)`}p.code.add(o`
|
|
3
3
|
vec4 getBackground(vec2 uv) {
|
|
4
|
-
return ${
|
|
5
|
-
}`),
|
|
4
|
+
return ${a(d,`baseOpacity *`)} ${m};
|
|
5
|
+
}`),u===0?!f&&(l===1&&!d||l===4)?p.code.add(o`vec4 blendLayers(vec2 bgUV, vec4 colorLayer, float opacity) {
|
|
6
|
+
return colorLayer * opacity;
|
|
7
|
+
}`):p.code.add(o`vec4 blendLayers(vec2 bgUV, vec4 colorLayer, float opacity) {
|
|
8
|
+
float composeAlpha = colorLayer.a * opacity;
|
|
9
|
+
vec4 bgColor = getBackground(bgUV);
|
|
10
|
+
return bgColor * (1.0 - composeAlpha) + colorLayer * opacity;
|
|
11
|
+
}`):p.code.add(o`vec4 blendLayers(vec2 bgUV, vec4 colorLayer, float opacity) {
|
|
6
12
|
vec3 cl = colorLayer.a == 0.0 ? colorLayer.rgb : colorLayer.rgb / colorLayer.a;
|
|
7
13
|
vec4 bgColor = getBackground(bgUV);
|
|
8
14
|
vec3 cb = bgColor.a == 0.0 ? bgColor.rgb : bgColor.rgb / bgColor.a;
|
|
9
15
|
return applyBlendMode(clamp(cl, vec3(0.0), vec3(1.0)), colorLayer.a * opacity, cb, bgColor.a);
|
|
10
|
-
}`)
|
|
11
|
-
vec4 blendLayers(vec2 bgUV, vec4 colorLayer, float opacity) {
|
|
12
|
-
float composeAlpha = colorLayer.a * opacity;
|
|
13
|
-
${o(h,a`return colorLayer * opacity;`,a`
|
|
14
|
-
vec4 bgColor = getBackground(bgUV);
|
|
15
|
-
return bgColor * (1.0 - composeAlpha) + colorLayer * opacity;
|
|
16
|
-
`)}
|
|
17
|
-
}`)}export{u as TileBackground,l as TileBackgroundPassParameters};
|
|
16
|
+
}`)}export{l as TileBackgroundPassParameters,u as blendLayers};
|
|
@@ -7,8 +7,8 @@ float mid = 0.5 * (covariance2D.x + covariance2D.z);
|
|
|
7
7
|
float radius = length(vec2((covariance2D.x - covariance2D.z) * 0.5, covariance2D.y));
|
|
8
8
|
return vec2(mid + radius, mid - radius);
|
|
9
9
|
}
|
|
10
|
-
float computeGaussianEllipseThreshold(float
|
|
11
|
-
return max(0.0, -2.0 *
|
|
10
|
+
float computeGaussianEllipseThreshold(float logFalloffCutoff) {
|
|
11
|
+
return max(0.0, -2.0 * logFalloffCutoff);
|
|
12
12
|
}
|
|
13
13
|
bool rejectGaussianByMinimumRadius(float maxRadius, float opacity, float minSplatRadius) {
|
|
14
14
|
return minSplatRadius > 0.0 && maxRadius * opacity < minSplatRadius;
|
|
@@ -23,6 +23,12 @@ return any(greaterThan(abs(ndcPosition) - radiusNDC, vec2(1.0)));
|
|
|
23
23
|
vec2 computeGaussianUnitQuadCorner(int vertexID) {
|
|
24
24
|
return vec2((vertexID << 1) & 2, vertexID & 2) - 1.0;
|
|
25
25
|
}
|
|
26
|
+
vec2 computeGaussianQuadOffset(vec3 covariance2D, float determinant, vec2 coordinates) {
|
|
27
|
+
float inverseRadiusX = inversesqrt(covariance2D.x);
|
|
28
|
+
vec2 choleskyAxisX = covariance2D.xy * inverseRadiusX;
|
|
29
|
+
vec2 choleskyAxisY = vec2(0.0, sqrt(determinant) * inverseRadiusX);
|
|
30
|
+
return coordinates.x * choleskyAxisX + coordinates.y * choleskyAxisY;
|
|
31
|
+
}
|
|
26
32
|
float evaluateGaussianExponent(vec2 canonicalCoordinates) {
|
|
27
33
|
return -0.5 * dot(canonicalCoordinates, canonicalCoordinates);
|
|
28
34
|
}`)}export{t as GaussianSplatEvaluation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{set as e}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{
|
|
2
|
+
import{set as e}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as t}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{normalize as n,set as r}from"../../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Float2BindUniform as a}from"../../shaderModules/Float2BindUniform.js";import{Float3BindUniform as o}from"../../shaderModules/Float3BindUniform.js";import{Float4BindUniform as s}from"../../shaderModules/Float4BindUniform.js";import{FloatBindUniform as c}from"../../shaderModules/FloatBindUniform.js";import{Matrix4BindUniform as l}from"../../shaderModules/Matrix4BindUniform.js";const u=new l(`view`,({camera:e})=>e.viewMatrix),d=new l(`inverseViewMatrix`,({camera:e})=>e.inverseViewMatrix),f=new l(`proj`,({camera:e})=>e.projectionMatrix),p=new l(`inverseProjectionMatrix`,({camera:e})=>e.inverseProjectionMatrix),m=new o(`cameraPosition`,({camera:e})=>e.eye),h=new l(`viewNormal`,({camera:e})=>e.viewInverseTransposeMatrix),g=new o(`localUpView`,({camera:e})=>{let t=e.viewInverseTransposeMatrix;return n(D,r(D,t[8],t[9],t[10]))}),_=new a(`nearFar`,({camera:e})=>e.nearFar),v=new s(`viewport`,({camera:e})=>e.fullViewport),y=new c(`pixelRatio`,e=>e.camera.pixelRatio/e.overlayStretch),b=new c(`screenPixelSizePerDistance`,({camera:e})=>e.screenPixelSizePerDistance),x=new c(`worldToScreenPerDistanceRatio`,({camera:e})=>1/e.screenPixelSizePerDistance),S=new c(`renderPixelSizePerDistance`,({camera:e})=>e.renderPixelSizePerDistance),C=new c(`metersPerRenderUnit`,e=>e.metersPerRenderUnit),w=new a(`inverseScreenSize`,({camera:t})=>e(E,1/t.fullWidth,1/t.fullHeight)),T=new a(`pixelToNDC`,({camera:t})=>e(E,2/t.fullViewport[2],2/t.fullViewport[3])),E=t(),D=i();export{m as cameraPosition,p as inverseProjectionMatrix,w as inverseScreenSize,d as inverseViewMatrix,g as localUpView,C as metersPerRenderUnit,_ as nearFar,y as pixelRatio,T as pixelToNDC,f as projMatrix,S as renderPixelSizePerDistance,b as screenPixelSizePerDistance,u as viewMatrix,h as viewNormal,v as viewport,x as worldToScreenPerDistanceRatio};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import"../../core/shaderLibrary/
|
|
2
|
+
import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderLibrary/output/ReadDepthLastFrame.glsl.js";import"../../core/shaderLibrary/shading/lightingUniforms.js";import"../../core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js";import"../../core/shaderLibrary/util/CameraSpace.glsl.js";import"../../core/shaderLibrary/util/cameraUniforms.js";import"../../core/shaderModules/FloatBindUniform.js";import"../../core/shaderModules/FloatPassUniform.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Matrix4BindUniform.js";import"../../core/shaderModules/Texture2DBindUniform.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"./GlobalIlluminationColorQuantization.glsl.js";import"../../shaders/floatBlendScale.glsl.js";import"../../shaders/ToneMapping.glsl.js";import"../../../../webgl/enums.js";import"../../../../webgl/NoParameters.js";import"../../../../webgl/ShaderBuilder.js";export{G as GlobalIlluminationPassParameters,b as build}from"../../../../../chunks/GlobalIllumination.glsl.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../../core/maybe.js";import{watch as n,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{waitRender as i}from"../../../../../core/scheduling.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{set as o}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_W as s,ZEROS as c}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as l}from"../../../webgl.js";import{AmbientIllumination as u}from"../AmbientIllumination.js";import{G as d}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as f}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as p}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as m}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as h}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as g}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as _}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as v,ColorAttachment1 as y}from"../../../../webgl/enums.js";let b=class extends u{constructor(e){super(e),this._passParameters=new d,this._drawParameters=new f,this._drawParametersUpscale=new g,this._configuration=new h,this._lastOutput=null,this._isGlobalIlluminationUpdate=!1,this._lowQualityResolutionScale=.35,this._maxFrames=256}initialize(){this.addHandles(n(()=>this._mode,e=>{e===0?this._disable():this._enable()},r))}destroy(){this._lastOutput=t(this._lastOutput)}_disable(){super._disable(),this._resetAccumulation(),this._passParameters.temporalSampleFrame=0}get hasHighQuality(){return this._mode===2}resetAccumulation(){!this._isGlobalIlluminationUpdate&&(this._passParameters.accumulatedFrames>100||!this._configuration.hasEmission)&&this._resetAccumulation()}_resetAccumulation(){this._passParameters.accumulatedFrames=0,this._lastOutput=t(this._lastOutput)}get isAccumulating(){return this.enabled&&this._passParameters.accumulatedFrames<this._maxFrames}precompile(){this.techniques.getCompiled(_)}render(e){if(this.bindParameters.frameRendererTarget===3)return null;let t=this.bindParameters.frameRendererTarget!==0;if(this._passParameters.accumulatedFrames>=this._maxFrames&&!t)return this._lastOutput?.retain(),this._lastOutput;let n=e.find(({name:e})=>e===`normals`),r=n?.getTexture(),i=n?.getTexture(v);return!r||!i||this._mode===0?this._emptyOutput:(this._configuration.hasEmission=!!this.bindParameters.reprojection.lastFrameEmission,t?this._renderOffscreen(r,i):this._renderInteractive(r,i))}_renderOffscreen(e,t){let n=this._emptyOutput,r=this._passParameters.accumulatedFrames,i=this._passParameters.temporalSampleFrame;this._passParameters.accumulatedFrames=0,this._passParameters.temporalSampleFrame=0;let a=this.techniques.get(m,this._configuration),o=this.techniques.get(p);for(;this._passParameters.accumulatedFrames<this._maxFrames;){this._passParameters.globalIllumination=n.getTexture(),this._passParameters.globalIlluminationWeights=n.getTexture(y);let r=this._renderAccumulationFrame(e,t,a,o);++this._passParameters.accumulatedFrames,n.release(),n=r}return this._passParameters.globalIllumination=null,this._passParameters.globalIlluminationWeights=null,this._passParameters.accumulatedFrames=r,this._passParameters.temporalSampleFrame=i,n}_renderInteractive(e,t){if(!this._canRender)return this._requestRender(),this._emptyOutput;let n=this._mode===1?this._lowQualityResolutionScale:1,r=this.techniques.getCompiled(m,this._configuration),i=this.techniques.getCompiled(p),a=n<1,o=a?this.techniques.getCompiled(_):null;if(!r||!i||a&&!o)return this._requestRender(),this._emptyOutput;let s=this._renderAccumulationFrame(e,t,r,i,o,n);return++this._passParameters.accumulatedFrames,this._passParameters.accumulatedFrames<this._maxFrames&&this._requestRender(),this._storeOutput(s),s}_renderAccumulationFrame(e,t,n,r,i,a=1){let s=this.bindParameters,c=this.renderingContext,{camera:u}=s;this._passParameters.normalTexture=e,this._passParameters.depthTexture=t,this._passParameters.projScale=1/u.computeScreenPixelSizeAtDistance(1),this._passParameters.resolutionScale=a,this._passParameters.glowBoost=this._glowBoost;let{fullWidth:d,fullHeight:f}=u,p=Math.max(1,Math.floor(d*a)),m=Math.max(1,Math.floor(f*a)),h=this.fboCache.acquire(p,m,`global illumination input`).acquireColor(y,2);c.bindFramebuffer(h.fbo),c.setViewport(0,0,p,m),c.bindTechnique(n,s,this._passParameters,this._drawParameters),c.screen.draw();let g=Math.max(1,Math.round(p)),_=Math.max(1,Math.round(m)),v=this.fboCache.acquire(g,_,`global illumination blur horizontal`);c.bindFramebuffer(v.fbo);let b=h.obtainAttachment(y);this._drawParameters.texture=h.getTexture(),this._drawParameters.weightTexture=b.attachment,o(this._drawParameters.blurSize,0,1/m),c.bindTechnique(r,s,this._passParameters,this._drawParameters),c.setViewport(0,0,g,_),c.screen.draw(),h.release();let x=this.fboCache.acquire(g,_,i?`global illumination blur vertical`:l.AMBIENT_ILLUMINATION);c.bindFramebuffer(x.fbo),c.setViewport(0,0,g,_),c.setClearColor(1,1,1,0),c.clear(16384),this._drawParameters.texture=v.getTexture(),this._drawParameters.weightTexture=b.attachment,o(this._drawParameters.blurSize,1/g,0),c.bindTechnique(r,s,this._passParameters,this._drawParameters),c.setViewport(0,0,g,_),c.screen.draw(),v.release(),x.attachColor(b,y),b.release();let S=x;return i&&(S=this.fboCache.acquire(d,f,l.AMBIENT_ILLUMINATION).acquireColor(y,2),c.bindFramebuffer(S.fbo),c.setViewport(0,0,d,f),c.setClearColor(1,1,1,0),c.clear(16384),this._drawParametersUpscale.colorTexture=x.getTexture(),this._drawParametersUpscale.weightTexture=x.getTexture(y),c.bindTechnique(i,s,this._passParameters,this._drawParametersUpscale),c.screen.draw(),x.release()),c.setViewport4fv(u.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,S}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_storeOutput(e){this._lastOutput!==e&&(this._lastOutput=t(this._lastOutput),this._lastOutput=e,this._lastOutput.retain())}get _emptyOutput(){let e=this.renderingContext,{fullWidth:t,fullHeight:n}=this.bindParameters.camera,r=this.fboCache.acquire(t,n,l.AMBIENT_ILLUMINATION).acquireColor(y,2);return e.bindFramebuffer(r.fbo),e.setViewport(0,0,t,n),e.clearBuffer(0,s),e.clearBuffer(1,c),r}get _canRender(){let{reprojection:e,hasEmission:t,globalIllumination:n}=this.bindParameters;return
|
|
2
|
+
import{__decorate as e}from"tslib";import{releaseMaybe as t}from"../../../../../core/maybe.js";import{watch as n,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{waitRender as i}from"../../../../../core/scheduling.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators.js";import{set as o}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{UNIT_W as s,ZEROS as c}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{InternalRenderCategory as l}from"../../../webgl.js";import{AmbientIllumination as u}from"../AmbientIllumination.js";import{G as d}from"../../../../../chunks/GlobalIllumination.glsl.js";import{G as f}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as p}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as m}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as h}from"./GlobalIlluminationTechniqueConfiguration.js";import{G as g}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as _}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as v,ColorAttachment1 as y}from"../../../../webgl/enums.js";let b=class extends u{constructor(e){super(e),this._passParameters=new d,this._drawParameters=new f,this._drawParametersUpscale=new g,this._configuration=new h,this._lastOutput=null,this._isGlobalIlluminationUpdate=!1,this._lowQualityResolutionScale=.35,this._maxFrames=256}initialize(){this.addHandles(n(()=>this._mode,e=>{e===0?this._disable():this._enable()},r))}destroy(){this._lastOutput=t(this._lastOutput)}_disable(){super._disable(),this._resetAccumulation(),this._passParameters.temporalSampleFrame=0}get hasHighQuality(){return this._mode===2}resetAccumulation(){!this._isGlobalIlluminationUpdate&&(this._passParameters.accumulatedFrames>100||!this._configuration.hasEmission)&&this._resetAccumulation()}_resetAccumulation(){this._passParameters.accumulatedFrames=0,this._lastOutput=t(this._lastOutput)}get isAccumulating(){return this.enabled&&this._passParameters.accumulatedFrames<this._maxFrames}precompile(){this.techniques.getCompiled(_)}render(e){if(this.bindParameters.frameRendererTarget===3)return null;let t=this.bindParameters.frameRendererTarget!==0;if(this._passParameters.accumulatedFrames>=this._maxFrames&&!t)return this._lastOutput?.retain(),this._lastOutput;let n=e.find(({name:e})=>e===`normals`),r=n?.getTexture(),i=n?.getTexture(v);return!r||!i||this._mode===0?this._emptyOutput:(this._configuration.hasEmission=!!this.bindParameters.reprojection.lastFrameEmission,t?this._renderOffscreen(r,i):this._renderInteractive(r,i))}_renderOffscreen(e,t){let n=this._emptyOutput,r=this._passParameters.accumulatedFrames,i=this._passParameters.temporalSampleFrame;this._passParameters.accumulatedFrames=0,this._passParameters.temporalSampleFrame=0;let a=this.techniques.get(m,this._configuration),o=this.techniques.get(p);for(;this._passParameters.accumulatedFrames<this._maxFrames;){this._passParameters.globalIllumination=n.getTexture(),this._passParameters.globalIlluminationWeights=n.getTexture(y);let r=this._renderAccumulationFrame(e,t,a,o);++this._passParameters.accumulatedFrames,n.release(),n=r}return this._passParameters.globalIllumination=null,this._passParameters.globalIlluminationWeights=null,this._passParameters.accumulatedFrames=r,this._passParameters.temporalSampleFrame=i,n}_renderInteractive(e,t){if(!this._canRender)return this._requestRender(),this._emptyOutput;let n=this._mode===1?this._lowQualityResolutionScale:1,r=this.techniques.getCompiled(m,this._configuration),i=this.techniques.getCompiled(p),a=n<1,o=a?this.techniques.getCompiled(_):null;if(!r||!i||a&&!o)return this._requestRender(),this._emptyOutput;let s=this._renderAccumulationFrame(e,t,r,i,o,n);return++this._passParameters.accumulatedFrames,this._passParameters.accumulatedFrames<this._maxFrames&&this._requestRender(),this._storeOutput(s),s}_renderAccumulationFrame(e,t,n,r,i,a=1){let s=this.bindParameters,c=this.renderingContext,{camera:u}=s;this._passParameters.normalTexture=e,this._passParameters.depthTexture=t,this._passParameters.projScale=1/u.computeScreenPixelSizeAtDistance(1),this._passParameters.resolutionScale=a,this._passParameters.glowBoost=this._glowBoost;let{fullWidth:d,fullHeight:f}=u,p=Math.max(1,Math.floor(d*a)),m=Math.max(1,Math.floor(f*a)),h=this.fboCache.acquire(p,m,`global illumination input`).acquireColor(y,2);c.bindFramebuffer(h.fbo),c.setViewport(0,0,p,m),c.bindTechnique(n,s,this._passParameters,this._drawParameters),c.screen.draw();let g=Math.max(1,Math.round(p)),_=Math.max(1,Math.round(m)),v=this.fboCache.acquire(g,_,`global illumination blur horizontal`);c.bindFramebuffer(v.fbo);let b=h.obtainAttachment(y);this._drawParameters.texture=h.getTexture(),this._drawParameters.weightTexture=b.attachment,o(this._drawParameters.blurSize,0,1/m),c.bindTechnique(r,s,this._passParameters,this._drawParameters),c.setViewport(0,0,g,_),c.screen.draw(),h.release();let x=this.fboCache.acquire(g,_,i?`global illumination blur vertical`:l.AMBIENT_ILLUMINATION);c.bindFramebuffer(x.fbo),c.setViewport(0,0,g,_),c.setClearColor(1,1,1,0),c.clear(16384),this._drawParameters.texture=v.getTexture(),this._drawParameters.weightTexture=b.attachment,o(this._drawParameters.blurSize,1/g,0),c.bindTechnique(r,s,this._passParameters,this._drawParameters),c.setViewport(0,0,g,_),c.screen.draw(),v.release(),x.attachColor(b,y),b.release();let S=x;return i&&(S=this.fboCache.acquire(d,f,l.AMBIENT_ILLUMINATION).acquireColor(y,2),c.bindFramebuffer(S.fbo),c.setViewport(0,0,d,f),c.setClearColor(1,1,1,0),c.clear(16384),this._drawParametersUpscale.colorTexture=x.getTexture(),this._drawParametersUpscale.weightTexture=x.getTexture(y),c.bindTechnique(i,s,this._passParameters,this._drawParametersUpscale),c.screen.draw(),x.release()),c.setViewport4fv(u.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,S}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_storeOutput(e){this._lastOutput!==e&&(this._lastOutput=t(this._lastOutput),this._lastOutput=e,this._lastOutput.retain())}get _emptyOutput(){let e=this.renderingContext,{fullWidth:t,fullHeight:n}=this.bindParameters.camera,r=this.fboCache.acquire(t,n,l.AMBIENT_ILLUMINATION).acquireColor(y,2);return e.bindFramebuffer(r.fbo),e.setViewport(0,0,t,n),e.clearBuffer(0,s),e.clearBuffer(1,c),r}get _canRender(){let{reprojection:e,hasEmission:t,globalIllumination:n}=this.bindParameters;return(!t||!!e.lastFrameEmission)&&!!e.lastFrameDepth&&!!n}get _glowBoost(){let e=this.view.environment.lighting.glow;return e==null?0:2+3*e.intensity}get _mode(){return this._useGlobalIllumination?this.view.stage.renderer.isFeatureEnabled(10)?2:1:0}get test(){let e=this;return{get maxFrames(){return e._maxFrames},set maxFrames(t){e._maxFrames=t},get lowQualityResolutionScale(){return e._lowQualityResolutionScale},set lowQualityResolutionScale(t){e._lowQualityResolutionScale=t},passParameters:this._passParameters,configuration:this._configuration,get mode(){return e._mode},async restartAccumulation(){e.produces!==`disabled`&&(e._disable(),await i(),e._enable())}}}};b=e([a(`esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination`)],b);export{b as GlobalIllumination};
|
package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{parameter as t,ShaderTechniqueConfiguration as n}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";
|
|
2
|
+
import{__decorate as e}from"tslib";import{parameter as t,ShaderTechniqueConfiguration as n}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends n{constructor(){super(...arguments),this.hasColor=!0,this.hasEmission=!1,this.rayMarchMaxReach=.5,this.rayMarchMaxSteps=16,this.useProjectedRayLength=!0,this.clampRayToScreen=!1}}e([t()],r.prototype,`hasColor`,void 0),e([t()],r.prototype,`hasEmission`,void 0);export{r as GlobalIlluminationTechniqueConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{releaseMaybe as e}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import r from"../../webgl/RenderCamera.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as a}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as o}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as s}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as c}from"../lighting/SceneLighting.js";class l{constructor(e,t){this.width=e,this.height=t}}class u{constructor(e){this.shadowMap=e,this.output=0,this.slot=2,this.slicePlane=null,this.planarDistanceToGroundRatio=1,this.metersPerRenderUnit=1,this.hasOccludees=!1,this._emissions=t(0),this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.
|
|
2
|
+
import{releaseMaybe as e}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import r from"../../webgl/RenderCamera.js";import{isColor as i}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as a}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as o}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as s}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as c}from"../lighting/SceneLighting.js";class l{constructor(e,t){this.width=e,this.height=t}}class u{constructor(e){this.shadowMap=e,this.output=0,this.slot=2,this.slicePlane=null,this.planarDistanceToGroundRatio=1,this.metersPerRenderUnit=1,this.hasOccludees=!1,this._emissions=t(0),this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.frameRendererTarget=0,this.overlayStretch=1,this.viewshedEnabled=!1,this.laserlinesEnabled=!1,this.shadowAnalysisEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this._camera=t(new r),this._inverseViewport=n(),this._oldLighting=new c,this._newLighting=new c,this._fadedLighting=new c,this._lighting=this._newLighting,this.screenSpaceReflections=new s,this.reprojection=new o,this.highlights=[],this.highlightMixOrigin=n(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new a,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=e(this.depth),this.shadowMap?.dispose()}get emissions(){return this._emissions.value}set emissions(e){this._emissions.value=e}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return this.emissions===1||this.emissions===3}get hasTransparentEmission(){return this.emissions===2||this.emissions===3}get hasEmissions(){return this.emissions!==0}get camera(){return this._camera.value}set camera(e){this._camera.value=e,this._inverseViewport[0]=1/e.fullViewport[2],this._inverseViewport[1]=1/e.fullViewport[3]}get enableOITOffset(){return this.camera.relativeElevation<5e5}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(e,t,n,r){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=n,this._newLighting.set(e),this._oldLighting.updateLegacy(),r===1&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return this.frameRendererTarget!==3&&i(this.output)&&this.screenSpaceReflections.enabled&&this.reprojection.lastFrameColor!=null}get highlight(){return this.highlightLevel==null?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(e){e&&(e.name=`geometry depth`),this._depth=e}get occluder(){return this.slot===10||this.slot===11?this.slot:null}}export{u as BindParameters,l as ViewportSize};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/PooledArray.js";import{subtract as
|
|
2
|
+
import{baseObjectMemory as e,estimateFixedArrayMemory as t,baseTypedArrayMemory as n,integerArrayElementBytes as r}from"../../../../core/memoryEstimations.js";import i from"../../../../core/PooledArray.js";import{isTypedArray as a}from"../../../../core/typedArrayUtil.js";import{subtract as o,sqrLen as s,scaleAndAdd as c,min as l}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as u}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as d,expandWithVec3 as f,center as p,width as m,depth as h,height as g,squareDiameter as _}from"../../../../geometry/support/aaBoundingBox.js";import{isSharedIndexArray as v}from"../../../../geometry/support/Indices.js";import{Sphere as y}from"../../../../geometry/support/sphere.js";import{assert as b}from"./Util.js";class x{constructor(e,t,n,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this._readPosition=n,this._notifyMemoryChange=r,this._children=void 0,b(e.length>=1);let i=e.length;T.clear();let a=d();for(let r=0;r<i;++r){let i=t*e[r];for(let e=0;e<t;++e){let t=i+e;T.push(t),f(a,n(S,t))}}this.box=a;let l=new y,u=p(a,l.center),_=.5*Math.max(m(a),h(a),g(a)),v=_*_;for(let e=0;e<T.length;++e){let t=n(S,T.at(e)),r=o(t,t,u),i=s(r);if(i<=v)continue;let a=Math.sqrt(i),l=(a-_)*.5;_+=l,v=_*_;let d=l/a;c(u,u,r,d)}l.radius=_,this.sphere=l,T.clear()}get usedMemory(){let n=e+56+t(this.box,8)+e+16+t(this.sphere.center,8)+E(this.primitiveIndices),r=this._children;if(r){n+=t(r,8);for(let e of r)n+=e.usedMemory}return n}get children(){if(this._children)return this._children;let e=this.box;if(_(e)<=1)return;let{_readPosition:n,_numIndexPerPrimitive:r,primitiveIndices:i}=this,a=p(e,S),o=i.length,s=new Uint8Array(o),c=[0,0,0,0,0,0,0,0];for(let e=0;e<o;++e){let t=r*i[e],o=n(C,t);for(let e=1;e<r;++e)l(o,o,n(w,t+e));let u=+(o[0]<a[0])|(o[1]<a[1]?2:0)|(o[2]<a[2]?4:0);s[e]=u,++c[u]}let u=0;for(let e=0;e<8;++e)c[e]>0&&++u;if(u<2)return;let d=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0];for(let e=0;e<8;++e)c[e]>0&&(d[e]=new Uint32Array(c[e]));c.fill(0);for(let e=0;e<o;++e){let t=s[e];d[t][c[t]++]=i[e]}let f=[];for(let e=0;e<8;++e){let t=d[e];t!==void 0&&f.push(new x(t,r,n,this._notifyMemoryChange))}return this._children=f,this._notifyMemoryChange?.(t(f,8)+f.reduce((e,t)=>e+t.usedMemory,0)),f}static prune(){T.prune()}}const S=u(),C=u(),w=u(),T=new i({deallocator:null});function E(e){return a(e)?n+(v(e)?0:e.byteLength):v(e)?0:t(e,r)}export{x as BoundingInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{integerArrayElementBytes as e}from"../../../../core/memoryEstimations.js";import{add as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{getContinuousIndexArray as n}from"../../../../geometry/support/Indices.js";import{NullSphere as r,Sphere as i}from"../../../../geometry/support/sphere.js";import{affectsGeometry as a}from"./affectsGeometry.js";import{BoundingInfo as o}from"./BoundingInfo.js";import{BufferGeometryBaseInstance as s}from"./BufferGeometryBaseInstance.js";import{Object3DHighlightStateID as c}from"./Object3DStateID.js";import{assert as l}from"./Util.js";class u extends s{constructor(e,t,n,r=null,i=null){super(t),this.material=e,this.localOrigin=n,this.mapPositions=r,this.baseGeometry=i,this.layerViewUid=null,this.graphicUid=null,this.castShadow=!1,this._readPrimitivePosition=null,this._boundingInfo=null,this._boundingSphere=null,this._highlights=null,this._highlightOptionsCounts=null,this.occludees=void 0,this.visible=!0;let a=e?.useIndexing??!1,o=t.index!=null,s=i!=null;l(!s||!a&&i.buffers.index==null&&!o,`Instancing for index materials is not supported`),l(!s||t.vertex.count===1,`Instanced BufferGeometry requires exactly one instance`),l(a===o,`Material index requirement and BufferGeometry.buffers.index must match`)}instantiate(e){return new u(e,this._buffers,this.localOrigin,this.mapPositions,this.baseGeometry)}get usedMemoryExcludingBuffers(){return this._boundingInfo?.usedMemory??0}computeBufferMemory(t){return t.arrayMemory(this._buffers.index,e,!0)+t.arrayMemory(this._buffers.storage?.texelElementBuffer)+t.arrayMemory(this.mapPositions)+t.bufferMemory(this._buffers.vertex.buffer)}get indexCount(){return this.baseGeometry?.buffers.indexCount??this._buffers.indexCount??0}get faceCount(){return this.indexCount/3}get readPrimitivePosition(){return this._readPrimitivePosition??=this.material.createPrimitivePositionReader(this.buffers,this.baseGeometry?.buffers),this._readPrimitivePosition}get boundingInfo(){return this._boundingInfo||(this._boundingInfo=this._calculateBoundingInfo(),this._boundingInfo&&this.notifyMemoryChange?.(this._boundingInfo.usedMemory)),this._boundingInfo}get boundingSphere(){let e=this.boundingInfo?.sphere;if(e==null)return r;if(this._boundingSphere==null){let n=new i;n.copyFrom(e),t(n.center,n.center,this.localOrigin.vec3),this._boundingSphere=n}return this._boundingSphere}_calculateBoundingInfo(){let e=this.indexCount;if(e===0)return null;let t=this.material.primitiveVertexCount;l(e%t===0,`Indexing error: `+e+` not divisible by `+t);let r=n(e/t);return new o(r,t,this.readPrimitivePosition,e=>this.notifyMemoryChange?.(e))}invalidateBoundingInfo(){let e=this._boundingInfo?.usedMemory??0;this._boundingInfo=null,this._boundingSphere=null,e&&this.notifyMemoryChange?.(-e)}getMutableVertexField(e,t){let n=this._buffers.vertex.getField(e,t);return n!=null&&a(e)&&this._invalidatePositionCaches(),n}getMutableStorageField(e,t){let n=this._buffers.storage?.getField(e,t);return n!=null&&a(e)&&this._invalidatePositionCaches(),n}_invalidatePositionCaches(){this._readPrimitivePosition=null,this.invalidateBoundingInfo()}computeAttachmentOrigin(e){return this.material.computeAttachmentOrigin(e,this.readPrimitivePosition,this.indexCount)?(t(e,e,this.localOrigin.vec3),!0):!1}get highlights(){return this._highlights||d}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}forEachHighlightOption(e){this._highlightOptionsCounts?.forEach((t,n)=>e(n))}allocateIdAndHighlight(e){let t=new c(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);let{highlightName:t}=e,n=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,n),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){let{highlightName:t}=e,n=this._highlightOptionsCounts?.get(t)??0;n<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,n-1)}}}const d=new Set;export{u as BufferGeometry};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{generateUID as e}from"../../../../core/uid.js";import{identity as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n,IDENTITY as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{distance as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{empty as a,copy as o,offset as s,expandWithAABB as c,center as l,create as u}from"../../../../geometry/support/aaBoundingBox.js";import{affectsGeometry as d}from"./affectsGeometry.js";import{BoundingVolume as f}from"./BoundingVolume.js";import{Object3DOccludeeStateID as p,Object3DHighlightStateID as m}from"./Object3DStateID.js";import{assert as h}from"./Util.js";import{addObject3DStateID as g,removeObject3DStateID as _}from"../materials/renderers/utils.js";class v{constructor(t){this.id=e(),this.type=1,this.lastValidElevationBB=void 0,this._layer=null,this._visible=!0,this._highlightIds=new Set,this._boundingVolume=null,this._geometries=Array.from(t.geometries),this.castShadow=t.castShadow??!1,this.graphicUid=t.graphicUid,this.layerViewUid=t.layerViewUid;for(let e of this._geometries)this._applyObjectProperties(e);t.isElevationSource&&(this.lastValidElevationBB=a())}dispose(){this._geometries.length=0}get geometries(){return this._geometries}addGeometry(e){this._applyObjectProperties(e),this._geometries.push(e);for(let t of this._highlightIds)e.highlights.has(t)||e.addHighlight(t);this._emit(`
|
|
2
|
+
import{generateUID as e}from"../../../../core/uid.js";import{identity as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as n,IDENTITY as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{distance as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{empty as a,copy as o,offset as s,expandWithAABB as c,center as l,create as u}from"../../../../geometry/support/aaBoundingBox.js";import{affectsGeometry as d}from"./affectsGeometry.js";import{BoundingVolume as f}from"./BoundingVolume.js";import{Object3DOccludeeStateID as p,Object3DHighlightStateID as m}from"./Object3DStateID.js";import{assert as h}from"./Util.js";import{addObject3DStateID as g,removeObject3DStateID as _}from"../materials/renderers/utils.js";class v{constructor(t){this.id=e(),this.type=1,this.lastValidElevationBB=void 0,this._layer=null,this._visible=!0,this._highlightIds=new Set,this._boundingVolume=null,this._geometries=Array.from(t.geometries),this.castShadow=t.castShadow??!1,this.graphicUid=t.graphicUid,this.layerViewUid=t.layerViewUid;for(let e of this._geometries)this._applyObjectProperties(e);t.isElevationSource&&(this.lastValidElevationBB=a())}dispose(){this._geometries.length=0}get geometries(){return this._geometries}addGeometry(e){this._applyObjectProperties(e),this._geometries.push(e);for(let t of this._highlightIds)e.highlights.has(t)||e.addHighlight(t);this._emit(`geometriesChanged`,{object:this,removed:[],added:[e]}),this._highlightIds.size&&this._emit(`highlightChanged`,this),this._invalidateBoundingVolume()}removeGeometry(e){let t=this._geometries.splice(e,1)[0];if(t){for(let e of this._highlightIds)t.removeHighlight(e);this._emit(`geometriesChanged`,{object:this,removed:[t],added:[]}),this._highlightIds.size&&this._emit(`highlightChanged`,this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}_applyObjectProperties(e){e.castShadow=this.castShadow,e.graphicUid=this.graphicUid,e.layerViewUid=this.layerViewUid,e.visible=this._visible}get layer(){return this._layer}set layer(e){h(this._layer==null||e==null,`BufferObject3D can only be added to a single Layer`),this._layer=e}get visible(){return this._visible}set visible(e){if(this._visible!==e){this._visible=e;for(let e of this._geometries)e.visible=this._visible;this._emit(`visibilityChanged`,this)}}_emit(e,t){this.layer?.events.emit(e,t)}maskOccludee(){let e=new p;for(let t of this._geometries)t.occludees=g(t.occludees,e);return this._emit(`occlusionChanged`,this),e}removeOcclude(e){for(let t of this._geometries)t.occludees=_(t.occludees,e);this._emit(`occlusionChanged`,this)}highlight(e){let t=new m(e);for(let e of this._geometries)e.addHighlight(t);return this._highlightIds.add(t),this._emit(`highlightChanged`,this),t}removeHighlight(e){if(this._highlightIds.delete(e)){for(let t of this._geometries)t.removeHighlight(e);this._emit(`highlightChanged`,this)}}removeStateID(e){e.channel===0?this.removeHighlight(e):this.removeOcclude(e)}getCombinedStaticTransformation(e,n){return t(n)}getCombinedShaderTransformation(e,r=n()){return t(r)}get boundingVolumeWorldSpace(){return this._boundingVolume||(this._boundingVolume=new f,this._validateBoundingVolume(this._boundingVolume)),this._boundingVolume}get boundingVolumeObjectSpace(){return this.boundingVolumeWorldSpace}_validateBoundingVolume(e){for(let t of this._geometries){let{boundingInfo:n,localOrigin:r}=t;if(n==null)continue;let[i,a,l]=r.vec3;o(y,n.box),s(y,i,a,l),c(e.box,y)}l(e.box,e.sphere.center);for(let t of this._geometries){let{boundingInfo:n,boundingSphere:r}=t;if(n==null)continue;let a=i(r.center,e.sphere.center);e.sphere.radius=Math.max(e.sphere.radius,a+n.sphere.radius)}}get transformation(){return r}get shaderTransformation(){return null}get effectiveTransformation(){return r}geometryVertexAttributeUpdated(e,t,n=!1){d(t)&&this._invalidateBoundingVolume(),this._emit(`attributesChanged`,{object:this,geometry:e,attribute:t,sync:n})}_invalidateBoundingVolume(){let e=this._boundingVolume?.sphere;this._boundingVolume=void 0,this.layer&&e&&this.layer.notifyObjectBBChanged(this,e)}}const y=u();export{v as BufferObject3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
const e=[`layerObjectAdded`,`layerObjectRemoved`,`layerObjectsAdded`,`layerObjectsRemoved`,`transformationChanged`,`shaderTransformationChanged`,`visibilityChanged`,`occlusionChanged`,`highlightChanged`,`
|
|
2
|
+
const e=[`layerObjectAdded`,`layerObjectRemoved`,`layerObjectsAdded`,`layerObjectsRemoved`,`transformationChanged`,`shaderTransformationChanged`,`visibilityChanged`,`occlusionChanged`,`highlightChanged`,`geometriesChanged`,`attributesChanged`];export{e as DirtyEventNames};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{estimateArrayMemory as e,integerArrayElementBytes as t}from"../../../../core/memoryEstimations.js";import{IDENTITY as n,clone as r}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{getContinuousIndexArray as a}from"../../../../geometry/support/Indices.js";import{cloneAttributeData as o}from"./AttributeArray.js";import{BoundingInfo as s}from"./BoundingInfo.js";import{GeometryBaseInstance as c}from"./GeometryBaseInstance.js";import{Object3DHighlightStateID as l}from"./Object3DStateID.js";import{createPositionAttributeReader as u}from"./PositionReader.js";import{assert as d}from"./Util.js";import{webglDebugEnabled as f}from"../../../webgl/checkWebGLError.js";class p extends c{get usedMemoryExcludingBuffers(){return this._usedMemory+this._primitivePositionIndicesMemory+(this._boundingInfo?.usedMemory??0)}get _primitivePositionIndicesMemory(){let n=this._vertexPositionIndicesCache;return n&&n!==this.positionAttribute?.indices?e(n,t):0}computeBufferMemory(e){let n=e.arrayMemory(this.mapPositions)+e.arrayMemory(this.drawIndices,t,!0);for(let r of this.attributes.values())n+=e.arrayMemory(r.data)+e.arrayMemory(r.indices,t,!0);return n}constructor(e,t,n=null,r=-1,i,a){super(t),this.material=e,this.mapPositions=n,this.edgeIndicesLength=r,this.baseGeometry=i,this.drawIndices=a,this._usedMemory=0,this._readPrimitivePosition=null,this._vertexPositionIndicesCache=void 0,this._transformation=void 0,this.localOrigin=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.occludees=void 0,this.visible=!0,this._boundingInfo=null,d((e?.useIndexing??!1)===(a!=null),`Material index requirement and Geometry must match`),this.edgeIndicesLength<0&&(this.edgeIndicesLength=this.indexCount)}get readPrimitivePosition(){return this._readPrimitivePosition??=u(this.positionAttribute,this.drawIndices),this._readPrimitivePosition}_invalidateReadPrimitivePosition(){this._readPrimitivePosition=null}instantiate(e={}){let t=new p(e.material||this.material,[],this.mapPositions,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((e,n)=>{e.exclusive=!1,t._attributes.set(n,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:o(t.data)},this._attributes.set(e,t),e===`position`&&this._invalidateReadPrimitivePosition()),t}setAttributeData(e,t){let n=this._attributes.get(e);n?(this._attributes.set(e,{...n,exclusive:!0,data:t}),e===`position`&&this._invalidateReadPrimitivePosition()):f()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){if(this._vertexPositionIndicesCache!==void 0)return this._vertexPositionIndicesCache;this._vertexPositionIndicesCache=this._computePrimitivePositionIndices();let e=this._primitivePositionIndicesMemory;return e&&this.notifyMemoryChange?.(e),this._vertexPositionIndicesCache}_computePrimitivePositionIndices(){let{drawIndices:e}=this,t=this.positionAttribute;if(e!=null&&t!=null){let n=Array(e.length).fill(0);for(let r=0;r<e.length;r++)n[r]=t.indices[e[r]];return n}return t?.indices??null}get positionAttribute(){return this.attributes.get(`position`)??this.baseGeometry?.attributes.get(`position`)}get indexCount(){return(this.drawIndices??this.positionAttribute?.indices)?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo||(this._boundingInfo=this._calculateBoundingInfo(),this._boundingInfo&&this.notifyMemoryChange?.(this._boundingInfo.usedMemory)),this._boundingInfo}computeAttachmentOrigin(e){return this.material.computeAttachmentOrigin(e,this.readPrimitivePosition,this.indexCount)?(this._transformation!=null&&i(e,e,this._transformation),!0):!1}invalidateBoundingInfo(){let e=this._primitivePositionIndicesMemory+(this._boundingInfo?.usedMemory??0);this._boundingInfo=null,this._vertexPositionIndicesCache=void 0,e&&this.notifyMemoryChange?.(-e)}_calculateBoundingInfo(){let e=this.positionAttribute,t=this.indexCount;if(!e||t===0)return null;let n=this.material.primitiveVertexCount;d(t%n===0,`Indexing error: `+t+` not divisible by `+n);let r=a(t/n);return new s(r,n,this.readPrimitivePosition,e=>this.notifyMemoryChange?.(e))}get transformation(){return this._transformation??n}set transformation(e){this._transformation=e&&e!==n?r(e):null}get highlights(){return this._highlights||m}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}forEachHighlightOption(e){this._highlightOptionsCounts?.forEach((t,n)=>e(n))}allocateIdAndHighlight(e){let t=new l(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);let{highlightName:t}=e,n=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,n),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){let{highlightName:t}=e,n=this._highlightOptionsCounts?.get(t)??0;n<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,n-1)}}}const m=new Set;export{p as Geometry};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import{EventEmitter as t}from"../../../../core/Evented.js";import{disposeMaybe as n,removeMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as i,onAbort as a,createAbortError as o}from"../../../../core/promiseUtils.js";import{isUint8Array as s,isArrayBuffer as c,isTypedArray as l}from"../../../../core/typedArrayUtil.js";import{generateUID as u}from"../../../../core/uid.js";import{isBlobProtocol as d,isDataProtocol as f}from"../../../../core/urlUtils.js";import{whenVideoPlayable as p}from"../../../../layers/support/videoUtils.js";import{requestImage as m}from"../../../../request/image.js";import{loadImage as h}from"../../../../request/loadImage.js";import{createTextureKTX1 as g,createTextureKTX2 as _,createTextureBasis as v,estimateMemoryKTX2 as y,estimateMemoryBasis as b}from"./BasisUtil.js";import{createDDSTexture as x}from"./DDSUtil.js";import{ensureImageMaxSize as S}from"./textureUtils.js";import{assert as C}from"./Util.js";import w from"../../../webgl/Texture.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";import{isCompressedFormat as E,isSizedPixelFormat as D,isSizedDepthFormat as O,isSizedDepthStencilFormat as k}from"../../../webgl/textureUtils.js";import{getFormatComponents as A}from"../../../webgl/Util.js";class
|
|
2
|
+
import e from"../../../../core/Error.js";import{EventEmitter as t}from"../../../../core/Evented.js";import has from"../../../../core/has.js";import{disposeMaybe as n,removeMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as i,onAbort as a,createAbortError as o}from"../../../../core/promiseUtils.js";import{isUint8Array as s,isArrayBuffer as c,isTypedArray as l}from"../../../../core/typedArrayUtil.js";import{generateUID as u}from"../../../../core/uid.js";import{isBlobProtocol as d,isDataProtocol as f}from"../../../../core/urlUtils.js";import{whenVideoPlayable as p}from"../../../../layers/support/videoUtils.js";import{requestImage as m}from"../../../../request/image.js";import{loadImage as h}from"../../../../request/loadImage.js";import{createTextureKTX1 as g,createTextureKTX2 as _,createTextureBasis as v,estimateMemoryKTX2 as y,estimateMemoryBasis as b}from"./BasisUtil.js";import{createDDSTexture as x}from"./DDSUtil.js";import{ensureImageMaxSize as S}from"./textureUtils.js";import{assert as C}from"./Util.js";import w from"../../../webgl/Texture.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";import{isCompressedFormat as E,isSizedPixelFormat as D,isSizedDepthFormat as O,isSizedDepthStencilFormat as k}from"../../../webgl/textureUtils.js";import{getFormatComponents as A}from"../../../webgl/Util.js";const j=!!has(`esri-tests-disable-gpu-memory-measurements`);class M{constructor(e,n){this._data=e,this.id=u(),this.events=new t,this._parameters={...F,...n},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!d(e.src)&&(e.preload!==`auto`||!e.crossOrigin)&&(e.preload=`auto`,e.crossOrigin=`anonymous`,e.src=e.src,e.paused&&e.autoplay)){let t=[];p(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){f(e.src)||d(e.src)||e.crossOrigin||(e.crossOrigin=`anonymous`,e.src=e.src)}_createDescriptor(e){let t=new T;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t.isImmutable=this._parameters.immutable===!0&&I(this._parameters.internalFormat),t}get texture(){return this._texture??this._emptyTexture}get loaded(){return this._texture!=null}get usedMemory(){return j?0:this._texture?.usedMemory??N(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;let t=this._data;return t==null?(this._texture=new w(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),typeof t==`string`?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):s(t)&&this._parameters.encoding===`image/vnd-ms.dds`?this._loadFromDDSData(e,t):c(t)&&this._parameters.encoding===`image/vnd-ms.dds`?this._loadFromDDSData(e,new Uint8Array(t)):s(t)&&this._parameters.encoding===`image/ktx`?this._loadFromKTX1(e,t):c(t)&&this._parameters.encoding===`image/ktx`?this._loadFromKTX1(e,new Uint8Array(t)):(c(t)||s(t))&&this._parameters.encoding===`image/ktx2`?this._loadFromKTX2(e,t):(c(t)||s(t))&&this._parameters.encoding===`image/x.basis`?this._loadFromBasis(e,t):c(t)?this._loadFromPixelData(e,new Uint8Array(t)):l(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return this._texture==null||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=x(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX1(e,t){return this._texture=g(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>_(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>v(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){C(this._parameters.width>0&&this._parameters.height>0);let n=this._createDescriptor(e);return(n.pixelFormat===6407||n.pixelFormat===6408)&&(n.compress=this._parameters.compressionOptions),n.width=this._parameters.width??0,n.height=this._parameters.height??0,this._texture=new w(e,n,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async n=>{let r=await m(t,{signal:n});return i(n),this._loadFromImage(e,r)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async n=>{let r=await h(t,t.src,!1,n);return i(n),this._loadFromImage(e,r)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(t,n){return this._loadAsync(i=>new Promise((s,c)=>{let l=()=>{n.removeEventListener(`loadeddata`,u),n.removeEventListener(`error`,d),r(f)},u=()=>{n.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),s(this._loadFromImage(t,n)))},d=t=>{l(),c(t||new e(`texture:load-error`,`Failed to load video`))};n.addEventListener(`loadeddata`,u),n.addEventListener(`error`,d);let f=a(i,()=>d(o()))}))}_loadFromImage(e,t){let n=t;n instanceof HTMLVideoElement||(n=S(n,e.parameters));let r=P(n);this._parameters.width=r.width,this._parameters.height=r.height;let i=this._createDescriptor(e);return i.width=r.width,i.height=r.height,i.compress=this._parameters.compressionOptions,this._texture=new w(e,i,n),this._emptyTexture=null,this.events.emit(`loaded`),this._texture}_loadAsync(e){let t=new AbortController;this._loadingController=t;let n=e(t.signal);this._loadingPromise=n;let r=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===n&&(this._loadingPromise=null),this._emptyTexture=null};return n.then(r,r),n}unload(){if(this._texture=n(this._texture),this._emptyTexture=null,this._loadingController!=null){let e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit(`unloaded`)}get parameters(){return this._parameters}}function N(e,t){if(e==null)return 0;if(c(e)||s(e))return t.encoding===`image/ktx2`?y(e,!!t.mipmap):t.encoding===`image/x.basis`?b(e,!!t.mipmap):e.byteLength;let{width:n,height:r}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?P(e):t,i=t.pixelFormat??6408,a=A(i);return(t.mipmap?4/3:1)*n*r*a||0}function P(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const F={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1};function I(e){return e!=null&&(E(e)||D(e)||O(e)||k(e))}export{M as ManagedTexture};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{NestedMap as n}from"../../../../core/NestedMap.js";import{nullUid as r}from"../../../../core/uid.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{assert as o}from"./Util.js";class s{constructor(e,t,n,r){this.operation=e,this.geometry=t,this.states=n,this.sync=r}}let c=class extends t{constructor(e){super(e),this._residentGeomRecords=new n,this._dirtyGeomRecords=new n,this._dirtyRecordCount=0}get dirty(){return this._dirtyRecordCount>0}commitLayer(e,t){let n=this._dirtyGeomRecords.getInner(e),r=this.model.getLayer(e);if(!n||!r)return;let i=0;n.forEach((n,a)=>{let s=this._ensureGeomRecord(e,a);this._dirtyGeomRecords.delete(e,a),i+=n.size,n.forEach(({geometry:e,operation:n,states:i},c)=>{let l=!1;if(n===1){let n=s.get(c);if(n){if(i&4){let t=r.getObject(a);o(t?.type!==1&&n.type!==1&&e.type!==1,`ModelDirtySet.commitLayer: invalid update on BufferObject3D`),this.model.updateRenderGeometryTransformation(t,e,n)&&(l=!0)}l||t.updates.push({renderGeometry:n,updateType:i})}else o(!1,`ModelDirtySet.commitLayer: invalid update`)}if(n===2||l){let e=s.get(c);e?(t.removes.push(e),s.delete(c)):n===2&&o(!1,`ModelDirtySet.commitLayer: invalid remove`)}if(n===0||l){let n=r.getObject(a);if(n!=null){let r=this.model.getRenderGeometry(n,e);t.adds.push(r),s.set(c,r)}}}),s.size===0&&this._residentGeomRecords.delete(e,a)}),this._dirtyRecordCount-=i}commitSyncUpdates(e,t){let n=this._dirtyGeomRecords.getInner(e),r=this.model.getLayer(e);n&&r&&n.forEach((n,i)=>{let a=this._ensureGeomRecord(e,i);n.forEach(({geometry:e,operation:n,states:s,sync:c},l)=>{let u=!1;if(n===1&&c){let n=a.get(l);if(n){if(s&4){let t=r.getObject(i);o(t?.type!==1&&n.type!==1&&e.type!==1,`ModelDirtySet.commitLayer: invalid update on BufferObject3D`),this.model.updateRenderGeometryTransformation(t,e,n)&&(u=!0)}u||t.updates.push({renderGeometry:n,updateType:s})}else o(!1,`ModelDirtySet.commitSyncUpdates: invalid update`)}})})}_objectStateChanged(e,t){for(let n of t.geometries)this._updateOrCreateDirtyRecord(t,n,1,e)}visibilityChanged(e){this._objectStateChanged(1,e)}highlightChanged(e){this._objectStateChanged(8,e)}occlusionChanged(e){this._objectStateChanged(16,e)}attributesChanged({object:e,geometry:t,sync:n}){this._updateOrCreateDirtyRecord(e,t,1,2,n)}layerAdded(e){e.objects.forEach(e=>this.layerObjectAdded(e))}layerRemoved(e){e.objects.forEach(e=>this.layerObjectRemoved(e))}layerObjectAdded(e){for(let t of e.geometries)this._geometryAdded(e,t)}layerObjectRemoved(e){for(let t of e.geometries)this._geometryRemoved(e,t)}layerObjectsAdded(e){for(let t of e)this.layerObjectAdded(t)}layerObjectsRemoved(e){for(let t of e)this.layerObjectRemoved(t)}transformationChanged(e){let t=this._getLayerId(e),n=e.id,r=this._ensureGeomRecord(t,n);for(let{geometry:t}of r.values().filter(e=>e.type!==1))this._updateOrCreateDirtyRecord(e,t,1,4)}shaderTransformationChanged(e){let t=this._getLayerId(e),n=e.id,r=this._ensureGeomRecord(t,n);for(let t of r.values().filter(e=>e.type!==1))t.objectShaderTransformationChanged(e.shaderTransformation)}
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{NestedMap as n}from"../../../../core/NestedMap.js";import{nullUid as r}from"../../../../core/uid.js";import{property as i,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{assert as o}from"./Util.js";class s{constructor(e,t,n,r){this.operation=e,this.geometry=t,this.states=n,this.sync=r}}let c=class extends t{constructor(e){super(e),this._residentGeomRecords=new n,this._dirtyGeomRecords=new n,this._dirtyRecordCount=0}get dirty(){return this._dirtyRecordCount>0}commitLayer(e,t){let n=this._dirtyGeomRecords.getInner(e),r=this.model.getLayer(e);if(!n||!r)return;let i=0;n.forEach((n,a)=>{let s=this._ensureGeomRecord(e,a);this._dirtyGeomRecords.delete(e,a),i+=n.size,n.forEach(({geometry:e,operation:n,states:i},c)=>{let l=!1;if(n===1){let n=s.get(c);if(n){if(i&4){let t=r.getObject(a);o(t?.type!==1&&n.type!==1&&e.type!==1,`ModelDirtySet.commitLayer: invalid update on BufferObject3D`),this.model.updateRenderGeometryTransformation(t,e,n)&&(l=!0)}l||t.updates.push({renderGeometry:n,updateType:i})}else o(!1,`ModelDirtySet.commitLayer: invalid update`)}if(n===2||l){let e=s.get(c);e?(t.removes.push(e),s.delete(c)):n===2&&o(!1,`ModelDirtySet.commitLayer: invalid remove`)}if(n===0||l){let n=r.getObject(a);if(n!=null){let r=this.model.getRenderGeometry(n,e);t.adds.push(r),s.set(c,r)}}}),s.size===0&&this._residentGeomRecords.delete(e,a)}),this._dirtyRecordCount-=i}commitSyncUpdates(e,t){let n=this._dirtyGeomRecords.getInner(e),r=this.model.getLayer(e);n&&r&&n.forEach((n,i)=>{let a=this._ensureGeomRecord(e,i);n.forEach(({geometry:e,operation:n,states:s,sync:c},l)=>{let u=!1;if(n===1&&c){let n=a.get(l);if(n){if(s&4){let t=r.getObject(i);o(t?.type!==1&&n.type!==1&&e.type!==1,`ModelDirtySet.commitLayer: invalid update on BufferObject3D`),this.model.updateRenderGeometryTransformation(t,e,n)&&(u=!0)}u||t.updates.push({renderGeometry:n,updateType:s})}else o(!1,`ModelDirtySet.commitSyncUpdates: invalid update`)}})})}_objectStateChanged(e,t){for(let n of t.geometries)this._updateOrCreateDirtyRecord(t,n,1,e)}visibilityChanged(e){this._objectStateChanged(1,e)}highlightChanged(e){this._objectStateChanged(8,e)}occlusionChanged(e){this._objectStateChanged(16,e)}attributesChanged({object:e,geometry:t,sync:n}){this._updateOrCreateDirtyRecord(e,t,1,2,n)}layerAdded(e){e.objects.forEach(e=>this.layerObjectAdded(e))}layerRemoved(e){e.objects.forEach(e=>this.layerObjectRemoved(e))}layerObjectAdded(e){for(let t of e.geometries)this._geometryAdded(e,t)}layerObjectRemoved(e){for(let t of e.geometries)this._geometryRemoved(e,t)}layerObjectsAdded(e){for(let t of e)this.layerObjectAdded(t)}layerObjectsRemoved(e){for(let t of e)this.layerObjectRemoved(t)}transformationChanged(e){let t=this._getLayerId(e),n=e.id,r=this._ensureGeomRecord(t,n);for(let{geometry:t}of r.values().filter(e=>e.type!==1))this._updateOrCreateDirtyRecord(e,t,1,4)}shaderTransformationChanged(e){let t=this._getLayerId(e),n=e.id,r=this._ensureGeomRecord(t,n);for(let t of r.values().filter(e=>e.type!==1))t.objectShaderTransformationChanged(e.shaderTransformation)}_geometryAdded(e,t){this._updateOrCreateDirtyRecord(e,t,0)}_geometryRemoved(e,t){this._updateOrCreateDirtyRecord(e,t,2)}geometriesChanged({object:e,removed:t,added:n}){for(let n of t)this._geometryRemoved(e,n);for(let t of n)this._geometryAdded(e,t)}_updateOrCreateDirtyRecord(e,t,n,r=0,i=!1){let a=this._getLayerId(e),c=e.id,l=t.id,u=this._ensureDirtyRecord(a,c),d=u.get(l);if(d){let e=d.operation;e===2&&n===0&&d.states!==0?d.operation=1:e===2&&n===0||e===0&&n===2?(u.delete(l),this._dirtyRecordCount--):e===1&&(n===2||n===1)?(d.operation=n,d.states|=r):(o((e===2||e===0)&&n===1,`ModelDirtySet.objectGeometryAdded: inconsistent state`),d.states|=r),d.sync=d.sync||i}else u.set(l,new s(n,t,r,i)),this._dirtyRecordCount++}_ensureGeomRecord(e,t){let n=this._residentGeomRecords.get(e,t);return n||(n=new Map,this._residentGeomRecords.set(e,t,n)),n}assertLayerClean(e){o(this._dirtyGeomRecords.getInner(e)==null,`Dirty geometry records for removed layer`)}_ensureDirtyRecord(e,t){let n=this.model.getLayer(e);o(n!=null,`Updating geometry record for an unregistered layer`);let r=this._dirtyGeomRecords.get(e,t);return r||(r=new Map,this._dirtyGeomRecords.set(e,t,r)),r}_getLayerId(e){return e.layer?.id??r}formatDebugInfo(){let e=[`ADD`,`UPD`,void 0,`REM`],t=``;return this._dirtyGeomRecords.forAll((n,r,i)=>{t.length>0&&(t+=`
|
|
3
3
|
`),t+=r+`.`+i;let a=[];n.forEach(e=>{let t=e.operation;a[t]||(a[t]=[]),a[t].push(e.geometry.id)});for(let n=0;n<a.length;n++)if(a[n]){t+=` `+e[n-1]+`: `;for(let e=0;e<a[n].length;e++)t+=a[n][e]+`, `}}),t}get test(){}};e([i({constructOnly:!0})],c.prototype,`model`,void 0),e([i()],c.prototype,`_dirtyRecordCount`,void 0),c=e([a(`esri.views.3d.webgl-engine.lib.ModelDirtySet`)],c);const l=c;export{l as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import"../../../../core/has.js";import{generateUID as e}from"../../../../core/uid.js";import{multiply as t,copy as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r,IDENTITY as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as a,distance as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as c,center as l}from"../../../../geometry/support/aaBoundingBox.js";import{maxScale as u}from"../../support/mathUtils.js";import{affectsGeometry as d}from"./affectsGeometry.js";import{BoundingVolume as f,expandWithTransformedBox as p}from"./BoundingVolume.js";import{Object3DOccludeeStateID as m,Object3DHighlightStateID as h}from"./Object3DStateID.js";import{assert as g}from"./Util.js";import{addObject3DStateID as _,removeObject3DStateID as v}from"../materials/renderers/utils.js";class y{constructor(t={}){this.id=e(),this.type=0,this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=t.castShadow??!0,this.usesVerticalDistanceToGround=t.usesVerticalDistanceToGround??!1,this.graphicUid=t.graphicUid,this.layerViewUid=t.layerViewUid,t.isElevationSource&&(this.lastValidElevationBB=c()),this._geometries=t.geometries?Array.from(t.geometries):[]}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(e){g(this._layer==null||e==null,`Object3D can only be added to a single Layer`),this._layer=e}addGeometry(e){e.visible=this._visible,this._geometries.push(e);for(let t of this._highlightIds)e.addHighlight(t);this._emit(`
|
|
2
|
+
import"../../../../core/has.js";import{generateUID as e}from"../../../../core/uid.js";import{multiply as t,copy as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as r,IDENTITY as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{transformMat4 as a,distance as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as c,center as l}from"../../../../geometry/support/aaBoundingBox.js";import{maxScale as u}from"../../support/mathUtils.js";import{affectsGeometry as d}from"./affectsGeometry.js";import{BoundingVolume as f,expandWithTransformedBox as p}from"./BoundingVolume.js";import{Object3DOccludeeStateID as m,Object3DHighlightStateID as h}from"./Object3DStateID.js";import{assert as g}from"./Util.js";import{addObject3DStateID as _,removeObject3DStateID as v}from"../materials/renderers/utils.js";class y{constructor(t={}){this.id=e(),this.type=0,this._highlightIds=new Set,this._shaderTransformation=null,this._visible=!0,this.castShadow=t.castShadow??!0,this.usesVerticalDistanceToGround=t.usesVerticalDistanceToGround??!1,this.graphicUid=t.graphicUid,this.layerViewUid=t.layerViewUid,t.isElevationSource&&(this.lastValidElevationBB=c()),this._geometries=t.geometries?Array.from(t.geometries):[]}dispose(){this._geometries.length=0}get layer(){return this._layer}set layer(e){g(this._layer==null||e==null,`Object3D can only be added to a single Layer`),this._layer=e}addGeometry(e){e.visible=this._visible,this._geometries.push(e);for(let t of this._highlightIds)e.addHighlight(t);this._emit(`geometriesChanged`,{object:this,removed:[],added:[e]}),this._highlightIds.size&&this._emit(`highlightChanged`,this),this._invalidateBoundingVolume()}removeGeometry(e){let t=this._geometries.splice(e,1)[0];if(t){for(let e of this._highlightIds)t.removeHighlight(e);this._emit(`geometriesChanged`,{object:this,removed:[t],added:[]}),this._highlightIds.size&&this._emit(`highlightChanged`,this),this._invalidateBoundingVolume()}}removeAllGeometries(){for(;this._geometries.length>0;)this.removeGeometry(0)}replaceGeometries(e){let t=this._geometries,n=Array.from(e);for(let e of t)for(let t of this._highlightIds)e.removeHighlight(t);for(let e of n){e.visible=this._visible;for(let t of this._highlightIds)e.addHighlight(t)}this._geometries=n,this._invalidateBoundingVolume(),this._emit(`geometriesChanged`,{object:this,removed:t,added:n}),this._highlightIds.size&&this._emit(`highlightChanged`,this)}geometryVertexAttributeUpdated(e,t,n=!1){this._emit(`attributesChanged`,{object:this,geometry:e,attribute:t,sync:n}),d(t)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(e){if(this._visible!==e){this._visible=e;for(let e of this._geometries)e.visible=this._visible;this._emit(`visibilityChanged`,this)}}maskOccludee(){let e=new m;for(let t of this._geometries)t.occludees=_(t.occludees,e);return this._emit(`occlusionChanged`,this),e}removeOcclude(e){for(let t of this._geometries)t.occludees=v(t.occludees,e);this._emit(`occlusionChanged`,this)}highlight(e){let t=new h(e);for(let e of this._geometries)e.addHighlight(t);return this._emit(`highlightChanged`,this),this._highlightIds.add(t),t}removeHighlight(e){this._highlightIds.delete(e);for(let t of this._geometries)t.removeHighlight(e);this._emit(`highlightChanged`,this)}removeStateID(e){e.channel===0?this.removeHighlight(e):this.removeOcclude(e)}getCombinedStaticTransformation(e,n){return t(n,this.transformation,e.transformation)}getCombinedShaderTransformation(e,n=r()){return t(n,this.effectiveTransformation,e.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=new f,this._validateBoundingVolume(this._bvWorldSpace,0)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=new f,this._validateBoundingVolume(this._bvObjectSpace,1)),this._bvObjectSpace}_validateBoundingVolume(e,t){let n=t===1;for(let t of this._geometries){let r=t.boundingInfo;r&&p(e.box,r.box,n?t.transformation:this.getCombinedShaderTransformation(t))}l(e.box,e.sphere.center);for(let t of this._geometries){let r=t.boundingInfo;if(r==null)continue;let i=n?t.transformation:this.getCombinedShaderTransformation(t),s=u(i);a(b,r.sphere.center,i);let c=o(b,e.sphere.center),l=r.sphere.radius*s;e.sphere.radius=Math.max(e.sphere.radius,c+l)}}_invalidateBoundingVolume(){let e=this._bvWorldSpace?.sphere;this._bvObjectSpace=this._bvWorldSpace=void 0,this.layer&&e&&this.layer.notifyObjectBBChanged(this,e)}_emit(e,t){this.layer?.events.emit(e,t)}get geometries(){return this._geometries}get transformation(){return this._transformation??i}set transformation(e){this._transformation=n(this._transformation??r(),e),this._invalidateBoundingVolume(),this._emit(`transformationChanged`,this)}get shaderTransformation(){return this._shaderTransformation}set shaderTransformation(e){this._shaderTransformation=e?n(this._shaderTransformation??r(),e):null,this._invalidateBoundingVolume(),this._emit(`shaderTransformationChanged`,this)}get effectiveTransformation(){return this.shaderTransformation??this.transformation}get test(){}}const b=s();export{y as Object3D};
|