@babylonjs/core 8.40.0 → 8.41.0
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/Compute/computeEffect.js +5 -1
- package/Compute/computeEffect.js.map +1 -1
- package/Compute/computeShader.d.ts +4 -0
- package/Compute/computeShader.js +9 -3
- package/Compute/computeShader.js.map +1 -1
- package/Engines/Extensions/engine.computeShader.d.ts +2 -3
- package/Engines/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/ICanvas.d.ts +3 -3
- package/Engines/ICanvas.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +2 -2
- package/Engines/webgpuEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +3 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +29 -14
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +12 -41
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +106 -184
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
- package/FrameGraph/Passes/renderPass.js +5 -3
- package/FrameGraph/Passes/renderPass.js.map +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +2 -0
- package/FrameGraph/Tasks/Layers/baseLayerTask.js +6 -0
- package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/Layers/glowLayerTask.d.ts +1 -0
- package/FrameGraph/Tasks/Layers/glowLayerTask.js +3 -0
- package/FrameGraph/Tasks/Layers/glowLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/Layers/highlightLayerTask.d.ts +1 -0
- package/FrameGraph/Tasks/Layers/highlightLayerTask.js +3 -0
- package/FrameGraph/Tasks/Layers/highlightLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/computeShaderTask.d.ts +1 -0
- package/FrameGraph/Tasks/Misc/computeShaderTask.js +3 -0
- package/FrameGraph/Tasks/Misc/computeShaderTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/cullObjectsTask.d.ts +1 -0
- package/FrameGraph/Tasks/Misc/cullObjectsTask.js +3 -0
- package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/executeTask.d.ts +1 -0
- package/FrameGraph/Tasks/Misc/executeTask.js +3 -0
- package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.d.ts +1 -0
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +8 -1
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/anaglyphTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/blurTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/colorCorrectionTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/colorCorrectionTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/colorCorrectionTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/convolutionTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/convolutionTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/convolutionTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/customPostProcessTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/customPostProcessTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/customPostProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/filterTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/filterTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/filterTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/fxaaTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/fxaaTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/fxaaTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/grainTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/grainTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/grainTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/imageProcessingTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/motionBlurTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/motionBlurTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/motionBlurTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/passTask.d.ts +2 -0
- package/FrameGraph/Tasks/PostProcesses/passTask.js +6 -0
- package/FrameGraph/Tasks/PostProcesses/passTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/sharpenTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/sharpenTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/sharpenTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssao2BlurTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2BlurTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2BlurTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2RenderingPipelineTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssao2Task.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2Task.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/ssao2Task.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/ssrBlurTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssrTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/ssrTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/ssrTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/taaTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/taaTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/taaTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/tonemapTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/tonemapTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/tonemapTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.d.ts +1 -0
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.js +3 -0
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingBlendVolumeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.d.ts +3 -1
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js +12 -6
- package/FrameGraph/Tasks/PostProcesses/volumetricLightingTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +1 -0
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +3 -0
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +18 -58
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +114 -121
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +12 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +65 -26
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +1 -0
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +3 -0
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.d.ts +1 -0
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js +3 -0
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +1 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +21 -8
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.d.ts +1 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js +3 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +1 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +21 -4
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +1 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +3 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -1
- package/FrameGraph/frameGraphContext.js +2 -2
- package/FrameGraph/frameGraphContext.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +1 -0
- package/FrameGraph/frameGraphRenderContext.js +17 -8
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/frameGraphTask.d.ts +5 -0
- package/FrameGraph/frameGraphTask.js +9 -0
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphUtils.d.ts +2 -2
- package/FrameGraph/frameGraphUtils.js +6 -6
- package/FrameGraph/frameGraphUtils.js.map +1 -1
- package/Lights/lightingVolume.d.ts +10 -1
- package/Lights/lightingVolume.js +201 -102
- package/Lights/lightingVolume.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +2 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.d.ts +5 -1
- package/Materials/materialHelper.geometryrendering.js +11 -2
- package/Materials/materialHelper.geometryrendering.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +2 -1
- package/Meshes/geometry.js +6 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/mesh.d.ts +2 -1
- package/Meshes/mesh.js +4 -3
- package/Meshes/mesh.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +6 -2
- package/Rendering/objectRenderer.js +69 -63
- package/Rendering/objectRenderer.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +2 -2
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/volumetricLightingRenderVolume.fragment.js +2 -2
- package/Shaders/volumetricLightingRenderVolume.fragment.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +3 -3
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/lightingVolume.compute.js +10 -4
- package/ShadersWGSL/lightingVolume.compute.js.map +1 -1
- package/ShadersWGSL/volumetricLightingRenderVolume.fragment.js +2 -2
- package/ShadersWGSL/volumetricLightingRenderVolume.fragment.js.map +1 -1
- package/States/alphaCullingState.d.ts +1 -0
- package/States/alphaCullingState.js +3 -0
- package/States/alphaCullingState.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customPostProcessTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/customPostProcessTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAErF;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,yBAAyB;IAS1E;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,OAAqC;QACnF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAErF,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC;IAC/D,CAAC;CACJ","sourcesContent":["import type { FrameGraph, EffectWrapperCreationOptions, Observable, Effect } from \"core/index\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { ThinCustomPostProcess } from \"../../../PostProcesses/thinCustomPostProcess\";\r\n\r\n/**\r\n * Task which applies a custom post process.\r\n */\r\nexport class FrameGraphCustomPostProcessTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinCustomPostProcess;\r\n\r\n /**\r\n * Observable triggered when bind is called for the post process.\r\n * Use this to set custom uniforms.\r\n */\r\n public onApplyObservable: Observable<Effect>;\r\n\r\n /**\r\n * Constructs a new custom post process task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param options Options to configure the post process\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, options: EffectWrapperCreationOptions) {\r\n super(name, frameGraph, new ThinCustomPostProcess(name, frameGraph.engine, options));\r\n\r\n this.onApplyObservable = this.postProcess.onBindObservable;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"customPostProcessTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/customPostProcessTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAErF;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,yBAAyB;IAS1E;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,OAAqC;QACnF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAErF,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC;IAC/D,CAAC;IAEe,YAAY;QACxB,OAAO,iCAAiC,CAAC;IAC7C,CAAC;CACJ","sourcesContent":["import type { FrameGraph, EffectWrapperCreationOptions, Observable, Effect } from \"core/index\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { ThinCustomPostProcess } from \"../../../PostProcesses/thinCustomPostProcess\";\r\n\r\n/**\r\n * Task which applies a custom post process.\r\n */\r\nexport class FrameGraphCustomPostProcessTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinCustomPostProcess;\r\n\r\n /**\r\n * Observable triggered when bind is called for the post process.\r\n * Use this to set custom uniforms.\r\n */\r\n public onApplyObservable: Observable<Effect>;\r\n\r\n /**\r\n * Constructs a new custom post process task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param options Options to configure the post process\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, options: EffectWrapperCreationOptions) {\r\n super(name, frameGraph, new ThinCustomPostProcess(name, frameGraph.engine, options));\r\n\r\n this.onApplyObservable = this.postProcess.onBindObservable;\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphCustomPostProcessTask\";\r\n }\r\n}\r\n"]}
|
|
@@ -8,5 +8,6 @@ export declare class FrameGraphDepthOfFieldBlurTask extends FrameGraphBlurTask {
|
|
|
8
8
|
circleOfConfusionTexture: FrameGraphTextureHandle;
|
|
9
9
|
circleOfConfusionSamplingMode: number;
|
|
10
10
|
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinDepthOfFieldBlurPostProcess);
|
|
11
|
+
getClassName(): string;
|
|
11
12
|
record(skipCreationOfDisabledPasses?: boolean): FrameGraphRenderPass;
|
|
12
13
|
}
|
|
@@ -10,6 +10,9 @@ export class FrameGraphDepthOfFieldBlurTask extends FrameGraphBlurTask {
|
|
|
10
10
|
super(name, frameGraph, thinPostProcess || new ThinDepthOfFieldBlurPostProcess(name, frameGraph.engine, new Vector2(1, 0), 10));
|
|
11
11
|
this.circleOfConfusionSamplingMode = 2;
|
|
12
12
|
}
|
|
13
|
+
getClassName() {
|
|
14
|
+
return "FrameGraphDepthOfFieldBlurTask";
|
|
15
|
+
}
|
|
13
16
|
record(skipCreationOfDisabledPasses = false) {
|
|
14
17
|
if (this.sourceTexture === undefined || this.circleOfConfusionTexture === undefined) {
|
|
15
18
|
throw new Error(`FrameGraphDepthOfFieldBlurTask "${this.name}": sourceTexture and circleOfConfusionTexture are required`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depthOfFieldBlurTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,sCAA+B;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,kEAA2D;AACrG,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAEjD;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,kBAAkB;IAKlE,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAiD;QAC/F,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,+BAA+B,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAH7H,kCAA6B,GAAG,SAAS,CAAC,6BAA6B,CAAC;IAI/E,CAAC;IAEe,MAAM,CAAC,4BAA4B,GAAG,KAAK;QACvD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,wBAAwB,KAAK,SAAS,EAAE,CAAC;YAClF,MAAM,IAAI,KAAK,CAAC,mCAAmC,IAAI,CAAC,IAAI,4DAA4D,CAAC,CAAC;QAC9H,CAAC;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CACrB,4BAA4B,EAC5B,CAAC,OAAO,EAAE,EAAE;YACR,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC;QACtG,CAAC,EACD,CAAC,OAAO,EAAE,EAAE;YACR,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,0BAA0B,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC/H,CAAC,CACJ,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAEpD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphBlurTask } from \"./blurTask\";\r\nimport { ThinDepthOfFieldBlurPostProcess } from \"core/PostProcesses/thinDepthOfFieldBlurPostProcess\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class FrameGraphDepthOfFieldBlurTask extends FrameGraphBlurTask {\r\n public circleOfConfusionTexture: FrameGraphTextureHandle;\r\n\r\n public circleOfConfusionSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinDepthOfFieldBlurPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinDepthOfFieldBlurPostProcess(name, frameGraph.engine, new Vector2(1, 0), 10));\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined || this.circleOfConfusionTexture === undefined) {\r\n throw new Error(`FrameGraphDepthOfFieldBlurTask \"${this.name}\": sourceTexture and circleOfConfusionTexture are required`);\r\n }\r\n\r\n const pass = super.record(\r\n skipCreationOfDisabledPasses,\r\n (context) => {\r\n context.setTextureSamplingMode(this.circleOfConfusionTexture, this.circleOfConfusionSamplingMode);\r\n },\r\n (context) => {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"circleOfConfusionSampler\", this.circleOfConfusionTexture);\r\n }\r\n );\r\n\r\n pass.addDependencies(this.circleOfConfusionTexture);\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"depthOfFieldBlurTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,sCAA+B;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,+BAA+B,EAAE,kEAA2D;AACrG,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAEjD;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,kBAAkB;IAKlE,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAiD;QAC/F,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,+BAA+B,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAH7H,kCAA6B,GAAG,SAAS,CAAC,6BAA6B,CAAC;IAI/E,CAAC;IAEe,YAAY;QACxB,OAAO,gCAAgC,CAAC;IAC5C,CAAC;IAEe,MAAM,CAAC,4BAA4B,GAAG,KAAK;QACvD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,wBAAwB,KAAK,SAAS,EAAE,CAAC;YAClF,MAAM,IAAI,KAAK,CAAC,mCAAmC,IAAI,CAAC,IAAI,4DAA4D,CAAC,CAAC;QAC9H,CAAC;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CACrB,4BAA4B,EAC5B,CAAC,OAAO,EAAE,EAAE;YACR,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC;QACtG,CAAC,EACD,CAAC,OAAO,EAAE,EAAE;YACR,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,0BAA0B,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC/H,CAAC,CACJ,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAEpD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphBlurTask } from \"./blurTask\";\r\nimport { ThinDepthOfFieldBlurPostProcess } from \"core/PostProcesses/thinDepthOfFieldBlurPostProcess\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class FrameGraphDepthOfFieldBlurTask extends FrameGraphBlurTask {\r\n public circleOfConfusionTexture: FrameGraphTextureHandle;\r\n\r\n public circleOfConfusionSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinDepthOfFieldBlurPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinDepthOfFieldBlurPostProcess(name, frameGraph.engine, new Vector2(1, 0), 10));\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphDepthOfFieldBlurTask\";\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined || this.circleOfConfusionTexture === undefined) {\r\n throw new Error(`FrameGraphDepthOfFieldBlurTask \"${this.name}\": sourceTexture and circleOfConfusionTexture are required`);\r\n }\r\n\r\n const pass = super.record(\r\n skipCreationOfDisabledPasses,\r\n (context) => {\r\n context.setTextureSamplingMode(this.circleOfConfusionTexture, this.circleOfConfusionSamplingMode);\r\n },\r\n (context) => {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"circleOfConfusionSampler\", this.circleOfConfusionTexture);\r\n }\r\n );\r\n\r\n pass.addDependencies(this.circleOfConfusionTexture);\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
@@ -8,5 +8,6 @@ export declare class FrameGraphDepthOfFieldMergeTask extends FrameGraphPostProce
|
|
|
8
8
|
circleOfConfusionTexture: FrameGraphTextureHandle;
|
|
9
9
|
blurSteps: FrameGraphTextureHandle[];
|
|
10
10
|
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinDepthOfFieldMergePostProcess);
|
|
11
|
+
getClassName(): string;
|
|
11
12
|
record(skipCreationOfDisabledPasses?: boolean): FrameGraphRenderPass;
|
|
12
13
|
}
|
|
@@ -9,6 +9,9 @@ export class FrameGraphDepthOfFieldMergeTask extends FrameGraphPostProcessTask {
|
|
|
9
9
|
super(name, frameGraph, thinPostProcess || new ThinDepthOfFieldMergePostProcess(name, frameGraph.engine));
|
|
10
10
|
this.blurSteps = [];
|
|
11
11
|
}
|
|
12
|
+
getClassName() {
|
|
13
|
+
return "FrameGraphDepthOfFieldMergeTask";
|
|
14
|
+
}
|
|
12
15
|
record(skipCreationOfDisabledPasses = false) {
|
|
13
16
|
if (this.sourceTexture === undefined || this.circleOfConfusionTexture === undefined || this.blurSteps.length === 0) {
|
|
14
17
|
throw new Error(`FrameGraphBloomMergeTask "${this.name}": sourceTexture, circleOfConfusionTexture and blurSteps are required`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depthOfFieldMergeTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,mEAA4D;AACvG,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,yBAAyB;IAK1E,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAkD;QAChG,KAA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AC,SAAS,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;YAC1H,CAAC;QACL,CAAC,CACJ,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACpD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAErC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from \"core/index\";\r\nimport { ThinDepthOfFieldMergePostProcess } from \"core/PostProcesses/thinDepthOfFieldMergePostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { Constants } from \"../../../Engines/constants\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class FrameGraphDepthOfFieldMergeTask extends FrameGraphPostProcessTask {\r\n public circleOfConfusionTexture: FrameGraphTextureHandle;\r\n\r\n public blurSteps: FrameGraphTextureHandle[] = [];\r\n\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinDepthOfFieldMergePostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinDepthOfFieldMergePostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined || this.circleOfConfusionTexture === undefined || this.blurSteps.length === 0) {\r\n throw new Error(`FrameGraphBloomMergeTask \"${this.name}\": sourceTexture, circleOfConfusionTexture and blurSteps are required`);\r\n }\r\n\r\n this.postProcess.updateEffect(\"#define BLUR_LEVEL \" + (this.blurSteps.length - 1) + \"\\n\");\r\n\r\n const pass = super.record(\r\n skipCreationOfDisabledPasses,\r\n (context) => {\r\n context.setTextureSamplingMode(this.blurSteps[this.blurSteps.length - 1], Constants.TEXTURE_BILINEAR_SAMPLINGMODE);\r\n },\r\n (context) => {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"circleOfConfusionSampler\", this.circleOfConfusionTexture);\r\n for (let i = 0; i < this.blurSteps.length; i++) {\r\n const handle = this.blurSteps[i];\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"blurStep\" + (this.blurSteps.length - i - 1), handle);\r\n }\r\n }\r\n );\r\n\r\n pass.addDependencies(this.circleOfConfusionTexture);\r\n pass.addDependencies(this.blurSteps);\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"depthOfFieldMergeTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,mEAA4D;AACvG,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,yBAAyB;IAK1E,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAkD;QAChG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,gCAAgC,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAHvG,cAAS,GAA8B,EAAE,CAAC;IAIjD,CAAC;IAEe,YAAY;QACxB,OAAO,iCAAiC,CAAC;IAC7C,CAAC;IAEe,MAAM,CAAC,4BAA4B,GAAG,KAAK;QACvD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,wBAAwB,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjH,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,CAAC,IAAI,uEAAuE,CAAC,CAAC;QACnI,CAAC;QAED,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,qBAAqB,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;QAE1F,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CACrB,4BAA4B,EAC5B,CAAC,OAAO,EAAE,EAAE;YACR,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,6BAA6B,CAAC,CAAC;QACvH,CAAC,EACD,CAAC,OAAO,EAAE,EAAE;YACR,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,0BAA0B,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC;YAC3H,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;gBACjC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,UAAU,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;YAC1H,CAAC;QACL,CAAC,CACJ,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACpD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAErC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from \"core/index\";\r\nimport { ThinDepthOfFieldMergePostProcess } from \"core/PostProcesses/thinDepthOfFieldMergePostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { Constants } from \"../../../Engines/constants\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class FrameGraphDepthOfFieldMergeTask extends FrameGraphPostProcessTask {\r\n public circleOfConfusionTexture: FrameGraphTextureHandle;\r\n\r\n public blurSteps: FrameGraphTextureHandle[] = [];\r\n\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinDepthOfFieldMergePostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinDepthOfFieldMergePostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphDepthOfFieldMergeTask\";\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined || this.circleOfConfusionTexture === undefined || this.blurSteps.length === 0) {\r\n throw new Error(`FrameGraphBloomMergeTask \"${this.name}\": sourceTexture, circleOfConfusionTexture and blurSteps are required`);\r\n }\r\n\r\n this.postProcess.updateEffect(\"#define BLUR_LEVEL \" + (this.blurSteps.length - 1) + \"\\n\");\r\n\r\n const pass = super.record(\r\n skipCreationOfDisabledPasses,\r\n (context) => {\r\n context.setTextureSamplingMode(this.blurSteps[this.blurSteps.length - 1], Constants.TEXTURE_BILINEAR_SAMPLINGMODE);\r\n },\r\n (context) => {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"circleOfConfusionSampler\", this.circleOfConfusionTexture);\r\n for (let i = 0; i < this.blurSteps.length; i++) {\r\n const handle = this.blurSteps[i];\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"blurStep\" + (this.blurSteps.length - i - 1), handle);\r\n }\r\n }\r\n );\r\n\r\n pass.addDependencies(this.circleOfConfusionTexture);\r\n pass.addDependencies(this.blurSteps);\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
@@ -64,6 +64,7 @@ export declare class FrameGraphDepthOfFieldTask extends FrameGraphTask {
|
|
|
64
64
|
*/
|
|
65
65
|
constructor(name: string, frameGraph: FrameGraph, blurLevel?: ThinDepthOfFieldEffectBlurLevel, hdr?: boolean);
|
|
66
66
|
isReady(): boolean;
|
|
67
|
+
getClassName(): string;
|
|
67
68
|
record(): void;
|
|
68
69
|
dispose(): void;
|
|
69
70
|
}
|
|
@@ -73,6 +73,9 @@ export class FrameGraphDepthOfFieldTask extends FrameGraphTask {
|
|
|
73
73
|
isReady() {
|
|
74
74
|
return this.depthOfField.isReady();
|
|
75
75
|
}
|
|
76
|
+
getClassName() {
|
|
77
|
+
return "FrameGraphDepthOfFieldTask";
|
|
78
|
+
}
|
|
76
79
|
record() {
|
|
77
80
|
if (this.sourceTexture === undefined || this.depthTexture === undefined || this.camera === undefined) {
|
|
78
81
|
throw new Error("FrameGraphDepthOfFieldTask: sourceTexture, depthTexture and camera are required");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depthOfFieldTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,sCAA+B;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,yDAAkD;AAEnF;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,cAAc;IAgD1D;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAoB,IAAI,CAAC,IAAY;QACjC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC1B,IAAI,CAAC,kBAAkB,CAAC,IAAI,GAAG,GAAG,IAAI,sBAAsB,CAAC;QACjE,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,KAAK,IA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CAAC;QACtB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphTextureCreationOptions, FrameGraphTextureHandle, AbstractEngine, Camera } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\nimport { ThinDepthOfFieldEffectBlurLevel } from \"core/PostProcesses/thinDepthOfFieldEffect\";\r\nimport { FrameGraphDepthOfFieldMergeTask } from \"./depthOfFieldMergeTask\";\r\nimport { FrameGraphCircleOfConfusionTask } from \"./circleOfConfusionTask\";\r\nimport { FrameGraphDepthOfFieldBlurTask } from \"./depthOfFieldBlurTask\";\r\nimport { ThinDepthOfFieldEffect } from \"core/PostProcesses/thinDepthOfFieldEffect\";\r\n\r\n/**\r\n * Task which applies a depth of field effect.\r\n */\r\nexport class FrameGraphDepthOfFieldTask extends FrameGraphTask {\r\n /**\r\n * The source texture to apply the depth of field effect on.\r\n */\r\n public sourceTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The sampling mode to use for the source texture.\r\n */\r\n public sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n /**\r\n * The depth texture to use for the depth of field effect.\r\n * Should store camera space depth (Z coordinate).\r\n */\r\n public depthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The sampling mode to use for the depth texture.\r\n */\r\n public depthSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n /**\r\n * The camera used to render the scene.\r\n */\r\n public camera: Camera;\r\n\r\n /**\r\n * The target texture to render the depth of field effect to.\r\n */\r\n public targetTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture of the depth of field effect.\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The depth of field effect.\r\n */\r\n public readonly depthOfField: ThinDepthOfFieldEffect;\r\n\r\n /**\r\n * Whether the depth of field effect is applied on HDR textures.\r\n * When true, the depth of field effect will use a higher precision texture format (half float or float). Else, it will use unsigned byte.\r\n */\r\n public readonly hdr: boolean;\r\n\r\n /**\r\n * The name of the task.\r\n */\r\n public override get name() {\r\n return this._name;\r\n }\r\n\r\n public override set name(name: string) {\r\n this._name = name;\r\n if (this._circleOfConfusion) {\r\n this._circleOfConfusion.name = `${name} Circle of Confusion`;\r\n }\r\n\r\n if (this._blurX) {\r\n for (let i = 0; i < this._blurX.length; i++) {\r\n this._blurX[i].name = `${name} Blur X${i}`;\r\n this._blurY[i].name = `${name} Blur Y${i}`;\r\n }\r\n }\r\n\r\n if (this._merge) {\r\n this._merge.name = `${name} Merge`;\r\n }\r\n }\r\n\r\n private readonly _engine: AbstractEngine;\r\n private readonly _circleOfConfusion: FrameGraphCircleOfConfusionTask;\r\n private readonly _blurX: FrameGraphDepthOfFieldBlurTask[] = [];\r\n private readonly _blurY: FrameGraphDepthOfFieldBlurTask[] = [];\r\n private readonly _merge: FrameGraphDepthOfFieldMergeTask;\r\n private readonly _defaultPipelineTextureType: number;\r\n\r\n /**\r\n * Constructs a depth of field task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task belongs to.\r\n * @param blurLevel The blur level of the depth of field effect (default: ThinDepthOfFieldEffectBlurLevel.Low).\r\n * @param hdr Whether the depth of field effect is HDR.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, blurLevel: ThinDepthOfFieldEffectBlurLevel = ThinDepthOfFieldEffectBlurLevel.Low, hdr = false) {\r\n super(name, frameGraph);\r\n\r\n this._engine = frameGraph.engine;\r\n this.hdr = hdr;\r\n\r\n this._defaultPipelineTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n if (hdr) {\r\n const caps = frameGraph.engine.getCaps();\r\n if (caps.textureHalfFloatRender) {\r\n this._defaultPipelineTextureType = Constants.TEXTURETYPE_HALF_FLOAT;\r\n } else if (caps.textureFloatRender) {\r\n this._defaultPipelineTextureType = Constants.TEXTURETYPE_FLOAT;\r\n }\r\n }\r\n\r\n this.depthOfField = new ThinDepthOfFieldEffect(name, frameGraph.engine, blurLevel, true);\r\n\r\n this._circleOfConfusion = new FrameGraphCircleOfConfusionTask(`${name} Circle of Confusion`, this._frameGraph, this.depthOfField._circleOfConfusion);\r\n\r\n const blurCount = this.depthOfField._depthOfFieldBlurX.length;\r\n\r\n for (let i = 0; i < blurCount; i++) {\r\n this._blurX.push(new FrameGraphDepthOfFieldBlurTask(`${name} Blur X${i}`, this._frameGraph, this.depthOfField._depthOfFieldBlurX[i][0]));\r\n this._blurY.push(new FrameGraphDepthOfFieldBlurTask(`${name} Blur Y${i}`, this._frameGraph, this.depthOfField._depthOfFieldBlurY[i][0]));\r\n }\r\n\r\n this._merge = new FrameGraphDepthOfFieldMergeTask(`${name} Merge`, this._frameGraph, this.depthOfField._dofMerge);\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public override isReady() {\r\n return this.depthOfField.isReady();\r\n }\r\n\r\n public record(): void {\r\n if (this.sourceTexture === undefined || this.depthTexture === undefined || this.camera === undefined) {\r\n throw new Error(\"FrameGraphDepthOfFieldTask: sourceTexture, depthTexture and camera are required\");\r\n }\r\n\r\n const sourceTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.sourceTexture);\r\n\r\n const textureSize = {\r\n width: sourceTextureDescription.size.width,\r\n height: sourceTextureDescription.size.height,\r\n };\r\n const circleOfConfusionTextureFormat = this._engine.isWebGPU || this._engine.version > 1 ? Constants.TEXTUREFORMAT_RED : Constants.TEXTUREFORMAT_RGBA;\r\n const textureCreationOptions: FrameGraphTextureCreationOptions = {\r\n size: textureSize,\r\n options: {\r\n createMipMaps: false,\r\n types: [this._defaultPipelineTextureType],\r\n formats: [circleOfConfusionTextureFormat],\r\n samples: 1,\r\n useSRGBBuffers: [false],\r\n labels: [\"\"],\r\n },\r\n sizeIsPercentage: false,\r\n };\r\n\r\n const circleOfConfusionTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._circleOfConfusion.name, textureCreationOptions);\r\n\r\n this._circleOfConfusion.sourceTexture = this.sourceTexture; // texture not used by the CoC shader\r\n this._circleOfConfusion.depthTexture = this.depthTexture;\r\n this._circleOfConfusion.depthSamplingMode = this.depthSamplingMode;\r\n this._circleOfConfusion.camera = this.camera;\r\n this._circleOfConfusion.targetTexture = circleOfConfusionTextureHandle;\r\n this._circleOfConfusion.record(true);\r\n\r\n textureCreationOptions.options.formats = [Constants.TEXTUREFORMAT_RGBA];\r\n\r\n const blurSteps: FrameGraphTextureHandle[] = [];\r\n\r\n for (let i = 0; i < this._blurX.length; i++) {\r\n const ratio = this.depthOfField._depthOfFieldBlurX[i][1];\r\n\r\n textureSize.width = Math.floor(sourceTextureDescription.size.width * ratio) || 1;\r\n textureSize.height = Math.floor(sourceTextureDescription.size.height * ratio) || 1;\r\n\r\n textureCreationOptions.options.labels![0] = \"step \" + (i + 1);\r\n\r\n const blurYTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurY[i].name, textureCreationOptions);\r\n\r\n this._blurY[i].sourceTexture = i === 0 ? this.sourceTexture : this._blurX[i - 1].outputTexture;\r\n this._blurY[i].sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurY[i].circleOfConfusionTexture = circleOfConfusionTextureHandle;\r\n this._blurY[i].targetTexture = blurYTextureHandle;\r\n this._blurY[i].record(true);\r\n\r\n const blurXTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurX[i].name, textureCreationOptions);\r\n\r\n this._blurX[i].sourceTexture = this._blurY[i].outputTexture;\r\n this._blurX[i].sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurX[i].circleOfConfusionTexture = circleOfConfusionTextureHandle;\r\n this._blurX[i].targetTexture = blurXTextureHandle;\r\n this._blurX[i].record(true);\r\n\r\n blurSteps.push(blurXTextureHandle);\r\n }\r\n\r\n const sourceTextureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture);\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture, this._merge.name, sourceTextureCreationOptions);\r\n\r\n this._merge.sourceTexture = this.sourceTexture;\r\n this._merge.sourceSamplingMode = this.sourceSamplingMode;\r\n this._merge.circleOfConfusionTexture = circleOfConfusionTextureHandle;\r\n this._merge.blurSteps = blurSteps;\r\n this._merge.targetTexture = this.outputTexture;\r\n this._merge.record(true);\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.addDependencies(this.sourceTexture);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setExecuteFunc((context) => {\r\n context.copyTexture(this.sourceTexture);\r\n });\r\n }\r\n\r\n public override dispose(): void {\r\n this._circleOfConfusion.dispose();\r\n for (let i = 0; i < this._blurX.length; i++) {\r\n this._blurX[i].dispose();\r\n this._blurY[i].dispose();\r\n }\r\n this._merge.dispose();\r\n super.dispose();\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"depthOfFieldTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,sCAA+B;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,yDAAkD;AAEnF;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,cAAc;IAgD1D;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAoB,IAAI,CAAC,IAAY;QACjC,IAA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EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC1C,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YACzB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAC7B,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphTextureCreationOptions, FrameGraphTextureHandle, AbstractEngine, Camera } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\nimport { ThinDepthOfFieldEffectBlurLevel } from \"core/PostProcesses/thinDepthOfFieldEffect\";\r\nimport { FrameGraphDepthOfFieldMergeTask } from \"./depthOfFieldMergeTask\";\r\nimport { FrameGraphCircleOfConfusionTask } from \"./circleOfConfusionTask\";\r\nimport { FrameGraphDepthOfFieldBlurTask } from \"./depthOfFieldBlurTask\";\r\nimport { ThinDepthOfFieldEffect } from \"core/PostProcesses/thinDepthOfFieldEffect\";\r\n\r\n/**\r\n * Task which applies a depth of field effect.\r\n */\r\nexport class FrameGraphDepthOfFieldTask extends FrameGraphTask {\r\n /**\r\n * The source texture to apply the depth of field effect on.\r\n */\r\n public sourceTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The sampling mode to use for the source texture.\r\n */\r\n public sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n /**\r\n * The depth texture to use for the depth of field effect.\r\n * Should store camera space depth (Z coordinate).\r\n */\r\n public depthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The sampling mode to use for the depth texture.\r\n */\r\n public depthSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n /**\r\n * The camera used to render the scene.\r\n */\r\n public camera: Camera;\r\n\r\n /**\r\n * The target texture to render the depth of field effect to.\r\n */\r\n public targetTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture of the depth of field effect.\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The depth of field effect.\r\n */\r\n public readonly depthOfField: ThinDepthOfFieldEffect;\r\n\r\n /**\r\n * Whether the depth of field effect is applied on HDR textures.\r\n * When true, the depth of field effect will use a higher precision texture format (half float or float). Else, it will use unsigned byte.\r\n */\r\n public readonly hdr: boolean;\r\n\r\n /**\r\n * The name of the task.\r\n */\r\n public override get name() {\r\n return this._name;\r\n }\r\n\r\n public override set name(name: string) {\r\n this._name = name;\r\n if (this._circleOfConfusion) {\r\n this._circleOfConfusion.name = `${name} Circle of Confusion`;\r\n }\r\n\r\n if (this._blurX) {\r\n for (let i = 0; i < this._blurX.length; i++) {\r\n this._blurX[i].name = `${name} Blur X${i}`;\r\n this._blurY[i].name = `${name} Blur Y${i}`;\r\n }\r\n }\r\n\r\n if (this._merge) {\r\n this._merge.name = `${name} Merge`;\r\n }\r\n }\r\n\r\n private readonly _engine: AbstractEngine;\r\n private readonly _circleOfConfusion: FrameGraphCircleOfConfusionTask;\r\n private readonly _blurX: FrameGraphDepthOfFieldBlurTask[] = [];\r\n private readonly _blurY: FrameGraphDepthOfFieldBlurTask[] = [];\r\n private readonly _merge: FrameGraphDepthOfFieldMergeTask;\r\n private readonly _defaultPipelineTextureType: number;\r\n\r\n /**\r\n * Constructs a depth of field task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task belongs to.\r\n * @param blurLevel The blur level of the depth of field effect (default: ThinDepthOfFieldEffectBlurLevel.Low).\r\n * @param hdr Whether the depth of field effect is HDR.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, blurLevel: ThinDepthOfFieldEffectBlurLevel = ThinDepthOfFieldEffectBlurLevel.Low, hdr = false) {\r\n super(name, frameGraph);\r\n\r\n this._engine = frameGraph.engine;\r\n this.hdr = hdr;\r\n\r\n this._defaultPipelineTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n if (hdr) {\r\n const caps = frameGraph.engine.getCaps();\r\n if (caps.textureHalfFloatRender) {\r\n this._defaultPipelineTextureType = Constants.TEXTURETYPE_HALF_FLOAT;\r\n } else if (caps.textureFloatRender) {\r\n this._defaultPipelineTextureType = Constants.TEXTURETYPE_FLOAT;\r\n }\r\n }\r\n\r\n this.depthOfField = new ThinDepthOfFieldEffect(name, frameGraph.engine, blurLevel, true);\r\n\r\n this._circleOfConfusion = new FrameGraphCircleOfConfusionTask(`${name} Circle of Confusion`, this._frameGraph, this.depthOfField._circleOfConfusion);\r\n\r\n const blurCount = this.depthOfField._depthOfFieldBlurX.length;\r\n\r\n for (let i = 0; i < blurCount; i++) {\r\n this._blurX.push(new FrameGraphDepthOfFieldBlurTask(`${name} Blur X${i}`, this._frameGraph, this.depthOfField._depthOfFieldBlurX[i][0]));\r\n this._blurY.push(new FrameGraphDepthOfFieldBlurTask(`${name} Blur Y${i}`, this._frameGraph, this.depthOfField._depthOfFieldBlurY[i][0]));\r\n }\r\n\r\n this._merge = new FrameGraphDepthOfFieldMergeTask(`${name} Merge`, this._frameGraph, this.depthOfField._dofMerge);\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public override isReady() {\r\n return this.depthOfField.isReady();\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphDepthOfFieldTask\";\r\n }\r\n\r\n public record(): void {\r\n if (this.sourceTexture === undefined || this.depthTexture === undefined || this.camera === undefined) {\r\n throw new Error(\"FrameGraphDepthOfFieldTask: sourceTexture, depthTexture and camera are required\");\r\n }\r\n\r\n const sourceTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.sourceTexture);\r\n\r\n const textureSize = {\r\n width: sourceTextureDescription.size.width,\r\n height: sourceTextureDescription.size.height,\r\n };\r\n const circleOfConfusionTextureFormat = this._engine.isWebGPU || this._engine.version > 1 ? Constants.TEXTUREFORMAT_RED : Constants.TEXTUREFORMAT_RGBA;\r\n const textureCreationOptions: FrameGraphTextureCreationOptions = {\r\n size: textureSize,\r\n options: {\r\n createMipMaps: false,\r\n types: [this._defaultPipelineTextureType],\r\n formats: [circleOfConfusionTextureFormat],\r\n samples: 1,\r\n useSRGBBuffers: [false],\r\n labels: [\"\"],\r\n },\r\n sizeIsPercentage: false,\r\n };\r\n\r\n const circleOfConfusionTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._circleOfConfusion.name, textureCreationOptions);\r\n\r\n this._circleOfConfusion.sourceTexture = this.sourceTexture; // texture not used by the CoC shader\r\n this._circleOfConfusion.depthTexture = this.depthTexture;\r\n this._circleOfConfusion.depthSamplingMode = this.depthSamplingMode;\r\n this._circleOfConfusion.camera = this.camera;\r\n this._circleOfConfusion.targetTexture = circleOfConfusionTextureHandle;\r\n this._circleOfConfusion.record(true);\r\n\r\n textureCreationOptions.options.formats = [Constants.TEXTUREFORMAT_RGBA];\r\n\r\n const blurSteps: FrameGraphTextureHandle[] = [];\r\n\r\n for (let i = 0; i < this._blurX.length; i++) {\r\n const ratio = this.depthOfField._depthOfFieldBlurX[i][1];\r\n\r\n textureSize.width = Math.floor(sourceTextureDescription.size.width * ratio) || 1;\r\n textureSize.height = Math.floor(sourceTextureDescription.size.height * ratio) || 1;\r\n\r\n textureCreationOptions.options.labels![0] = \"step \" + (i + 1);\r\n\r\n const blurYTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurY[i].name, textureCreationOptions);\r\n\r\n this._blurY[i].sourceTexture = i === 0 ? this.sourceTexture : this._blurX[i - 1].outputTexture;\r\n this._blurY[i].sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurY[i].circleOfConfusionTexture = circleOfConfusionTextureHandle;\r\n this._blurY[i].targetTexture = blurYTextureHandle;\r\n this._blurY[i].record(true);\r\n\r\n const blurXTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurX[i].name, textureCreationOptions);\r\n\r\n this._blurX[i].sourceTexture = this._blurY[i].outputTexture;\r\n this._blurX[i].sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurX[i].circleOfConfusionTexture = circleOfConfusionTextureHandle;\r\n this._blurX[i].targetTexture = blurXTextureHandle;\r\n this._blurX[i].record(true);\r\n\r\n blurSteps.push(blurXTextureHandle);\r\n }\r\n\r\n const sourceTextureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture);\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture, this._merge.name, sourceTextureCreationOptions);\r\n\r\n this._merge.sourceTexture = this.sourceTexture;\r\n this._merge.sourceSamplingMode = this.sourceSamplingMode;\r\n this._merge.circleOfConfusionTexture = circleOfConfusionTextureHandle;\r\n this._merge.blurSteps = blurSteps;\r\n this._merge.targetTexture = this.outputTexture;\r\n this._merge.record(true);\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.addDependencies(this.sourceTexture);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setExecuteFunc((context) => {\r\n context.copyTexture(this.sourceTexture);\r\n });\r\n }\r\n\r\n public override dispose(): void {\r\n this._circleOfConfusion.dispose();\r\n for (let i = 0; i < this._blurX.length; i++) {\r\n this._blurX[i].dispose();\r\n this._blurY[i].dispose();\r\n }\r\n this._merge.dispose();\r\n super.dispose();\r\n }\r\n}\r\n"]}
|
|
@@ -13,4 +13,5 @@ export declare class FrameGraphExtractHighlightsTask extends FrameGraphPostProce
|
|
|
13
13
|
* @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.
|
|
14
14
|
*/
|
|
15
15
|
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinExtractHighlightsPostProcess);
|
|
16
|
+
getClassName(): string;
|
|
16
17
|
}
|
|
@@ -13,5 +13,8 @@ export class FrameGraphExtractHighlightsTask extends FrameGraphPostProcessTask {
|
|
|
13
13
|
constructor(name, frameGraph, thinPostProcess) {
|
|
14
14
|
super(name, frameGraph, thinPostProcess || new ThinExtractHighlightsPostProcess(name, frameGraph.engine));
|
|
15
15
|
}
|
|
16
|
+
getClassName() {
|
|
17
|
+
return "FrameGraphExtractHighlightsTask";
|
|
18
|
+
}
|
|
16
19
|
}
|
|
17
20
|
//# sourceMappingURL=extractHighlightsTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractHighlightsTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,mEAA4D;AACvG,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,yBAAyB;IAG1E;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAkD;QAChG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,gCAAgC,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9G,CAAC;CACJ","sourcesContent":["import type { FrameGraph } from \"core/index\";\r\nimport { ThinExtractHighlightsPostProcess } from \"core/PostProcesses/thinExtractHighlightsPostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\n\r\n/**\r\n * Task used to extract highlights from a scene.\r\n */\r\nexport class FrameGraphExtractHighlightsTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinExtractHighlightsPostProcess;\r\n\r\n /**\r\n * Constructs a new extract highlights task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinExtractHighlightsPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinExtractHighlightsPostProcess(name, frameGraph.engine));\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"extractHighlightsTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,mEAA4D;AACvG,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,yBAAyB;IAG1E;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAkD;QAChG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,gCAAgC,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9G,CAAC;IAEe,YAAY;QACxB,OAAO,iCAAiC,CAAC;IAC7C,CAAC;CACJ","sourcesContent":["import type { FrameGraph } from \"core/index\";\r\nimport { ThinExtractHighlightsPostProcess } from \"core/PostProcesses/thinExtractHighlightsPostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\n\r\n/**\r\n * Task used to extract highlights from a scene.\r\n */\r\nexport class FrameGraphExtractHighlightsTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinExtractHighlightsPostProcess;\r\n\r\n /**\r\n * Constructs a new extract highlights task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinExtractHighlightsPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinExtractHighlightsPostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphExtractHighlightsTask\";\r\n }\r\n}\r\n"]}
|
|
@@ -13,4 +13,5 @@ export declare class FrameGraphFilterTask extends FrameGraphPostProcessTask {
|
|
|
13
13
|
* @param thinPostProcess The thin post process to use for the filter effect. If not provided, a new one will be created.
|
|
14
14
|
*/
|
|
15
15
|
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinFilterPostProcess);
|
|
16
|
+
getClassName(): string;
|
|
16
17
|
}
|
|
@@ -13,5 +13,8 @@ export class FrameGraphFilterTask extends FrameGraphPostProcessTask {
|
|
|
13
13
|
constructor(name, frameGraph, thinPostProcess) {
|
|
14
14
|
super(name, frameGraph, thinPostProcess || new ThinFilterPostProcess(name, frameGraph.engine));
|
|
15
15
|
}
|
|
16
|
+
getClassName() {
|
|
17
|
+
return "FrameGraphFilterTask";
|
|
18
|
+
}
|
|
16
19
|
}
|
|
17
20
|
//# sourceMappingURL=filterTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/filterTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,wDAAiD;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,yBAAyB;IAG/D;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAuC;QACrF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACnG,CAAC;CACJ","sourcesContent":["import type { FrameGraph } from \"core/FrameGraph/frameGraph\";\r\nimport { ThinFilterPostProcess } from \"core/PostProcesses/thinFilterPostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\n\r\n/**\r\n * Task which applies a kernel filter post process.\r\n */\r\nexport class FrameGraphFilterTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinFilterPostProcess;\r\n\r\n /**\r\n * Constructs a new filter task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param thinPostProcess The thin post process to use for the filter effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinFilterPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinFilterPostProcess(name, frameGraph.engine));\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"filterTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/filterTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,wDAAiD;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,yBAAyB;IAG/D;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAuC;QACrF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACnG,CAAC;IAEe,YAAY;QACxB,OAAO,sBAAsB,CAAC;IAClC,CAAC;CACJ","sourcesContent":["import type { FrameGraph } from \"core/FrameGraph/frameGraph\";\r\nimport { ThinFilterPostProcess } from \"core/PostProcesses/thinFilterPostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\n\r\n/**\r\n * Task which applies a kernel filter post process.\r\n */\r\nexport class FrameGraphFilterTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinFilterPostProcess;\r\n\r\n /**\r\n * Constructs a new filter task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param thinPostProcess The thin post process to use for the filter effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinFilterPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinFilterPostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphFilterTask\";\r\n }\r\n}\r\n"]}
|
|
@@ -13,5 +13,6 @@ export declare class FrameGraphFXAATask extends FrameGraphPostProcessTask {
|
|
|
13
13
|
* @param thinPostProcess The thin post process to use for the FXAA effect. If not provided, a new one will be created.
|
|
14
14
|
*/
|
|
15
15
|
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinFXAAPostProcess);
|
|
16
|
+
getClassName(): string;
|
|
16
17
|
record(skipCreationOfDisabledPasses?: boolean, additionalExecute?: (context: FrameGraphRenderContext) => void, additionalBindings?: (context: FrameGraphRenderContext) => void): FrameGraphRenderPass;
|
|
17
18
|
}
|
|
@@ -13,6 +13,9 @@ export class FrameGraphFXAATask extends FrameGraphPostProcessTask {
|
|
|
13
13
|
constructor(name, frameGraph, thinPostProcess) {
|
|
14
14
|
super(name, frameGraph, thinPostProcess || new ThinFXAAPostProcess(name, frameGraph.engine));
|
|
15
15
|
}
|
|
16
|
+
getClassName() {
|
|
17
|
+
return "FrameGraphFXAATask";
|
|
18
|
+
}
|
|
16
19
|
record(skipCreationOfDisabledPasses = false, additionalExecute, additionalBindings) {
|
|
17
20
|
const pass = super.record(skipCreationOfDisabledPasses, additionalExecute, additionalBindings);
|
|
18
21
|
this.postProcess.texelSize.x = 1 / this._sourceWidth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fxaaTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/fxaaTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,sDAA+C;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,yBAAyB;IAG7D;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAqC;QACnF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACjG,CAAC;IAEe,MAAM,CAClB,4BAA4B,GAAG,KAAK,EACpC,iBAA8D,EAC9D,kBAA+D;QAE/D,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;QAE/F,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QACrD,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QAEtD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphRenderContext, FrameGraphRenderPass } from \"core/index\";\r\nimport { ThinFXAAPostProcess } from \"core/PostProcesses/thinFXAAPostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\n\r\n/**\r\n * Task which applies a FXAA post process.\r\n */\r\nexport class FrameGraphFXAATask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinFXAAPostProcess;\r\n\r\n /**\r\n * Constructs a new FXAA task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param thinPostProcess The thin post process to use for the FXAA effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinFXAAPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinFXAAPostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override record(\r\n skipCreationOfDisabledPasses = false,\r\n additionalExecute?: (context: FrameGraphRenderContext) => void,\r\n additionalBindings?: (context: FrameGraphRenderContext) => void\r\n ): FrameGraphRenderPass {\r\n const pass = super.record(skipCreationOfDisabledPasses, additionalExecute, additionalBindings);\r\n\r\n this.postProcess.texelSize.x = 1 / this._sourceWidth;\r\n this.postProcess.texelSize.y = 1 / this._sourceHeight;\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"fxaaTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/fxaaTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,sDAA+C;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,yBAAyB;IAG7D;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAqC;QACnF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACjG,CAAC;IAEe,YAAY;QACxB,OAAO,oBAAoB,CAAC;IAChC,CAAC;IAEe,MAAM,CAClB,4BAA4B,GAAG,KAAK,EACpC,iBAA8D,EAC9D,kBAA+D;QAE/D,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;QAE/F,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;QACrD,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QAEtD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphRenderContext, FrameGraphRenderPass } from \"core/index\";\r\nimport { ThinFXAAPostProcess } from \"core/PostProcesses/thinFXAAPostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\n\r\n/**\r\n * Task which applies a FXAA post process.\r\n */\r\nexport class FrameGraphFXAATask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinFXAAPostProcess;\r\n\r\n /**\r\n * Constructs a new FXAA task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param thinPostProcess The thin post process to use for the FXAA effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinFXAAPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinFXAAPostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphFXAATask\";\r\n }\r\n\r\n public override record(\r\n skipCreationOfDisabledPasses = false,\r\n additionalExecute?: (context: FrameGraphRenderContext) => void,\r\n additionalBindings?: (context: FrameGraphRenderContext) => void\r\n ): FrameGraphRenderPass {\r\n const pass = super.record(skipCreationOfDisabledPasses, additionalExecute, additionalBindings);\r\n\r\n this.postProcess.texelSize.x = 1 / this._sourceWidth;\r\n this.postProcess.texelSize.y = 1 / this._sourceHeight;\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
@@ -13,4 +13,5 @@ export declare class FrameGraphGrainTask extends FrameGraphPostProcessTask {
|
|
|
13
13
|
* @param thinPostProcess The thin post process to use for the grain effect. If not provided, a new one will be created.
|
|
14
14
|
*/
|
|
15
15
|
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinGrainPostProcess);
|
|
16
|
+
getClassName(): string;
|
|
16
17
|
}
|
|
@@ -13,5 +13,8 @@ export class FrameGraphGrainTask extends FrameGraphPostProcessTask {
|
|
|
13
13
|
constructor(name, frameGraph, thinPostProcess) {
|
|
14
14
|
super(name, frameGraph, thinPostProcess || new ThinGrainPostProcess(name, frameGraph.engine));
|
|
15
15
|
}
|
|
16
|
+
getClassName() {
|
|
17
|
+
return "FrameGraphGrainTask";
|
|
18
|
+
}
|
|
16
19
|
}
|
|
17
20
|
//# sourceMappingURL=grainTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grainTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/grainTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,uDAAgD;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,yBAAyB;IAG9D;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAsC;QACpF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,oBAAoB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAClG,CAAC;CACJ","sourcesContent":["import type { FrameGraph } from \"core/FrameGraph/frameGraph\";\r\nimport { ThinGrainPostProcess } from \"core/PostProcesses/thinGrainPostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\n\r\n/**\r\n * Task which applies a grain post process.\r\n */\r\nexport class FrameGraphGrainTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinGrainPostProcess;\r\n\r\n /**\r\n * Constructs a new grain task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param thinPostProcess The thin post process to use for the grain effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinGrainPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinGrainPostProcess(name, frameGraph.engine));\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"grainTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/grainTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,uDAAgD;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,yBAAyB;IAG9D;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAsC;QACpF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,oBAAoB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAClG,CAAC;IAEe,YAAY;QACxB,OAAO,qBAAqB,CAAC;IACjC,CAAC;CACJ","sourcesContent":["import type { FrameGraph } from \"core/FrameGraph/frameGraph\";\r\nimport { ThinGrainPostProcess } from \"core/PostProcesses/thinGrainPostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\n\r\n/**\r\n * Task which applies a grain post process.\r\n */\r\nexport class FrameGraphGrainTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinGrainPostProcess;\r\n\r\n /**\r\n * Constructs a new grain task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param thinPostProcess The thin post process to use for the grain effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinGrainPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinGrainPostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphGrainTask\";\r\n }\r\n}\r\n"]}
|
|
@@ -13,5 +13,6 @@ export declare class FrameGraphImageProcessingTask extends FrameGraphPostProcess
|
|
|
13
13
|
* @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.
|
|
14
14
|
*/
|
|
15
15
|
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinImageProcessingPostProcess);
|
|
16
|
+
getClassName(): string;
|
|
16
17
|
record(skipCreationOfDisabledPasses?: boolean, additionalExecute?: (context: FrameGraphRenderContext) => void, additionalBindings?: (context: FrameGraphRenderContext) => void): FrameGraphRenderPass;
|
|
17
18
|
}
|
|
@@ -13,6 +13,9 @@ export class FrameGraphImageProcessingTask extends FrameGraphPostProcessTask {
|
|
|
13
13
|
constructor(name, frameGraph, thinPostProcess) {
|
|
14
14
|
super(name, frameGraph, thinPostProcess || new ThinImageProcessingPostProcess(name, frameGraph.engine));
|
|
15
15
|
}
|
|
16
|
+
getClassName() {
|
|
17
|
+
return "FrameGraphImageProcessingTask";
|
|
18
|
+
}
|
|
16
19
|
record(skipCreationOfDisabledPasses = false, additionalExecute, additionalBindings) {
|
|
17
20
|
const pass = super.record(skipCreationOfDisabledPasses, additionalExecute, additionalBindings);
|
|
18
21
|
this.postProcess.outputTextureWidth = this._outputWidth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageProcessingTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/imageProcessingTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,8BAA8B,EAAE,iEAA0D;AAEnG;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,yBAAyB;IAGxE;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAgD;QAC9F,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,8BAA8B,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5G,CAAC;IAEe,MAAM,CAClB,4BAA4B,GAAG,KAAK,EACpC,iBAA8D,EAC9D,kBAA+D;QAE/D,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;QAE/F,IAAI,CAAC,WAAW,CAAC,kBAAkB,GAAG,IAAI,CAAC,YAAY,CAAC;QACxD,IAAI,CAAC,WAAW,CAAC,mBAAmB,GAAG,IAAI,CAAC,aAAa,CAAC;QAE1D,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphRenderPass, FrameGraphRenderContext } from \"core/index\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { ThinImageProcessingPostProcess } from \"core/PostProcesses/thinImageProcessingPostProcess\";\r\n\r\n/**\r\n * Task which applies an image processing post process.\r\n */\r\nexport class FrameGraphImageProcessingTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinImageProcessingPostProcess;\r\n\r\n /**\r\n * Constructs a new image processing task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task belongs to.\r\n * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinImageProcessingPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinImageProcessingPostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override record(\r\n skipCreationOfDisabledPasses = false,\r\n additionalExecute?: (context: FrameGraphRenderContext) => void,\r\n additionalBindings?: (context: FrameGraphRenderContext) => void\r\n ): FrameGraphRenderPass {\r\n const pass = super.record(skipCreationOfDisabledPasses, additionalExecute, additionalBindings);\r\n\r\n this.postProcess.outputTextureWidth = this._outputWidth;\r\n this.postProcess.outputTextureHeight = this._outputHeight;\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"imageProcessingTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/imageProcessingTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,8BAA8B,EAAE,iEAA0D;AAEnG;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,yBAAyB;IAGxE;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAgD;QAC9F,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,8BAA8B,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5G,CAAC;IAEe,YAAY;QACxB,OAAO,+BAA+B,CAAC;IAC3C,CAAC;IAEe,MAAM,CAClB,4BAA4B,GAAG,KAAK,EACpC,iBAA8D,EAC9D,kBAA+D;QAE/D,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;QAE/F,IAAI,CAAC,WAAW,CAAC,kBAAkB,GAAG,IAAI,CAAC,YAAY,CAAC;QACxD,IAAI,CAAC,WAAW,CAAC,mBAAmB,GAAG,IAAI,CAAC,aAAa,CAAC;QAE1D,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphRenderPass, FrameGraphRenderContext } from \"core/index\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { ThinImageProcessingPostProcess } from \"core/PostProcesses/thinImageProcessingPostProcess\";\r\n\r\n/**\r\n * Task which applies an image processing post process.\r\n */\r\nexport class FrameGraphImageProcessingTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinImageProcessingPostProcess;\r\n\r\n /**\r\n * Constructs a new image processing task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task belongs to.\r\n * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinImageProcessingPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinImageProcessingPostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphImageProcessingTask\";\r\n }\r\n\r\n public override record(\r\n skipCreationOfDisabledPasses = false,\r\n additionalExecute?: (context: FrameGraphRenderContext) => void,\r\n additionalBindings?: (context: FrameGraphRenderContext) => void\r\n ): FrameGraphRenderPass {\r\n const pass = super.record(skipCreationOfDisabledPasses, additionalExecute, additionalBindings);\r\n\r\n this.postProcess.outputTextureWidth = this._outputWidth;\r\n this.postProcess.outputTextureHeight = this._outputHeight;\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
@@ -23,5 +23,6 @@ export declare class FrameGraphMotionBlurTask extends FrameGraphPostProcessTask
|
|
|
23
23
|
* @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.
|
|
24
24
|
*/
|
|
25
25
|
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinMotionBlurPostProcess);
|
|
26
|
+
getClassName(): string;
|
|
26
27
|
record(skipCreationOfDisabledPasses?: boolean): FrameGraphRenderPass;
|
|
27
28
|
}
|
|
@@ -13,6 +13,9 @@ export class FrameGraphMotionBlurTask extends FrameGraphPostProcessTask {
|
|
|
13
13
|
constructor(name, frameGraph, thinPostProcess) {
|
|
14
14
|
super(name, frameGraph, thinPostProcess || new ThinMotionBlurPostProcess(name, frameGraph.scene));
|
|
15
15
|
}
|
|
16
|
+
getClassName() {
|
|
17
|
+
return "FrameGraphMotionBlurTask";
|
|
18
|
+
}
|
|
16
19
|
record(skipCreationOfDisabledPasses = false) {
|
|
17
20
|
if (this.sourceTexture === undefined) {
|
|
18
21
|
throw new Error(`FrameGraphMotionBlurTask "${this.name}": sourceTexture is required`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motionBlurTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/motionBlurTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,4DAAqD;AAEzF;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,yBAAyB;IAenE;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAA2C;QACzF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,yBAAyB,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACtG,CAAC;IAEe,MAAM,CAAC,4BAA4B,GAAG,KAAK;QACv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, FrameGraphRenderPass } from \"core/index\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { ThinMotionBlurPostProcess } from \"core/PostProcesses/thinMotionBlurPostProcess\";\r\n\r\n/**\r\n * Task which applies a motion blur post process.\r\n */\r\nexport class FrameGraphMotionBlurTask extends FrameGraphPostProcessTask {\r\n /**\r\n * The velocity texture to use for the motion blur effect.\r\n * Needed for object-based motion blur.\r\n */\r\n public velocityTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The (view) depth texture to use for the motion blur effect.\r\n * Needed for screen-based motion blur.\r\n */\r\n public depthTexture?: FrameGraphTextureHandle;\r\n\r\n public override readonly postProcess: ThinMotionBlurPostProcess;\r\n\r\n /**\r\n * Constructs a new motion blur task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task belongs to.\r\n * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinMotionBlurPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinMotionBlurPostProcess(name, frameGraph.scene));\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined) {\r\n throw new Error(`FrameGraphMotionBlurTask \"${this.name}\": sourceTexture is required`);\r\n }\r\n\r\n const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {\r\n if (this.velocityTexture) {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"velocitySampler\", this.velocityTexture);\r\n } else if (this.postProcess.isObjectBased) {\r\n throw new Error(`FrameGraphMotionBlurTask \"${this.name}\": velocityTexture is required for object-based motion blur`);\r\n }\r\n\r\n if (this.depthTexture) {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"depthSampler\", this.depthTexture);\r\n } else if (!this.postProcess.isObjectBased) {\r\n throw new Error(`FrameGraphMotionBlurTask \"${this.name}\": depthTexture is required for screen-based motion blur`);\r\n }\r\n });\r\n\r\n pass.addDependencies(this.velocityTexture);\r\n pass.addDependencies(this.depthTexture);\r\n\r\n this.postProcess.textureWidth = this._sourceWidth;\r\n this.postProcess.textureHeight = this._sourceHeight;\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"motionBlurTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/motionBlurTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,4DAAqD;AAEzF;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,yBAAyB;IAenE;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAA2C;QACzF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,yBAAyB,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACtG,CAAC;IAEe,YAAY;QACxB,OAAO,0BAA0B,CAAC;IACtC,CAAC;IAEe,MAAM,CAAC,4BAA4B,GAAG,KAAK;QACvD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,CAAC,IAAI,8BAA8B,CAAC,CAAC;QAC1F,CAAC;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;YAC3E,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;gBACvB,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,iBAAiB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;YAC7G,CAAC;iBAAM,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;gBACxC,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,CAAC,IAAI,6DAA6D,CAAC,CAAC;YACzH,CAAC;YAED,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gBACpB,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;YACvG,CAAC;iBAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;gBACzC,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,CAAC,IAAI,0DAA0D,CAAC,CAAC;YACtH,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAExC,IAAI,CAAC,WAAW,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QAClD,IAAI,CAAC,WAAW,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QAEpD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from \"core/index\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { ThinMotionBlurPostProcess } from \"core/PostProcesses/thinMotionBlurPostProcess\";\r\n\r\n/**\r\n * Task which applies a motion blur post process.\r\n */\r\nexport class FrameGraphMotionBlurTask extends FrameGraphPostProcessTask {\r\n /**\r\n * The velocity texture to use for the motion blur effect.\r\n * Needed for object-based motion blur.\r\n */\r\n public velocityTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The (view) depth texture to use for the motion blur effect.\r\n * Needed for screen-based motion blur.\r\n */\r\n public depthTexture?: FrameGraphTextureHandle;\r\n\r\n public override readonly postProcess: ThinMotionBlurPostProcess;\r\n\r\n /**\r\n * Constructs a new motion blur task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task belongs to.\r\n * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinMotionBlurPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinMotionBlurPostProcess(name, frameGraph.scene));\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphMotionBlurTask\";\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined) {\r\n throw new Error(`FrameGraphMotionBlurTask \"${this.name}\": sourceTexture is required`);\r\n }\r\n\r\n const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {\r\n if (this.velocityTexture) {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"velocitySampler\", this.velocityTexture);\r\n } else if (this.postProcess.isObjectBased) {\r\n throw new Error(`FrameGraphMotionBlurTask \"${this.name}\": velocityTexture is required for object-based motion blur`);\r\n }\r\n\r\n if (this.depthTexture) {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"depthSampler\", this.depthTexture);\r\n } else if (!this.postProcess.isObjectBased) {\r\n throw new Error(`FrameGraphMotionBlurTask \"${this.name}\": depthTexture is required for screen-based motion blur`);\r\n }\r\n });\r\n\r\n pass.addDependencies(this.velocityTexture);\r\n pass.addDependencies(this.depthTexture);\r\n\r\n this.postProcess.textureWidth = this._sourceWidth;\r\n this.postProcess.textureHeight = this._sourceHeight;\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
@@ -13,6 +13,7 @@ export declare class FrameGraphPassTask extends FrameGraphPostProcessTask {
|
|
|
13
13
|
* @param thinPostProcess The thin post process to use for the pass effect. If not provided, a new one will be created.
|
|
14
14
|
*/
|
|
15
15
|
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinPassPostProcess);
|
|
16
|
+
getClassName(): string;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
19
|
* Task which applies a pass cube post process.
|
|
@@ -26,4 +27,5 @@ export declare class FrameGraphPassCubeTask extends FrameGraphPostProcessTask {
|
|
|
26
27
|
* @param thinPostProcess The thin post process to use for the pass cube effect. If not provided, a new one will be created.
|
|
27
28
|
*/
|
|
28
29
|
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinPassCubePostProcess);
|
|
30
|
+
getClassName(): string;
|
|
29
31
|
}
|
|
@@ -13,6 +13,9 @@ export class FrameGraphPassTask extends FrameGraphPostProcessTask {
|
|
|
13
13
|
constructor(name, frameGraph, thinPostProcess) {
|
|
14
14
|
super(name, frameGraph, thinPostProcess || new ThinPassPostProcess(name, frameGraph.engine));
|
|
15
15
|
}
|
|
16
|
+
getClassName() {
|
|
17
|
+
return "FrameGraphPassTask";
|
|
18
|
+
}
|
|
16
19
|
}
|
|
17
20
|
/**
|
|
18
21
|
* Task which applies a pass cube post process.
|
|
@@ -27,5 +30,8 @@ export class FrameGraphPassCubeTask extends FrameGraphPostProcessTask {
|
|
|
27
30
|
constructor(name, frameGraph, thinPostProcess) {
|
|
28
31
|
super(name, frameGraph, thinPostProcess || new ThinPassCubePostProcess(name, frameGraph.engine));
|
|
29
32
|
}
|
|
33
|
+
getClassName() {
|
|
34
|
+
return "FrameGraphPassCubeTask";
|
|
35
|
+
}
|
|
30
36
|
}
|
|
31
37
|
//# sourceMappingURL=passTask.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/passTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,sDAA+C;AAEtG;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,yBAAyB;IAG7D;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAqC;QACnF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACjG,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,yBAAyB;IAGjE;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAyC;QACvF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,uBAAuB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACrG,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph } from \"core/index\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { ThinPassCubePostProcess, ThinPassPostProcess } from \"core/PostProcesses/thinPassPostProcess\";\r\n\r\n/**\r\n * Task which applies a pass post process.\r\n */\r\nexport class FrameGraphPassTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinPassPostProcess;\r\n\r\n /**\r\n * Constructs a new pass task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param thinPostProcess The thin post process to use for the pass effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinPassPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinPassPostProcess(name, frameGraph.engine));\r\n }\r\n}\r\n\r\n/**\r\n * Task which applies a pass cube post process.\r\n */\r\nexport class FrameGraphPassCubeTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinPassCubePostProcess;\r\n\r\n /**\r\n * Constructs a new pass cube task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param thinPostProcess The thin post process to use for the pass cube effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinPassCubePostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinPassCubePostProcess(name, frameGraph.engine));\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"passTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/passTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,sDAA+C;AAEtG;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,yBAAyB;IAG7D;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAqC;QACnF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,mBAAmB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACjG,CAAC;IAEe,YAAY;QACxB,OAAO,oBAAoB,CAAC;IAChC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,yBAAyB;IAGjE;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAyC;QACvF,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,uBAAuB,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACrG,CAAC;IAEe,YAAY;QACxB,OAAO,wBAAwB,CAAC;IACpC,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph } from \"core/index\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { ThinPassCubePostProcess, ThinPassPostProcess } from \"core/PostProcesses/thinPassPostProcess\";\r\n\r\n/**\r\n * Task which applies a pass post process.\r\n */\r\nexport class FrameGraphPassTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinPassPostProcess;\r\n\r\n /**\r\n * Constructs a new pass task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param thinPostProcess The thin post process to use for the pass effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinPassPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinPassPostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphPassTask\";\r\n }\r\n}\r\n\r\n/**\r\n * Task which applies a pass cube post process.\r\n */\r\nexport class FrameGraphPassCubeTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinPassCubePostProcess;\r\n\r\n /**\r\n * Constructs a new pass cube task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param thinPostProcess The thin post process to use for the pass cube effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinPassCubePostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinPassCubePostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphPassCubeTask\";\r\n }\r\n}\r\n"]}
|
|
@@ -92,6 +92,7 @@ export declare class FrameGraphPostProcessTask extends FrameGraphTask {
|
|
|
92
92
|
*/
|
|
93
93
|
constructor(name: string, frameGraph: FrameGraph, postProcess: EffectWrapper);
|
|
94
94
|
isReady(): boolean;
|
|
95
|
+
getClassName(): string;
|
|
95
96
|
record(skipCreationOfDisabledPasses?: boolean, additionalExecute?: (context: FrameGraphRenderContext) => void, additionalBindings?: (context: FrameGraphRenderContext) => void): FrameGraphRenderPass;
|
|
96
97
|
dispose(): void;
|
|
97
98
|
}
|
|
@@ -57,6 +57,9 @@ export class FrameGraphPostProcessTask extends FrameGraphTask {
|
|
|
57
57
|
isReady() {
|
|
58
58
|
return this.postProcess.isReady();
|
|
59
59
|
}
|
|
60
|
+
getClassName() {
|
|
61
|
+
return "FrameGraphPostProcessTask";
|
|
62
|
+
}
|
|
60
63
|
record(skipCreationOfDisabledPasses = false, additionalExecute, additionalBindings) {
|
|
61
64
|
if (this.sourceTexture === undefined && this.targetTexture === undefined) {
|
|
62
65
|
throw new Error(`FrameGraphPostProcessTask "${this.name}": sourceTexture or targetTexture is required`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postProcessTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/postProcessTask.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAE,sCAA+B;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,cAAc;IAsFzD;;OAEG;IACH,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACxC,CAAC;IAQD;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,WAA0B;QACxE,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAlG5B;;WAEG;QACI,uBAAkB,GAAG,SAAS,CAAC,6BAA6B,CAAC;QAmBpE;;;;;WAKG;QACI,kBAAa,GAAG,KAAK,CAAC;QAE7B;;;;;WAKG;QACI,oBAAe,GAAG,KAAK,CAAC;QAE/B;;;WAGG;QACI,sBAAiB,GAAG,KAAK,CAAC;QAEjC;;WAEG;QACI,iBAAY,GAAG,KAAK,CAAC;QAE5B;;WAEG;QACI,cAAS,GAAG,IAAI,CAAC;QAgDpB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC;QAE5D,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,oBAAoB,EAAE,CAAC;QAC5E,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,oBAAoB,EAAE,CAAC;IAC/F,CAAC;IAEe,OAAO;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CA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phTextureHandle,\r\n DrawWrapper,\r\n FrameGraphRenderPass,\r\n FrameGraphRenderContext,\r\n EffectWrapper,\r\n IViewportLike,\r\n Nullable,\r\n IStencilStateProperties,\r\n} from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task which applies a post process.\r\n */\r\nexport class FrameGraphPostProcessTask extends FrameGraphTask {\r\n /**\r\n * The source texture to apply the post process on.\r\n * It's allowed to be undefined if the post process does not require a source texture.\r\n * In that case, targetTexture must be provided.\r\n */\r\n public sourceTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The sampling mode to use for the source texture.\r\n */\r\n public sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n /**\r\n * The target texture to render the post process to.\r\n * If not supplied, a texture with the same configuration as the source texture will be created.\r\n */\r\n public targetTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The stencil state to use for the post process (optional).\r\n */\r\n public stencilState?: IStencilStateProperties;\r\n\r\n /**\r\n * The depth attachment texture to use for the post process (optional).\r\n * Note that a post-process task never writes to the depth buffer: attaching a depth texture is only useful if you want to test against the depth/stencil aspect or write to the stencil buffer.\r\n */\r\n public depthAttachmentTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * If true, the depth attachment will be read-only.\r\n * This means that the post process will not write to the depth buffer.\r\n * Setting depthReadOnly and stencilReadOnly to true is useful when you want to also be able to bind this same depth/stencil attachment to a shader.\r\n * Note that it will only work in WebGPU, as WebGL does not support read-only depth/stencil attachments.\r\n */\r\n public depthReadOnly = false;\r\n\r\n /**\r\n * If true, the stencil attachment will be read-only.\r\n * This means that the post process will not write to the stencil buffer.\r\n * Setting depthReadOnly and stencilReadOnly to true is useful when you want to also be able to bind this same depth/stencil attachment to a shader.\r\n * Note that it will only work in WebGPU, as WebGL does not support read-only depth/stencil attachments.\r\n */\r\n public stencilReadOnly = false;\r\n\r\n /**\r\n * If true, color write will be disabled when applying the post process.\r\n * This means that the post process will not write to the color buffer.\r\n */\r\n public disableColorWrite = false;\r\n\r\n /**\r\n * If true, the post process will be generated by a back face full-screen quad (CW order).\r\n */\r\n public drawBackFace = false;\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 * The viewport to use when applying the post process.\r\n * If set to null, the currently active viewport is used.\r\n * If undefined (default), the viewport is reset to a full screen viewport before applying the post process.\r\n */\r\n public viewport?: Nullable<IViewportLike>;\r\n\r\n /**\r\n * The output texture of the post process.\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 depthAttachmentTexture property if it is set.\r\n * Note, however, that the handle itself will be different!\r\n */\r\n public readonly outputDepthAttachmentTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The post process to apply.\r\n */\r\n public readonly postProcess: EffectWrapper;\r\n\r\n /**\r\n * The draw wrapper used by the post process\r\n */\r\n public get drawWrapper() {\r\n return this._postProcessDrawWrapper;\r\n }\r\n\r\n protected readonly _postProcessDrawWrapper: DrawWrapper;\r\n protected _sourceWidth: number;\r\n protected _sourceHeight: number;\r\n protected _outputWidth: number;\r\n protected _outputHeight: number;\r\n\r\n /**\r\n * Constructs a new post process task.\r\n * @param name Name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param postProcess The post process to apply.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, postProcess: EffectWrapper) {\r\n super(name, frameGraph);\r\n\r\n this.postProcess = postProcess;\r\n this._postProcessDrawWrapper = this.postProcess.drawWrapper;\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.outputDepthAttachmentTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public override isReady() {\r\n return this.postProcess.isReady();\r\n }\r\n\r\n public record(\r\n skipCreationOfDisabledPasses = false,\r\n additionalExecute?: (context: FrameGraphRenderContext) => void,\r\n additionalBindings?: (context: FrameGraphRenderContext) => void\r\n ): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined && this.targetTexture === undefined) {\r\n throw new Error(`FrameGraphPostProcessTask \"${this.name}\": sourceTexture or targetTexture is required`);\r\n }\r\n\r\n const sourceTextureCreationOptions = this.sourceTexture !== undefined ? this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture) : undefined;\r\n if (sourceTextureCreationOptions) {\r\n sourceTextureCreationOptions.options.samples = 1;\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture, this.name, sourceTextureCreationOptions);\r\n if (this.depthAttachmentTexture !== undefined) {\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthAttachmentTexture, this.depthAttachmentTexture);\r\n }\r\n\r\n if (sourceTextureCreationOptions) {\r\n const sourceSize = this._frameGraph.textureManager.getTextureAbsoluteDimensions(sourceTextureCreationOptions);\r\n\r\n this._sourceWidth = sourceSize.width;\r\n this._sourceHeight = sourceSize.height;\r\n }\r\n\r\n const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.outputTexture);\r\n\r\n this._outputWidth = outputTextureDescription.size.width;\r\n this._outputHeight = outputTextureDescription.size.height;\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.depthReadOnly = this.depthReadOnly;\r\n pass.stencilReadOnly = this.stencilReadOnly;\r\n\r\n pass.addDependencies(this.sourceTexture);\r\n\r\n pass.setRenderTarget(this.outputTexture);\r\n pass.setRenderTargetDepth(this.depthAttachmentTexture);\r\n pass.setExecuteFunc((context) => {\r\n if (this.sourceTexture !== undefined) {\r\n context.setTextureSamplingMode(this.sourceTexture, this.sourceSamplingMode);\r\n }\r\n additionalExecute?.(context);\r\n if (this.viewport) {\r\n context.setViewport(this.viewport);\r\n }\r\n context.applyFullScreenEffect(\r\n this._postProcessDrawWrapper,\r\n () => {\r\n if (this.sourceTexture !== undefined) {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"textureSampler\", this.sourceTexture);\r\n }\r\n additionalBindings?.(context);\r\n this.postProcess.bind();\r\n },\r\n this.stencilState,\r\n this.disableColorWrite,\r\n this.drawBackFace,\r\n this.depthTest,\r\n this.viewport !== undefined\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.depthReadOnly = this.depthReadOnly;\r\n passDisabled.stencilReadOnly = this.stencilReadOnly;\r\n\r\n passDisabled.addDependencies(this.sourceTexture);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setRenderTargetDepth(this.depthAttachmentTexture);\r\n passDisabled.setExecuteFunc((context) => {\r\n if (this.sourceTexture !== undefined) {\r\n if (this.viewport) {\r\n context.setViewport(this.viewport);\r\n }\r\n context.copyTexture(this.sourceTexture, undefined, this.viewport !== undefined);\r\n }\r\n });\r\n }\r\n\r\n return pass;\r\n }\r\n\r\n public override dispose(): void {\r\n this.postProcess.dispose();\r\n super.dispose();\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"postProcessTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/postProcessTask.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAE,sCAA+B;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,cAAc;IAsFzD;;OAEG;IACH,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACxC,CAAC;IAQD;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,WAA0B;QACxE,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAlG5B;;WAEG;QACI,uBAAkB,GAAG,SAAS,CAAC,6BAA6B,CAAC;QAmBpE;;;;;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jD,YAAY,CAAC,oBAAoB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YAC/D,YAAY,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;gBACpC,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;oBACnC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;wBAChB,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBACvC,CAAC;oBACD,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;gBACpF,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAEe,OAAO;QACnB,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QAC3B,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ","sourcesContent":["import type {\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n DrawWrapper,\r\n FrameGraphRenderPass,\r\n FrameGraphRenderContext,\r\n EffectWrapper,\r\n IViewportLike,\r\n Nullable,\r\n IStencilStateProperties,\r\n} from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\n\r\n/**\r\n * Task which applies a post process.\r\n */\r\nexport class FrameGraphPostProcessTask extends FrameGraphTask {\r\n /**\r\n * The source texture to apply the post process on.\r\n * It's allowed to be undefined if the post process does not require a source texture.\r\n * In that case, targetTexture must be provided.\r\n */\r\n public sourceTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The sampling mode to use for the source texture.\r\n */\r\n public sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n /**\r\n * The target texture to render the post process to.\r\n * If not supplied, a texture with the same configuration as the source texture will be created.\r\n */\r\n public targetTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The stencil state to use for the post process (optional).\r\n */\r\n public stencilState?: IStencilStateProperties;\r\n\r\n /**\r\n * The depth attachment texture to use for the post process (optional).\r\n * Note that a post-process task never writes to the depth buffer: attaching a depth texture is only useful if you want to test against the depth/stencil aspect or write to the stencil buffer.\r\n */\r\n public depthAttachmentTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * If true, the depth attachment will be read-only.\r\n * This means that the post process will not write to the depth buffer.\r\n * Setting depthReadOnly and stencilReadOnly to true is useful when you want to also be able to bind this same depth/stencil attachment to a shader.\r\n * Note that it will only work in WebGPU, as WebGL does not support read-only depth/stencil attachments.\r\n */\r\n public depthReadOnly = false;\r\n\r\n /**\r\n * If true, the stencil attachment will be read-only.\r\n * This means that the post process will not write to the stencil buffer.\r\n * Setting depthReadOnly and stencilReadOnly to true is useful when you want to also be able to bind this same depth/stencil attachment to a shader.\r\n * Note that it will only work in WebGPU, as WebGL does not support read-only depth/stencil attachments.\r\n */\r\n public stencilReadOnly = false;\r\n\r\n /**\r\n * If true, color write will be disabled when applying the post process.\r\n * This means that the post process will not write to the color buffer.\r\n */\r\n public disableColorWrite = false;\r\n\r\n /**\r\n * If true, the post process will be generated by a back face full-screen quad (CW order).\r\n */\r\n public drawBackFace = false;\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 * The viewport to use when applying the post process.\r\n * If set to null, the currently active viewport is used.\r\n * If undefined (default), the viewport is reset to a full screen viewport before applying the post process.\r\n */\r\n public viewport?: Nullable<IViewportLike>;\r\n\r\n /**\r\n * The output texture of the post process.\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 depthAttachmentTexture property if it is set.\r\n * Note, however, that the handle itself will be different!\r\n */\r\n public readonly outputDepthAttachmentTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The post process to apply.\r\n */\r\n public readonly postProcess: EffectWrapper;\r\n\r\n /**\r\n * The draw wrapper used by the post process\r\n */\r\n public get drawWrapper() {\r\n return this._postProcessDrawWrapper;\r\n }\r\n\r\n protected readonly _postProcessDrawWrapper: DrawWrapper;\r\n protected _sourceWidth: number;\r\n protected _sourceHeight: number;\r\n protected _outputWidth: number;\r\n protected _outputHeight: number;\r\n\r\n /**\r\n * Constructs a new post process task.\r\n * @param name Name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param postProcess The post process to apply.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, postProcess: EffectWrapper) {\r\n super(name, frameGraph);\r\n\r\n this.postProcess = postProcess;\r\n this._postProcessDrawWrapper = this.postProcess.drawWrapper;\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.outputDepthAttachmentTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public override isReady() {\r\n return this.postProcess.isReady();\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphPostProcessTask\";\r\n }\r\n\r\n public record(\r\n skipCreationOfDisabledPasses = false,\r\n additionalExecute?: (context: FrameGraphRenderContext) => void,\r\n additionalBindings?: (context: FrameGraphRenderContext) => void\r\n ): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined && this.targetTexture === undefined) {\r\n throw new Error(`FrameGraphPostProcessTask \"${this.name}\": sourceTexture or targetTexture is required`);\r\n }\r\n\r\n const sourceTextureCreationOptions = this.sourceTexture !== undefined ? this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture) : undefined;\r\n if (sourceTextureCreationOptions) {\r\n sourceTextureCreationOptions.options.samples = 1;\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture, this.name, sourceTextureCreationOptions);\r\n if (this.depthAttachmentTexture !== undefined) {\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthAttachmentTexture, this.depthAttachmentTexture);\r\n }\r\n\r\n if (sourceTextureCreationOptions) {\r\n const sourceSize = this._frameGraph.textureManager.getTextureAbsoluteDimensions(sourceTextureCreationOptions);\r\n\r\n this._sourceWidth = sourceSize.width;\r\n this._sourceHeight = sourceSize.height;\r\n }\r\n\r\n const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.outputTexture);\r\n\r\n this._outputWidth = outputTextureDescription.size.width;\r\n this._outputHeight = outputTextureDescription.size.height;\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.depthReadOnly = this.depthReadOnly;\r\n pass.stencilReadOnly = this.stencilReadOnly;\r\n\r\n pass.addDependencies(this.sourceTexture);\r\n\r\n pass.setRenderTarget(this.outputTexture);\r\n pass.setRenderTargetDepth(this.depthAttachmentTexture);\r\n pass.setExecuteFunc((context) => {\r\n if (this.sourceTexture !== undefined) {\r\n context.setTextureSamplingMode(this.sourceTexture, this.sourceSamplingMode);\r\n }\r\n additionalExecute?.(context);\r\n if (this.viewport) {\r\n context.setViewport(this.viewport);\r\n }\r\n context.applyFullScreenEffect(\r\n this._postProcessDrawWrapper,\r\n () => {\r\n if (this.sourceTexture !== undefined) {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"textureSampler\", this.sourceTexture);\r\n }\r\n additionalBindings?.(context);\r\n this.postProcess.bind();\r\n },\r\n this.stencilState,\r\n this.disableColorWrite,\r\n this.drawBackFace,\r\n this.depthTest,\r\n this.viewport !== undefined\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.depthReadOnly = this.depthReadOnly;\r\n passDisabled.stencilReadOnly = this.stencilReadOnly;\r\n\r\n passDisabled.addDependencies(this.sourceTexture);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n passDisabled.setRenderTargetDepth(this.depthAttachmentTexture);\r\n passDisabled.setExecuteFunc((context) => {\r\n if (this.sourceTexture !== undefined) {\r\n if (this.viewport) {\r\n context.setViewport(this.viewport);\r\n }\r\n context.copyTexture(this.sourceTexture, undefined, this.viewport !== undefined);\r\n }\r\n });\r\n }\r\n\r\n return pass;\r\n }\r\n\r\n public override dispose(): void {\r\n this.postProcess.dispose();\r\n super.dispose();\r\n }\r\n}\r\n"]}
|
|
@@ -18,5 +18,6 @@ export declare class FrameGraphScreenSpaceCurvatureTask extends FrameGraphPostPr
|
|
|
18
18
|
* @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.
|
|
19
19
|
*/
|
|
20
20
|
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinScreenSpaceCurvaturePostProcess);
|
|
21
|
+
getClassName(): string;
|
|
21
22
|
record(skipCreationOfDisabledPasses?: boolean): FrameGraphRenderPass;
|
|
22
23
|
}
|
|
@@ -13,6 +13,9 @@ export class FrameGraphScreenSpaceCurvatureTask extends FrameGraphPostProcessTas
|
|
|
13
13
|
constructor(name, frameGraph, thinPostProcess) {
|
|
14
14
|
super(name, frameGraph, thinPostProcess || new ThinScreenSpaceCurvaturePostProcess(name, frameGraph.engine));
|
|
15
15
|
}
|
|
16
|
+
getClassName() {
|
|
17
|
+
return "FrameGraphScreenSpaceCurvatureTask";
|
|
18
|
+
}
|
|
16
19
|
record(skipCreationOfDisabledPasses = false) {
|
|
17
20
|
if (this.sourceTexture === undefined || this.normalTexture === undefined) {
|
|
18
21
|
throw new Error(`FrameGraphScreenSpaceCurvatureTask "${this.name}": sourceTexture and normalTexture are required`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenSpaceCurvatureTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,mCAAmC,EAAE,sEAA+D;AAE7G;;GAEG;AACH,MAAM,OAAO,kCAAmC,SAAQ,yBAAyB;IAS7E;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAqD;QACnG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,mCAAmC,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACjH,CAAC;IAEe,MAAM,CAAC,4BAA4B,GAAG,KAAK;QACvD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACvE,MAAM,IAAI,KAAK,CAAC,uCAAuC,IAAI,CAAC,IAAI,iDAAiD,CAAC,CAAC;QACvH,CAAC;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;YAC3E,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACzG,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEzC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from \"core/index\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { ThinScreenSpaceCurvaturePostProcess } from \"core/PostProcesses/thinScreenSpaceCurvaturePostProcess\";\r\n\r\n/**\r\n * Task which applies a screen space curvature post process.\r\n */\r\nexport class FrameGraphScreenSpaceCurvatureTask extends FrameGraphPostProcessTask {\r\n /**\r\n * The normal texture to use for the screen space curvature effect.\r\n * It must store normals in camera view space.\r\n */\r\n public normalTexture: FrameGraphTextureHandle;\r\n\r\n public override readonly postProcess: ThinScreenSpaceCurvaturePostProcess;\r\n\r\n /**\r\n * Constructs a new circle of confusion task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task belongs to.\r\n * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinScreenSpaceCurvaturePostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinScreenSpaceCurvaturePostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined || this.normalTexture === undefined) {\r\n throw new Error(`FrameGraphScreenSpaceCurvatureTask \"${this.name}\": sourceTexture and normalTexture are required`);\r\n }\r\n\r\n const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"normalSampler\", this.normalTexture);\r\n });\r\n\r\n pass.addDependencies(this.normalTexture);\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"screenSpaceCurvatureTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/screenSpaceCurvatureTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,mCAAmC,EAAE,sEAA+D;AAE7G;;GAEG;AACH,MAAM,OAAO,kCAAmC,SAAQ,yBAAyB;IAS7E;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAqD;QACnG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,mCAAmC,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IACjH,CAAC;IAEe,YAAY;QACxB,OAAO,oCAAoC,CAAC;IAChD,CAAC;IAEe,MAAM,CAAC,4BAA4B,GAAG,KAAK;QACvD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACvE,MAAM,IAAI,KAAK,CAAC,uCAAuC,IAAI,CAAC,IAAI,iDAAiD,CAAC,CAAC;QACvH,CAAC;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;YAC3E,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAO,EAAE,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACzG,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEzC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { FrameGraph, FrameGraphTextureHandle, FrameGraphRenderPass } from \"core/index\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\nimport { ThinScreenSpaceCurvaturePostProcess } from \"core/PostProcesses/thinScreenSpaceCurvaturePostProcess\";\r\n\r\n/**\r\n * Task which applies a screen space curvature post process.\r\n */\r\nexport class FrameGraphScreenSpaceCurvatureTask extends FrameGraphPostProcessTask {\r\n /**\r\n * The normal texture to use for the screen space curvature effect.\r\n * It must store normals in camera view space.\r\n */\r\n public normalTexture: FrameGraphTextureHandle;\r\n\r\n public override readonly postProcess: ThinScreenSpaceCurvaturePostProcess;\r\n\r\n /**\r\n * Constructs a new circle of confusion task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph this task belongs to.\r\n * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinScreenSpaceCurvaturePostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinScreenSpaceCurvaturePostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphScreenSpaceCurvatureTask\";\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined || this.normalTexture === undefined) {\r\n throw new Error(`FrameGraphScreenSpaceCurvatureTask \"${this.name}\": sourceTexture and normalTexture are required`);\r\n }\r\n\r\n const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"normalSampler\", this.normalTexture);\r\n });\r\n\r\n pass.addDependencies(this.normalTexture);\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
@@ -13,5 +13,6 @@ export declare class FrameGraphSharpenTask extends FrameGraphPostProcessTask {
|
|
|
13
13
|
* @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.
|
|
14
14
|
*/
|
|
15
15
|
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinSharpenPostProcess);
|
|
16
|
+
getClassName(): string;
|
|
16
17
|
record(skipCreationOfDisabledPasses?: boolean, additionalExecute?: (context: FrameGraphRenderContext) => void, additionalBindings?: (context: FrameGraphRenderContext) => void): FrameGraphRenderPass;
|
|
17
18
|
}
|