@arcgis/core 5.1.0-next.114 → 5.1.0-next.115
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.js +1 -1
- package/analysis/ShadowCast/MinDurationOptions.d.ts +3 -5
- package/analysis/ShadowCastAnalysis.d.ts +1 -1
- package/arcgisGlobal.d.ts +4 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/05c47ca3a266a271974b.js +1 -0
- package/assets/esri/core/workers/chunks/{29bbc0d6d847b065d10e.js → 062aadf426fe97a76bbb.js} +1 -1
- package/assets/esri/core/workers/chunks/0954e82f739d25001bcb.js +1 -0
- package/assets/esri/core/workers/chunks/0aaee272520c6e5bb617.js +1 -0
- package/assets/esri/core/workers/chunks/{12053c1213465d07d2f6.js → 0b445c1cf281f158c1f1.js} +1 -1
- package/assets/esri/core/workers/chunks/102ff3710db4ba5f083d.js +1 -0
- package/assets/esri/core/workers/chunks/163ce1be8bfe20e77f97.js +1 -0
- package/assets/esri/core/workers/chunks/{e87d02af6d6b05e19d93.js → 16713986893adfbc9331.js} +1 -1
- package/assets/esri/core/workers/chunks/{9bd713d96502ddc2ce25.js → 1765042635084f75d2b3.js} +1 -1
- package/assets/esri/core/workers/chunks/185c670eb99474906836.js +1 -0
- package/assets/esri/core/workers/chunks/18ebf1d3ed05c8057f7d.js +1 -0
- package/assets/esri/core/workers/chunks/1da2c34743897d1b6a24.js +1 -0
- package/assets/esri/core/workers/chunks/22d4521637806a8b828f.js +1 -0
- package/assets/esri/core/workers/chunks/233ff588798c8a5eedf4.js +1 -0
- package/assets/esri/core/workers/chunks/24d9e4f1c7b8ff0d2cce.js +1 -0
- package/assets/esri/core/workers/chunks/2562d8905bd05ef6fd07.js +1 -0
- package/assets/esri/core/workers/chunks/{e5d969214d9eda5c0b4c.js → 2a5dbed88bbd96cfac9f.js} +1 -1
- package/assets/esri/core/workers/chunks/2bcd4d395bfe6a19ccc8.js +1 -0
- package/assets/esri/core/workers/chunks/3192586ec7fc73ed1165.js +1 -0
- package/assets/esri/core/workers/chunks/38ca59db0e8f45bd7811.js +1 -0
- package/assets/esri/core/workers/chunks/3b10a962e4ff2f3da5bc.js +1 -0
- package/assets/esri/core/workers/chunks/3e9709e61015993b1c7d.js +1 -0
- package/assets/esri/core/workers/chunks/425c04b26a6ec6d04b08.js +1 -0
- package/assets/esri/core/workers/chunks/4364a3e706294bb6ae41.js +1 -0
- package/assets/esri/core/workers/chunks/44e52fe98ffafe6a2807.js +1 -0
- package/assets/esri/core/workers/chunks/4cecc582513b8a83f194.js +1 -0
- package/assets/esri/core/workers/chunks/5022413f5a41b5d435ea.js +1 -0
- package/assets/esri/core/workers/chunks/{8ade869fa9bae446266a.js → 51816d79c6be15e4bfcf.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf9b0ba30a75c030ca92.js → 5524a71d1abc9568ce26.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba31616de9d73d83d867.js → 557e39e5156b313597f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{5ef37f37e405b3bb5450.js → 59dafa1e1340ea4043e6.js} +1 -1
- package/assets/esri/core/workers/chunks/624b1bb269744142b835.js +1 -0
- package/assets/esri/core/workers/chunks/{39987c06636e757d1f00.js → 62b5972d0ef9bf173308.js} +1 -1
- package/assets/esri/core/workers/chunks/641b8622fbb93c84671d.js +1 -0
- package/assets/esri/core/workers/chunks/643c7506f8fe8e06acd2.js +1 -0
- package/assets/esri/core/workers/chunks/65f02eca694cc1c9f5a7.js +1 -0
- package/assets/esri/core/workers/chunks/6d696beddcc5fbed5875.js +1 -0
- package/assets/esri/core/workers/chunks/728ad5bbbcbf88d6249f.js +1 -0
- package/assets/esri/core/workers/chunks/{0d2bc1be5802681666a4.js → 77859a61d059738d057f.js} +1 -1
- package/assets/esri/core/workers/chunks/{03a4543b94f9adeb1852.js → 7a3b05e25de2ff150f38.js} +1 -1
- package/assets/esri/core/workers/chunks/7bbffe07e62897928773.js +1 -0
- package/assets/esri/core/workers/chunks/{14a241b07baa67743248.js → 7c292f7b181f3b93352b.js} +1 -1
- package/assets/esri/core/workers/chunks/7c2d7df4ef4d775cd648.js +1 -0
- package/assets/esri/core/workers/chunks/{6d20d741b8ae1a45b422.js → 7dc2c21d61ba66a3f461.js} +1 -1
- package/assets/esri/core/workers/chunks/7df05c3c82cd27b77300.js +1 -0
- package/assets/esri/core/workers/chunks/7eb94fc75926bc739233.js +1 -0
- package/assets/esri/core/workers/chunks/8461f50e9875db4ccfec.js +1 -0
- package/assets/esri/core/workers/chunks/{71e12db99589c98a4357.js → 8477b5fdd99c6ac5c27b.js} +1 -1
- package/assets/esri/core/workers/chunks/{be1e4c3ec53fc92a26f1.js → 8598997340682113a2a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{548c34ea88f113d03c93.js → 86229634bf008f53dad4.js} +1 -1
- package/assets/esri/core/workers/chunks/86443e47ad99e555753a.js +1 -0
- package/assets/esri/core/workers/chunks/87a40e7f79f97ca637a9.js +1 -0
- package/assets/esri/core/workers/chunks/{27d6ad4ca5ab8c9d62cd.js → 8c443c52c846a096a250.js} +1 -1
- package/assets/esri/core/workers/chunks/{86161025b53b916328ff.js → 8ca88cfc0b9f84dc5832.js} +1 -1
- package/assets/esri/core/workers/chunks/{340f2c996f62f7f5ceae.js → 8e7ce4835b3106349684.js} +1 -1
- package/assets/esri/core/workers/chunks/90b0fe5584fb6fc99766.js +1 -0
- package/assets/esri/core/workers/chunks/9133c1b7cc1c9da27deb.js +1 -0
- package/assets/esri/core/workers/chunks/{d4749eb8a47869477037.js → 9250615c78f8570a9cda.js} +1 -1
- package/assets/esri/core/workers/chunks/92a7735973b2f82a66ce.js +1 -0
- package/assets/esri/core/workers/chunks/94a5a834e32fc6cc6ed4.js +1 -0
- package/assets/esri/core/workers/chunks/986d8c3907aeeb18c4f6.js +1 -0
- package/assets/esri/core/workers/chunks/98e489c2b85feded7776.js +1 -0
- package/assets/esri/core/workers/chunks/{271e42b7cd3c3441839e.js → 9eab1e1535494ff2050d.js} +10 -22
- package/assets/esri/core/workers/chunks/{466c250537415f12eb59.js → a01f0ffbe555f690bdca.js} +1 -1
- package/assets/esri/core/workers/chunks/a03c4c0bf138734a002e.js +1 -0
- package/assets/esri/core/workers/chunks/a814069325125466506b.js +1 -0
- package/assets/esri/core/workers/chunks/{e4b2120d7ee1c998b1fc.js → aa03f770178693167aa0.js} +1 -1
- package/assets/esri/core/workers/chunks/aea439d4c2308f88b295.js +1 -0
- package/assets/esri/core/workers/chunks/{7995e6983456c779adf9.js → b002304a45856b024b46.js} +1 -1
- package/assets/esri/core/workers/chunks/b0c242c4f5412e4cce73.js +1 -0
- package/assets/esri/core/workers/chunks/b44f1d08784f2e50c853.js +1 -0
- package/assets/esri/core/workers/chunks/c1b6de0d728d25d7905a.js +1 -0
- package/assets/esri/core/workers/chunks/{f8b884b529064df4a30a.js → caf80facb0322be054ab.js} +1 -1
- package/assets/esri/core/workers/chunks/{25d795a1697803d77e56.js → ce0e627a5e1cb78adce8.js} +1 -1
- package/assets/esri/core/workers/chunks/{63378b0b4265a547656b.js → d8ec0afb2b91ccf32e55.js} +1 -1
- package/assets/esri/core/workers/chunks/d97c0c18202b8c578f8c.js +1 -0
- package/assets/esri/core/workers/chunks/{2f99a95facddc44319a9.js → da3c54e27a808f4fcc18.js} +1 -1
- package/assets/esri/core/workers/chunks/db012650fb34c10cecd0.js +1 -0
- package/assets/esri/core/workers/chunks/dc6d50e1097a920ff820.js +1 -0
- package/assets/esri/core/workers/chunks/dce37324a2382d2eef0d.js +1 -0
- package/assets/esri/core/workers/chunks/e0bd550b10dd402c48f1.js +1 -0
- package/assets/esri/core/workers/chunks/e2ba57f7119b7182ba02.js +279 -0
- package/assets/esri/core/workers/chunks/e755477dc78e9d6038d4.js +1 -0
- package/assets/esri/core/workers/chunks/ea4057090cf15d602585.js +1 -0
- package/assets/esri/core/workers/chunks/ea8f642b1db933d2c26f.js +1 -0
- package/assets/esri/core/workers/chunks/eabd4a78221b7e733793.js +1 -0
- package/assets/esri/core/workers/chunks/eb16976b4eb7f1300f4a.js +1 -0
- package/assets/esri/core/workers/chunks/efae58f746b108163a50.js +1 -0
- package/assets/esri/core/workers/chunks/f231548c8ac7ecb59927.js +1 -0
- package/assets/esri/core/workers/chunks/fe2325efd0d8ad8369ed.js +1 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +26 -3
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -13
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/GlobalIllumination.glsl.js +22 -34
- package/config.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/editing/templates/TemplateListing.d.ts +32 -0
- package/editing/templates/TemplateListing.js +2 -0
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/interfaces.d.ts +14 -0
- package/kernel.js +1 -1
- package/layers/AnnotationLayer.d.ts +42 -0
- package/layers/AnnotationLayer.js +2 -0
- package/layers/DimensionFeatureLayer.d.ts +36 -1
- package/layers/DimensionFeatureLayer.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
- package/layers/types.d.ts +1 -1
- package/networks/support/networkFieldUtils.js +1 -1
- package/package.json +1 -1
- package/rest/support/OutDistance.js +1 -1
- package/rest/support/Query.js +1 -1
- package/support/basemapEnsureType.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMOperators.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/FeatureMeshFactory.js +1 -1
- package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createTestMeshData.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/util/AnnotationMatcher.js +2 -0
- package/views/2d/engine/webgl/util/DimensionMatcher.js +2 -0
- package/views/2d/engine/webgl/util/Matcher.js +1 -1
- package/views/2d/engine/webgl/util/createMatcher.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/layers/AnnotationLayerView2D.js +2 -0
- package/views/2d/layers/{DimensionLayerView2D.js → DimensionFeatureLayerView2D.js} +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +2 -0
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderAnnotationJSON.js +2 -0
- package/views/2d/layers/features/support/FeatureSetReaderDimensionJSON.js +2 -0
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +2 -0
- package/views/2d/layers/support/annodime/DimensionMatcherSchema.js +2 -0
- package/views/2d/layers/support/annodime/PrivateDimensionEffect.js +2 -0
- package/views/2d/layers/support/annodime/PrivatePlacementMultipoint.js +2 -0
- package/views/2d/layers/support/annodime/annotationGraphic.js +2 -0
- package/views/2d/layers/support/annodime/annotationSchema.js +2 -0
- package/views/2d/layers/support/annodime/annotationUtils.js +2 -0
- package/views/2d/layers/support/annodime/cimAnnotations.js +2 -0
- package/views/2d/layers/support/annodime/dimensionSchema.js +2 -0
- package/views/2d/layers/support/annodime/dimensionSymbols.js +2 -0
- package/views/2d/layers/support/annodime/dimensionUtils.js +2 -0
- package/views/2d/layers/support/annodime/fields.js +2 -0
- package/views/2d/layers/support/annodime/unsupported.js +2 -0
- package/views/2d/layers/support/annodime/utils.js +2 -0
- package/views/2d/layers/support/annodime/virtualFields.js +2 -0
- package/views/2d/support/clippingUtils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/2d/types.d.ts +5 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/MapImageLayerView3D.js +1 -1
- package/views/3d/layers/TileLayerView3D.js +1 -1
- package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
- package/views/3d/types.d.ts +2 -0
- package/views/3d/webgl-engine/collections/Component/RenderSubmitSystem.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +53 -61
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +23 -32
- 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/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
- package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +18 -1
- package/views/PopupView.d.ts +3 -3
- package/views/PopupView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/layers/AnnotationLayerView.d.ts +18 -0
- package/views/layers/AnnotationLayerView.js +2 -0
- package/views/layers/DimensionFeatureLayerView.d.ts +18 -0
- package/views/layers/DimensionFeatureLayerView.js +2 -0
- package/views/layers/FeatureLikeLayerView.d.ts +2 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/WMSLayerView.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/rendered-content/RelationshipDetails.js +2 -0
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/css.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0175098da590a7109539.js +0 -1
- package/assets/esri/core/workers/chunks/019a4fe7e085b2fc6ae9.js +0 -1
- package/assets/esri/core/workers/chunks/023837e5d9d2b6af66d8.js +0 -1
- package/assets/esri/core/workers/chunks/03c46880b69ce75a010f.js +0 -1
- package/assets/esri/core/workers/chunks/040884cec4b84dd1bb17.js +0 -1
- package/assets/esri/core/workers/chunks/04ea806b933d4dd41609.js +0 -1
- package/assets/esri/core/workers/chunks/0e549d942d6cba1608cf.js +0 -1
- package/assets/esri/core/workers/chunks/13a8346abe5509167578.js +0 -1
- package/assets/esri/core/workers/chunks/13d43a0683c42b94feb6.js +0 -1
- package/assets/esri/core/workers/chunks/179ffa2168c42615ccf2.js +0 -1
- package/assets/esri/core/workers/chunks/1ebb613bbe09fcf274d8.js +0 -1
- package/assets/esri/core/workers/chunks/27d7c701306efeea6b82.js +0 -1
- package/assets/esri/core/workers/chunks/2b9661700743d1f9717e.js +0 -1
- package/assets/esri/core/workers/chunks/2bdfae998371e3aa9f2d.js +0 -1
- package/assets/esri/core/workers/chunks/2f0a3b22fc46d832e240.js +0 -1
- package/assets/esri/core/workers/chunks/3835097520296b0517af.js +0 -1
- package/assets/esri/core/workers/chunks/4605a68e40c5c3ac6e3e.js +0 -1
- package/assets/esri/core/workers/chunks/4b130db9b7b4e2e32ea4.js +0 -1
- package/assets/esri/core/workers/chunks/4bfeac7338df9e0b7ce1.js +0 -1
- package/assets/esri/core/workers/chunks/4c5cdd2712c938fafc5d.js +0 -1
- package/assets/esri/core/workers/chunks/4fa3840672c33adb9171.js +0 -1
- package/assets/esri/core/workers/chunks/4ffcca40e7aa24c8cc35.js +0 -1
- package/assets/esri/core/workers/chunks/534dd93c72ea448ee908.js +0 -1
- package/assets/esri/core/workers/chunks/5ea0096a282e87a269bd.js +0 -1
- package/assets/esri/core/workers/chunks/66fe1634c6e8f72fc653.js +0 -1
- package/assets/esri/core/workers/chunks/6920e7f700a9ba280dba.js +0 -1
- package/assets/esri/core/workers/chunks/6b1f2b36bdc6b2ff2ea5.js +0 -1
- package/assets/esri/core/workers/chunks/6b66a6f69aa03338c346.js +0 -1
- package/assets/esri/core/workers/chunks/6d59a9cf533ebc590f70.js +0 -1
- package/assets/esri/core/workers/chunks/75dfdd85abbac26ac899.js +0 -1
- package/assets/esri/core/workers/chunks/798c4d3201fcc9f2a42b.js +0 -1
- package/assets/esri/core/workers/chunks/817fd88fe9a48caf69fb.js +0 -1
- package/assets/esri/core/workers/chunks/825db2ea15308ee6e5dc.js +0 -1
- package/assets/esri/core/workers/chunks/82f7d83a2073d1b0111c.js +0 -1
- package/assets/esri/core/workers/chunks/89250d268dc2554a9ece.js +0 -1
- package/assets/esri/core/workers/chunks/8c8fed53c12fb80ef2ed.js +0 -1
- package/assets/esri/core/workers/chunks/8ff83c59462dea6e3427.js +0 -1
- package/assets/esri/core/workers/chunks/961995d8da45a9203255.js +0 -1
- package/assets/esri/core/workers/chunks/a9c9c00432ee41ec91ba.js +0 -1
- package/assets/esri/core/workers/chunks/af762422a65c551dcd54.js +0 -1
- package/assets/esri/core/workers/chunks/b041c22885193bdd3004.js +0 -1
- package/assets/esri/core/workers/chunks/b3e8ab68fc38306f13c6.js +0 -1
- package/assets/esri/core/workers/chunks/b684ff4bc93bd60d6a19.js +0 -1
- package/assets/esri/core/workers/chunks/bb2f6b0fcdfb8b158e26.js +0 -1
- package/assets/esri/core/workers/chunks/c5ab346a226df1894302.js +0 -1
- package/assets/esri/core/workers/chunks/cd2b2babcdc130b4c368.js +0 -1
- package/assets/esri/core/workers/chunks/cedf3e316d6f89cf7005.js +0 -1
- package/assets/esri/core/workers/chunks/d39f5590022d910ee951.js +0 -1
- package/assets/esri/core/workers/chunks/d412a43060441d347fb4.js +0 -1
- package/assets/esri/core/workers/chunks/d41b847d08c42e5329d6.js +0 -262
- package/assets/esri/core/workers/chunks/d52172439db02a349542.js +0 -1
- package/assets/esri/core/workers/chunks/d8c2bed12f937228c763.js +0 -1
- package/assets/esri/core/workers/chunks/de916dd0c11aefb6832e.js +0 -1
- package/assets/esri/core/workers/chunks/ecf4d07917efc97eb991.js +0 -1
- package/assets/esri/core/workers/chunks/eda51e512eff551ad858.js +0 -1
- package/assets/esri/core/workers/chunks/f14e3693cd644265f909.js +0 -1
- package/assets/esri/core/workers/chunks/f52c6efc5a2abf5ac845.js +0 -1
- package/assets/esri/core/workers/chunks/f635a8e3b0bfeda99ed5.js +0 -1
- package/assets/esri/core/workers/chunks/f9f331c76c96743d8522.js +0 -1
- package/assets/esri/core/workers/chunks/fcbacca99c5a3ee5b69a.js +0 -1
- package/symbols/dimensions/effects/LinearDimensionArrowEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionExtensionLineEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionLeaderLineEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionLineEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionPointEffect.js +0 -2
- package/symbols/dimensions/effects/LinearDimensionTextEffect.js +0 -2
- package/views/2d/layers/features/support/FeatureSetReaderDimension.js +0 -2
- package/views/3d/webgl-engine/effects/globalIllumination/BlueNoise.js +0 -2
- package/views/layers/support/dimensionUtils.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as m,sync as u}from"../../../../core/reactiveUtils.js";import{signal as _}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as I,create as E}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as A,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as S}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as T,InternalRenderCategory as R,AllRenderNodeOutputs as O,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as G}from"../../support/debugFlags.js";import{computeShadowsEnabled as N}from"../../support/sunUtils.js";import{FBOCache as H}from"../core/FBOCache.js";import{RenderPassManager as x}from"../core/renderPasses/RenderPassManager.js";import{isColor as y}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as v}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as M}from"../effects/RenderNodes.js";import{RenderPluginManager as L}from"../effects/RenderPluginManager.js";import{WeatherFader as q}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as U}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as j}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as V}from"../effects/highlight/Highlight.js";import{OITBlend as k}from"../effects/transparency/OITBlend.js";import{AnimationTimer as W}from"./AnimationTimer.js";import{AnimationTimeStep as Q}from"./AnimationTimeStep.js";import{BoundingInfo as z}from"./BoundingInfo.js";import{Compositor as Y}from"./Compositor.js";import{DepthRange as X}from"./DepthRange.js";import{depthRangeFromScene as $}from"./depthRangeUtils.js";import{MainFramebuffer as J}from"./MainFramebuffer.js";import{RenderContext as K,defaultRenderOccludedMask as Z}from"./RenderContext.js";import{RendererBase as ee}from"./RendererBase.js";import{setupFeatureDefaults as te}from"./RenderFeature.js";import{RenderPluginInput as se}from"./RenderPluginInput.js";import{ShadowAccumulator as ie}from"./ShadowAccumulator.js";import{ShadowMap as re}from"./ShadowMap.js";import ae from"./SliceHelper.js";import{MergedRenderer as ne}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as he}from"../parts/renderUtils.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as le,PixelType as me,ColorAttachment2 as ue,ColorAttachment0 as _e,DrawBufferNone as pe}from"../../../webgl/enums.js";let ce=class extends ee{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new x,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ae,this.sceneDepthRange=_(X.Infinite),this._state=_(2),this._hasGlobalIlluminationFlag=!!has("global-illumination"),this._hasAnimations=!1,this._animationTimestep=new Q,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=_(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new se,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of Re)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new H(i),this._compositor=new Y(i,s),this._renderStateFeatures=_(te(e.view.qualityProfile));const a=new re(this._fboCache,e.viewingMode);this._renderContext=new K(this._rctx,a,s),this._framebuffer=new J(this._fboCache,this._bindParameters),this._performanceInfo=new oe(this._rctx),this._blit=new j(s),this._shadowAccumulator=new ie(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,s,i)=>{const r=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,i,!0,r),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},r),this._nodes=new M(this._renderContext),this._plugins=new L({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new q({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>G.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},m),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=v,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),d(()=>this._bindParameters.clouds.data?.state,()=>r(),u),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},m),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,z.prune(),ne.prune(),S()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new k(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=te(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender()}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this.isFeatureEnabled(3)&&!this._inGlobeView}get hasGlobalIllumination(){return this._hasGlobalIlluminationFlag&&this.hasAmbientIllumination}get hasGlobalIlluminationHighQuality(){return this.hasGlobalIllumination&&this.isFeatureEnabled(10)}get _keepGlobalIlluminationShadingAlive(){return this._hasGlobalIlluminationFlag&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmissions(){return this._plugins.hasEmissions}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ne(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.reprojection.matrix,I)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}modifyShadowsEnabled(){const e=this.stage.view.environmentManager.referencePositionGeographic,t=null==e||N(e[2],this.stage.viewingMode),s=this.stage.view.environment.lighting.directShadowsEnabled&&t;this._bindParameters.shadowMap.enabled!==s&&(this._bindParameters.shadowMap.enabled=s,this._requestRender(1))}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...we),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new W(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new he(this._pluginInput.get(T.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.output=0,this._bindParameters.emissions=this._hasEmissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(R.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(R.CUTFILL_COLOR),this._renderOverlay(),r.setGLViewport(this._rctx);const m=this._framebuffer,u=m.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),_=this._needsLastFrameColor;_?(u?.retain(_-1),u?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor=u):u?.release(),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Ce),this._plugins.prepareRender(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._hasTransparentGeometry=this._plugins.produces(0,...fe),this._precompilePrepasses(),this.performanceInfo.advance(de.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p,!i),m.bind(),this._bindParameters.mainDepth=m.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0;this._bindParameters.hasOpaqueEmissions||0===this._bindParameters.emissions?(this._renderOpaque(),this._renderPreTransparent()):(this._bindParameters.emissions=0,this._renderOpaque(),this._renderPreTransparent(),this._bindParameters.emissions=2),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),m.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),m.update(e=>this._renderNodes(R.VIEWSHED,e)),m.update(e=>this._renderNodes(R.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),m.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),m.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.GROUND_DEPTH),m.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;m.update(e=>this._renderNodes(T.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),this.hasGlobalIllumination&&this._hasEmissions&&(this._bindParameters.reprojection.lastFrameEmission=m.color.obtainAttachment(le)),m.update(e=>this._renderNodes(R.ANTIALIASING,e));const b=this._hasTransparentGeometry?2:1;let f;return this._bindParameters.emissions=0,this._hasHUDHighlights&&m.update(e=>this._renderHUD(b,e)),m.update(e=>this._renderNodes(R.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||m.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=this._hasEmissions,m.update(e=>this._renderNodes(R.MAGNIFIER,e)),m.update(e=>this._renderNodes(T.FINAL,e)),i&&this._blit.toFramebuffer(m.color,this._bindParameters),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),m.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(f=m.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new he(f,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const t=this._bindParameters,s=t.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(s,R.OPAQUE_ENVIRONMENT,R.GAUSSIAN_SPLAT,R.OPAQUE_OCCLUSION_QUERY,R.VOXEL);if(2===this._bindParameters.emissions&&(this._bindParameters.emissions=0,this._precompileOpaqueGeometry(),this._bindParameters.emissions=2),this._bindParameters.output=3,this._plugins.precompile(...ge),this._bindParameters.output=0,this._plugins.precompile(...ge),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1),this._precompileTransparentGeometry()}this._nodes.precompile(s,R.FOCUSAREA),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,s),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(s,R.TRANSPARENT_ENVIRONMENT,R.VIEWSHED,R.CUTFILL_COMPUTATION,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=this._hasEmissions,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(s,R.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(s,T.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),s&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(de.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,"olid");return i.acquireDepth(14),i=this._nodes.render(i,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const r=Math.max(e,i);this._animationTimestep.frame(r,s)}}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,me.UNSIGNED_BYTE,t),r.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?de.OPAQUE_EDGES:de.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(de.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(R.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(de.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(R.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=t===this._bindParameters.shadowMap&&6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowCasterNodes();t.finish(e),this._bindParameters.output=s}_renderShadowCasterNodes(){if(!this._nodes.produces(R.SHADOW_CASTERS))return;const e=this._bindParameters.shadowMap.renderTarget;if(!e)return;const t=e.name;e.setName(R.SHADOW_CASTERS),this._pluginInput.set(R.SHADOW_CASTERS,e);try{this._nodes.render(e,this._pluginInput,this._releaseNodeInputs)}finally{e.setName(t),this._pluginInput.set(R.SHADOW_CASTERS,null)}}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._shadowAccumulator.accumulating+ +this._testsNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(R.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(de.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._hasGlobalIlluminationFlag&&(this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(de.DEPTH)}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return X.Zero;const t=$(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),this._bindParameters.shadowMap.enabled&&t.union(this._nodes.queryDepthRange(R.SHADOW_CASTERS,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=X.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<U)return void(this.sceneDepthRange.value=X.Infinite);const t=e.clone();t.near=F,t.far=1e10;const s=$(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...O,R.VIEWSHED,R.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){this._normalsRequired?(this._precompilePlugins(4,Pe),this._needsDepth&&this._precompilePlugins(3,Ie)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,R.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&(this._shadowAccumulator.precompilePrepass(),this._precompileAllGeometry(5)),this.hasAmbientIllumination&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,R.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals",5);i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...Pe);const r=this._nodes.optional("normals",...O,R.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(de.NORMALS),i}_renderSSAO(){this._bindParameters.globalIlluminationEnabled=!1;const e=this._pluginInput.get("normals");return this.hasAmbientIllumination&&e?(this._bindParameters.ssao=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(de.AMBIENT_ILLUMINATION),this._bindParameters.ssao):null}_renderGlobalIllumination(){if(!this.hasGlobalIllumination)return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive,null;const e=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=e,this._bindParameters.globalIlluminationEnabled=!0,this.hasGlobalIlluminationHighQuality?this.performanceInfo.advance(de.AMBIENT_ILLUMINATION_HIGH_QUALITY):this.performanceInfo.advance(de.AMBIENT_ILLUMINATION),e}_releaseGlobalIlluminationBuffers(){this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor),this._bindParameters.reprojection.lastFrameDepth=h(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=h(this._bindParameters.reprojection.lastFrameEmission),this._bindParameters.globalIllumination=h(this._bindParameters.globalIllumination),this._bindParameters.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...ge),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Ee);this._renderContext.renderOccludedMask=Z}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Ee),this._renderContext.renderOccludedMask=Z}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Se[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillOrthographicReferenceDepth(){this._precompilePlugins(9,Te)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillOrthographicReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Te),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,R.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Ie)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...be),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...be)}_renderTransparentGeometry(){this._plugins.render(...fe),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...ge)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...we),this._bindParameters.output=2,this._plugins.precompile(...we),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...we)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(le);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?de.HUD_OCCLUDED:de.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>B?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),V(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(de.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ae),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e),this._bindParameters.output=0,this._shadowAccumulator.accumulating&&this._bindParameters.depth&&(this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(de.ACCUMULATED_SHADOWS),this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){y(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...fe),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...fe),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...fe)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",m=this.fboCache.acquire(i,r,l,o),u=h.hasEmission&&(0===e||1!==t);u&&m.acquireColor(le,o,"oit emissive");const _=u?ue:le;m.acquireColor(_,this.hasFloatBlend?7:0,"oit alpha"),s||m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,C),a(),m.detachDepth(),h.output=2;const p=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");u&&p.acquireColor(le,o,"oit front emissive"),s?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,s),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(_,0,"hud occlusion"),this._rctx.clearBuffer(_-_e,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,m,p,h,u,c,e),b?.detachDepth(),s||c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(_)),p.release(),m.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...be)||this.plugins.produces(5,...be)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(R.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(T.OPAQUE,t,e)),this.fboCache.debugCallback?.(T.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(R.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(R.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(R.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.VOXEL,e)),this.fboCache.debugCallback?.(R.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;2===this._bindParameters.emissions&&e.ensureEmissionAttachment(),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(T.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(T.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),this._renderTransparentEnvironment()}_renderTransparentEnvironment(){if(this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(de.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([pe,le]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const i=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(i,t.fbo);const r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),r}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=I);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(f(De,t.viewMatrix),f(Oe,t.projectionMatrix),g(Fe,De,Oe),g(Fe,s.viewMatrix,Fe),g(Fe,s.projectionMatrix,Fe),this._reprojectionMatrix=Fe):this._reprojectionMatrix=I,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(g(Ge,s.viewMatrix,De),P(t,Ge)):P(t,I)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p()],ce.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],ce.prototype,"highResolutionAtmosphere",null),e([p()],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),ce=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ce);const be=[0,1,2,3],fe=[7,6,4,5],ge=[7,6],Pe=[0,1,2,4,...ge],Ie=[3,5],Ee=[2,4,8],we=[16,12,14,13],Ae=[4,5,2,3,0,1,...ge],Ce=[4,8,5,11],Se={0:[13],1:[12],2:[13,12],3:[13,12]},Te=[0,1,...ge],Re=["normals","highlights"],Oe=E(),De=E(),Fe=E(),Ge=E();function Ne(e){return t=>e.immediate.schedule(t)}export{ce as Renderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as m,sync as u}from"../../../../core/reactiveUtils.js";import{signal as _}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as b,invert as f,multiply as g,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as I,create as E}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as A,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as S}from"../../../../geometry/support/Indices.js";import{RenderNodeOutput as T,InternalRenderCategory as R,AllRenderNodeOutputs as O,AllInternalRenderNodeOutputs as D}from"../../webgl.js";import{minNearDistanceInMeters as F}from"../../state/NearFarHeuristic.js";import{debugFlags as G}from"../../support/debugFlags.js";import{computeShadowsEnabled as N}from"../../support/sunUtils.js";import{FBOCache as H}from"../core/FBOCache.js";import{RenderPassManager as x}from"../core/renderPasses/RenderPassManager.js";import{isColor as y}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as v}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as M}from"../effects/RenderNodes.js";import{RenderPluginManager as L}from"../effects/RenderPluginManager.js";import{WeatherFader as q}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as U}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as j}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as V}from"../effects/highlight/Highlight.js";import{OITBlend as k}from"../effects/transparency/OITBlend.js";import{AnimationTimer as W}from"./AnimationTimer.js";import{AnimationTimeStep as Q}from"./AnimationTimeStep.js";import{BoundingInfo as z}from"./BoundingInfo.js";import{Compositor as Y}from"./Compositor.js";import{DepthRange as X}from"./DepthRange.js";import{depthRangeFromScene as $}from"./depthRangeUtils.js";import{MainFramebuffer as J}from"./MainFramebuffer.js";import{RenderContext as K,defaultRenderOccludedMask as Z}from"./RenderContext.js";import{RendererBase as ee}from"./RendererBase.js";import{setupFeatureDefaults as te}from"./RenderFeature.js";import{RenderPluginInput as se}from"./RenderPluginInput.js";import{ShadowAccumulator as ie}from"./ShadowAccumulator.js";import{ShadowMap as re}from"./ShadowMap.js";import ae from"./SliceHelper.js";import{MergedRenderer as ne}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as he}from"../parts/renderUtils.js";import{RendererPerformanceInfo as oe,PerformanceCategory as de}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as le,PixelType as me,ColorAttachment2 as ue,ColorAttachment0 as _e,DrawBufferNone as pe}from"../../../webgl/enums.js";let ce=class extends ee{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new x,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ae,this.sceneDepthRange=_(X.Infinite),this._state=_(2),this._hasGlobalIlluminationFlag=!!has("global-illumination"),this._hasAnimations=!1,this._animationTimestep=new Q,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=_(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new se,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of Re)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new H(i),this._compositor=new Y(i,s),this._renderStateFeatures=_(te(e.view.qualityProfile));const a=new re(this._fboCache,e.viewingMode);this._renderContext=new K(this._rctx,a,s),this._framebuffer=new J(this._fboCache,this._bindParameters),this._performanceInfo=new oe(this._rctx),this._blit=new j(s),this._shadowAccumulator=new ie(this.fboCache,s,e,e=>{const t=this.shadowsEnabled;a.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),a.enabled=t},(t,s,i)=>{const r=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,s,i,!0,r),this._renderShadowCascades(5,t.shadowMap),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},r),this._nodes=new M(this._renderContext),this._plugins=new L({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new q({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>G.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},m),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=v,l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},u),d(()=>this._bindParameters.clouds.data?.state,()=>r(),u),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},m),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,z.prune(),ne.prune(),S()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new k(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=te(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender()}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this.isFeatureEnabled(3)&&!this._inGlobeView}get hasGlobalIllumination(){return this._hasGlobalIlluminationFlag&&this.hasAmbientIllumination}get hasGlobalIlluminationHighQuality(){return this.hasGlobalIllumination&&this.isFeatureEnabled(10)}get _keepGlobalIlluminationShadingAlive(){return this._hasGlobalIlluminationFlag&&!this._inGlobeView}get hasSMAA(){return this.isFeatureEnabled(0)}get _hasEmissions(){return this._plugins.hasEmissions}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");o(e);const s=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ne(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),u)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.reprojection.matrix,I)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}modifyShadowsEnabled(){const e=this.stage.view.environmentManager.referencePositionGeographic,t=null==e||N(e[2],this.stage.viewingMode),s=this.stage.view.environment.lighting.directShadowsEnabled&&t;this._bindParameters.shadowMap.enabled!==s&&(this._bindParameters.shadowMap.enabled=s,this._requestRender(1))}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&this._shadowAccumulator.setParameters(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...we),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new W(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new he(this._pluginInput.get(T.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.output=0,this._bindParameters.emissions=this._hasEmissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(R.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(R.CUTFILL_COLOR),this._renderOverlay(),r.setGLViewport(this._rctx);const m=this._framebuffer,u=m.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),_=this._needsLastFrameColor;_?(u?.retain(_-1),u?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor=u):u?.release(),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Ce),this._plugins.prepareRender(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._hasTransparentGeometry=this._plugins.produces(0,...fe),this._precompilePrepasses(),this.performanceInfo.advance(de.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p,!i),m.bind(),this._bindParameters.mainDepth=m.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0;this._bindParameters.hasOpaqueEmissions||0===this._bindParameters.emissions?(this._renderOpaque(),this._renderPreTransparent()):(this._bindParameters.emissions=0,this._renderOpaque(),this._renderPreTransparent(),this._bindParameters.emissions=2),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),this._renderCutFillComputation(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),m.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),m.update(e=>this._renderNodes(R.VIEWSHED,e)),m.update(e=>this._renderNodes(R.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),m.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),m.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.GROUND_DEPTH),m.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;m.update(e=>this._renderNodes(T.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),this.hasGlobalIllumination&&this._hasEmissions&&(this._bindParameters.reprojection.lastFrameEmission=m.color.obtainAttachment(le)),m.update(e=>this._renderNodes(R.ANTIALIASING,e));const b=this._hasTransparentGeometry?2:1;let f;return this._bindParameters.emissions=0,this._hasHUDHighlights&&m.update(e=>this._renderHUD(b,e)),m.update(e=>this._renderNodes(R.HIGHLIGHT_COLOR,e)),this._hasHUDHighlights||m.update(e=>this._renderHUD(b,e)),this._bindParameters.emissions=this._hasEmissions,m.update(e=>this._renderNodes(R.MAGNIFIER,e)),m.update(e=>this._renderNodes(T.FINAL,e)),i&&this._blit.toFramebuffer(m.color,this._bindParameters),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),m.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(f=m.color,f.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new he(f,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling,this._bindParameters.output=0;const t=this._bindParameters,s=t.hasEmission;this._precompileOpaqueGeometry(),this._nodes.precompile(s,R.OPAQUE_ENVIRONMENT,R.GAUSSIAN_SPLAT,R.OPAQUE_OCCLUSION_QUERY,R.VOXEL);if(2===this._bindParameters.emissions&&(this._bindParameters.emissions=0,this._precompileOpaqueGeometry(),this._bindParameters.emissions=2),this._bindParameters.output=3,this._plugins.precompile(...ge),this._bindParameters.output=0,this._plugins.precompile(...ge),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(this._bindParameters,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(this._bindParameters,!1,1),this._precompileTransparentGeometry()}this._nodes.precompile(s,R.FOCUSAREA),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,s),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(s,R.TRANSPARENT_ENVIRONMENT,R.VIEWSHED,R.CUTFILL_COMPUTATION,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=this._hasEmissions,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(s,R.HIGHLIGHT_COLOR)),t.highlightMixTexture=null,this._nodes.precompile(s,T.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),s&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(de.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,"olid");return i.acquireDepth(14),i=this._nodes.render(i,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(de.OBJECT_AND_LAYER_ID_COLOR),this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e;if(s||t){const e=s?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const r=Math.max(e,i);this._animationTimestep.frame(r,s)}}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,me.UNSIGNED_BYTE,t),r.release()}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?de.OPAQUE_EDGES:de.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(de.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(R.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(de.SHADOW_MAP)}_renderCutFillComputation(){this._nodes.produce(R.CUTFILL_COMPUTATION,this._pluginInput)?.release()}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=t===this._bindParameters.shadowMap&&6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowCasterNodes();t.finish(e),this._bindParameters.output=s}_renderShadowCasterNodes(){if(!this._nodes.produces(R.SHADOW_CASTERS))return;const e=this._bindParameters.shadowMap.renderTarget;if(!e)return;const t=e.name;e.setName(R.SHADOW_CASTERS),this._pluginInput.set(R.SHADOW_CASTERS,e);try{this._nodes.render(e,this._pluginInput,this._releaseNodeInputs)}finally{e.setName(t),this._pluginInput.set(R.SHADOW_CASTERS,null)}}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._shadowAccumulator.requiresDepth+ +this._testsNeedsDepth}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(R.AMBIENT_ILLUMINATION,this._hasGlobalIlluminationFlag?this._renderGlobalIllumination():this._renderSSAO());const t=this._needsDepth;t?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),this.performanceInfo.advance(de.DEPTH)):e.detachDepth(),this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._hasGlobalIlluminationFlag&&(this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(de.DEPTH)}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return X.Zero;const t=$(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),this._bindParameters.shadowMap.enabled&&t.union(this._nodes.queryDepthRange(R.SHADOW_CASTERS,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=X.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<U)return void(this.sceneDepthRange.value=X.Infinite);const t=e.clone();t.near=F,t.far=1e10;const s=$(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...O,R.VIEWSHED,R.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){this._normalsRequired?(this._precompilePlugins(4,Pe),this._needsDepth&&this._precompilePlugins(3,Ie)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(this._bindParameters.hasEmission,R.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator.active&&(this._shadowAccumulator.precompilePrepass(),this._precompileAllGeometry(5)),this.hasAmbientIllumination&&this._normalsRequired&&this._nodes.precompile(this._bindParameters.hasEmission,R.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals",5);i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...Pe);const r=this._nodes.optional("normals",...O,R.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(de.NORMALS),i}_renderSSAO(){this._bindParameters.globalIlluminationEnabled=!1;const e=this._pluginInput.get("normals");return this.hasAmbientIllumination&&e?(this._bindParameters.ssao=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput),this._bindParameters.ssao&&this.performanceInfo.advance(de.AMBIENT_ILLUMINATION),this._bindParameters.ssao):null}_renderGlobalIllumination(){if(!this.hasGlobalIllumination)return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIlluminationEnabled=this._keepGlobalIlluminationShadingAlive,null;const e=this._nodes.produce(R.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),this._bindParameters.globalIllumination=e,this._bindParameters.globalIlluminationEnabled=!0,this.hasGlobalIlluminationHighQuality?this.performanceInfo.advance(de.AMBIENT_ILLUMINATION_HIGH_QUALITY):this.performanceInfo.advance(de.AMBIENT_ILLUMINATION),e}_releaseGlobalIlluminationBuffers(){this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor),this._bindParameters.reprojection.lastFrameDepth=h(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=h(this._bindParameters.reprojection.lastFrameEmission),this._bindParameters.globalIllumination=h(this._bindParameters.globalIllumination),this._bindParameters.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...ge),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Ee);this._renderContext.renderOccludedMask=Z}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Ee),this._renderContext.renderOccludedMask=Z}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Se[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){this._precompileAllGeometry(8)}precompileCutFillOrthographicReferenceDepth(){this._precompilePlugins(9,Te)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._ensureBindParametersCamera(t,s),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=i}renderCutFillOrthographicReferenceDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Te),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,R.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Ie)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...be),this._nodes.precompile(this._bindParameters.hasEmission,"opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...be)}_renderTransparentGeometry(){this._plugins.render(...fe),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...ge)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...we),this._bindParameters.output=2,this._plugins.precompile(...we),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...we)),this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(le);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?de.HUD_OCCLUDED:de.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>B?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),V(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(de.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...D)+this._nodes.optional("highlights",...D)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ae),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t){this._shadowAccumulator.updateDepthRange(e);const s=this._shadowAccumulator.requiresDepth;this._bindParameters.output=0,this._shadowAccumulator.renderAccumulation(this._bindParameters,t)&&this.performanceInfo.advance(de.ACCUMULATED_SHADOWS),s&&(this._bindParameters.depth=h(this._bindParameters.depth))}_precompileTransparentGeometry(){y(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...fe),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...fe),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...fe)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",m=this.fboCache.acquire(i,r,l,o),u=h.hasEmission&&(0===e||1!==t);u&&m.acquireColor(le,o,"oit emissive");const _=u?ue:le;m.acquireColor(_,this.hasFloatBlend?7:0,"oit alpha"),s||m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer([0,0,0,1]),u&&this._rctx.clearBuffer(1,C),a(),m.detachDepth(),h.output=2;const p=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");u&&p.acquireColor(le,o,"oit front emissive"),s?p.acquireDepth(this._hudDepthFormat):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,s),a(),p.detachDepth();const c=this._pluginsHas.occludedHudElements&&!s;let b;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(b=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(b.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(c&&(this._framebuffer.color.acquireColor(_,0,"hud occlusion"),this._rctx.clearBuffer(_-_e,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,m,p,h,u,c,e),b?.detachDepth(),s||c&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(_)),p.release(),m.release(),h.output=d,b}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...be)||this.plugins.produces(5,...be)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(R.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(T.OPAQUE,t,e)),this.fboCache.debugCallback?.(T.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(R.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(R.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(R.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(R.VOXEL,e)),this.fboCache.debugCallback?.(R.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;2===this._bindParameters.emissions&&e.ensureEmissionAttachment(),this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(T.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(T.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),this._renderTransparentEnvironment()}_renderTransparentEnvironment(){if(this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(de.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([pe,le]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){const i=t.name;if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;this._fboCache.debugCallback?.(i,t.fbo);const r=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),r}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=I);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(f(De,t.viewMatrix),f(Oe,t.projectionMatrix),g(Fe,De,Oe),g(Fe,s.viewMatrix,Fe),g(Fe,s.projectionMatrix,Fe),this._reprojectionMatrix=Fe):this._reprojectionMatrix=I,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(g(Ge,s.viewMatrix,De),P(t,Ge)):P(t,I)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p()],ce.prototype,"_inGlobeView",void 0),e([p({readOnly:!0})],ce.prototype,"highResolutionAtmosphere",null),e([p()],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),ce=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ce);const be=[0,1,2,3],fe=[7,6,4,5],ge=[7,6],Pe=[0,1,2,4,...ge],Ie=[3,5],Ee=[2,4,8],we=[16,12,14,13],Ae=[4,5,2,3,0,1,...ge],Ce=[4,8,5,11],Se={0:[13],1:[12],2:[13,12],3:[13,12]},Te=[0,1,...ge],Re=["normals","highlights"],Oe=E(),De=E(),Fe=E(),Ge=E();function Ne(e){return t=>e.immediate.schedule(t)}export{ce as Renderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{sliceEquals as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as r}from"../../../../core/mathUtils.js";import{releaseMaybe as s,disposeMaybe as a}from"../../../../core/maybe.js";import{watch as o,sync as n}from"../../../../core/reactiveUtils.js";import{signal as h}from"../../../../core/signal.js";import{property as c,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{copy as l,equals as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as d}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{a as p}from"../../../../chunks/FocusAreaMask.glsl.js";import{volumeToVao as f}from"../effects/focusArea/focusAreaMaskUtils.js";import{BindParameters as g}from"./BindParameters.js";import{DepthRange as b}from"./DepthRange.js";import{createQuadVAO as v}from"./glUtil3D.js";import{ShadowCastRenderer as y,shadowCastDisabledElevationThreshold as S,shadowCastDisableElevationMax as w,shadowCastDisableElevationMin as A}from"./ShadowCastRenderer.js";import{ShadowMap as F}from"./ShadowMap.js";import{a as C}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as R}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as x}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as P}from"../shaders/ShadowCastClearTechnique.js";import{ShadowCastMaskTechnique as q}from"../shaders/ShadowCastMaskTechnique.js";import{TaskPriority as j}from"../../../support/Scheduler.js";import{PrimitiveType as H,DepthStencilAttachment as V,PixelType as T}from"../../../webgl/enums.js";import{DisposableFramebufferObject as D}from"../../../webgl/FramebufferObject.js";import{noParameters as M}from"../../../webgl/NoParameters.js";let E=class extends t{constructor(e,t,i,r,a,h){super({}),this._fbos=e,this._techniques=t,this._stage=i,this._prepareForShadowMapPass=r,this._renderToShadowMap=a,this._requestRender=h,this._analysisVolumeGeometry=null,this._primarySet=new U(new x(0),()=>this._requestRenderIfEnabled()),this._contextSet=new U(new x(1),()=>this._requestRenderIfEnabled()),this._passParameters=new d,this._maskParameters=new p,this._volumeVao=null,this._volumeVertexCount=0,this._depthRange=b.Zero,this._enabled=!1,this._previewing=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._bindParameters=new g(e.rctx,new F(e,i.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=v(e.rctx),this._accumulationRenderer=new y(e,t,this,h),this._tmpReadFbo=new D(e.rctx);const c=this._stage.view.resourceController.scheduler;this.addHandles([c.registerTask(j.SHADOW_ACCUMULATOR,this),o(()=>this._previewing,e=>{e?this._invalidateAccumulationSets():this._requestRenderIfEnabled()},n),o(()=>this._numActive,()=>this._numActiveChanged(),n),o(()=>this.readyToRun,e=>{e||(this._bindParameters.depth=s(this._bindParameters.depth),this.notifyChange("canAccumulate"))})],this._shadowAccumulatorKey)}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=a(this._accumulationRenderer),this._fboHandle=a(this._fboHandle),this._vao=a(this._vao),this._volumeVao=a(this._volumeVao),this._tmpReadFbo=a(this._tmpReadFbo),this._bindParameters.destroy();for(const e of this._accumulationSets())e.destroy();this._contextSet=null,this._primarySet=null}*_accumulationSets(){yield this._primarySet,yield this._contextSet}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fboHandle?.getTexture()}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return this._enabled&&[...this._accumulationSets()].some(e=>e.active)}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==b.Zero&&this._opacityFromElevation>S}get _doneAccumulating(){return[...this._accumulationSets()].every(e=>e.doneAccumulating)}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get _numActive(){return[...this._accumulationSets()].reduce((e,t)=>e+(t.active?1:0),0)}get _colorFormat(){return 2===this._numActive?2:0}get readyToRun(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some(e=>e.running)}get _analysisVolume(){return this._analysisVolumeGeometry}set _analysisVolume(e){if(this._analysisVolumeGeometry===e)return;this._invalidateAccumulationSets(),this._analysisVolumeGeometry=e,this._volumeVao=a(this._volumeVao),this._volumeVertexCount=0;const t=null!=e;for(const a of this._accumulationSets())a.configuration.useMask=t;if(!t)return;const i=e.geometryVolume,{vao:r,vertexCount:s}=f(this._rctx,i);this._volumeVao=r,this._volumeVertexCount=s}runTask(e){this._clearBuffersOnAccumulationStart(),this._prepareForShadowMapPass(this._bindParameters);let t=!1;for(const i of this._accumulationSets())this._runTaskForSet(i,e)&&(t=!0);t&&this._requestRender()}_runTaskForSet(e,t){let i=!1;for(;!t.done&&!e.doneAccumulating;)this._accumulateShadow(e),t.madeProgress(),i=!0;return i}renderAccumulation(e,t){return this._updateCamera(e.camera),this._bindParameters.contentCamera=e.contentCamera,e.depth?.retain(),this._bindParameters.depth?.release(),this._bindParameters.depth=e.depth,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!(!this.accumulating||!this.canAccumulate)&&(this._previewing||t?(this._clearFramebuffer(),this._reset()):this._clearBuffersOnAccumulationStart(),this._renderAreaMask(),this._accumulateSetsForRenderFrame(t))}_renderAreaMask(){const e=this._techniques.getCompiled(q),t=this._volumeVao,i=this._volumeVertexCount,r=this._fboHandle,s=this._analysisVolume;if(r?.detachDepth(),!e||!t||i<1||!r||!s)return;r.acquireDepth(14);const a=this._rctx,o=this._bindParameters,n=o.depth,h=this._tmpReadFbo;h.attachDepthStencil(n?.attachment),a.blitFramebuffer(h,r.fbo,256),h.detachDepthStencilTexture(),a.bindFramebuffer(r.fbo),a.setClearStencil(0),a.clear(1024),a.setViewport(0,0,o.camera.width,o.camera.height);const c=a.bindTechnique(e,o,M);this._maskParameters.origin=s.origin,c.bindDraw(o,M,this._maskParameters),a.bindVAO(t),a.drawArrays(H.TRIANGLES,0,i)}_clearBuffersOnAccumulationStart(){if([...this._accumulationSets()].every(e=>0===e.progress))this._clearFramebuffer();else for(const e of this._accumulationSets())0===e.progress&&this._clearFramebufferForSet(this._fboHandle,e)}_accumulateSetsForRenderFrame(e){let t=!1;for(const i of this._accumulationSets())this._accumulateSetForRenderFrame(i,e)&&(t=!0);return t&&this._requestRender(),t}_accumulateSetForRenderFrame(e,t){let i=t?e.sampleCount:Math.min(k,e.sampleCount);i-=e.progress;for(let r=0;r<i;++r)this._accumulateShadow(e);return i>0}precompilePrepass(){if(this.accumulating){for(const e of this._accumulationSets())this._techniques.precompile(R,e.configuration),this._techniques.precompile(P,e.configuration);this._techniques.precompile(q)}}precompile(){this._accumulationRenderer.precompile()}render(e){const t=this._fboHandle?.getAttachment(V);this._accumulationRenderer.render(e,t)}setParameters(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),void 0!==e.analysisVolume&&(this._analysisVolume=e.analysisVolume),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const i=this._primarySet.progress;return!this.active||!this._fboHandle||i<1||e<0||e>=this._fboHandle.fbo.width||t<0||t>=this._fboHandle.fbo.height?0:(this._fboHandle.fbo.readPixels(e,t,1,1,6408,T.UNSIGNED_BYTE,O),O[0]/i)}_numActiveChanged(){if(!this._enabled||!this._fboHandle)return;const e=2===this._numActive,{width:t,height:i}=this._fboHandle.fbo,r=this._createFBO(t,i);e&&(this._clearFramebuffer(r),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fboHandle.fbo,r.fbo),this._fboHandle.dispose(),this._fboHandle=r,this._requestRender()}_enable(){this._enabled||(this._enabled=!0,this._invalidateAccumulationSets())}_disable(){this._enabled&&(this._fboHandle=a(this._fboHandle),this._enabled=!1,this._requestRender())}_createFBO(e,t){return this._fbos.acquire(e,t,"shadow accumulation",this._colorFormat)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fboHandle){e&&(this._rctx.bindFramebuffer(e.fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(16384))}_clearFramebufferForSet(e,t){if(!e)return;const i=this._techniques.get(P,t.configuration);this._rctx.bindFramebuffer(e.fbo),this._rctx.bindTechnique(i,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(e){this._renderToShadowMap(this._bindParameters,e.lightDirections[e.progress++],this._depthRange);const t=this._techniques.get(R,e.configuration);this._rctx.bindFramebuffer(this._fboHandle?.fbo),this._rctx.bindTechnique(t,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,this._vao.vertexCount("geometry"))}_updateCamera(e){if(!this._enabled)return;const t=this._bindParameters.camera;e.equals(t)||t.copyFrom(e),this._fboHandle?.fbo.width===e.fullWidth&&this._fboHandle?.fbo.height===e.fullHeight||(this._fboHandle?.release(),this._fboHandle=this._createFBO(e.fullWidth,e.fullHeight)),this._opacityFromElevation=1-r(A,w,e.relativeElevation)}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}get _rctx(){return this._fbos.rctx}updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e,this._invalidateAccumulationSets())}get test(){}};e([c()],E.prototype,"_refining",null),e([c()],E.prototype,"active",null),e([c()],E.prototype,"canAccumulate",null),e([c()],E.prototype,"_doneAccumulating",null),e([c()],E.prototype,"_opacityFromElevation",null),e([c()],E.prototype,"_numActive",null),e([c()],E.prototype,"_colorFormat",null),e([c()],E.prototype,"readyToRun",null),e([c()],E.prototype,"_depthRange",void 0),e([c()],E.prototype,"_enabled",void 0),e([c()],E.prototype,"_previewing",void 0),e([c()],E.prototype,"_accumulationRenderer",void 0),E=e([u("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],E);const k=6,O=new Uint8Array(4);class U{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=h(0),this._sampleCount=h(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,r=Math.min(C,e.length);if(!i(t,0,t.length,e,0,r,m)){t.length=r,this._sampleCount.value=r;for(let i=0;i<r;++i)t[i]=l(t[i]??_(),e[i]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(R,this.configuration),e.precompile(P,this.configuration)}}export{E as ShadowAccumulator};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{sliceEquals as i}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{smoothstep as r}from"../../../../core/mathUtils.js";import{releaseMaybe as s,disposeMaybe as a}from"../../../../core/maybe.js";import{watch as o,sync as n}from"../../../../core/reactiveUtils.js";import{signal as h}from"../../../../core/signal.js";import{property as c,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{copy as l,equals as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadShadowMapPassParameters as d}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{a as p}from"../../../../chunks/FocusAreaMask.glsl.js";import{volumeToVao as f}from"../effects/focusArea/focusAreaMaskUtils.js";import{BindParameters as g}from"./BindParameters.js";import{DepthRange as b}from"./DepthRange.js";import{createQuadVAO as v}from"./glUtil3D.js";import{ShadowCastRenderer as y,shadowCastDisabledElevationThreshold as S,shadowCastDisableElevationMax as w,shadowCastDisableElevationMin as A}from"./ShadowCastRenderer.js";import{ShadowMap as F}from"./ShadowMap.js";import{a as C}from"../../../../chunks/ShadowCastAccumulate.glsl.js";import{ShadowCastAccumulateTechnique as R}from"../shaders/ShadowCastAccumulateTechnique.js";import{ShadowCastAccumulateTechniqueConfiguration as x}from"../shaders/ShadowCastAccumulateTechniqueConfiguration.js";import{ShadowCastClearTechnique as P}from"../shaders/ShadowCastClearTechnique.js";import{ShadowCastMaskTechnique as q}from"../shaders/ShadowCastMaskTechnique.js";import{TaskPriority as V}from"../../../support/Scheduler.js";import{PrimitiveType as j,DepthStencilAttachment as H,PixelType as D}from"../../../webgl/enums.js";import{DisposableFramebufferObject as T}from"../../../webgl/FramebufferObject.js";import{noParameters as M}from"../../../webgl/NoParameters.js";let E=class extends t{constructor(e,t,i,r,a,h){super({}),this._fbos=e,this._techniques=t,this._stage=i,this._prepareForShadowMapPass=r,this._renderToShadowMap=a,this._requestRender=h,this._analysisVolumeGeometry=null,this._primarySet=new U(new x(0),()=>this._requestRenderIfEnabled()),this._contextSet=new U(new x(1),()=>this._requestRenderIfEnabled()),this._passParameters=new d,this._maskParameters=new p,this._volumeVao=null,this._volumeVertexCount=0,this._depthRange=b.Zero,this._enabled=!1,this._previewing=!1,this._shadowAccumulatorKey=Symbol("shadowAccumulator"),this._bindParameters=new g(e.rctx,new F(e,i.viewingMode)),this._bindParameters.shadowMap.enabled=!0,this._vao=v(e.rctx),this._accumulationRenderer=new y(e,t,this,h),this._tmpReadFbo=new T(e.rctx);const c=this._stage.view.resourceController.scheduler;this.addHandles([c.registerTask(V.SHADOW_ACCUMULATOR,this),o(()=>this._previewing,e=>{e?this._invalidateAccumulationSets():this._requestRenderIfEnabled()},n),o(()=>this._numActive,()=>this._numActiveChanged(),n),o(()=>this.readyToRun,e=>{e||(this._bindParameters.depth=s(this._bindParameters.depth),this.notifyChange("canAccumulate"))})],this._shadowAccumulatorKey)}destroy(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=a(this._accumulationRenderer),this._fboHandle=a(this._fboHandle),this._vao=a(this._vao),this._volumeVao=a(this._volumeVao),this._tmpReadFbo=a(this._tmpReadFbo),this._bindParameters.destroy();for(const e of this._accumulationSets())e.destroy();this._contextSet=null,this._primarySet=null}*_accumulationSets(){yield this._primarySet,yield this._contextSet}get computedSamples(){return[this._primarySet.progress,this._contextSet.progress]}get shadowCastTexture(){return this._fboHandle?.getTexture()}get accumulating(){return this.active&&this._previewing||this._refining}get _refining(){return this.active&&!this._doneAccumulating&&!this._previewing}get active(){return this._enabled&&[...this._accumulationSets()].some(e=>e.active)}get canAccumulate(){return null!=this._bindParameters.depth&&this._depthRange!==b.Zero&&this._opacityFromElevation>S}get _doneAccumulating(){return[...this._accumulationSets()].every(e=>e.doneAccumulating)}get _opacityFromElevation(){return this._accumulationRenderer.opacityFromElevation}set _opacityFromElevation(e){this._accumulationRenderer.opacityFromElevation=e}get _numActive(){return[...this._accumulationSets()].reduce((e,t)=>e+(t.active?1:0),0)}get _colorFormat(){return 2===this._numActive?2:0}get readyToRun(){return this._refining&&this.canAccumulate&&[...this._accumulationSets()].some(e=>e.running)}get _analysisVolume(){return this._analysisVolumeGeometry}set _analysisVolume(e){if(this._analysisVolumeGeometry===e)return;this._invalidateAccumulationSets(),this._analysisVolumeGeometry=e,this._volumeVao=a(this._volumeVao),this._volumeVertexCount=0;const t=null!=e;for(const a of this._accumulationSets())a.configuration.useMask=t;if(!t)return;const i=e.geometryVolume,{vao:r,vertexCount:s}=f(this._rctx,i);this._volumeVao=r,this._volumeVertexCount=s}runTask(e){this._clearBuffersOnAccumulationStart(),this._prepareForShadowMapPass(this._bindParameters);let t=!1;for(const i of this._accumulationSets())this._runTaskForSet(i,e)&&(t=!0);t&&this._requestRender()}_runTaskForSet(e,t){let i=!1;for(;!t.done&&!e.doneAccumulating;)this._accumulateShadow(e),t.madeProgress(),i=!0;return i}get requiresDepth(){return this.accumulating||null!=this._volumeVao}renderAccumulation(e,t){return!!this._enabled&&(this._updateCamera(e.camera),this._bindParameters.contentCamera=e.contentCamera,e.depth?.retain(),this._bindParameters.depth?.release(),this._bindParameters.depth=e.depth,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!!this.canAccumulate&&(this._renderAreaMask(),!!this.accumulating&&(this._previewing||t?(this._clearFramebuffer(),this._reset()):this._clearBuffersOnAccumulationStart(),this._accumulateSetsForRenderFrame(t))))}_renderAreaMask(){const e=this._techniques.getCompiled(q),t=this._volumeVao,i=this._volumeVertexCount,r=this._fboHandle,s=this._analysisVolume;if(r?.detachDepth(),!e||!t||i<1||!r||!s)return;r.acquireDepth(14);const a=this._rctx,o=this._bindParameters,n=o.depth,h=this._tmpReadFbo;h.attachDepthStencil(n?.attachment),a.blitFramebuffer(h,r.fbo,256),h.detachDepthStencilTexture(),a.bindFramebuffer(r.fbo),a.setClearStencil(0),a.clear(1024),a.setViewport(0,0,o.camera.width,o.camera.height);const c=a.bindTechnique(e,o,M);this._maskParameters.origin=s.origin,c.bindDraw(o,M,this._maskParameters),a.bindVAO(t),a.drawArrays(j.TRIANGLES,0,i)}_clearBuffersOnAccumulationStart(){if([...this._accumulationSets()].every(e=>0===e.progress))this._clearFramebuffer();else for(const e of this._accumulationSets())0===e.progress&&this._clearFramebufferForSet(this._fboHandle,e)}_accumulateSetsForRenderFrame(e){let t=!1;for(const i of this._accumulationSets())this._accumulateSetForRenderFrame(i,e)&&(t=!0);return t&&this._requestRender(),t}_accumulateSetForRenderFrame(e,t){let i=t?e.sampleCount:Math.min(k,e.sampleCount);i-=e.progress;for(let r=0;r<i;++r)this._accumulateShadow(e);return i>0}precompilePrepass(){if(this.accumulating){for(const e of this._accumulationSets())this._techniques.precompile(R,e.configuration),this._techniques.precompile(P,e.configuration);this._techniques.precompile(q)}}precompile(){this._accumulationRenderer.precompile()}render(e){const t=this._fboHandle?.getAttachment(H);this._accumulationRenderer.render(e,t)}setParameters(e){void 0!==e.previewing&&(this._previewing=e.previewing),void 0!==e.lightDirections&&(this._primarySet.lightDirections=e.lightDirections),void 0!==e.lightDirectionsContext&&(this._contextSet.lightDirections=e.lightDirectionsContext),!0===e.enabled?this._enable():!1===e.enabled&&this._disable(),void 0!==e.analysisVolume&&(this._analysisVolume=e.analysisVolume),this._accumulationRenderer.setOptions(e)}readAccumulatedShadow(e,t){const i=this._primarySet.progress;return!this.active||!this._fboHandle||i<1||e<0||e>=this._fboHandle.fbo.width||t<0||t>=this._fboHandle.fbo.height?0:(this._fboHandle.fbo.readPixels(e,t,1,1,6408,D.UNSIGNED_BYTE,O),O[0]/i)}_numActiveChanged(){if(!this._enabled||!this._fboHandle)return;const e=2===this._numActive,{width:t,height:i}=this._fboHandle.fbo,r=this._createFBO(t,i);e&&(this._clearFramebuffer(r),this._contextSet.reset()),this._rctx.blitFramebuffer(this._fboHandle.fbo,r.fbo),this._fboHandle.dispose(),this._fboHandle=r,this._requestRender()}_enable(){this._enabled||(this._enabled=!0,this._invalidateAccumulationSets())}_disable(){this._enabled&&(this._fboHandle=a(this._fboHandle),this._enabled=!1,this._requestRender())}_createFBO(e,t){return this._fbos.acquire(e,t,"shadow accumulation",this._colorFormat)}_invalidateAccumulationSets(){for(const e of this._accumulationSets())e.reset();this._requestRenderIfEnabled()}_reset(){for(const e of this._accumulationSets())e.reset()}_clearFramebuffer(e=this._fboHandle){e&&(this._rctx.bindFramebuffer(e.fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clear(16384))}_clearFramebufferForSet(e,t){if(!e)return;const i=this._techniques.get(P,t.configuration);this._rctx.bindFramebuffer(e.fbo),this._rctx.bindTechnique(i,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(i.primitiveType,0,this._vao.vertexCount("geometry"))}_accumulateShadow(e){this._renderToShadowMap(this._bindParameters,e.lightDirections[e.progress++],this._depthRange);const t=this._techniques.get(R,e.configuration);this._rctx.bindFramebuffer(this._fboHandle?.fbo),this._rctx.bindTechnique(t,this._bindParameters,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(t.primitiveType,0,this._vao.vertexCount("geometry"))}_isAccumulationValid(e){return this._fboHandle?.fbo.width===e.fullWidth&&this._fboHandle?.fbo.height===e.fullHeight}_updateCamera(e){const t=this._bindParameters.camera;e.equals(t)||t.copyFrom(e),this._isAccumulationValid(e)||(this._fboHandle?.release(),this._fboHandle=this._createFBO(e.fullWidth,e.fullHeight)),this._opacityFromElevation=1-r(A,w,e.relativeElevation)}_requestRenderIfEnabled(){this._enabled&&this._requestRender()}get _rctx(){return this._fbos.rctx}updateDepthRange(e){this._depthRange.equals(e)||(this._depthRange=e,this._invalidateAccumulationSets())}get test(){}};e([c()],E.prototype,"_refining",null),e([c()],E.prototype,"active",null),e([c()],E.prototype,"canAccumulate",null),e([c()],E.prototype,"_doneAccumulating",null),e([c()],E.prototype,"_opacityFromElevation",null),e([c()],E.prototype,"_numActive",null),e([c()],E.prototype,"_colorFormat",null),e([c()],E.prototype,"readyToRun",null),e([c()],E.prototype,"_depthRange",void 0),e([c()],E.prototype,"_enabled",void 0),e([c()],E.prototype,"_previewing",void 0),e([c()],E.prototype,"_accumulationRenderer",void 0),E=e([u("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],E);const k=6,O=new Uint8Array(4);class U{constructor(e,t){this.configuration=e,this._notifyChange=t,this._cachedLightDirections=[],this._progress=h(0),this._sampleCount=h(0)}get progress(){return this._progress.value}set progress(e){this._progress.value=e}get sampleCount(){return this._sampleCount.value}get doneAccumulating(){return this.progress>=this.sampleCount}get running(){return this.progress>0}get active(){return this.sampleCount>0}get lightDirections(){return this._cachedLightDirections}set lightDirections(e){const t=this._cachedLightDirections,r=Math.min(C,e.length);if(!i(t,0,t.length,e,0,r,m)){t.length=r,this._sampleCount.value=r;for(let i=0;i<r;++i)t[i]=l(t[i]??_(),e[i]);this.reset(),this._notifyChange()}}destroy(){this._cachedLightDirections.length=0,this._sampleCount.value=0}reset(){this.progress=0}precompile(e){e.precompile(R,this.configuration),e.precompile(P,this.configuration)}}export{E as ShadowAccumulator};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{hasNativeFloat16Array as e}from"../../../../../geometry/support/float16.js";import{BufferViewMat3f as t,BufferViewVec3f as o,BufferViewVec2f as n,BufferViewFloat as f,BufferViewFloat16 as r,BufferViewVec2Snorm16 as u,
|
|
2
|
+
import{hasNativeFloat16Array as e}from"../../../../../geometry/support/float16.js";import{BufferViewMat3f as t,BufferViewVec3f as o,BufferViewVec2f as n,BufferViewFloat as f,BufferViewFloat16 as r,BufferViewVec2Snorm16 as u,BufferViewSnorm16 as m,BufferViewVec4Unorm8 as s,BufferViewUnorm8 as l,BufferViewVec4u8 as i,BufferViewUint8 as p}from"../../../../../geometry/support/buffer/BufferView.js";import{elementTypeSize as w}from"../../../../../geometry/support/buffer/types.js";class a{constructor(e,t,o){this.elementCount=e,this.elementType=t,this.bufferViewConstructor=o,this.byteSize=c(o)}}function c(e){return w(e.ElementType)*e.ElementCount}const y={u8:new a(1,"uint",p),vec4u8:new a(4,"uint",i),unorm8:new a(1,"float",l),vec4unorm8:new a(4,"float",s),snorm16:new a(1,"float",m),vec2snorm16:new a(2,"float",u),f16:new a(1,"float",e?r:f),f32:new a(1,"float",f),vec2f32:new a(2,"float",n),vec3f32:new a(3,"float",o),mat3f32:new a(9,"float",t)};export{a as FieldCreationInfo,y as typeToCreationInfoMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{olidEnabled as t}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as r}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";function o(){const r=e().u32("pathVertexInfo",{integer:!0}).u32("textureElementIndex",{integer:!0});return t()&&r.vec4u8("olidColor"),r.freeze()}function n(e){const t=[{type:"vec3f32",name:"position"},{type:"vec2snorm16",name:"profileRight"},{type:"vec2snorm16",name:"profileUp"}
|
|
2
|
+
import{newLayout as e}from"../../support/buffer/InterleavedLayout.js";import{olidEnabled as t}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as r}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";function o(){const r=e().u32("pathVertexInfo",{integer:!0}).u32("textureElementIndex",{integer:!0});return t()&&r.vec4u8("olidColor"),r.freeze()}function n(e){const t=[{type:"vec3f32",name:"position"},{type:"vec2snorm16",name:"profileRight"},{type:"vec2snorm16",name:"profileUp"}];return 1===e.upVectorAlignment&&t.push({type:"vec2snorm16",name:"pathRotationUp"}),e.hasVVSize&&t.push({type:"f32",name:"sizeFeatureAttribute"}),e.hasVVColor&&t.push({type:"f32",name:"colorFeatureAttribute"}),e.hasVVOpacity&&t.push({type:"f32",name:"opacityFeatureAttribute"}),t.push({type:"f16",name:"pathMaxStretchDistance"},{type:"snorm16",name:"profileRotation"}),new r(t)}export{o as getLayout,n as getTextureLayout};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewUint32 as s,BufferViewVec3f as o,BufferViewVec2Snorm16 as a,
|
|
2
|
+
import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as r}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewUint32 as s,BufferViewVec3f as o,BufferViewVec2Snorm16 as a,BufferViewSnorm16 as n,BufferViewFloat16 as p,BufferViewFloat as h}from"../../../../geometry/support/buffer/BufferView.js";import{isShadowLike as u,is3DGeometry as f,isColor as c}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{isPathGeometry as m}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as d}from"../lib/RayIntersections.js";import{assert as b}from"../lib/Util.js";import{getLayout as _,getTextureLayout as S}from"./PathLayouts.js";import{PathPassParameters as y,PathTechnique as x}from"./PathTechnique.js";import{PathTechniqueConfiguration as V}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as w}from"./TriangleMaterial.js";import{writeAttributes as z,writeTextureElementIndex as v,writeBufferUint32 as F,writePosition as j,writeBufferVec2 as M,writeBufferInt16 as C,writeBufferFloat16 as A,writeBufferFloat as R}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as T}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as O}from"../../../../webscene/support/AlphaCutoff.js";class P extends w{constructor(t,e){super(t,I),this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,t=>(this.parameters.castShadows&&u(t)||f(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&u(t)||f(t))&&this.transparent]]),this._configuration=new V(e.spherical)}get hasEmissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,c(t.output)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?1:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?2:0,this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.hasShadowHighlights=T(this._configuration,t),this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=t.snowCover>0,this._configuration.upVectorAlignment=this.parameters.upVectorAlignment,this._configuration.pathCapType=this.parameters.pathCapType,this._configuration.pathProfileType=this.parameters.profile.type}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=O}intersect(t,e,i,r,s,o){this._intersect(t,i,r,s,o)}intersectDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(t,e,this._pp0,this._pp1,r)}_intersect(i,s,o,a,n){const p=i;if(!m(p))return;const h=p.path,u=e(this.parameters.size);if(this.parameters.vvSize){const{offset:e,factor:i,minSize:r,maxSize:s,fallback:o}=this.parameters.vvSize,a=h.sizeAttributeValue;Number.isNaN(a)?(u[0]*=o[0],u[1]*=o[2]):(u[0]*=t(e[0]+a*i[0],r[0],s[0]),u[1]*=t(e[2]+a*i[2],r[2],s[2]))}const f=new g(s.tolerance,!1,s.options.normalRequired),c=Math.max(u[0],u[1]),l=i.boundingInfo;if(null==l)return void k(h,u,o,a,f,n);const b=r(l.bbMin[0]-c,l.bbMin[1]-c,l.bbMin[2]-c,l.bbMax[0]+c,l.bbMax[1]+c,l.bbMax[2]+c),_=[a[0]-o[0],a[1]-o[1],a[2]-o[2]],S=Math.sqrt(_[0]*_[0]+_[1]*_[1]+_[2]*_[2]),y=[S/_[0],S/_[1],S/_[2]];d(b,o,y,s.tolerance)&&k(h,u,o,a,f,n)}createBufferWriter(){return new U(_(),S(this.parameters))}createGLMaterial(t){return new B(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class B extends l{beginSlot(t){return this.getTechnique(x,t)}}function k(t,e,i,r,s,o){t.baked.size&&t.baked.size[0]===e[0]&&t.baked.size[1]===e[1]||t.baked.bake(e),t.baked.intersect(i,r,s,o)}class I extends y{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1,this.upVectorAlignment=0,this.pathCapType=1}}class U{constructor(t,e){this.layout=t,this.textureBufferLayout=e}elementCount(t){return t.get("pathVertexInfo")?.indices.length??0}elementCountTextureBuffer(t){return t.get("position")?.indices.length??0}write(t,e,i,r,u,f){b(null!=f,"Texture buffer is required for path material"),z(i,r,this.layout,t,e,u);const c=u.buffer.getField("textureElementIndex",s),l=i.get("textureElementIndex"),m=f.offset,g=f.textureBufferRange.from;c&&l&&v(l,c,u.offset,g);const d=u.buffer.getField("pathVertexInfo",s),_=i.get("pathVertexInfo");d&&_&&(b(1===_.size),F(_,d,u.offset));const S=f.buffer.getField("position",o),y=i.get("position");S&&y&&(b(3===y.size),j(y,t,S,m));const x=f.buffer.getField("profileRight",a),V=i.get("profileRight");x&&V&&(b(2===V.size),M(V,x,m));const w=f.buffer.getField("profileUp",a),T=i.get("profileUp");w&&T&&(b(2===T.size),M(T,w,m));const O=f.buffer.getField("profileRotation",n),P=i.get("profileRotation");O&&P&&(b(1===P.size),C(P,O,m));const B=f.buffer.getField("pathRotationUp",a),k=i.get("pathRotationUp");B&&k&&(b(2===k.size),M(k,B,m));const I=f.buffer.getField("pathMaxStretchDistance",p),U=i.get("pathMaxStretchDistance");I&&U&&(b(1===U.size),A(U,I,m));const q=f.buffer.getField("sizeFeatureAttribute",h),L=i.get("sizeFeatureAttribute");q&&L&&R(L,q,m);const E=f.buffer.getField("opacityFeatureAttribute",h),D=i.get("opacityFeatureAttribute");E&&D&&R(D,E,m);const G=f.buffer.getField("colorFeatureAttribute",h),N=i.get("colorFeatureAttribute");G&&N&&R(N,G,m)}}export{I as Parameters,U as PathBufferWriter,P as PathMaterial};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{subtract as e,length as t,scale as f}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOrthoNormal as r,hasIdentityRotation as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as n,BufferViewVec4f as s,BufferViewFloat as c,BufferViewVec2i16 as l,BufferViewVec2f16 as d,BufferViewVec2f as u,BufferViewVec3f as a}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as p}from"../../lib/Util.js";function g(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l)n[f]=r[i[l]],f+=s;else for(let l=0;l<c;++l){const e=r[i[l]];for(let t=0;t<o;t++)n[f]=e,f+=s}}function
|
|
2
|
+
import{subtract as e,length as t,scale as f}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as o}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isOrthoNormal as r,hasIdentityRotation as i}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{BufferViewVec4u8 as n,BufferViewVec4f as s,BufferViewFloat as c,BufferViewVec2i16 as l,BufferViewVec2f16 as d,BufferViewVec2f as u,BufferViewVec3f as a}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as p}from"../../lib/Util.js";function g(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c)i[f]=o[r[c]],f+=n}function y(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l)n[f]=r[i[l]],f+=s;else for(let l=0;l<c;++l){const e=r[i[l]];for(let t=0;t<o;t++)n[f]=e,f+=s}}function B(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c)i[f]=o[r[c]],f+=n}function b(e,t,f){const{data:o,stride:r,indices:i}=e,n=i.length;for(let s=0;s<n;++s)t.set(f+s,o[r*i[s]])}function h(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=2*r[c];i[f]=o[e],i[f+1]=o[e+1],f+=n}}function m(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l){const e=3*i[l];n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],f+=s}else for(let l=0;l<c;++l){const e=3*i[l];for(let t=0;t<o;++t)n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],f+=s}}function v(e,t,f,o=1){const{data:r,indices:i}=e,n=t.typedBuffer,s=t.typedBufferStride,c=i.length;if(f*=s,1===o)for(let l=0;l<c;++l){const e=4*i[l];n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],n[f+3]=r[e+3],f+=s}else for(let l=0;l<c;++l){const e=4*i[l];for(let t=0;t<o;++t)n[f]=r[e],n[f+1]=r[e+1],n[f+2]=r[e+2],n[f+3]=r[e+3],f+=s}}function S(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride,i=e.elementCount;t*=r;for(let n=0;n<f;++n){for(let e=0;e<i;++e)o[t+e]=0;t+=r}}function F(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=9*r[c];for(let t=0;t<9;++t)i[f+t]=o[e+t];f+=n}}function z(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length;f*=n;for(let c=0;c<s;++c){const e=16*r[c];for(let t=0;t<16;++t)i[f+t]=o[e+t];f+=n}}function w(e,t,f,o,r=1){if(!t)return void m(e,f,o,r);const{data:n,indices:s}=e,c=f.typedBuffer,l=f.typedBufferStride,d=s.length,u=t[0],a=t[1],p=t[2],g=t[4],y=t[5],B=t[6],b=t[8],h=t[9],v=t[10],S=t[12],F=t[13],z=t[14];o*=l;let w=0,k=0,N=0;const $=i(t)?e=>{w=n[e]+S,k=n[e+1]+F,N=n[e+2]+z}:e=>{const t=n[e],f=n[e+1],o=n[e+2];w=u*t+g*f+b*o+S,k=a*t+y*f+h*o+F,N=p*t+B*f+v*o+z};if(1===r)for(let i=0;i<d;++i)$(3*s[i]),c[o]=w,c[o+1]=k,c[o+2]=N,o+=l;else for(let i=0;i<d;++i){$(3*s[i]);for(let e=0;e<r;++e)c[o]=w,c[o+1]=k,c[o+2]=N,o+=l}}function k(e,t,f,o,n=1){if(!t)return void m(e,f,o,n);const{data:s,indices:c}=e,l=t,d=f.typedBuffer,u=f.typedBufferStride,a=c.length,p=l[0],g=l[1],y=l[2],B=l[4],b=l[5],h=l[6],v=l[8],S=l[9],F=l[10],z=!r(l),w=1e-6,k=1-w;o*=u;let N=0,$=0,x=0;const M=i(l)?e=>{N=s[e],$=s[e+1],x=s[e+2]}:e=>{const t=s[e],f=s[e+1],o=s[e+2];N=p*t+B*f+v*o,$=g*t+b*f+S*o,x=y*t+h*f+F*o};if(1===n)if(z)for(let r=0;r<a;++r){M(3*c[r]);const e=N*N+$*$+x*x;if(e<k&&e>w){const t=1/Math.sqrt(e);d[o]=N*t,d[o+1]=$*t,d[o+2]=x*t}else d[o]=N,d[o+1]=$,d[o+2]=x;o+=u}else for(let r=0;r<a;++r)M(3*c[r]),d[o]=N,d[o+1]=$,d[o+2]=x,o+=u;else for(let r=0;r<a;++r){if(M(3*c[r]),z){const e=N*N+$*$+x*x;if(e<k&&e>w){const t=1/Math.sqrt(e);N*=t,$*=t,x*=t}}for(let e=0;e<n;++e)d[o]=N,d[o+1]=$,d[o+2]=x,o+=u}}function N(e,t,f,o,i=1){if(!t)return void v(e,f,o,i);const{data:n,indices:s}=e,c=t,l=f.typedBuffer,d=f.typedBufferStride,u=s.length,a=c[0],p=c[1],g=c[2],y=c[4],B=c[5],b=c[6],h=c[8],m=c[9],S=c[10],F=!r(c),z=1e-6,w=1-z;if(o*=d,1===i)for(let r=0;r<u;++r){const e=4*s[r],t=n[e],f=n[e+1],i=n[e+2],c=n[e+3];let u=a*t+y*f+h*i,v=p*t+B*f+m*i,k=g*t+b*f+S*i;if(F){const e=u*u+v*v+k*k;if(e<w&&e>z){const t=1/Math.sqrt(e);u*=t,v*=t,k*=t}}l[o]=u,l[o+1]=v,l[o+2]=k,l[o+3]=c,o+=d}else for(let r=0;r<u;++r){const e=4*s[r],t=n[e],f=n[e+1],c=n[e+2],u=n[e+3];let v=a*t+y*f+h*c,k=p*t+B*f+m*c,N=g*t+b*f+S*c;if(F){const e=v*v+k*k+N*N;if(e<w&&e>z){const t=1/Math.sqrt(e);v*=t,k*=t,N*=t}}for(let r=0;r<i;++r)l[o]=v,l[o+1]=k,l[o+2]=N,l[o+3]=u,o+=d}}function $(e,t,f,o,r=1){const{data:i,indices:n}=e,s=f.typedBuffer,c=f.typedBufferStride,l=n.length;if(o*=c,t===i.length&&4===t){s[o]=i[0],s[o+1]=i[1],s[o+2]=i[2],s[o+3]=i[3];const e=new Uint32Array(f.typedBuffer.buffer,f.start),t=c/4,n=e[o/=4];o+=t;const d=l*r;for(let f=1;f<d;++f)e[o]=n,o+=t;return}if(1!==r)if(4!==t)for(let d=0;d<l;++d){const e=3*n[d];for(let t=0;t<r;++t)s[o]=i[e],s[o+1]=i[e+1],s[o+2]=i[e+2],s[o+3]=255,o+=c}else for(let d=0;d<l;++d){const e=4*n[d];for(let t=0;t<r;++t)s[o]=i[e],s[o+1]=i[e+1],s[o+2]=i[e+2],s[o+3]=i[e+3],o+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*n[e];s[o]=i[t],s[o+1]=i[t+1],s[o+2]=i[t+2],s[o+3]=i[t+3],o+=c}return}for(let e=0;e<l;++e){const t=3*n[e];s[o]=i[t],s[o+1]=i[t+1],s[o+2]=i[t+2],s[o+3]=255,o+=c}}}function x(e,t,f){const{data:o,indices:r}=e,i=t.typedBuffer,n=t.typedBufferStride,s=r.length,c=o[0];f*=n;for(let l=0;l<s;++l)i[f]=c,f+=n}function M(o,r,i,n){e(j,o,r);const s=Math.max(Math.sqrt(t(j)),1e-4);f(j,j,1/s),i[n++]=j[0],i[n++]=j[1],i[n++]=j[2],i[n++]=s}const j=o();function q(e,t,f,o,r=1){const i=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===r)for(let s=0;s<f;++s)i[o]=e[0],i[o+1]=e[1],i[o+2]=e[2],i[o+3]=e[3],o+=n;else for(let s=0;s<f;++s)for(let t=0;t<r;++t)i[o]=e[0],i[o+1]=e[1],i[o+2]=e[2],i[o+3]=e[3],o+=n}function A(e,t,f,o,r,i){const{buffer:s,offset:c}=i;for(const l of f.fields.keys()){const f=e.get(l),i=f?.indices;if(f&&i)C(l,f,o,r,s,c);else if("olidColor"===l&&null!=t){const f=e.get("position")?.indices;if(f){const e=f.length;q(t,s.getField(l,n),e,c)}}}}function C(e,t,f,o,r,i){switch(e){case"position":{p(3===t.size);const o=r.getField(e,a);p(!!o,`No buffer view for ${e}`),w(t,f,o,i);break}case"normal":{p(3===t.size);const f=r.getField(e,a);p(!!f,`No buffer view for ${e}`),k(t,o,f,i);break}case"normalCompressed":case"profileRight":case"profileUp":{p(2===t.size);const f=r.getField(e,l);p(!!f,`No buffer view for ${e}`),h(t,f,i);break}case"uv0":{p(2===t.size);const f=r.getField(e,d)??r.getField(e,u);p(!!f,`No buffer view for ${e}`),h(t,f,i);break}case"uvi":{p(2===t.size);const f=r.getField(e,l);p(!!f,`No buffer view for ${e}`),h(t,f,i);break}case"color":case"symbolColor":{const f=r.getField(e,n);p(!!f,`No buffer view for ${e}`),p(3===t.size||4===t.size),$(t,t.size,f,i);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const f=r.getField(e,c)??r.getField(e,c);p(!!f,`No buffer view for ${e}`),p(1===t.size),x(t,f,i);break}case"tangent":{p(4===t.size);const o=r.getField(e,s);p(!!o,`No buffer view for ${e}`),N(t,f,o,i);break}}}function U(e,t,f,o){const{data:r,stride:i,size:n,indices:s}=e;p(1===n,"Index should be 1D");const c=s.length;for(let l=0;l<c;++l){const e=r[i*s[l]];t.set(f+l,o+e)}}function D(e,t,f,o){for(let r=0;r<o;++r)e.set(t+r,f)}export{C as writeAttribute,A as writeAttributes,y as writeBufferFloat,g as writeBufferFloat16,B as writeBufferInt16,F as writeBufferMat3f,z as writeBufferMat4f,b as writeBufferUint32,h as writeBufferVec2,m as writeBufferVec3,v as writeBufferVec4,S as writeBufferZeros,$ as writeColor,D as writeConstTextureElementIndex,M as writeDeltaF16Vector,k as writeNormal,q as writeOlidColor,w as writePosition,N as writeTangent,U as writeTextureElementIndex,x as writeVVFeatureAttribute};
|
|
@@ -1,2 +1,19 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{glsl as
|
|
2
|
+
import{glsl as e}from"../core/shaderModules/glsl.js";function a(e,a){r(e,!a.useFloatBlend)}function l(e){r(e,!0)}function o(a){a.code.add(e`float analiticalBlueNoiseDitherValue(vec2 pixel, float frame, vec2 axis, float phase) {
|
|
3
|
+
float scroll = 5.588238 * mod(frame, 512.0);
|
|
4
|
+
vec2 p = pixel + vec2(scroll);
|
|
5
|
+
vec2 rotated = vec2(
|
|
6
|
+
axis.x * p.x + axis.y * p.y,
|
|
7
|
+
-axis.y * p.x + axis.x * p.y
|
|
8
|
+
);
|
|
9
|
+
return fract(52.9829189 * fract(0.06711056 * rotated.x + 0.00583715 * rotated.y + phase));
|
|
10
|
+
}
|
|
11
|
+
vec4 analiticalBlueNoiseDither(vec2 pixel, float frame) {
|
|
12
|
+
vec4 value = vec4(
|
|
13
|
+
analiticalBlueNoiseDitherValue(pixel, frame, vec2(0.9659258, 0.25881904), 0.0),
|
|
14
|
+
analiticalBlueNoiseDitherValue(pixel, frame, vec2(0.70710677, 0.70710677), 0.17),
|
|
15
|
+
analiticalBlueNoiseDitherValue(pixel, frame, vec2(0.25881904, 0.9659258), 0.37),
|
|
16
|
+
analiticalBlueNoiseDitherValue(pixel, frame, vec2(1.0, 0.0), 0.61)
|
|
17
|
+
);
|
|
18
|
+
return value * 2.0 - 1.0;
|
|
19
|
+
}`)}function r(a,l){l?a.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }"):a.code.add(e`float ditherNoise(vec4 color) { return 0.0; }`)}export{o as analiticalBlueNoiseDither,a as ditherNoise,l as ditherNoiseUnconditional};
|
package/views/PopupView.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type Graphic from "../Graphic.js";
|
|
2
2
|
import type Popup from "../widgets/Popup.js";
|
|
3
3
|
import type { AbortOptions } from "../core/promiseUtils.js";
|
|
4
|
-
import type { ScreenPoint } from "../core/types.js";
|
|
4
|
+
import type { ScreenPoint, ScreenRect } from "../core/types.js";
|
|
5
5
|
import type { PointerType } from "./input/types.js";
|
|
6
6
|
import type { PopupProperties } from "../widgets/Popup.js";
|
|
7
7
|
import type { PopupOpenOptions } from "../widgets/Popup/types.js";
|
|
@@ -127,7 +127,7 @@ export abstract class PopupView {
|
|
|
127
127
|
* an end user's click location. This method allows a developer to
|
|
128
128
|
* control how the input location is handled, and then subsequently, what to do with the results.
|
|
129
129
|
*
|
|
130
|
-
* @param
|
|
130
|
+
* @param hitTarget
|
|
131
131
|
* @param options
|
|
132
132
|
* @returns An async generator of features ready to be displayed by the popup,
|
|
133
133
|
* with the attributes and geometry required by their popup template.
|
|
@@ -173,7 +173,7 @@ export abstract class PopupView {
|
|
|
173
173
|
* console.log(`top most feature`, feature);
|
|
174
174
|
* });
|
|
175
175
|
*/
|
|
176
|
-
fetchPopupFeatures(
|
|
176
|
+
fetchPopupFeatures(hitTarget: ScreenPoint | ScreenRect, options?: FetchPopupFeaturesOptions): AsyncGenerator<Graphic>;
|
|
177
177
|
/**
|
|
178
178
|
* Opens the popup at the given location with content defined either explicitly with `content`
|
|
179
179
|
* or driven from the [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) of input features. This method sets
|
package/views/PopupView.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as p}from"tslib";import{createTask as e}from"../core/asyncUtils.js";import t from"../core/Error.js";import{generatorFlat as o,generatorFromPromises as s}from"../core/generatorUtils.js";import has from"../core/has.js";import i from"../core/Logger.js";import{
|
|
2
|
+
import{__decorate as p}from"tslib";import{createTask as e}from"../core/asyncUtils.js";import t from"../core/Error.js";import{generatorFlat as o,generatorFromPromises as s}from"../core/generatorUtils.js";import has from"../core/has.js";import i from"../core/Logger.js";import{allSettledValues as r,throwIfAborted as u,wrapAbortWithTimeout as n}from"../core/promiseUtils.js";import{watch as a,syncAndInitial as h,whenOnce as c}from"../core/reactiveUtils.js";import{property as l,subclass as m}from"../core/accessorSupport/decorators.js";import{addPopup as d,openPopupWithViewClick as f,isPopup as g,isPopupElement as w,openPopupWithOptions as y,closePopup as P}from"./popupAdapter.js";import{ViewEventPriorities as E}from"./input/InputManager.js";const _=_=>{const T=_;let j=class extends T{constructor(...p){super(...p),this._popupSetupTask=null,this.popupEnabled=!0,this.popup={}}initialize(){this.addHandles([a(()=>[this.ui,this.popup,this.popupElement],([p,e,t],o)=>{const[s,i,r]=o??[];d(this,[p,e,t],[s,i,r])},h),this.on("click",p=>{this.popup&&this.popupEnabled&&("mouse"!==p.pointerType||0===p.button)&&f(this,p)},E.WIDGET)]),c(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>import("../widgets/Popup.js"))}destroy(){this.destroyed||this.closePopup()}get popup(){return this._get("popup")}set popup(p){this._set("popup",p)}async openPopup(p){if(g(this.popup))return this.popup.open(p);if(this.popupElement&&w(this.popupElement))this.popupElement.open(p).catch(()=>{});else try{if(await this.setupPopup(),!this.popup)return void i.getLogger(this).error(new t("view:null-popup","Popup is null and can't be opened"));y(this,p)}catch{}}closePopup(){this._popupSetupTask?.abort(),P(this.popup,this.popupElement)}async*fetchPopupFeatures(p,e){await this.when();const t=await this._getPopupHits(p,e),i=this._popupHitsToFeatures(p,t.hits,e);yield*o(s(i,e),e)}async fetchPopupFeaturesLegacy(p,e){await this.when();const t=await this._getPopupHits(p,e),o=this._popupHitsToFeatures(p,t.hits,e);return{pendingFeatures:o,allGraphicsPromise:r(o).then(p=>p.filter(p=>!!p).flat()),location:t.location}}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!g(this.popup))return this._popupSetupTask=e(async p=>{if(!this.popupEnabled||!w(this.popupElement))if(this.dependencies.popup&&"function"==typeof this.dependencies.popup)await this.dependencies.popup(),u(p),customElements.get("arcgis-popup")||i.getLogger(this).error(new t("view:undefined-popup-element","`arcgis-popup` custom element is undefined and can't be opened")),this.popupElement=document.createElement("arcgis-popup");else{const{default:e}=await import("../widgets/Popup.js");if(u(p),!this.popup||g(this.popup))return;const t=this.popup;if("open"in t||"close"in t){const{open:p,close:o,...s}=t;this.popup=new e({...s})}else this.popup=new e(t)}}),this._popupSetupTask.promise}_popupHitsToFeatures(p,e,t){const o=[],s=[];let i=!1;const r=n(t,has("popup-view-fetch-timeout")??V),u=p=>{const e=new v(p);return s.push(e),o.push(e.promise),e},a=p=>{const e=s.at(-1);return e&&e.layerView===p&&!i?e:u(p)};for(const n of e)if("graphic"in n){a(n.layerView).graphics.push(n.graphic),i=!1}else o.push(n.layerView.fetchPopupFeaturesAtTarget(p,n.geometry,r)),i=!0;return s.forEach(p=>p.resolve(r)),o}async _getPopupHits(p,e){const{hits:t,location:o}=await this.popupHitTest(p);u(e);const s=[];for(const i of t)if("graphic"in i){if(this._isValidPopupGraphic(i.graphic,e)){const p=this._isFeaturePatchingLayerView(i.layerView)?i.layerView:void 0;s.push({graphic:i.graphic,layerView:p})}}else s.push({geometry:i.geometry,layerView:i.layerView});return{hits:s,location:o}}_isValidPopupGraphic(p,e){return p&&!!p.getEffectivePopupTemplate(e?.defaultPopupTemplateEnabled)}_isFeaturePatchingLayerView(p){return!p||(!("layer"in p)||!p.suspended)&&"patchFeaturesForPopup"in p}};return p([l()],j.prototype,"popup",null),p([l()],j.prototype,"popupElement",void 0),p([l()],j.prototype,"popupEnabled",void 0),j=p([m("esri.views.PopupView")],j),j};class v{constructor(p){this.layerView=p,this._resolver=Promise.withResolvers(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(p){const{layerView:e,graphics:t,_resolver:o}=this;if(!e)return o.resolve(t),o.promise;let s;return e.patchFeaturesForPopup(t,p).catch(p=>(s=p,null)).then(p=>{p?o.resolve(p):o.reject(s)}),o.promise}}const V=5e3;export{_ as PopupView};
|