@babylonjs/core 7.32.0 → 7.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -0
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Cameras/camera.d.ts +5 -2
- package/Cameras/camera.js +1 -0
- package/Cameras/camera.js.map +1 -1
- package/Decorators/nodeDecorator.d.ts +9 -1
- package/Decorators/nodeDecorator.js +8 -0
- package/Decorators/nodeDecorator.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +40 -53
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +20 -8
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.debugging.js +16 -7
- package/Engines/WebGPU/Extensions/engine.debugging.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +43 -44
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +8 -6
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.d.ts +3 -3
- package/Engines/WebGPU/webgpuHardwareTexture.js +12 -9
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +25 -19
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +5 -3
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.d.ts +6 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +6 -1
- package/Engines/constants.js +6 -1
- package/Engines/constants.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +7 -0
- package/Engines/renderTargetWrapper.js +15 -0
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +3 -1
- package/Engines/webgpuEngine.js +9 -8
- package/Engines/webgpuEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.d.ts +47 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +113 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.d.ts +62 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +171 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.d.ts +51 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +127 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.d.ts +67 -0
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +187 -0
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.d.ts +77 -0
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +232 -0
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.d.ts +47 -0
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +113 -0
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.d.ts +41 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js +79 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +119 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +451 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.d.ts +63 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +154 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.d.ts +59 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js +131 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.d.ts +49 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.js +107 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +50 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +125 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.d.ts +38 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +71 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.d.ts +34 -0
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +59 -0
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/elbowBlock.d.ts +28 -0
- package/FrameGraph/Node/Blocks/elbowBlock.js +47 -0
- package/FrameGraph/Node/Blocks/elbowBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/index.d.ts +17 -0
- package/FrameGraph/Node/Blocks/index.js +18 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -0
- package/FrameGraph/Node/Blocks/inputBlock.d.ts +94 -0
- package/FrameGraph/Node/Blocks/inputBlock.js +270 -0
- package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/outputBlock.d.ts +30 -0
- package/FrameGraph/Node/Blocks/outputBlock.js +51 -0
- package/FrameGraph/Node/Blocks/outputBlock.js.map +1 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +110 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +78 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraph.d.ts +196 -0
- package/FrameGraph/Node/nodeRenderGraph.js +614 -0
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.d.ts +190 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js +495 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +143 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +275 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraphBuildState.d.ts +21 -0
- package/FrameGraph/Node/nodeRenderGraphBuildState.js +35 -0
- package/FrameGraph/Node/nodeRenderGraphBuildState.js.map +1 -0
- package/FrameGraph/Passes/cullPass.d.ts +28 -0
- package/FrameGraph/Passes/cullPass.js +38 -0
- package/FrameGraph/Passes/cullPass.js.map +1 -0
- package/FrameGraph/Passes/pass.d.ts +14 -0
- package/FrameGraph/Passes/pass.js +20 -0
- package/FrameGraph/Passes/pass.js.map +1 -0
- package/FrameGraph/Passes/renderPass.d.ts +49 -0
- package/FrameGraph/Passes/renderPass.js +72 -0
- package/FrameGraph/Passes/renderPass.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.d.ts +16 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js +17 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.d.ts +12 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +21 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +54 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +114 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.d.ts +17 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.js +24 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.d.ts +30 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +35 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.d.ts +12 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +26 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.d.ts +12 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +29 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +65 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +134 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.d.ts +16 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js +17 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +41 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +64 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.d.ts +28 -0
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.js +52 -0
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +145 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +259 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +66 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +127 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +34 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +42 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.d.ts +12 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js +23 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +26 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +31 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +22 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +34 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -0
- package/FrameGraph/frameGraph.d.ts +143 -0
- package/FrameGraph/frameGraph.js +275 -0
- package/FrameGraph/frameGraph.js.map +1 -0
- package/FrameGraph/frameGraphContext.d.ts +5 -0
- package/FrameGraph/frameGraphContext.js +6 -0
- package/FrameGraph/frameGraphContext.js.map +1 -0
- package/FrameGraph/frameGraphObjectList.d.ts +15 -0
- package/FrameGraph/frameGraphObjectList.js +7 -0
- package/FrameGraph/frameGraphObjectList.js.map +1 -0
- package/FrameGraph/frameGraphRenderContext.d.ts +110 -0
- package/FrameGraph/frameGraphRenderContext.js +237 -0
- package/FrameGraph/frameGraphRenderContext.js.map +1 -0
- package/FrameGraph/frameGraphTask.d.ts +49 -0
- package/FrameGraph/frameGraphTask.js +117 -0
- package/FrameGraph/frameGraphTask.js.map +1 -0
- package/FrameGraph/frameGraphTextureManager.d.ts +50 -0
- package/FrameGraph/frameGraphTextureManager.js +277 -0
- package/FrameGraph/frameGraphTextureManager.js.map +1 -0
- package/FrameGraph/frameGraphTypes.d.ts +59 -0
- package/FrameGraph/frameGraphTypes.js +9 -0
- package/FrameGraph/frameGraphTypes.js.map +1 -0
- package/FrameGraph/index.d.ts +28 -0
- package/FrameGraph/index.js +30 -0
- package/FrameGraph/index.js.map +1 -0
- package/Gamepads/gamepadSceneComponent.d.ts +0 -1
- package/Gamepads/gamepadSceneComponent.js +1 -7
- package/Gamepads/gamepadSceneComponent.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +7 -0
- package/Gizmos/boundingBoxGizmo.js +19 -6
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +3 -1
- package/Inputs/scene.inputManager.js +20 -8
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/layer.d.ts +1 -1
- package/Layers/layer.js +1 -1
- package/Layers/layer.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +4 -0
- package/Materials/PBR/pbrBaseMaterial.js +8 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/dynamicTexture.d.ts +32 -2
- package/Materials/Textures/dynamicTexture.js +13 -18
- package/Materials/Textures/dynamicTexture.js.map +1 -1
- package/Materials/Textures/index.d.ts +1 -0
- package/Materials/Textures/index.js +1 -0
- package/Materials/Textures/index.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +0 -6
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +20 -8
- package/Materials/Textures/multiRenderTarget.js +2 -0
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +8 -1
- package/Materials/Textures/renderTargetTexture.js +28 -10
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +20 -2
- package/Materials/Textures/textureCreationOptions.js +20 -1
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Materials/effectRenderer.d.ts +132 -14
- package/Materials/effectRenderer.js +229 -33
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/index.d.ts +1 -0
- package/Materials/index.js +1 -0
- package/Materials/index.js.map +1 -1
- package/Materials/materialHelper.functions.js +2 -0
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.d.ts +122 -0
- package/Materials/materialHelper.geometryrendering.js +259 -0
- package/Materials/materialHelper.geometryrendering.js.map +1 -0
- package/Materials/standardMaterial.d.ts +4 -0
- package/Materials/standardMaterial.js +8 -0
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/index.d.ts +1 -0
- package/Maths/index.js +1 -0
- package/Maths/index.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.d.ts +22 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js +39 -0
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
- package/Misc/copyTextureToTexture.d.ts +3 -2
- package/Misc/copyTextureToTexture.js +11 -5
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.d.ts +5 -3
- package/PostProcesses/blackAndWhitePostProcess.js +24 -19
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/bloomEffect.d.ts +7 -5
- package/PostProcesses/bloomEffect.js +49 -23
- package/PostProcesses/bloomEffect.js.map +1 -1
- package/PostProcesses/bloomMergePostProcess.d.ts +5 -5
- package/PostProcesses/bloomMergePostProcess.js +28 -19
- package/PostProcesses/bloomMergePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +7 -43
- package/PostProcesses/blurPostProcess.js +47 -185
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/circleOfConfusionPostProcess.d.ts +13 -6
- package/PostProcesses/circleOfConfusionPostProcess.js +59 -38
- package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +2 -6
- package/PostProcesses/depthOfFieldBlurPostProcess.js +14 -11
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.d.ts +5 -2
- package/PostProcesses/depthOfFieldEffect.js +53 -45
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.d.ts +0 -1
- package/PostProcesses/depthOfFieldMergePostProcess.js +18 -12
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/extractHighlightsPostProcess.d.ts +8 -4
- package/PostProcesses/extractHighlightsPostProcess.js +35 -22
- package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
- package/PostProcesses/index.d.ts +6 -0
- package/PostProcesses/index.js +6 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +15 -70
- package/PostProcesses/postProcess.js +80 -97
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/thinBlackAndWhitePostProcess.d.ts +28 -0
- package/PostProcesses/thinBlackAndWhitePostProcess.js +50 -0
- package/PostProcesses/thinBlackAndWhitePostProcess.js.map +1 -0
- package/PostProcesses/thinBloomEffect.d.ts +49 -0
- package/PostProcesses/thinBloomEffect.js +59 -0
- package/PostProcesses/thinBloomEffect.js.map +1 -0
- package/PostProcesses/thinBloomMergePostProcess.d.ts +15 -0
- package/PostProcesses/thinBloomMergePostProcess.js +38 -0
- package/PostProcesses/thinBloomMergePostProcess.js.map +1 -0
- package/PostProcesses/thinBlurPostProcess.d.ts +89 -0
- package/PostProcesses/thinBlurPostProcess.js +242 -0
- package/PostProcesses/thinBlurPostProcess.js.map +1 -0
- package/PostProcesses/thinCircleOfConfusionPostProcess.d.ts +62 -0
- package/PostProcesses/thinCircleOfConfusionPostProcess.js +81 -0
- package/PostProcesses/thinCircleOfConfusionPostProcess.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldBlurPostProcess.d.ts +8 -0
- package/PostProcesses/thinDepthOfFieldBlurPostProcess.js +13 -0
- package/PostProcesses/thinDepthOfFieldBlurPostProcess.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldEffect.d.ts +70 -0
- package/PostProcesses/thinDepthOfFieldEffect.js +115 -0
- package/PostProcesses/thinDepthOfFieldEffect.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldMergePostProcess.d.ts +11 -0
- package/PostProcesses/thinDepthOfFieldMergePostProcess.js +30 -0
- package/PostProcesses/thinDepthOfFieldMergePostProcess.js.map +1 -0
- package/PostProcesses/thinExtractHighlightsPostProcess.d.ts +30 -0
- package/PostProcesses/thinExtractHighlightsPostProcess.js +55 -0
- package/PostProcesses/thinExtractHighlightsPostProcess.js.map +1 -0
- package/Rendering/depthPeelingRenderer.js +2 -2
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js +4 -4
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockPrePass.d.ts +5 -0
- package/Shaders/ShadersInclude/pbrBlockPrePass.js +75 -0
- package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -0
- package/Shaders/ShadersInclude/prePassVertex.js +1 -2
- package/Shaders/ShadersInclude/prePassVertex.js.map +1 -1
- package/Shaders/circleOfConfusion.fragment.js +9 -1
- package/Shaders/circleOfConfusion.fragment.js.map +1 -1
- package/Shaders/colorCorrection.fragment.js +1 -0
- package/Shaders/colorCorrection.fragment.js.map +1 -1
- package/Shaders/default.fragment.js +17 -25
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/default.vertex.js +4 -6
- package/Shaders/default.vertex.js.map +1 -1
- package/Shaders/pbr.fragment.d.ts +1 -0
- package/Shaders/pbr.fragment.js +2 -74
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/pbr.vertex.js +3 -3
- package/Shaders/pbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +100 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/prePassVertex.js +1 -2
- package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -1
- package/ShadersWGSL/background.vertex.js +1 -1
- package/ShadersWGSL/background.vertex.js.map +1 -1
- package/ShadersWGSL/circleOfConfusion.fragment.js +10 -2
- package/ShadersWGSL/circleOfConfusion.fragment.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +20 -31
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/default.vertex.js +4 -5
- package/ShadersWGSL/default.vertex.js.map +1 -1
- package/ShadersWGSL/glowMapGeneration.fragment.js +1 -1
- package/ShadersWGSL/glowMapGeneration.fragment.js.map +1 -1
- package/ShadersWGSL/glowMapGeneration.vertex.js +1 -1
- package/ShadersWGSL/glowMapGeneration.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.d.ts +1 -0
- package/ShadersWGSL/pbr.fragment.js +2 -100
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.vertex.js +4 -2
- package/ShadersWGSL/pbr.vertex.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.js +1 -1
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +19 -2
- package/scene.js +110 -13
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +0 -1
- package/sceneComponent.js +0 -1
- package/sceneComponent.js.map +1 -1
- package/types.d.ts +12 -0
- package/types.js.map +1 -1
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { FrameGraphPass } from "./Passes/pass.js";
|
|
2
|
+
import { FrameGraphRenderPass } from "./Passes/renderPass.js";
|
|
3
|
+
import { FrameGraphCullPass } from "./Passes/cullPass.js";
|
|
4
|
+
import { FrameGraphRenderContext } from "./frameGraphRenderContext.js";
|
|
5
|
+
import { FrameGraphContext } from "./frameGraphContext.js";
|
|
6
|
+
import { FrameGraphTextureManager } from "./frameGraphTextureManager.js";
|
|
7
|
+
import { Observable } from "../Misc/observable.js";
|
|
8
|
+
import { getDimensionsFromTextureSize, textureSizeIsObject } from "../Materials/Textures/textureCreationOptions.js";
|
|
9
|
+
var FrameGraphPassType;
|
|
10
|
+
(function (FrameGraphPassType) {
|
|
11
|
+
FrameGraphPassType[FrameGraphPassType["Render"] = 0] = "Render";
|
|
12
|
+
FrameGraphPassType[FrameGraphPassType["Cull"] = 1] = "Cull";
|
|
13
|
+
FrameGraphPassType[FrameGraphPassType["Compute"] = 2] = "Compute";
|
|
14
|
+
})(FrameGraphPassType || (FrameGraphPassType = {}));
|
|
15
|
+
/**
|
|
16
|
+
* Class used to implement a frame graph
|
|
17
|
+
* @experimental
|
|
18
|
+
*/
|
|
19
|
+
export class FrameGraph {
|
|
20
|
+
/**
|
|
21
|
+
* Gets the engine used by the frame graph
|
|
22
|
+
*/
|
|
23
|
+
get engine() {
|
|
24
|
+
return this._engine;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Constructs the frame graph
|
|
28
|
+
* @param engine defines the hosting engine
|
|
29
|
+
* @param debugTextures defines a boolean indicating that textures created by the frame graph should be visible in the inspector
|
|
30
|
+
* @param scene defines the scene in which debugging textures are to be created
|
|
31
|
+
*/
|
|
32
|
+
constructor(engine, debugTextures = false, scene) {
|
|
33
|
+
this._tasks = [];
|
|
34
|
+
this._currentProcessedTask = null;
|
|
35
|
+
/**
|
|
36
|
+
* Observable raised when the node render graph is built
|
|
37
|
+
*/
|
|
38
|
+
this.onBuildObservable = new Observable();
|
|
39
|
+
this._engine = engine;
|
|
40
|
+
this._textureManager = new FrameGraphTextureManager(this._engine, debugTextures, scene);
|
|
41
|
+
this._passContext = new FrameGraphContext();
|
|
42
|
+
this._renderContext = new FrameGraphRenderContext(this._engine, this._textureManager);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Gets a task by name
|
|
46
|
+
* @param name Name of the task to get
|
|
47
|
+
* @returns The task or undefined if not found
|
|
48
|
+
*/
|
|
49
|
+
getTaskByName(name) {
|
|
50
|
+
return this._tasks.find((t) => t.name === name);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Adds a task to the frame graph
|
|
54
|
+
* @param task Task to add
|
|
55
|
+
*/
|
|
56
|
+
addTask(task) {
|
|
57
|
+
if (this._currentProcessedTask !== null) {
|
|
58
|
+
throw new Error(`FrameGraph.addTask: Can't add the task "${task.name}" while another task is currently building (task: ${this._currentProcessedTask.name}).`);
|
|
59
|
+
}
|
|
60
|
+
this._tasks.push(task);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Adds a render pass to a task. This method can only be called during a Task.record execution.
|
|
64
|
+
* @param name The name of the pass
|
|
65
|
+
* @param whenTaskDisabled If true, the pass will be added to the list of passes to execute when the task is disabled (default is false)
|
|
66
|
+
* @returns The render pass created
|
|
67
|
+
*/
|
|
68
|
+
addRenderPass(name, whenTaskDisabled = false) {
|
|
69
|
+
return this._addPass(name, FrameGraphPassType.Render, whenTaskDisabled);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Adds a cull pass to a task. This method can only be called during a Task.record execution.
|
|
73
|
+
* @param name The name of the pass
|
|
74
|
+
* @param whenTaskDisabled If true, the pass will be added to the list of passes to execute when the task is disabled (default is false)
|
|
75
|
+
* @returns The cull pass created
|
|
76
|
+
*/
|
|
77
|
+
addCullPass(name, whenTaskDisabled = false) {
|
|
78
|
+
return this._addPass(name, FrameGraphPassType.Cull, whenTaskDisabled);
|
|
79
|
+
}
|
|
80
|
+
_addPass(name, passType, whenTaskDisabled = false) {
|
|
81
|
+
if (!this._currentProcessedTask) {
|
|
82
|
+
throw new Error("FrameGraph: A pass must be created during a Task.record execution only.");
|
|
83
|
+
}
|
|
84
|
+
let pass;
|
|
85
|
+
switch (passType) {
|
|
86
|
+
case FrameGraphPassType.Render:
|
|
87
|
+
pass = new FrameGraphRenderPass(name, this._currentProcessedTask, this._renderContext, this._engine);
|
|
88
|
+
break;
|
|
89
|
+
case FrameGraphPassType.Cull:
|
|
90
|
+
pass = new FrameGraphCullPass(name, this._currentProcessedTask, this._passContext, this._engine);
|
|
91
|
+
break;
|
|
92
|
+
default:
|
|
93
|
+
pass = new FrameGraphPass(name, this._currentProcessedTask, this._passContext);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
this._currentProcessedTask._addPass(pass, whenTaskDisabled);
|
|
97
|
+
return pass;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Builds the frame graph.
|
|
101
|
+
* 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).
|
|
102
|
+
*/
|
|
103
|
+
build() {
|
|
104
|
+
this._textureManager.releaseTextures(false);
|
|
105
|
+
for (const task of this._tasks) {
|
|
106
|
+
task._reset();
|
|
107
|
+
this._currentProcessedTask = task;
|
|
108
|
+
task.record();
|
|
109
|
+
this._currentProcessedTask = null;
|
|
110
|
+
}
|
|
111
|
+
this._textureManager.allocateTextures();
|
|
112
|
+
for (const task of this._tasks) {
|
|
113
|
+
task._checkTask();
|
|
114
|
+
}
|
|
115
|
+
this.onBuildObservable.notifyObservers(this);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Returns a promise that resolves when the frame graph is ready to be executed
|
|
119
|
+
* This method must be called after the graph has been built (FrameGraph.build called)!
|
|
120
|
+
* @param timeout Timeout in ms between retries (default is 16)
|
|
121
|
+
* @returns The promise that resolves when the graph is ready
|
|
122
|
+
*/
|
|
123
|
+
whenReadyAsync(timeout = 16) {
|
|
124
|
+
return new Promise((resolve) => {
|
|
125
|
+
const checkReady = () => {
|
|
126
|
+
let ready = true;
|
|
127
|
+
for (const task of this._tasks) {
|
|
128
|
+
ready && (ready = task.isReady());
|
|
129
|
+
}
|
|
130
|
+
if (ready) {
|
|
131
|
+
resolve();
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
setTimeout(checkReady, timeout);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
checkReady();
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Executes the frame graph.
|
|
142
|
+
*/
|
|
143
|
+
execute() {
|
|
144
|
+
this._renderContext._bindRenderTarget();
|
|
145
|
+
for (const task of this._tasks) {
|
|
146
|
+
const passes = task._getPasses();
|
|
147
|
+
for (const pass of passes) {
|
|
148
|
+
pass._execute();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Imports a texture into the frame graph
|
|
154
|
+
* @param name Name of the texture
|
|
155
|
+
* @param texture Texture to import
|
|
156
|
+
* @param handle Existing handle to use for the texture. If not provided (default), a new handle will be created.
|
|
157
|
+
* @returns The handle to the texture
|
|
158
|
+
*/
|
|
159
|
+
importTexture(name, texture, handle) {
|
|
160
|
+
return this._textureManager.importTexture(name, texture, handle);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Gets the creation options of a texture
|
|
164
|
+
* @param handle Handle of the texture
|
|
165
|
+
* @param cloneOptions If true, the options will be cloned before being returned (default is false)
|
|
166
|
+
* @returns The creation options of the texture
|
|
167
|
+
*/
|
|
168
|
+
getTextureCreationOptions(handle, cloneOptions = false) {
|
|
169
|
+
const creationOptions = this._textureManager.getTextureCreationOptions(handle);
|
|
170
|
+
return cloneOptions
|
|
171
|
+
? {
|
|
172
|
+
size: getDimensionsFromTextureSize(creationOptions.size),
|
|
173
|
+
options: { ...creationOptions.options },
|
|
174
|
+
sizeIsPercentage: creationOptions.sizeIsPercentage,
|
|
175
|
+
}
|
|
176
|
+
: creationOptions;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Gets the description of a texture
|
|
180
|
+
* @param handle Handle of the texture
|
|
181
|
+
* @returns The description of the texture
|
|
182
|
+
*/
|
|
183
|
+
getTextureDescription(handle) {
|
|
184
|
+
const creationOptions = this.getTextureCreationOptions(handle);
|
|
185
|
+
const size = !creationOptions.sizeIsPercentage
|
|
186
|
+
? textureSizeIsObject(creationOptions.size)
|
|
187
|
+
? { width: creationOptions.size.width, height: creationOptions.size.height }
|
|
188
|
+
: { width: creationOptions.size, height: creationOptions.size }
|
|
189
|
+
: this._textureManager.getAbsoluteDimensions(creationOptions.size);
|
|
190
|
+
return {
|
|
191
|
+
size,
|
|
192
|
+
options: { ...creationOptions.options },
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Gets a texture handle or creates a new texture if the handle is not provided.
|
|
197
|
+
* @param handle If provided, will simply return the handle
|
|
198
|
+
* @param newTextureName Name of the new texture to create
|
|
199
|
+
* @param creationOptions Options to use when creating the new texture
|
|
200
|
+
* @returns The handle to the texture. If handle is not provided, newTextureName and creationOptions must be provided.
|
|
201
|
+
*/
|
|
202
|
+
getTextureHandleOrCreateTexture(handle, newTextureName, creationOptions) {
|
|
203
|
+
if (handle === undefined) {
|
|
204
|
+
if (newTextureName === undefined || creationOptions === undefined) {
|
|
205
|
+
throw new Error("getTextureHandleOrCreateTexture: Either handle or newTextureName and creationOptions must be provided.");
|
|
206
|
+
}
|
|
207
|
+
return this.createRenderTargetTexture(newTextureName, creationOptions);
|
|
208
|
+
}
|
|
209
|
+
return handle;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Gets a texture from a handle
|
|
213
|
+
* @param handle The handle of the texture
|
|
214
|
+
* @returns The texture or null if not found
|
|
215
|
+
*/
|
|
216
|
+
getTexture(handle) {
|
|
217
|
+
return this._textureManager.getTextureFromHandle(handle);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Creates a new render target texture
|
|
221
|
+
* @param name Name of the texture
|
|
222
|
+
* @param creationOptions Options to use when creating the texture
|
|
223
|
+
* @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.
|
|
224
|
+
* @returns The handle to the texture
|
|
225
|
+
*/
|
|
226
|
+
createRenderTargetTexture(name, creationOptions, multiTargetMode = false) {
|
|
227
|
+
return this._textureManager.createRenderTargetTexture(name, !!this._currentProcessedTask, creationOptions, multiTargetMode);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Creates a handle which is not associated with any texture.
|
|
231
|
+
* Call resolveDanglingHandle to associate the handle with a valid texture handle.
|
|
232
|
+
* @returns The dangling handle
|
|
233
|
+
*/
|
|
234
|
+
createDanglingHandle() {
|
|
235
|
+
return this._textureManager.createDanglingHandle();
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Associates a texture with a dangling handle
|
|
239
|
+
* @param danglingHandle The dangling handle
|
|
240
|
+
* @param handle The handle to associate with the dangling handle (if not provided, a new texture handle will be created)
|
|
241
|
+
* @param newTextureName The name of the new texture to create (if handle is not provided)
|
|
242
|
+
* @param creationOptions The options to use when creating the new texture (if handle is not provided)
|
|
243
|
+
*/
|
|
244
|
+
resolveDanglingHandle(danglingHandle, handle, newTextureName, creationOptions) {
|
|
245
|
+
if (handle === undefined) {
|
|
246
|
+
if (newTextureName === undefined || creationOptions === undefined) {
|
|
247
|
+
throw new Error("resolveDanglingHandle: Either handle or newTextureName and creationOptions must be provided.");
|
|
248
|
+
}
|
|
249
|
+
this._textureManager.createRenderTargetTexture(newTextureName, !!this._currentProcessedTask, creationOptions, false, danglingHandle);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
this._textureManager.resolveDanglingHandle(danglingHandle, handle);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Clears the frame graph (remove the tasks and release the textures).
|
|
256
|
+
* The frame graph can be built again after this method is called.
|
|
257
|
+
*/
|
|
258
|
+
clear() {
|
|
259
|
+
for (const task of this._tasks) {
|
|
260
|
+
task._reset();
|
|
261
|
+
}
|
|
262
|
+
this._tasks.length = 0;
|
|
263
|
+
this._textureManager.releaseTextures();
|
|
264
|
+
this._currentProcessedTask = null;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Disposes the frame graph
|
|
268
|
+
*/
|
|
269
|
+
dispose() {
|
|
270
|
+
this.clear();
|
|
271
|
+
this._textureManager.dispose();
|
|
272
|
+
this._renderContext._dispose();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
//# sourceMappingURL=frameGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frameGraph.js","sourceRoot":"","sources":["../../../../dev/core/src/FrameGraph/frameGraph.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,oBAAo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AAK,SAAS,IAAI,eAAe,KAAK,SAAS,EAAE;gBAC/D,MAAM,IAAI,KAAK,CAAC,8FAA8F,CAAC,CAAC;aACnH;YACD,IAAI,CAAC,eAAe,CAAC,yBAAyB,CAAC,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;YACrI,OAAO;SACV;QAED,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;IAED;;;OAGG;IACI,KAAK;QACR,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;YAC5B,IAAI,CAAC,MAAM,EAAE,CAAC;SACjB;QAED,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,eAAe,CAAC,eAAe,EAAE,CAAC;QACvC,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,KAAK,EAAE,CAAC;QACb,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;CACJ","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nimport type {\r\n Scene,\r\n AbstractEngine,\r\n RenderTargetWrapper,\r\n FrameGraphTextureCreationOptions,\r\n FrameGraphTextureHandle,\r\n FrameGraphTextureDescription,\r\n Nullable,\r\n FrameGraphTask,\r\n} from \"core/index\";\r\nimport { FrameGraphPass } from \"./Passes/pass\";\r\nimport { FrameGraphRenderPass } from \"./Passes/renderPass\";\r\nimport { FrameGraphCullPass } from \"./Passes/cullPass\";\r\nimport { FrameGraphRenderContext } from \"./frameGraphRenderContext\";\r\nimport { FrameGraphContext } from \"./frameGraphContext\";\r\nimport { FrameGraphTextureManager } from \"./frameGraphTextureManager\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { getDimensionsFromTextureSize, textureSizeIsObject } from \"../Materials/Textures/textureCreationOptions\";\r\n\r\nenum FrameGraphPassType {\r\n Render = 0,\r\n Cull = 1,\r\n Compute = 2,\r\n}\r\n\r\n/**\r\n * Class used to implement a frame graph\r\n * @experimental\r\n */\r\nexport class FrameGraph {\r\n /** @internal */\r\n public readonly _passContext: FrameGraphContext;\r\n /** @internal */\r\n public readonly _renderContext: FrameGraphRenderContext;\r\n\r\n private readonly _engine: AbstractEngine;\r\n private readonly _textureManager: FrameGraphTextureManager;\r\n private _tasks: FrameGraphTask[] = [];\r\n private _currentProcessedTask: FrameGraphTask | null = null;\r\n\r\n /**\r\n * Observable raised when the node render graph is built\r\n */\r\n public onBuildObservable = new Observable<FrameGraph>();\r\n\r\n /**\r\n * Gets the engine used by the frame graph\r\n */\r\n public get engine() {\r\n return this._engine;\r\n }\r\n\r\n /**\r\n * Constructs the frame graph\r\n * @param engine defines the hosting engine\r\n * @param debugTextures defines a boolean indicating that textures created by the frame graph should be visible in the inspector\r\n * @param scene defines the scene in which debugging textures are to be created\r\n */\r\n constructor(engine: AbstractEngine, debugTextures = false, scene?: Scene) {\r\n this._engine = engine;\r\n this._textureManager = new FrameGraphTextureManager(this._engine, debugTextures, scene);\r\n this._passContext = new FrameGraphContext();\r\n this._renderContext = new FrameGraphRenderContext(this._engine, this._textureManager);\r\n }\r\n\r\n /**\r\n * Gets a task by name\r\n * @param name Name of the task to get\r\n * @returns The task or undefined if not found\r\n */\r\n public getTaskByName<T extends FrameGraphTask>(name: string): T | undefined {\r\n return this._tasks.find((t) => t.name === name) as T;\r\n }\r\n\r\n /**\r\n * Adds a task to the frame graph\r\n * @param task Task to add\r\n */\r\n public addTask(task: FrameGraphTask): void {\r\n if (this._currentProcessedTask !== null) {\r\n throw new Error(`FrameGraph.addTask: Can't add the task \"${task.name}\" while another task is currently building (task: ${this._currentProcessedTask.name}).`);\r\n }\r\n\r\n this._tasks.push(task);\r\n }\r\n\r\n /**\r\n * Adds a render pass to a task. This method can only be called during a Task.record execution.\r\n * @param name The name of the pass\r\n * @param whenTaskDisabled If true, the pass will be added to the list of passes to execute when the task is disabled (default is false)\r\n * @returns The render pass created\r\n */\r\n public addRenderPass(name: string, whenTaskDisabled = false): FrameGraphRenderPass {\r\n return this._addPass(name, FrameGraphPassType.Render, whenTaskDisabled) as FrameGraphRenderPass;\r\n }\r\n\r\n /**\r\n * Adds a cull pass to a task. This method can only be called during a Task.record execution.\r\n * @param name The name of the pass\r\n * @param whenTaskDisabled If true, the pass will be added to the list of passes to execute when the task is disabled (default is false)\r\n * @returns The cull pass created\r\n */\r\n public addCullPass(name: string, whenTaskDisabled = false): FrameGraphCullPass {\r\n return this._addPass(name, FrameGraphPassType.Cull, whenTaskDisabled) as FrameGraphCullPass;\r\n }\r\n\r\n private _addPass(name: string, passType: FrameGraphPassType, whenTaskDisabled = false): FrameGraphPass<FrameGraphContext> | FrameGraphRenderPass {\r\n if (!this._currentProcessedTask) {\r\n throw new Error(\"FrameGraph: A pass must be created during a Task.record execution only.\");\r\n }\r\n\r\n let pass: FrameGraphPass<FrameGraphContext> | FrameGraphRenderPass;\r\n\r\n switch (passType) {\r\n case FrameGraphPassType.Render:\r\n pass = new FrameGraphRenderPass(name, this._currentProcessedTask, this._renderContext, this._engine);\r\n break;\r\n case FrameGraphPassType.Cull:\r\n pass = new FrameGraphCullPass(name, this._currentProcessedTask, this._passContext, this._engine);\r\n break;\r\n default:\r\n pass = new FrameGraphPass(name, this._currentProcessedTask, this._passContext);\r\n break;\r\n }\r\n\r\n this._currentProcessedTask._addPass(pass, whenTaskDisabled);\r\n\r\n return pass;\r\n }\r\n\r\n /**\r\n * Builds the frame graph.\r\n * 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).\r\n */\r\n public build(): void {\r\n this._textureManager.releaseTextures(false);\r\n\r\n for (const task of this._tasks) {\r\n task._reset();\r\n\r\n this._currentProcessedTask = task;\r\n\r\n task.record();\r\n\r\n this._currentProcessedTask = null;\r\n }\r\n\r\n this._textureManager.allocateTextures();\r\n\r\n for (const task of this._tasks) {\r\n task._checkTask();\r\n }\r\n\r\n this.onBuildObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Returns a promise that resolves when the frame graph is ready to be executed\r\n * This method must be called after the graph has been built (FrameGraph.build called)!\r\n * @param timeout Timeout in ms between retries (default is 16)\r\n * @returns The promise that resolves when the graph is ready\r\n */\r\n public whenReadyAsync(timeout = 16): Promise<void> {\r\n return new Promise((resolve) => {\r\n const checkReady = () => {\r\n let ready = true;\r\n for (const task of this._tasks) {\r\n ready &&= task.isReady();\r\n }\r\n if (ready) {\r\n resolve();\r\n } else {\r\n setTimeout(checkReady, timeout);\r\n }\r\n };\r\n\r\n checkReady();\r\n });\r\n }\r\n\r\n /**\r\n * Executes the frame graph.\r\n */\r\n public execute(): void {\r\n this._renderContext._bindRenderTarget();\r\n\r\n for (const task of this._tasks) {\r\n const passes = task._getPasses();\r\n\r\n for (const pass of passes) {\r\n pass._execute();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Imports a texture into the frame graph\r\n * @param name Name of the texture\r\n * @param texture Texture to import\r\n * @param handle Existing handle to use for the texture. If not provided (default), a new handle will be created.\r\n * @returns The handle to the texture\r\n */\r\n public importTexture(name: string, texture: RenderTargetWrapper, handle?: FrameGraphTextureHandle): FrameGraphTextureHandle {\r\n return this._textureManager.importTexture(name, texture, handle);\r\n }\r\n\r\n /**\r\n * Gets the creation options of a texture\r\n * @param handle Handle of the texture\r\n * @param cloneOptions If true, the options will be cloned before being returned (default is false)\r\n * @returns The creation options of the texture\r\n */\r\n public getTextureCreationOptions(handle: FrameGraphTextureHandle, cloneOptions = false): FrameGraphTextureCreationOptions {\r\n const creationOptions = this._textureManager.getTextureCreationOptions(handle);\r\n\r\n return cloneOptions\r\n ? {\r\n size: getDimensionsFromTextureSize(creationOptions.size),\r\n options: { ...creationOptions.options },\r\n sizeIsPercentage: creationOptions.sizeIsPercentage,\r\n }\r\n : creationOptions;\r\n }\r\n\r\n /**\r\n * Gets the description of a texture\r\n * @param handle Handle of the texture\r\n * @returns The description of the texture\r\n */\r\n public getTextureDescription(handle: FrameGraphTextureHandle): FrameGraphTextureDescription {\r\n const creationOptions = this.getTextureCreationOptions(handle);\r\n\r\n const size = !creationOptions.sizeIsPercentage\r\n ? textureSizeIsObject(creationOptions.size)\r\n ? { width: creationOptions.size.width, height: creationOptions.size.height }\r\n : { width: creationOptions.size, height: creationOptions.size }\r\n : this._textureManager.getAbsoluteDimensions(creationOptions.size);\r\n\r\n return {\r\n size,\r\n options: { ...creationOptions.options },\r\n };\r\n }\r\n\r\n /**\r\n * Gets a texture handle or creates a new texture if the handle is not provided.\r\n * @param handle If provided, will simply return the handle\r\n * @param newTextureName Name of the new texture to create\r\n * @param creationOptions Options to use when creating the new texture\r\n * @returns The handle to the texture. If handle is not provided, newTextureName and creationOptions must be provided.\r\n */\r\n public getTextureHandleOrCreateTexture(handle?: FrameGraphTextureHandle, newTextureName?: string, creationOptions?: FrameGraphTextureCreationOptions): FrameGraphTextureHandle {\r\n if (handle === undefined) {\r\n if (newTextureName === undefined || creationOptions === undefined) {\r\n throw new Error(\"getTextureHandleOrCreateTexture: Either handle or newTextureName and creationOptions must be provided.\");\r\n }\r\n return this.createRenderTargetTexture(newTextureName, creationOptions);\r\n }\r\n return handle;\r\n }\r\n\r\n /**\r\n * Gets a texture from a handle\r\n * @param handle The handle of the texture\r\n * @returns The texture or null if not found\r\n */\r\n public getTexture(handle: FrameGraphTextureHandle): Nullable<RenderTargetWrapper> {\r\n return this._textureManager.getTextureFromHandle(handle);\r\n }\r\n\r\n /**\r\n * Creates a new render target texture\r\n * @param name Name of the texture\r\n * @param creationOptions Options to use when creating the texture\r\n * @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.\r\n * @returns The handle to the texture\r\n */\r\n public createRenderTargetTexture(name: string, creationOptions: FrameGraphTextureCreationOptions, multiTargetMode = false): FrameGraphTextureHandle {\r\n return this._textureManager.createRenderTargetTexture(name, !!this._currentProcessedTask, creationOptions, multiTargetMode);\r\n }\r\n\r\n /**\r\n * Creates a handle which is not associated with any texture.\r\n * Call resolveDanglingHandle to associate the handle with a valid texture handle.\r\n * @returns The dangling handle\r\n */\r\n public createDanglingHandle(): FrameGraphTextureHandle {\r\n return this._textureManager.createDanglingHandle();\r\n }\r\n\r\n /**\r\n * Associates a texture with a dangling handle\r\n * @param danglingHandle The dangling handle\r\n * @param handle The handle to associate with the dangling handle (if not provided, a new texture handle will be created)\r\n * @param newTextureName The name of the new texture to create (if handle is not provided)\r\n * @param creationOptions The options to use when creating the new texture (if handle is not provided)\r\n */\r\n public resolveDanglingHandle(\r\n danglingHandle: FrameGraphTextureHandle,\r\n handle?: FrameGraphTextureHandle,\r\n newTextureName?: string,\r\n creationOptions?: FrameGraphTextureCreationOptions\r\n ) {\r\n if (handle === undefined) {\r\n if (newTextureName === undefined || creationOptions === undefined) {\r\n throw new Error(\"resolveDanglingHandle: Either handle or newTextureName and creationOptions must be provided.\");\r\n }\r\n this._textureManager.createRenderTargetTexture(newTextureName, !!this._currentProcessedTask, creationOptions, false, danglingHandle);\r\n return;\r\n }\r\n\r\n this._textureManager.resolveDanglingHandle(danglingHandle, handle);\r\n }\r\n\r\n /**\r\n * Clears the frame graph (remove the tasks and release the textures).\r\n * The frame graph can be built again after this method is called.\r\n */\r\n public clear(): void {\r\n for (const task of this._tasks) {\r\n task._reset();\r\n }\r\n\r\n this._tasks.length = 0;\r\n this._textureManager.releaseTextures();\r\n this._currentProcessedTask = null;\r\n }\r\n\r\n /**\r\n * Disposes the frame graph\r\n */\r\n public dispose(): void {\r\n this.clear();\r\n this._textureManager.dispose();\r\n this._renderContext._dispose();\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frameGraphContext.js","sourceRoot":"","sources":["../../../../dev/core/src/FrameGraph/frameGraphContext.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,iBAAiB;CAAG","sourcesContent":["/**\r\n * Base class for frame graph context.\r\n */\r\nexport class FrameGraphContext {}\r\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Nullable, AbstractMesh, IParticleSystem } from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Structure used by the frame graph to reference objects.
|
|
4
|
+
* @experimental
|
|
5
|
+
*/
|
|
6
|
+
export declare class FrameGraphObjectList {
|
|
7
|
+
/**
|
|
8
|
+
* The meshes in the object list.
|
|
9
|
+
*/
|
|
10
|
+
meshes: Nullable<AbstractMesh[]>;
|
|
11
|
+
/**
|
|
12
|
+
* The particle systems in the object list.
|
|
13
|
+
*/
|
|
14
|
+
particleSystems: Nullable<IParticleSystem[]>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frameGraphObjectList.js","sourceRoot":"","sources":["../../../../dev/core/src/FrameGraph/frameGraphObjectList.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,OAAO,oBAAoB;CAUhC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, AbstractMesh, IParticleSystem } from \"core/index\";\r\n\r\n/**\r\n * Structure used by the frame graph to reference objects.\r\n * @experimental\r\n */\r\nexport class FrameGraphObjectList {\r\n /**\r\n * The meshes in the object list.\r\n */\r\n meshes: Nullable<AbstractMesh[]>;\r\n /**\r\n * The particle systems in the object list.\r\n */\r\n particleSystems: Nullable<IParticleSystem[]>;\r\n // todo: sprites?\r\n}\r\n"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { Nullable, AbstractEngine, DrawWrapper, IColor4Like, Layer, FrameGraphTextureHandle, Effect, FrameGraphTextureManager, RenderTargetTexture } from "../index.js";
|
|
2
|
+
import { FrameGraphContext } from "./frameGraphContext";
|
|
3
|
+
/**
|
|
4
|
+
* Frame graph context used render passes.
|
|
5
|
+
* @experimental
|
|
6
|
+
*/
|
|
7
|
+
export declare class FrameGraphRenderContext extends FrameGraphContext {
|
|
8
|
+
private readonly _engine;
|
|
9
|
+
private readonly _textureManager;
|
|
10
|
+
private readonly _effectRenderer;
|
|
11
|
+
private _currentRenderTargetHandle;
|
|
12
|
+
private _debugMessageWhenTargetBound;
|
|
13
|
+
private _debugMessageHasBeenPushed;
|
|
14
|
+
private _renderTargetIsBound;
|
|
15
|
+
private readonly _copyTexture;
|
|
16
|
+
/** @internal */
|
|
17
|
+
constructor(_engine: AbstractEngine, _textureManager: FrameGraphTextureManager);
|
|
18
|
+
/**
|
|
19
|
+
* Checks whether a texture handle points to the backbuffer's color or depth texture
|
|
20
|
+
* @param handle The handle to check
|
|
21
|
+
* @returns True if the handle points to the backbuffer's color or depth texture, otherwise false
|
|
22
|
+
*/
|
|
23
|
+
isBackbuffer(handle: FrameGraphTextureHandle): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Checks whether a texture handle points to the backbuffer's color texture
|
|
26
|
+
* @param handle The handle to check
|
|
27
|
+
* @returns True if the handle points to the backbuffer's color texture, otherwise false
|
|
28
|
+
*/
|
|
29
|
+
isBackbufferColor(handle: FrameGraphTextureHandle): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Checks whether a texture handle points to the backbuffer's depth texture
|
|
32
|
+
* @param handle The handle to check
|
|
33
|
+
* @returns True if the handle points to the backbuffer's depth texture, otherwise false
|
|
34
|
+
*/
|
|
35
|
+
isBackbufferDepthStencil(handle: FrameGraphTextureHandle): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Clears the current render buffer or the current render target (if any is set up)
|
|
38
|
+
* @param color Defines the color to use
|
|
39
|
+
* @param backBuffer Defines if the back buffer must be cleared
|
|
40
|
+
* @param depth Defines if the depth buffer must be cleared
|
|
41
|
+
* @param stencil Defines if the stencil buffer must be cleared
|
|
42
|
+
*/
|
|
43
|
+
clear(color: Nullable<IColor4Like>, backBuffer: boolean, depth: boolean, stencil?: boolean): void;
|
|
44
|
+
/**
|
|
45
|
+
* Clears the color attachments of the current render target
|
|
46
|
+
* @param color Defines the color to use
|
|
47
|
+
* @param attachments The attachments to clear
|
|
48
|
+
*/
|
|
49
|
+
clearColorAttachments(color: Nullable<IColor4Like>, attachments: number[]): void;
|
|
50
|
+
/**
|
|
51
|
+
* Binds the attachments to the current render target
|
|
52
|
+
* @param attachments The attachments to bind
|
|
53
|
+
*/
|
|
54
|
+
bindAttachments(attachments: number[]): void;
|
|
55
|
+
/**
|
|
56
|
+
* Generates mipmaps for the current render target
|
|
57
|
+
*/
|
|
58
|
+
generateMipMaps(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Sets the texture sampling mode for a given texture handle
|
|
61
|
+
* @param handle Handle of the texture to set the sampling mode for
|
|
62
|
+
* @param samplingMode Sampling mode to set
|
|
63
|
+
*/
|
|
64
|
+
setTextureSamplingMode(handle: FrameGraphTextureHandle, samplingMode: number): void;
|
|
65
|
+
/**
|
|
66
|
+
* Binds a texture handle to a given effect (resolves the handle to a texture and binds it to the effect)
|
|
67
|
+
* @param effect The effect to bind the texture to
|
|
68
|
+
* @param name The name of the texture in the effect
|
|
69
|
+
* @param handle The handle of the texture to bind
|
|
70
|
+
*/
|
|
71
|
+
bindTextureHandle(effect: Effect, name: string, handle: FrameGraphTextureHandle): void;
|
|
72
|
+
/**
|
|
73
|
+
* Sets the depth states for the current render target
|
|
74
|
+
* @param depthTest If true, depth testing is enabled
|
|
75
|
+
* @param depthWrite If true, depth writing is enabled
|
|
76
|
+
*/
|
|
77
|
+
setDepthStates(depthTest: boolean, depthWrite: boolean): void;
|
|
78
|
+
/**
|
|
79
|
+
* Applies a full-screen effect to the current render target
|
|
80
|
+
* @param drawWrapper The draw wrapper containing the effect to apply
|
|
81
|
+
* @param customBindings The custom bindings to use when applying the effect (optional)
|
|
82
|
+
* @returns True if the effect was applied, otherwise false (effect not ready)
|
|
83
|
+
*/
|
|
84
|
+
applyFullScreenEffect(drawWrapper: DrawWrapper, customBindings?: () => void): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Copies a texture to the current render target
|
|
87
|
+
* @param sourceTexture The source texture to copy from
|
|
88
|
+
* @param forceCopyToBackbuffer If true, the copy will be done to the back buffer regardless of the current render target
|
|
89
|
+
*/
|
|
90
|
+
copyTexture(sourceTexture: FrameGraphTextureHandle, forceCopyToBackbuffer?: boolean): void;
|
|
91
|
+
/**
|
|
92
|
+
* Renders a RenderTargetTexture or a layer
|
|
93
|
+
* @param object The RenderTargetTexture/Layer to render
|
|
94
|
+
*/
|
|
95
|
+
render(object: Layer | RenderTargetTexture): void;
|
|
96
|
+
/**
|
|
97
|
+
* Binds a render target texture so that upcoming draw calls will render to it
|
|
98
|
+
* Note: it is a lazy operation, so the render target will only be bound when needed. This way, it is possible to call
|
|
99
|
+
* this method several times with different render targets without incurring the cost of binding if no draw calls are made
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
_bindRenderTarget(renderTargetHandle?: FrameGraphTextureHandle, debugMessage?: string): void;
|
|
103
|
+
/** @internal */
|
|
104
|
+
_flushDebugMessages(): void;
|
|
105
|
+
/** @internal */
|
|
106
|
+
_shareDepth(srcRenderTargetHandle: FrameGraphTextureHandle, dstRenderTargetHandle: FrameGraphTextureHandle): void;
|
|
107
|
+
private _applyRenderTarget;
|
|
108
|
+
/** @internal */
|
|
109
|
+
_dispose(): void;
|
|
110
|
+
}
|