@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 @@
|
|
|
1
|
+
{"version":3,"file":"objectRendererTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Rendering/objectRendererTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,mCAAmC,EAAE,MAAM,uBAAuB,CAAC;AAC1G,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,cAAc;IAkB5D;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,IAAW,MAAM,CAAC,MAAc;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC;IACzC,CAAC;IAgCD;;OAEG;IACH,IAAW,mBAAmB;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,IAAoB,IA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CAAC;aACxD;YACD,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;YAE9C,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE;gBACjC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,YAAY,EAAE;oBACpC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;iBACnC;aACJ;SACJ;IACL,CAAC;IAEe,OAAO;QACnB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACpB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle, Scene, Camera, FrameGraphObjectList, FrameGraphRenderContext } from \"core/index\";\r\nimport { backbufferColorTextureHandle, backbufferDepthStencilTextureHandle } from \"../../frameGraphTypes\";\r\nimport { RenderTargetTexture } from \"../../../Materials/Textures/renderTargetTexture\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task used to render objects to a texture.\r\n */\r\nexport class FrameGraphObjectRendererTask extends FrameGraphTask {\r\n /**\r\n * The destination texture where the objects will be rendered.\r\n */\r\n public destinationTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The depth attachment texture where the objects will be rendered (optional).\r\n */\r\n public depthTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The dependencies of the task (optional).\r\n */\r\n public dependencies?: FrameGraphTextureHandle[] = [];\r\n\r\n private _camera: Camera;\r\n\r\n /**\r\n * Gets or sets the camera used to render the objects.\r\n */\r\n public get camera() {\r\n return this._camera;\r\n }\r\n\r\n public set camera(camera: Camera) {\r\n this._camera = camera;\r\n this._rtt.activeCamera = this.camera;\r\n }\r\n\r\n /**\r\n * The list of objects to render.\r\n */\r\n public objectList: FrameGraphObjectList;\r\n\r\n /**\r\n * If depth testing should be enabled (default is true).\r\n */\r\n public depthTest = true;\r\n\r\n /**\r\n * If depth writing should be enabled (default is true).\r\n */\r\n public depthWrite = true;\r\n\r\n /**\r\n * The output texture.\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output depth attachment texture.\r\n * This texture will point to the same texture than the depthTexture property if it is set.\r\n * Note, however, that the handle itself will be different!\r\n */\r\n public readonly outputDepthTexture: FrameGraphTextureHandle;\r\n\r\n protected _scene: Scene;\r\n protected _rtt: RenderTargetTexture;\r\n\r\n /**\r\n * The render target texture used to render the objects.\r\n */\r\n public get renderTargetTexture() {\r\n return this._rtt;\r\n }\r\n\r\n public override get name() {\r\n return this._name;\r\n }\r\n\r\n public override set name(value: string) {\r\n this._name = value;\r\n if (this._rtt) {\r\n this._rtt.name = value + \"_internal_rtt\";\r\n }\r\n }\r\n\r\n /**\r\n * Constructs a new object renderer task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n * @param scene The scene the frame graph is associated with.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph);\r\n\r\n this._scene = scene;\r\n this._rtt = new RenderTargetTexture(name, 1, scene, {\r\n delayAllocation: true,\r\n });\r\n this._rtt.skipInitialClear = true;\r\n this.name = name;\r\n\r\n this.outputTexture = this._frameGraph.createDanglingHandle();\r\n this.outputDepthTexture = this._frameGraph.createDanglingHandle();\r\n }\r\n\r\n public override isReady() {\r\n return this._rtt.isReadyForRendering();\r\n }\r\n\r\n public record(skipCreationOfDisabledPasses = false, additionalExecute?: (context: FrameGraphRenderContext) => void) {\r\n if (this.destinationTexture === undefined || this.objectList === undefined) {\r\n throw new Error(`FrameGraphObjectRendererTask ${this.name}: destinationTexture and objectList are required`);\r\n }\r\n\r\n const outputTextureDescription = this._frameGraph.getTextureDescription(this.destinationTexture);\r\n\r\n let depthEnabled = false;\r\n\r\n if (this.depthTexture !== undefined) {\r\n if (this.depthTexture === backbufferDepthStencilTextureHandle && this.destinationTexture !== backbufferColorTextureHandle) {\r\n throw new Error(\r\n `FrameGraphObjectRendererTask ${this.name}: the back buffer color texture is the only color texture allowed when the depth is the back buffer depth/stencil`\r\n );\r\n }\r\n if (this.depthTexture !== backbufferDepthStencilTextureHandle && this.destinationTexture === backbufferColorTextureHandle) {\r\n throw new Error(\r\n `FrameGraphObjectRendererTask ${this.name}: the back buffer depth/stencil texture is the only depth texture allowed when the destination is the back buffer color`\r\n );\r\n }\r\n\r\n const depthTextureDescription = this._frameGraph.getTextureDescription(this.depthTexture);\r\n if (depthTextureDescription.options.samples !== outputTextureDescription.options.samples) {\r\n throw new Error(`FrameGraphObjectRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);\r\n }\r\n\r\n depthEnabled = true;\r\n }\r\n\r\n this._frameGraph.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\r\n if (this.depthTexture !== undefined) {\r\n this._frameGraph.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);\r\n }\r\n\r\n this._rtt._size = outputTextureDescription.size;\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.destinationTexture);\r\n if (this.depthTexture !== undefined) {\r\n pass.setRenderTargetDepth(this.depthTexture);\r\n }\r\n pass.setExecuteFunc((_context) => {\r\n this._rtt.renderList = this.objectList.meshes;\r\n this._rtt.particleSystemList = this.objectList.particleSystems;\r\n this._scene.incrementRenderId();\r\n this._scene.resetCachedMaterial();\r\n _context.setDepthStates(this.depthTest && depthEnabled, this.depthWrite && depthEnabled);\r\n _context.render(this._rtt);\r\n additionalExecute?.(_context);\r\n });\r\n\r\n if (this.dependencies !== undefined) {\r\n for (const handle of this.dependencies) {\r\n pass.useTexture(handle);\r\n }\r\n }\r\n\r\n if (!skipCreationOfDisabledPasses) {\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.destinationTexture);\r\n if (this.depthTexture !== undefined) {\r\n passDisabled.setRenderTargetDepth(this.depthTexture);\r\n }\r\n passDisabled.setExecuteFunc((_context) => {});\r\n\r\n if (this.dependencies !== undefined) {\r\n for (const handle of this.dependencies) {\r\n passDisabled.useTexture(handle);\r\n }\r\n }\r\n }\r\n }\r\n\r\n public override dispose(): void {\r\n this._rtt.dispose();\r\n super.dispose();\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphTextureHandle } from "../../../index.js";
|
|
2
|
+
import { Color4 } from "../../../Maths/math.color";
|
|
3
|
+
import { FrameGraphTask } from "../../frameGraphTask";
|
|
4
|
+
/**
|
|
5
|
+
* Task used to clear a texture.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FrameGraphClearTextureTask extends FrameGraphTask {
|
|
8
|
+
/**
|
|
9
|
+
* The color to clear the texture with.
|
|
10
|
+
*/
|
|
11
|
+
color: Color4;
|
|
12
|
+
/**
|
|
13
|
+
* If the color should be cleared.
|
|
14
|
+
*/
|
|
15
|
+
clearColor: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* If the depth should be cleared.
|
|
18
|
+
*/
|
|
19
|
+
clearDepth: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* If the stencil should be cleared.
|
|
22
|
+
*/
|
|
23
|
+
clearStencil: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The texture to clear.
|
|
26
|
+
*/
|
|
27
|
+
destinationTexture: FrameGraphTextureHandle;
|
|
28
|
+
/**
|
|
29
|
+
* The output texture (same as destinationTexture, but the handle may be different).
|
|
30
|
+
*/
|
|
31
|
+
readonly outputTexture: FrameGraphTextureHandle;
|
|
32
|
+
constructor(name: string, frameGraph: FrameGraph);
|
|
33
|
+
record(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Color4 } from "../../../Maths/math.color.js";
|
|
2
|
+
import { FrameGraphTask } from "../../frameGraphTask.js";
|
|
3
|
+
/**
|
|
4
|
+
* Task used to clear a texture.
|
|
5
|
+
*/
|
|
6
|
+
export class FrameGraphClearTextureTask extends FrameGraphTask {
|
|
7
|
+
constructor(name, frameGraph) {
|
|
8
|
+
super(name, frameGraph);
|
|
9
|
+
/**
|
|
10
|
+
* The color to clear the texture with.
|
|
11
|
+
*/
|
|
12
|
+
this.color = new Color4(0.2, 0.2, 0.3, 1);
|
|
13
|
+
/**
|
|
14
|
+
* If the color should be cleared.
|
|
15
|
+
*/
|
|
16
|
+
this.clearColor = true;
|
|
17
|
+
/**
|
|
18
|
+
* If the depth should be cleared.
|
|
19
|
+
*/
|
|
20
|
+
this.clearDepth = false;
|
|
21
|
+
/**
|
|
22
|
+
* If the stencil should be cleared.
|
|
23
|
+
*/
|
|
24
|
+
this.clearStencil = false;
|
|
25
|
+
this.outputTexture = this._frameGraph.createDanglingHandle();
|
|
26
|
+
}
|
|
27
|
+
record() {
|
|
28
|
+
if (this.destinationTexture === undefined) {
|
|
29
|
+
throw new Error(`FrameGraphClearTextureTask ${this.name}: destinationTexture is required`);
|
|
30
|
+
}
|
|
31
|
+
this._frameGraph.resolveDanglingHandle(this.outputTexture, this.destinationTexture);
|
|
32
|
+
const pass = this._frameGraph.addRenderPass(this.name);
|
|
33
|
+
pass.setRenderTarget(this.destinationTexture);
|
|
34
|
+
pass.setExecuteFunc((context) => {
|
|
35
|
+
context.clear(this.color, !!this.clearColor, !!this.clearDepth, !!this.clearStencil);
|
|
36
|
+
});
|
|
37
|
+
const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
|
|
38
|
+
passDisabled.setRenderTarget(this.destinationTexture);
|
|
39
|
+
passDisabled.setExecuteFunc((_context) => { });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=clearTextureTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearTextureTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Texture/clearTextureTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,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,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACtD,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;IAClD,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle } from \"core/index\";\r\nimport { Color4 } from \"../../../Maths/math.color\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task used to clear a texture.\r\n */\r\nexport class FrameGraphClearTextureTask extends FrameGraphTask {\r\n /**\r\n * The color to clear the texture with.\r\n */\r\n public color = new Color4(0.2, 0.2, 0.3, 1);\r\n\r\n /**\r\n * If the color should be cleared.\r\n */\r\n public clearColor = true;\r\n\r\n /**\r\n * If the depth should be cleared.\r\n */\r\n public clearDepth = false;\r\n\r\n /**\r\n * If the stencil should be cleared.\r\n */\r\n public clearStencil = false;\r\n\r\n /**\r\n * The texture to clear.\r\n */\r\n public destinationTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture (same as destinationTexture, but the handle may be different).\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n constructor(name: string, frameGraph: FrameGraph) {\r\n super(name, frameGraph);\r\n\r\n this.outputTexture = this._frameGraph.createDanglingHandle();\r\n }\r\n\r\n public record() {\r\n if (this.destinationTexture === undefined) {\r\n throw new Error(`FrameGraphClearTextureTask ${this.name}: destinationTexture is required`);\r\n }\r\n\r\n this._frameGraph.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.destinationTexture);\r\n pass.setExecuteFunc((context) => {\r\n context.clear(this.color, !!this.clearColor, !!this.clearDepth, !!this.clearStencil);\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.destinationTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FrameGraphTextureHandle } from "../../../index.js";
|
|
2
|
+
import { FrameGraphTask } from "../../frameGraphTask";
|
|
3
|
+
/**
|
|
4
|
+
* Task which copies a texture to the backbuffer color texture.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FrameGraphCopyToBackbufferColorTask extends FrameGraphTask {
|
|
7
|
+
/**
|
|
8
|
+
* The source texture to copy to the backbuffer color texture.
|
|
9
|
+
*/
|
|
10
|
+
sourceTexture: FrameGraphTextureHandle;
|
|
11
|
+
record(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { backbufferColorTextureHandle } from "../../frameGraphTypes.js";
|
|
2
|
+
import { FrameGraphTask } from "../../frameGraphTask.js";
|
|
3
|
+
/**
|
|
4
|
+
* Task which copies a texture to the backbuffer color texture.
|
|
5
|
+
*/
|
|
6
|
+
export class FrameGraphCopyToBackbufferColorTask extends FrameGraphTask {
|
|
7
|
+
record() {
|
|
8
|
+
if (this.sourceTexture === undefined) {
|
|
9
|
+
throw new Error(`FrameGraphCopyToBackbufferColorTask "${this.name}": sourceTexture is required`);
|
|
10
|
+
}
|
|
11
|
+
const pass = this._frameGraph.addRenderPass(this.name);
|
|
12
|
+
pass.setRenderTarget(backbufferColorTextureHandle);
|
|
13
|
+
pass.setExecuteFunc((context) => {
|
|
14
|
+
if (!context.isBackbuffer(this.sourceTexture)) {
|
|
15
|
+
context.copyTexture(this.sourceTexture);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
|
|
19
|
+
passDisabled.setRenderTarget(backbufferColorTextureHandle);
|
|
20
|
+
passDisabled.setExecuteFunc((_context) => { });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=copyToBackbufferColorTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyToBackbufferColorTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,mCAAoC,SAAQ,cAAc;IAM5D,MAAM;QACT,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE;YAClC,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,CAAC,IAAI,8BAA8B,CAAC,CAAC;SACpG;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEvD,IAAI,CAAC,eAAe,CAAC,4BAA4B,CAAC,CAAC;QACnD,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5B,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE;gBAC3C,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;aAC3C;QACL,CAAC,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,4BAA4B,CAAC,CAAC;QAC3D,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;IAClD,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraphTextureHandle } from \"core/index\";\r\nimport { backbufferColorTextureHandle } from \"../../frameGraphTypes\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task which copies a texture to the backbuffer color texture.\r\n */\r\nexport class FrameGraphCopyToBackbufferColorTask extends FrameGraphTask {\r\n /**\r\n * The source texture to copy to the backbuffer color texture.\r\n */\r\n public sourceTexture: FrameGraphTextureHandle;\r\n\r\n public record() {\r\n if (this.sourceTexture === undefined) {\r\n throw new Error(`FrameGraphCopyToBackbufferColorTask \"${this.name}\": sourceTexture is required`);\r\n }\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(backbufferColorTextureHandle);\r\n pass.setExecuteFunc((context) => {\r\n if (!context.isBackbuffer(this.sourceTexture)) {\r\n context.copyTexture(this.sourceTexture);\r\n }\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(backbufferColorTextureHandle);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphTextureHandle } from "../../../index.js";
|
|
2
|
+
import { FrameGraphTask } from "../../frameGraphTask";
|
|
3
|
+
/**
|
|
4
|
+
* Task used to copy a texture to another texture.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FrameGraphCopyToTextureTask extends FrameGraphTask {
|
|
7
|
+
/**
|
|
8
|
+
* The source texture to copy from.
|
|
9
|
+
*/
|
|
10
|
+
sourceTexture: FrameGraphTextureHandle;
|
|
11
|
+
/**
|
|
12
|
+
* The destination texture to copy to.
|
|
13
|
+
*/
|
|
14
|
+
destinationTexture: FrameGraphTextureHandle;
|
|
15
|
+
/**
|
|
16
|
+
* The output texture (same as destinationTexture, but the handle may be different).
|
|
17
|
+
*/
|
|
18
|
+
readonly outputTexture: FrameGraphTextureHandle;
|
|
19
|
+
/**
|
|
20
|
+
* Constructs a new FrameGraphCopyToTextureTask.
|
|
21
|
+
* @param name The name of the task.
|
|
22
|
+
* @param frameGraph The frame graph the task belongs to.
|
|
23
|
+
*/
|
|
24
|
+
constructor(name: string, frameGraph: FrameGraph);
|
|
25
|
+
record(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FrameGraphTask } from "../../frameGraphTask.js";
|
|
2
|
+
/**
|
|
3
|
+
* Task used to copy a texture to another texture.
|
|
4
|
+
*/
|
|
5
|
+
export class FrameGraphCopyToTextureTask extends FrameGraphTask {
|
|
6
|
+
/**
|
|
7
|
+
* Constructs a new FrameGraphCopyToTextureTask.
|
|
8
|
+
* @param name The name of the task.
|
|
9
|
+
* @param frameGraph The frame graph the task belongs to.
|
|
10
|
+
*/
|
|
11
|
+
constructor(name, frameGraph) {
|
|
12
|
+
super(name, frameGraph);
|
|
13
|
+
this.outputTexture = this._frameGraph.createDanglingHandle();
|
|
14
|
+
}
|
|
15
|
+
record() {
|
|
16
|
+
if (this.sourceTexture === undefined || this.destinationTexture === undefined) {
|
|
17
|
+
throw new Error(`FrameGraphCopyToTextureTask "${this.name}": sourceTexture and destinationTexture are required`);
|
|
18
|
+
}
|
|
19
|
+
this._frameGraph.resolveDanglingHandle(this.outputTexture, this.destinationTexture);
|
|
20
|
+
const pass = this._frameGraph.addRenderPass(this.name);
|
|
21
|
+
pass.useTexture(this.sourceTexture);
|
|
22
|
+
pass.setRenderTarget(this.outputTexture);
|
|
23
|
+
pass.setExecuteFunc((context) => {
|
|
24
|
+
context.copyTexture(this.sourceTexture);
|
|
25
|
+
});
|
|
26
|
+
const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
|
|
27
|
+
passDisabled.setRenderTarget(this.outputTexture);
|
|
28
|
+
passDisabled.setExecuteFunc((_context) => { });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=copyToTextureTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyToTextureTask.js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E,GAAE,CAAC,CAAC,CAAC;IAClD,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle } from \"core/index\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task used to copy a texture to another texture.\r\n */\r\nexport class FrameGraphCopyToTextureTask extends FrameGraphTask {\r\n /**\r\n * The source texture to copy from.\r\n */\r\n public sourceTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The destination texture to copy to.\r\n */\r\n public destinationTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture (same as destinationTexture, but the handle may be different).\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * Constructs a new FrameGraphCopyToTextureTask.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph) {\r\n super(name, frameGraph);\r\n\r\n this.outputTexture = this._frameGraph.createDanglingHandle();\r\n }\r\n\r\n public record() {\r\n if (this.sourceTexture === undefined || this.destinationTexture === undefined) {\r\n throw new Error(`FrameGraphCopyToTextureTask \"${this.name}\": sourceTexture and destinationTexture are required`);\r\n }\r\n\r\n this._frameGraph.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.useTexture(this.sourceTexture);\r\n pass.setRenderTarget(this.outputTexture);\r\n pass.setExecuteFunc((context) => {\r\n context.copyTexture(this.sourceTexture);\r\n });\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 }\r\n}\r\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphTextureHandle } from "../../../index.js";
|
|
2
|
+
import { FrameGraphTask } from "../../frameGraphTask";
|
|
3
|
+
/**
|
|
4
|
+
* Task which generates mipmaps for a texture.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FrameGraphGenerateMipMapsTask extends FrameGraphTask {
|
|
7
|
+
/**
|
|
8
|
+
* The texture to generate mipmaps for.
|
|
9
|
+
*/
|
|
10
|
+
destinationTexture: FrameGraphTextureHandle;
|
|
11
|
+
/**
|
|
12
|
+
* The output texture (same as destinationTexture, but the handle may be different).
|
|
13
|
+
*/
|
|
14
|
+
readonly outputTexture: FrameGraphTextureHandle;
|
|
15
|
+
/**
|
|
16
|
+
* Constructs a new FrameGraphGenerateMipMapsTask.
|
|
17
|
+
* @param name The name of the task.
|
|
18
|
+
* @param frameGraph The frame graph the task belongs to.
|
|
19
|
+
*/
|
|
20
|
+
constructor(name: string, frameGraph: FrameGraph);
|
|
21
|
+
record(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FrameGraphTask } from "../../frameGraphTask.js";
|
|
2
|
+
/**
|
|
3
|
+
* Task which generates mipmaps for a texture.
|
|
4
|
+
*/
|
|
5
|
+
export class FrameGraphGenerateMipMapsTask extends FrameGraphTask {
|
|
6
|
+
/**
|
|
7
|
+
* Constructs a new FrameGraphGenerateMipMapsTask.
|
|
8
|
+
* @param name The name of the task.
|
|
9
|
+
* @param frameGraph The frame graph the task belongs to.
|
|
10
|
+
*/
|
|
11
|
+
constructor(name, frameGraph) {
|
|
12
|
+
super(name, frameGraph);
|
|
13
|
+
this.outputTexture = this._frameGraph.createDanglingHandle();
|
|
14
|
+
}
|
|
15
|
+
record() {
|
|
16
|
+
if (this.destinationTexture === undefined) {
|
|
17
|
+
throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture is required`);
|
|
18
|
+
}
|
|
19
|
+
this._frameGraph.resolveDanglingHandle(this.outputTexture, this.destinationTexture);
|
|
20
|
+
const outputTextureDescription = this._frameGraph.getTextureDescription(this.destinationTexture);
|
|
21
|
+
if (!outputTextureDescription.options.createMipMaps) {
|
|
22
|
+
throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture must have createMipMaps set to true`);
|
|
23
|
+
}
|
|
24
|
+
const pass = this._frameGraph.addRenderPass(this.name);
|
|
25
|
+
pass.setRenderTarget(this.outputTexture);
|
|
26
|
+
pass.setExecuteFunc((context) => {
|
|
27
|
+
context.generateMipMaps();
|
|
28
|
+
});
|
|
29
|
+
const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
|
|
30
|
+
passDisabled.setRenderTarget(this.outputTexture);
|
|
31
|
+
passDisabled.setExecuteFunc((_context) => { });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=generateMipMapsTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateMipMapsTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Texture/generateMipMapsTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,cAAc;IAW7D;;;;OAIG;IACH,YAAY,IAAY,EAAE,UAAsB;QAC5C,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAExB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,oBAAoB,EAAE,CAAC;IACjE,CAAC;IAEM,MAAM;QACT,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE;YACvC,MAAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,CAAC,IAAI,kCAAkC,CAAC,CAAC;SACjG;QAED,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAEpF,MAAM,wBAAwB,GAAG,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAEjG,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,aAAa,EAAE;YACjD,MAAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,CAAC,IAAI,0DAA0D,CAAC,CAAC;SACzH;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEvD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YAC5B,OAAO,CAAC,eAAe,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEH,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;IAClD,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureHandle } from \"core/index\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task which generates mipmaps for a texture.\r\n */\r\nexport class FrameGraphGenerateMipMapsTask extends FrameGraphTask {\r\n /**\r\n * The texture to generate mipmaps for.\r\n */\r\n public destinationTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture (same as destinationTexture, but the handle may be different).\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * Constructs a new FrameGraphGenerateMipMapsTask.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph) {\r\n super(name, frameGraph);\r\n\r\n this.outputTexture = this._frameGraph.createDanglingHandle();\r\n }\r\n\r\n public record() {\r\n if (this.destinationTexture === undefined) {\r\n throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture is required`);\r\n }\r\n\r\n this._frameGraph.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\r\n\r\n const outputTextureDescription = this._frameGraph.getTextureDescription(this.destinationTexture);\r\n\r\n if (!outputTextureDescription.options.createMipMaps) {\r\n throw new Error(`FrameGraphGenerateMipMapsTask ${this.name}: destinationTexture must have createMipMaps set to true`);\r\n }\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(this.outputTexture);\r\n pass.setExecuteFunc((context) => {\r\n context.generateMipMaps();\r\n });\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 }\r\n}\r\n"]}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { Scene, AbstractEngine, RenderTargetWrapper, FrameGraphTextureCreationOptions, FrameGraphTextureHandle, FrameGraphTextureDescription, Nullable, FrameGraphTask } from "../index.js";
|
|
2
|
+
import { FrameGraphRenderPass } from "./Passes/renderPass";
|
|
3
|
+
import { FrameGraphCullPass } from "./Passes/cullPass";
|
|
4
|
+
import { FrameGraphRenderContext } from "./frameGraphRenderContext";
|
|
5
|
+
import { FrameGraphContext } from "./frameGraphContext";
|
|
6
|
+
import { Observable } from "../Misc/observable.js";
|
|
7
|
+
/**
|
|
8
|
+
* Class used to implement a frame graph
|
|
9
|
+
* @experimental
|
|
10
|
+
*/
|
|
11
|
+
export declare class FrameGraph {
|
|
12
|
+
/** @internal */
|
|
13
|
+
readonly _passContext: FrameGraphContext;
|
|
14
|
+
/** @internal */
|
|
15
|
+
readonly _renderContext: FrameGraphRenderContext;
|
|
16
|
+
private readonly _engine;
|
|
17
|
+
private readonly _textureManager;
|
|
18
|
+
private _tasks;
|
|
19
|
+
private _currentProcessedTask;
|
|
20
|
+
/**
|
|
21
|
+
* Observable raised when the node render graph is built
|
|
22
|
+
*/
|
|
23
|
+
onBuildObservable: Observable<FrameGraph>;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the engine used by the frame graph
|
|
26
|
+
*/
|
|
27
|
+
get engine(): AbstractEngine;
|
|
28
|
+
/**
|
|
29
|
+
* Constructs the frame graph
|
|
30
|
+
* @param engine defines the hosting engine
|
|
31
|
+
* @param debugTextures defines a boolean indicating that textures created by the frame graph should be visible in the inspector
|
|
32
|
+
* @param scene defines the scene in which debugging textures are to be created
|
|
33
|
+
*/
|
|
34
|
+
constructor(engine: AbstractEngine, debugTextures?: boolean, scene?: Scene);
|
|
35
|
+
/**
|
|
36
|
+
* Gets a task by name
|
|
37
|
+
* @param name Name of the task to get
|
|
38
|
+
* @returns The task or undefined if not found
|
|
39
|
+
*/
|
|
40
|
+
getTaskByName<T extends FrameGraphTask>(name: string): T | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Adds a task to the frame graph
|
|
43
|
+
* @param task Task to add
|
|
44
|
+
*/
|
|
45
|
+
addTask(task: FrameGraphTask): void;
|
|
46
|
+
/**
|
|
47
|
+
* Adds a render pass to a task. This method can only be called during a Task.record execution.
|
|
48
|
+
* @param name The name of the pass
|
|
49
|
+
* @param whenTaskDisabled If true, the pass will be added to the list of passes to execute when the task is disabled (default is false)
|
|
50
|
+
* @returns The render pass created
|
|
51
|
+
*/
|
|
52
|
+
addRenderPass(name: string, whenTaskDisabled?: boolean): FrameGraphRenderPass;
|
|
53
|
+
/**
|
|
54
|
+
* Adds a cull pass to a task. This method can only be called during a Task.record execution.
|
|
55
|
+
* @param name The name of the pass
|
|
56
|
+
* @param whenTaskDisabled If true, the pass will be added to the list of passes to execute when the task is disabled (default is false)
|
|
57
|
+
* @returns The cull pass created
|
|
58
|
+
*/
|
|
59
|
+
addCullPass(name: string, whenTaskDisabled?: boolean): FrameGraphCullPass;
|
|
60
|
+
private _addPass;
|
|
61
|
+
/**
|
|
62
|
+
* Builds the frame graph.
|
|
63
|
+
* This method should be called after all tasks have been added to the frame graph (FrameGraph.addTask) and before the graph is executed (FrameGraph.execute).
|
|
64
|
+
*/
|
|
65
|
+
build(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Returns a promise that resolves when the frame graph is ready to be executed
|
|
68
|
+
* This method must be called after the graph has been built (FrameGraph.build called)!
|
|
69
|
+
* @param timeout Timeout in ms between retries (default is 16)
|
|
70
|
+
* @returns The promise that resolves when the graph is ready
|
|
71
|
+
*/
|
|
72
|
+
whenReadyAsync(timeout?: number): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Executes the frame graph.
|
|
75
|
+
*/
|
|
76
|
+
execute(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Imports a texture into the frame graph
|
|
79
|
+
* @param name Name of the texture
|
|
80
|
+
* @param texture Texture to import
|
|
81
|
+
* @param handle Existing handle to use for the texture. If not provided (default), a new handle will be created.
|
|
82
|
+
* @returns The handle to the texture
|
|
83
|
+
*/
|
|
84
|
+
importTexture(name: string, texture: RenderTargetWrapper, handle?: FrameGraphTextureHandle): FrameGraphTextureHandle;
|
|
85
|
+
/**
|
|
86
|
+
* Gets the creation options of a texture
|
|
87
|
+
* @param handle Handle of the texture
|
|
88
|
+
* @param cloneOptions If true, the options will be cloned before being returned (default is false)
|
|
89
|
+
* @returns The creation options of the texture
|
|
90
|
+
*/
|
|
91
|
+
getTextureCreationOptions(handle: FrameGraphTextureHandle, cloneOptions?: boolean): FrameGraphTextureCreationOptions;
|
|
92
|
+
/**
|
|
93
|
+
* Gets the description of a texture
|
|
94
|
+
* @param handle Handle of the texture
|
|
95
|
+
* @returns The description of the texture
|
|
96
|
+
*/
|
|
97
|
+
getTextureDescription(handle: FrameGraphTextureHandle): FrameGraphTextureDescription;
|
|
98
|
+
/**
|
|
99
|
+
* Gets a texture handle or creates a new texture if the handle is not provided.
|
|
100
|
+
* @param handle If provided, will simply return the handle
|
|
101
|
+
* @param newTextureName Name of the new texture to create
|
|
102
|
+
* @param creationOptions Options to use when creating the new texture
|
|
103
|
+
* @returns The handle to the texture. If handle is not provided, newTextureName and creationOptions must be provided.
|
|
104
|
+
*/
|
|
105
|
+
getTextureHandleOrCreateTexture(handle?: FrameGraphTextureHandle, newTextureName?: string, creationOptions?: FrameGraphTextureCreationOptions): FrameGraphTextureHandle;
|
|
106
|
+
/**
|
|
107
|
+
* Gets a texture from a handle
|
|
108
|
+
* @param handle The handle of the texture
|
|
109
|
+
* @returns The texture or null if not found
|
|
110
|
+
*/
|
|
111
|
+
getTexture(handle: FrameGraphTextureHandle): Nullable<RenderTargetWrapper>;
|
|
112
|
+
/**
|
|
113
|
+
* Creates a new render target texture
|
|
114
|
+
* @param name Name of the texture
|
|
115
|
+
* @param creationOptions Options to use when creating the texture
|
|
116
|
+
* @param multiTargetMode If true, the texture will be created in multi target mode (default is false). In this mode, a handle is created for each target separately, in addition to the handle created for the main render target texture itself.
|
|
117
|
+
* @returns The handle to the texture
|
|
118
|
+
*/
|
|
119
|
+
createRenderTargetTexture(name: string, creationOptions: FrameGraphTextureCreationOptions, multiTargetMode?: boolean): FrameGraphTextureHandle;
|
|
120
|
+
/**
|
|
121
|
+
* Creates a handle which is not associated with any texture.
|
|
122
|
+
* Call resolveDanglingHandle to associate the handle with a valid texture handle.
|
|
123
|
+
* @returns The dangling handle
|
|
124
|
+
*/
|
|
125
|
+
createDanglingHandle(): FrameGraphTextureHandle;
|
|
126
|
+
/**
|
|
127
|
+
* Associates a texture with a dangling handle
|
|
128
|
+
* @param danglingHandle The dangling handle
|
|
129
|
+
* @param handle The handle to associate with the dangling handle (if not provided, a new texture handle will be created)
|
|
130
|
+
* @param newTextureName The name of the new texture to create (if handle is not provided)
|
|
131
|
+
* @param creationOptions The options to use when creating the new texture (if handle is not provided)
|
|
132
|
+
*/
|
|
133
|
+
resolveDanglingHandle(danglingHandle: FrameGraphTextureHandle, handle?: FrameGraphTextureHandle, newTextureName?: string, creationOptions?: FrameGraphTextureCreationOptions): void;
|
|
134
|
+
/**
|
|
135
|
+
* Clears the frame graph (remove the tasks and release the textures).
|
|
136
|
+
* The frame graph can be built again after this method is called.
|
|
137
|
+
*/
|
|
138
|
+
clear(): void;
|
|
139
|
+
/**
|
|
140
|
+
* Disposes the frame graph
|
|
141
|
+
*/
|
|
142
|
+
dispose(): void;
|
|
143
|
+
}
|