@babylonjs/core 7.43.0 → 7.44.1
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/Actions/actionEvent.d.ts +4 -4
- package/Buffers/bufferUtils.d.ts +8 -1
- package/Buffers/bufferUtils.js +15 -0
- package/Buffers/bufferUtils.js.map +1 -1
- package/Culling/Helper/boundingInfoHelper.d.ts +2 -9
- package/Culling/Helper/boundingInfoHelper.js +2 -9
- package/Culling/Helper/boundingInfoHelper.js.map +1 -1
- package/Debug/debugLayer.d.ts +4 -0
- package/Debug/debugLayer.js +9 -0
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +2 -4
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +2 -4
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/abstractEngine.d.ts +19 -1
- package/Engines/abstractEngine.js +48 -9
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.d.ts +6 -3
- package/Engines/engine.js +2 -20
- package/Engines/engine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +2 -2
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +1 -5
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +1 -0
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +1 -1
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +16 -12
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +63 -27
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.d.ts +72 -0
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +197 -0
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +42 -0
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +78 -0
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.d.ts +3 -19
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +3 -49
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.d.ts +3 -19
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +3 -49
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.d.ts +3 -19
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +3 -49
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.d.ts +2 -17
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +3 -45
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.d.ts +2 -17
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +3 -44
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.d.ts +3 -19
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +3 -49
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.d.ts +47 -0
- package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.js +65 -0
- package/FrameGraph/Node/Blocks/PostProcesses/passPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +4 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +9 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +2 -0
- package/FrameGraph/Node/Blocks/index.js +2 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +2 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.d.ts +3 -2
- package/FrameGraph/Node/nodeRenderGraph.js +4 -3
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlock.js +4 -4
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +8 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +10 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.d.ts +21 -0
- package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.js +31 -0
- package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.js.map +1 -0
- package/FrameGraph/Passes/pass.d.ts +1 -0
- package/FrameGraph/Passes/pass.js +4 -1
- package/FrameGraph/Passes/pass.js.map +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +81 -0
- package/FrameGraph/Tasks/Layers/baseLayerTask.js +304 -0
- package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -0
- package/FrameGraph/Tasks/Layers/glowLayerTask.d.ts +3 -40
- package/FrameGraph/Tasks/Layers/glowLayerTask.js +4 -158
- package/FrameGraph/Tasks/Layers/glowLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/Layers/highlightLayerTask.d.ts +21 -0
- package/FrameGraph/Tasks/Layers/highlightLayerTask.js +32 -0
- package/FrameGraph/Tasks/Layers/highlightLayerTask.js.map +1 -0
- package/FrameGraph/Tasks/Misc/executeTask.d.ts +2 -2
- package/FrameGraph/Tasks/Misc/executeTask.js +1 -0
- package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +5 -4
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +5 -4
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +2 -4
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/passTask.d.ts +29 -0
- package/FrameGraph/Tasks/PostProcesses/passTask.js +31 -0
- package/FrameGraph/Tasks/PostProcesses/passTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +4 -2
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +2 -2
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +1 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.d.ts +2 -2
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +1 -0
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +2 -2
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +1 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +8 -2
- package/FrameGraph/frameGraph.js +31 -5
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +10 -0
- package/FrameGraph/frameGraphRenderContext.js +14 -0
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/frameGraphTask.d.ts +3 -2
- package/FrameGraph/frameGraphTask.js +12 -2
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.d.ts +1 -1
- package/FrameGraph/frameGraphTypes.d.ts +4 -0
- package/FrameGraph/frameGraphTypes.js.map +1 -1
- package/FrameGraph/index.d.ts +2 -0
- package/FrameGraph/index.js +2 -0
- package/FrameGraph/index.js.map +1 -1
- package/Gizmos/planeRotationGizmo.js +10 -0
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Helpers/environmentHelper.js +7 -6
- package/Helpers/environmentHelper.js.map +1 -1
- package/Inputs/scene.inputManager.js +2 -2
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayer.d.ts +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.d.ts +2 -14
- package/Layers/glowLayer.js +34 -36
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +13 -74
- package/Layers/highlightLayer.js +123 -309
- package/Layers/highlightLayer.js.map +1 -1
- package/Layers/index.d.ts +1 -0
- package/Layers/index.js +1 -0
- package/Layers/index.js.map +1 -1
- package/Layers/thinEffectLayer.d.ts +55 -2
- package/Layers/thinEffectLayer.js +66 -0
- package/Layers/thinEffectLayer.js.map +1 -1
- package/Layers/thinGlowLayer.d.ts +3 -6
- package/Layers/thinGlowLayer.js +4 -1
- package/Layers/thinGlowLayer.js.map +1 -1
- package/Layers/thinHighlightLayer.d.ts +197 -0
- package/Layers/thinHighlightLayer.js +417 -0
- package/Layers/thinHighlightLayer.js.map +1 -0
- package/Materials/GreasedLine/greasedLinePluginMaterial.d.ts +6 -2
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +8 -2
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js +11 -3
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.d.ts +1 -0
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js +1 -0
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +1 -3
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +3 -3
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +4 -2
- package/Materials/Node/nodeMaterial.js +9 -6
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +1 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js +1 -0
- package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.d.ts +69 -0
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +187 -0
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -0
- package/Materials/Textures/hdrCubeTexture.d.ts +5 -1
- package/Materials/Textures/hdrCubeTexture.js +29 -3
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/index.d.ts +4 -0
- package/Materials/Textures/index.js +4 -0
- package/Materials/Textures/index.js.map +1 -1
- package/Materials/effect.d.ts +5 -0
- package/Materials/effect.js +15 -0
- package/Materials/effect.js.map +1 -1
- package/Materials/standardMaterial.d.ts +1 -2
- package/Materials/standardMaterial.js +0 -2
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/Builders/planeBuilder.js +2 -2
- package/Meshes/Builders/planeBuilder.js.map +1 -1
- package/Meshes/Compression/dracoCodec.d.ts +4 -4
- package/Meshes/Compression/dracoCodec.js.map +1 -1
- package/Meshes/Compression/dracoCompression.d.ts +5 -3
- package/Meshes/Compression/dracoCompression.js +24 -11
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/Compression/dracoCompressionWorker.d.ts +16 -30
- package/Meshes/Compression/dracoCompressionWorker.js +128 -22
- package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
- package/Meshes/Compression/dracoDecoder.d.ts +4 -9
- package/Meshes/Compression/dracoDecoder.js +5 -5
- package/Meshes/Compression/dracoDecoder.js.map +1 -1
- package/Meshes/Compression/dracoDecoder.types.d.ts +52 -0
- package/Meshes/Compression/dracoDecoder.types.js +2 -0
- package/Meshes/Compression/dracoDecoder.types.js.map +1 -0
- package/Meshes/Compression/dracoEncoder.d.ts +95 -0
- package/Meshes/Compression/dracoEncoder.js +245 -0
- package/Meshes/Compression/dracoEncoder.js.map +1 -0
- package/Meshes/Compression/dracoEncoder.types.d.ts +82 -0
- package/Meshes/Compression/dracoEncoder.types.js +2 -0
- package/Meshes/Compression/dracoEncoder.types.js.map +1 -0
- package/Meshes/Compression/index.d.ts +1 -0
- package/Meshes/Compression/index.js +1 -0
- package/Meshes/Compression/index.js.map +1 -1
- package/Meshes/Compression/meshoptCompression.js +17 -2
- package/Meshes/Compression/meshoptCompression.js.map +1 -1
- package/Meshes/Compression/test/integration/draco.test.d.ts +1 -0
- package/Meshes/Compression/test/integration/draco.test.js +30 -0
- package/Meshes/Compression/test/integration/draco.test.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +92 -2
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +286 -10
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.js +4 -2
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +1 -1
- package/Meshes/csg.js +4 -0
- package/Meshes/csg.js.map +1 -1
- package/Meshes/mesh.d.ts +2 -2
- package/Meshes/transformNode.d.ts +4 -1
- package/Meshes/transformNode.js +6 -1
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/copyTextureToTexture.js +1 -1
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/decorators.serialization.js +2 -0
- package/Misc/decorators.serialization.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +1 -1
- package/Misc/logger.d.ts +2 -1
- package/Misc/logger.js +2 -1
- package/Misc/logger.js.map +1 -1
- package/Misc/screenshotTools.js +58 -5
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/tools.d.ts +21 -1
- package/Misc/tools.js +33 -0
- package/Misc/tools.js.map +1 -1
- package/Morph/morphTargetManager.d.ts +1 -0
- package/Morph/morphTargetManager.js +6 -1
- package/Morph/morphTargetManager.js.map +1 -1
- package/Particles/particleHelper.js +2 -1
- package/Particles/particleHelper.js.map +1 -1
- package/Particles/particleSystemSet.d.ts +1 -0
- package/Particles/particleSystemSet.js +1 -0
- package/Particles/particleSystemSet.js.map +1 -1
- package/Particles/pointsCloudSystem.d.ts +3 -3
- package/Particles/webgl2ParticleSystem.d.ts +1 -1
- package/Particles/webgl2ParticleSystem.js +1 -2
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/Physics/v2/Plugins/havokPlugin.d.ts +2 -2
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/index.d.ts +1 -0
- package/PostProcesses/index.js +1 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/passPostProcess.d.ts +2 -3
- package/PostProcesses/passPostProcess.js +36 -48
- package/PostProcesses/passPostProcess.js.map +1 -1
- package/PostProcesses/thinPassPostProcess.d.ts +48 -0
- package/PostProcesses/thinPassPostProcess.js +113 -0
- package/PostProcesses/thinPassPostProcess.js.map +1 -0
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
- package/Rendering/depthRenderer.js +1 -1
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/iblCdfGenerator.d.ts +13 -5
- package/Rendering/iblCdfGenerator.js +67 -10
- package/Rendering/iblCdfGenerator.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +5 -3
- package/Rendering/objectRenderer.js +5 -3
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/renderingManager.d.ts +4 -0
- package/Rendering/renderingManager.js +1 -0
- package/Rendering/renderingManager.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js +6 -6
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/ShadersInclude/intersectionFunctions.d.ts +5 -0
- package/Shaders/ShadersInclude/intersectionFunctions.js +14 -0
- package/Shaders/ShadersInclude/intersectionFunctions.js.map +1 -0
- package/Shaders/ShadersInclude/pbrBlockReflection.js +13 -8
- package/Shaders/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/Shaders/background.fragment.d.ts +1 -0
- package/Shaders/background.fragment.js +3 -5
- package/Shaders/background.fragment.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +2 -1
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/hdrIrradianceFiltering.fragment.d.ts +9 -0
- package/Shaders/hdrIrradianceFiltering.fragment.js +25 -0
- package/Shaders/hdrIrradianceFiltering.fragment.js.map +1 -0
- package/Shaders/hdrIrradianceFiltering.vertex.d.ts +5 -0
- package/Shaders/hdrIrradianceFiltering.vertex.js +15 -0
- package/Shaders/hdrIrradianceFiltering.vertex.js.map +1 -0
- package/Shaders/pbr.fragment.js +1 -3
- package/Shaders/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/intersectionFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/intersectionFunctions.js +14 -0
- package/ShadersWGSL/ShadersInclude/intersectionFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +13 -8
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/ShadersWGSL/background.fragment.d.ts +1 -0
- package/ShadersWGSL/background.fragment.js +3 -5
- package/ShadersWGSL/background.fragment.js.map +1 -1
- package/ShadersWGSL/greasedLine.fragment.js +9 -3
- package/ShadersWGSL/greasedLine.fragment.js.map +1 -1
- package/ShadersWGSL/greasedLine.vertex.js +12 -2
- package/ShadersWGSL/greasedLine.vertex.js.map +1 -1
- package/ShadersWGSL/hdrIrradianceFiltering.fragment.d.ts +9 -0
- package/ShadersWGSL/hdrIrradianceFiltering.fragment.js +26 -0
- package/ShadersWGSL/hdrIrradianceFiltering.fragment.js.map +1 -0
- package/ShadersWGSL/hdrIrradianceFiltering.vertex.d.ts +5 -0
- package/ShadersWGSL/hdrIrradianceFiltering.vertex.js +16 -0
- package/ShadersWGSL/hdrIrradianceFiltering.vertex.js.map +1 -0
- package/ShadersWGSL/outline.fragment.js +1 -1
- package/ShadersWGSL/outline.fragment.js.map +1 -1
- package/ShadersWGSL/passCube.fragment.js +1 -1
- package/ShadersWGSL/passCube.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +1 -3
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/XR/features/WebXRDepthSensing.d.ts +24 -2
- package/XR/features/WebXRDepthSensing.js +320 -26
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +8 -7
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +9 -5
- package/scene.js.map +1 -1
- package/types.d.ts +4 -0
- package/types.js.map +1 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { __decorate } from "../../../../tslib.es6.js";
|
|
2
|
+
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
|
|
3
|
+
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
4
|
+
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export class NodeRenderGraphBasePostProcessBlock extends NodeRenderGraphBlock {
|
|
9
|
+
/**
|
|
10
|
+
* Create a new NodeRenderGraphBasePostProcessBlock
|
|
11
|
+
* @param name defines the block name
|
|
12
|
+
* @param frameGraph defines the hosting frame graph
|
|
13
|
+
* @param scene defines the hosting scene
|
|
14
|
+
*/
|
|
15
|
+
constructor(name, frameGraph, scene) {
|
|
16
|
+
super(name, frameGraph, scene);
|
|
17
|
+
this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
18
|
+
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
19
|
+
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
20
|
+
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
21
|
+
}
|
|
22
|
+
_finalizeInputOutputRegistering() {
|
|
23
|
+
this._addDependenciesInput();
|
|
24
|
+
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
25
|
+
this.output._typeConnectionSource = () => {
|
|
26
|
+
return this.destination.isConnected ? this.destination : this.source;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** Sampling mode used to sample from the source texture */
|
|
30
|
+
get sourceSamplingMode() {
|
|
31
|
+
return this._frameGraphTask.sourceSamplingMode;
|
|
32
|
+
}
|
|
33
|
+
set sourceSamplingMode(value) {
|
|
34
|
+
this._frameGraphTask.sourceSamplingMode = value;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Gets the source input component
|
|
38
|
+
*/
|
|
39
|
+
get source() {
|
|
40
|
+
return this._inputs[0];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Gets the destination input component
|
|
44
|
+
*/
|
|
45
|
+
get destination() {
|
|
46
|
+
return this._inputs[1];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Gets the output component
|
|
50
|
+
*/
|
|
51
|
+
get output() {
|
|
52
|
+
return this._outputs[0];
|
|
53
|
+
}
|
|
54
|
+
_buildBlock(state) {
|
|
55
|
+
super._buildBlock(state);
|
|
56
|
+
this.output.value = this._frameGraphTask.outputTexture;
|
|
57
|
+
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
58
|
+
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
59
|
+
}
|
|
60
|
+
_dumpPropertiesCode() {
|
|
61
|
+
const codes = [];
|
|
62
|
+
codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
|
|
63
|
+
return super._dumpPropertiesCode() + codes.join("\n");
|
|
64
|
+
}
|
|
65
|
+
serialize() {
|
|
66
|
+
const serializationObject = super.serialize();
|
|
67
|
+
serializationObject.sourceSamplingMode = this.sourceSamplingMode;
|
|
68
|
+
return serializationObject;
|
|
69
|
+
}
|
|
70
|
+
_deserialize(serializationObject) {
|
|
71
|
+
super._deserialize(serializationObject);
|
|
72
|
+
this.sourceSamplingMode = serializationObject.sourceSamplingMode;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
__decorate([
|
|
76
|
+
editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
|
|
77
|
+
], NodeRenderGraphBasePostProcessBlock.prototype, "sourceSamplingMode", null);
|
|
78
|
+
//# sourceMappingURL=basePostProcessBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basePostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AAStG;;GAEG;AACH,MAAM,OAAO,mCAAoC,SAAQ,oBAAoB;IAGzE;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,wCAAwC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAE1F,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,wCAAwC,CAAC,uBAAuB,CAAC,CAAC;QAC9G,IAAI,CAAC,WAAW,CAAC,+BAA+B,CAAC,wCAAwC,CAAC,UAAU,CAAC,CAAC;IAC1G,CAAC;IAES,+BAA+B;QACrC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7B,IAAI,CAA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C,kBAAkB,GAAG,CAAC,CAAC;QACzF,OAAO,KAAK,CAAC,mBAAmB,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEe,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC9C,mBAAmB,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;QACjE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;IACrE,CAAC;CACJ;AAtDG;IADC,sBAAsB,CAAC,sBAAsB,+CAAuC,YAAY,CAAC;6EAGjG","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, FrameGraphTask } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\n\r\ninterface IPostProcessLike {\r\n sourceSamplingMode: number;\r\n sourceTexture: FrameGraphTextureHandle;\r\n destinationTexture?: FrameGraphTextureHandle;\r\n outputTexture: FrameGraphTextureHandle;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class NodeRenderGraphBasePostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: IPostProcessLike & FrameGraphTask;\r\n\r\n /**\r\n * Create a new NodeRenderGraphBasePostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n }\r\n\r\n protected _finalizeInputOutputRegistering() {\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
|
|
1
|
+
import type { Scene, FrameGraph } from "../../../../index.js";
|
|
3
2
|
import { FrameGraphBlackAndWhiteTask } from "../../../Tasks/PostProcesses/blackAndWhiteTask.js";
|
|
3
|
+
import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock";
|
|
4
4
|
/**
|
|
5
5
|
* Block that implements the black and white post process
|
|
6
6
|
*/
|
|
7
|
-
export declare class NodeRenderGraphBlackAndWhitePostProcessBlock extends
|
|
7
|
+
export declare class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
|
|
8
8
|
protected _frameGraphTask: FrameGraphBlackAndWhiteTask;
|
|
9
9
|
/**
|
|
10
10
|
* Gets the frame graph task associated with this block
|
|
@@ -17,9 +17,6 @@ export declare class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRe
|
|
|
17
17
|
* @param scene defines the hosting scene
|
|
18
18
|
*/
|
|
19
19
|
constructor(name: string, frameGraph: FrameGraph, scene: Scene);
|
|
20
|
-
/** Sampling mode used to sample from the source texture */
|
|
21
|
-
get sourceSamplingMode(): number;
|
|
22
|
-
set sourceSamplingMode(value: number);
|
|
23
20
|
/** Degree of conversion to black and white (default: 1 - full b&w conversion) */
|
|
24
21
|
get degree(): number;
|
|
25
22
|
set degree(value: number);
|
|
@@ -28,19 +25,6 @@ export declare class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRe
|
|
|
28
25
|
* @returns the class name
|
|
29
26
|
*/
|
|
30
27
|
getClassName(): string;
|
|
31
|
-
/**
|
|
32
|
-
* Gets the source input component
|
|
33
|
-
*/
|
|
34
|
-
get source(): NodeRenderGraphConnectionPoint;
|
|
35
|
-
/**
|
|
36
|
-
* Gets the destination input component
|
|
37
|
-
*/
|
|
38
|
-
get destination(): NodeRenderGraphConnectionPoint;
|
|
39
|
-
/**
|
|
40
|
-
* Gets the output component
|
|
41
|
-
*/
|
|
42
|
-
get output(): NodeRenderGraphConnectionPoint;
|
|
43
|
-
protected _buildBlock(state: NodeRenderGraphBuildState): void;
|
|
44
28
|
protected _dumpPropertiesCode(): string;
|
|
45
29
|
serialize(): any;
|
|
46
30
|
_deserialize(serializationObject: any): void;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { __decorate } from "../../../../tslib.es6.js";
|
|
2
|
-
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
|
|
3
2
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
|
-
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
5
3
|
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
6
4
|
import { FrameGraphBlackAndWhiteTask } from "../../../Tasks/PostProcesses/blackAndWhiteTask.js";
|
|
7
5
|
import { ThinBlackAndWhitePostProcess } from "../../../../PostProcesses/thinBlackAndWhitePostProcess.js";
|
|
6
|
+
import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock.js";
|
|
8
7
|
/**
|
|
9
8
|
* Block that implements the black and white post process
|
|
10
9
|
*/
|
|
11
|
-
export class NodeRenderGraphBlackAndWhitePostProcessBlock extends
|
|
10
|
+
export class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
|
|
12
11
|
/**
|
|
13
12
|
* Gets the frame graph task associated with this block
|
|
14
13
|
*/
|
|
@@ -23,24 +22,9 @@ export class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGrap
|
|
|
23
22
|
*/
|
|
24
23
|
constructor(name, frameGraph, scene) {
|
|
25
24
|
super(name, frameGraph, scene);
|
|
26
|
-
this.
|
|
27
|
-
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
28
|
-
this._addDependenciesInput();
|
|
29
|
-
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
30
|
-
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
31
|
-
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
32
|
-
this.output._typeConnectionSource = () => {
|
|
33
|
-
return this.destination.isConnected ? this.destination : this.source;
|
|
34
|
-
};
|
|
25
|
+
this._finalizeInputOutputRegistering();
|
|
35
26
|
this._frameGraphTask = new FrameGraphBlackAndWhiteTask(this.name, frameGraph, new ThinBlackAndWhitePostProcess(name, scene.getEngine()));
|
|
36
27
|
}
|
|
37
|
-
/** Sampling mode used to sample from the source texture */
|
|
38
|
-
get sourceSamplingMode() {
|
|
39
|
-
return this._frameGraphTask.sourceSamplingMode;
|
|
40
|
-
}
|
|
41
|
-
set sourceSamplingMode(value) {
|
|
42
|
-
this._frameGraphTask.sourceSamplingMode = value;
|
|
43
|
-
}
|
|
44
28
|
/** Degree of conversion to black and white (default: 1 - full b&w conversion) */
|
|
45
29
|
get degree() {
|
|
46
30
|
return this._frameGraphTask.postProcess.degree;
|
|
@@ -55,51 +39,21 @@ export class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGrap
|
|
|
55
39
|
getClassName() {
|
|
56
40
|
return "NodeRenderGraphBlackAndWhitePostProcessBlock";
|
|
57
41
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Gets the source input component
|
|
60
|
-
*/
|
|
61
|
-
get source() {
|
|
62
|
-
return this._inputs[0];
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Gets the destination input component
|
|
66
|
-
*/
|
|
67
|
-
get destination() {
|
|
68
|
-
return this._inputs[1];
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Gets the output component
|
|
72
|
-
*/
|
|
73
|
-
get output() {
|
|
74
|
-
return this._outputs[0];
|
|
75
|
-
}
|
|
76
|
-
_buildBlock(state) {
|
|
77
|
-
super._buildBlock(state);
|
|
78
|
-
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
79
|
-
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
80
|
-
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
81
|
-
}
|
|
82
42
|
_dumpPropertiesCode() {
|
|
83
43
|
const codes = [];
|
|
84
44
|
codes.push(`${this._codeVariableName}.degree = ${this.degree};`);
|
|
85
|
-
codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
|
|
86
45
|
return super._dumpPropertiesCode() + codes.join("\n");
|
|
87
46
|
}
|
|
88
47
|
serialize() {
|
|
89
48
|
const serializationObject = super.serialize();
|
|
90
49
|
serializationObject.degree = this.degree;
|
|
91
|
-
serializationObject.sourceSamplingMode = this.sourceSamplingMode;
|
|
92
50
|
return serializationObject;
|
|
93
51
|
}
|
|
94
52
|
_deserialize(serializationObject) {
|
|
95
53
|
super._deserialize(serializationObject);
|
|
96
54
|
this.degree = serializationObject.degree;
|
|
97
|
-
this.sourceSamplingMode = serializationObject.sourceSamplingMode;
|
|
98
55
|
}
|
|
99
56
|
}
|
|
100
|
-
__decorate([
|
|
101
|
-
editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
|
|
102
|
-
], NodeRenderGraphBlackAndWhitePostProcessBlock.prototype, "sourceSamplingMode", null);
|
|
103
57
|
__decorate([
|
|
104
58
|
editableInPropertyPage("Degree", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 1 })
|
|
105
59
|
], NodeRenderGraphBlackAndWhitePostProcessBlock.prototype, "degree", null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blackAndWhitePostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"blackAndWhitePostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,2BAA2B,EAAE,0DAA8D;AACpG,OAAO,EAAE,4BAA4B,EAAE,kEAAwD;AAC/F,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,4CAA6C,SAAQ,mCAAmC;IAGjG;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,+BAA+B,EAAE,CAAC;QAEvC,IAAI,CAAC,eAAe,GAAG,IAAI,2BAA2B,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,4BAA4B,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAC7I,CAAC;IAED,iFAAiF;IAEjF,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC;IACnD,CAAC;IAED,IAAW,MAAM,CAAC,KAAa;QAC3B,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,MAAM,GAAG,KAAK,CAAC;IACpD,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,8CAA8C,CAAC;IAC1D,CAAC;IAEkB,mBAAmB;QAClC,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,iBAAiB,aAAa,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QACjE,OAAO,KAAK,CAAC,mBAAmB,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEe,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC9C,mBAAmB,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzC,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAC7C,CAAC;CACJ;AAhCG;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;0EAGhG;AAgCL,aAAa,CAAC,sDAAsD,EAAE,4CAA4C,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Scene, FrameGraph } from \"core/index\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBlackAndWhiteTask } from \"core/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask\";\r\nimport { ThinBlackAndWhitePostProcess } from \"core/PostProcesses/thinBlackAndWhitePostProcess\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the black and white post process\r\n */\r\nexport class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphBlackAndWhiteTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new BlackAndWhitePostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphBlackAndWhiteTask(this.name, frameGraph, new ThinBlackAndWhitePostProcess(name, scene.getEngine()));\r\n }\r\n\r\n /** Degree of conversion to black and white (default: 1 - full b&w conversion) */\r\n @editableInPropertyPage(\"Degree\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 1 })\r\n public get degree(): number {\r\n return this._frameGraphTask.postProcess.degree;\r\n }\r\n\r\n public set degree(value: number) {\r\n this._frameGraphTask.postProcess.degree = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphBlackAndWhitePostProcessBlock\";\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.degree = ${this.degree};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.degree = this.degree;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.degree = serializationObject.degree;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBlackAndWhitePostProcessBlock\", NodeRenderGraphBlackAndWhitePostProcessBlock);\r\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
|
|
1
|
+
import type { Scene, FrameGraph } from "../../../../index.js";
|
|
3
2
|
import { FrameGraphBloomTask } from "../../../Tasks/PostProcesses/bloomTask";
|
|
3
|
+
import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock";
|
|
4
4
|
/**
|
|
5
5
|
* Block that implements the bloom post process
|
|
6
6
|
*/
|
|
7
|
-
export declare class NodeRenderGraphBloomPostProcessBlock extends
|
|
7
|
+
export declare class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
|
|
8
8
|
protected _frameGraphTask: FrameGraphBloomTask;
|
|
9
9
|
/**
|
|
10
10
|
* Gets the frame graph task associated with this block
|
|
@@ -26,9 +26,6 @@ export declare class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGrap
|
|
|
26
26
|
/** If high dynamic range textures should be used */
|
|
27
27
|
get hdr(): boolean;
|
|
28
28
|
set hdr(value: boolean);
|
|
29
|
-
/** Sampling mode used to sample from the source texture */
|
|
30
|
-
get sourceSamplingMode(): number;
|
|
31
|
-
set sourceSamplingMode(value: number);
|
|
32
29
|
/** The luminance threshold to find bright areas of the image to bloom. */
|
|
33
30
|
get threshold(): number;
|
|
34
31
|
set threshold(value: number);
|
|
@@ -43,19 +40,6 @@ export declare class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGrap
|
|
|
43
40
|
* @returns the class name
|
|
44
41
|
*/
|
|
45
42
|
getClassName(): string;
|
|
46
|
-
/**
|
|
47
|
-
* Gets the source input component
|
|
48
|
-
*/
|
|
49
|
-
get source(): NodeRenderGraphConnectionPoint;
|
|
50
|
-
/**
|
|
51
|
-
* Gets the destination input component
|
|
52
|
-
*/
|
|
53
|
-
get destination(): NodeRenderGraphConnectionPoint;
|
|
54
|
-
/**
|
|
55
|
-
* Gets the output component
|
|
56
|
-
*/
|
|
57
|
-
get output(): NodeRenderGraphConnectionPoint;
|
|
58
|
-
protected _buildBlock(state: NodeRenderGraphBuildState): void;
|
|
59
43
|
protected _dumpPropertiesCode(): string;
|
|
60
44
|
serialize(): any;
|
|
61
45
|
_deserialize(serializationObject: any): void;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { __decorate } from "../../../../tslib.es6.js";
|
|
2
|
-
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
|
|
3
2
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
|
-
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
5
3
|
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
6
4
|
import { FrameGraphBloomTask } from "../../../Tasks/PostProcesses/bloomTask.js";
|
|
5
|
+
import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock.js";
|
|
7
6
|
/**
|
|
8
7
|
* Block that implements the bloom post process
|
|
9
8
|
*/
|
|
10
|
-
export class NodeRenderGraphBloomPostProcessBlock extends
|
|
9
|
+
export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
|
|
11
10
|
/**
|
|
12
11
|
* Gets the frame graph task associated with this block
|
|
13
12
|
*/
|
|
@@ -25,15 +24,7 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
|
|
|
25
24
|
constructor(name, frameGraph, scene, hdr = false, bloomScale = 0.5) {
|
|
26
25
|
super(name, frameGraph, scene);
|
|
27
26
|
this._additionalConstructionParameters = [hdr, bloomScale];
|
|
28
|
-
this.
|
|
29
|
-
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
30
|
-
this._addDependenciesInput();
|
|
31
|
-
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
32
|
-
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
33
|
-
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
34
|
-
this.output._typeConnectionSource = () => {
|
|
35
|
-
return this.destination.isConnected ? this.destination : this.source;
|
|
36
|
-
};
|
|
27
|
+
this._finalizeInputOutputRegistering();
|
|
37
28
|
this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, scene.getEngine(), 0.75, 64, 0.2, hdr, bloomScale);
|
|
38
29
|
}
|
|
39
30
|
_createTask(bloomScale, hdr) {
|
|
@@ -60,13 +51,6 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
|
|
|
60
51
|
set hdr(value) {
|
|
61
52
|
this._createTask(this._frameGraphTask.bloom.scale, value);
|
|
62
53
|
}
|
|
63
|
-
/** Sampling mode used to sample from the source texture */
|
|
64
|
-
get sourceSamplingMode() {
|
|
65
|
-
return this._frameGraphTask.sourceSamplingMode;
|
|
66
|
-
}
|
|
67
|
-
set sourceSamplingMode(value) {
|
|
68
|
-
this._frameGraphTask.sourceSamplingMode = value;
|
|
69
|
-
}
|
|
70
54
|
/** The luminance threshold to find bright areas of the image to bloom. */
|
|
71
55
|
get threshold() {
|
|
72
56
|
return this._frameGraphTask.bloom.threshold;
|
|
@@ -95,36 +79,11 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
|
|
|
95
79
|
getClassName() {
|
|
96
80
|
return "NodeRenderGraphBloomPostProcessBlock";
|
|
97
81
|
}
|
|
98
|
-
/**
|
|
99
|
-
* Gets the source input component
|
|
100
|
-
*/
|
|
101
|
-
get source() {
|
|
102
|
-
return this._inputs[0];
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Gets the destination input component
|
|
106
|
-
*/
|
|
107
|
-
get destination() {
|
|
108
|
-
return this._inputs[1];
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Gets the output component
|
|
112
|
-
*/
|
|
113
|
-
get output() {
|
|
114
|
-
return this._outputs[0];
|
|
115
|
-
}
|
|
116
|
-
_buildBlock(state) {
|
|
117
|
-
super._buildBlock(state);
|
|
118
|
-
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
119
|
-
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
120
|
-
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
121
|
-
}
|
|
122
82
|
_dumpPropertiesCode() {
|
|
123
83
|
const codes = [];
|
|
124
84
|
codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);
|
|
125
85
|
codes.push(`${this._codeVariableName}.weight = ${this.weight};`);
|
|
126
86
|
codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);
|
|
127
|
-
codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
|
|
128
87
|
return super._dumpPropertiesCode() + codes.join("\n");
|
|
129
88
|
}
|
|
130
89
|
serialize() {
|
|
@@ -132,7 +91,6 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
|
|
|
132
91
|
serializationObject.threshold = this.threshold;
|
|
133
92
|
serializationObject.weight = this.weight;
|
|
134
93
|
serializationObject.kernel = this.kernel;
|
|
135
|
-
serializationObject.sourceSamplingMode = this.sourceSamplingMode;
|
|
136
94
|
return serializationObject;
|
|
137
95
|
}
|
|
138
96
|
_deserialize(serializationObject) {
|
|
@@ -140,7 +98,6 @@ export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
|
|
|
140
98
|
this.threshold = serializationObject.threshold;
|
|
141
99
|
this.weight = serializationObject.weight;
|
|
142
100
|
this.kernel = serializationObject.kernel;
|
|
143
|
-
this.sourceSamplingMode = serializationObject.sourceSamplingMode;
|
|
144
101
|
}
|
|
145
102
|
}
|
|
146
103
|
__decorate([
|
|
@@ -149,9 +106,6 @@ __decorate([
|
|
|
149
106
|
__decorate([
|
|
150
107
|
editableInPropertyPage("HDR", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
|
|
151
108
|
], NodeRenderGraphBloomPostProcessBlock.prototype, "hdr", null);
|
|
152
|
-
__decorate([
|
|
153
|
-
editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */)
|
|
154
|
-
], NodeRenderGraphBloomPostProcessBlock.prototype, "sourceSamplingMode", null);
|
|
155
109
|
__decorate([
|
|
156
110
|
editableInPropertyPage("Threshold", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 2 })
|
|
157
111
|
], NodeRenderGraphBloomPostProcessBlock.prototype, "threshold", null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bloomPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E;;GAEG;AACH,MAAM,OAAO,oCAAqC,SAAQ,oBAAoB;IAG1E;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,GAAG,GAAG,KAAK,EAAE,UAAU,GAAG,GAAG;QAChG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,iCAAiC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAE3D,I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sBAAsB,8CAAsC;8EAGnF;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;qEAGnG;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;kEAGhG;AAQD;IADC,sBAAsB,CAAC,QAAQ,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;kEAGhG;AAuEL,aAAa,CAAC,8CAA8C,EAAE,oCAAoC,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBloomTask } from \"../../../Tasks/PostProcesses/bloomTask\";\r\n\r\n/**\r\n * Block that implements the bloom post process\r\n */\r\nexport class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphBloomTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphBloomPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param hdr If high dynamic range textures should be used (default: false)\r\n * @param bloomScale The scale of the bloom effect (default: 0.5)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, hdr = false, bloomScale = 0.5) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, scene.getEngine(), 0.75, 64, 0.2, hdr, bloomScale);\r\n }\r\n\r\n private _createTask(bloomScale: number, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const threshold = this._frameGraphTask.bloom.threshold;\r\n const weight = this._frameGraphTask.bloom.weight;\r\n const kernel = this._frameGraphTask.bloom.kernel;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, this._frameGraph, this._scene.getEngine(), weight, kernel, threshold, hdr, bloomScale);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Bloom scale\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get bloomScale() {\r\n return this._frameGraphTask.bloom.scale;\r\n }\r\n\r\n public set bloomScale(value: number) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.bloom.scale, value);\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode)\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** The luminance threshold to find bright areas of the image to bloom. */\r\n @editableInPropertyPage(\"Threshold\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 2 })\r\n public get threshold(): number {\r\n return this._frameGraphTask.bloom.threshold;\r\n }\r\n\r\n public set threshold(value: number) {\r\n this._frameGraphTask.bloom.threshold = value;\r\n }\r\n\r\n /** The strength of the bloom. */\r\n @editableInPropertyPage(\"Weight\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 3 })\r\n public get weight(): number {\r\n return this._frameGraphTask.bloom.weight;\r\n }\r\n\r\n public set weight(value: number) {\r\n this._frameGraphTask.bloom.weight = value;\r\n }\r\n\r\n /** Specifies the size of the bloom blur kernel, relative to the final output size */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 128 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.bloom.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.bloom.kernel = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphBloomPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);\r\n codes.push(`${this._codeVariableName}.weight = ${this.weight};`);\r\n codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.threshold = this.threshold;\r\n serializationObject.weight = this.weight;\r\n serializationObject.kernel = this.kernel;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.threshold = serializationObject.threshold;\r\n this.weight = serializationObject.weight;\r\n this.kernel = serializationObject.kernel;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBloomPostProcessBlock\", NodeRenderGraphBloomPostProcessBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"bloomPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAA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GjF;AAQD;IADC,sBAAsB,CAAC,KAAK,0CAAkC,YAAY,CAAC;+DAG3E;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;qEAGnG;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;kEAGhG;AAQD;IADC,sBAAsB,CAAC,QAAQ,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;kEAGhG;AAsCL,aAAa,CAAC,8CAA8C,EAAE,oCAAoC,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Scene, FrameGraph } from \"core/index\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphBloomTask } from \"../../../Tasks/PostProcesses/bloomTask\";\r\nimport { NodeRenderGraphBasePostProcessBlock } from \"./basePostProcessBlock\";\r\n\r\n/**\r\n * Block that implements the bloom post process\r\n */\r\nexport class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {\r\n protected override _frameGraphTask: FrameGraphBloomTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphBloomPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param hdr If high dynamic range textures should be used (default: false)\r\n * @param bloomScale The scale of the bloom effect (default: 0.5)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, hdr = false, bloomScale = 0.5) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n\r\n this._finalizeInputOutputRegistering();\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, scene.getEngine(), 0.75, 64, 0.2, hdr, bloomScale);\r\n }\r\n\r\n private _createTask(bloomScale: number, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const threshold = this._frameGraphTask.bloom.threshold;\r\n const weight = this._frameGraphTask.bloom.weight;\r\n const kernel = this._frameGraphTask.bloom.kernel;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphBloomTask(this.name, this._frameGraph, this._scene.getEngine(), weight, kernel, threshold, hdr, bloomScale);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n\r\n this._additionalConstructionParameters = [hdr, bloomScale];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Bloom scale\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get bloomScale() {\r\n return this._frameGraphTask.bloom.scale;\r\n }\r\n\r\n public set bloomScale(value: number) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.bloom.scale, value);\r\n }\r\n\r\n /** The luminance threshold to find bright areas of the image to bloom. */\r\n @editableInPropertyPage(\"Threshold\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 2 })\r\n public get threshold(): number {\r\n return this._frameGraphTask.bloom.threshold;\r\n }\r\n\r\n public set threshold(value: number) {\r\n this._frameGraphTask.bloom.threshold = value;\r\n }\r\n\r\n /** The strength of the bloom. */\r\n @editableInPropertyPage(\"Weight\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 3 })\r\n public get weight(): number {\r\n return this._frameGraphTask.bloom.weight;\r\n }\r\n\r\n public set weight(value: number) {\r\n this._frameGraphTask.bloom.weight = value;\r\n }\r\n\r\n /** Specifies the size of the bloom blur kernel, relative to the final output size */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 128 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.bloom.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.bloom.kernel = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphBloomPostProcessBlock\";\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);\r\n codes.push(`${this._codeVariableName}.weight = ${this.weight};`);\r\n codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.threshold = this.threshold;\r\n serializationObject.weight = this.weight;\r\n serializationObject.kernel = this.kernel;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.threshold = serializationObject.threshold;\r\n this.weight = serializationObject.weight;\r\n this.kernel = serializationObject.kernel;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBloomPostProcessBlock\", NodeRenderGraphBloomPostProcessBlock);\r\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
|
|
1
|
+
import type { Scene, FrameGraph } from "../../../../index.js";
|
|
3
2
|
import { FrameGraphBlurTask } from "../../../Tasks/PostProcesses/blurTask.js";
|
|
4
3
|
import { Vector2 } from "../../../../Maths/math.vector.js";
|
|
4
|
+
import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock";
|
|
5
5
|
/**
|
|
6
6
|
* Block that implements the blur post process
|
|
7
7
|
*/
|
|
8
|
-
export declare class NodeRenderGraphBlurPostProcessBlock extends
|
|
8
|
+
export declare class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
|
|
9
9
|
protected _frameGraphTask: FrameGraphBlurTask;
|
|
10
10
|
/**
|
|
11
11
|
* Gets the frame graph task associated with this block
|
|
@@ -18,9 +18,6 @@ export declare class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraph
|
|
|
18
18
|
* @param scene defines the hosting scene
|
|
19
19
|
*/
|
|
20
20
|
constructor(name: string, frameGraph: FrameGraph, scene: Scene);
|
|
21
|
-
/** Sampling mode used to sample from the source texture */
|
|
22
|
-
get sourceSamplingMode(): number;
|
|
23
|
-
set sourceSamplingMode(value: number);
|
|
24
21
|
/** The direction in which to blur the image */
|
|
25
22
|
get direction(): Vector2;
|
|
26
23
|
set direction(value: Vector2);
|
|
@@ -32,19 +29,6 @@ export declare class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraph
|
|
|
32
29
|
* @returns the class name
|
|
33
30
|
*/
|
|
34
31
|
getClassName(): string;
|
|
35
|
-
/**
|
|
36
|
-
* Gets the source input component
|
|
37
|
-
*/
|
|
38
|
-
get source(): NodeRenderGraphConnectionPoint;
|
|
39
|
-
/**
|
|
40
|
-
* Gets the destination input component
|
|
41
|
-
*/
|
|
42
|
-
get destination(): NodeRenderGraphConnectionPoint;
|
|
43
|
-
/**
|
|
44
|
-
* Gets the output component
|
|
45
|
-
*/
|
|
46
|
-
get output(): NodeRenderGraphConnectionPoint;
|
|
47
|
-
protected _buildBlock(state: NodeRenderGraphBuildState): void;
|
|
48
32
|
protected _dumpPropertiesCode(): string;
|
|
49
33
|
serialize(): any;
|
|
50
34
|
_deserialize(serializationObject: any): void;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { __decorate } from "../../../../tslib.es6.js";
|
|
2
|
-
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
|
|
3
2
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
|
-
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
5
3
|
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
6
4
|
import { FrameGraphBlurTask } from "../../../Tasks/PostProcesses/blurTask.js";
|
|
7
5
|
import { ThinBlurPostProcess } from "../../../../PostProcesses/thinBlurPostProcess.js";
|
|
8
6
|
import { Vector2 } from "../../../../Maths/math.vector.js";
|
|
7
|
+
import { NodeRenderGraphBasePostProcessBlock } from "./basePostProcessBlock.js";
|
|
9
8
|
/**
|
|
10
9
|
* Block that implements the blur post process
|
|
11
10
|
*/
|
|
12
|
-
export class NodeRenderGraphBlurPostProcessBlock extends
|
|
11
|
+
export class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBasePostProcessBlock {
|
|
13
12
|
/**
|
|
14
13
|
* Gets the frame graph task associated with this block
|
|
15
14
|
*/
|
|
@@ -24,24 +23,9 @@ export class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBlock {
|
|
|
24
23
|
*/
|
|
25
24
|
constructor(name, frameGraph, scene) {
|
|
26
25
|
super(name, frameGraph, scene);
|
|
27
|
-
this.
|
|
28
|
-
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
29
|
-
this._addDependenciesInput();
|
|
30
|
-
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
31
|
-
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
32
|
-
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
33
|
-
this.output._typeConnectionSource = () => {
|
|
34
|
-
return this.destination.isConnected ? this.destination : this.source;
|
|
35
|
-
};
|
|
26
|
+
this._finalizeInputOutputRegistering();
|
|
36
27
|
this._frameGraphTask = new FrameGraphBlurTask(this.name, frameGraph, new ThinBlurPostProcess(name, scene.getEngine(), new Vector2(1, 0), 32));
|
|
37
28
|
}
|
|
38
|
-
/** Sampling mode used to sample from the source texture */
|
|
39
|
-
get sourceSamplingMode() {
|
|
40
|
-
return this._frameGraphTask.sourceSamplingMode;
|
|
41
|
-
}
|
|
42
|
-
set sourceSamplingMode(value) {
|
|
43
|
-
this._frameGraphTask.sourceSamplingMode = value;
|
|
44
|
-
}
|
|
45
29
|
/** The direction in which to blur the image */
|
|
46
30
|
get direction() {
|
|
47
31
|
return this._frameGraphTask.postProcess.direction;
|
|
@@ -63,54 +47,24 @@ export class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBlock {
|
|
|
63
47
|
getClassName() {
|
|
64
48
|
return "NodeRenderGraphBlurPostProcessBlock";
|
|
65
49
|
}
|
|
66
|
-
/**
|
|
67
|
-
* Gets the source input component
|
|
68
|
-
*/
|
|
69
|
-
get source() {
|
|
70
|
-
return this._inputs[0];
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Gets the destination input component
|
|
74
|
-
*/
|
|
75
|
-
get destination() {
|
|
76
|
-
return this._inputs[1];
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Gets the output component
|
|
80
|
-
*/
|
|
81
|
-
get output() {
|
|
82
|
-
return this._outputs[0];
|
|
83
|
-
}
|
|
84
|
-
_buildBlock(state) {
|
|
85
|
-
super._buildBlock(state);
|
|
86
|
-
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
87
|
-
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
88
|
-
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
89
|
-
}
|
|
90
50
|
_dumpPropertiesCode() {
|
|
91
51
|
const codes = [];
|
|
92
52
|
codes.push(`${this._codeVariableName}.direction = new BABYLON.Vector2(${this.direction.x}, ${this.direction.y});`);
|
|
93
53
|
codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);
|
|
94
|
-
codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
|
|
95
54
|
return super._dumpPropertiesCode() + codes.join("\n");
|
|
96
55
|
}
|
|
97
56
|
serialize() {
|
|
98
57
|
const serializationObject = super.serialize();
|
|
99
58
|
serializationObject.direction = this.direction.asArray();
|
|
100
59
|
serializationObject.kernel = this.kernel;
|
|
101
|
-
serializationObject.sourceSamplingMode = this.sourceSamplingMode;
|
|
102
60
|
return serializationObject;
|
|
103
61
|
}
|
|
104
62
|
_deserialize(serializationObject) {
|
|
105
63
|
super._deserialize(serializationObject);
|
|
106
64
|
this.direction.fromArray(serializationObject.direction);
|
|
107
65
|
this.kernel = serializationObject.kernel;
|
|
108
|
-
this.sourceSamplingMode = serializationObject.sourceSamplingMode;
|
|
109
66
|
}
|
|
110
67
|
}
|
|
111
|
-
__decorate([
|
|
112
|
-
editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
|
|
113
|
-
], NodeRenderGraphBlurPostProcessBlock.prototype, "sourceSamplingMode", null);
|
|
114
68
|
__decorate([
|
|
115
69
|
editableInPropertyPage("Direction", 3 /* PropertyTypeForEdition.Vector2 */, "PROPERTIES")
|
|
116
70
|
], NodeRenderGraphBlurPostProcessBlock.prototype, "direction", null);
|