@babylonjs/core 7.32.0 → 7.32.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/Behaviors/Cameras/autoRotationBehavior.js +1 -0
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Cameras/camera.d.ts +5 -2
- package/Cameras/camera.js +1 -0
- package/Cameras/camera.js.map +1 -1
- package/Decorators/nodeDecorator.d.ts +9 -1
- package/Decorators/nodeDecorator.js +8 -0
- package/Decorators/nodeDecorator.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +40 -53
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +20 -8
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.debugging.js +16 -7
- package/Engines/WebGPU/Extensions/engine.debugging.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +43 -44
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +8 -6
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.d.ts +3 -3
- package/Engines/WebGPU/webgpuHardwareTexture.js +12 -9
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +25 -19
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +5 -3
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.d.ts +6 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +6 -1
- package/Engines/constants.js +6 -1
- package/Engines/constants.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +7 -0
- package/Engines/renderTargetWrapper.js +15 -0
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +3 -1
- package/Engines/webgpuEngine.js +9 -8
- package/Engines/webgpuEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.d.ts +47 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +113 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.d.ts +62 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +171 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.d.ts +51 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +127 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.d.ts +67 -0
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +187 -0
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.d.ts +77 -0
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +232 -0
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.d.ts +47 -0
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +113 -0
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.d.ts +41 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js +79 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +119 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +451 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.d.ts +63 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +154 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.d.ts +59 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js +131 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.d.ts +49 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.js +107 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +50 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +125 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.d.ts +38 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +71 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.d.ts +34 -0
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +59 -0
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/elbowBlock.d.ts +28 -0
- package/FrameGraph/Node/Blocks/elbowBlock.js +47 -0
- package/FrameGraph/Node/Blocks/elbowBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/index.d.ts +17 -0
- package/FrameGraph/Node/Blocks/index.js +18 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -0
- package/FrameGraph/Node/Blocks/inputBlock.d.ts +94 -0
- package/FrameGraph/Node/Blocks/inputBlock.js +270 -0
- package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/outputBlock.d.ts +30 -0
- package/FrameGraph/Node/Blocks/outputBlock.js +51 -0
- package/FrameGraph/Node/Blocks/outputBlock.js.map +1 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +110 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +78 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraph.d.ts +196 -0
- package/FrameGraph/Node/nodeRenderGraph.js +614 -0
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.d.ts +190 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js +495 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +143 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +275 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraphBuildState.d.ts +21 -0
- package/FrameGraph/Node/nodeRenderGraphBuildState.js +35 -0
- package/FrameGraph/Node/nodeRenderGraphBuildState.js.map +1 -0
- package/FrameGraph/Passes/cullPass.d.ts +28 -0
- package/FrameGraph/Passes/cullPass.js +38 -0
- package/FrameGraph/Passes/cullPass.js.map +1 -0
- package/FrameGraph/Passes/pass.d.ts +14 -0
- package/FrameGraph/Passes/pass.js +20 -0
- package/FrameGraph/Passes/pass.js.map +1 -0
- package/FrameGraph/Passes/renderPass.d.ts +49 -0
- package/FrameGraph/Passes/renderPass.js +72 -0
- package/FrameGraph/Passes/renderPass.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.d.ts +16 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js +17 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.d.ts +12 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +21 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +54 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +114 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.d.ts +17 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.js +24 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.d.ts +30 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +35 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.d.ts +12 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +26 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.d.ts +12 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +29 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +65 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +134 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.d.ts +16 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js +17 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +41 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +64 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.d.ts +28 -0
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.js +52 -0
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +145 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +259 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +66 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +127 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +34 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +42 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.d.ts +12 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js +23 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +26 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +31 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +22 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +34 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -0
- package/FrameGraph/frameGraph.d.ts +143 -0
- package/FrameGraph/frameGraph.js +275 -0
- package/FrameGraph/frameGraph.js.map +1 -0
- package/FrameGraph/frameGraphContext.d.ts +5 -0
- package/FrameGraph/frameGraphContext.js +6 -0
- package/FrameGraph/frameGraphContext.js.map +1 -0
- package/FrameGraph/frameGraphObjectList.d.ts +15 -0
- package/FrameGraph/frameGraphObjectList.js +7 -0
- package/FrameGraph/frameGraphObjectList.js.map +1 -0
- package/FrameGraph/frameGraphRenderContext.d.ts +110 -0
- package/FrameGraph/frameGraphRenderContext.js +237 -0
- package/FrameGraph/frameGraphRenderContext.js.map +1 -0
- package/FrameGraph/frameGraphTask.d.ts +49 -0
- package/FrameGraph/frameGraphTask.js +117 -0
- package/FrameGraph/frameGraphTask.js.map +1 -0
- package/FrameGraph/frameGraphTextureManager.d.ts +50 -0
- package/FrameGraph/frameGraphTextureManager.js +277 -0
- package/FrameGraph/frameGraphTextureManager.js.map +1 -0
- package/FrameGraph/frameGraphTypes.d.ts +59 -0
- package/FrameGraph/frameGraphTypes.js +9 -0
- package/FrameGraph/frameGraphTypes.js.map +1 -0
- package/FrameGraph/index.d.ts +28 -0
- package/FrameGraph/index.js +30 -0
- package/FrameGraph/index.js.map +1 -0
- package/Gamepads/gamepadSceneComponent.d.ts +0 -1
- package/Gamepads/gamepadSceneComponent.js +1 -7
- package/Gamepads/gamepadSceneComponent.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +7 -0
- package/Gizmos/boundingBoxGizmo.js +19 -6
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +3 -1
- package/Inputs/scene.inputManager.js +20 -8
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/layer.d.ts +1 -1
- package/Layers/layer.js +1 -1
- package/Layers/layer.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +4 -0
- package/Materials/PBR/pbrBaseMaterial.js +8 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/dynamicTexture.d.ts +32 -2
- package/Materials/Textures/dynamicTexture.js +13 -18
- package/Materials/Textures/dynamicTexture.js.map +1 -1
- package/Materials/Textures/index.d.ts +1 -0
- package/Materials/Textures/index.js +1 -0
- package/Materials/Textures/index.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +0 -6
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +20 -8
- package/Materials/Textures/multiRenderTarget.js +2 -0
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +8 -1
- package/Materials/Textures/renderTargetTexture.js +28 -10
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +20 -2
- package/Materials/Textures/textureCreationOptions.js +20 -1
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Materials/effectRenderer.d.ts +132 -14
- package/Materials/effectRenderer.js +229 -33
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/index.d.ts +1 -0
- package/Materials/index.js +1 -0
- package/Materials/index.js.map +1 -1
- package/Materials/materialHelper.functions.js +2 -0
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.d.ts +122 -0
- package/Materials/materialHelper.geometryrendering.js +259 -0
- package/Materials/materialHelper.geometryrendering.js.map +1 -0
- package/Materials/standardMaterial.d.ts +4 -0
- package/Materials/standardMaterial.js +8 -0
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/index.d.ts +1 -0
- package/Maths/index.js +1 -0
- package/Maths/index.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.d.ts +22 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js +39 -0
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
- package/Misc/copyTextureToTexture.d.ts +3 -2
- package/Misc/copyTextureToTexture.js +11 -5
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.d.ts +5 -3
- package/PostProcesses/blackAndWhitePostProcess.js +24 -19
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/bloomEffect.d.ts +7 -5
- package/PostProcesses/bloomEffect.js +49 -23
- package/PostProcesses/bloomEffect.js.map +1 -1
- package/PostProcesses/bloomMergePostProcess.d.ts +5 -5
- package/PostProcesses/bloomMergePostProcess.js +28 -19
- package/PostProcesses/bloomMergePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +7 -43
- package/PostProcesses/blurPostProcess.js +47 -185
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/circleOfConfusionPostProcess.d.ts +13 -6
- package/PostProcesses/circleOfConfusionPostProcess.js +59 -38
- package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +2 -6
- package/PostProcesses/depthOfFieldBlurPostProcess.js +14 -11
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.d.ts +5 -2
- package/PostProcesses/depthOfFieldEffect.js +53 -45
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.d.ts +0 -1
- package/PostProcesses/depthOfFieldMergePostProcess.js +18 -12
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/extractHighlightsPostProcess.d.ts +8 -4
- package/PostProcesses/extractHighlightsPostProcess.js +35 -22
- package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
- package/PostProcesses/index.d.ts +6 -0
- package/PostProcesses/index.js +6 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +15 -70
- package/PostProcesses/postProcess.js +80 -97
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/thinBlackAndWhitePostProcess.d.ts +28 -0
- package/PostProcesses/thinBlackAndWhitePostProcess.js +50 -0
- package/PostProcesses/thinBlackAndWhitePostProcess.js.map +1 -0
- package/PostProcesses/thinBloomEffect.d.ts +49 -0
- package/PostProcesses/thinBloomEffect.js +59 -0
- package/PostProcesses/thinBloomEffect.js.map +1 -0
- package/PostProcesses/thinBloomMergePostProcess.d.ts +15 -0
- package/PostProcesses/thinBloomMergePostProcess.js +38 -0
- package/PostProcesses/thinBloomMergePostProcess.js.map +1 -0
- package/PostProcesses/thinBlurPostProcess.d.ts +89 -0
- package/PostProcesses/thinBlurPostProcess.js +242 -0
- package/PostProcesses/thinBlurPostProcess.js.map +1 -0
- package/PostProcesses/thinCircleOfConfusionPostProcess.d.ts +62 -0
- package/PostProcesses/thinCircleOfConfusionPostProcess.js +81 -0
- package/PostProcesses/thinCircleOfConfusionPostProcess.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldBlurPostProcess.d.ts +8 -0
- package/PostProcesses/thinDepthOfFieldBlurPostProcess.js +13 -0
- package/PostProcesses/thinDepthOfFieldBlurPostProcess.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldEffect.d.ts +70 -0
- package/PostProcesses/thinDepthOfFieldEffect.js +115 -0
- package/PostProcesses/thinDepthOfFieldEffect.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldMergePostProcess.d.ts +11 -0
- package/PostProcesses/thinDepthOfFieldMergePostProcess.js +30 -0
- package/PostProcesses/thinDepthOfFieldMergePostProcess.js.map +1 -0
- package/PostProcesses/thinExtractHighlightsPostProcess.d.ts +30 -0
- package/PostProcesses/thinExtractHighlightsPostProcess.js +55 -0
- package/PostProcesses/thinExtractHighlightsPostProcess.js.map +1 -0
- package/Rendering/depthPeelingRenderer.js +2 -2
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js +4 -4
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockPrePass.d.ts +5 -0
- package/Shaders/ShadersInclude/pbrBlockPrePass.js +75 -0
- package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -0
- package/Shaders/ShadersInclude/prePassVertex.js +1 -2
- package/Shaders/ShadersInclude/prePassVertex.js.map +1 -1
- package/Shaders/circleOfConfusion.fragment.js +9 -1
- package/Shaders/circleOfConfusion.fragment.js.map +1 -1
- package/Shaders/colorCorrection.fragment.js +1 -0
- package/Shaders/colorCorrection.fragment.js.map +1 -1
- package/Shaders/default.fragment.js +17 -25
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/default.vertex.js +4 -6
- package/Shaders/default.vertex.js.map +1 -1
- package/Shaders/pbr.fragment.d.ts +1 -0
- package/Shaders/pbr.fragment.js +2 -74
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/pbr.vertex.js +3 -3
- package/Shaders/pbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +100 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/prePassVertex.js +1 -2
- package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -1
- package/ShadersWGSL/background.vertex.js +1 -1
- package/ShadersWGSL/background.vertex.js.map +1 -1
- package/ShadersWGSL/circleOfConfusion.fragment.js +10 -2
- package/ShadersWGSL/circleOfConfusion.fragment.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +20 -31
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/default.vertex.js +4 -5
- package/ShadersWGSL/default.vertex.js.map +1 -1
- package/ShadersWGSL/glowMapGeneration.fragment.js +1 -1
- package/ShadersWGSL/glowMapGeneration.fragment.js.map +1 -1
- package/ShadersWGSL/glowMapGeneration.vertex.js +1 -1
- package/ShadersWGSL/glowMapGeneration.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.d.ts +1 -0
- package/ShadersWGSL/pbr.fragment.js +2 -100
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.vertex.js +4 -2
- package/ShadersWGSL/pbr.vertex.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.js +1 -1
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +19 -2
- package/scene.js +110 -13
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +0 -1
- package/sceneComponent.js +0 -1
- package/sceneComponent.js.map +1 -1
- package/types.d.ts +12 -0
- package/types.js.map +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph } from "../../../../index.js";
|
|
2
|
+
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
|
|
3
|
+
import { FrameGraphBlackAndWhiteTask } from "../../../Tasks/PostProcesses/blackAndWhiteTask.js";
|
|
4
|
+
/**
|
|
5
|
+
* Block that implements the black and white post process
|
|
6
|
+
*/
|
|
7
|
+
export declare class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBlock {
|
|
8
|
+
protected _frameGraphTask: FrameGraphBlackAndWhiteTask;
|
|
9
|
+
/**
|
|
10
|
+
* Gets the frame graph task associated with this block
|
|
11
|
+
*/
|
|
12
|
+
get task(): FrameGraphBlackAndWhiteTask;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new BlackAndWhitePostProcessBlock
|
|
15
|
+
* @param name defines the block name
|
|
16
|
+
* @param frameGraph defines the hosting frame graph
|
|
17
|
+
* @param scene defines the hosting scene
|
|
18
|
+
*/
|
|
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
|
+
/** Degree of conversion to black and white (default: 1 - full b&w conversion) */
|
|
24
|
+
get degree(): number;
|
|
25
|
+
set degree(value: number);
|
|
26
|
+
/**
|
|
27
|
+
* Gets the current class name
|
|
28
|
+
* @returns the class name
|
|
29
|
+
*/
|
|
30
|
+
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
|
+
protected _dumpPropertiesCode(): string;
|
|
45
|
+
serialize(): any;
|
|
46
|
+
_deserialize(serializationObject: any): void;
|
|
47
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { __decorate } from "../../../../tslib.es6.js";
|
|
2
|
+
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
|
|
3
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
|
+
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
5
|
+
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
6
|
+
import { FrameGraphBlackAndWhiteTask } from "../../../Tasks/PostProcesses/blackAndWhiteTask.js";
|
|
7
|
+
import { ThinBlackAndWhitePostProcess } from "../../../../PostProcesses/thinBlackAndWhitePostProcess.js";
|
|
8
|
+
/**
|
|
9
|
+
* Block that implements the black and white post process
|
|
10
|
+
*/
|
|
11
|
+
export class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBlock {
|
|
12
|
+
/**
|
|
13
|
+
* Gets the frame graph task associated with this block
|
|
14
|
+
*/
|
|
15
|
+
get task() {
|
|
16
|
+
return this._frameGraphTask;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Create a new BlackAndWhitePostProcessBlock
|
|
20
|
+
* @param name defines the block name
|
|
21
|
+
* @param frameGraph defines the hosting frame graph
|
|
22
|
+
* @param scene defines the hosting scene
|
|
23
|
+
*/
|
|
24
|
+
constructor(name, frameGraph, scene) {
|
|
25
|
+
super(name, frameGraph, scene);
|
|
26
|
+
this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
27
|
+
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
28
|
+
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
29
|
+
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
30
|
+
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
31
|
+
this.output._typeConnectionSource = () => {
|
|
32
|
+
return this.destination.isConnected ? this.destination : this.source;
|
|
33
|
+
};
|
|
34
|
+
this._frameGraphTask = new FrameGraphBlackAndWhiteTask(this.name, frameGraph, new ThinBlackAndWhitePostProcess(name, scene.getEngine()));
|
|
35
|
+
}
|
|
36
|
+
/** Sampling mode used to sample from the source texture */
|
|
37
|
+
get sourceSamplingMode() {
|
|
38
|
+
return this._frameGraphTask.sourceSamplingMode;
|
|
39
|
+
}
|
|
40
|
+
set sourceSamplingMode(value) {
|
|
41
|
+
this._frameGraphTask.sourceSamplingMode = value;
|
|
42
|
+
}
|
|
43
|
+
/** Degree of conversion to black and white (default: 1 - full b&w conversion) */
|
|
44
|
+
get degree() {
|
|
45
|
+
return this._frameGraphTask.postProcess.degree;
|
|
46
|
+
}
|
|
47
|
+
set degree(value) {
|
|
48
|
+
this._frameGraphTask.postProcess.degree = value;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Gets the current class name
|
|
52
|
+
* @returns the class name
|
|
53
|
+
*/
|
|
54
|
+
getClassName() {
|
|
55
|
+
return "NodeRenderGraphBlackAndWhitePostProcessBlock";
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Gets the source input component
|
|
59
|
+
*/
|
|
60
|
+
get source() {
|
|
61
|
+
return this._inputs[0];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Gets the destination input component
|
|
65
|
+
*/
|
|
66
|
+
get destination() {
|
|
67
|
+
return this._inputs[1];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Gets the output component
|
|
71
|
+
*/
|
|
72
|
+
get output() {
|
|
73
|
+
return this._outputs[0];
|
|
74
|
+
}
|
|
75
|
+
_buildBlock(state) {
|
|
76
|
+
super._buildBlock(state);
|
|
77
|
+
this._frameGraphTask.name = this.name;
|
|
78
|
+
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
79
|
+
const sourceConnectedPoint = this.source.connectedPoint;
|
|
80
|
+
if (sourceConnectedPoint) {
|
|
81
|
+
this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
|
|
82
|
+
}
|
|
83
|
+
const destinationConnectedPoint = this.destination.connectedPoint;
|
|
84
|
+
if (destinationConnectedPoint) {
|
|
85
|
+
this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
_dumpPropertiesCode() {
|
|
89
|
+
const codes = [];
|
|
90
|
+
codes.push(`${this._codeVariableName}.degree = ${this.degree};`);
|
|
91
|
+
codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
|
|
92
|
+
return super._dumpPropertiesCode() + codes.join("\n");
|
|
93
|
+
}
|
|
94
|
+
serialize() {
|
|
95
|
+
const serializationObject = super.serialize();
|
|
96
|
+
serializationObject.degree = this.degree;
|
|
97
|
+
serializationObject.sourceSamplingMode = this.sourceSamplingMode;
|
|
98
|
+
return serializationObject;
|
|
99
|
+
}
|
|
100
|
+
_deserialize(serializationObject) {
|
|
101
|
+
super._deserialize(serializationObject);
|
|
102
|
+
this.degree = serializationObject.degree;
|
|
103
|
+
this.sourceSamplingMode = serializationObject.sourceSamplingMode;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
__decorate([
|
|
107
|
+
editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
|
|
108
|
+
], NodeRenderGraphBlackAndWhitePostProcessBlock.prototype, "sourceSamplingMode", null);
|
|
109
|
+
__decorate([
|
|
110
|
+
editableInPropertyPage("Degree", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 1 })
|
|
111
|
+
], NodeRenderGraphBlackAndWhitePostProcessBlock.prototype, "degree", null);
|
|
112
|
+
RegisterClass("BABYLON.NodeRenderGraphBlackAndWhitePostProcessBlock", NodeRenderGraphBlackAndWhitePostProcessBlock);
|
|
113
|
+
//# sourceMappingURL=blackAndWhitePostProcessBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blackAndWhitePostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.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,2BAA2B,EAAE,0DAA8D;AACpG,OAAO,EAAE,4BAA4B,EAAE,kEAAwD;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AC,iBAAiB,aAAa,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QACjE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,iBAAiB,yBAAyB,IAAI,CAAC,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,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzC,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,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;IACrE,CAAC;CACJ;AApFG;IADC,sBAAsB,CAAC,sBAAsB,+CAAuC,YAAY,CAAC;sFAGjG;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;0EAGhG;AA0EL,aAAa,CAAC,sDAAsD,EAAE,4CAA4C,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 { FrameGraphBlackAndWhiteTask } from \"core/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask\";\r\nimport { ThinBlackAndWhitePostProcess } from \"core/PostProcesses/thinBlackAndWhitePostProcess\";\r\n\r\n/**\r\n * Block that implements the black and white post process\r\n */\r\nexport class NodeRenderGraphBlackAndWhitePostProcessBlock extends NodeRenderGraphBlock {\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.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\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 FrameGraphBlackAndWhiteTask(this.name, frameGraph, new ThinBlackAndWhitePostProcess(name, scene.getEngine()));\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 /** 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 /**\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._frameGraphTask.name = this.name;\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 const sourceConnectedPoint = this.source.connectedPoint;\r\n if (sourceConnectedPoint) {\r\n this._frameGraphTask.sourceTexture = sourceConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\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 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.degree = this.degree;\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.degree = serializationObject.degree;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBlackAndWhitePostProcessBlock\", NodeRenderGraphBlackAndWhitePostProcessBlock);\r\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph } from "../../../../index.js";
|
|
2
|
+
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
|
|
3
|
+
import { FrameGraphBloomTask } from "../../../Tasks/PostProcesses/bloomTask";
|
|
4
|
+
/**
|
|
5
|
+
* Block that implements the bloom post process
|
|
6
|
+
*/
|
|
7
|
+
export declare class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
|
|
8
|
+
protected _frameGraphTask: FrameGraphBloomTask;
|
|
9
|
+
/**
|
|
10
|
+
* Gets the frame graph task associated with this block
|
|
11
|
+
*/
|
|
12
|
+
get task(): FrameGraphBloomTask;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new NodeRenderGraphBloomPostProcessBlock
|
|
15
|
+
* @param name defines the block name
|
|
16
|
+
* @param frameGraph defines the hosting frame graph
|
|
17
|
+
* @param scene defines the hosting scene
|
|
18
|
+
* @param hdr If high dynamic range textures should be used (default: false)
|
|
19
|
+
* @param bloomScale The scale of the bloom effect (default: 0.5)
|
|
20
|
+
*/
|
|
21
|
+
constructor(name: string, frameGraph: FrameGraph, scene: Scene, hdr?: boolean, bloomScale?: number);
|
|
22
|
+
private _createTask;
|
|
23
|
+
/** The quality of the blur effect */
|
|
24
|
+
get bloomScale(): number;
|
|
25
|
+
set bloomScale(value: number);
|
|
26
|
+
/** If high dynamic range textures should be used */
|
|
27
|
+
get hdr(): boolean;
|
|
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
|
+
/** The luminance threshold to find bright areas of the image to bloom. */
|
|
33
|
+
get threshold(): number;
|
|
34
|
+
set threshold(value: number);
|
|
35
|
+
/** The strength of the bloom. */
|
|
36
|
+
get weight(): number;
|
|
37
|
+
set weight(value: number);
|
|
38
|
+
/** Specifies the size of the bloom blur kernel, relative to the final output size */
|
|
39
|
+
get kernel(): number;
|
|
40
|
+
set kernel(value: number);
|
|
41
|
+
/**
|
|
42
|
+
* Gets the current class name
|
|
43
|
+
* @returns the class name
|
|
44
|
+
*/
|
|
45
|
+
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
|
+
protected _dumpPropertiesCode(): string;
|
|
60
|
+
serialize(): any;
|
|
61
|
+
_deserialize(serializationObject: any): void;
|
|
62
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { __decorate } from "../../../../tslib.es6.js";
|
|
2
|
+
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
|
|
3
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
|
+
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
5
|
+
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
6
|
+
import { FrameGraphBloomTask } from "../../../Tasks/PostProcesses/bloomTask.js";
|
|
7
|
+
/**
|
|
8
|
+
* Block that implements the bloom post process
|
|
9
|
+
*/
|
|
10
|
+
export class NodeRenderGraphBloomPostProcessBlock extends NodeRenderGraphBlock {
|
|
11
|
+
/**
|
|
12
|
+
* Gets the frame graph task associated with this block
|
|
13
|
+
*/
|
|
14
|
+
get task() {
|
|
15
|
+
return this._frameGraphTask;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a new NodeRenderGraphBloomPostProcessBlock
|
|
19
|
+
* @param name defines the block name
|
|
20
|
+
* @param frameGraph defines the hosting frame graph
|
|
21
|
+
* @param scene defines the hosting scene
|
|
22
|
+
* @param hdr If high dynamic range textures should be used (default: false)
|
|
23
|
+
* @param bloomScale The scale of the bloom effect (default: 0.5)
|
|
24
|
+
*/
|
|
25
|
+
constructor(name, frameGraph, scene, hdr = false, bloomScale = 0.5) {
|
|
26
|
+
super(name, frameGraph, scene);
|
|
27
|
+
this._additionalConstructionParameters = [hdr, bloomScale];
|
|
28
|
+
this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
29
|
+
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
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
|
+
};
|
|
36
|
+
this._frameGraphTask = new FrameGraphBloomTask(this.name, frameGraph, scene.getEngine(), 0.75, 64, 0.2, hdr, bloomScale);
|
|
37
|
+
}
|
|
38
|
+
_createTask(bloomScale, hdr) {
|
|
39
|
+
const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;
|
|
40
|
+
const threshold = this._frameGraphTask.bloom.threshold;
|
|
41
|
+
const weight = this._frameGraphTask.bloom.weight;
|
|
42
|
+
const kernel = this._frameGraphTask.bloom.kernel;
|
|
43
|
+
this._frameGraphTask.dispose();
|
|
44
|
+
this._frameGraphTask = new FrameGraphBloomTask(this.name, this._frameGraph, this._scene.getEngine(), weight, kernel, threshold, hdr, bloomScale);
|
|
45
|
+
this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;
|
|
46
|
+
this._additionalConstructionParameters = [hdr, bloomScale];
|
|
47
|
+
}
|
|
48
|
+
/** The quality of the blur effect */
|
|
49
|
+
get bloomScale() {
|
|
50
|
+
return this._frameGraphTask.bloom.scale;
|
|
51
|
+
}
|
|
52
|
+
set bloomScale(value) {
|
|
53
|
+
this._createTask(value, this._frameGraphTask.hdr);
|
|
54
|
+
}
|
|
55
|
+
/** If high dynamic range textures should be used */
|
|
56
|
+
get hdr() {
|
|
57
|
+
return this._frameGraphTask.hdr;
|
|
58
|
+
}
|
|
59
|
+
set hdr(value) {
|
|
60
|
+
this._createTask(this._frameGraphTask.bloom.scale, value);
|
|
61
|
+
}
|
|
62
|
+
/** Sampling mode used to sample from the source texture */
|
|
63
|
+
get sourceSamplingMode() {
|
|
64
|
+
return this._frameGraphTask.sourceSamplingMode;
|
|
65
|
+
}
|
|
66
|
+
set sourceSamplingMode(value) {
|
|
67
|
+
this._frameGraphTask.sourceSamplingMode = value;
|
|
68
|
+
}
|
|
69
|
+
/** The luminance threshold to find bright areas of the image to bloom. */
|
|
70
|
+
get threshold() {
|
|
71
|
+
return this._frameGraphTask.bloom.threshold;
|
|
72
|
+
}
|
|
73
|
+
set threshold(value) {
|
|
74
|
+
this._frameGraphTask.bloom.threshold = value;
|
|
75
|
+
}
|
|
76
|
+
/** The strength of the bloom. */
|
|
77
|
+
get weight() {
|
|
78
|
+
return this._frameGraphTask.bloom.weight;
|
|
79
|
+
}
|
|
80
|
+
set weight(value) {
|
|
81
|
+
this._frameGraphTask.bloom.weight = value;
|
|
82
|
+
}
|
|
83
|
+
/** Specifies the size of the bloom blur kernel, relative to the final output size */
|
|
84
|
+
get kernel() {
|
|
85
|
+
return this._frameGraphTask.bloom.kernel;
|
|
86
|
+
}
|
|
87
|
+
set kernel(value) {
|
|
88
|
+
this._frameGraphTask.bloom.kernel = value;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Gets the current class name
|
|
92
|
+
* @returns the class name
|
|
93
|
+
*/
|
|
94
|
+
getClassName() {
|
|
95
|
+
return "NodeRenderGraphBloomPostProcessBlock";
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Gets the source input component
|
|
99
|
+
*/
|
|
100
|
+
get source() {
|
|
101
|
+
return this._inputs[0];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Gets the destination input component
|
|
105
|
+
*/
|
|
106
|
+
get destination() {
|
|
107
|
+
return this._inputs[1];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Gets the output component
|
|
111
|
+
*/
|
|
112
|
+
get output() {
|
|
113
|
+
return this._outputs[0];
|
|
114
|
+
}
|
|
115
|
+
_buildBlock(state) {
|
|
116
|
+
super._buildBlock(state);
|
|
117
|
+
this._frameGraphTask.name = this.name;
|
|
118
|
+
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
119
|
+
const sourceConnectedPoint = this.source.connectedPoint;
|
|
120
|
+
if (sourceConnectedPoint) {
|
|
121
|
+
this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
|
|
122
|
+
}
|
|
123
|
+
const destinationConnectedPoint = this.destination.connectedPoint;
|
|
124
|
+
if (destinationConnectedPoint) {
|
|
125
|
+
this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
_dumpPropertiesCode() {
|
|
129
|
+
const codes = [];
|
|
130
|
+
codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);
|
|
131
|
+
codes.push(`${this._codeVariableName}.weight = ${this.weight};`);
|
|
132
|
+
codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);
|
|
133
|
+
codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
|
|
134
|
+
return super._dumpPropertiesCode() + codes.join("\n");
|
|
135
|
+
}
|
|
136
|
+
serialize() {
|
|
137
|
+
const serializationObject = super.serialize();
|
|
138
|
+
serializationObject.threshold = this.threshold;
|
|
139
|
+
serializationObject.weight = this.weight;
|
|
140
|
+
serializationObject.kernel = this.kernel;
|
|
141
|
+
serializationObject.sourceSamplingMode = this.sourceSamplingMode;
|
|
142
|
+
return serializationObject;
|
|
143
|
+
}
|
|
144
|
+
_deserialize(serializationObject) {
|
|
145
|
+
super._deserialize(serializationObject);
|
|
146
|
+
this.threshold = serializationObject.threshold;
|
|
147
|
+
this.weight = serializationObject.weight;
|
|
148
|
+
this.kernel = serializationObject.kernel;
|
|
149
|
+
this.sourceSamplingMode = serializationObject.sourceSamplingMode;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
__decorate([
|
|
153
|
+
editableInPropertyPage("Bloom scale", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
|
|
154
|
+
], NodeRenderGraphBloomPostProcessBlock.prototype, "bloomScale", null);
|
|
155
|
+
__decorate([
|
|
156
|
+
editableInPropertyPage("HDR", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
|
|
157
|
+
], NodeRenderGraphBloomPostProcessBlock.prototype, "hdr", null);
|
|
158
|
+
__decorate([
|
|
159
|
+
editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */)
|
|
160
|
+
], NodeRenderGraphBloomPostProcessBlock.prototype, "sourceSamplingMode", null);
|
|
161
|
+
__decorate([
|
|
162
|
+
editableInPropertyPage("Threshold", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 2 })
|
|
163
|
+
], NodeRenderGraphBloomPostProcessBlock.prototype, "threshold", null);
|
|
164
|
+
__decorate([
|
|
165
|
+
editableInPropertyPage("Weight", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 3 })
|
|
166
|
+
], NodeRenderGraphBloomPostProcessBlock.prototype, "weight", null);
|
|
167
|
+
__decorate([
|
|
168
|
+
editableInPropertyPage("Kernel", 2 /* PropertyTypeForEdition.Int */, "PROPERTIES", { min: 1, max: 128 })
|
|
169
|
+
], NodeRenderGraphBloomPostProcessBlock.prototype, "kernel", null);
|
|
170
|
+
RegisterClass("BABYLON.NodeRenderGraphBloomPostProcessBlock", NodeRenderGraphBloomPostProcessBlock);
|
|
171
|
+
//# sourceMappingURL=bloomPostProcessBlock.js.map
|
|
@@ -0,0 +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,EAA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kB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;IACrE,CAAC;CACJ;AAlIG;IADC,sBAAsB,CAAC,aAAa,wCAAgC,YAAY,CAAC;sEAGjF;AAQD;IADC,sBAAsB,CAAC,KAAK,0CAAkC,YAAY,CAAC;+DAG3E;AAQD;IADC,sBAAsB,CAAC,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;AAgFL,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.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._frameGraphTask.name = this.name;\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 const sourceConnectedPoint = this.source.connectedPoint;\r\n if (sourceConnectedPoint) {\r\n this._frameGraphTask.sourceTexture = sourceConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\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"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph } from "../../../../index.js";
|
|
2
|
+
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
|
|
3
|
+
import { FrameGraphBlurTask } from "../../../Tasks/PostProcesses/blurTask.js";
|
|
4
|
+
import { Vector2 } from "../../../../Maths/math.vector.js";
|
|
5
|
+
/**
|
|
6
|
+
* Block that implements the blur post process
|
|
7
|
+
*/
|
|
8
|
+
export declare class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBlock {
|
|
9
|
+
protected _frameGraphTask: FrameGraphBlurTask;
|
|
10
|
+
/**
|
|
11
|
+
* Gets the frame graph task associated with this block
|
|
12
|
+
*/
|
|
13
|
+
get task(): FrameGraphBlurTask;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new NodeRenderGraphBlurPostProcessBlock
|
|
16
|
+
* @param name defines the block name
|
|
17
|
+
* @param frameGraph defines the hosting frame graph
|
|
18
|
+
* @param scene defines the hosting scene
|
|
19
|
+
*/
|
|
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
|
+
/** The direction in which to blur the image */
|
|
25
|
+
get direction(): Vector2;
|
|
26
|
+
set direction(value: Vector2);
|
|
27
|
+
/** Length in pixels of the blur sample region */
|
|
28
|
+
get kernel(): number;
|
|
29
|
+
set kernel(value: number);
|
|
30
|
+
/**
|
|
31
|
+
* Gets the current class name
|
|
32
|
+
* @returns the class name
|
|
33
|
+
*/
|
|
34
|
+
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
|
+
protected _dumpPropertiesCode(): string;
|
|
49
|
+
serialize(): any;
|
|
50
|
+
_deserialize(serializationObject: any): void;
|
|
51
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { __decorate } from "../../../../tslib.es6.js";
|
|
2
|
+
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
|
|
3
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
|
+
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
5
|
+
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
6
|
+
import { FrameGraphBlurTask } from "../../../Tasks/PostProcesses/blurTask.js";
|
|
7
|
+
import { ThinBlurPostProcess } from "../../../../PostProcesses/thinBlurPostProcess.js";
|
|
8
|
+
import { Vector2 } from "../../../../Maths/math.vector.js";
|
|
9
|
+
/**
|
|
10
|
+
* Block that implements the blur post process
|
|
11
|
+
*/
|
|
12
|
+
export class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBlock {
|
|
13
|
+
/**
|
|
14
|
+
* Gets the frame graph task associated with this block
|
|
15
|
+
*/
|
|
16
|
+
get task() {
|
|
17
|
+
return this._frameGraphTask;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create a new NodeRenderGraphBlurPostProcessBlock
|
|
21
|
+
* @param name defines the block name
|
|
22
|
+
* @param frameGraph defines the hosting frame graph
|
|
23
|
+
* @param scene defines the hosting scene
|
|
24
|
+
*/
|
|
25
|
+
constructor(name, frameGraph, scene) {
|
|
26
|
+
super(name, frameGraph, scene);
|
|
27
|
+
this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
28
|
+
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
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
|
+
};
|
|
35
|
+
this._frameGraphTask = new FrameGraphBlurTask(this.name, frameGraph, new ThinBlurPostProcess(name, scene.getEngine(), new Vector2(1, 0), 32));
|
|
36
|
+
}
|
|
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
|
+
/** The direction in which to blur the image */
|
|
45
|
+
get direction() {
|
|
46
|
+
return this._frameGraphTask.postProcess.direction;
|
|
47
|
+
}
|
|
48
|
+
set direction(value) {
|
|
49
|
+
this._frameGraphTask.postProcess.direction = value;
|
|
50
|
+
}
|
|
51
|
+
/** Length in pixels of the blur sample region */
|
|
52
|
+
get kernel() {
|
|
53
|
+
return this._frameGraphTask.postProcess.kernel;
|
|
54
|
+
}
|
|
55
|
+
set kernel(value) {
|
|
56
|
+
this._frameGraphTask.postProcess.kernel = value;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Gets the current class name
|
|
60
|
+
* @returns the class name
|
|
61
|
+
*/
|
|
62
|
+
getClassName() {
|
|
63
|
+
return "NodeRenderGraphBlurPostProcessBlock";
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Gets the source input component
|
|
67
|
+
*/
|
|
68
|
+
get source() {
|
|
69
|
+
return this._inputs[0];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Gets the destination input component
|
|
73
|
+
*/
|
|
74
|
+
get destination() {
|
|
75
|
+
return this._inputs[1];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Gets the output component
|
|
79
|
+
*/
|
|
80
|
+
get output() {
|
|
81
|
+
return this._outputs[0];
|
|
82
|
+
}
|
|
83
|
+
_buildBlock(state) {
|
|
84
|
+
super._buildBlock(state);
|
|
85
|
+
this._frameGraphTask.name = this.name;
|
|
86
|
+
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
87
|
+
const sourceConnectedPoint = this.source.connectedPoint;
|
|
88
|
+
if (sourceConnectedPoint) {
|
|
89
|
+
this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
|
|
90
|
+
}
|
|
91
|
+
const destinationConnectedPoint = this.destination.connectedPoint;
|
|
92
|
+
if (destinationConnectedPoint) {
|
|
93
|
+
this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
_dumpPropertiesCode() {
|
|
97
|
+
const codes = [];
|
|
98
|
+
codes.push(`${this._codeVariableName}.direction = new BABYLON.Vector2(${this.direction.x}, ${this.direction.y});`);
|
|
99
|
+
codes.push(`${this._codeVariableName}.kernel = ${this.kernel};`);
|
|
100
|
+
codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);
|
|
101
|
+
return super._dumpPropertiesCode() + codes.join("\n");
|
|
102
|
+
}
|
|
103
|
+
serialize() {
|
|
104
|
+
const serializationObject = super.serialize();
|
|
105
|
+
serializationObject.direction = this.direction.asArray();
|
|
106
|
+
serializationObject.kernel = this.kernel;
|
|
107
|
+
serializationObject.sourceSamplingMode = this.sourceSamplingMode;
|
|
108
|
+
return serializationObject;
|
|
109
|
+
}
|
|
110
|
+
_deserialize(serializationObject) {
|
|
111
|
+
super._deserialize(serializationObject);
|
|
112
|
+
this.direction.fromArray(serializationObject.direction);
|
|
113
|
+
this.kernel = serializationObject.kernel;
|
|
114
|
+
this.sourceSamplingMode = serializationObject.sourceSamplingMode;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
__decorate([
|
|
118
|
+
editableInPropertyPage("Source sampling mode", 6 /* PropertyTypeForEdition.SamplingMode */, "PROPERTIES")
|
|
119
|
+
], NodeRenderGraphBlurPostProcessBlock.prototype, "sourceSamplingMode", null);
|
|
120
|
+
__decorate([
|
|
121
|
+
editableInPropertyPage("Direction", 3 /* PropertyTypeForEdition.Vector2 */, "PROPERTIES")
|
|
122
|
+
], NodeRenderGraphBlurPostProcessBlock.prototype, "direction", null);
|
|
123
|
+
__decorate([
|
|
124
|
+
editableInPropertyPage("Kernel", 2 /* PropertyTypeForEdition.Int */, "PROPERTIES", { min: 1, max: 256 })
|
|
125
|
+
], NodeRenderGraphBlurPostProcessBlock.prototype, "kernel", null);
|
|
126
|
+
RegisterClass("BABYLON.NodeRenderGraphBlurPostProcessBlock", NodeRenderGraphBlurPostProcessBlock);
|
|
127
|
+
//# sourceMappingURL=blurPostProcessBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blurPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.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,EAA0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SAAS,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACxD,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;IACrE,CAAC;CACJ;AAjGG;IADC,sBAAsB,CAAC,sBAAsB,+CAAuC,YAAY,CAAC;6EAGjG;AAQD;IADC,sBAAsB,CAAC,WAAW,0CAAkC,YAAY,CAAC;oEAGjF;AAQD;IADC,sBAAsB,CAAC,QAAQ,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;iEAGhG;AA6EL,aAAa,CAAC,6CAA6C,EAAE,mCAAmC,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 { FrameGraphBlurTask } from \"core/FrameGraph/Tasks/PostProcesses/blurTask\";\r\nimport { ThinBlurPostProcess } from \"core/PostProcesses/thinBlurPostProcess\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Block that implements the blur post process\r\n */\r\nexport class NodeRenderGraphBlurPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphBlurTask;\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 NodeRenderGraphBlurPostProcessBlock\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 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 FrameGraphBlurTask(this.name, frameGraph, new ThinBlurPostProcess(name, scene.getEngine(), new Vector2(1, 0), 32));\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 /** The direction in which to blur the image */\r\n @editableInPropertyPage(\"Direction\", PropertyTypeForEdition.Vector2, \"PROPERTIES\")\r\n public get direction(): Vector2 {\r\n return this._frameGraphTask.postProcess.direction;\r\n }\r\n\r\n public set direction(value: Vector2) {\r\n this._frameGraphTask.postProcess.direction = value;\r\n }\r\n\r\n /** Length in pixels of the blur sample region */\r\n @editableInPropertyPage(\"Kernel\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 256 })\r\n public get kernel(): number {\r\n return this._frameGraphTask.postProcess.kernel;\r\n }\r\n\r\n public set kernel(value: number) {\r\n this._frameGraphTask.postProcess.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 \"NodeRenderGraphBlurPostProcessBlock\";\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._frameGraphTask.name = this.name;\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 const sourceConnectedPoint = this.source.connectedPoint;\r\n if (sourceConnectedPoint) {\r\n this._frameGraphTask.sourceTexture = sourceConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.direction = new BABYLON.Vector2(${this.direction.x}, ${this.direction.y});`);\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.direction = this.direction.asArray();\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.direction.fromArray(serializationObject.direction);\r\n this.kernel = serializationObject.kernel;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphBlurPostProcessBlock\", NodeRenderGraphBlurPostProcessBlock);\r\n"]}
|