@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":"chromaticAberrationPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/chromaticAberrationPostProcess.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"chromaticAberrationPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/chromaticAberrationPostProcess.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AAE1F;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,WAAW;IAC3D;;OAEG;IAEH,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC;IAChD,CAAC;IAED,IAAW,gBAAgB,CAAC,KAAa;QACrC,IAAI,CAAC,cAAc,CAAC,gBAAgB,GAAG,KAAK,CAAC;IACjD,CAAC;IAED;;OAEG;IAEH,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC;IAC/C,CAAC;IAED,IAAW,eAAe,CAAC,KAAa;QACpC,IAAI,CAAC,cAAc,CAAC,eAAe,GAAG,KAAK,CAAC;IAChD,CAAC;IAED;;OAEG;IAEH,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;IACzC,CAAC;IAED,IAAW,SAAS,CAAC,KAAc;QAC/B,IAAI,CAAC,cAAc,CAAC,SAAS,GAAG,KAAK,CAAC;IAC1C,CAAC;IAED;;OAEG;IAEH,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC;IAC9C,CAAC;IAED,IAAW,cAAc,CAAC,KAAc;QACpC,IAAI,CAAC,cAAc,CAAC,cA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AAC;QAC/B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;IAED;;OAEG;IACI,MAAM,CAAU,MAAM,CAAC,iBAAsB,EAAE,YAAoB,EAAE,KAAY,EAAE,OAAe;QACrG,OAAO,mBAAmB,CAAC,KAAK,CAC5B,GAAG,EAAE;YACD,OAAO,IAAI,8BAA8B,CACrC,iBAAiB,CAAC,IAAI,EACtB,iBAAiB,CAAC,WAAW,EAC7B,iBAAiB,CAAC,YAAY,EAC9B,iBAAiB,CAAC,OAAO,EACzB,YAAY,EACZ,iBAAiB,CAAC,wBAAwB,EAC1C,KAAK,CAAC,SAAS,EAAE,EACjB,iBAAiB,CAAC,QAAQ,EAC1B,iBAAiB,CAAC,WAAW,EAC7B,KAAK,CACR,CAAC;QACN,CAAC,EACD,iBAAiB,EACjB,KAAK,EACL,OAAO,CACV,CAAC;IACN,CAAC;CACJ;AAhJG;IADC,SAAS,EAAE;sEAGX;AAUD;IADC,SAAS,EAAE;qEAGX;AAUD;IADC,SAAS,EAAE;+DAGX;AAUD;IADC,SAAS,EAAE;oEAGX;AAQD;IADC,SAAS,EAAE;iEAGX;AAQD;IADC,SAAS,EAAE;kEAGX;AAwFL,aAAa,CAAC,wCAAwC,EAAE,8BAA8B,CAAC,CAAC","sourcesContent":["import type { Vector2 } from \"../Maths/math.vector\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\n\r\nimport type { Scene } from \"../scene\";\r\nimport { ThinChromaticAberrationPostProcess } from \"./thinChromaticAberrationPostProcess\";\r\n\r\n/**\r\n * The ChromaticAberrationPostProcess separates the rgb channels in an image to produce chromatic distortion around the edges of the screen\r\n */\r\nexport class ChromaticAberrationPostProcess extends PostProcess {\r\n /**\r\n * The amount of separation of rgb channels (default: 30)\r\n */\r\n @serialize()\r\n public get aberrationAmount() {\r\n return this._effectWrapper.aberrationAmount;\r\n }\r\n\r\n public set aberrationAmount(value: number) {\r\n this._effectWrapper.aberrationAmount = value;\r\n }\r\n\r\n /**\r\n * The amount the effect will increase for pixels closer to the edge of the screen. (default: 0)\r\n */\r\n @serialize()\r\n public get radialIntensity() {\r\n return this._effectWrapper.radialIntensity;\r\n }\r\n\r\n public set radialIntensity(value: number) {\r\n this._effectWrapper.radialIntensity = value;\r\n }\r\n\r\n /**\r\n * The normalized direction in which the rgb channels should be separated. If set to 0,0 radial direction will be used. (default: Vector2(0.707,0.707))\r\n */\r\n @serialize()\r\n public get direction() {\r\n return this._effectWrapper.direction;\r\n }\r\n\r\n public set direction(value: Vector2) {\r\n this._effectWrapper.direction = value;\r\n }\r\n\r\n /**\r\n * The center position where the radialIntensity should be around. [0.5,0.5 is center of screen, 1,1 is top right corner] (default: Vector2(0.5 ,0.5))\r\n */\r\n @serialize()\r\n public get centerPosition() {\r\n return this._effectWrapper.centerPosition;\r\n }\r\n\r\n public set centerPosition(value: Vector2) {\r\n this._effectWrapper.centerPosition = value;\r\n }\r\n\r\n /** The width of the screen to apply the effect on */\r\n @serialize()\r\n public get screenWidth() {\r\n return this._effectWrapper.screenWidth;\r\n }\r\n\r\n public set screenWidth(value: number) {\r\n this._effectWrapper.screenWidth = value;\r\n }\r\n\r\n /** The height of the screen to apply the effect on */\r\n @serialize()\r\n public get screenHeight() {\r\n return this._effectWrapper.screenHeight;\r\n }\r\n\r\n public set screenHeight(value: number) {\r\n this._effectWrapper.screenHeight = value;\r\n }\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"ChromaticAberrationPostProcess\" string\r\n */\r\n public override getClassName(): string {\r\n return \"ChromaticAberrationPostProcess\";\r\n }\r\n\r\n protected override _effectWrapper: ThinChromaticAberrationPostProcess;\r\n\r\n /**\r\n * Creates a new instance ChromaticAberrationPostProcess\r\n * @param name The name of the effect.\r\n * @param screenWidth The width of the screen to apply the effect on.\r\n * @param screenHeight The height of the screen to apply the effect on.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n */\r\n constructor(\r\n name: string,\r\n screenWidth: number,\r\n screenHeight: number,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: AbstractEngine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n blockCompilation = false\r\n ) {\r\n const localOptions = {\r\n uniforms: ThinChromaticAberrationPostProcess.Uniforms,\r\n size: typeof options === \"number\" ? options : undefined,\r\n camera,\r\n samplingMode,\r\n engine,\r\n reusable,\r\n textureType,\r\n blockCompilation,\r\n ...(options as PostProcessOptions),\r\n };\r\n\r\n super(name, ThinChromaticAberrationPostProcess.FragmentUrl, {\r\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinChromaticAberrationPostProcess(name, engine, localOptions) : undefined,\r\n ...localOptions,\r\n });\r\n\r\n this.screenWidth = screenWidth;\r\n this.screenHeight = screenHeight;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static override _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<ChromaticAberrationPostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new ChromaticAberrationPostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.screenWidth,\r\n parsedPostProcess.screenHeight,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable,\r\n parsedPostProcess.textureType,\r\n false\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ChromaticAberrationPostProcess\", ChromaticAberrationPostProcess);\r\n"]}
|
package/PostProcesses/index.d.ts
CHANGED
|
@@ -31,9 +31,11 @@ export * from "./vrDistortionCorrectionPostProcess";
|
|
|
31
31
|
export * from "./vrMultiviewToSingleviewPostProcess";
|
|
32
32
|
export * from "./screenSpaceReflectionPostProcess";
|
|
33
33
|
export * from "./screenSpaceCurvaturePostProcess";
|
|
34
|
+
export * from "./thinAnaglyphPostProcess";
|
|
34
35
|
export * from "./thinBlackAndWhitePostProcess";
|
|
35
36
|
export * from "./thinBloomEffect";
|
|
36
37
|
export * from "./thinBlurPostProcess";
|
|
38
|
+
export * from "./thinChromaticAberrationPostProcess";
|
|
37
39
|
export * from "./thinCircleOfConfusionPostProcess";
|
|
38
40
|
export * from "./thinDepthOfFieldEffect";
|
|
39
41
|
export * from "./thinExtractHighlightsPostProcess";
|
package/PostProcesses/index.js
CHANGED
|
@@ -32,9 +32,11 @@ export * from "./vrDistortionCorrectionPostProcess.js";
|
|
|
32
32
|
export * from "./vrMultiviewToSingleviewPostProcess.js";
|
|
33
33
|
export * from "./screenSpaceReflectionPostProcess.js";
|
|
34
34
|
export * from "./screenSpaceCurvaturePostProcess.js";
|
|
35
|
+
export * from "./thinAnaglyphPostProcess.js";
|
|
35
36
|
export * from "./thinBlackAndWhitePostProcess.js";
|
|
36
37
|
export * from "./thinBloomEffect.js";
|
|
37
38
|
export * from "./thinBlurPostProcess.js";
|
|
39
|
+
export * from "./thinChromaticAberrationPostProcess.js";
|
|
38
40
|
export * from "./thinCircleOfConfusionPostProcess.js";
|
|
39
41
|
export * from "./thinDepthOfFieldEffect.js";
|
|
40
42
|
export * from "./thinExtractHighlightsPostProcess.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAElD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAA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cAAc,qCAAqC,CAAC;AAEpD,mBAAmB;AACnB,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AAExD,cAAc;AACd,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,SAAS;AACT,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAE/C,aAAa;AACb,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,UAAU;AACV,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AAEpD,UAAU;AACV,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./anaglyphPostProcess\";\r\nexport * from \"./blackAndWhitePostProcess\";\r\nexport * from \"./bloomEffect\";\r\nexport * from \"./bloomMergePostProcess\";\r\nexport * from \"./blurPostProcess\";\r\nexport * from \"./chromaticAberrationPostProcess\";\r\nexport * from \"./circleOfConfusionPostProcess\";\r\nexport * from \"./colorCorrectionPostProcess\";\r\nexport * from \"./convolutionPostProcess\";\r\nexport * from \"./depthOfFieldBlurPostProcess\";\r\nexport * from \"./depthOfFieldEffect\";\r\nexport * from \"./depthOfFieldMergePostProcess\";\r\nexport * from \"./displayPassPostProcess\";\r\nexport * from \"./extractHighlightsPostProcess\";\r\nexport * from \"./filterPostProcess\";\r\nexport * from \"./fxaaPostProcess\";\r\nexport * from \"./grainPostProcess\";\r\nexport * from \"./highlightsPostProcess\";\r\nexport * from \"./imageProcessingPostProcess\";\r\nexport * from \"./motionBlurPostProcess\";\r\nexport * from \"./passPostProcess\";\r\nexport * from \"./postProcess\";\r\nexport * from \"./postProcessManager\";\r\nexport * from \"./refractionPostProcess\";\r\nexport * from \"./RenderPipeline/index\";\r\nexport * from \"./sharpenPostProcess\";\r\nexport * from \"./stereoscopicInterlacePostProcess\";\r\nexport * from \"./tonemapPostProcess\";\r\nexport * from \"./volumetricLightScatteringPostProcess\";\r\nexport * from \"./vrDistortionCorrectionPostProcess\";\r\nexport * from \"./vrMultiviewToSingleviewPostProcess\";\r\nexport * from \"./screenSpaceReflectionPostProcess\";\r\nexport * from \"./screenSpaceCurvaturePostProcess\";\r\n\r\nexport * from \"./thinBlackAndWhitePostProcess\";\r\nexport * from \"./thinBloomEffect\";\r\nexport * from \"./thinBlurPostProcess\";\r\nexport * from \"./thinCircleOfConfusionPostProcess\";\r\nexport * from \"./thinDepthOfFieldEffect\";\r\nexport * from \"./thinExtractHighlightsPostProcess\";\r\nexport * from \"./thinPassPostProcess\";\r\n\r\n// Postprocess\r\nexport * from \"../Shaders/postprocess.vertex\";\r\nexport * from \"../ShadersWGSL/postprocess.vertex\";\r\n\r\n// Blur postprocess\r\nexport * from \"../Shaders/kernelBlur.fragment\";\r\nexport * from \"../Shaders/kernelBlur.vertex\";\r\nexport * from \"../ShadersWGSL/kernelBlur.fragment\";\r\nexport * from \"../ShadersWGSL/kernelBlur.vertex\";\r\n\r\n// Pass postprocess\r\nexport * from \"../Shaders/pass.fragment\";\r\nexport * from \"../Shaders/passCube.fragment\";\r\nexport * from \"../ShadersWGSL/pass.fragment\";\r\nexport * from \"../ShadersWGSL/passCube.fragment\";\r\n\r\n// vrDFistortionCorrection postprocess\r\nexport * from \"../Shaders/vrDistortionCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/vrDistortionCorrection.fragment\";\r\n\r\n// Image processing postprocess\r\nexport * from \"../ShadersWGSL/imageProcessing.fragment\";\r\nexport * from \"../Shaders/imageProcessing.fragment\";\r\n\r\n// Sharpen\r\nexport * from \"../Shaders/sharpen.fragment\";\r\nexport * from \"../ShadersWGSL/sharpen.fragment\";\r\n\r\n// Grain\r\nexport * from \"../Shaders/grain.fragment\";\r\nexport * from \"../ShadersWGSL/grain.fragment\";\r\n\r\n// Chromatic Aberration\r\nexport * from \"../Shaders/chromaticAberration.fragment\";\r\nexport * from \"../ShadersWGSL/chromaticAberration.fragment\";\r\n\r\n// Depth of field merge\r\nexport * from \"../Shaders/depthOfFieldMerge.fragment\";\r\nexport * from \"../ShadersWGSL/depthOfFieldMerge.fragment\";\r\n\r\n// Circle of confusion\r\nexport * from \"../Shaders/circleOfConfusion.fragment\";\r\nexport * from \"../ShadersWGSL/circleOfConfusion.fragment\";\r\n\r\n// Bloom\r\nexport * from \"../Shaders/bloomMerge.fragment\";\r\nexport * from \"../ShadersWGSL/bloomMerge.fragment\";\r\n\r\n// Extract highlights\r\nexport * from \"../Shaders/extractHighlights.fragment\";\r\nexport * from \"../ShadersWGSL/extractHighlights.fragment\";\r\n\r\n// FXAA\r\nexport * from \"../Shaders/fxaa.fragment\";\r\nexport * from \"../Shaders/fxaa.vertex\";\r\nexport * from \"../ShadersWGSL/fxaa.fragment\";\r\nexport * from \"../ShadersWGSL/fxaa.vertex\";\r\n\r\n// B&W\r\nexport * from \"../Shaders/blackAndWhite.fragment\";\r\nexport * from \"../ShadersWGSL/blackAndWhite.fragment\";\r\n\r\n// Anaglyph\r\nexport * from \"../Shaders/anaglyph.fragment\";\r\nexport * from \"../ShadersWGSL/anaglyph.fragment\";\r\n\r\n// Convolution\r\nexport * from \"../Shaders/convolution.fragment\";\r\nexport * from \"../ShadersWGSL/convolution.fragment\";\r\n\r\n// Color correction\r\nexport * from \"../Shaders/colorCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/colorCorrection.fragment\";\r\n\r\n// Motion blur\r\nexport * from \"../Shaders/motionBlur.fragment\";\r\nexport * from \"../ShadersWGSL/motionBlur.fragment\";\r\n\r\n// Filter\r\nexport * from \"../Shaders/filter.fragment\";\r\nexport * from \"../ShadersWGSL/filter.fragment\";\r\n\r\n// Highlights\r\nexport * from \"../Shaders/highlights.fragment\";\r\nexport * from \"../ShadersWGSL/highlights.fragment\";\r\n\r\n// Display\r\nexport * from \"../Shaders/displayPass.fragment\";\r\nexport * from \"../ShadersWGSL/displayPass.fragment\";\r\n\r\n// Tonemap\r\nexport * from \"../Shaders/tonemap.fragment\";\r\nexport * from \"../ShadersWGSL/tonemap.fragment\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAElD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cA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Ac;AACd,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AAEpD,mBAAmB;AACnB,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AAExD,cAAc;AACd,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,SAAS;AACT,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAE/C,aAAa;AACb,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAEnD,UAAU;AACV,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AAEpD,UAAU;AACV,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./anaglyphPostProcess\";\r\nexport * from \"./blackAndWhitePostProcess\";\r\nexport * from \"./bloomEffect\";\r\nexport * from \"./bloomMergePostProcess\";\r\nexport * from \"./blurPostProcess\";\r\nexport * from \"./chromaticAberrationPostProcess\";\r\nexport * from \"./circleOfConfusionPostProcess\";\r\nexport * from \"./colorCorrectionPostProcess\";\r\nexport * from \"./convolutionPostProcess\";\r\nexport * from \"./depthOfFieldBlurPostProcess\";\r\nexport * from \"./depthOfFieldEffect\";\r\nexport * from \"./depthOfFieldMergePostProcess\";\r\nexport * from \"./displayPassPostProcess\";\r\nexport * from \"./extractHighlightsPostProcess\";\r\nexport * from \"./filterPostProcess\";\r\nexport * from \"./fxaaPostProcess\";\r\nexport * from \"./grainPostProcess\";\r\nexport * from \"./highlightsPostProcess\";\r\nexport * from \"./imageProcessingPostProcess\";\r\nexport * from \"./motionBlurPostProcess\";\r\nexport * from \"./passPostProcess\";\r\nexport * from \"./postProcess\";\r\nexport * from \"./postProcessManager\";\r\nexport * from \"./refractionPostProcess\";\r\nexport * from \"./RenderPipeline/index\";\r\nexport * from \"./sharpenPostProcess\";\r\nexport * from \"./stereoscopicInterlacePostProcess\";\r\nexport * from \"./tonemapPostProcess\";\r\nexport * from \"./volumetricLightScatteringPostProcess\";\r\nexport * from \"./vrDistortionCorrectionPostProcess\";\r\nexport * from \"./vrMultiviewToSingleviewPostProcess\";\r\nexport * from \"./screenSpaceReflectionPostProcess\";\r\nexport * from \"./screenSpaceCurvaturePostProcess\";\r\n\r\nexport * from \"./thinAnaglyphPostProcess\";\r\nexport * from \"./thinBlackAndWhitePostProcess\";\r\nexport * from \"./thinBloomEffect\";\r\nexport * from \"./thinBlurPostProcess\";\r\nexport * from \"./thinChromaticAberrationPostProcess\";\r\nexport * from \"./thinCircleOfConfusionPostProcess\";\r\nexport * from \"./thinDepthOfFieldEffect\";\r\nexport * from \"./thinExtractHighlightsPostProcess\";\r\nexport * from \"./thinPassPostProcess\";\r\n\r\n// Postprocess\r\nexport * from \"../Shaders/postprocess.vertex\";\r\nexport * from \"../ShadersWGSL/postprocess.vertex\";\r\n\r\n// Blur postprocess\r\nexport * from \"../Shaders/kernelBlur.fragment\";\r\nexport * from \"../Shaders/kernelBlur.vertex\";\r\nexport * from \"../ShadersWGSL/kernelBlur.fragment\";\r\nexport * from \"../ShadersWGSL/kernelBlur.vertex\";\r\n\r\n// Pass postprocess\r\nexport * from \"../Shaders/pass.fragment\";\r\nexport * from \"../Shaders/passCube.fragment\";\r\nexport * from \"../ShadersWGSL/pass.fragment\";\r\nexport * from \"../ShadersWGSL/passCube.fragment\";\r\n\r\n// vrDFistortionCorrection postprocess\r\nexport * from \"../Shaders/vrDistortionCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/vrDistortionCorrection.fragment\";\r\n\r\n// Image processing postprocess\r\nexport * from \"../ShadersWGSL/imageProcessing.fragment\";\r\nexport * from \"../Shaders/imageProcessing.fragment\";\r\n\r\n// Sharpen\r\nexport * from \"../Shaders/sharpen.fragment\";\r\nexport * from \"../ShadersWGSL/sharpen.fragment\";\r\n\r\n// Grain\r\nexport * from \"../Shaders/grain.fragment\";\r\nexport * from \"../ShadersWGSL/grain.fragment\";\r\n\r\n// Chromatic Aberration\r\nexport * from \"../Shaders/chromaticAberration.fragment\";\r\nexport * from \"../ShadersWGSL/chromaticAberration.fragment\";\r\n\r\n// Depth of field merge\r\nexport * from \"../Shaders/depthOfFieldMerge.fragment\";\r\nexport * from \"../ShadersWGSL/depthOfFieldMerge.fragment\";\r\n\r\n// Circle of confusion\r\nexport * from \"../Shaders/circleOfConfusion.fragment\";\r\nexport * from \"../ShadersWGSL/circleOfConfusion.fragment\";\r\n\r\n// Bloom\r\nexport * from \"../Shaders/bloomMerge.fragment\";\r\nexport * from \"../ShadersWGSL/bloomMerge.fragment\";\r\n\r\n// Extract highlights\r\nexport * from \"../Shaders/extractHighlights.fragment\";\r\nexport * from \"../ShadersWGSL/extractHighlights.fragment\";\r\n\r\n// FXAA\r\nexport * from \"../Shaders/fxaa.fragment\";\r\nexport * from \"../Shaders/fxaa.vertex\";\r\nexport * from \"../ShadersWGSL/fxaa.fragment\";\r\nexport * from \"../ShadersWGSL/fxaa.vertex\";\r\n\r\n// B&W\r\nexport * from \"../Shaders/blackAndWhite.fragment\";\r\nexport * from \"../ShadersWGSL/blackAndWhite.fragment\";\r\n\r\n// Anaglyph\r\nexport * from \"../Shaders/anaglyph.fragment\";\r\nexport * from \"../ShadersWGSL/anaglyph.fragment\";\r\n\r\n// Convolution\r\nexport * from \"../Shaders/convolution.fragment\";\r\nexport * from \"../ShadersWGSL/convolution.fragment\";\r\n\r\n// Color correction\r\nexport * from \"../Shaders/colorCorrection.fragment\";\r\nexport * from \"../ShadersWGSL/colorCorrection.fragment\";\r\n\r\n// Motion blur\r\nexport * from \"../Shaders/motionBlur.fragment\";\r\nexport * from \"../ShadersWGSL/motionBlur.fragment\";\r\n\r\n// Filter\r\nexport * from \"../Shaders/filter.fragment\";\r\nexport * from \"../ShadersWGSL/filter.fragment\";\r\n\r\n// Highlights\r\nexport * from \"../Shaders/highlights.fragment\";\r\nexport * from \"../ShadersWGSL/highlights.fragment\";\r\n\r\n// Display\r\nexport * from \"../Shaders/displayPass.fragment\";\r\nexport * from \"../ShadersWGSL/displayPass.fragment\";\r\n\r\n// Tonemap\r\nexport * from \"../Shaders/tonemap.fragment\";\r\nexport * from \"../ShadersWGSL/tonemap.fragment\";\r\n"]}
|
|
@@ -328,6 +328,10 @@ export declare class PostProcess {
|
|
|
328
328
|
* A function that is added to the onAfterRenderObservable
|
|
329
329
|
*/
|
|
330
330
|
set onAfterRender(callback: (efect: Effect) => void);
|
|
331
|
+
/**
|
|
332
|
+
* An event triggered when the post-process is disposed
|
|
333
|
+
*/
|
|
334
|
+
readonly onDisposeObservable: Observable<void>;
|
|
331
335
|
/**
|
|
332
336
|
* The input texture for this post process and the output texture of the previous post process. When added to a pipeline the previous post process will
|
|
333
337
|
* render it's output into this texture and this texture will be used as textureSampler in the fragment shader of this post process.
|
|
@@ -350,6 +354,7 @@ export declare class PostProcess {
|
|
|
350
354
|
*/
|
|
351
355
|
get texelSize(): Vector2;
|
|
352
356
|
protected readonly _effectWrapper: EffectWrapper;
|
|
357
|
+
protected readonly _useExistingThinPostProcess: boolean;
|
|
353
358
|
/**
|
|
354
359
|
* Creates a new instance PostProcess
|
|
355
360
|
* @param name The name of the PostProcess.
|
|
@@ -304,6 +304,10 @@ export class PostProcess {
|
|
|
304
304
|
* An event triggered after rendering the postprocess
|
|
305
305
|
*/
|
|
306
306
|
this.onAfterRenderObservable = new Observable();
|
|
307
|
+
/**
|
|
308
|
+
* An event triggered when the post-process is disposed
|
|
309
|
+
*/
|
|
310
|
+
this.onDisposeObservable = new Observable();
|
|
307
311
|
let size = 1;
|
|
308
312
|
let uniformBuffers = null;
|
|
309
313
|
let effectWrapper;
|
|
@@ -335,7 +339,7 @@ export class PostProcess {
|
|
|
335
339
|
size = { width: _size.width, height: _size.height };
|
|
336
340
|
}
|
|
337
341
|
}
|
|
338
|
-
|
|
342
|
+
this._useExistingThinPostProcess = !!effectWrapper;
|
|
339
343
|
this._effectWrapper =
|
|
340
344
|
effectWrapper ??
|
|
341
345
|
new EffectWrapper({
|
|
@@ -386,7 +390,7 @@ export class PostProcess {
|
|
|
386
390
|
}
|
|
387
391
|
this._uniformBuffers = uniformBuffers || [];
|
|
388
392
|
this._indexParameters = indexParameters;
|
|
389
|
-
if (!
|
|
393
|
+
if (!this._useExistingThinPostProcess) {
|
|
390
394
|
this._webGPUReady = this._shaderLanguage === 1 /* ShaderLanguage.WGSL */;
|
|
391
395
|
const importPromises = [];
|
|
392
396
|
this._gatherImports(this._engine.isWebGPU && !PostProcess.ForceGLSL, importPromises);
|
|
@@ -735,6 +739,9 @@ export class PostProcess {
|
|
|
735
739
|
*/
|
|
736
740
|
dispose(camera) {
|
|
737
741
|
camera = camera || this._camera;
|
|
742
|
+
if (!this._useExistingThinPostProcess) {
|
|
743
|
+
this._effectWrapper.dispose();
|
|
744
|
+
}
|
|
738
745
|
this._disposeTextures();
|
|
739
746
|
let index;
|
|
740
747
|
if (this._scene) {
|
|
@@ -754,6 +761,7 @@ export class PostProcess {
|
|
|
754
761
|
if (index !== -1) {
|
|
755
762
|
this._engine.postProcesses.splice(index, 1);
|
|
756
763
|
}
|
|
764
|
+
this.onDisposeObservable.notifyObservers();
|
|
757
765
|
if (!camera) {
|
|
758
766
|
return;
|
|
759
767
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/postProcess.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAMjD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,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,EAAE;YACD,OAAO,IAAI,WAAW,CAClB,iBAAiB,CAAC,IAAI,EACtB,iBAAiB,CAAC,WAAW,EAC7B,iBAAiB,CAAC,UAAU,EAC5B,iBAAiB,CAAC,QAAQ,EAC1B,iBAAiB,CAAC,OAAO,EACzB,YAAY,EACZ,iBAAiB,CAAC,wBAAwB,EAC1C,iBAAiB,CAAC,OAAO,EACzB,iBAAiB,CAAC,QAAQ,EAC1B,iBAAiB,CAAC,OAAO,EACzB,iBAAiB,CAAC,WAAW,EAC7B,iBAAiB,CAAC,SAAS,EAC3B,iBAAiB,CAAC,eAAe,EACjC,KAAK,EACL,iBAAiB,CAAC,aAAa,CAClC,CAAC;QACN,CAAC,EACD,iBAAiB,EACjB,KAAK,EACL,OAAO,CACV,CAAC;IACN,CAAC;CACJ;AAvjCU;IADN,SAAS,EAAE;6CACY;AAIxB;IADC,SAAS,EAAE;uCAGX;AAUM;IADN,SAAS,EAAE;0CACM;AAMX;IADN,SAAS,EAAE;2CACO;AAgBZ;IADN,SAAS,EAAE;6DAC4B;AAKjC;IADN,iBAAiB,EAAE;+CACM;AAMnB;IADN,SAAS,EAAE;8CACY;AAMjB;IADN,SAAS,EAAE;8DAC6B;AAMzC;IADC,SAAS,EAAE;4CAGX;AAUM;IADN,SAAS,EAAE;mDACkB;AAYvB;IADN,SAAS,EAAE;2DAC0B;AAM/B;IADN,SAAS,EAAE;4DAC0B;AAmB/B;IADN,SAAS,EAAE;8CACiC;AAKtC;IADN,SAAS,EAAE;mDACkB;AAGtB;IADP,SAAS,CAAC,SAAS,CAAC;6CACA;AAqBd;IADN,SAAS,EAAE;gEAC+B;AA86B/C,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport { SmartArray } from \"../Misc/smartArray\";\r\nimport type { Observer } from \"../Misc/observable\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport { Effect } from \"../Materials/effect\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport type { RenderTargetCreationOptions } from \"../Materials/Textures/textureCreationOptions\";\r\nimport type { IInspectable } from \"../Misc/iInspectable\";\r\nimport type { Color4 } from \"../Maths/math.color\";\r\n\r\nimport type { NodeMaterial } from \"../Materials/Node/nodeMaterial\";\r\nimport { serialize, serializeAsColor4 } from \"../Misc/decorators\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\nimport { GetClass, RegisterClass } from \"../Misc/typeStore\";\r\nimport type { RenderTargetWrapper } from \"../Engines/renderTargetWrapper\";\r\nimport { ShaderLanguage } from \"../Materials/shaderLanguage\";\r\n\r\nimport type { Scene } from \"../scene\";\r\nimport type { InternalTexture } from \"../Materials/Textures/internalTexture\";\r\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { PrePassRenderer } from \"../Rendering/prePassRenderer\";\r\nimport type { PrePassEffectConfiguration } from \"../Rendering/prePassEffectConfiguration\";\r\nimport { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { GetExponentOfTwo } from \"../Misc/tools.functions\";\r\nimport type { IAssetContainer } from \"core/IAssetContainer\";\r\nimport type { EffectWrapperCustomShaderCodeProcessing, EffectWrapperCreationOptions } from \"../Materials/effectRenderer\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\n\r\ndeclare module \"../Engines/abstractEngine\" {\r\n export interface AbstractEngine {\r\n /**\r\n * Sets a texture to the context from a postprocess\r\n * @param channel defines the channel to use\r\n * @param postProcess defines the source postprocess\r\n * @param name name of the channel\r\n */\r\n setTextureFromPostProcess(channel: number, postProcess: Nullable<PostProcess>, name: string): void;\r\n\r\n /**\r\n * Binds the output of the passed in post process to the texture channel specified\r\n * @param channel The channel the texture should be bound to\r\n * @param postProcess The post process which's output should be bound\r\n * @param name name of the channel\r\n */\r\n setTextureFromPostProcessOutput(channel: number, postProcess: Nullable<PostProcess>, name: string): void;\r\n }\r\n}\r\n\r\nAbstractEngine.prototype.setTextureFromPostProcess = function (channel: number, postProcess: Nullable<PostProcess>, name: string): void {\r\n let postProcessInput = null;\r\n if (postProcess) {\r\n if (postProcess._forcedOutputTexture) {\r\n postProcessInput = postProcess._forcedOutputTexture;\r\n } else if (postProcess._textures.data[postProcess._currentRenderTextureInd]) {\r\n postProcessInput = postProcess._textures.data[postProcess._currentRenderTextureInd];\r\n }\r\n }\r\n\r\n this._bindTexture(channel, postProcessInput?.texture ?? null, name);\r\n};\r\n\r\nAbstractEngine.prototype.setTextureFromPostProcessOutput = function (channel: number, postProcess: Nullable<PostProcess>, name: string): void {\r\n this._bindTexture(channel, postProcess?._outputTexture?.texture ?? null, name);\r\n};\r\n\r\ndeclare module \"../Materials/effect\" {\r\n export interface Effect {\r\n /**\r\n * Sets a texture to be the input of the specified post process. (To use the output, pass in the next post process in the pipeline)\r\n * @param channel Name of the sampler variable.\r\n * @param postProcess Post process to get the input texture from.\r\n */\r\n setTextureFromPostProcess(channel: string, postProcess: Nullable<PostProcess>): void;\r\n\r\n /**\r\n * (Warning! setTextureFromPostProcessOutput may be desired instead)\r\n * Sets the input texture of the passed in post process to be input of this effect. (To use the output of the passed in post process use setTextureFromPostProcessOutput)\r\n * @param channel Name of the sampler variable.\r\n * @param postProcess Post process to get the output texture from.\r\n */\r\n setTextureFromPostProcessOutput(channel: string, postProcess: Nullable<PostProcess>): void;\r\n }\r\n}\r\n\r\n/**\r\n * Sets a texture to be the input of the specified post process. (To use the output, pass in the next post process in the pipeline)\r\n * @param channel Name of the sampler variable.\r\n * @param postProcess Post process to get the input texture from.\r\n */\r\nEffect.prototype.setTextureFromPostProcess = function (channel: string, postProcess: Nullable<PostProcess>): void {\r\n this._engine.setTextureFromPostProcess(this._samplers[channel], postProcess, channel);\r\n};\r\n\r\n/**\r\n * (Warning! setTextureFromPostProcessOutput may be desired instead)\r\n * Sets the input texture of the passed in post process to be input of this effect. (To use the output of the passed in post process use setTextureFromPostProcessOutput)\r\n * @param channel Name of the sampler variable.\r\n * @param postProcess Post process to get the output texture from.\r\n */\r\nEffect.prototype.setTextureFromPostProcessOutput = function (channel: string, postProcess: Nullable<PostProcess>): void {\r\n this._engine.setTextureFromPostProcessOutput(this._samplers[channel], postProcess, channel);\r\n};\r\n\r\n/**\r\n * Options for the PostProcess constructor\r\n */\r\nexport type PostProcessOptions = EffectWrapperCreationOptions & {\r\n /**\r\n * The width of the texture created for this post process.\r\n * This parameter (and height) is only used when passing a value for the 5th parameter (options) to the PostProcess constructor function.\r\n * If you use a PostProcessOptions for the 3rd parameter of the constructor, size is used instead of width and height.\r\n */\r\n width?: number;\r\n /**\r\n * The height of the texture created for this post process.\r\n * This parameter (and width) is only used when passing a value for the 5th parameter (options) to the PostProcess constructor function.\r\n * If you use a PostProcessOptions for the 3rd parameter of the constructor, size is used instead of width and height.\r\n */\r\n height?: number;\r\n\r\n /**\r\n * The size of the post process texture.\r\n * It is either a ratio to downscale or upscale the texture create for this post process, or an object containing width and height values.\r\n * Default: 1\r\n */\r\n size?: number | { width: number; height: number };\r\n /**\r\n * The camera that the post process will be attached to (default: null)\r\n */\r\n camera?: Nullable<Camera>;\r\n /**\r\n * The sampling mode to be used by the shader (default: Constants.TEXTURE_NEAREST_SAMPLINGMODE)\r\n */\r\n samplingMode?: number;\r\n /**\r\n * The engine to be used to render the post process (default: engine from scene)\r\n */\r\n engine?: AbstractEngine;\r\n /**\r\n * If the post process can be reused on the same frame. (default: false)\r\n */\r\n reusable?: boolean;\r\n /**\r\n * Type of the texture created for this post process (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)\r\n */\r\n textureType?: number;\r\n /**\r\n * Format of the texture created for this post process (default: TEXTUREFORMAT_RGBA)\r\n */\r\n textureFormat?: number;\r\n /**\r\n * The effect wrapper instance used by the post process. If not provided, a new one will be created.\r\n */\r\n effectWrapper?: EffectWrapper;\r\n};\r\n\r\ntype TextureCache = { texture: RenderTargetWrapper; postProcessChannel: number; lastUsedRenderId: number };\r\n\r\n/**\r\n * PostProcess can be used to apply a shader to a texture after it has been rendered\r\n * See https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses\r\n */\r\nexport class PostProcess {\r\n /**\r\n * Force all the postprocesses to compile to glsl even on WebGPU engines.\r\n * False by default. This is mostly meant for backward compatibility.\r\n */\r\n public static get ForceGLSL(): boolean {\r\n return EffectWrapper.ForceGLSL;\r\n }\r\n\r\n public static set ForceGLSL(force: boolean) {\r\n EffectWrapper.ForceGLSL = force;\r\n }\r\n\r\n /** @internal */\r\n public _parentContainer: Nullable<IAssetContainer> = null;\r\n\r\n /**\r\n * Registers a shader code processing with a post process name.\r\n * @param postProcessName name of the post process. Use null for the fallback shader code processing. This is the shader code processing that will be used in case no specific shader code processing has been associated to a post process name\r\n * @param customShaderCodeProcessing shader code processing to associate to the post process name\r\n */\r\n public static RegisterShaderCodeProcessing(postProcessName: Nullable<string>, customShaderCodeProcessing?: EffectWrapperCustomShaderCodeProcessing) {\r\n EffectWrapper.RegisterShaderCodeProcessing(postProcessName, customShaderCodeProcessing);\r\n }\r\n\r\n /**\r\n * Gets or sets the unique id of the post process\r\n */\r\n @serialize()\r\n public uniqueId: number;\r\n\r\n /** Name of the PostProcess. */\r\n @serialize()\r\n public get name() {\r\n return this._effectWrapper.name;\r\n }\r\n\r\n public set name(value: string) {\r\n this._effectWrapper.name = value;\r\n }\r\n\r\n /**\r\n * Width of the texture to apply the post process on\r\n */\r\n @serialize()\r\n public width = -1;\r\n\r\n /**\r\n * Height of the texture to apply the post process on\r\n */\r\n @serialize()\r\n public height = -1;\r\n\r\n /**\r\n * Gets the node material used to create this postprocess (null if the postprocess was manually created)\r\n */\r\n public nodeMaterialSource: Nullable<NodeMaterial> = null;\r\n\r\n /**\r\n * Internal, reference to the location where this postprocess was output to. (Typically the texture on the next postprocess in the chain)\r\n * @internal\r\n */\r\n public _outputTexture: Nullable<RenderTargetWrapper> = null;\r\n /**\r\n * Sampling mode used by the shader\r\n */\r\n @serialize()\r\n public renderTargetSamplingMode: number;\r\n /**\r\n * Clear color to use when screen clearing\r\n */\r\n @serializeAsColor4()\r\n public clearColor: Color4;\r\n /**\r\n * If the buffer needs to be cleared before applying the post process. (default: true)\r\n * Should be set to false if shader will overwrite all previous pixels.\r\n */\r\n @serialize()\r\n public autoClear = true;\r\n /**\r\n * If clearing the buffer should be forced in autoClear mode, even when alpha mode is enabled (default: false).\r\n * By default, the buffer will only be cleared if alpha mode is disabled (and autoClear is true).\r\n */\r\n @serialize()\r\n public forceAutoClearInAlphaMode = false;\r\n\r\n /**\r\n * Type of alpha mode to use when performing the post process (default: Engine.ALPHA_DISABLE)\r\n */\r\n @serialize()\r\n public get alphaMode() {\r\n return this._effectWrapper.alphaMode;\r\n }\r\n\r\n public set alphaMode(value: number) {\r\n this._effectWrapper.alphaMode = value;\r\n }\r\n\r\n /**\r\n * Sets the setAlphaBlendConstants of the babylon engine\r\n */\r\n @serialize()\r\n public alphaConstants: Color4;\r\n\r\n /**\r\n * Animations to be used for the post processing\r\n */\r\n public animations: Animation[] = [];\r\n\r\n /**\r\n * Enable Pixel Perfect mode where texture is not scaled to be power of 2.\r\n * Can only be used on a single postprocess or on the last one of a chain. (default: false)\r\n */\r\n @serialize()\r\n public enablePixelPerfectMode = false;\r\n\r\n /**\r\n * Force the postprocess to be applied without taking in account viewport\r\n */\r\n @serialize()\r\n public forceFullscreenViewport = true;\r\n\r\n /**\r\n * List of inspectable custom properties (used by the Inspector)\r\n * @see https://doc.babylonjs.com/toolsAndResources/inspector#extensibility\r\n */\r\n public inspectableCustomProperties: IInspectable[];\r\n\r\n /**\r\n * Scale mode for the post process (default: Engine.SCALEMODE_FLOOR)\r\n *\r\n * | Value | Type | Description |\r\n * | ----- | ----------------------------------- | ----------- |\r\n * | 1 | SCALEMODE_FLOOR | [engine.scalemode_floor](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_floor) |\r\n * | 2 | SCALEMODE_NEAREST | [engine.scalemode_nearest](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_nearest) |\r\n * | 3 | SCALEMODE_CEILING | [engine.scalemode_ceiling](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_ceiling) |\r\n *\r\n */\r\n @serialize()\r\n public scaleMode = Constants.SCALEMODE_FLOOR;\r\n /**\r\n * Force textures to be a power of two (default: false)\r\n */\r\n @serialize()\r\n public alwaysForcePOT = false;\r\n\r\n @serialize(\"samples\")\r\n private _samples = 1;\r\n\r\n /**\r\n * Number of sample textures (default: 1)\r\n */\r\n public get samples() {\r\n return this._samples;\r\n }\r\n\r\n public set samples(n: number) {\r\n this._samples = Math.min(n, this._engine.getCaps().maxMSAASamples);\r\n\r\n this._textures.forEach((texture) => {\r\n texture.setSamples(this._samples);\r\n });\r\n }\r\n\r\n /**\r\n * Modify the scale of the post process to be the same as the viewport (default: false)\r\n */\r\n @serialize()\r\n public adaptScaleToCurrentViewport = false;\r\n\r\n private _camera: Camera;\r\n protected _scene: Scene;\r\n private _engine: AbstractEngine;\r\n\r\n protected _webGPUReady = false;\r\n\r\n private _options: number | { width: number; height: number };\r\n private _reusable = false;\r\n private _renderId = 0;\r\n private _textureType: number;\r\n private _textureFormat: number;\r\n /** @internal */\r\n private _shaderLanguage: ShaderLanguage;\r\n\r\n /**\r\n * Gets the shader language type used to generate vertex and fragment source code.\r\n */\r\n public get shaderLanguage(): ShaderLanguage {\r\n return this._shaderLanguage;\r\n }\r\n\r\n /**\r\n * if externalTextureSamplerBinding is true, the \"apply\" method won't bind the textureSampler texture, it is expected to be done by the \"outside\" (by the onApplyObservable observer most probably).\r\n * counter-productive in some cases because if the texture bound by \"apply\" is different from the currently texture bound, (the one set by the onApplyObservable observer, for eg) some\r\n * internal structures (materialContext) will be dirtified, which may impact performances\r\n */\r\n public externalTextureSamplerBinding = false;\r\n\r\n /**\r\n * Smart array of input and output textures for the post process.\r\n * @internal\r\n */\r\n public _textures = new SmartArray<RenderTargetWrapper>(2);\r\n /**\r\n * Smart array of input and output textures for the post process.\r\n * @internal\r\n */\r\n private _textureCache: TextureCache[] = [];\r\n /**\r\n * The index in _textures that corresponds to the output texture.\r\n * @internal\r\n */\r\n public _currentRenderTextureInd = 0;\r\n private _samplers: string[];\r\n private _fragmentUrl: string;\r\n private _vertexUrl: string;\r\n private _parameters: string[];\r\n private _uniformBuffers: string[];\r\n protected _postProcessDefines: Nullable<string>;\r\n private _scaleRatio = new Vector2(1, 1);\r\n protected _indexParameters: any;\r\n private _shareOutputWithPostProcess: Nullable<PostProcess>;\r\n private _texelSize = Vector2.Zero();\r\n\r\n /** @internal */\r\n public _forcedOutputTexture: Nullable<RenderTargetWrapper>;\r\n\r\n /**\r\n * Prepass configuration in case this post process needs a texture from prepass\r\n * @internal\r\n */\r\n public _prePassEffectConfiguration: PrePassEffectConfiguration;\r\n\r\n /**\r\n * Returns the fragment url or shader name used in the post process.\r\n * @returns the fragment url or name in the shader store.\r\n */\r\n public getEffectName(): string {\r\n return this._fragmentUrl;\r\n }\r\n\r\n /**\r\n * Executed when the effect was created\r\n * @returns effect that was created for this post process\r\n */\r\n public onEffectCreatedObservable;\r\n\r\n // Events\r\n\r\n /**\r\n * An event triggered when the postprocess is activated.\r\n */\r\n public onActivateObservable = new Observable<Camera>();\r\n\r\n private _onActivateObserver: Nullable<Observer<Camera>>;\r\n /**\r\n * A function that is added to the onActivateObservable\r\n */\r\n public set onActivate(callback: Nullable<(camera: Camera) => void>) {\r\n if (this._onActivateObserver) {\r\n this.onActivateObservable.remove(this._onActivateObserver);\r\n }\r\n if (callback) {\r\n this._onActivateObserver = this.onActivateObservable.add(callback);\r\n }\r\n }\r\n\r\n /**\r\n * An event triggered when the postprocess changes its size.\r\n */\r\n public onSizeChangedObservable = new Observable<PostProcess>();\r\n\r\n private _onSizeChangedObserver: Nullable<Observer<PostProcess>>;\r\n /**\r\n * A function that is added to the onSizeChangedObservable\r\n */\r\n public set onSizeChanged(callback: (postProcess: PostProcess) => void) {\r\n if (this._onSizeChangedObserver) {\r\n this.onSizeChangedObservable.remove(this._onSizeChangedObserver);\r\n }\r\n this._onSizeChangedObserver = this.onSizeChangedObservable.add(callback);\r\n }\r\n\r\n /**\r\n * An event triggered when the postprocess applies its effect.\r\n */\r\n public onApplyObservable = new Observable<Effect>();\r\n\r\n private _onApplyObserver: Nullable<Observer<Effect>>;\r\n /**\r\n * A function that is added to the onApplyObservable\r\n */\r\n public set onApply(callback: (effect: Effect) => void) {\r\n if (this._onApplyObserver) {\r\n this.onApplyObservable.remove(this._onApplyObserver);\r\n }\r\n this._onApplyObserver = this.onApplyObservable.add(callback);\r\n }\r\n\r\n /**\r\n * An event triggered before rendering the postprocess\r\n */\r\n public onBeforeRenderObservable = new Observable<Effect>();\r\n\r\n private _onBeforeRenderObserver: Nullable<Observer<Effect>>;\r\n /**\r\n * A function that is added to the onBeforeRenderObservable\r\n */\r\n public set onBeforeRender(callback: (effect: Effect) => void) {\r\n if (this._onBeforeRenderObserver) {\r\n this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);\r\n }\r\n this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);\r\n }\r\n\r\n /**\r\n * An event triggered after rendering the postprocess\r\n */\r\n public onAfterRenderObservable = new Observable<Effect>();\r\n\r\n private _onAfterRenderObserver: Nullable<Observer<Effect>>;\r\n /**\r\n * A function that is added to the onAfterRenderObservable\r\n */\r\n public set onAfterRender(callback: (efect: Effect) => void) {\r\n if (this._onAfterRenderObserver) {\r\n this.onAfterRenderObservable.remove(this._onAfterRenderObserver);\r\n }\r\n this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);\r\n }\r\n\r\n /**\r\n * The input texture for this post process and the output texture of the previous post process. When added to a pipeline the previous post process will\r\n * render it's output into this texture and this texture will be used as textureSampler in the fragment shader of this post process.\r\n */\r\n public get inputTexture(): RenderTargetWrapper {\r\n return this._textures.data[this._currentRenderTextureInd];\r\n }\r\n\r\n public set inputTexture(value: RenderTargetWrapper) {\r\n this._forcedOutputTexture = value;\r\n }\r\n\r\n /**\r\n * Since inputTexture should always be defined, if we previously manually set `inputTexture`,\r\n * the only way to unset it is to use this function to restore its internal state\r\n */\r\n public restoreDefaultInputTexture() {\r\n if (this._forcedOutputTexture) {\r\n this._forcedOutputTexture = null;\r\n this.markTextureDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets the camera which post process is applied to.\r\n * @returns The camera the post process is applied to.\r\n */\r\n public getCamera(): Camera {\r\n return this._camera;\r\n }\r\n\r\n /**\r\n * Gets the texel size of the postprocess.\r\n * See https://en.wikipedia.org/wiki/Texel_(graphics)\r\n */\r\n public get texelSize(): Vector2 {\r\n if (this._shareOutputWithPostProcess) {\r\n return this._shareOutputWithPostProcess.texelSize;\r\n }\r\n\r\n if (this._forcedOutputTexture) {\r\n this._texelSize.copyFromFloats(1.0 / this._forcedOutputTexture.width, 1.0 / this._forcedOutputTexture.height);\r\n }\r\n\r\n return this._texelSize;\r\n }\r\n\r\n protected readonly _effectWrapper: EffectWrapper;\r\n\r\n /**\r\n * Creates a new instance PostProcess\r\n * @param name The name of the PostProcess.\r\n * @param fragmentUrl The url of the fragment shader to be used.\r\n * @param options The options to be used when constructing the post process.\r\n */\r\n constructor(name: string, fragmentUrl: string, options?: PostProcessOptions);\r\n\r\n /**\r\n * Creates a new instance PostProcess\r\n * @param name The name of the PostProcess.\r\n * @param fragmentUrl The url of the fragment shader to be used.\r\n * @param parameters Array of the names of uniform non-sampler2D variables that will be passed to the shader.\r\n * @param samplers Array of the names of uniform sampler2D variables that will be passed to the shader.\r\n * @param options The required width/height ratio to downsize to before computing the render pass. (Use 1.0 for full size)\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param defines String of defines that will be set when running the fragment shader. (default: null)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param vertexUrl The url of the vertex shader to be used. (default: \"postprocess\")\r\n * @param indexParameters The index parameters to be used for babylons include syntax \"#include<kernelBlurVaryingDeclaration>[0..varyingCount]\". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx\r\n * @param blockCompilation If the shader should not be compiled immediatly. (default: false)\r\n * @param textureFormat Format of textures used when performing the post process. (default: TEXTUREFORMAT_RGBA)\r\n * @param shaderLanguage The shader language of the shader. (default: GLSL)\r\n * @param extraInitializations Defines additional code to call to prepare the shader code\r\n */\r\n constructor(\r\n name: string,\r\n fragmentUrl: string,\r\n parameters: Nullable<string[]>,\r\n samplers: Nullable<string[]>,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: AbstractEngine,\r\n reusable?: boolean,\r\n defines?: Nullable<string>,\r\n textureType?: number,\r\n vertexUrl?: string,\r\n indexParameters?: any,\r\n blockCompilation?: boolean,\r\n textureFormat?: number,\r\n shaderLanguage?: ShaderLanguage,\r\n extraInitializations?: (useWebGPU: boolean, list: Promise<any>[]) => void\r\n );\r\n\r\n /** @internal */\r\n constructor(\r\n name: string,\r\n fragmentUrl: string,\r\n parameters?: Nullable<string[]> | PostProcessOptions,\r\n samplers?: Nullable<string[]>,\r\n _size?: number | PostProcessOptions,\r\n camera?: Nullable<Camera>,\r\n samplingMode: number = Constants.TEXTURE_NEAREST_SAMPLINGMODE,\r\n engine?: AbstractEngine,\r\n reusable?: boolean,\r\n defines: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n vertexUrl: string = \"postprocess\",\r\n indexParameters?: any,\r\n blockCompilation = false,\r\n textureFormat = Constants.TEXTUREFORMAT_RGBA,\r\n shaderLanguage?: ShaderLanguage,\r\n extraInitializations?: (useWebGPU: boolean, list: Promise<any>[]) => void\r\n ) {\r\n let size: number | { width: number; height: number } = 1;\r\n let uniformBuffers: Nullable<string[]> = null;\r\n let effectWrapper: EffectWrapper | undefined;\r\n if (parameters && !Array.isArray(parameters)) {\r\n const options = parameters;\r\n parameters = options.uniforms ?? null;\r\n samplers = options.samplers ?? null;\r\n size = options.size ?? 1;\r\n camera = options.camera ?? null;\r\n samplingMode = options.samplingMode ?? Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n engine = options.engine;\r\n reusable = options.reusable;\r\n defines = Array.isArray(options.defines) ? options.defines.join(\"\\n\") : (options.defines ?? null);\r\n textureType = options.textureType ?? Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n vertexUrl = options.vertexUrl ?? \"postprocess\";\r\n indexParameters = options.indexParameters;\r\n blockCompilation = options.blockCompilation ?? false;\r\n textureFormat = options.textureFormat ?? Constants.TEXTUREFORMAT_RGBA;\r\n shaderLanguage = options.shaderLanguage ?? ShaderLanguage.GLSL;\r\n uniformBuffers = options.uniformBuffers ?? null;\r\n extraInitializations = options.extraInitializations;\r\n effectWrapper = options.effectWrapper;\r\n } else if (_size) {\r\n if (typeof _size === \"number\") {\r\n size = _size;\r\n } else {\r\n size = { width: _size.width!, height: _size.height! };\r\n }\r\n }\r\n\r\n const useExistingThinPostProcess = !!effectWrapper;\r\n\r\n this._effectWrapper =\r\n effectWrapper ??\r\n new EffectWrapper({\r\n name,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: fragmentUrl,\r\n engine: engine || camera?.getScene().getEngine(),\r\n uniforms: parameters,\r\n samplers,\r\n uniformBuffers,\r\n defines,\r\n vertexUrl,\r\n indexParameters,\r\n blockCompilation: true,\r\n shaderLanguage,\r\n extraInitializations: undefined,\r\n });\r\n\r\n this.name = name;\r\n this.onEffectCreatedObservable = this._effectWrapper.onEffectCreatedObservable;\r\n\r\n if (camera != null) {\r\n this._camera = camera;\r\n this._scene = camera.getScene();\r\n camera.attachPostProcess(this);\r\n this._engine = this._scene.getEngine();\r\n\r\n this._scene.postProcesses.push(this);\r\n this.uniqueId = this._scene.getUniqueId();\r\n } else if (engine) {\r\n this._engine = engine;\r\n this._engine.postProcesses.push(this);\r\n }\r\n\r\n this._options = size;\r\n this.renderTargetSamplingMode = samplingMode ? samplingMode : Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n this._reusable = reusable || false;\r\n this._textureType = textureType;\r\n this._textureFormat = textureFormat;\r\n this._shaderLanguage = shaderLanguage || ShaderLanguage.GLSL;\r\n\r\n this._samplers = samplers || [];\r\n if (this._samplers.indexOf(\"textureSampler\") === -1) {\r\n this._samplers.push(\"textureSampler\");\r\n }\r\n\r\n this._fragmentUrl = fragmentUrl;\r\n this._vertexUrl = vertexUrl;\r\n this._parameters = parameters || [];\r\n\r\n if (this._parameters.indexOf(\"scale\") === -1) {\r\n this._parameters.push(\"scale\");\r\n }\r\n this._uniformBuffers = uniformBuffers || [];\r\n\r\n this._indexParameters = indexParameters;\r\n\r\n if (!useExistingThinPostProcess) {\r\n this._webGPUReady = this._shaderLanguage === ShaderLanguage.WGSL;\r\n\r\n const importPromises: Array<Promise<any>> = [];\r\n\r\n this._gatherImports(this._engine.isWebGPU && !PostProcess.ForceGLSL, importPromises);\r\n\r\n this._effectWrapper._webGPUReady = this._webGPUReady;\r\n this._effectWrapper._postConstructor(blockCompilation, defines, extraInitializations, importPromises);\r\n }\r\n }\r\n\r\n protected _gatherImports(useWebGPU = false, list: Promise<any>[]) {\r\n // this._webGPUReady is used to detect when a postprocess is intended to be used with WebGPU\r\n if (useWebGPU && this._webGPUReady) {\r\n list.push(Promise.all([import(\"../ShadersWGSL/postprocess.vertex\")]));\r\n } else {\r\n list.push(Promise.all([import(\"../Shaders/postprocess.vertex\")]));\r\n }\r\n }\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"PostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"PostProcess\";\r\n }\r\n\r\n /**\r\n * Gets the engine which this post process belongs to.\r\n * @returns The engine the post process was enabled with.\r\n */\r\n public getEngine(): AbstractEngine {\r\n return this._engine;\r\n }\r\n\r\n /**\r\n * The effect that is created when initializing the post process.\r\n * @returns The created effect corresponding to the postprocess.\r\n */\r\n public getEffect(): Effect {\r\n return this._effectWrapper.drawWrapper.effect!;\r\n }\r\n\r\n /**\r\n * To avoid multiple redundant textures for multiple post process, the output the output texture for this post process can be shared with another.\r\n * @param postProcess The post process to share the output with.\r\n * @returns This post process.\r\n */\r\n public shareOutputWith(postProcess: PostProcess): PostProcess {\r\n this._disposeTextures();\r\n\r\n this._shareOutputWithPostProcess = postProcess;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Reverses the effect of calling shareOutputWith and returns the post process back to its original state.\r\n * This should be called if the post process that shares output with this post process is disabled/disposed.\r\n */\r\n public useOwnOutput() {\r\n if (this._textures.length == 0) {\r\n this._textures = new SmartArray<RenderTargetWrapper>(2);\r\n }\r\n\r\n this._shareOutputWithPostProcess = null;\r\n }\r\n\r\n /**\r\n * Updates the effect with the current post process compile time values and recompiles the shader.\r\n * @param defines Define statements that should be added at the beginning of the shader. (default: null)\r\n * @param uniforms Set of uniform variables that will be passed to the shader. (default: null)\r\n * @param samplers Set of Texture2D variables that will be passed to the shader. (default: null)\r\n * @param indexParameters The index parameters to be used for babylons include syntax \"#include<kernelBlurVaryingDeclaration>[0..varyingCount]\". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx\r\n * @param onCompiled Called when the shader has been compiled.\r\n * @param onError Called if there is an error when compiling a shader.\r\n * @param vertexUrl The url of the vertex shader to be used (default: the one given at construction time)\r\n * @param fragmentUrl The url of the fragment shader to be used (default: the one given at construction time)\r\n */\r\n public updateEffect(\r\n defines: Nullable<string> = null,\r\n uniforms: Nullable<string[]> = null,\r\n samplers: Nullable<string[]> = null,\r\n indexParameters?: any,\r\n onCompiled?: (effect: Effect) => void,\r\n onError?: (effect: Effect, errors: string) => void,\r\n vertexUrl?: string,\r\n fragmentUrl?: string\r\n ) {\r\n this._effectWrapper.updateEffect(defines, uniforms, samplers, indexParameters, onCompiled, onError, vertexUrl, fragmentUrl);\r\n this._postProcessDefines = Array.isArray(this._effectWrapper.options.defines) ? this._effectWrapper.options.defines.join(\"\\n\") : this._effectWrapper.options.defines;\r\n }\r\n\r\n /**\r\n * The post process is reusable if it can be used multiple times within one frame.\r\n * @returns If the post process is reusable\r\n */\r\n public isReusable(): boolean {\r\n return this._reusable;\r\n }\r\n\r\n /** invalidate frameBuffer to hint the postprocess to create a depth buffer */\r\n public markTextureDirty(): void {\r\n this.width = -1;\r\n }\r\n\r\n private _createRenderTargetTexture(textureSize: { width: number; height: number }, textureOptions: RenderTargetCreationOptions, channel = 0) {\r\n for (let i = 0; i < this._textureCache.length; i++) {\r\n if (\r\n this._textureCache[i].texture.width === textureSize.width &&\r\n this._textureCache[i].texture.height === textureSize.height &&\r\n this._textureCache[i].postProcessChannel === channel &&\r\n this._textureCache[i].texture._generateDepthBuffer === textureOptions.generateDepthBuffer &&\r\n this._textureCache[i].texture.samples === textureOptions.samples\r\n ) {\r\n return this._textureCache[i].texture;\r\n }\r\n }\r\n\r\n const tex = this._engine.createRenderTargetTexture(textureSize, textureOptions);\r\n this._textureCache.push({ texture: tex, postProcessChannel: channel, lastUsedRenderId: -1 });\r\n\r\n return tex;\r\n }\r\n\r\n private _flushTextureCache() {\r\n const currentRenderId = this._renderId;\r\n\r\n for (let i = this._textureCache.length - 1; i >= 0; i--) {\r\n if (currentRenderId - this._textureCache[i].lastUsedRenderId > 100) {\r\n let currentlyUsed = false;\r\n for (let j = 0; j < this._textures.length; j++) {\r\n if (this._textures.data[j] === this._textureCache[i].texture) {\r\n currentlyUsed = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!currentlyUsed) {\r\n this._textureCache[i].texture.dispose();\r\n this._textureCache.splice(i, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Resizes the post-process texture\r\n * @param width Width of the texture\r\n * @param height Height of the texture\r\n * @param camera The camera this post-process is applied to. Pass null if the post-process is used outside the context of a camera post-process chain (default: null)\r\n * @param needMipMaps True if mip maps need to be generated after render (default: false)\r\n * @param forceDepthStencil True to force post-process texture creation with stencil depth and buffer (default: false)\r\n */\r\n public resize(width: number, height: number, camera: Nullable<Camera> = null, needMipMaps = false, forceDepthStencil = false) {\r\n if (this._textures.length > 0) {\r\n this._textures.reset();\r\n }\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n let firstPP = null;\r\n if (camera) {\r\n for (let i = 0; i < camera._postProcesses.length; i++) {\r\n if (camera._postProcesses[i] !== null) {\r\n firstPP = camera._postProcesses[i];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n const textureSize = { width: this.width, height: this.height };\r\n const textureOptions = {\r\n generateMipMaps: needMipMaps,\r\n generateDepthBuffer: forceDepthStencil || firstPP === this,\r\n generateStencilBuffer: (forceDepthStencil || firstPP === this) && this._engine.isStencilEnable,\r\n samplingMode: this.renderTargetSamplingMode,\r\n type: this._textureType,\r\n format: this._textureFormat,\r\n samples: this._samples,\r\n label: \"PostProcessRTT-\" + this.name,\r\n };\r\n\r\n this._textures.push(this._createRenderTargetTexture(textureSize, textureOptions, 0));\r\n\r\n if (this._reusable) {\r\n this._textures.push(this._createRenderTargetTexture(textureSize, textureOptions, 1));\r\n }\r\n\r\n this._texelSize.copyFromFloats(1.0 / this.width, 1.0 / this.height);\r\n\r\n this.onSizeChangedObservable.notifyObservers(this);\r\n }\r\n\r\n private _getTarget() {\r\n let target: RenderTargetWrapper;\r\n\r\n if (this._shareOutputWithPostProcess) {\r\n target = this._shareOutputWithPostProcess.inputTexture;\r\n } else if (this._forcedOutputTexture) {\r\n target = this._forcedOutputTexture;\r\n\r\n this.width = this._forcedOutputTexture.width;\r\n this.height = this._forcedOutputTexture.height;\r\n } else {\r\n target = this.inputTexture;\r\n\r\n let cache;\r\n for (let i = 0; i < this._textureCache.length; i++) {\r\n if (this._textureCache[i].texture === target) {\r\n cache = this._textureCache[i];\r\n break;\r\n }\r\n }\r\n\r\n if (cache) {\r\n cache.lastUsedRenderId = this._renderId;\r\n }\r\n }\r\n\r\n return target;\r\n }\r\n\r\n /**\r\n * Activates the post process by intializing the textures to be used when executed. Notifies onActivateObservable.\r\n * When this post process is used in a pipeline, this is call will bind the input texture of this post process to the output of the previous.\r\n * @param cameraOrScene The camera that will be used in the post process. This camera will be used when calling onActivateObservable. You can also pass the scene if no camera is available.\r\n * @param sourceTexture The source texture to be inspected to get the width and height if not specified in the post process constructor. (default: null)\r\n * @param forceDepthStencil If true, a depth and stencil buffer will be generated. (default: false)\r\n * @returns The render target wrapper that was bound to be written to.\r\n */\r\n public activate(cameraOrScene: Nullable<Camera> | Scene, sourceTexture: Nullable<InternalTexture> = null, forceDepthStencil?: boolean): RenderTargetWrapper {\r\n const camera = cameraOrScene === null || (cameraOrScene as Camera).cameraRigMode !== undefined ? (cameraOrScene as Camera) || this._camera : null;\r\n\r\n const scene = camera?.getScene() ?? (cameraOrScene as Scene);\r\n const engine = scene.getEngine();\r\n const maxSize = engine.getCaps().maxTextureSize;\r\n\r\n const requiredWidth = ((sourceTexture ? sourceTexture.width : this._engine.getRenderWidth(true)) * <number>this._options) | 0;\r\n const requiredHeight = ((sourceTexture ? sourceTexture.height : this._engine.getRenderHeight(true)) * <number>this._options) | 0;\r\n\r\n let desiredWidth = (<PostProcessOptions>this._options).width || requiredWidth;\r\n let desiredHeight = (<PostProcessOptions>this._options).height || requiredHeight;\r\n\r\n const needMipMaps =\r\n this.renderTargetSamplingMode !== Constants.TEXTURE_NEAREST_LINEAR &&\r\n this.renderTargetSamplingMode !== Constants.TEXTURE_NEAREST_NEAREST &&\r\n this.renderTargetSamplingMode !== Constants.TEXTURE_LINEAR_LINEAR;\r\n\r\n let target: Nullable<RenderTargetWrapper> = null;\r\n\r\n if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {\r\n if (this.adaptScaleToCurrentViewport) {\r\n const currentViewport = engine.currentViewport;\r\n\r\n if (currentViewport) {\r\n desiredWidth *= currentViewport.width;\r\n desiredHeight *= currentViewport.height;\r\n }\r\n }\r\n\r\n if (needMipMaps || this.alwaysForcePOT) {\r\n if (!(<PostProcessOptions>this._options).width) {\r\n desiredWidth = engine.needPOTTextures ? GetExponentOfTwo(desiredWidth, maxSize, this.scaleMode) : desiredWidth;\r\n }\r\n\r\n if (!(<PostProcessOptions>this._options).height) {\r\n desiredHeight = engine.needPOTTextures ? GetExponentOfTwo(desiredHeight, maxSize, this.scaleMode) : desiredHeight;\r\n }\r\n }\r\n\r\n if (this.width !== desiredWidth || this.height !== desiredHeight || !(target = this._getTarget())) {\r\n this.resize(desiredWidth, desiredHeight, camera, needMipMaps, forceDepthStencil);\r\n }\r\n\r\n this._textures.forEach((texture) => {\r\n if (texture.samples !== this.samples) {\r\n this._engine.updateRenderTargetTextureSampleCount(texture, this.samples);\r\n }\r\n });\r\n\r\n this._flushTextureCache();\r\n this._renderId++;\r\n }\r\n\r\n if (!target) {\r\n target = this._getTarget();\r\n }\r\n\r\n // Bind the input of this post process to be used as the output of the previous post process.\r\n if (this.enablePixelPerfectMode) {\r\n this._scaleRatio.copyFromFloats(requiredWidth / desiredWidth, requiredHeight / desiredHeight);\r\n this._engine.bindFramebuffer(target, 0, requiredWidth, requiredHeight, this.forceFullscreenViewport);\r\n } else {\r\n this._scaleRatio.copyFromFloats(1, 1);\r\n this._engine.bindFramebuffer(target, 0, undefined, undefined, this.forceFullscreenViewport);\r\n }\r\n\r\n this._engine._debugInsertMarker?.(`post process ${this.name} input`);\r\n\r\n this.onActivateObservable.notifyObservers(camera!);\r\n\r\n // Clear\r\n if (this.autoClear && (this.alphaMode === Constants.ALPHA_DISABLE || this.forceAutoClearInAlphaMode)) {\r\n this._engine.clear(this.clearColor ? this.clearColor : scene.clearColor, scene._allowPostProcessClearColor, true, true);\r\n }\r\n\r\n if (this._reusable) {\r\n this._currentRenderTextureInd = (this._currentRenderTextureInd + 1) % 2;\r\n }\r\n return target;\r\n }\r\n\r\n /**\r\n * If the post process is supported.\r\n */\r\n public get isSupported(): boolean {\r\n return this._effectWrapper.drawWrapper.effect!.isSupported;\r\n }\r\n\r\n /**\r\n * The aspect ratio of the output texture.\r\n */\r\n public get aspectRatio(): number {\r\n if (this._shareOutputWithPostProcess) {\r\n return this._shareOutputWithPostProcess.aspectRatio;\r\n }\r\n\r\n if (this._forcedOutputTexture) {\r\n return this._forcedOutputTexture.width / this._forcedOutputTexture.height;\r\n }\r\n return this.width / this.height;\r\n }\r\n\r\n /**\r\n * Get a value indicating if the post-process is ready to be used\r\n * @returns true if the post-process is ready (shader is compiled)\r\n */\r\n public isReady(): boolean {\r\n return this._effectWrapper.isReady();\r\n }\r\n\r\n /**\r\n * Binds all textures and uniforms to the shader, this will be run on every pass.\r\n * @returns the effect corresponding to this post process. Null if not compiled or not ready.\r\n */\r\n public apply(): Nullable<Effect> {\r\n // Check\r\n if (!this._effectWrapper.isReady()) {\r\n return null;\r\n }\r\n\r\n // States\r\n this._engine.enableEffect(this._effectWrapper.drawWrapper);\r\n this._engine.setState(false);\r\n this._engine.setDepthBuffer(false);\r\n this._engine.setDepthWrite(false);\r\n\r\n // Alpha\r\n if (this.alphaConstants) {\r\n this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a);\r\n }\r\n\r\n // Bind the output texture of the preivous post process as the input to this post process.\r\n let source: RenderTargetWrapper;\r\n if (this._shareOutputWithPostProcess) {\r\n source = this._shareOutputWithPostProcess.inputTexture;\r\n } else if (this._forcedOutputTexture) {\r\n source = this._forcedOutputTexture;\r\n } else {\r\n source = this.inputTexture;\r\n }\r\n\r\n if (!this.externalTextureSamplerBinding) {\r\n this._effectWrapper.drawWrapper.effect!._bindTexture(\"textureSampler\", source?.texture);\r\n }\r\n\r\n // Parameters\r\n this._effectWrapper.drawWrapper.effect!.setVector2(\"scale\", this._scaleRatio);\r\n this.onApplyObservable.notifyObservers(this._effectWrapper.drawWrapper.effect!);\r\n\r\n this._effectWrapper.bind();\r\n\r\n return this._effectWrapper.drawWrapper.effect;\r\n }\r\n\r\n private _disposeTextures() {\r\n if (this._shareOutputWithPostProcess || this._forcedOutputTexture) {\r\n this._disposeTextureCache();\r\n return;\r\n }\r\n\r\n this._disposeTextureCache();\r\n this._textures.dispose();\r\n }\r\n\r\n private _disposeTextureCache() {\r\n for (let i = this._textureCache.length - 1; i >= 0; i--) {\r\n this._textureCache[i].texture.dispose();\r\n }\r\n\r\n this._textureCache.length = 0;\r\n }\r\n\r\n /**\r\n * Sets the required values to the prepass renderer.\r\n * @param prePassRenderer defines the prepass renderer to setup.\r\n * @returns true if the pre pass is needed.\r\n */\r\n public setPrePassRenderer(prePassRenderer: PrePassRenderer): boolean {\r\n if (this._prePassEffectConfiguration) {\r\n this._prePassEffectConfiguration = prePassRenderer.addEffectConfiguration(this._prePassEffectConfiguration);\r\n this._prePassEffectConfiguration.enabled = true;\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Disposes the post process.\r\n * @param camera The camera to dispose the post process on.\r\n */\r\n public dispose(camera?: Camera): void {\r\n camera = camera || this._camera;\r\n\r\n this._disposeTextures();\r\n\r\n let index;\r\n if (this._scene) {\r\n index = this._scene.postProcesses.indexOf(this);\r\n if (index !== -1) {\r\n this._scene.postProcesses.splice(index, 1);\r\n }\r\n }\r\n\r\n if (this._parentContainer) {\r\n const index = this._parentContainer.postProcesses.indexOf(this);\r\n if (index > -1) {\r\n this._parentContainer.postProcesses.splice(index, 1);\r\n }\r\n this._parentContainer = null;\r\n }\r\n\r\n index = this._engine.postProcesses.indexOf(this);\r\n if (index !== -1) {\r\n this._engine.postProcesses.splice(index, 1);\r\n }\r\n\r\n if (!camera) {\r\n return;\r\n }\r\n camera.detachPostProcess(this);\r\n\r\n index = camera._postProcesses.indexOf(this);\r\n if (index === 0 && camera._postProcesses.length > 0) {\r\n const firstPostProcess = this._camera._getFirstPostProcess();\r\n if (firstPostProcess) {\r\n firstPostProcess.markTextureDirty();\r\n }\r\n }\r\n\r\n this.onActivateObservable.clear();\r\n this.onAfterRenderObservable.clear();\r\n this.onApplyObservable.clear();\r\n this.onBeforeRenderObservable.clear();\r\n this.onSizeChangedObservable.clear();\r\n this.onEffectCreatedObservable.clear();\r\n }\r\n\r\n /**\r\n * Serializes the post process to a JSON object\r\n * @returns the JSON object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n const camera = this.getCamera() || (this._scene && this._scene.activeCamera);\r\n serializationObject.customType = \"BABYLON.\" + this.getClassName();\r\n serializationObject.cameraId = camera ? camera.id : null;\r\n serializationObject.reusable = this._reusable;\r\n serializationObject.textureType = this._textureType;\r\n serializationObject.fragmentUrl = this._fragmentUrl;\r\n serializationObject.parameters = this._parameters;\r\n serializationObject.samplers = this._samplers;\r\n serializationObject.uniformBuffers = this._uniformBuffers;\r\n serializationObject.options = this._options;\r\n serializationObject.defines = this._postProcessDefines;\r\n serializationObject.textureFormat = this._textureFormat;\r\n serializationObject.vertexUrl = this._vertexUrl;\r\n serializationObject.indexParameters = this._indexParameters;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Clones this post process\r\n * @returns a new post process similar to this one\r\n */\r\n public clone(): Nullable<PostProcess> {\r\n const serializationObject = this.serialize();\r\n serializationObject._engine = this._engine;\r\n serializationObject.cameraId = null;\r\n\r\n const result = PostProcess.Parse(serializationObject, this._scene, \"\");\r\n\r\n if (!result) {\r\n return null;\r\n }\r\n\r\n result.onActivateObservable = this.onActivateObservable.clone();\r\n result.onSizeChangedObservable = this.onSizeChangedObservable.clone();\r\n result.onApplyObservable = this.onApplyObservable.clone();\r\n result.onBeforeRenderObservable = this.onBeforeRenderObservable.clone();\r\n result.onAfterRenderObservable = this.onAfterRenderObservable.clone();\r\n\r\n result._prePassEffectConfiguration = this._prePassEffectConfiguration;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a material from parsed material data\r\n * @param parsedPostProcess defines parsed post process data\r\n * @param scene defines the hosting scene\r\n * @param rootUrl defines the root URL to use to load textures\r\n * @returns a new post process\r\n */\r\n public static Parse(parsedPostProcess: any, scene: Scene, rootUrl: string): Nullable<PostProcess> {\r\n const postProcessType = GetClass(parsedPostProcess.customType);\r\n\r\n if (!postProcessType || !postProcessType._Parse) {\r\n return null;\r\n }\r\n\r\n const camera = scene ? scene.getCameraById(parsedPostProcess.cameraId) : null;\r\n return postProcessType._Parse(parsedPostProcess, camera, scene, rootUrl);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _Parse(parsedPostProcess: any, targetCamera: Nullable<Camera>, scene: Nullable<Scene>, rootUrl: string): Nullable<PostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new PostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.fragmentUrl,\r\n parsedPostProcess.parameters,\r\n parsedPostProcess.samplers,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n parsedPostProcess._engine,\r\n parsedPostProcess.reusable,\r\n parsedPostProcess.defines,\r\n parsedPostProcess.textureType,\r\n parsedPostProcess.vertexUrl,\r\n parsedPostProcess.indexParameters,\r\n false,\r\n parsedPostProcess.textureFormat\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PostProcess\", PostProcess);\r\n"]}
|
|
1
|
+
{"version":3,"file":"postProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/postProcess.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAMjD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kC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/C,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport { SmartArray } from \"../Misc/smartArray\";\r\nimport type { Observer } from \"../Misc/observable\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport { Effect } from \"../Materials/effect\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport type { RenderTargetCreationOptions } from \"../Materials/Textures/textureCreationOptions\";\r\nimport type { IInspectable } from \"../Misc/iInspectable\";\r\nimport type { Color4 } from \"../Maths/math.color\";\r\n\r\nimport type { NodeMaterial } from \"../Materials/Node/nodeMaterial\";\r\nimport { serialize, serializeAsColor4 } from \"../Misc/decorators\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\nimport { GetClass, RegisterClass } from \"../Misc/typeStore\";\r\nimport type { RenderTargetWrapper } from \"../Engines/renderTargetWrapper\";\r\nimport { ShaderLanguage } from \"../Materials/shaderLanguage\";\r\n\r\nimport type { Scene } from \"../scene\";\r\nimport type { InternalTexture } from \"../Materials/Textures/internalTexture\";\r\nimport type { Animation } from \"../Animations/animation\";\r\nimport type { PrePassRenderer } from \"../Rendering/prePassRenderer\";\r\nimport type { PrePassEffectConfiguration } from \"../Rendering/prePassEffectConfiguration\";\r\nimport { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { GetExponentOfTwo } from \"../Misc/tools.functions\";\r\nimport type { IAssetContainer } from \"core/IAssetContainer\";\r\nimport type { EffectWrapperCustomShaderCodeProcessing, EffectWrapperCreationOptions } from \"../Materials/effectRenderer\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\n\r\ndeclare module \"../Engines/abstractEngine\" {\r\n export interface AbstractEngine {\r\n /**\r\n * Sets a texture to the context from a postprocess\r\n * @param channel defines the channel to use\r\n * @param postProcess defines the source postprocess\r\n * @param name name of the channel\r\n */\r\n setTextureFromPostProcess(channel: number, postProcess: Nullable<PostProcess>, name: string): void;\r\n\r\n /**\r\n * Binds the output of the passed in post process to the texture channel specified\r\n * @param channel The channel the texture should be bound to\r\n * @param postProcess The post process which's output should be bound\r\n * @param name name of the channel\r\n */\r\n setTextureFromPostProcessOutput(channel: number, postProcess: Nullable<PostProcess>, name: string): void;\r\n }\r\n}\r\n\r\nAbstractEngine.prototype.setTextureFromPostProcess = function (channel: number, postProcess: Nullable<PostProcess>, name: string): void {\r\n let postProcessInput = null;\r\n if (postProcess) {\r\n if (postProcess._forcedOutputTexture) {\r\n postProcessInput = postProcess._forcedOutputTexture;\r\n } else if (postProcess._textures.data[postProcess._currentRenderTextureInd]) {\r\n postProcessInput = postProcess._textures.data[postProcess._currentRenderTextureInd];\r\n }\r\n }\r\n\r\n this._bindTexture(channel, postProcessInput?.texture ?? null, name);\r\n};\r\n\r\nAbstractEngine.prototype.setTextureFromPostProcessOutput = function (channel: number, postProcess: Nullable<PostProcess>, name: string): void {\r\n this._bindTexture(channel, postProcess?._outputTexture?.texture ?? null, name);\r\n};\r\n\r\ndeclare module \"../Materials/effect\" {\r\n export interface Effect {\r\n /**\r\n * Sets a texture to be the input of the specified post process. (To use the output, pass in the next post process in the pipeline)\r\n * @param channel Name of the sampler variable.\r\n * @param postProcess Post process to get the input texture from.\r\n */\r\n setTextureFromPostProcess(channel: string, postProcess: Nullable<PostProcess>): void;\r\n\r\n /**\r\n * (Warning! setTextureFromPostProcessOutput may be desired instead)\r\n * Sets the input texture of the passed in post process to be input of this effect. (To use the output of the passed in post process use setTextureFromPostProcessOutput)\r\n * @param channel Name of the sampler variable.\r\n * @param postProcess Post process to get the output texture from.\r\n */\r\n setTextureFromPostProcessOutput(channel: string, postProcess: Nullable<PostProcess>): void;\r\n }\r\n}\r\n\r\n/**\r\n * Sets a texture to be the input of the specified post process. (To use the output, pass in the next post process in the pipeline)\r\n * @param channel Name of the sampler variable.\r\n * @param postProcess Post process to get the input texture from.\r\n */\r\nEffect.prototype.setTextureFromPostProcess = function (channel: string, postProcess: Nullable<PostProcess>): void {\r\n this._engine.setTextureFromPostProcess(this._samplers[channel], postProcess, channel);\r\n};\r\n\r\n/**\r\n * (Warning! setTextureFromPostProcessOutput may be desired instead)\r\n * Sets the input texture of the passed in post process to be input of this effect. (To use the output of the passed in post process use setTextureFromPostProcessOutput)\r\n * @param channel Name of the sampler variable.\r\n * @param postProcess Post process to get the output texture from.\r\n */\r\nEffect.prototype.setTextureFromPostProcessOutput = function (channel: string, postProcess: Nullable<PostProcess>): void {\r\n this._engine.setTextureFromPostProcessOutput(this._samplers[channel], postProcess, channel);\r\n};\r\n\r\n/**\r\n * Options for the PostProcess constructor\r\n */\r\nexport type PostProcessOptions = EffectWrapperCreationOptions & {\r\n /**\r\n * The width of the texture created for this post process.\r\n * This parameter (and height) is only used when passing a value for the 5th parameter (options) to the PostProcess constructor function.\r\n * If you use a PostProcessOptions for the 3rd parameter of the constructor, size is used instead of width and height.\r\n */\r\n width?: number;\r\n /**\r\n * The height of the texture created for this post process.\r\n * This parameter (and width) is only used when passing a value for the 5th parameter (options) to the PostProcess constructor function.\r\n * If you use a PostProcessOptions for the 3rd parameter of the constructor, size is used instead of width and height.\r\n */\r\n height?: number;\r\n\r\n /**\r\n * The size of the post process texture.\r\n * It is either a ratio to downscale or upscale the texture create for this post process, or an object containing width and height values.\r\n * Default: 1\r\n */\r\n size?: number | { width: number; height: number };\r\n /**\r\n * The camera that the post process will be attached to (default: null)\r\n */\r\n camera?: Nullable<Camera>;\r\n /**\r\n * The sampling mode to be used by the shader (default: Constants.TEXTURE_NEAREST_SAMPLINGMODE)\r\n */\r\n samplingMode?: number;\r\n /**\r\n * The engine to be used to render the post process (default: engine from scene)\r\n */\r\n engine?: AbstractEngine;\r\n /**\r\n * If the post process can be reused on the same frame. (default: false)\r\n */\r\n reusable?: boolean;\r\n /**\r\n * Type of the texture created for this post process (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)\r\n */\r\n textureType?: number;\r\n /**\r\n * Format of the texture created for this post process (default: TEXTUREFORMAT_RGBA)\r\n */\r\n textureFormat?: number;\r\n /**\r\n * The effect wrapper instance used by the post process. If not provided, a new one will be created.\r\n */\r\n effectWrapper?: EffectWrapper;\r\n};\r\n\r\ntype TextureCache = { texture: RenderTargetWrapper; postProcessChannel: number; lastUsedRenderId: number };\r\n\r\n/**\r\n * PostProcess can be used to apply a shader to a texture after it has been rendered\r\n * See https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses\r\n */\r\nexport class PostProcess {\r\n /**\r\n * Force all the postprocesses to compile to glsl even on WebGPU engines.\r\n * False by default. This is mostly meant for backward compatibility.\r\n */\r\n public static get ForceGLSL(): boolean {\r\n return EffectWrapper.ForceGLSL;\r\n }\r\n\r\n public static set ForceGLSL(force: boolean) {\r\n EffectWrapper.ForceGLSL = force;\r\n }\r\n\r\n /** @internal */\r\n public _parentContainer: Nullable<IAssetContainer> = null;\r\n\r\n /**\r\n * Registers a shader code processing with a post process name.\r\n * @param postProcessName name of the post process. Use null for the fallback shader code processing. This is the shader code processing that will be used in case no specific shader code processing has been associated to a post process name\r\n * @param customShaderCodeProcessing shader code processing to associate to the post process name\r\n */\r\n public static RegisterShaderCodeProcessing(postProcessName: Nullable<string>, customShaderCodeProcessing?: EffectWrapperCustomShaderCodeProcessing) {\r\n EffectWrapper.RegisterShaderCodeProcessing(postProcessName, customShaderCodeProcessing);\r\n }\r\n\r\n /**\r\n * Gets or sets the unique id of the post process\r\n */\r\n @serialize()\r\n public uniqueId: number;\r\n\r\n /** Name of the PostProcess. */\r\n @serialize()\r\n public get name() {\r\n return this._effectWrapper.name;\r\n }\r\n\r\n public set name(value: string) {\r\n this._effectWrapper.name = value;\r\n }\r\n\r\n /**\r\n * Width of the texture to apply the post process on\r\n */\r\n @serialize()\r\n public width = -1;\r\n\r\n /**\r\n * Height of the texture to apply the post process on\r\n */\r\n @serialize()\r\n public height = -1;\r\n\r\n /**\r\n * Gets the node material used to create this postprocess (null if the postprocess was manually created)\r\n */\r\n public nodeMaterialSource: Nullable<NodeMaterial> = null;\r\n\r\n /**\r\n * Internal, reference to the location where this postprocess was output to. (Typically the texture on the next postprocess in the chain)\r\n * @internal\r\n */\r\n public _outputTexture: Nullable<RenderTargetWrapper> = null;\r\n /**\r\n * Sampling mode used by the shader\r\n */\r\n @serialize()\r\n public renderTargetSamplingMode: number;\r\n /**\r\n * Clear color to use when screen clearing\r\n */\r\n @serializeAsColor4()\r\n public clearColor: Color4;\r\n /**\r\n * If the buffer needs to be cleared before applying the post process. (default: true)\r\n * Should be set to false if shader will overwrite all previous pixels.\r\n */\r\n @serialize()\r\n public autoClear = true;\r\n /**\r\n * If clearing the buffer should be forced in autoClear mode, even when alpha mode is enabled (default: false).\r\n * By default, the buffer will only be cleared if alpha mode is disabled (and autoClear is true).\r\n */\r\n @serialize()\r\n public forceAutoClearInAlphaMode = false;\r\n\r\n /**\r\n * Type of alpha mode to use when performing the post process (default: Engine.ALPHA_DISABLE)\r\n */\r\n @serialize()\r\n public get alphaMode() {\r\n return this._effectWrapper.alphaMode;\r\n }\r\n\r\n public set alphaMode(value: number) {\r\n this._effectWrapper.alphaMode = value;\r\n }\r\n\r\n /**\r\n * Sets the setAlphaBlendConstants of the babylon engine\r\n */\r\n @serialize()\r\n public alphaConstants: Color4;\r\n\r\n /**\r\n * Animations to be used for the post processing\r\n */\r\n public animations: Animation[] = [];\r\n\r\n /**\r\n * Enable Pixel Perfect mode where texture is not scaled to be power of 2.\r\n * Can only be used on a single postprocess or on the last one of a chain. (default: false)\r\n */\r\n @serialize()\r\n public enablePixelPerfectMode = false;\r\n\r\n /**\r\n * Force the postprocess to be applied without taking in account viewport\r\n */\r\n @serialize()\r\n public forceFullscreenViewport = true;\r\n\r\n /**\r\n * List of inspectable custom properties (used by the Inspector)\r\n * @see https://doc.babylonjs.com/toolsAndResources/inspector#extensibility\r\n */\r\n public inspectableCustomProperties: IInspectable[];\r\n\r\n /**\r\n * Scale mode for the post process (default: Engine.SCALEMODE_FLOOR)\r\n *\r\n * | Value | Type | Description |\r\n * | ----- | ----------------------------------- | ----------- |\r\n * | 1 | SCALEMODE_FLOOR | [engine.scalemode_floor](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_floor) |\r\n * | 2 | SCALEMODE_NEAREST | [engine.scalemode_nearest](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_nearest) |\r\n * | 3 | SCALEMODE_CEILING | [engine.scalemode_ceiling](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_ceiling) |\r\n *\r\n */\r\n @serialize()\r\n public scaleMode = Constants.SCALEMODE_FLOOR;\r\n /**\r\n * Force textures to be a power of two (default: false)\r\n */\r\n @serialize()\r\n public alwaysForcePOT = false;\r\n\r\n @serialize(\"samples\")\r\n private _samples = 1;\r\n\r\n /**\r\n * Number of sample textures (default: 1)\r\n */\r\n public get samples() {\r\n return this._samples;\r\n }\r\n\r\n public set samples(n: number) {\r\n this._samples = Math.min(n, this._engine.getCaps().maxMSAASamples);\r\n\r\n this._textures.forEach((texture) => {\r\n texture.setSamples(this._samples);\r\n });\r\n }\r\n\r\n /**\r\n * Modify the scale of the post process to be the same as the viewport (default: false)\r\n */\r\n @serialize()\r\n public adaptScaleToCurrentViewport = false;\r\n\r\n private _camera: Camera;\r\n protected _scene: Scene;\r\n private _engine: AbstractEngine;\r\n\r\n protected _webGPUReady = false;\r\n\r\n private _options: number | { width: number; height: number };\r\n private _reusable = false;\r\n private _renderId = 0;\r\n private _textureType: number;\r\n private _textureFormat: number;\r\n /** @internal */\r\n private _shaderLanguage: ShaderLanguage;\r\n\r\n /**\r\n * Gets the shader language type used to generate vertex and fragment source code.\r\n */\r\n public get shaderLanguage(): ShaderLanguage {\r\n return this._shaderLanguage;\r\n }\r\n\r\n /**\r\n * if externalTextureSamplerBinding is true, the \"apply\" method won't bind the textureSampler texture, it is expected to be done by the \"outside\" (by the onApplyObservable observer most probably).\r\n * counter-productive in some cases because if the texture bound by \"apply\" is different from the currently texture bound, (the one set by the onApplyObservable observer, for eg) some\r\n * internal structures (materialContext) will be dirtified, which may impact performances\r\n */\r\n public externalTextureSamplerBinding = false;\r\n\r\n /**\r\n * Smart array of input and output textures for the post process.\r\n * @internal\r\n */\r\n public _textures = new SmartArray<RenderTargetWrapper>(2);\r\n /**\r\n * Smart array of input and output textures for the post process.\r\n * @internal\r\n */\r\n private _textureCache: TextureCache[] = [];\r\n /**\r\n * The index in _textures that corresponds to the output texture.\r\n * @internal\r\n */\r\n public _currentRenderTextureInd = 0;\r\n private _samplers: string[];\r\n private _fragmentUrl: string;\r\n private _vertexUrl: string;\r\n private _parameters: string[];\r\n private _uniformBuffers: string[];\r\n protected _postProcessDefines: Nullable<string>;\r\n private _scaleRatio = new Vector2(1, 1);\r\n protected _indexParameters: any;\r\n private _shareOutputWithPostProcess: Nullable<PostProcess>;\r\n private _texelSize = Vector2.Zero();\r\n\r\n /** @internal */\r\n public _forcedOutputTexture: Nullable<RenderTargetWrapper>;\r\n\r\n /**\r\n * Prepass configuration in case this post process needs a texture from prepass\r\n * @internal\r\n */\r\n public _prePassEffectConfiguration: PrePassEffectConfiguration;\r\n\r\n /**\r\n * Returns the fragment url or shader name used in the post process.\r\n * @returns the fragment url or name in the shader store.\r\n */\r\n public getEffectName(): string {\r\n return this._fragmentUrl;\r\n }\r\n\r\n /**\r\n * Executed when the effect was created\r\n * @returns effect that was created for this post process\r\n */\r\n public onEffectCreatedObservable;\r\n\r\n // Events\r\n\r\n /**\r\n * An event triggered when the postprocess is activated.\r\n */\r\n public onActivateObservable = new Observable<Camera>();\r\n\r\n private _onActivateObserver: Nullable<Observer<Camera>>;\r\n /**\r\n * A function that is added to the onActivateObservable\r\n */\r\n public set onActivate(callback: Nullable<(camera: Camera) => void>) {\r\n if (this._onActivateObserver) {\r\n this.onActivateObservable.remove(this._onActivateObserver);\r\n }\r\n if (callback) {\r\n this._onActivateObserver = this.onActivateObservable.add(callback);\r\n }\r\n }\r\n\r\n /**\r\n * An event triggered when the postprocess changes its size.\r\n */\r\n public onSizeChangedObservable = new Observable<PostProcess>();\r\n\r\n private _onSizeChangedObserver: Nullable<Observer<PostProcess>>;\r\n /**\r\n * A function that is added to the onSizeChangedObservable\r\n */\r\n public set onSizeChanged(callback: (postProcess: PostProcess) => void) {\r\n if (this._onSizeChangedObserver) {\r\n this.onSizeChangedObservable.remove(this._onSizeChangedObserver);\r\n }\r\n this._onSizeChangedObserver = this.onSizeChangedObservable.add(callback);\r\n }\r\n\r\n /**\r\n * An event triggered when the postprocess applies its effect.\r\n */\r\n public onApplyObservable = new Observable<Effect>();\r\n\r\n private _onApplyObserver: Nullable<Observer<Effect>>;\r\n /**\r\n * A function that is added to the onApplyObservable\r\n */\r\n public set onApply(callback: (effect: Effect) => void) {\r\n if (this._onApplyObserver) {\r\n this.onApplyObservable.remove(this._onApplyObserver);\r\n }\r\n this._onApplyObserver = this.onApplyObservable.add(callback);\r\n }\r\n\r\n /**\r\n * An event triggered before rendering the postprocess\r\n */\r\n public onBeforeRenderObservable = new Observable<Effect>();\r\n\r\n private _onBeforeRenderObserver: Nullable<Observer<Effect>>;\r\n /**\r\n * A function that is added to the onBeforeRenderObservable\r\n */\r\n public set onBeforeRender(callback: (effect: Effect) => void) {\r\n if (this._onBeforeRenderObserver) {\r\n this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);\r\n }\r\n this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);\r\n }\r\n\r\n /**\r\n * An event triggered after rendering the postprocess\r\n */\r\n public onAfterRenderObservable = new Observable<Effect>();\r\n\r\n private _onAfterRenderObserver: Nullable<Observer<Effect>>;\r\n /**\r\n * A function that is added to the onAfterRenderObservable\r\n */\r\n public set onAfterRender(callback: (efect: Effect) => void) {\r\n if (this._onAfterRenderObserver) {\r\n this.onAfterRenderObservable.remove(this._onAfterRenderObserver);\r\n }\r\n this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);\r\n }\r\n\r\n /**\r\n * An event triggered when the post-process is disposed\r\n */\r\n public readonly onDisposeObservable = new Observable<void>();\r\n\r\n /**\r\n * The input texture for this post process and the output texture of the previous post process. When added to a pipeline the previous post process will\r\n * render it's output into this texture and this texture will be used as textureSampler in the fragment shader of this post process.\r\n */\r\n public get inputTexture(): RenderTargetWrapper {\r\n return this._textures.data[this._currentRenderTextureInd];\r\n }\r\n\r\n public set inputTexture(value: RenderTargetWrapper) {\r\n this._forcedOutputTexture = value;\r\n }\r\n\r\n /**\r\n * Since inputTexture should always be defined, if we previously manually set `inputTexture`,\r\n * the only way to unset it is to use this function to restore its internal state\r\n */\r\n public restoreDefaultInputTexture() {\r\n if (this._forcedOutputTexture) {\r\n this._forcedOutputTexture = null;\r\n this.markTextureDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets the camera which post process is applied to.\r\n * @returns The camera the post process is applied to.\r\n */\r\n public getCamera(): Camera {\r\n return this._camera;\r\n }\r\n\r\n /**\r\n * Gets the texel size of the postprocess.\r\n * See https://en.wikipedia.org/wiki/Texel_(graphics)\r\n */\r\n public get texelSize(): Vector2 {\r\n if (this._shareOutputWithPostProcess) {\r\n return this._shareOutputWithPostProcess.texelSize;\r\n }\r\n\r\n if (this._forcedOutputTexture) {\r\n this._texelSize.copyFromFloats(1.0 / this._forcedOutputTexture.width, 1.0 / this._forcedOutputTexture.height);\r\n }\r\n\r\n return this._texelSize;\r\n }\r\n\r\n protected readonly _effectWrapper: EffectWrapper;\r\n protected readonly _useExistingThinPostProcess: boolean;\r\n\r\n /**\r\n * Creates a new instance PostProcess\r\n * @param name The name of the PostProcess.\r\n * @param fragmentUrl The url of the fragment shader to be used.\r\n * @param options The options to be used when constructing the post process.\r\n */\r\n constructor(name: string, fragmentUrl: string, options?: PostProcessOptions);\r\n\r\n /**\r\n * Creates a new instance PostProcess\r\n * @param name The name of the PostProcess.\r\n * @param fragmentUrl The url of the fragment shader to be used.\r\n * @param parameters Array of the names of uniform non-sampler2D variables that will be passed to the shader.\r\n * @param samplers Array of the names of uniform sampler2D variables that will be passed to the shader.\r\n * @param options The required width/height ratio to downsize to before computing the render pass. (Use 1.0 for full size)\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param defines String of defines that will be set when running the fragment shader. (default: null)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param vertexUrl The url of the vertex shader to be used. (default: \"postprocess\")\r\n * @param indexParameters The index parameters to be used for babylons include syntax \"#include<kernelBlurVaryingDeclaration>[0..varyingCount]\". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx\r\n * @param blockCompilation If the shader should not be compiled immediatly. (default: false)\r\n * @param textureFormat Format of textures used when performing the post process. (default: TEXTUREFORMAT_RGBA)\r\n * @param shaderLanguage The shader language of the shader. (default: GLSL)\r\n * @param extraInitializations Defines additional code to call to prepare the shader code\r\n */\r\n constructor(\r\n name: string,\r\n fragmentUrl: string,\r\n parameters: Nullable<string[]>,\r\n samplers: Nullable<string[]>,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: AbstractEngine,\r\n reusable?: boolean,\r\n defines?: Nullable<string>,\r\n textureType?: number,\r\n vertexUrl?: string,\r\n indexParameters?: any,\r\n blockCompilation?: boolean,\r\n textureFormat?: number,\r\n shaderLanguage?: ShaderLanguage,\r\n extraInitializations?: (useWebGPU: boolean, list: Promise<any>[]) => void\r\n );\r\n\r\n /** @internal */\r\n constructor(\r\n name: string,\r\n fragmentUrl: string,\r\n parameters?: Nullable<string[]> | PostProcessOptions,\r\n samplers?: Nullable<string[]>,\r\n _size?: number | PostProcessOptions,\r\n camera?: Nullable<Camera>,\r\n samplingMode: number = Constants.TEXTURE_NEAREST_SAMPLINGMODE,\r\n engine?: AbstractEngine,\r\n reusable?: boolean,\r\n defines: Nullable<string> = null,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n vertexUrl: string = \"postprocess\",\r\n indexParameters?: any,\r\n blockCompilation = false,\r\n textureFormat = Constants.TEXTUREFORMAT_RGBA,\r\n shaderLanguage?: ShaderLanguage,\r\n extraInitializations?: (useWebGPU: boolean, list: Promise<any>[]) => void\r\n ) {\r\n let size: number | { width: number; height: number } = 1;\r\n let uniformBuffers: Nullable<string[]> = null;\r\n let effectWrapper: EffectWrapper | undefined;\r\n if (parameters && !Array.isArray(parameters)) {\r\n const options = parameters;\r\n parameters = options.uniforms ?? null;\r\n samplers = options.samplers ?? null;\r\n size = options.size ?? 1;\r\n camera = options.camera ?? null;\r\n samplingMode = options.samplingMode ?? Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n engine = options.engine;\r\n reusable = options.reusable;\r\n defines = Array.isArray(options.defines) ? options.defines.join(\"\\n\") : (options.defines ?? null);\r\n textureType = options.textureType ?? Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n vertexUrl = options.vertexUrl ?? \"postprocess\";\r\n indexParameters = options.indexParameters;\r\n blockCompilation = options.blockCompilation ?? false;\r\n textureFormat = options.textureFormat ?? Constants.TEXTUREFORMAT_RGBA;\r\n shaderLanguage = options.shaderLanguage ?? ShaderLanguage.GLSL;\r\n uniformBuffers = options.uniformBuffers ?? null;\r\n extraInitializations = options.extraInitializations;\r\n effectWrapper = options.effectWrapper;\r\n } else if (_size) {\r\n if (typeof _size === \"number\") {\r\n size = _size;\r\n } else {\r\n size = { width: _size.width!, height: _size.height! };\r\n }\r\n }\r\n\r\n this._useExistingThinPostProcess = !!effectWrapper;\r\n\r\n this._effectWrapper =\r\n effectWrapper ??\r\n new EffectWrapper({\r\n name,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: fragmentUrl,\r\n engine: engine || camera?.getScene().getEngine(),\r\n uniforms: parameters,\r\n samplers,\r\n uniformBuffers,\r\n defines,\r\n vertexUrl,\r\n indexParameters,\r\n blockCompilation: true,\r\n shaderLanguage,\r\n extraInitializations: undefined,\r\n });\r\n\r\n this.name = name;\r\n this.onEffectCreatedObservable = this._effectWrapper.onEffectCreatedObservable;\r\n\r\n if (camera != null) {\r\n this._camera = camera;\r\n this._scene = camera.getScene();\r\n camera.attachPostProcess(this);\r\n this._engine = this._scene.getEngine();\r\n\r\n this._scene.postProcesses.push(this);\r\n this.uniqueId = this._scene.getUniqueId();\r\n } else if (engine) {\r\n this._engine = engine;\r\n this._engine.postProcesses.push(this);\r\n }\r\n\r\n this._options = size;\r\n this.renderTargetSamplingMode = samplingMode ? samplingMode : Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n this._reusable = reusable || false;\r\n this._textureType = textureType;\r\n this._textureFormat = textureFormat;\r\n this._shaderLanguage = shaderLanguage || ShaderLanguage.GLSL;\r\n\r\n this._samplers = samplers || [];\r\n if (this._samplers.indexOf(\"textureSampler\") === -1) {\r\n this._samplers.push(\"textureSampler\");\r\n }\r\n\r\n this._fragmentUrl = fragmentUrl;\r\n this._vertexUrl = vertexUrl;\r\n this._parameters = parameters || [];\r\n\r\n if (this._parameters.indexOf(\"scale\") === -1) {\r\n this._parameters.push(\"scale\");\r\n }\r\n this._uniformBuffers = uniformBuffers || [];\r\n\r\n this._indexParameters = indexParameters;\r\n\r\n if (!this._useExistingThinPostProcess) {\r\n this._webGPUReady = this._shaderLanguage === ShaderLanguage.WGSL;\r\n\r\n const importPromises: Array<Promise<any>> = [];\r\n\r\n this._gatherImports(this._engine.isWebGPU && !PostProcess.ForceGLSL, importPromises);\r\n\r\n this._effectWrapper._webGPUReady = this._webGPUReady;\r\n this._effectWrapper._postConstructor(blockCompilation, defines, extraInitializations, importPromises);\r\n }\r\n }\r\n\r\n protected _gatherImports(useWebGPU = false, list: Promise<any>[]) {\r\n // this._webGPUReady is used to detect when a postprocess is intended to be used with WebGPU\r\n if (useWebGPU && this._webGPUReady) {\r\n list.push(Promise.all([import(\"../ShadersWGSL/postprocess.vertex\")]));\r\n } else {\r\n list.push(Promise.all([import(\"../Shaders/postprocess.vertex\")]));\r\n }\r\n }\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"PostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"PostProcess\";\r\n }\r\n\r\n /**\r\n * Gets the engine which this post process belongs to.\r\n * @returns The engine the post process was enabled with.\r\n */\r\n public getEngine(): AbstractEngine {\r\n return this._engine;\r\n }\r\n\r\n /**\r\n * The effect that is created when initializing the post process.\r\n * @returns The created effect corresponding to the postprocess.\r\n */\r\n public getEffect(): Effect {\r\n return this._effectWrapper.drawWrapper.effect!;\r\n }\r\n\r\n /**\r\n * To avoid multiple redundant textures for multiple post process, the output the output texture for this post process can be shared with another.\r\n * @param postProcess The post process to share the output with.\r\n * @returns This post process.\r\n */\r\n public shareOutputWith(postProcess: PostProcess): PostProcess {\r\n this._disposeTextures();\r\n\r\n this._shareOutputWithPostProcess = postProcess;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Reverses the effect of calling shareOutputWith and returns the post process back to its original state.\r\n * This should be called if the post process that shares output with this post process is disabled/disposed.\r\n */\r\n public useOwnOutput() {\r\n if (this._textures.length == 0) {\r\n this._textures = new SmartArray<RenderTargetWrapper>(2);\r\n }\r\n\r\n this._shareOutputWithPostProcess = null;\r\n }\r\n\r\n /**\r\n * Updates the effect with the current post process compile time values and recompiles the shader.\r\n * @param defines Define statements that should be added at the beginning of the shader. (default: null)\r\n * @param uniforms Set of uniform variables that will be passed to the shader. (default: null)\r\n * @param samplers Set of Texture2D variables that will be passed to the shader. (default: null)\r\n * @param indexParameters The index parameters to be used for babylons include syntax \"#include<kernelBlurVaryingDeclaration>[0..varyingCount]\". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx\r\n * @param onCompiled Called when the shader has been compiled.\r\n * @param onError Called if there is an error when compiling a shader.\r\n * @param vertexUrl The url of the vertex shader to be used (default: the one given at construction time)\r\n * @param fragmentUrl The url of the fragment shader to be used (default: the one given at construction time)\r\n */\r\n public updateEffect(\r\n defines: Nullable<string> = null,\r\n uniforms: Nullable<string[]> = null,\r\n samplers: Nullable<string[]> = null,\r\n indexParameters?: any,\r\n onCompiled?: (effect: Effect) => void,\r\n onError?: (effect: Effect, errors: string) => void,\r\n vertexUrl?: string,\r\n fragmentUrl?: string\r\n ) {\r\n this._effectWrapper.updateEffect(defines, uniforms, samplers, indexParameters, onCompiled, onError, vertexUrl, fragmentUrl);\r\n this._postProcessDefines = Array.isArray(this._effectWrapper.options.defines) ? this._effectWrapper.options.defines.join(\"\\n\") : this._effectWrapper.options.defines;\r\n }\r\n\r\n /**\r\n * The post process is reusable if it can be used multiple times within one frame.\r\n * @returns If the post process is reusable\r\n */\r\n public isReusable(): boolean {\r\n return this._reusable;\r\n }\r\n\r\n /** invalidate frameBuffer to hint the postprocess to create a depth buffer */\r\n public markTextureDirty(): void {\r\n this.width = -1;\r\n }\r\n\r\n private _createRenderTargetTexture(textureSize: { width: number; height: number }, textureOptions: RenderTargetCreationOptions, channel = 0) {\r\n for (let i = 0; i < this._textureCache.length; i++) {\r\n if (\r\n this._textureCache[i].texture.width === textureSize.width &&\r\n this._textureCache[i].texture.height === textureSize.height &&\r\n this._textureCache[i].postProcessChannel === channel &&\r\n this._textureCache[i].texture._generateDepthBuffer === textureOptions.generateDepthBuffer &&\r\n this._textureCache[i].texture.samples === textureOptions.samples\r\n ) {\r\n return this._textureCache[i].texture;\r\n }\r\n }\r\n\r\n const tex = this._engine.createRenderTargetTexture(textureSize, textureOptions);\r\n this._textureCache.push({ texture: tex, postProcessChannel: channel, lastUsedRenderId: -1 });\r\n\r\n return tex;\r\n }\r\n\r\n private _flushTextureCache() {\r\n const currentRenderId = this._renderId;\r\n\r\n for (let i = this._textureCache.length - 1; i >= 0; i--) {\r\n if (currentRenderId - this._textureCache[i].lastUsedRenderId > 100) {\r\n let currentlyUsed = false;\r\n for (let j = 0; j < this._textures.length; j++) {\r\n if (this._textures.data[j] === this._textureCache[i].texture) {\r\n currentlyUsed = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!currentlyUsed) {\r\n this._textureCache[i].texture.dispose();\r\n this._textureCache.splice(i, 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Resizes the post-process texture\r\n * @param width Width of the texture\r\n * @param height Height of the texture\r\n * @param camera The camera this post-process is applied to. Pass null if the post-process is used outside the context of a camera post-process chain (default: null)\r\n * @param needMipMaps True if mip maps need to be generated after render (default: false)\r\n * @param forceDepthStencil True to force post-process texture creation with stencil depth and buffer (default: false)\r\n */\r\n public resize(width: number, height: number, camera: Nullable<Camera> = null, needMipMaps = false, forceDepthStencil = false) {\r\n if (this._textures.length > 0) {\r\n this._textures.reset();\r\n }\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n let firstPP = null;\r\n if (camera) {\r\n for (let i = 0; i < camera._postProcesses.length; i++) {\r\n if (camera._postProcesses[i] !== null) {\r\n firstPP = camera._postProcesses[i];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n const textureSize = { width: this.width, height: this.height };\r\n const textureOptions = {\r\n generateMipMaps: needMipMaps,\r\n generateDepthBuffer: forceDepthStencil || firstPP === this,\r\n generateStencilBuffer: (forceDepthStencil || firstPP === this) && this._engine.isStencilEnable,\r\n samplingMode: this.renderTargetSamplingMode,\r\n type: this._textureType,\r\n format: this._textureFormat,\r\n samples: this._samples,\r\n label: \"PostProcessRTT-\" + this.name,\r\n };\r\n\r\n this._textures.push(this._createRenderTargetTexture(textureSize, textureOptions, 0));\r\n\r\n if (this._reusable) {\r\n this._textures.push(this._createRenderTargetTexture(textureSize, textureOptions, 1));\r\n }\r\n\r\n this._texelSize.copyFromFloats(1.0 / this.width, 1.0 / this.height);\r\n\r\n this.onSizeChangedObservable.notifyObservers(this);\r\n }\r\n\r\n private _getTarget() {\r\n let target: RenderTargetWrapper;\r\n\r\n if (this._shareOutputWithPostProcess) {\r\n target = this._shareOutputWithPostProcess.inputTexture;\r\n } else if (this._forcedOutputTexture) {\r\n target = this._forcedOutputTexture;\r\n\r\n this.width = this._forcedOutputTexture.width;\r\n this.height = this._forcedOutputTexture.height;\r\n } else {\r\n target = this.inputTexture;\r\n\r\n let cache;\r\n for (let i = 0; i < this._textureCache.length; i++) {\r\n if (this._textureCache[i].texture === target) {\r\n cache = this._textureCache[i];\r\n break;\r\n }\r\n }\r\n\r\n if (cache) {\r\n cache.lastUsedRenderId = this._renderId;\r\n }\r\n }\r\n\r\n return target;\r\n }\r\n\r\n /**\r\n * Activates the post process by intializing the textures to be used when executed. Notifies onActivateObservable.\r\n * When this post process is used in a pipeline, this is call will bind the input texture of this post process to the output of the previous.\r\n * @param cameraOrScene The camera that will be used in the post process. This camera will be used when calling onActivateObservable. You can also pass the scene if no camera is available.\r\n * @param sourceTexture The source texture to be inspected to get the width and height if not specified in the post process constructor. (default: null)\r\n * @param forceDepthStencil If true, a depth and stencil buffer will be generated. (default: false)\r\n * @returns The render target wrapper that was bound to be written to.\r\n */\r\n public activate(cameraOrScene: Nullable<Camera> | Scene, sourceTexture: Nullable<InternalTexture> = null, forceDepthStencil?: boolean): RenderTargetWrapper {\r\n const camera = cameraOrScene === null || (cameraOrScene as Camera).cameraRigMode !== undefined ? (cameraOrScene as Camera) || this._camera : null;\r\n\r\n const scene = camera?.getScene() ?? (cameraOrScene as Scene);\r\n const engine = scene.getEngine();\r\n const maxSize = engine.getCaps().maxTextureSize;\r\n\r\n const requiredWidth = ((sourceTexture ? sourceTexture.width : this._engine.getRenderWidth(true)) * <number>this._options) | 0;\r\n const requiredHeight = ((sourceTexture ? sourceTexture.height : this._engine.getRenderHeight(true)) * <number>this._options) | 0;\r\n\r\n let desiredWidth = (<PostProcessOptions>this._options).width || requiredWidth;\r\n let desiredHeight = (<PostProcessOptions>this._options).height || requiredHeight;\r\n\r\n const needMipMaps =\r\n this.renderTargetSamplingMode !== Constants.TEXTURE_NEAREST_LINEAR &&\r\n this.renderTargetSamplingMode !== Constants.TEXTURE_NEAREST_NEAREST &&\r\n this.renderTargetSamplingMode !== Constants.TEXTURE_LINEAR_LINEAR;\r\n\r\n let target: Nullable<RenderTargetWrapper> = null;\r\n\r\n if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {\r\n if (this.adaptScaleToCurrentViewport) {\r\n const currentViewport = engine.currentViewport;\r\n\r\n if (currentViewport) {\r\n desiredWidth *= currentViewport.width;\r\n desiredHeight *= currentViewport.height;\r\n }\r\n }\r\n\r\n if (needMipMaps || this.alwaysForcePOT) {\r\n if (!(<PostProcessOptions>this._options).width) {\r\n desiredWidth = engine.needPOTTextures ? GetExponentOfTwo(desiredWidth, maxSize, this.scaleMode) : desiredWidth;\r\n }\r\n\r\n if (!(<PostProcessOptions>this._options).height) {\r\n desiredHeight = engine.needPOTTextures ? GetExponentOfTwo(desiredHeight, maxSize, this.scaleMode) : desiredHeight;\r\n }\r\n }\r\n\r\n if (this.width !== desiredWidth || this.height !== desiredHeight || !(target = this._getTarget())) {\r\n this.resize(desiredWidth, desiredHeight, camera, needMipMaps, forceDepthStencil);\r\n }\r\n\r\n this._textures.forEach((texture) => {\r\n if (texture.samples !== this.samples) {\r\n this._engine.updateRenderTargetTextureSampleCount(texture, this.samples);\r\n }\r\n });\r\n\r\n this._flushTextureCache();\r\n this._renderId++;\r\n }\r\n\r\n if (!target) {\r\n target = this._getTarget();\r\n }\r\n\r\n // Bind the input of this post process to be used as the output of the previous post process.\r\n if (this.enablePixelPerfectMode) {\r\n this._scaleRatio.copyFromFloats(requiredWidth / desiredWidth, requiredHeight / desiredHeight);\r\n this._engine.bindFramebuffer(target, 0, requiredWidth, requiredHeight, this.forceFullscreenViewport);\r\n } else {\r\n this._scaleRatio.copyFromFloats(1, 1);\r\n this._engine.bindFramebuffer(target, 0, undefined, undefined, this.forceFullscreenViewport);\r\n }\r\n\r\n this._engine._debugInsertMarker?.(`post process ${this.name} input`);\r\n\r\n this.onActivateObservable.notifyObservers(camera!);\r\n\r\n // Clear\r\n if (this.autoClear && (this.alphaMode === Constants.ALPHA_DISABLE || this.forceAutoClearInAlphaMode)) {\r\n this._engine.clear(this.clearColor ? this.clearColor : scene.clearColor, scene._allowPostProcessClearColor, true, true);\r\n }\r\n\r\n if (this._reusable) {\r\n this._currentRenderTextureInd = (this._currentRenderTextureInd + 1) % 2;\r\n }\r\n return target;\r\n }\r\n\r\n /**\r\n * If the post process is supported.\r\n */\r\n public get isSupported(): boolean {\r\n return this._effectWrapper.drawWrapper.effect!.isSupported;\r\n }\r\n\r\n /**\r\n * The aspect ratio of the output texture.\r\n */\r\n public get aspectRatio(): number {\r\n if (this._shareOutputWithPostProcess) {\r\n return this._shareOutputWithPostProcess.aspectRatio;\r\n }\r\n\r\n if (this._forcedOutputTexture) {\r\n return this._forcedOutputTexture.width / this._forcedOutputTexture.height;\r\n }\r\n return this.width / this.height;\r\n }\r\n\r\n /**\r\n * Get a value indicating if the post-process is ready to be used\r\n * @returns true if the post-process is ready (shader is compiled)\r\n */\r\n public isReady(): boolean {\r\n return this._effectWrapper.isReady();\r\n }\r\n\r\n /**\r\n * Binds all textures and uniforms to the shader, this will be run on every pass.\r\n * @returns the effect corresponding to this post process. Null if not compiled or not ready.\r\n */\r\n public apply(): Nullable<Effect> {\r\n // Check\r\n if (!this._effectWrapper.isReady()) {\r\n return null;\r\n }\r\n\r\n // States\r\n this._engine.enableEffect(this._effectWrapper.drawWrapper);\r\n this._engine.setState(false);\r\n this._engine.setDepthBuffer(false);\r\n this._engine.setDepthWrite(false);\r\n\r\n // Alpha\r\n if (this.alphaConstants) {\r\n this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a);\r\n }\r\n\r\n // Bind the output texture of the preivous post process as the input to this post process.\r\n let source: RenderTargetWrapper;\r\n if (this._shareOutputWithPostProcess) {\r\n source = this._shareOutputWithPostProcess.inputTexture;\r\n } else if (this._forcedOutputTexture) {\r\n source = this._forcedOutputTexture;\r\n } else {\r\n source = this.inputTexture;\r\n }\r\n\r\n if (!this.externalTextureSamplerBinding) {\r\n this._effectWrapper.drawWrapper.effect!._bindTexture(\"textureSampler\", source?.texture);\r\n }\r\n\r\n // Parameters\r\n this._effectWrapper.drawWrapper.effect!.setVector2(\"scale\", this._scaleRatio);\r\n this.onApplyObservable.notifyObservers(this._effectWrapper.drawWrapper.effect!);\r\n\r\n this._effectWrapper.bind();\r\n\r\n return this._effectWrapper.drawWrapper.effect;\r\n }\r\n\r\n private _disposeTextures() {\r\n if (this._shareOutputWithPostProcess || this._forcedOutputTexture) {\r\n this._disposeTextureCache();\r\n return;\r\n }\r\n\r\n this._disposeTextureCache();\r\n this._textures.dispose();\r\n }\r\n\r\n private _disposeTextureCache() {\r\n for (let i = this._textureCache.length - 1; i >= 0; i--) {\r\n this._textureCache[i].texture.dispose();\r\n }\r\n\r\n this._textureCache.length = 0;\r\n }\r\n\r\n /**\r\n * Sets the required values to the prepass renderer.\r\n * @param prePassRenderer defines the prepass renderer to setup.\r\n * @returns true if the pre pass is needed.\r\n */\r\n public setPrePassRenderer(prePassRenderer: PrePassRenderer): boolean {\r\n if (this._prePassEffectConfiguration) {\r\n this._prePassEffectConfiguration = prePassRenderer.addEffectConfiguration(this._prePassEffectConfiguration);\r\n this._prePassEffectConfiguration.enabled = true;\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Disposes the post process.\r\n * @param camera The camera to dispose the post process on.\r\n */\r\n public dispose(camera?: Camera): void {\r\n camera = camera || this._camera;\r\n\r\n if (!this._useExistingThinPostProcess) {\r\n this._effectWrapper.dispose();\r\n }\r\n\r\n this._disposeTextures();\r\n\r\n let index;\r\n if (this._scene) {\r\n index = this._scene.postProcesses.indexOf(this);\r\n if (index !== -1) {\r\n this._scene.postProcesses.splice(index, 1);\r\n }\r\n }\r\n\r\n if (this._parentContainer) {\r\n const index = this._parentContainer.postProcesses.indexOf(this);\r\n if (index > -1) {\r\n this._parentContainer.postProcesses.splice(index, 1);\r\n }\r\n this._parentContainer = null;\r\n }\r\n\r\n index = this._engine.postProcesses.indexOf(this);\r\n if (index !== -1) {\r\n this._engine.postProcesses.splice(index, 1);\r\n }\r\n\r\n this.onDisposeObservable.notifyObservers();\r\n\r\n if (!camera) {\r\n return;\r\n }\r\n camera.detachPostProcess(this);\r\n\r\n index = camera._postProcesses.indexOf(this);\r\n if (index === 0 && camera._postProcesses.length > 0) {\r\n const firstPostProcess = this._camera._getFirstPostProcess();\r\n if (firstPostProcess) {\r\n firstPostProcess.markTextureDirty();\r\n }\r\n }\r\n\r\n this.onActivateObservable.clear();\r\n this.onAfterRenderObservable.clear();\r\n this.onApplyObservable.clear();\r\n this.onBeforeRenderObservable.clear();\r\n this.onSizeChangedObservable.clear();\r\n this.onEffectCreatedObservable.clear();\r\n }\r\n\r\n /**\r\n * Serializes the post process to a JSON object\r\n * @returns the JSON object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n const camera = this.getCamera() || (this._scene && this._scene.activeCamera);\r\n serializationObject.customType = \"BABYLON.\" + this.getClassName();\r\n serializationObject.cameraId = camera ? camera.id : null;\r\n serializationObject.reusable = this._reusable;\r\n serializationObject.textureType = this._textureType;\r\n serializationObject.fragmentUrl = this._fragmentUrl;\r\n serializationObject.parameters = this._parameters;\r\n serializationObject.samplers = this._samplers;\r\n serializationObject.uniformBuffers = this._uniformBuffers;\r\n serializationObject.options = this._options;\r\n serializationObject.defines = this._postProcessDefines;\r\n serializationObject.textureFormat = this._textureFormat;\r\n serializationObject.vertexUrl = this._vertexUrl;\r\n serializationObject.indexParameters = this._indexParameters;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Clones this post process\r\n * @returns a new post process similar to this one\r\n */\r\n public clone(): Nullable<PostProcess> {\r\n const serializationObject = this.serialize();\r\n serializationObject._engine = this._engine;\r\n serializationObject.cameraId = null;\r\n\r\n const result = PostProcess.Parse(serializationObject, this._scene, \"\");\r\n\r\n if (!result) {\r\n return null;\r\n }\r\n\r\n result.onActivateObservable = this.onActivateObservable.clone();\r\n result.onSizeChangedObservable = this.onSizeChangedObservable.clone();\r\n result.onApplyObservable = this.onApplyObservable.clone();\r\n result.onBeforeRenderObservable = this.onBeforeRenderObservable.clone();\r\n result.onAfterRenderObservable = this.onAfterRenderObservable.clone();\r\n\r\n result._prePassEffectConfiguration = this._prePassEffectConfiguration;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a material from parsed material data\r\n * @param parsedPostProcess defines parsed post process data\r\n * @param scene defines the hosting scene\r\n * @param rootUrl defines the root URL to use to load textures\r\n * @returns a new post process\r\n */\r\n public static Parse(parsedPostProcess: any, scene: Scene, rootUrl: string): Nullable<PostProcess> {\r\n const postProcessType = GetClass(parsedPostProcess.customType);\r\n\r\n if (!postProcessType || !postProcessType._Parse) {\r\n return null;\r\n }\r\n\r\n const camera = scene ? scene.getCameraById(parsedPostProcess.cameraId) : null;\r\n return postProcessType._Parse(parsedPostProcess, camera, scene, rootUrl);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _Parse(parsedPostProcess: any, targetCamera: Nullable<Camera>, scene: Nullable<Scene>, rootUrl: string): Nullable<PostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new PostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.fragmentUrl,\r\n parsedPostProcess.parameters,\r\n parsedPostProcess.samplers,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n parsedPostProcess._engine,\r\n parsedPostProcess.reusable,\r\n parsedPostProcess.defines,\r\n parsedPostProcess.textureType,\r\n parsedPostProcess.vertexUrl,\r\n parsedPostProcess.indexParameters,\r\n false,\r\n parsedPostProcess.textureFormat\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PostProcess\", PostProcess);\r\n"]}
|