@babylonjs/core 7.52.3 → 7.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.d.ts +0 -3
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js +9 -6
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js +10 -5
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js +2 -2
- package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js +3 -3
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +7 -2
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.d.ts +3 -12
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js +16 -36
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +5 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +17 -4
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +3 -11
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +5 -14
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +1 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js +18 -17
- package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.d.ts +10 -1
- package/FlowGraph/flowGraphDataConnection.js +23 -13
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +5 -0
- package/FlowGraph/flowGraphRichTypes.js +12 -0
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.d.ts +30 -0
- package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js +48 -0
- package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +3 -3
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +6 -6
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.d.ts +38 -0
- package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js +88 -0
- package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +7 -7
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +7 -7
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +2 -0
- package/FrameGraph/Node/Blocks/index.js +2 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +2 -2
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +3 -3
- package/FrameGraph/Tasks/Layers/baseLayerTask.js +12 -12
- package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/anaglyphTask.d.ts +21 -0
- package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js +27 -0
- package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +5 -5
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.d.ts +17 -0
- package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js +23 -0
- package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +5 -5
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +8 -8
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +3 -3
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +9 -9
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +7 -7
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.d.ts +3 -3
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js +3 -3
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +3 -3
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +8 -8
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +3 -3
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +3 -3
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +2 -2
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +5 -5
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -1
- package/FrameGraph/index.d.ts +2 -0
- package/FrameGraph/index.js +2 -0
- package/FrameGraph/index.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +3 -0
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/materialDefines.js +1 -1
- package/Materials/materialDefines.js.map +1 -1
- package/Meshes/Builders/shapeBuilder.d.ts +6 -0
- package/Meshes/Builders/shapeBuilder.js +7 -4
- package/Meshes/Builders/shapeBuilder.js.map +1 -1
- package/PostProcesses/anaglyphPostProcess.d.ts +0 -1
- package/PostProcesses/anaglyphPostProcess.js +14 -11
- package/PostProcesses/anaglyphPostProcess.js.map +1 -1
- package/PostProcesses/chromaticAberrationPostProcess.d.ts +15 -8
- package/PostProcesses/chromaticAberrationPostProcess.js +72 -42
- package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/index.d.ts +2 -0
- package/PostProcesses/index.js +2 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +5 -0
- package/PostProcesses/postProcess.js +10 -2
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/thinAnaglyphPostProcess.d.ts +23 -0
- package/PostProcesses/thinAnaglyphPostProcess.js +42 -0
- package/PostProcesses/thinAnaglyphPostProcess.js.map +1 -0
- package/PostProcesses/thinChromaticAberrationPostProcess.d.ts +45 -0
- package/PostProcesses/thinChromaticAberrationPostProcess.js +69 -0
- package/PostProcesses/thinChromaticAberrationPostProcess.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseLayerTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Layers/ba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AC,uBAAuB,CAAC,OAAO,EAAE,CAAC;QACvC,IAAI,CAAC,iBAAiB,EAAE,OAAO,EAAE,CAAC;QAClC,IAAI,CAAC,gBAAgB,EAAE,OAAO,EAAE,CAAC;QACjC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACrB,KAAK,IAAI,CAAC,GAAG,CAAC,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,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ","sourcesContent":["import type {\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n Scene,\r\n FrameGraphTextureCreationOptions,\r\n Effect,\r\n ThinBlurPostProcess,\r\n AbstractEngine,\r\n Nullable,\r\n Observer,\r\n RenderingGroupInfo,\r\n ThinEffectLayer,\r\n FrameGraphRenderPass,\r\n FrameGraphRenderContext,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\nimport { FrameGraphObjectRendererTask } from \"../Rendering/objectRendererTask\";\r\nimport { FrameGraphClearTextureTask } from \"../Texture/clearTextureTask\";\r\nimport { FrameGraphBlurTask } from \"../PostProcesses/blurTask\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphTextureManager } from \"../../frameGraphTextureManager\";\r\nimport { getDimensionsFromTextureSize } from \"../../../Materials/Textures/textureCreationOptions\";\r\nimport { FrameGraphPostProcessTask } from \"../PostProcesses/postProcessTask\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { ThinGlowBlurPostProcess } from \"../../../Layers/thinEffectLayer\";\r\nimport { FrameGraphExecuteTask } from \"../Misc/executeTask\";\r\n\r\nclass FrameGraphGlowBlurTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinGlowBlurPostProcess;\r\n\r\n /**\r\n * Constructs a new glow blur 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 glow blur effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinGlowBlurPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinGlowBlurPostProcess(name, frameGraph.engine, new Vector2(1, 0), 1));\r\n }\r\n\r\n public override record(\r\n skipCreationOfDisabledPasses = false,\r\n additionalExecute?: (context: FrameGraphRenderContext) => void,\r\n additionalBindings?: (context: FrameGraphRenderContext) => void\r\n ): FrameGraphRenderPass {\r\n const pass = super.record(skipCreationOfDisabledPasses, additionalExecute, additionalBindings);\r\n\r\n this.postProcess.textureWidth = this._outputWidth;\r\n this.postProcess.textureHeight = this._outputHeight;\r\n\r\n return pass;\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class FrameGraphBaseLayerTask extends FrameGraphTask {\r\n /**\r\n * The destination texture to apply the effect layer to.\r\n * The effect will be blended with the contents of this texture.\r\n */\r\n public destinationTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The object renderer task used to render the objects in the texture to which the layer will be applied.\r\n * This is needed because the layer may have to inject code in the rendering manager used by object renderer task.\r\n */\r\n public objectRendererTask: FrameGraphObjectRendererTask;\r\n\r\n /**\r\n * The layer texture to render the effect into.\r\n * If not provided, a default texture will be created.\r\n */\r\n public layerTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture of the task (same as destinationTexture, but the handle will be different).\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The layer object. Use this object to update the layer properties.\r\n */\r\n public readonly layer: ThinEffectLayer;\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._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._clearLayerTextures) {\r\n this._clearLayerTextures.name = name + \" Clear Layer\";\r\n }\r\n\r\n if (this._objectRendererForLayer) {\r\n this._objectRendererForLayer.name = name + \" Render to Layer\";\r\n }\r\n }\r\n\r\n protected readonly _scene: Scene;\r\n protected readonly _engine: AbstractEngine;\r\n protected readonly _clearLayerTextures: FrameGraphClearTextureTask;\r\n protected readonly _objectRendererForLayer: FrameGraphObjectRendererTask;\r\n protected readonly _blurX: Array<FrameGraphBlurTask | FrameGraphGlowBlurTask> = [];\r\n protected readonly _blurY: Array<FrameGraphBlurTask | FrameGraphGlowBlurTask> = [];\r\n private readonly _onBeforeBlurTask: Nullable<FrameGraphExecuteTask> = null;\r\n private readonly _onAfterBlurTask: Nullable<FrameGraphExecuteTask> = null;\r\n private _onBeforeObservableObserver: Nullable<Observer<number>> = null;\r\n private _onAfterObservableObserver: Nullable<Observer<number>> = null;\r\n private _onAfterRenderingGroupObserver: Nullable<Observer<RenderingGroupInfo>> = null;\r\n\r\n /**\r\n * Constructs a new layer task.\r\n * @param name Name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param scene The scene to render the layer in.\r\n * @param layer The layer.\r\n * @param numBlurPasses The number of blur passes applied by the layer.\r\n * @param useCustomBlur If true, the layer will use a custom blur post process instead of the default one.\r\n * @param _setRenderTargetDepth If true, the task will set the render target depth.\r\n * @param _notifyBlurObservable If true, the task will notify before and after blurring occurs.\r\n */\r\n constructor(\r\n name: string,\r\n frameGraph: FrameGraph,\r\n scene: Scene,\r\n layer: ThinEffectLayer,\r\n numBlurPasses: number,\r\n useCustomBlur = false,\r\n private _setRenderTargetDepth = false,\r\n private _notifyBlurObservable = false\r\n ) {\r\n super(name, frameGraph);\r\n\r\n this._scene = scene;\r\n this._engine = scene.getEngine();\r\n\r\n this.layer = layer;\r\n for (let i = 0; i < numBlurPasses; i++) {\r\n if (useCustomBlur) {\r\n this._blurX.push(new FrameGraphGlowBlurTask(`${name} Blur X${i}`, this._frameGraph, this.layer._postProcesses[1 + i * 2 + 0] as ThinGlowBlurPostProcess));\r\n this._blurY.push(new FrameGraphGlowBlurTask(`${name} Blur Y${i}`, this._frameGraph, this.layer._postProcesses[1 + i * 2 + 1] as ThinGlowBlurPostProcess));\r\n } else {\r\n this._blurX.push(new FrameGraphBlurTask(`${name} Blur X${i}`, this._frameGraph, this.layer._postProcesses[i * 2 + 0] as ThinBlurPostProcess));\r\n this._blurY.push(new FrameGraphBlurTask(`${name} Blur Y${i}`, this._frameGraph, this.layer._postProcesses[i * 2 + 1] as ThinBlurPostProcess));\r\n }\r\n }\r\n\r\n this._clearLayerTextures = new FrameGraphClearTextureTask(name + \" Clear Layer\", frameGraph);\r\n this._clearLayerTextures.clearColor = true;\r\n this._clearLayerTextures.clearDepth = true;\r\n\r\n this._objectRendererForLayer = new FrameGraphObjectRendererTask(name + \" Render to Layer\", frameGraph, scene, undefined, this.layer.objectRenderer);\r\n\r\n if (this._notifyBlurObservable) {\r\n this._onBeforeBlurTask = new FrameGraphExecuteTask(name + \" On Before Blur\", frameGraph);\r\n this._onAfterBlurTask = new FrameGraphExecuteTask(name + \" On After Blur\", frameGraph);\r\n\r\n this._onBeforeBlurTask.func = () => {\r\n if (this.layer.onBeforeBlurObservable.hasObservers()) {\r\n this.layer.onBeforeBlurObservable.notifyObservers(this.layer);\r\n }\r\n };\r\n this._onAfterBlurTask.func = () => {\r\n if (this.layer.onAfterBlurObservable.hasObservers()) {\r\n this.layer.onAfterBlurObservable.notifyObservers(this.layer);\r\n }\r\n };\r\n }\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n\r\n this.onTexturesAllocatedObservable.add((context) => {\r\n for (let i = 0; i < this._blurX.length; i++) {\r\n this._blurX[i].onTexturesAllocatedObservable.notifyObservers(context);\r\n this._blurY[i].onTexturesAllocatedObservable.notifyObservers(context);\r\n }\r\n\r\n context.setTextureSamplingMode(this._blurY[this._blurY.length - 1].destinationTexture!, Constants.TEXTURE_BILINEAR_SAMPLINGMODE);\r\n });\r\n }\r\n\r\n public override isReady() {\r\n return this._objectRendererForLayer.isReady() && this.layer.isLayerReady();\r\n }\r\n\r\n public record() {\r\n if (this.destinationTexture === undefined || this.objectRendererTask === undefined) {\r\n throw new Error(`${this.constructor.name} \"${this.name}\": destinationTexture and objectRendererTask are required`);\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture);\r\n\r\n // Uses the layerTexture or creates a color texture to render the layer to\r\n let textureSize: {\r\n width: number;\r\n height: number;\r\n };\r\n let textureCreationOptions: FrameGraphTextureCreationOptions;\r\n\r\n let colorLayerOutput: FrameGraphTextureHandle;\r\n\r\n if (this.layerTexture) {\r\n colorLayerOutput = this.layerTexture;\r\n textureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.layerTexture);\r\n textureSize = getDimensionsFromTextureSize(textureCreationOptions.size);\r\n textureCreationOptions.size = textureSize;\r\n } else {\r\n const destinationTextureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.destinationTexture);\r\n const fixedTextureSize = this.layer._options.mainTextureFixedSize ? Math.max(2, this.layer._options.mainTextureFixedSize) : 0;\r\n\r\n textureSize = getDimensionsFromTextureSize(destinationTextureCreationOptions.size);\r\n textureSize.width = fixedTextureSize || Math.floor(textureSize.width * (this.layer._options.mainTextureRatio || 0.1));\r\n textureSize.height = fixedTextureSize || Math.floor(textureSize.height * (this.layer._options.mainTextureRatio || 0.1));\r\n\r\n textureCreationOptions = {\r\n size: textureSize,\r\n options: {\r\n createMipMaps: false,\r\n types: [this.layer._options.mainTextureType],\r\n formats: [Constants.TEXTUREFORMAT_RGBA],\r\n samples: 1,\r\n useSRGBBuffers: [false],\r\n creationFlags: [0],\r\n },\r\n sizeIsPercentage: this.layer._options.mainTextureFixedSize ? false : destinationTextureCreationOptions.sizeIsPercentage,\r\n };\r\n colorLayerOutput = this._frameGraph.textureManager.createRenderTargetTexture(`${this.name} Color`, textureCreationOptions);\r\n }\r\n\r\n // Creates a depth texture, used to render objects to the layer\r\n // We don't reuse the depth texture of the objectRendererTask, as the size of the layer texture will generally be different (smaller).\r\n const textureDepthCreationOptions: FrameGraphTextureCreationOptions = {\r\n size: textureSize,\r\n options: FrameGraphTextureManager.CloneTextureOptions(textureCreationOptions.options),\r\n sizeIsPercentage: textureCreationOptions.sizeIsPercentage,\r\n };\r\n\r\n textureDepthCreationOptions.options.formats![0] = Constants.TEXTUREFORMAT_DEPTH32_FLOAT;\r\n\r\n const depthLayerOutput = this._frameGraph.textureManager.createRenderTargetTexture(`${this.name} Depth`, textureDepthCreationOptions);\r\n\r\n // Clears the textures\r\n this._clearLayerTextures.destinationTexture = colorLayerOutput;\r\n this._clearLayerTextures.depthTexture = depthLayerOutput;\r\n this._clearLayerTextures.color = this.layer.neutralColor;\r\n this._clearLayerTextures.clearDepth = true;\r\n\r\n const clearTaskPass = this._clearLayerTextures.record();\r\n\r\n // Renders the objects to the layer texture\r\n this._objectRendererForLayer.destinationTexture = this._clearLayerTextures.outputTexture;\r\n this._objectRendererForLayer.depthTexture = this._clearLayerTextures.outputDepthTexture;\r\n this._objectRendererForLayer.camera = this.objectRendererTask.camera;\r\n this._objectRendererForLayer.objectList = this.objectRendererTask.objectList;\r\n this._objectRendererForLayer.disableShadows = true;\r\n\r\n const objectRendererForLayerTaskPass = this._objectRendererForLayer.record();\r\n\r\n // Blurs the layer color texture\r\n let blurTextureType = 0;\r\n if (this._engine.getCaps().textureHalfFloatRender) {\r\n blurTextureType = Constants.TEXTURETYPE_HALF_FLOAT;\r\n } else {\r\n blurTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n }\r\n\r\n textureCreationOptions.options.types![0] = blurTextureType;\r\n\r\n const blurTextureSizeRatio = (this.layer._options as any).blurTextureSizeRatio !== undefined ? (this.layer._options as any).blurTextureSizeRatio || 0.1 : undefined;\r\n if (blurTextureSizeRatio !== undefined) {\r\n textureSize.width = Math.floor(textureSize.width * blurTextureSizeRatio);\r\n textureSize.height = Math.floor(textureSize.height * blurTextureSizeRatio);\r\n }\r\n\r\n const onBeforeBlurPass = this._onBeforeBlurTask?.record();\r\n\r\n const blurPasses: FrameGraphRenderPass[] = [];\r\n\r\n for (let i = 0; i < this._blurX.length; i++) {\r\n const blurXTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurX[i].name, textureCreationOptions);\r\n\r\n this._blurX[i].sourceTexture = i === 0 ? this._objectRendererForLayer.outputTexture : this._blurY[i - 1].outputTexture;\r\n this._blurX[i].sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurX[i].destinationTexture = blurXTextureHandle;\r\n blurPasses.push(this._blurX[i].record(true));\r\n\r\n const blurYTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurY[i].name, textureCreationOptions);\r\n\r\n this._blurY[i].sourceTexture = this._blurX[i].outputTexture;\r\n this._blurY[i].sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurY[i].destinationTexture = blurYTextureHandle;\r\n blurPasses.push(this._blurY[i].record(true));\r\n\r\n textureSize.width = textureSize.width >> 1;\r\n textureSize.height = textureSize.height >> 1;\r\n }\r\n\r\n const onAfterBlurPass = this._onAfterBlurTask?.record();\r\n\r\n // Enables stencil (if stencil is needed) when rendering objects to the main texture\r\n // We also disable the internal passes if the layer should not render\r\n this.objectRendererTask.objectRenderer.onBeforeRenderObservable.remove(this._onBeforeObservableObserver);\r\n this._onBeforeObservableObserver = this.objectRendererTask.objectRenderer.onBeforeRenderObservable.add(() => {\r\n const shouldRender = this.layer.shouldRender();\r\n\r\n clearTaskPass.disabled = !shouldRender;\r\n objectRendererForLayerTaskPass.disabled = !shouldRender;\r\n if (onBeforeBlurPass) {\r\n onBeforeBlurPass.disabled = !shouldRender;\r\n }\r\n for (let i = 0; i < blurPasses.length; i++) {\r\n blurPasses[i].disabled = !shouldRender;\r\n }\r\n if (onAfterBlurPass) {\r\n onAfterBlurPass.disabled = !shouldRender;\r\n }\r\n\r\n if (shouldRender && this.layer.needStencil()) {\r\n this._engine.setStencilBuffer(true);\r\n this._engine.setStencilFunctionReference(1);\r\n }\r\n });\r\n\r\n this.objectRendererTask.objectRenderer.onAfterRenderObservable.remove(this._onAfterObservableObserver);\r\n this._onAfterObservableObserver = this.objectRendererTask.objectRenderer.onAfterRenderObservable.add(() => {\r\n if (this.layer.shouldRender() && this.layer.needStencil()) {\r\n this._engine.setStencilBuffer(false);\r\n }\r\n });\r\n\r\n // Composes the layer with the destination texture\r\n this.layer.bindTexturesForCompose = undefined as any;\r\n\r\n this._clearAfterRenderingGroupObserver();\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n for (let i = 0; i < this._blurY.length; i++) {\r\n pass.addDependencies(this._blurY[i].outputTexture);\r\n }\r\n\r\n pass.setRenderTarget(this.outputTexture);\r\n if (this._setRenderTargetDepth) {\r\n pass.setRenderTargetDepth(this.objectRendererTask.depthTexture);\r\n }\r\n pass.setExecuteFunc((context) => {\r\n if (!this.layer.bindTexturesForCompose) {\r\n this.layer.bindTexturesForCompose = (effect: Effect) => {\r\n for (let i = 0; i < this._blurY.length; i++) {\r\n context.bindTextureHandle(effect, `textureSampler${i > 0 ? i + 1 : \"\"}`, this._blurY[i].outputTexture);\r\n }\r\n };\r\n }\r\n\r\n if (this.layer._options.renderingGroupId !== -1) {\r\n if (!this._onAfterRenderingGroupObserver) {\r\n this._onAfterRenderingGroupObserver = this._scene.onAfterRenderingGroupObservable.add((info) => {\r\n if (\r\n !this.layer.shouldRender() ||\r\n info.renderingGroupId !== this.layer._options.renderingGroupId ||\r\n info.renderingManager !== this.objectRendererTask.objectRenderer._renderingManager\r\n ) {\r\n return;\r\n }\r\n this._objectRendererForLayer.objectList = this.objectRendererTask.objectList;\r\n context.saveDepthStates();\r\n context.setDepthStates(false, false);\r\n context._applyRenderTarget();\r\n this.layer.compose();\r\n context.restoreDepthStates();\r\n });\r\n }\r\n } else {\r\n this._clearAfterRenderingGroupObserver();\r\n if (this.layer.shouldRender()) {\r\n this._objectRendererForLayer.objectList = this.objectRendererTask.objectList; // in case the object list has changed in objectRendererTask\r\n\r\n context.setDepthStates(false, false);\r\n context._applyRenderTarget();\r\n\r\n this.layer.compose();\r\n }\r\n }\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n if (this._setRenderTargetDepth) {\r\n passDisabled.setRenderTargetDepth(this.objectRendererTask.depthTexture);\r\n }\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n\r\n private _clearAfterRenderingGroupObserver() {\r\n this._scene.onAfterRenderingGroupObservable.remove(this._onAfterRenderingGroupObserver);\r\n this._onAfterRenderingGroupObserver = null;\r\n }\r\n\r\n public override dispose(): void {\r\n this._clearAfterRenderingGroupObserver();\r\n this._clearLayerTextures.dispose();\r\n this._objectRendererForLayer.dispose();\r\n this._onBeforeBlurTask?.dispose();\r\n this._onAfterBlurTask?.dispose();\r\n this.layer.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 super.dispose();\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"baseLayerTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Layers/baseLayerTask.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,k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AAE,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,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ","sourcesContent":["import type {\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n Scene,\r\n FrameGraphTextureCreationOptions,\r\n Effect,\r\n ThinBlurPostProcess,\r\n AbstractEngine,\r\n Nullable,\r\n Observer,\r\n RenderingGroupInfo,\r\n ThinEffectLayer,\r\n FrameGraphRenderPass,\r\n FrameGraphRenderContext,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\nimport { FrameGraphObjectRendererTask } from \"../Rendering/objectRendererTask\";\r\nimport { FrameGraphClearTextureTask } from \"../Texture/clearTextureTask\";\r\nimport { FrameGraphBlurTask } from \"../PostProcesses/blurTask\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphTextureManager } from \"../../frameGraphTextureManager\";\r\nimport { getDimensionsFromTextureSize } from \"../../../Materials/Textures/textureCreationOptions\";\r\nimport { FrameGraphPostProcessTask } from \"../PostProcesses/postProcessTask\";\r\nimport { Vector2 } from \"core/Maths/math.vector\";\r\nimport { ThinGlowBlurPostProcess } from \"../../../Layers/thinEffectLayer\";\r\nimport { FrameGraphExecuteTask } from \"../Misc/executeTask\";\r\n\r\nclass FrameGraphGlowBlurTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinGlowBlurPostProcess;\r\n\r\n /**\r\n * Constructs a new glow blur 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 glow blur effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinGlowBlurPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinGlowBlurPostProcess(name, frameGraph.engine, new Vector2(1, 0), 1));\r\n }\r\n\r\n public override record(\r\n skipCreationOfDisabledPasses = false,\r\n additionalExecute?: (context: FrameGraphRenderContext) => void,\r\n additionalBindings?: (context: FrameGraphRenderContext) => void\r\n ): FrameGraphRenderPass {\r\n const pass = super.record(skipCreationOfDisabledPasses, additionalExecute, additionalBindings);\r\n\r\n this.postProcess.textureWidth = this._outputWidth;\r\n this.postProcess.textureHeight = this._outputHeight;\r\n\r\n return pass;\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class FrameGraphBaseLayerTask extends FrameGraphTask {\r\n /**\r\n * The target texture to apply the effect layer to.\r\n * The effect will be blended with the contents of this texture.\r\n */\r\n public targetTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The object renderer task used to render the objects in the texture to which the layer will be applied.\r\n * This is needed because the layer may have to inject code in the rendering manager used by object renderer task.\r\n */\r\n public objectRendererTask: FrameGraphObjectRendererTask;\r\n\r\n /**\r\n * The layer texture to render the effect into.\r\n * If not provided, a default texture will be created.\r\n */\r\n public layerTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture of the task (same as targetTexture, but the handle will be different).\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The layer object. Use this object to update the layer properties.\r\n */\r\n public readonly layer: ThinEffectLayer;\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._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._clearLayerTextures) {\r\n this._clearLayerTextures.name = name + \" Clear Layer\";\r\n }\r\n\r\n if (this._objectRendererForLayer) {\r\n this._objectRendererForLayer.name = name + \" Render to Layer\";\r\n }\r\n }\r\n\r\n protected readonly _scene: Scene;\r\n protected readonly _engine: AbstractEngine;\r\n protected readonly _clearLayerTextures: FrameGraphClearTextureTask;\r\n protected readonly _objectRendererForLayer: FrameGraphObjectRendererTask;\r\n protected readonly _blurX: Array<FrameGraphBlurTask | FrameGraphGlowBlurTask> = [];\r\n protected readonly _blurY: Array<FrameGraphBlurTask | FrameGraphGlowBlurTask> = [];\r\n private readonly _onBeforeBlurTask: Nullable<FrameGraphExecuteTask> = null;\r\n private readonly _onAfterBlurTask: Nullable<FrameGraphExecuteTask> = null;\r\n private _onBeforeObservableObserver: Nullable<Observer<number>> = null;\r\n private _onAfterObservableObserver: Nullable<Observer<number>> = null;\r\n private _onAfterRenderingGroupObserver: Nullable<Observer<RenderingGroupInfo>> = null;\r\n\r\n /**\r\n * Constructs a new layer task.\r\n * @param name Name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param scene The scene to render the layer in.\r\n * @param layer The layer.\r\n * @param numBlurPasses The number of blur passes applied by the layer.\r\n * @param useCustomBlur If true, the layer will use a custom blur post process instead of the default one.\r\n * @param _setRenderTargetDepth If true, the task will set the render target depth.\r\n * @param _notifyBlurObservable If true, the task will notify before and after blurring occurs.\r\n */\r\n constructor(\r\n name: string,\r\n frameGraph: FrameGraph,\r\n scene: Scene,\r\n layer: ThinEffectLayer,\r\n numBlurPasses: number,\r\n useCustomBlur = false,\r\n private _setRenderTargetDepth = false,\r\n private _notifyBlurObservable = false\r\n ) {\r\n super(name, frameGraph);\r\n\r\n this._scene = scene;\r\n this._engine = scene.getEngine();\r\n\r\n this.layer = layer;\r\n for (let i = 0; i < numBlurPasses; i++) {\r\n if (useCustomBlur) {\r\n this._blurX.push(new FrameGraphGlowBlurTask(`${name} Blur X${i}`, this._frameGraph, this.layer._postProcesses[1 + i * 2 + 0] as ThinGlowBlurPostProcess));\r\n this._blurY.push(new FrameGraphGlowBlurTask(`${name} Blur Y${i}`, this._frameGraph, this.layer._postProcesses[1 + i * 2 + 1] as ThinGlowBlurPostProcess));\r\n } else {\r\n this._blurX.push(new FrameGraphBlurTask(`${name} Blur X${i}`, this._frameGraph, this.layer._postProcesses[i * 2 + 0] as ThinBlurPostProcess));\r\n this._blurY.push(new FrameGraphBlurTask(`${name} Blur Y${i}`, this._frameGraph, this.layer._postProcesses[i * 2 + 1] as ThinBlurPostProcess));\r\n }\r\n }\r\n\r\n this._clearLayerTextures = new FrameGraphClearTextureTask(name + \" Clear Layer\", frameGraph);\r\n this._clearLayerTextures.clearColor = true;\r\n this._clearLayerTextures.clearDepth = true;\r\n\r\n this._objectRendererForLayer = new FrameGraphObjectRendererTask(name + \" Render to Layer\", frameGraph, scene, undefined, this.layer.objectRenderer);\r\n\r\n if (this._notifyBlurObservable) {\r\n this._onBeforeBlurTask = new FrameGraphExecuteTask(name + \" On Before Blur\", frameGraph);\r\n this._onAfterBlurTask = new FrameGraphExecuteTask(name + \" On After Blur\", frameGraph);\r\n\r\n this._onBeforeBlurTask.func = () => {\r\n if (this.layer.onBeforeBlurObservable.hasObservers()) {\r\n this.layer.onBeforeBlurObservable.notifyObservers(this.layer);\r\n }\r\n };\r\n this._onAfterBlurTask.func = () => {\r\n if (this.layer.onAfterBlurObservable.hasObservers()) {\r\n this.layer.onAfterBlurObservable.notifyObservers(this.layer);\r\n }\r\n };\r\n }\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n\r\n this.onTexturesAllocatedObservable.add((context) => {\r\n for (let i = 0; i < this._blurX.length; i++) {\r\n this._blurX[i].onTexturesAllocatedObservable.notifyObservers(context);\r\n this._blurY[i].onTexturesAllocatedObservable.notifyObservers(context);\r\n }\r\n\r\n context.setTextureSamplingMode(this._blurY[this._blurY.length - 1].targetTexture!, Constants.TEXTURE_BILINEAR_SAMPLINGMODE);\r\n });\r\n }\r\n\r\n public override isReady() {\r\n return this._objectRendererForLayer.isReady() && this.layer.isLayerReady();\r\n }\r\n\r\n public record() {\r\n if (this.targetTexture === undefined || this.objectRendererTask === undefined) {\r\n throw new Error(`${this.constructor.name} \"${this.name}\": targetTexture and objectRendererTask are required`);\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture);\r\n\r\n // Uses the layerTexture or creates a color texture to render the layer to\r\n let textureSize: {\r\n width: number;\r\n height: number;\r\n };\r\n let textureCreationOptions: FrameGraphTextureCreationOptions;\r\n\r\n let colorLayerOutput: FrameGraphTextureHandle;\r\n\r\n if (this.layerTexture) {\r\n colorLayerOutput = this.layerTexture;\r\n textureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.layerTexture);\r\n textureSize = getDimensionsFromTextureSize(textureCreationOptions.size);\r\n textureCreationOptions.size = textureSize;\r\n } else {\r\n const targetTextureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.targetTexture);\r\n const fixedTextureSize = this.layer._options.mainTextureFixedSize ? Math.max(2, this.layer._options.mainTextureFixedSize) : 0;\r\n\r\n textureSize = getDimensionsFromTextureSize(targetTextureCreationOptions.size);\r\n textureSize.width = fixedTextureSize || Math.floor(textureSize.width * (this.layer._options.mainTextureRatio || 0.1));\r\n textureSize.height = fixedTextureSize || Math.floor(textureSize.height * (this.layer._options.mainTextureRatio || 0.1));\r\n\r\n textureCreationOptions = {\r\n size: textureSize,\r\n options: {\r\n createMipMaps: false,\r\n types: [this.layer._options.mainTextureType],\r\n formats: [Constants.TEXTUREFORMAT_RGBA],\r\n samples: 1,\r\n useSRGBBuffers: [false],\r\n creationFlags: [0],\r\n },\r\n sizeIsPercentage: this.layer._options.mainTextureFixedSize ? false : targetTextureCreationOptions.sizeIsPercentage,\r\n };\r\n colorLayerOutput = this._frameGraph.textureManager.createRenderTargetTexture(`${this.name} Color`, textureCreationOptions);\r\n }\r\n\r\n // Creates a depth texture, used to render objects to the layer\r\n // We don't reuse the depth texture of the objectRendererTask, as the size of the layer texture will generally be different (smaller).\r\n const textureDepthCreationOptions: FrameGraphTextureCreationOptions = {\r\n size: textureSize,\r\n options: FrameGraphTextureManager.CloneTextureOptions(textureCreationOptions.options),\r\n sizeIsPercentage: textureCreationOptions.sizeIsPercentage,\r\n };\r\n\r\n textureDepthCreationOptions.options.formats![0] = Constants.TEXTUREFORMAT_DEPTH32_FLOAT;\r\n\r\n const depthLayerOutput = this._frameGraph.textureManager.createRenderTargetTexture(`${this.name} Depth`, textureDepthCreationOptions);\r\n\r\n // Clears the textures\r\n this._clearLayerTextures.targetTexture = colorLayerOutput;\r\n this._clearLayerTextures.depthTexture = depthLayerOutput;\r\n this._clearLayerTextures.color = this.layer.neutralColor;\r\n this._clearLayerTextures.clearDepth = true;\r\n\r\n const clearTaskPass = this._clearLayerTextures.record();\r\n\r\n // Renders the objects to the layer texture\r\n this._objectRendererForLayer.targetTexture = this._clearLayerTextures.outputTexture;\r\n this._objectRendererForLayer.depthTexture = this._clearLayerTextures.outputDepthTexture;\r\n this._objectRendererForLayer.camera = this.objectRendererTask.camera;\r\n this._objectRendererForLayer.objectList = this.objectRendererTask.objectList;\r\n this._objectRendererForLayer.disableShadows = true;\r\n\r\n const objectRendererForLayerTaskPass = this._objectRendererForLayer.record();\r\n\r\n // Blurs the layer color texture\r\n let blurTextureType = 0;\r\n if (this._engine.getCaps().textureHalfFloatRender) {\r\n blurTextureType = Constants.TEXTURETYPE_HALF_FLOAT;\r\n } else {\r\n blurTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n }\r\n\r\n textureCreationOptions.options.types![0] = blurTextureType;\r\n\r\n const blurTextureSizeRatio = (this.layer._options as any).blurTextureSizeRatio !== undefined ? (this.layer._options as any).blurTextureSizeRatio || 0.1 : undefined;\r\n if (blurTextureSizeRatio !== undefined) {\r\n textureSize.width = Math.floor(textureSize.width * blurTextureSizeRatio);\r\n textureSize.height = Math.floor(textureSize.height * blurTextureSizeRatio);\r\n }\r\n\r\n const onBeforeBlurPass = this._onBeforeBlurTask?.record();\r\n\r\n const blurPasses: FrameGraphRenderPass[] = [];\r\n\r\n for (let i = 0; i < this._blurX.length; i++) {\r\n const blurXTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurX[i].name, textureCreationOptions);\r\n\r\n this._blurX[i].sourceTexture = i === 0 ? this._objectRendererForLayer.outputTexture : this._blurY[i - 1].outputTexture;\r\n this._blurX[i].sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurX[i].targetTexture = blurXTextureHandle;\r\n blurPasses.push(this._blurX[i].record(true));\r\n\r\n const blurYTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurY[i].name, textureCreationOptions);\r\n\r\n this._blurY[i].sourceTexture = this._blurX[i].outputTexture;\r\n this._blurY[i].sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurY[i].targetTexture = blurYTextureHandle;\r\n blurPasses.push(this._blurY[i].record(true));\r\n\r\n textureSize.width = textureSize.width >> 1;\r\n textureSize.height = textureSize.height >> 1;\r\n }\r\n\r\n const onAfterBlurPass = this._onAfterBlurTask?.record();\r\n\r\n // Enables stencil (if stencil is needed) when rendering objects to the main texture\r\n // We also disable the internal passes if the layer should not render\r\n this.objectRendererTask.objectRenderer.onBeforeRenderObservable.remove(this._onBeforeObservableObserver);\r\n this._onBeforeObservableObserver = this.objectRendererTask.objectRenderer.onBeforeRenderObservable.add(() => {\r\n const shouldRender = this.layer.shouldRender();\r\n\r\n clearTaskPass.disabled = !shouldRender;\r\n objectRendererForLayerTaskPass.disabled = !shouldRender;\r\n if (onBeforeBlurPass) {\r\n onBeforeBlurPass.disabled = !shouldRender;\r\n }\r\n for (let i = 0; i < blurPasses.length; i++) {\r\n blurPasses[i].disabled = !shouldRender;\r\n }\r\n if (onAfterBlurPass) {\r\n onAfterBlurPass.disabled = !shouldRender;\r\n }\r\n\r\n if (shouldRender && this.layer.needStencil()) {\r\n this._engine.setStencilBuffer(true);\r\n this._engine.setStencilFunctionReference(1);\r\n }\r\n });\r\n\r\n this.objectRendererTask.objectRenderer.onAfterRenderObservable.remove(this._onAfterObservableObserver);\r\n this._onAfterObservableObserver = this.objectRendererTask.objectRenderer.onAfterRenderObservable.add(() => {\r\n if (this.layer.shouldRender() && this.layer.needStencil()) {\r\n this._engine.setStencilBuffer(false);\r\n }\r\n });\r\n\r\n // Composes the layer with the target texture\r\n this.layer.bindTexturesForCompose = undefined as any;\r\n\r\n this._clearAfterRenderingGroupObserver();\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n for (let i = 0; i < this._blurY.length; i++) {\r\n pass.addDependencies(this._blurY[i].outputTexture);\r\n }\r\n\r\n pass.setRenderTarget(this.outputTexture);\r\n if (this._setRenderTargetDepth) {\r\n pass.setRenderTargetDepth(this.objectRendererTask.depthTexture);\r\n }\r\n pass.setExecuteFunc((context) => {\r\n if (!this.layer.bindTexturesForCompose) {\r\n this.layer.bindTexturesForCompose = (effect: Effect) => {\r\n for (let i = 0; i < this._blurY.length; i++) {\r\n context.bindTextureHandle(effect, `textureSampler${i > 0 ? i + 1 : \"\"}`, this._blurY[i].outputTexture);\r\n }\r\n };\r\n }\r\n\r\n if (this.layer._options.renderingGroupId !== -1) {\r\n if (!this._onAfterRenderingGroupObserver) {\r\n this._onAfterRenderingGroupObserver = this._scene.onAfterRenderingGroupObservable.add((info) => {\r\n if (\r\n !this.layer.shouldRender() ||\r\n info.renderingGroupId !== this.layer._options.renderingGroupId ||\r\n info.renderingManager !== this.objectRendererTask.objectRenderer._renderingManager\r\n ) {\r\n return;\r\n }\r\n this._objectRendererForLayer.objectList = this.objectRendererTask.objectList;\r\n context.saveDepthStates();\r\n context.setDepthStates(false, false);\r\n context._applyRenderTarget();\r\n this.layer.compose();\r\n context.restoreDepthStates();\r\n });\r\n }\r\n } else {\r\n this._clearAfterRenderingGroupObserver();\r\n if (this.layer.shouldRender()) {\r\n this._objectRendererForLayer.objectList = this.objectRendererTask.objectList; // in case the object list has changed in objectRendererTask\r\n\r\n context.setDepthStates(false, false);\r\n context._applyRenderTarget();\r\n\r\n this.layer.compose();\r\n }\r\n }\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(this.outputTexture);\r\n if (this._setRenderTargetDepth) {\r\n passDisabled.setRenderTargetDepth(this.objectRendererTask.depthTexture);\r\n }\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n\r\n private _clearAfterRenderingGroupObserver() {\r\n this._scene.onAfterRenderingGroupObservable.remove(this._onAfterRenderingGroupObserver);\r\n this._onAfterRenderingGroupObserver = null;\r\n }\r\n\r\n public override dispose(): void {\r\n this._clearAfterRenderingGroupObserver();\r\n this._clearLayerTextures.dispose();\r\n this._objectRendererForLayer.dispose();\r\n this._onBeforeBlurTask?.dispose();\r\n this._onAfterBlurTask?.dispose();\r\n this.layer.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 super.dispose();\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphRenderPass, FrameGraphTextureHandle } from "../../../index.js";
|
|
2
|
+
import { ThinAnaglyphPostProcess } from "../../../PostProcesses/thinAnaglyphPostProcess.js";
|
|
3
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask";
|
|
4
|
+
/**
|
|
5
|
+
* Task which applies an anaglyph post process.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FrameGraphAnaglyphTask extends FrameGraphPostProcessTask {
|
|
8
|
+
/**
|
|
9
|
+
* The texture to use as the left texture.
|
|
10
|
+
*/
|
|
11
|
+
leftTexture: FrameGraphTextureHandle;
|
|
12
|
+
readonly postProcess: ThinAnaglyphPostProcess;
|
|
13
|
+
/**
|
|
14
|
+
* Constructs a new anaglyph task.
|
|
15
|
+
* @param name The name of the task.
|
|
16
|
+
* @param frameGraph The frame graph this task is associated with.
|
|
17
|
+
* @param thinPostProcess The thin post process to use for the anaglyph effect. If not provided, a new one will be created.
|
|
18
|
+
*/
|
|
19
|
+
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinAnaglyphPostProcess);
|
|
20
|
+
record(skipCreationOfDisabledPasses?: boolean): FrameGraphRenderPass;
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ThinAnaglyphPostProcess } from "../../../PostProcesses/thinAnaglyphPostProcess.js";
|
|
2
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask.js";
|
|
3
|
+
/**
|
|
4
|
+
* Task which applies an anaglyph post process.
|
|
5
|
+
*/
|
|
6
|
+
export class FrameGraphAnaglyphTask extends FrameGraphPostProcessTask {
|
|
7
|
+
/**
|
|
8
|
+
* Constructs a new anaglyph task.
|
|
9
|
+
* @param name The name of the task.
|
|
10
|
+
* @param frameGraph The frame graph this task is associated with.
|
|
11
|
+
* @param thinPostProcess The thin post process to use for the anaglyph effect. If not provided, a new one will be created.
|
|
12
|
+
*/
|
|
13
|
+
constructor(name, frameGraph, thinPostProcess) {
|
|
14
|
+
super(name, frameGraph, thinPostProcess || new ThinAnaglyphPostProcess(name, frameGraph.engine));
|
|
15
|
+
}
|
|
16
|
+
record(skipCreationOfDisabledPasses = false) {
|
|
17
|
+
if (this.sourceTexture === undefined || this.leftTexture === undefined) {
|
|
18
|
+
throw new Error(`FrameGraphAnaglyphTask "${this.name}": sourceTexture and leftTexture are required`);
|
|
19
|
+
}
|
|
20
|
+
const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {
|
|
21
|
+
context.bindTextureHandle(this._postProcessDrawWrapper.effect, "leftSampler", this.leftTexture);
|
|
22
|
+
});
|
|
23
|
+
pass.addDependencies(this.leftTexture);
|
|
24
|
+
return pass;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=anaglyphTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anaglyphTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/anaglyphTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,0DAAmD;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,yBAAyB;IAQjE;;;;;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,MAAM,CAAC,4BAA4B,GAAG,KAAK;QACvD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACrE,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,IAAI,+CAA+C,CAAC,CAAC;QACzG,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,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACrG,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEvC,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphRenderPass, FrameGraphTextureHandle } from \"core/index\";\r\nimport { ThinAnaglyphPostProcess } from \"core/PostProcesses/thinAnaglyphPostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\n\r\n/**\r\n * Task which applies an anaglyph post process.\r\n */\r\nexport class FrameGraphAnaglyphTask extends FrameGraphPostProcessTask {\r\n /**\r\n * The texture to use as the left texture.\r\n */\r\n public leftTexture: FrameGraphTextureHandle;\r\n\r\n public override readonly postProcess: ThinAnaglyphPostProcess;\r\n\r\n /**\r\n * Constructs a new anaglyph 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 anaglyph effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinAnaglyphPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinAnaglyphPostProcess(name, frameGraph.engine));\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false): FrameGraphRenderPass {\r\n if (this.sourceTexture === undefined || this.leftTexture === undefined) {\r\n throw new Error(`FrameGraphAnaglyphTask \"${this.name}\": sourceTexture and leftTexture are required`);\r\n }\r\n\r\n const pass = super.record(skipCreationOfDisabledPasses, undefined, (context) => {\r\n context.bindTextureHandle(this._postProcessDrawWrapper.effect!, \"leftSampler\", this.leftTexture);\r\n });\r\n\r\n pass.addDependencies(this.leftTexture);\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
@@ -14,10 +14,10 @@ export declare class FrameGraphBloomTask extends FrameGraphTask {
|
|
|
14
14
|
*/
|
|
15
15
|
sourceSamplingMode: number;
|
|
16
16
|
/**
|
|
17
|
-
* The
|
|
17
|
+
* The target texture to render the bloom effect to.
|
|
18
18
|
* If not supplied, a texture with the same configuration as the source texture will be created.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
targetTexture?: FrameGraphTextureHandle;
|
|
21
21
|
/**
|
|
22
22
|
* The output texture of the bloom effect.
|
|
23
23
|
*/
|
|
@@ -98,24 +98,24 @@ export class FrameGraphBloomTask extends FrameGraphTask {
|
|
|
98
98
|
const downscaleTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._downscale.name, textureCreationOptions);
|
|
99
99
|
this._downscale.sourceTexture = this.sourceTexture;
|
|
100
100
|
this._downscale.sourceSamplingMode = 2;
|
|
101
|
-
this._downscale.
|
|
101
|
+
this._downscale.targetTexture = downscaleTextureHandle;
|
|
102
102
|
this._downscale.record(true);
|
|
103
103
|
const blurXTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurX.name, textureCreationOptions);
|
|
104
104
|
this._blurX.sourceTexture = downscaleTextureHandle;
|
|
105
105
|
this._blurX.sourceSamplingMode = 2;
|
|
106
|
-
this._blurX.
|
|
106
|
+
this._blurX.targetTexture = blurXTextureHandle;
|
|
107
107
|
this._blurX.record(true);
|
|
108
108
|
const blurYTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurY.name, textureCreationOptions);
|
|
109
109
|
this._blurY.sourceTexture = blurXTextureHandle;
|
|
110
110
|
this._blurY.sourceSamplingMode = 2;
|
|
111
|
-
this._blurY.
|
|
111
|
+
this._blurY.targetTexture = blurYTextureHandle;
|
|
112
112
|
this._blurY.record(true);
|
|
113
113
|
const sourceTextureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture);
|
|
114
|
-
this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.
|
|
114
|
+
this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture, this._merge.name, sourceTextureCreationOptions);
|
|
115
115
|
this._merge.sourceTexture = this.sourceTexture;
|
|
116
116
|
this._merge.sourceSamplingMode = this.sourceSamplingMode;
|
|
117
117
|
this._merge.blurTexture = blurYTextureHandle;
|
|
118
|
-
this._merge.
|
|
118
|
+
this._merge.targetTexture = this.outputTexture;
|
|
119
119
|
this._merge.record(true);
|
|
120
120
|
const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
|
|
121
121
|
passDisabled.addDependencies(this.sourceTexture);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bloomTask.js","sourceRoot":"","sources":["../../../../../../dev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,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureCreationOptions, FrameGraphTextureHandle } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphBloomMergeTask } from \"./bloomMergeTask\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\nimport { ThinBloomEffect } from \"core/PostProcesses/thinBloomEffect\";\r\nimport { FrameGraphExtractHighlightsTask } from \"./extractHighlightsTask\";\r\nimport { FrameGraphBlurTask } from \"./blurTask\";\r\n\r\n/**\r\n * Task which applies a bloom render effect.\r\n */\r\nexport class FrameGraphBloomTask extends FrameGraphTask {\r\n /**\r\n * The source texture to apply the bloom effect on.\r\n */\r\n public sourceTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The sampling mode to use for the source texture.\r\n */\r\n public sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n /**\r\n * The destination texture to render the bloom effect to.\r\n * If not supplied, a texture with the same configuration as the source texture will be created.\r\n */\r\n public destinationTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture of the bloom effect.\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The bloom effect to apply.\r\n */\r\n public readonly bloom: ThinBloomEffect;\r\n\r\n /**\r\n * Whether the bloom effect is HDR.\r\n * When true, the bloom effect will use a higher precision texture format (half float or float). Else, it will use unsigned byte.\r\n */\r\n public readonly hdr: boolean;\r\n\r\n /**\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._downscale) {\r\n this._downscale.name = `${name} Downscale`;\r\n }\r\n\r\n if (this._blurX) {\r\n this._blurX.name = `${name} Blur X`;\r\n }\r\n\r\n if (this._blurY) {\r\n this._blurY.name = `${name} Blur Y`;\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 _downscale: FrameGraphExtractHighlightsTask;\r\n private readonly _blurX: FrameGraphBlurTask;\r\n private readonly _blurY: FrameGraphBlurTask;\r\n private readonly _merge: FrameGraphBloomMergeTask;\r\n private readonly _defaultPipelineTextureType: number;\r\n\r\n /**\r\n * Constructs a new bloom task.\r\n * @param name Name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param weight Weight of the bloom effect.\r\n * @param kernel Kernel size of the bloom effect.\r\n * @param threshold Threshold of the bloom effect.\r\n * @param hdr Whether the bloom effect is HDR.\r\n * @param bloomScale The scale of the bloom effect. This value is multiplied by the source texture size to determine the bloom texture size.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, weight: number, kernel: number, threshold: number, hdr = false, bloomScale = 0.5) {\r\n super(name, frameGraph);\r\n\r\n this.hdr = hdr;\r\n\r\n this._defaultPipelineTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n if (hdr) {\r\n const caps = 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.bloom = new ThinBloomEffect(name, frameGraph.engine, bloomScale);\r\n this.bloom.threshold = threshold;\r\n this.bloom.kernel = kernel;\r\n this.bloom.weight = weight;\r\n\r\n this._downscale = new FrameGraphExtractHighlightsTask(`${name} Downscale`, this._frameGraph, this.bloom._downscale);\r\n this._blurX = new FrameGraphBlurTask(`${name} Blur X`, this._frameGraph, this.bloom._blurX);\r\n this._blurY = new FrameGraphBlurTask(`${name} Blur Y`, this._frameGraph, this.bloom._blurY);\r\n this._merge = new FrameGraphBloomMergeTask(`${name} Merge`, this._frameGraph, this.bloom._merge);\r\n\r\n this.onTexturesAllocatedObservable.add((context) => {\r\n this._downscale.onTexturesAllocatedObservable.notifyObservers(context);\r\n this._blurX.onTexturesAllocatedObservable.notifyObservers(context);\r\n this._blurY.onTexturesAllocatedObservable.notifyObservers(context);\r\n this._merge.onTexturesAllocatedObservable.notifyObservers(context);\r\n });\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public override isReady() {\r\n return this.bloom.isReady();\r\n }\r\n\r\n public record(): void {\r\n if (this.sourceTexture === undefined) {\r\n throw new Error(\"FrameGraphBloomTask: sourceTexture is required\");\r\n }\r\n\r\n const sourceTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.sourceTexture);\r\n\r\n const textureCreationOptions: FrameGraphTextureCreationOptions = {\r\n size: {\r\n width: Math.floor(sourceTextureDescription.size.width * this.bloom.scale),\r\n height: Math.floor(sourceTextureDescription.size.height * this.bloom.scale),\r\n },\r\n options: {\r\n createMipMaps: false,\r\n types: [this._defaultPipelineTextureType],\r\n formats: [Constants.TEXTUREFORMAT_RGBA],\r\n samples: 1,\r\n useSRGBBuffers: [false],\r\n labels: [\"\"],\r\n },\r\n sizeIsPercentage: false,\r\n };\r\n\r\n const downscaleTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._downscale.name, textureCreationOptions);\r\n\r\n this._downscale.sourceTexture = this.sourceTexture;\r\n this._downscale.sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._downscale.destinationTexture = downscaleTextureHandle;\r\n this._downscale.record(true);\r\n\r\n const blurXTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurX.name, textureCreationOptions);\r\n\r\n this._blurX.sourceTexture = downscaleTextureHandle;\r\n this._blurX.sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurX.destinationTexture = blurXTextureHandle;\r\n this._blurX.record(true);\r\n\r\n const blurYTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurY.name, textureCreationOptions);\r\n\r\n this._blurY.sourceTexture = blurXTextureHandle;\r\n this._blurY.sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurY.destinationTexture = blurYTextureHandle;\r\n this._blurY.record(true);\r\n\r\n const sourceTextureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture);\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.destinationTexture, this._merge.name, sourceTextureCreationOptions);\r\n\r\n this._merge.sourceTexture = this.sourceTexture;\r\n this._merge.sourceSamplingMode = this.sourceSamplingMode;\r\n this._merge.blurTexture = blurYTextureHandle;\r\n this._merge.destinationTexture = this.outputTexture;\r\n this._merge.record(true);\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.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._downscale.dispose();\r\n this._blurX.dispose();\r\n this._blurY.dispose();\r\n this._merge.dispose();\r\n super.dispose();\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"bloomTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/bloomTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,sCAA+B;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,kDAA2C;AACrE,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,E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,cAAc,CAAC,qBAAqB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,4BAA4B,CAAC,CAAC;QAE9I,IAAI,CAAC,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;QACzD,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEzB,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEjD,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,YAAY,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YACpC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACP,CAAC;IAEe,OAAO;QACnB,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QAC1B,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphTextureCreationOptions, FrameGraphTextureHandle } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphBloomMergeTask } from \"./bloomMergeTask\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\nimport { ThinBloomEffect } from \"core/PostProcesses/thinBloomEffect\";\r\nimport { FrameGraphExtractHighlightsTask } from \"./extractHighlightsTask\";\r\nimport { FrameGraphBlurTask } from \"./blurTask\";\r\n\r\n/**\r\n * Task which applies a bloom render effect.\r\n */\r\nexport class FrameGraphBloomTask extends FrameGraphTask {\r\n /**\r\n * The source texture to apply the bloom effect on.\r\n */\r\n public sourceTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The sampling mode to use for the source texture.\r\n */\r\n public sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n\r\n /**\r\n * The target texture to render the bloom effect to.\r\n * If not supplied, a texture with the same configuration as the source texture will be created.\r\n */\r\n public targetTexture?: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The output texture of the bloom effect.\r\n */\r\n public readonly outputTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The bloom effect to apply.\r\n */\r\n public readonly bloom: ThinBloomEffect;\r\n\r\n /**\r\n * Whether the bloom effect is HDR.\r\n * When true, the bloom effect will use a higher precision texture format (half float or float). Else, it will use unsigned byte.\r\n */\r\n public readonly hdr: boolean;\r\n\r\n /**\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._downscale) {\r\n this._downscale.name = `${name} Downscale`;\r\n }\r\n\r\n if (this._blurX) {\r\n this._blurX.name = `${name} Blur X`;\r\n }\r\n\r\n if (this._blurY) {\r\n this._blurY.name = `${name} Blur Y`;\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 _downscale: FrameGraphExtractHighlightsTask;\r\n private readonly _blurX: FrameGraphBlurTask;\r\n private readonly _blurY: FrameGraphBlurTask;\r\n private readonly _merge: FrameGraphBloomMergeTask;\r\n private readonly _defaultPipelineTextureType: number;\r\n\r\n /**\r\n * Constructs a new bloom task.\r\n * @param name Name of the task.\r\n * @param frameGraph The frame graph this task is associated with.\r\n * @param weight Weight of the bloom effect.\r\n * @param kernel Kernel size of the bloom effect.\r\n * @param threshold Threshold of the bloom effect.\r\n * @param hdr Whether the bloom effect is HDR.\r\n * @param bloomScale The scale of the bloom effect. This value is multiplied by the source texture size to determine the bloom texture size.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, weight: number, kernel: number, threshold: number, hdr = false, bloomScale = 0.5) {\r\n super(name, frameGraph);\r\n\r\n this.hdr = hdr;\r\n\r\n this._defaultPipelineTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n if (hdr) {\r\n const caps = 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.bloom = new ThinBloomEffect(name, frameGraph.engine, bloomScale);\r\n this.bloom.threshold = threshold;\r\n this.bloom.kernel = kernel;\r\n this.bloom.weight = weight;\r\n\r\n this._downscale = new FrameGraphExtractHighlightsTask(`${name} Downscale`, this._frameGraph, this.bloom._downscale);\r\n this._blurX = new FrameGraphBlurTask(`${name} Blur X`, this._frameGraph, this.bloom._blurX);\r\n this._blurY = new FrameGraphBlurTask(`${name} Blur Y`, this._frameGraph, this.bloom._blurY);\r\n this._merge = new FrameGraphBloomMergeTask(`${name} Merge`, this._frameGraph, this.bloom._merge);\r\n\r\n this.onTexturesAllocatedObservable.add((context) => {\r\n this._downscale.onTexturesAllocatedObservable.notifyObservers(context);\r\n this._blurX.onTexturesAllocatedObservable.notifyObservers(context);\r\n this._blurY.onTexturesAllocatedObservable.notifyObservers(context);\r\n this._merge.onTexturesAllocatedObservable.notifyObservers(context);\r\n });\r\n\r\n this.outputTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n public override isReady() {\r\n return this.bloom.isReady();\r\n }\r\n\r\n public record(): void {\r\n if (this.sourceTexture === undefined) {\r\n throw new Error(\"FrameGraphBloomTask: sourceTexture is required\");\r\n }\r\n\r\n const sourceTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.sourceTexture);\r\n\r\n const textureCreationOptions: FrameGraphTextureCreationOptions = {\r\n size: {\r\n width: Math.floor(sourceTextureDescription.size.width * this.bloom.scale),\r\n height: Math.floor(sourceTextureDescription.size.height * this.bloom.scale),\r\n },\r\n options: {\r\n createMipMaps: false,\r\n types: [this._defaultPipelineTextureType],\r\n formats: [Constants.TEXTUREFORMAT_RGBA],\r\n samples: 1,\r\n useSRGBBuffers: [false],\r\n labels: [\"\"],\r\n },\r\n sizeIsPercentage: false,\r\n };\r\n\r\n const downscaleTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._downscale.name, textureCreationOptions);\r\n\r\n this._downscale.sourceTexture = this.sourceTexture;\r\n this._downscale.sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._downscale.targetTexture = downscaleTextureHandle;\r\n this._downscale.record(true);\r\n\r\n const blurXTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurX.name, textureCreationOptions);\r\n\r\n this._blurX.sourceTexture = downscaleTextureHandle;\r\n this._blurX.sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurX.targetTexture = blurXTextureHandle;\r\n this._blurX.record(true);\r\n\r\n const blurYTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurY.name, textureCreationOptions);\r\n\r\n this._blurY.sourceTexture = blurXTextureHandle;\r\n this._blurY.sourceSamplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE;\r\n this._blurY.targetTexture = blurYTextureHandle;\r\n this._blurY.record(true);\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.blurTexture = blurYTextureHandle;\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._downscale.dispose();\r\n this._blurX.dispose();\r\n this._blurY.dispose();\r\n this._merge.dispose();\r\n super.dispose();\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FrameGraph, FrameGraphRenderContext, FrameGraphRenderPass } from "../../../index.js";
|
|
2
|
+
import { ThinChromaticAberrationPostProcess } from "../../../PostProcesses/thinChromaticAberrationPostProcess.js";
|
|
3
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask";
|
|
4
|
+
/**
|
|
5
|
+
* Task which applies a chromatic aberration post process.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FrameGraphChromaticAberrationTask extends FrameGraphPostProcessTask {
|
|
8
|
+
readonly postProcess: ThinChromaticAberrationPostProcess;
|
|
9
|
+
/**
|
|
10
|
+
* Constructs a new chromatic aberration task.
|
|
11
|
+
* @param name The name of the task.
|
|
12
|
+
* @param frameGraph The frame graph this task is associated with.
|
|
13
|
+
* @param thinPostProcess The thin post process to use for the chromatic aberration effect. If not provided, a new one will be created.
|
|
14
|
+
*/
|
|
15
|
+
constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinChromaticAberrationPostProcess);
|
|
16
|
+
record(skipCreationOfDisabledPasses?: boolean, additionalExecute?: (context: FrameGraphRenderContext) => void, additionalBindings?: (context: FrameGraphRenderContext) => void): FrameGraphRenderPass;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ThinChromaticAberrationPostProcess } from "../../../PostProcesses/thinChromaticAberrationPostProcess.js";
|
|
2
|
+
import { FrameGraphPostProcessTask } from "./postProcessTask.js";
|
|
3
|
+
/**
|
|
4
|
+
* Task which applies a chromatic aberration post process.
|
|
5
|
+
*/
|
|
6
|
+
export class FrameGraphChromaticAberrationTask extends FrameGraphPostProcessTask {
|
|
7
|
+
/**
|
|
8
|
+
* Constructs a new chromatic aberration task.
|
|
9
|
+
* @param name The name of the task.
|
|
10
|
+
* @param frameGraph The frame graph this task is associated with.
|
|
11
|
+
* @param thinPostProcess The thin post process to use for the chromatic aberration effect. If not provided, a new one will be created.
|
|
12
|
+
*/
|
|
13
|
+
constructor(name, frameGraph, thinPostProcess) {
|
|
14
|
+
super(name, frameGraph, thinPostProcess || new ThinChromaticAberrationPostProcess(name, frameGraph.engine));
|
|
15
|
+
}
|
|
16
|
+
record(skipCreationOfDisabledPasses = false, additionalExecute, additionalBindings) {
|
|
17
|
+
const pass = super.record(skipCreationOfDisabledPasses, additionalExecute, additionalBindings);
|
|
18
|
+
this.postProcess.screenWidth = this._sourceWidth;
|
|
19
|
+
this.postProcess.screenHeight = this._sourceHeight;
|
|
20
|
+
return pass;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=chromaticAberrationTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chromaticAberrationTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kCAAkC,EAAE,qEAA8D;AAC3G,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,MAAM,OAAO,iCAAkC,SAAQ,yBAAyB;IAG5E;;;;;OAKG;IACH,YAAY,IAAY,EAAE,UAAsB,EAAE,eAAoD;QAClG,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,IAAI,IAAI,kCAAkC,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAChH,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,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC;QACjD,IAAI,CAAC,WAAW,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC;QAEnD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { FrameGraph, FrameGraphRenderContext, FrameGraphRenderPass } from \"core/index\";\r\nimport { ThinChromaticAberrationPostProcess } from \"core/PostProcesses/thinChromaticAberrationPostProcess\";\r\nimport { FrameGraphPostProcessTask } from \"./postProcessTask\";\r\n\r\n/**\r\n * Task which applies a chromatic aberration post process.\r\n */\r\nexport class FrameGraphChromaticAberrationTask extends FrameGraphPostProcessTask {\r\n public override readonly postProcess: ThinChromaticAberrationPostProcess;\r\n\r\n /**\r\n * Constructs a new chromatic aberration 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 chromatic aberration effect. If not provided, a new one will be created.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, thinPostProcess?: ThinChromaticAberrationPostProcess) {\r\n super(name, frameGraph, thinPostProcess || new ThinChromaticAberrationPostProcess(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.screenWidth = this._sourceWidth;\r\n this.postProcess.screenHeight = this._sourceHeight;\r\n\r\n return pass;\r\n }\r\n}\r\n"]}
|
|
@@ -28,9 +28,9 @@ export declare class FrameGraphDepthOfFieldTask extends FrameGraphTask {
|
|
|
28
28
|
*/
|
|
29
29
|
camera: Camera;
|
|
30
30
|
/**
|
|
31
|
-
* The
|
|
31
|
+
* The target texture to render the depth of field effect to.
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
targetTexture?: FrameGraphTextureHandle;
|
|
34
34
|
/**
|
|
35
35
|
* The output texture of the depth of field effect.
|
|
36
36
|
*/
|
|
@@ -108,7 +108,7 @@ export class FrameGraphDepthOfFieldTask extends FrameGraphTask {
|
|
|
108
108
|
this._circleOfConfusion.depthTexture = this.depthTexture;
|
|
109
109
|
this._circleOfConfusion.depthSamplingMode = this.depthSamplingMode;
|
|
110
110
|
this._circleOfConfusion.camera = this.camera;
|
|
111
|
-
this._circleOfConfusion.
|
|
111
|
+
this._circleOfConfusion.targetTexture = circleOfConfusionTextureHandle;
|
|
112
112
|
this._circleOfConfusion.record(true);
|
|
113
113
|
textureCreationOptions.options.formats = [5];
|
|
114
114
|
const blurSteps = [];
|
|
@@ -121,23 +121,23 @@ export class FrameGraphDepthOfFieldTask extends FrameGraphTask {
|
|
|
121
121
|
this._blurY[i].sourceTexture = i === 0 ? this.sourceTexture : this._blurX[i - 1].outputTexture;
|
|
122
122
|
this._blurY[i].sourceSamplingMode = 2;
|
|
123
123
|
this._blurY[i].circleOfConfusionTexture = circleOfConfusionTextureHandle;
|
|
124
|
-
this._blurY[i].
|
|
124
|
+
this._blurY[i].targetTexture = blurYTextureHandle;
|
|
125
125
|
this._blurY[i].record(true);
|
|
126
126
|
const blurXTextureHandle = this._frameGraph.textureManager.createRenderTargetTexture(this._blurX[i].name, textureCreationOptions);
|
|
127
127
|
this._blurX[i].sourceTexture = this._blurY[i].outputTexture;
|
|
128
128
|
this._blurX[i].sourceSamplingMode = 2;
|
|
129
129
|
this._blurX[i].circleOfConfusionTexture = circleOfConfusionTextureHandle;
|
|
130
|
-
this._blurX[i].
|
|
130
|
+
this._blurX[i].targetTexture = blurXTextureHandle;
|
|
131
131
|
this._blurX[i].record(true);
|
|
132
132
|
blurSteps.push(blurXTextureHandle);
|
|
133
133
|
}
|
|
134
134
|
const sourceTextureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture);
|
|
135
|
-
this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.
|
|
135
|
+
this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture, this._merge.name, sourceTextureCreationOptions);
|
|
136
136
|
this._merge.sourceTexture = this.sourceTexture;
|
|
137
137
|
this._merge.sourceSamplingMode = this.sourceSamplingMode;
|
|
138
138
|
this._merge.circleOfConfusionTexture = circleOfConfusionTextureHandle;
|
|
139
139
|
this._merge.blurSteps = blurSteps;
|
|
140
|
-
this._merge.
|
|
140
|
+
this._merge.targetTexture = this.outputTexture;
|
|
141
141
|
this._merge.record(true);
|
|
142
142
|
const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
|
|
143
143
|
passDisabled.addDependencies(this.sourceTexture);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depthOfFieldTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.ts"],"names":[],"mappings":"AAEA,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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wBAAwB,GAAG,8BAA8B,CAAC;QACtE,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;QAClC,IAAI,CAAC,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC,aAAa,CAAC;QACpD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEzB,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEjD,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,YAAY,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YACpC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACP,CAAC;IAEe,OAAO;QACnB,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC;QAClC,KAAK,IAAI,CAAC,GAAG,CAAC,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":["// eslint-disable-next-line import/no-internal-modules\r\nimport 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 destination texture to render the depth of field effect to.\r\n */\r\n public destinationTexture?: 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.onTexturesAllocatedObservable.add((context) => {\r\n this._circleOfConfusion.onTexturesAllocatedObservable.notifyObservers(context);\r\n for (let i = 0; i < blurCount; i++) {\r\n this._blurX[i].onTexturesAllocatedObservable.notifyObservers(context);\r\n this._blurY[i].onTexturesAllocatedObservable.notifyObservers(context);\r\n }\r\n this._merge.onTexturesAllocatedObservable.notifyObservers(context);\r\n });\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.destinationTexture = 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);\r\n textureSize.height = Math.floor(sourceTextureDescription.size.height * ratio);\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].destinationTexture = 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].destinationTexture = 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.destinationTexture, this._merge.name, sourceTextureCreationOptions);\r\n\r\n this._merge.sourceTexture = this.sourceTexture;\r\n this._merge.sourceSamplingMode = this.sourceSamplingMode;\r\n this._merge.circleOfConfusionTexture = circleOfConfusionTextureHandle;\r\n this._merge.blurSteps = blurSteps;\r\n this._merge.destinationTexture = this.outputTexture;\r\n this._merge.record(true);\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.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":"AAEA,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;QAC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Y,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnF,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAEjD,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,YAAY,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,EAAE;YACpC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACP,CAAC;IAEe,OAAO;QACnB,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC;QAClC,KAAK,IAAI,CAAC,GAAG,CAAC,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":["// eslint-disable-next-line import/no-internal-modules\r\nimport 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.onTexturesAllocatedObservable.add((context) => {\r\n this._circleOfConfusion.onTexturesAllocatedObservable.notifyObservers(context);\r\n for (let i = 0; i < blurCount; i++) {\r\n this._blurX[i].onTexturesAllocatedObservable.notifyObservers(context);\r\n this._blurY[i].onTexturesAllocatedObservable.notifyObservers(context);\r\n }\r\n this._merge.onTexturesAllocatedObservable.notifyObservers(context);\r\n });\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);\r\n textureSize.height = Math.floor(sourceTextureDescription.size.height * ratio);\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,10 +13,10 @@ export declare class FrameGraphPostProcessTask extends FrameGraphTask {
|
|
|
13
13
|
*/
|
|
14
14
|
sourceSamplingMode: number;
|
|
15
15
|
/**
|
|
16
|
-
* The
|
|
16
|
+
* The target texture to render the post process to.
|
|
17
17
|
* If not supplied, a texture with the same configuration as the source texture will be created.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
targetTexture?: FrameGraphTextureHandle;
|
|
20
20
|
/**
|
|
21
21
|
* The output texture of the post process.
|
|
22
22
|
*/
|
|
@@ -39,7 +39,7 @@ export class FrameGraphPostProcessTask extends FrameGraphTask {
|
|
|
39
39
|
}
|
|
40
40
|
const sourceTextureCreationOptions = this._frameGraph.textureManager.getTextureCreationOptions(this.sourceTexture);
|
|
41
41
|
sourceTextureCreationOptions.options.samples = 1;
|
|
42
|
-
this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.
|
|
42
|
+
this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, this.targetTexture, this.name, sourceTextureCreationOptions);
|
|
43
43
|
const sourceSize = !sourceTextureCreationOptions.sizeIsPercentage
|
|
44
44
|
? textureSizeIsObject(sourceTextureCreationOptions.size)
|
|
45
45
|
? sourceTextureCreationOptions.size
|