@babylonjs/core 7.31.2 → 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,49 @@
|
|
|
1
|
+
import type { Nullable, FrameGraphRenderContext, AbstractEngine, IFrameGraphPass, FrameGraphTextureHandle, FrameGraphTask } from "../../index.js";
|
|
2
|
+
import { FrameGraphPass } from "./pass";
|
|
3
|
+
/**
|
|
4
|
+
* Render pass used to render objects.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FrameGraphRenderPass extends FrameGraphPass<FrameGraphRenderContext> {
|
|
7
|
+
protected _engine: AbstractEngine;
|
|
8
|
+
protected _renderTarget: FrameGraphTextureHandle;
|
|
9
|
+
protected _renderTargetDepth: FrameGraphTextureHandle | undefined;
|
|
10
|
+
protected _usedTextures: FrameGraphTextureHandle[];
|
|
11
|
+
protected _depthShared: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Checks if a pass is a render pass.
|
|
14
|
+
* @param pass The pass to check.
|
|
15
|
+
* @returns True if the pass is a render pass, else false.
|
|
16
|
+
*/
|
|
17
|
+
static IsRenderPass(pass: IFrameGraphPass): pass is FrameGraphRenderPass;
|
|
18
|
+
/**
|
|
19
|
+
* Gets the render target used by the render pass.
|
|
20
|
+
*/
|
|
21
|
+
get renderTarget(): FrameGraphTextureHandle;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the render target depth used by the render pass.
|
|
24
|
+
*/
|
|
25
|
+
get renderTargetDepth(): FrameGraphTextureHandle | undefined;
|
|
26
|
+
/** @internal */
|
|
27
|
+
constructor(name: string, parentTask: FrameGraphTask, context: FrameGraphRenderContext, engine: AbstractEngine);
|
|
28
|
+
/**
|
|
29
|
+
* Indicates that the pass will use the given texture.
|
|
30
|
+
* Use this method to indicate that the pass will use a texture so that the frame graph can handle the texture's lifecycle.
|
|
31
|
+
* You don't have to call this method for the render target / render target depth textures.
|
|
32
|
+
* @param texture The texture used.
|
|
33
|
+
*/
|
|
34
|
+
useTexture(texture: FrameGraphTextureHandle): void;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the render target to use for rendering.
|
|
37
|
+
* @param renderTargetHandle The render target to use for rendering.
|
|
38
|
+
*/
|
|
39
|
+
setRenderTarget(renderTargetHandle: FrameGraphTextureHandle): void;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the render target depth to use for rendering.
|
|
42
|
+
* @param renderTargetHandle The render target depth to use for rendering.
|
|
43
|
+
*/
|
|
44
|
+
setRenderTargetDepth(renderTargetHandle?: FrameGraphTextureHandle): void;
|
|
45
|
+
/** @internal */
|
|
46
|
+
_execute(): void;
|
|
47
|
+
/** @internal */
|
|
48
|
+
_isValid(): Nullable<string>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { FrameGraphPass } from "./pass.js";
|
|
2
|
+
/**
|
|
3
|
+
* Render pass used to render objects.
|
|
4
|
+
*/
|
|
5
|
+
export class FrameGraphRenderPass extends FrameGraphPass {
|
|
6
|
+
/**
|
|
7
|
+
* Checks if a pass is a render pass.
|
|
8
|
+
* @param pass The pass to check.
|
|
9
|
+
* @returns True if the pass is a render pass, else false.
|
|
10
|
+
*/
|
|
11
|
+
static IsRenderPass(pass) {
|
|
12
|
+
return pass.setRenderTarget !== undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Gets the render target used by the render pass.
|
|
16
|
+
*/
|
|
17
|
+
get renderTarget() {
|
|
18
|
+
return this._renderTarget;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Gets the render target depth used by the render pass.
|
|
22
|
+
*/
|
|
23
|
+
get renderTargetDepth() {
|
|
24
|
+
return this._renderTargetDepth;
|
|
25
|
+
}
|
|
26
|
+
/** @internal */
|
|
27
|
+
constructor(name, parentTask, context, engine) {
|
|
28
|
+
super(name, parentTask, context);
|
|
29
|
+
this._usedTextures = [];
|
|
30
|
+
this._depthShared = false;
|
|
31
|
+
this._engine = engine;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Indicates that the pass will use the given texture.
|
|
35
|
+
* Use this method to indicate that the pass will use a texture so that the frame graph can handle the texture's lifecycle.
|
|
36
|
+
* You don't have to call this method for the render target / render target depth textures.
|
|
37
|
+
* @param texture The texture used.
|
|
38
|
+
*/
|
|
39
|
+
useTexture(texture) {
|
|
40
|
+
this._usedTextures.push(texture);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Sets the render target to use for rendering.
|
|
44
|
+
* @param renderTargetHandle The render target to use for rendering.
|
|
45
|
+
*/
|
|
46
|
+
setRenderTarget(renderTargetHandle) {
|
|
47
|
+
this._renderTarget = renderTargetHandle;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Sets the render target depth to use for rendering.
|
|
51
|
+
* @param renderTargetHandle The render target depth to use for rendering.
|
|
52
|
+
*/
|
|
53
|
+
setRenderTargetDepth(renderTargetHandle) {
|
|
54
|
+
this._renderTargetDepth = renderTargetHandle;
|
|
55
|
+
}
|
|
56
|
+
/** @internal */
|
|
57
|
+
_execute() {
|
|
58
|
+
if (this._renderTargetDepth && !this._depthShared) {
|
|
59
|
+
this._context._shareDepth(this._renderTargetDepth, this._renderTarget);
|
|
60
|
+
this._depthShared = true;
|
|
61
|
+
}
|
|
62
|
+
this._context._bindRenderTarget(this._renderTarget, `frame graph - render pass '${this.name}'`);
|
|
63
|
+
super._execute();
|
|
64
|
+
this._context._flushDebugMessages();
|
|
65
|
+
}
|
|
66
|
+
/** @internal */
|
|
67
|
+
_isValid() {
|
|
68
|
+
const errMsg = super._isValid();
|
|
69
|
+
return errMsg ? errMsg : this._renderTarget !== undefined ? null : "Render target is not set (call setRenderTarget to set it)";
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=renderPass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderPass.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Passes/renderPass.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,cAAuC;IAO7E;;;;OAIG;IACI,MAAM,CAAC,YAAY,CAAC,IAAqB;QAC5C,OAAQ,IAA6B,CAAC,eAAe,KAAK,SAAS,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;IAED,gBAAgB;IAChB,YAAY,IAAY,EAAE,UAA0B,EAAE,OAAgC,EAAE,MAAsB;QAC1G,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QA5B3B,kBAAa,GAA8B,EAAE,CAAC;QAC9C,iBAAY,GAAG,KAAK,CAAC;QA4B3B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED;;;;;OAKG;IACI,UAAU,CAAC,OAAgC;QAC9C,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED;;;OAGG;IACI,eAAe,CAAC,kBAA2C;QAC9D,IAAI,CAAC,aAAa,GAAG,kBAAkB,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACI,oBAAoB,CAAC,kBAA4C;QACpE,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IACjD,CAAC;IAED,gBAAgB;IACA,QAAQ;QACpB,IAAI,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YAC/C,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YACvE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;SAC5B;QAED,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,EAAE,8BAA8B,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;QAEhG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAEjB,IAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE,CAAC;IACxC,CAAC;IAED,gBAAgB;IACA,QAAQ;QACpB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,2DAA2D,CAAC;IACnI,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, FrameGraphRenderContext, AbstractEngine, IFrameGraphPass, FrameGraphTextureHandle, FrameGraphTask } from \"core/index\";\r\nimport { FrameGraphPass } from \"./pass\";\r\n\r\n/**\r\n * Render pass used to render objects.\r\n */\r\nexport class FrameGraphRenderPass extends FrameGraphPass<FrameGraphRenderContext> {\r\n protected _engine: AbstractEngine;\r\n protected _renderTarget: FrameGraphTextureHandle;\r\n protected _renderTargetDepth: FrameGraphTextureHandle | undefined;\r\n protected _usedTextures: FrameGraphTextureHandle[] = [];\r\n protected _depthShared = false;\r\n\r\n /**\r\n * Checks if a pass is a render pass.\r\n * @param pass The pass to check.\r\n * @returns True if the pass is a render pass, else false.\r\n */\r\n public static IsRenderPass(pass: IFrameGraphPass): pass is FrameGraphRenderPass {\r\n return (pass as FrameGraphRenderPass).setRenderTarget !== undefined;\r\n }\r\n\r\n /**\r\n * Gets the render target used by the render pass.\r\n */\r\n public get renderTarget(): FrameGraphTextureHandle {\r\n return this._renderTarget;\r\n }\r\n\r\n /**\r\n * Gets the render target depth used by the render pass.\r\n */\r\n public get renderTargetDepth(): FrameGraphTextureHandle | undefined {\r\n return this._renderTargetDepth;\r\n }\r\n\r\n /** @internal */\r\n constructor(name: string, parentTask: FrameGraphTask, context: FrameGraphRenderContext, engine: AbstractEngine) {\r\n super(name, parentTask, context);\r\n this._engine = engine;\r\n }\r\n\r\n /**\r\n * Indicates that the pass will use the given texture.\r\n * Use this method to indicate that the pass will use a texture so that the frame graph can handle the texture's lifecycle.\r\n * You don't have to call this method for the render target / render target depth textures.\r\n * @param texture The texture used.\r\n */\r\n public useTexture(texture: FrameGraphTextureHandle) {\r\n this._usedTextures.push(texture);\r\n }\r\n\r\n /**\r\n * Sets the render target to use for rendering.\r\n * @param renderTargetHandle The render target to use for rendering.\r\n */\r\n public setRenderTarget(renderTargetHandle: FrameGraphTextureHandle) {\r\n this._renderTarget = renderTargetHandle;\r\n }\r\n\r\n /**\r\n * Sets the render target depth to use for rendering.\r\n * @param renderTargetHandle The render target depth to use for rendering.\r\n */\r\n public setRenderTargetDepth(renderTargetHandle?: FrameGraphTextureHandle) {\r\n this._renderTargetDepth = renderTargetHandle;\r\n }\r\n\r\n /** @internal */\r\n public override _execute() {\r\n if (this._renderTargetDepth && !this._depthShared) {\r\n this._context._shareDepth(this._renderTargetDepth, this._renderTarget);\r\n this._depthShared = true;\r\n }\r\n\r\n this._context._bindRenderTarget(this._renderTarget, `frame graph - render pass '${this.name}'`);\r\n\r\n super._execute();\r\n\r\n this._context._flushDebugMessages();\r\n }\r\n\r\n /** @internal */\r\n public override _isValid(): Nullable<string> {\r\n const errMsg = super._isValid();\r\n return errMsg ? errMsg : this._renderTarget !== undefined ? null : \"Render target is not set (call setRenderTarget to set it)\";\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FrameGraph } from "../../frameGraph.js";
|
|
2
|
+
import { ThinBlackAndWhitePostProcess } from "../../../PostProcesses/thinBlackAndWhitePostProcess.js";
|
|
3
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask";
|
|
4
|
+
/**
|
|
5
|
+
* Task which applies a black and white post process.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FrameGraphBlackAndWhiteTask extends FrameGraphPostProcessTask {
|
|
8
|
+
readonly postProcess: ThinBlackAndWhitePostProcess;
|
|
9
|
+
/**
|
|
10
|
+
* Constructs a new black and white task.
|
|
11
|
+
* @param name The name of the task.
|
|
12
|
+
* @param frameGraph The frame graph this task is associated with.
|
|
13
|
+
* @param thinPostProcess The thin post process to use for the black and white effect. If not provided, a new one will be created.
|
|
14
|
+
*/
|
|
15
|
+
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinBlackAndWhitePostProcess);
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ThinBlackAndWhitePostProcess } from "../../../PostProcesses/thinBlackAndWhitePostProcess.js";
|
|
2
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask.js";
|
|
3
|
+
/**
|
|
4
|
+
* Task which applies a black and white post process.
|
|
5
|
+
*/
|
|
6
|
+
export class FrameGraphBlackAndWhiteTask extends FrameGraphPostProcessTask {
|
|
7
|
+
/**
|
|
8
|
+
* Constructs a new black and white task.
|
|
9
|
+
* @param name The name of the task.
|
|
10
|
+
* @param frameGraph The frame graph this task is associated with.
|
|
11
|
+
* @param thinPostProcess The thin post process to use for the black and white effect. If not provided, a new one will be created.
|
|
12
|
+
*/
|
|
13
|
+
constructor(name, frameGraph, thinPostProcess) {
|
|
14
|
+
super(name, frameGraph, thinPostProcess || new ThinBlackAndWhitePostProcess(name, frameGraph.engine));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=blackAndWhiteTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blackAndWhiteTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,+DAAwD;AAC/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,yBAAyB;IAGtE;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAA8C;QAC5F,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,4BAA4B,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1G,CAAC;CACJ","sourcesContent":["import type { FrameGraph } from \"core/FrameGraph/frameGraph\";\r\nimport { ThinBlackAndWhitePostProcess } from \"core/PostProcesses/thinBlackAndWhitePostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\n\r\n/**\r\n * Task which applies a black and white post process.\r\n */\r\nexport class FrameGraphBlackAndWhiteTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinBlackAndWhitePostProcess;\r\n\r\n /**\r\n * Constructs a new black and white task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param thinPostProcess The thin post process to use for the black and white effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinBlackAndWhitePostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinBlackAndWhitePostProcess(name, frameGraph.engine));\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from "../../../index.js";
|
|
2
|
+
import { ThinBloomMergePostProcess } from "../../../PostProcesses/thinBloomMergePostProcess.js";
|
|
3
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class FrameGraphBloomMergeTask extends FrameGraphPostProcessTask {
|
|
8
|
+
blurTexture: FrameGraphTextureHandle;
|
|
9
|
+
readonly postProcess: ThinBloomMergePostProcess;
|
|
10
|
+
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinBloomMergePostProcess);
|
|
11
|
+
record(skipCreationOfDisabledPasses?: boolean): FrameGraphRenderPass;
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ThinBloomMergePostProcess } from "../../../PostProcesses/thinBloomMergePostProcess.js";
|
|
2
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask.js";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export class FrameGraphBloomMergeTask extends FrameGraphPostProcessTask {
|
|
7
|
+
constructor(name, frameGraph, thinPostProcess) {
|
|
8
|
+
super(name, frameGraph, thinPostProcess || new ThinBloomMergePostProcess(name, frameGraph.engine));
|
|
9
|
+
}
|
|
10
|
+
record(skipCreationOfDisabledPasses = false) {
|
|
11
|
+
if (this.sourceTexture === undefined || this.blurTexture === undefined) {
|
|
12
|
+
throw new Error(`FrameGraphBloomMergeTask "${this.name}": sourceTexture and blurTexture are required`);
|
|
13
|
+
}
|
|
14
|
+
const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {
|
|
15
|
+
context.bindTextureHandle(this._postProcessDrawWrapper.effect, "bloomBlur", this.blurTexture);
|
|
16
|
+
});
|
|
17
|
+
pass.useTexture(this.blurTexture);
|
|
18
|
+
return pass;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=bloomMergeTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bloomMergeTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/bloomMergeTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,4DAAqD;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,yBAAyB;IAKnE,YAAY,IAAY,EAAE,UAAsB,EAAE,eAA2C;QACzF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,yBAAyB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACvG,CAAC;IAEe,MAAM,CAAC,4BAA4B,GAAG,KAAK;QACvD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE;YACpE,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,CAAC,IAAI,+CAA+C,CAAC,CAAC;SAC1G;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;YAC3E,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACnG,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAElC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from \"core/index\";\r\nimport { ThinBloomMergePostProcess } from \"core/PostProcesses/thinBloomMergePostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class FrameGraphBloomMergeTask extends FrameGraphPostProcessTask {\r\n public blurTexture: FrameGraphTextureHandle;\r\n\r\n public override readonly postProcess: ThinBloomMergePostProcess;\r\n\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinBloomMergePostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinBloomMergePostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined || this.blurTexture === undefined) {\r\n throw new Error(`FrameGraphBloomMergeTask \"${this.name}\": sourceTexture and blurTexture are required`);\r\n }\r\n\r\n const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"bloomBlur\", this.blurTexture);\r\n });\r\n\r\n pass.useTexture(this.blurTexture);\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphTextureHandle, AbstractEngine } from "../../../index.js";
|
|
2
|
+
import { FrameGraphTask } from "../../frameGraphTask";
|
|
3
|
+
import { ThinBloomEffect } from "../../../PostProcesses/thinBloomEffect.js";
|
|
4
|
+
/**
|
|
5
|
+
* Task which applies a bloom render effect.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FrameGraphBloomTask extends FrameGraphTask {
|
|
8
|
+
/**
|
|
9
|
+
* The source texture to apply the bloom effect on.
|
|
10
|
+
*/
|
|
11
|
+
sourceTexture: FrameGraphTextureHandle;
|
|
12
|
+
/**
|
|
13
|
+
* The sampling mode to use for the source texture.
|
|
14
|
+
*/
|
|
15
|
+
sourceSamplingMode: number;
|
|
16
|
+
/**
|
|
17
|
+
* The destination texture to render the bloom effect to.
|
|
18
|
+
* If not supplied, a texture with the same configuration as the source texture will be created.
|
|
19
|
+
*/
|
|
20
|
+
destinationTexture?: FrameGraphTextureHandle;
|
|
21
|
+
/**
|
|
22
|
+
* The output texture of the bloom effect.
|
|
23
|
+
*/
|
|
24
|
+
readonly outputTexture: FrameGraphTextureHandle;
|
|
25
|
+
/**
|
|
26
|
+
* The bloom effect to apply.
|
|
27
|
+
*/
|
|
28
|
+
readonly bloom: ThinBloomEffect;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the bloom effect is HDR.
|
|
31
|
+
* When true, the bloom effect will use a higher precision texture format (half float or float). Else, it will use unsigned byte.
|
|
32
|
+
*/
|
|
33
|
+
readonly hdr: boolean;
|
|
34
|
+
private _downscale;
|
|
35
|
+
private _blurX;
|
|
36
|
+
private _blurY;
|
|
37
|
+
private _merge;
|
|
38
|
+
private _defaultPipelineTextureType;
|
|
39
|
+
/**
|
|
40
|
+
* Constructs a new bloom task.
|
|
41
|
+
* @param name Name of the task.
|
|
42
|
+
* @param frameGraph The frame graph this task is associated with.
|
|
43
|
+
* @param engine The engine to use for the bloom effect.
|
|
44
|
+
* @param weight Weight of the bloom effect.
|
|
45
|
+
* @param kernel Kernel size of the bloom effect.
|
|
46
|
+
* @param threshold Threshold of the bloom effect.
|
|
47
|
+
* @param hdr Whether the bloom effect is HDR.
|
|
48
|
+
* @param bloomScale The scale of the bloom effect. This value is multiplied by the source texture size to determine the bloom texture size.
|
|
49
|
+
*/
|
|
50
|
+
constructor(name: string, frameGraph: FrameGraph, engine: AbstractEngine, weight: number, kernel: number, threshold: number, hdr?: boolean, bloomScale?: number);
|
|
51
|
+
isReady(): boolean;
|
|
52
|
+
record(): void;
|
|
53
|
+
dispose(): void;
|
|
54
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
|
|
2
|
+
import { FrameGraphBloomMergeTask } from "./bloomMergeTask.js";
|
|
3
|
+
import { FrameGraphTask } from "../../frameGraphTask.js";
|
|
4
|
+
import { ThinBloomEffect } from "../../../PostProcesses/thinBloomEffect.js";
|
|
5
|
+
import { FrameGraphExtractHighlightsTask } from "./extractHighlightsTask.js";
|
|
6
|
+
import { FrameGraphBlurTask } from "./blurTask.js";
|
|
7
|
+
/**
|
|
8
|
+
* Task which applies a bloom render effect.
|
|
9
|
+
*/
|
|
10
|
+
export class FrameGraphBloomTask extends FrameGraphTask {
|
|
11
|
+
/**
|
|
12
|
+
* Constructs a new bloom task.
|
|
13
|
+
* @param name Name of the task.
|
|
14
|
+
* @param frameGraph The frame graph this task is associated with.
|
|
15
|
+
* @param engine The engine to use for the bloom effect.
|
|
16
|
+
* @param weight Weight of the bloom effect.
|
|
17
|
+
* @param kernel Kernel size of the bloom effect.
|
|
18
|
+
* @param threshold Threshold of the bloom effect.
|
|
19
|
+
* @param hdr Whether the bloom effect is HDR.
|
|
20
|
+
* @param bloomScale The scale of the bloom effect. This value is multiplied by the source texture size to determine the bloom texture size.
|
|
21
|
+
*/
|
|
22
|
+
constructor(name, frameGraph, engine, weight, kernel, threshold, hdr = false, bloomScale = 0.5) {
|
|
23
|
+
super(name, frameGraph);
|
|
24
|
+
/**
|
|
25
|
+
* The sampling mode to use for the source texture.
|
|
26
|
+
*/
|
|
27
|
+
this.sourceSamplingMode = 2;
|
|
28
|
+
this.hdr = hdr;
|
|
29
|
+
this._defaultPipelineTextureType = 0;
|
|
30
|
+
if (hdr) {
|
|
31
|
+
const caps = engine.getCaps();
|
|
32
|
+
if (caps.textureHalfFloatRender) {
|
|
33
|
+
this._defaultPipelineTextureType = 2;
|
|
34
|
+
}
|
|
35
|
+
else if (caps.textureFloatRender) {
|
|
36
|
+
this._defaultPipelineTextureType = 1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
this.bloom = new ThinBloomEffect(name, engine, bloomScale);
|
|
40
|
+
this.bloom.threshold = threshold;
|
|
41
|
+
this.bloom.kernel = kernel;
|
|
42
|
+
this.bloom.weight = weight;
|
|
43
|
+
this._downscale = new FrameGraphExtractHighlightsTask(`${name} Downscale`, this._frameGraph, this.bloom._downscale);
|
|
44
|
+
this._blurX = new FrameGraphBlurTask(`${name} Blur X`, this._frameGraph, this.bloom._blurX);
|
|
45
|
+
this._blurY = new FrameGraphBlurTask(`${name} Blur Y`, this._frameGraph, this.bloom._blurY);
|
|
46
|
+
this._merge = new FrameGraphBloomMergeTask(`${name} Merge`, this._frameGraph, this.bloom._merge);
|
|
47
|
+
this.outputTexture = this._frameGraph.createDanglingHandle();
|
|
48
|
+
}
|
|
49
|
+
isReady() {
|
|
50
|
+
return this.bloom.isReady();
|
|
51
|
+
}
|
|
52
|
+
record() {
|
|
53
|
+
if (this.sourceTexture === undefined) {
|
|
54
|
+
throw new Error("FrameGraphBloomTask: sourceTexture is required");
|
|
55
|
+
}
|
|
56
|
+
const sourceTextureDescription = this._frameGraph.getTextureDescription(this.sourceTexture);
|
|
57
|
+
const textureCreationOptions = {
|
|
58
|
+
size: {
|
|
59
|
+
width: Math.floor(sourceTextureDescription.size.width * this.bloom.scale),
|
|
60
|
+
height: Math.floor(sourceTextureDescription.size.height * this.bloom.scale),
|
|
61
|
+
},
|
|
62
|
+
options: {
|
|
63
|
+
createMipMaps: false,
|
|
64
|
+
generateMipMaps: false,
|
|
65
|
+
types: [this._defaultPipelineTextureType],
|
|
66
|
+
samplingModes: [2],
|
|
67
|
+
formats: [5],
|
|
68
|
+
samples: 1,
|
|
69
|
+
useSRGBBuffers: [false],
|
|
70
|
+
generateDepthBuffer: false,
|
|
71
|
+
generateStencilBuffer: false,
|
|
72
|
+
label: "",
|
|
73
|
+
},
|
|
74
|
+
sizeIsPercentage: false,
|
|
75
|
+
};
|
|
76
|
+
const downscaleTextureHandle = this._frameGraph.createRenderTargetTexture(this._downscale.name, textureCreationOptions);
|
|
77
|
+
this._downscale.sourceTexture = this.sourceTexture;
|
|
78
|
+
this._downscale.sourceSamplingMode = 2;
|
|
79
|
+
this._downscale.destinationTexture = downscaleTextureHandle;
|
|
80
|
+
this._downscale.record(true);
|
|
81
|
+
const blurXTextureHandle = this._frameGraph.createRenderTargetTexture(this._blurX.name, textureCreationOptions);
|
|
82
|
+
this._blurX.sourceTexture = downscaleTextureHandle;
|
|
83
|
+
this._blurX.sourceSamplingMode = 2;
|
|
84
|
+
this._blurX.destinationTexture = blurXTextureHandle;
|
|
85
|
+
this._blurX.record(true);
|
|
86
|
+
const blurYTextureHandle = this._frameGraph.createRenderTargetTexture(this._blurY.name, textureCreationOptions);
|
|
87
|
+
this._blurY.sourceTexture = blurXTextureHandle;
|
|
88
|
+
this._blurY.sourceSamplingMode = 2;
|
|
89
|
+
this._blurY.destinationTexture = blurYTextureHandle;
|
|
90
|
+
this._blurY.record(true);
|
|
91
|
+
const sourceTextureCreationOptions = this._frameGraph.getTextureCreationOptions(this.sourceTexture, true);
|
|
92
|
+
sourceTextureCreationOptions.options.generateDepthBuffer = false;
|
|
93
|
+
sourceTextureCreationOptions.options.generateStencilBuffer = false;
|
|
94
|
+
this._frameGraph.resolveDanglingHandle(this.outputTexture, this.destinationTexture, this._merge.name, sourceTextureCreationOptions);
|
|
95
|
+
this._merge.sourceTexture = this.sourceTexture;
|
|
96
|
+
this._merge.sourceSamplingMode = this.sourceSamplingMode;
|
|
97
|
+
this._merge.blurTexture = blurYTextureHandle;
|
|
98
|
+
this._merge.destinationTexture = this.outputTexture;
|
|
99
|
+
this._merge.record(true);
|
|
100
|
+
const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
|
|
101
|
+
passDisabled.setRenderTarget(this.outputTexture);
|
|
102
|
+
passDisabled.setExecuteFunc((context) => {
|
|
103
|
+
context.copyTexture(this.sourceTexture);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
dispose() {
|
|
107
|
+
this._downscale.dispose();
|
|
108
|
+
this._blurX.dispose();
|
|
109
|
+
this._blurY.dispose();
|
|
110
|
+
this._merge.dispose();
|
|
111
|
+
super.dispose();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=bloomTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bloomTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/bloomTask.ts"],"names":[],"mappings":"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","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureCreationOptions, FrameGraphTextureHandle, AbstractEngine } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphBloomMergeTask } from \"./bloomMergeTask\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\nimport { ThinBloomEffect } from \"core/PostProcesses/thinBloomEffect\";\r\nimport { FrameGraphExtractHighlightsTask } from \"./extractHighlightsTask\";\r\nimport { FrameGraphBlurTask } from \"./blurTask\";\r\n\r\n/**\r\n * Task which applies a bloom render effect.\r\n */\r\nexport class FrameGraphBloomTask extends FrameGraphTask {\r\n /**\r\n * The source texture to apply the bloom effect on.\r\n */\r\n public sourceTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The sampling mode to use for the source texture.\r\n */\r\n public sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n /**\r\n * The destination texture to render the bloom effect to.\r\n * If not supplied, a texture with the same configuration as the source texture will be created.\r\n */\r\n public destinationTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture of the bloom effect.\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The bloom effect to apply.\r\n */\r\n public readonly bloom: ThinBloomEffect;\r\n\r\n /**\r\n * Whether the bloom effect is HDR.\r\n * When true, the bloom effect will use a higher precision texture format (half float or float). Else, it will use unsigned byte.\r\n */\r\n public readonly hdr: boolean;\r\n\r\n private _downscale: FrameGraphExtractHighlightsTask;\r\n private _blurX: FrameGraphBlurTask;\r\n private _blurY: FrameGraphBlurTask;\r\n private _merge: FrameGraphBloomMergeTask;\r\n private _defaultPipelineTextureType: number;\r\n\r\n /**\r\n * Constructs a new bloom task.\r\n * @param name Name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param engine The engine to use for the bloom effect.\r\n * @param weight Weight of the bloom effect.\r\n * @param kernel Kernel size of the bloom effect.\r\n * @param threshold Threshold of the bloom effect.\r\n * @param hdr Whether the bloom effect is HDR.\r\n * @param bloomScale The scale of the bloom effect. This value is multiplied by the source texture size to determine the bloom texture size.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, engine: AbstractEngine, weight: number, kernel: number, threshold: number, hdr = false, bloomScale = 0.5) {\r\n super(name, frameGraph);\r\n\r\n this.hdr = hdr;\r\n\r\n this._defaultPipelineTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n if (hdr) {\r\n const caps = engine.getCaps();\r\n if (caps.textureHalfFloatRender) {\r\n this._defaultPipelineTextureType = Constants.TEXTURETYPE_HALF_FLOAT;\r\n } else if (caps.textureFloatRender) {\r\n this._defaultPipelineTextureType = Constants.TEXTURETYPE_FLOAT;\r\n }\r\n }\r\n\r\n this.bloom = new ThinBloomEffect(name, engine, bloomScale);\r\n this.bloom.threshold = threshold;\r\n this.bloom.kernel = kernel;\r\n this.bloom.weight = weight;\r\n\r\n this._downscale = new FrameGraphExtractHighlightsTask(`${name} Downscale`, this._frameGraph, this.bloom._downscale);\r\n this._blurX = new FrameGraphBlurTask(`${name} Blur X`, this._frameGraph, this.bloom._blurX);\r\n this._blurY = new FrameGraphBlurTask(`${name} Blur Y`, this._frameGraph, this.bloom._blurY);\r\n this._merge = new FrameGraphBloomMergeTask(`${name} Merge`, this._frameGraph, this.bloom._merge);\r\n\r\n this.outputTexture = this._frameGraph.createDanglingHandle();\r\n }\r\n\r\n public override isReady() {\r\n return this.bloom.isReady();\r\n }\r\n\r\n public record(): void {\r\n if (this.sourceTexture === undefined) {\r\n throw new Error(\"FrameGraphBloomTask: sourceTexture is required\");\r\n }\r\n\r\n const sourceTextureDescription = this._frameGraph.getTextureDescription(this.sourceTexture);\r\n\r\n const textureCreationOptions: FrameGraphTextureCreationOptions = {\r\n size: {\r\n width: Math.floor(sourceTextureDescription.size.width * this.bloom.scale),\r\n height: Math.floor(sourceTextureDescription.size.height * this.bloom.scale),\r\n },\r\n options: {\r\n createMipMaps: false,\r\n generateMipMaps: false,\r\n types: [this._defaultPipelineTextureType],\r\n samplingModes: [Constants.TEXTURE_BILINEAR_SAMPLINGMODE],\r\n formats: [Constants.TEXTUREFORMAT_RGBA],\r\n samples: 1,\r\n useSRGBBuffers: [false],\r\n generateDepthBuffer: false,\r\n generateStencilBuffer: false,\r\n label: \"\",\r\n },\r\n sizeIsPercentage: false,\r\n };\r\n\r\n const downscaleTextureHandle = this._frameGraph.createRenderTargetTexture(this._downscale.name, textureCreationOptions);\r\n\r\n this._downscale.sourceTexture = this.sourceTexture;\r\n this._downscale.sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._downscale.destinationTexture = downscaleTextureHandle;\r\n this._downscale.record(true);\r\n\r\n const blurXTextureHandle = this._frameGraph.createRenderTargetTexture(this._blurX.name, textureCreationOptions);\r\n\r\n this._blurX.sourceTexture = downscaleTextureHandle;\r\n this._blurX.sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurX.destinationTexture = blurXTextureHandle;\r\n this._blurX.record(true);\r\n\r\n const blurYTextureHandle = this._frameGraph.createRenderTargetTexture(this._blurY.name, textureCreationOptions);\r\n\r\n this._blurY.sourceTexture = blurXTextureHandle;\r\n this._blurY.sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurY.destinationTexture = blurYTextureHandle;\r\n this._blurY.record(true);\r\n\r\n const sourceTextureCreationOptions = this._frameGraph.getTextureCreationOptions(this.sourceTexture, true);\r\n sourceTextureCreationOptions.options.generateDepthBuffer = false;\r\n sourceTextureCreationOptions.options.generateStencilBuffer = false;\r\n\r\n this._frameGraph.resolveDanglingHandle(this.outputTexture, this.destinationTexture, this._merge.name, sourceTextureCreationOptions);\r\n\r\n this._merge.sourceTexture = this.sourceTexture;\r\n this._merge.sourceSamplingMode = this.sourceSamplingMode;\r\n this._merge.blurTexture = blurYTextureHandle;\r\n this._merge.destinationTexture = this.outputTexture;\r\n this._merge.record(true);\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setExecuteFunc((context) => {\r\n context.copyTexture(this.sourceTexture);\r\n });\r\n }\r\n\r\n public override dispose(): void {\r\n this._downscale.dispose();\r\n this._blurX.dispose();\r\n this._blurY.dispose();\r\n this._merge.dispose();\r\n super.dispose();\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphRenderContext, FrameGraphRenderPass } from "../../../index.js";
|
|
2
|
+
import { ThinBlurPostProcess } from "../../../PostProcesses/thinBlurPostProcess.js";
|
|
3
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask";
|
|
4
|
+
/**
|
|
5
|
+
* Task which applies a blur post process.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FrameGraphBlurTask extends FrameGraphPostProcessTask {
|
|
8
|
+
readonly postProcess: ThinBlurPostProcess;
|
|
9
|
+
/**
|
|
10
|
+
* Constructs a new blur task.
|
|
11
|
+
* @param name Name of the task.
|
|
12
|
+
* @param frameGraph Frame graph this task is associated with.
|
|
13
|
+
* @param thinPostProcess The thin post process to use for the blur effect.
|
|
14
|
+
*/
|
|
15
|
+
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinBlurPostProcess);
|
|
16
|
+
record(skipCreationOfDisabledPasses?: boolean, additionalExecute?: (context: FrameGraphRenderContext) => void, additionalBindings?: (context: FrameGraphRenderContext) => void): FrameGraphRenderPass;
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ThinBlurPostProcess } from "../../../PostProcesses/thinBlurPostProcess.js";
|
|
2
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask.js";
|
|
3
|
+
import { Vector2 } from "../../../Maths/math.vector.js";
|
|
4
|
+
/**
|
|
5
|
+
* Task which applies a blur post process.
|
|
6
|
+
*/
|
|
7
|
+
export class FrameGraphBlurTask extends FrameGraphPostProcessTask {
|
|
8
|
+
/**
|
|
9
|
+
* Constructs a new blur task.
|
|
10
|
+
* @param name Name of the task.
|
|
11
|
+
* @param frameGraph Frame graph this task is associated with.
|
|
12
|
+
* @param thinPostProcess The thin post process to use for the blur effect.
|
|
13
|
+
*/
|
|
14
|
+
constructor(name, frameGraph, thinPostProcess) {
|
|
15
|
+
super(name, frameGraph, thinPostProcess || new ThinBlurPostProcess(name, frameGraph.engine, new Vector2(1, 0), 10));
|
|
16
|
+
}
|
|
17
|
+
record(skipCreationOfDisabledPasses = false, additionalExecute, additionalBindings) {
|
|
18
|
+
const pass = super.record(skipCreationOfDisabledPasses, additionalExecute, additionalBindings);
|
|
19
|
+
this.postProcess.textureWidth = this._outputWidth;
|
|
20
|
+
this.postProcess.textureHeight = this._outputHeight;
|
|
21
|
+
return pass;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=blurTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blurTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/blurTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,sDAA+C;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAEjD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,yBAAyB;IAG7D;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAqC;QACnF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACxH,CAAC;IAEe,MAAM,CAClB,4BAA4B,GAAG,KAAK,EACpC,iBAA8D,EAC9D,kBAA+D;QAE/D,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;QAE/F,IAAI,CAAC,WAAW,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QAClD,IAAI,CAAC,WAAW,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QAEpD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphRenderContext, FrameGraphRenderPass } from \"core/index\";\r\nimport { ThinBlurPostProcess } from \"core/PostProcesses/thinBlurPostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Task which applies a blur post process.\r\n */\r\nexport class FrameGraphBlurTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinBlurPostProcess;\r\n\r\n /**\r\n * Constructs a new blur task.\r\n * @param name Name of the task.\r\n * @param frameGraph Frame graph this task is associated with.\r\n * @param thinPostProcess The thin post process to use for the blur effect.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinBlurPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinBlurPostProcess(name, frameGraph.engine, new Vector2(1, 0), 10));\r\n }\r\n\r\n public override record(\r\n skipCreationOfDisabledPasses = false,\r\n additionalExecute?: (context: FrameGraphRenderContext) => void,\r\n additionalBindings?: (context: FrameGraphRenderContext) => void\r\n ): FrameGraphRenderPass {\r\n const pass = super.record(skipCreationOfDisabledPasses, additionalExecute, additionalBindings);\r\n\r\n this.postProcess.textureWidth = this._outputWidth;\r\n this.postProcess.textureHeight = this._outputHeight;\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass, Camera } from "../../../index.js";
|
|
2
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask";
|
|
3
|
+
import { ThinCircleOfConfusionPostProcess } from "../../../PostProcesses/thinCircleOfConfusionPostProcess.js";
|
|
4
|
+
/**
|
|
5
|
+
* Task which applies a circle of confusion post process.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FrameGraphCircleOfConfusionTask extends FrameGraphPostProcessTask {
|
|
8
|
+
/**
|
|
9
|
+
* The depth texture to use for the circle of confusion effect.
|
|
10
|
+
* It must store camera space depth (Z coordinate)
|
|
11
|
+
*/
|
|
12
|
+
depthTexture: FrameGraphTextureHandle;
|
|
13
|
+
/**
|
|
14
|
+
* The sampling mode to use for the depth texture.
|
|
15
|
+
*/
|
|
16
|
+
depthSamplingMode: number;
|
|
17
|
+
/**
|
|
18
|
+
* The camera to use for the circle of confusion effect.
|
|
19
|
+
*/
|
|
20
|
+
camera: Camera;
|
|
21
|
+
readonly postProcess: ThinCircleOfConfusionPostProcess;
|
|
22
|
+
/**
|
|
23
|
+
* Constructs a new circle of confusion task.
|
|
24
|
+
* @param name The name of the task.
|
|
25
|
+
* @param frameGraph The frame graph this task belongs to.
|
|
26
|
+
* @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.
|
|
27
|
+
*/
|
|
28
|
+
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinCircleOfConfusionPostProcess);
|
|
29
|
+
record(skipCreationOfDisabledPasses?: boolean): FrameGraphRenderPass;
|
|
30
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask.js";
|
|
2
|
+
|
|
3
|
+
import { ThinCircleOfConfusionPostProcess } from "../../../PostProcesses/thinCircleOfConfusionPostProcess.js";
|
|
4
|
+
/**
|
|
5
|
+
* Task which applies a circle of confusion post process.
|
|
6
|
+
*/
|
|
7
|
+
export class FrameGraphCircleOfConfusionTask extends FrameGraphPostProcessTask {
|
|
8
|
+
/**
|
|
9
|
+
* Constructs a new circle of confusion task.
|
|
10
|
+
* @param name The name of the task.
|
|
11
|
+
* @param frameGraph The frame graph this task belongs to.
|
|
12
|
+
* @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.
|
|
13
|
+
*/
|
|
14
|
+
constructor(name, frameGraph, thinPostProcess) {
|
|
15
|
+
super(name, frameGraph, thinPostProcess || new ThinCircleOfConfusionPostProcess(name, frameGraph.engine));
|
|
16
|
+
/**
|
|
17
|
+
* The sampling mode to use for the depth texture.
|
|
18
|
+
*/
|
|
19
|
+
this.depthSamplingMode = 2;
|
|
20
|
+
}
|
|
21
|
+
record(skipCreationOfDisabledPasses = false) {
|
|
22
|
+
if (this.sourceTexture === undefined || this.depthTexture === undefined || this.camera === undefined) {
|
|
23
|
+
throw new Error(`FrameGraphCircleOfConfusionTask "${this.name}": sourceTexture, depthTexture and camera are required`);
|
|
24
|
+
}
|
|
25
|
+
const pass = super.record(skipCreationOfDisabledPasses, (context) => {
|
|
26
|
+
context.setTextureSamplingMode(this.depthTexture, this.depthSamplingMode);
|
|
27
|
+
}, (context) => {
|
|
28
|
+
this.postProcess.camera = this.camera;
|
|
29
|
+
context.bindTextureHandle(this._postProcessDrawWrapper.effect, "depthSampler", this.depthTexture);
|
|
30
|
+
});
|
|
31
|
+
pass.useTexture(this.depthTexture);
|
|
32
|
+
return pass;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=circleOfConfusionTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circleOfConfusionTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,sCAA+B;AACnD,OAAO,EAAE,gCAAgC,EAAE,mEAA4D;AAEvG;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,yBAAyB;IAmB1E;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAkD;QAChG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,gCAAgC,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAnB9G;;WAEG;QACI,sBAAiB,GAAG,SAAS,CAAC,6BAA6B,CAAC;IAiBnE,CAAC;IAEe,MAAM,CAAC,4BAA4B,GAAG,KAAK;QACvD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE;YAClG,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,CAAC,IAAI,wDAAwD,CAAC,CAAC;SAC1H;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CACrB,4BAA4B,EAC5B,CAAC,OAAO,EAAE,EAAE;YACR,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC9E,CAAC,EACD,CAAC,OAAO,EAAE,EAAE;YACR,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;YACtC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACvG,CAAC,CACJ,CAAC;QAEF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAEnC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass, Camera } from \"core/index\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { ThinCircleOfConfusionPostProcess } from \"core/PostProcesses/thinCircleOfConfusionPostProcess\";\r\n\r\n/**\r\n * Task which applies a circle of confusion post process.\r\n */\r\nexport class FrameGraphCircleOfConfusionTask extends FrameGraphPostProcessTask {\r\n /**\r\n * The depth texture to use for the circle of confusion effect.\r\n * It must store camera space depth (Z coordinate)\r\n */\r\n public depthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The sampling mode to use for the depth texture.\r\n */\r\n public depthSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n /**\r\n * The camera to use for the circle of confusion effect.\r\n */\r\n public camera: Camera;\r\n\r\n public override readonly postProcess: ThinCircleOfConfusionPostProcess;\r\n\r\n /**\r\n * Constructs a new circle of confusion task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task belongs to.\r\n * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinCircleOfConfusionPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinCircleOfConfusionPostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined || this.depthTexture === undefined || this.camera === undefined) {\r\n throw new Error(`FrameGraphCircleOfConfusionTask \"${this.name}\": sourceTexture, depthTexture and camera are required`);\r\n }\r\n\r\n const pass = super.record(\r\n skipCreationOfDisabledPasses,\r\n (context) => {\r\n context.setTextureSamplingMode(this.depthTexture, this.depthSamplingMode);\r\n },\r\n (context) => {\r\n this.postProcess.camera = this.camera;\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"depthSampler\", this.depthTexture);\r\n }\r\n );\r\n\r\n pass.useTexture(this.depthTexture);\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from "../../../index.js";
|
|
2
|
+
import { FrameGraphBlurTask } from "./blurTask";
|
|
3
|
+
import { ThinDepthOfFieldBlurPostProcess } from "../../../PostProcesses/thinDepthOfFieldBlurPostProcess.js";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class FrameGraphDepthOfFieldBlurTask extends FrameGraphBlurTask {
|
|
8
|
+
circleOfConfusionTexture: FrameGraphTextureHandle;
|
|
9
|
+
circleOfConfusionSamplingMode: number;
|
|
10
|
+
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinDepthOfFieldBlurPostProcess);
|
|
11
|
+
record(skipCreationOfDisabledPasses?: boolean): FrameGraphRenderPass;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
import { FrameGraphBlurTask } from "./blurTask.js";
|
|
3
|
+
import { ThinDepthOfFieldBlurPostProcess } from "../../../PostProcesses/thinDepthOfFieldBlurPostProcess.js";
|
|
4
|
+
import { Vector2 } from "../../../Maths/math.vector.js";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export class FrameGraphDepthOfFieldBlurTask extends FrameGraphBlurTask {
|
|
9
|
+
constructor(name, frameGraph, thinPostProcess) {
|
|
10
|
+
super(name, frameGraph, thinPostProcess || new ThinDepthOfFieldBlurPostProcess(name, frameGraph.engine, new Vector2(1, 0), 10));
|
|
11
|
+
this.circleOfConfusionSamplingMode = 2;
|
|
12
|
+
}
|
|
13
|
+
record(skipCreationOfDisabledPasses = false) {
|
|
14
|
+
if (this.sourceTexture === undefined || this.circleOfConfusionTexture === undefined) {
|
|
15
|
+
throw new Error(`FrameGraphDepthOfFieldBlurTask "${this.name}": sourceTexture and circleOfConfusionTexture are required`);
|
|
16
|
+
}
|
|
17
|
+
const pass = super.record(skipCreationOfDisabledPasses, (context) => {
|
|
18
|
+
context.setTextureSamplingMode(this.circleOfConfusionTexture, this.circleOfConfusionSamplingMode);
|
|
19
|
+
}, (context) => {
|
|
20
|
+
context.bindTextureHandle(this._postProcessDrawWrapper.effect, "circleOfConfusionSampler", this.circleOfConfusionTexture);
|
|
21
|
+
});
|
|
22
|
+
pass.useTexture(this.circleOfConfusionTexture);
|
|
23
|
+
return pass;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=depthOfFieldBlurTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"depthOfFieldBlurTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,sCAA+B;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,kEAA2D;AACrG,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAEjD;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,kBAAkB;IAKlE,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAiD;QAC/F,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,+BAA+B,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAH7H,kCAA6B,GAAG,SAAS,CAAC,6BAA6B,CAAC;IAI/E,CAAC;IAEe,MAAM,CAAC,4BAA4B,GAAG,KAAK;QACvD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,wBAAwB,KAAK,SAAS,EAAE;YACjF,MAAM,IAAI,KAAK,CAAC,mCAAmC,IAAI,CAAC,IAAI,4DAA4D,CAAC,CAAC;SAC7H;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CACrB,4BAA4B,EAC5B,CAAC,OAAO,EAAE,EAAE;YACR,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC;QACtG,CAAC,EACD,CAAC,OAAO,EAAE,EAAE;YACR,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,0BAA0B,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC/H,CAAC,CACJ,CAAC;QAEF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAE/C,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphBlurTask } from \"./blurTask\";\r\nimport { ThinDepthOfFieldBlurPostProcess } from \"core/PostProcesses/thinDepthOfFieldBlurPostProcess\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class FrameGraphDepthOfFieldBlurTask extends FrameGraphBlurTask {\r\n public circleOfConfusionTexture: FrameGraphTextureHandle;\r\n\r\n public circleOfConfusionSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinDepthOfFieldBlurPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinDepthOfFieldBlurPostProcess(name, frameGraph.engine, new Vector2(1, 0), 10));\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined || this.circleOfConfusionTexture === undefined) {\r\n throw new Error(`FrameGraphDepthOfFieldBlurTask \"${this.name}\": sourceTexture and circleOfConfusionTexture are required`);\r\n }\r\n\r\n const pass = super.record(\r\n skipCreationOfDisabledPasses,\r\n (context) => {\r\n context.setTextureSamplingMode(this.circleOfConfusionTexture, this.circleOfConfusionSamplingMode);\r\n },\r\n (context) => {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"circleOfConfusionSampler\", this.circleOfConfusionTexture);\r\n }\r\n );\r\n\r\n pass.useTexture(this.circleOfConfusionTexture);\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from "../../../index.js";
|
|
2
|
+
import { ThinDepthOfFieldMergePostProcess } from "../../../PostProcesses/thinDepthOfFieldMergePostProcess.js";
|
|
3
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class FrameGraphDepthOfFieldMergeTask extends FrameGraphPostProcessTask {
|
|
8
|
+
circleOfConfusionTexture: FrameGraphTextureHandle;
|
|
9
|
+
blurSteps: FrameGraphTextureHandle[];
|
|
10
|
+
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinDepthOfFieldMergePostProcess);
|
|
11
|
+
record(skipCreationOfDisabledPasses?: boolean): FrameGraphRenderPass;
|
|
12
|
+
}
|