1 |
- {"ast":null,"code":"import { __decorate } from \"../tslib.es6.js\";\nimport { SmartArray } from \"../Misc/smartArray.js\";\nimport { Observable } from \"../Misc/observable.js\";\nimport { Vector2 } from \"../Maths/math.vector.js\";\nimport { Effect } from \"../Materials/effect.js\";\nimport { serialize, serializeAsColor4 } from \"../Misc/decorators.js\";\nimport { SerializationHelper } from \"../Misc/decorators.serialization.js\";\nimport { GetClass, RegisterClass } from \"../Misc/typeStore.js\";\nimport { AbstractEngine } from \"../Engines/abstractEngine.js\";\nimport { GetExponentOfTwo } from \"../Misc/tools.functions.js\";\nimport { EffectWrapper } from \"../Materials/effectRenderer.js\";\nAbstractEngine.prototype.setTextureFromPostProcess = function (channel, postProcess, name) {\n var _postProcessInput$tex, _postProcessInput;\n let postProcessInput = null;\n if (postProcess) {\n if (postProcess._forcedOutputTexture) {\n postProcessInput = postProcess._forcedOutputTexture;\n } else if (postProcess._textures.data[postProcess._currentRenderTextureInd]) {\n postProcessInput = postProcess._textures.data[postProcess._currentRenderTextureInd];\n }\n }\n this._bindTexture(channel, (_postProcessInput$tex = (_postProcessInput = postProcessInput) === null || _postProcessInput === void 0 ? void 0 : _postProcessInput.texture) !== null && _postProcessInput$tex !== void 0 ? _postProcessInput$tex : null, name);\n};\nAbstractEngine.prototype.setTextureFromPostProcessOutput = function (channel, postProcess, name) {\n var _postProcess$_outputT, _postProcess$_outputT2;\n this._bindTexture(channel, (_postProcess$_outputT = postProcess === null || postProcess === void 0 || (_postProcess$_outputT2 = postProcess._outputTexture) === null || _postProcess$_outputT2 === void 0 ? void 0 : _postProcess$_outputT2.texture) !== null && _postProcess$_outputT !== void 0 ? _postProcess$_outputT : null, name);\n};\n/**\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)\n * @param channel Name of the sampler variable.\n * @param postProcess Post process to get the input texture from.\n */\nEffect.prototype.setTextureFromPostProcess = function (channel, postProcess) {\n this._engine.setTextureFromPostProcess(this._samplers[channel], postProcess, channel);\n};\n/**\n * (Warning! setTextureFromPostProcessOutput may be desired instead)\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)\n * @param channel Name of the sampler variable.\n * @param postProcess Post process to get the output texture from.\n */\nEffect.prototype.setTextureFromPostProcessOutput = function (channel, postProcess) {\n this._engine.setTextureFromPostProcessOutput(this._samplers[channel], postProcess, channel);\n};\n/**\n * PostProcess can be used to apply a shader to a texture after it has been rendered\n * See https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses\n */\nexport class PostProcess {\n /**\n * Force all the postprocesses to compile to glsl even on WebGPU engines.\n * False by default. This is mostly meant for backward compatibility.\n */\n static get ForceGLSL() {\n return EffectWrapper.ForceGLSL;\n }\n static set ForceGLSL(force) {\n EffectWrapper.ForceGLSL = force;\n }\n /**\n * Registers a shader code processing with a post process name.\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\n * @param customShaderCodeProcessing shader code processing to associate to the post process name\n */\n static RegisterShaderCodeProcessing(postProcessName, customShaderCodeProcessing) {\n EffectWrapper.RegisterShaderCodeProcessing(postProcessName, customShaderCodeProcessing);\n }\n /** Name of the PostProcess. */\n get name() {\n return this._effectWrapper.name;\n }\n set name(value) {\n this._effectWrapper.name = value;\n }\n /**\n * Type of alpha mode to use when performing the post process (default: Engine.ALPHA_DISABLE)\n */\n get alphaMode() {\n return this._effectWrapper.alphaMode;\n }\n set alphaMode(value) {\n this._effectWrapper.alphaMode = value;\n }\n /**\n * Number of sample textures (default: 1)\n */\n get samples() {\n return this._samples;\n }\n set samples(n) {\n this._samples = Math.min(n, this._engine.getCaps().maxMSAASamples);\n this._textures.forEach(texture => {\n texture.setSamples(this._samples);\n });\n }\n /**\n * Gets the shader language type used to generate vertex and fragment source code.\n */\n get shaderLanguage() {\n return this._shaderLanguage;\n }\n /**\n * Returns the fragment url or shader name used in the post process.\n * @returns the fragment url or name in the shader store.\n */\n getEffectName() {\n return this._fragmentUrl;\n }\n /**\n * A function that is added to the onActivateObservable\n */\n set onActivate(callback) {\n if (this._onActivateObserver) {\n this.onActivateObservable.remove(this._onActivateObserver);\n }\n if (callback) {\n this._onActivateObserver = this.onActivateObservable.add(callback);\n }\n }\n /**\n * A function that is added to the onSizeChangedObservable\n */\n set onSizeChanged(callback) {\n if (this._onSizeChangedObserver) {\n this.onSizeChangedObservable.remove(this._onSizeChangedObserver);\n }\n this._onSizeChangedObserver = this.onSizeChangedObservable.add(callback);\n }\n /**\n * A function that is added to the onApplyObservable\n */\n set onApply(callback) {\n if (this._onApplyObserver) {\n this.onApplyObservable.remove(this._onApplyObserver);\n }\n this._onApplyObserver = this.onApplyObservable.add(callback);\n }\n /**\n * A function that is added to the onBeforeRenderObservable\n */\n set onBeforeRender(callback) {\n if (this._onBeforeRenderObserver) {\n this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);\n }\n this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);\n }\n /**\n * A function that is added to the onAfterRenderObservable\n */\n set onAfterRender(callback) {\n if (this._onAfterRenderObserver) {\n this.onAfterRenderObservable.remove(this._onAfterRenderObserver);\n }\n this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);\n }\n /**\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\n * render it's output into this texture and this texture will be used as textureSampler in the fragment shader of this post process.\n */\n get inputTexture() {\n return this._textures.data[this._currentRenderTextureInd];\n }\n set inputTexture(value) {\n this._forcedOutputTexture = value;\n }\n /**\n * Since inputTexture should always be defined, if we previously manually set `inputTexture`,\n * the only way to unset it is to use this function to restore its internal state\n */\n restoreDefaultInputTexture() {\n if (this._forcedOutputTexture) {\n this._forcedOutputTexture = null;\n this.markTextureDirty();\n }\n }\n /**\n * Gets the camera which post process is applied to.\n * @returns The camera the post process is applied to.\n */\n getCamera() {\n return this._camera;\n }\n /**\n * Gets the texel size of the postprocess.\n * See https://en.wikipedia.org/wiki/Texel_(graphics)\n */\n get texelSize() {\n if (this._shareOutputWithPostProcess) {\n return this._shareOutputWithPostProcess.texelSize;\n }\n if (this._forcedOutputTexture) {\n this._texelSize.copyFromFloats(1.0 / this._forcedOutputTexture.width, 1.0 / this._forcedOutputTexture.height);\n }\n return this._texelSize;\n }\n /** @internal */\n constructor(name, fragmentUrl, parameters, samplers, _size, camera, samplingMode = 1, engine, reusable, defines = null, textureType = 0, vertexUrl = \"postprocess\", indexParameters, blockCompilation = false, textureFormat = 5, shaderLanguage, extraInitializations) {\n var _effectWrapper, _camera;\n /** @internal */\n this._parentContainer = null;\n /**\n * Width of the texture to apply the post process on\n */\n this.width = -1;\n /**\n * Height of the texture to apply the post process on\n */\n this.height = -1;\n /**\n * Gets the node material used to create this postprocess (null if the postprocess was manually created)\n */\n this.nodeMaterialSource = null;\n /**\n * Internal, reference to the location where this postprocess was output to. (Typically the texture on the next postprocess in the chain)\n * @internal\n */\n this._outputTexture = null;\n /**\n * If the buffer needs to be cleared before applying the post process. (default: true)\n * Should be set to false if shader will overwrite all previous pixels.\n */\n this.autoClear = true;\n /**\n * If clearing the buffer should be forced in autoClear mode, even when alpha mode is enabled (default: false).\n * By default, the buffer will only be cleared if alpha mode is disabled (and autoClear is true).\n */\n this.forceAutoClearInAlphaMode = false;\n /**\n * Animations to be used for the post processing\n */\n this.animations = [];\n /**\n * Enable Pixel Perfect mode where texture is not scaled to be power of 2.\n * Can only be used on a single postprocess or on the last one of a chain. (default: false)\n */\n this.enablePixelPerfectMode = false;\n /**\n * Force the postprocess to be applied without taking in account viewport\n */\n this.forceFullscreenViewport = true;\n /**\n * Scale mode for the post process (default: Engine.SCALEMODE_FLOOR)\n *\n * | Value | Type | Description |\n * | ----- | ----------------------------------- | ----------- |\n * | 1 | SCALEMODE_FLOOR | [engine.scalemode_floor](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_floor) |\n * | 2 | SCALEMODE_NEAREST | [engine.scalemode_nearest](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_nearest) |\n * | 3 | SCALEMODE_CEILING | [engine.scalemode_ceiling](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_ceiling) |\n *\n */\n this.scaleMode = 1;\n /**\n * Force textures to be a power of two (default: false)\n */\n this.alwaysForcePOT = false;\n this._samples = 1;\n /**\n * Modify the scale of the post process to be the same as the viewport (default: false)\n */\n this.adaptScaleToCurrentViewport = false;\n this._webGPUReady = false;\n this._reusable = false;\n this._renderId = 0;\n /**\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).\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\n * internal structures (materialContext) will be dirtified, which may impact performances\n */\n this.externalTextureSamplerBinding = false;\n /**\n * Smart array of input and output textures for the post process.\n * @internal\n */\n this._textures = new SmartArray(2);\n /**\n * Smart array of input and output textures for the post process.\n * @internal\n */\n this._textureCache = [];\n /**\n * The index in _textures that corresponds to the output texture.\n * @internal\n */\n this._currentRenderTextureInd = 0;\n this._scaleRatio = new Vector2(1, 1);\n this._texelSize = Vector2.Zero();\n // Events\n /**\n * An event triggered when the postprocess is activated.\n */\n this.onActivateObservable = new Observable();\n /**\n * An event triggered when the postprocess changes its size.\n */\n this.onSizeChangedObservable = new Observable();\n /**\n * An event triggered when the postprocess applies its effect.\n */\n this.onApplyObservable = new Observable();\n /**\n * An event triggered before rendering the postprocess\n */\n this.onBeforeRenderObservable = new Observable();\n /**\n * An event triggered after rendering the postprocess\n */\n this.onAfterRenderObservable = new Observable();\n let size = 1;\n let uniformBuffers = null;\n let effectWrapper;\n if (parameters && !Array.isArray(parameters)) {\n var _options$uniforms, _options$samplers, _options$size, _options$camera, _options$samplingMode, _options$defines, _options$textureType, _options$vertexUrl, _options$blockCompila, _options$textureForma, _options$shaderLangua, _options$uniformBuffe;\n const options = parameters;\n parameters = (_options$uniforms = options.uniforms) !== null && _options$uniforms !== void 0 ? _options$uniforms : null;\n samplers = (_options$samplers = options.samplers) !== null && _options$samplers !== void 0 ? _options$samplers : null;\n size = (_options$size = options.size) !== null && _options$size !== void 0 ? _options$size : 1;\n camera = (_options$camera = options.camera) !== null && _options$camera !== void 0 ? _options$camera : null;\n samplingMode = (_options$samplingMode = options.samplingMode) !== null && _options$samplingMode !== void 0 ? _options$samplingMode : 1;\n engine = options.engine;\n reusable = options.reusable;\n defines = Array.isArray(options.defines) ? options.defines.join(\"\\n\") : (_options$defines = options.defines) !== null && _options$defines !== void 0 ? _options$defines : null;\n textureType = (_options$textureType = options.textureType) !== null && _options$textureType !== void 0 ? _options$textureType : 0;\n vertexUrl = (_options$vertexUrl = options.vertexUrl) !== null && _options$vertexUrl !== void 0 ? _options$vertexUrl : \"postprocess\";\n indexParameters = options.indexParameters;\n blockCompilation = (_options$blockCompila = options.blockCompilation) !== null && _options$blockCompila !== void 0 ? _options$blockCompila : false;\n textureFormat = (_options$textureForma = options.textureFormat) !== null && _options$textureForma !== void 0 ? _options$textureForma : 5;\n shaderLanguage = (_options$shaderLangua = options.shaderLanguage) !== null && _options$shaderLangua !== void 0 ? _options$shaderLangua : 0 /* ShaderLanguage.GLSL */;\n uniformBuffers = (_options$uniformBuffe = options.uniformBuffers) !== null && _options$uniformBuffe !== void 0 ? _options$uniformBuffe : null;\n extraInitializations = options.extraInitializations;\n effectWrapper = options.effectWrapper;\n } else if (_size) {\n if (typeof _size === \"number\") {\n size = _size;\n } else {\n size = {\n width: _size.width,\n height: _size.height\n };\n }\n }\n const useExistingThinPostProcess = !!effectWrapper;\n this._effectWrapper = (_effectWrapper = effectWrapper) !== null && _effectWrapper !== void 0 ? _effectWrapper : new EffectWrapper({\n name,\n useShaderStore: true,\n useAsPostProcess: true,\n fragmentShader: fragmentUrl,\n engine: engine || ((_camera = camera) === null || _camera === void 0 ? void 0 : _camera.getScene().getEngine()),\n uniforms: parameters,\n samplers,\n uniformBuffers,\n defines,\n vertexUrl,\n indexParameters,\n blockCompilation: true,\n shaderLanguage,\n extraInitializations: undefined\n });\n this.name = name;\n this.onEffectCreatedObservable = this._effectWrapper.onEffectCreatedObservable;\n if (camera != null) {\n this._camera = camera;\n this._scene = camera.getScene();\n camera.attachPostProcess(this);\n this._engine = this._scene.getEngine();\n this._scene.postProcesses.push(this);\n this.uniqueId = this._scene.getUniqueId();\n } else if (engine) {\n this._engine = engine;\n this._engine.postProcesses.push(this);\n }\n this._options = size;\n this.renderTargetSamplingMode = samplingMode ? samplingMode : 1;\n this._reusable = reusable || false;\n this._textureType = textureType;\n this._textureFormat = textureFormat;\n this._shaderLanguage = shaderLanguage || 0 /* ShaderLanguage.GLSL */;\n this._samplers = samplers || [];\n if (this._samplers.indexOf(\"textureSampler\") === -1) {\n this._samplers.push(\"textureSampler\");\n }\n this._fragmentUrl = fragmentUrl;\n this._vertexUrl = vertexUrl;\n this._parameters = parameters || [];\n if (this._parameters.indexOf(\"scale\") === -1) {\n this._parameters.push(\"scale\");\n }\n this._uniformBuffers = uniformBuffers || [];\n this._indexParameters = indexParameters;\n if (!useExistingThinPostProcess) {\n this._webGPUReady = this._shaderLanguage === 1 /* ShaderLanguage.WGSL */;\n const importPromises = [];\n this._gatherImports(this._engine.isWebGPU && !PostProcess.ForceGLSL, importPromises);\n this._effectWrapper._webGPUReady = this._webGPUReady;\n this._effectWrapper._postConstructor(blockCompilation, defines, extraInitializations, importPromises);\n }\n }\n _gatherImports(useWebGPU = false, list) {\n // this._webGPUReady is used to detect when a postprocess is intended to be used with WebGPU\n if (useWebGPU && this._webGPUReady) {\n list.push(Promise.all([import(\"../ShadersWGSL/postprocess.vertex.js\")]));\n } else {\n list.push(Promise.all([import(\"../Shaders/postprocess.vertex.js\")]));\n }\n }\n /**\n * Gets a string identifying the name of the class\n * @returns \"PostProcess\" string\n */\n getClassName() {\n return \"PostProcess\";\n }\n /**\n * Gets the engine which this post process belongs to.\n * @returns The engine the post process was enabled with.\n */\n getEngine() {\n return this._engine;\n }\n /**\n * The effect that is created when initializing the post process.\n * @returns The created effect corresponding to the postprocess.\n */\n getEffect() {\n return this._effectWrapper.drawWrapper.effect;\n }\n /**\n * To avoid multiple redundant textures for multiple post process, the output the output texture for this post process can be shared with another.\n * @param postProcess The post process to share the output with.\n * @returns This post process.\n */\n shareOutputWith(postProcess) {\n this._disposeTextures();\n this._shareOutputWithPostProcess = postProcess;\n return this;\n }\n /**\n * Reverses the effect of calling shareOutputWith and returns the post process back to its original state.\n * This should be called if the post process that shares output with this post process is disabled/disposed.\n */\n useOwnOutput() {\n if (this._textures.length == 0) {\n this._textures = new SmartArray(2);\n }\n this._shareOutputWithPostProcess = null;\n }\n /**\n * Updates the effect with the current post process compile time values and recompiles the shader.\n * @param defines Define statements that should be added at the beginning of the shader. (default: null)\n * @param uniforms Set of uniform variables that will be passed to the shader. (default: null)\n * @param samplers Set of Texture2D variables that will be passed to the shader. (default: null)\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\n * @param onCompiled Called when the shader has been compiled.\n * @param onError Called if there is an error when compiling a shader.\n * @param vertexUrl The url of the vertex shader to be used (default: the one given at construction time)\n * @param fragmentUrl The url of the fragment shader to be used (default: the one given at construction time)\n */\n updateEffect(defines = null, uniforms = null, samplers = null, indexParameters, onCompiled, onError, vertexUrl, fragmentUrl) {\n this._effectWrapper.updateEffect(defines, uniforms, samplers, indexParameters, onCompiled, onError, vertexUrl, fragmentUrl);\n this._postProcessDefines = Array.isArray(this._effectWrapper.options.defines) ? this._effectWrapper.options.defines.join(\"\\n\") : this._effectWrapper.options.defines;\n }\n /**\n * The post process is reusable if it can be used multiple times within one frame.\n * @returns If the post process is reusable\n */\n isReusable() {\n return this._reusable;\n }\n /** invalidate frameBuffer to hint the postprocess to create a depth buffer */\n markTextureDirty() {\n this.width = -1;\n }\n _createRenderTargetTexture(textureSize, textureOptions, channel = 0) {\n for (let i = 0; i < this._textureCache.length; i++) {\n if (this._textureCache[i].texture.width === textureSize.width && this._textureCache[i].texture.height === textureSize.height && this._textureCache[i].postProcessChannel === channel && this._textureCache[i].texture._generateDepthBuffer === textureOptions.generateDepthBuffer && this._textureCache[i].texture.samples === textureOptions.samples) {\n return this._textureCache[i].texture;\n }\n }\n const tex = this._engine.createRenderTargetTexture(textureSize, textureOptions);\n this._textureCache.push({\n texture: tex,\n postProcessChannel: channel,\n lastUsedRenderId: -1\n });\n return tex;\n }\n _flushTextureCache() {\n const currentRenderId = this._renderId;\n for (let i = this._textureCache.length - 1; i >= 0; i--) {\n if (currentRenderId - this._textureCache[i].lastUsedRenderId > 100) {\n let currentlyUsed = false;\n for (let j = 0; j < this._textures.length; j++) {\n if (this._textures.data[j] === this._textureCache[i].texture) {\n currentlyUsed = true;\n break;\n }\n }\n if (!currentlyUsed) {\n this._textureCache[i].texture.dispose();\n this._textureCache.splice(i, 1);\n }\n }\n }\n }\n /**\n * Resizes the post-process texture\n * @param width Width of the texture\n * @param height Height of the texture\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)\n * @param needMipMaps True if mip maps need to be generated after render (default: false)\n * @param forceDepthStencil True to force post-process texture creation with stencil depth and buffer (default: false)\n */\n resize(width, height, camera = null, needMipMaps = false, forceDepthStencil = false) {\n if (this._textures.length > 0) {\n this._textures.reset();\n }\n this.width = width;\n this.height = height;\n let firstPP = null;\n if (camera) {\n for (let i = 0; i < camera._postProcesses.length; i++) {\n if (camera._postProcesses[i] !== null) {\n firstPP = camera._postProcesses[i];\n break;\n }\n }\n }\n const textureSize = {\n width: this.width,\n height: this.height\n };\n const textureOptions = {\n generateMipMaps: needMipMaps,\n generateDepthBuffer: forceDepthStencil || firstPP === this,\n generateStencilBuffer: (forceDepthStencil || firstPP === this) && this._engine.isStencilEnable,\n samplingMode: this.renderTargetSamplingMode,\n type: this._textureType,\n format: this._textureFormat,\n samples: this._samples,\n label: \"PostProcessRTT-\" + this.name\n };\n this._textures.push(this._createRenderTargetTexture(textureSize, textureOptions, 0));\n if (this._reusable) {\n this._textures.push(this._createRenderTargetTexture(textureSize, textureOptions, 1));\n }\n this._texelSize.copyFromFloats(1.0 / this.width, 1.0 / this.height);\n this.onSizeChangedObservable.notifyObservers(this);\n }\n _getTarget() {\n let target;\n if (this._shareOutputWithPostProcess) {\n target = this._shareOutputWithPostProcess.inputTexture;\n } else if (this._forcedOutputTexture) {\n target = this._forcedOutputTexture;\n this.width = this._forcedOutputTexture.width;\n this.height = this._forcedOutputTexture.height;\n } else {\n target = this.inputTexture;\n let cache;\n for (let i = 0; i < this._textureCache.length; i++) {\n if (this._textureCache[i].texture === target) {\n cache = this._textureCache[i];\n break;\n }\n }\n if (cache) {\n cache.lastUsedRenderId = this._renderId;\n }\n }\n return target;\n }\n /**\n * Activates the post process by intializing the textures to be used when executed. Notifies onActivateObservable.\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.\n * @param camera The camera that will be used in the post process. This camera will be used when calling onActivateObservable.\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)\n * @param forceDepthStencil If true, a depth and stencil buffer will be generated. (default: false)\n * @returns The render target wrapper that was bound to be written to.\n */\n activate(camera, sourceTexture = null, forceDepthStencil) {\n var _this$_engine$_debugI, _this$_engine;\n camera = camera || this._camera;\n const scene = camera.getScene();\n const engine = scene.getEngine();\n const maxSize = engine.getCaps().maxTextureSize;\n const requiredWidth = (sourceTexture ? sourceTexture.width : this._engine.getRenderWidth(true)) * this._options | 0;\n const requiredHeight = (sourceTexture ? sourceTexture.height : this._engine.getRenderHeight(true)) * this._options | 0;\n let desiredWidth = this._options.width || requiredWidth;\n let desiredHeight = this._options.height || requiredHeight;\n const needMipMaps = this.renderTargetSamplingMode !== 7 && this.renderTargetSamplingMode !== 1 && this.renderTargetSamplingMode !== 2;\n let target = null;\n if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {\n if (this.adaptScaleToCurrentViewport) {\n const currentViewport = engine.currentViewport;\n if (currentViewport) {\n desiredWidth *= currentViewport.width;\n desiredHeight *= currentViewport.height;\n }\n }\n if (needMipMaps || this.alwaysForcePOT) {\n if (!this._options.width) {\n desiredWidth = engine.needPOTTextures ? GetExponentOfTwo(desiredWidth, maxSize, this.scaleMode) : desiredWidth;\n }\n if (!this._options.height) {\n desiredHeight = engine.needPOTTextures ? GetExponentOfTwo(desiredHeight, maxSize, this.scaleMode) : desiredHeight;\n }\n }\n if (this.width !== desiredWidth || this.height !== desiredHeight || !(target = this._getTarget())) {\n this.resize(desiredWidth, desiredHeight, camera, needMipMaps, forceDepthStencil);\n }\n this._textures.forEach(texture => {\n if (texture.samples !== this.samples) {\n this._engine.updateRenderTargetTextureSampleCount(texture, this.samples);\n }\n });\n this._flushTextureCache();\n this._renderId++;\n }\n if (!target) {\n target = this._getTarget();\n }\n // Bind the input of this post process to be used as the output of the previous post process.\n if (this.enablePixelPerfectMode) {\n this._scaleRatio.copyFromFloats(requiredWidth / desiredWidth, requiredHeight / desiredHeight);\n this._engine.bindFramebuffer(target, 0, requiredWidth, requiredHeight, this.forceFullscreenViewport);\n } else {\n this._scaleRatio.copyFromFloats(1, 1);\n this._engine.bindFramebuffer(target, 0, undefined, undefined, this.forceFullscreenViewport);\n }\n (_this$_engine$_debugI = (_this$_engine = this._engine)._debugInsertMarker) === null || _this$_engine$_debugI === void 0 || _this$_engine$_debugI.call(_this$_engine, `post process ${this.name} input`);\n this.onActivateObservable.notifyObservers(camera);\n // Clear\n if (this.autoClear && (this.alphaMode === 0 || this.forceAutoClearInAlphaMode)) {\n this._engine.clear(this.clearColor ? this.clearColor : scene.clearColor, scene._allowPostProcessClearColor, true, true);\n }\n if (this._reusable) {\n this._currentRenderTextureInd = (this._currentRenderTextureInd + 1) % 2;\n }\n return target;\n }\n /**\n * If the post process is supported.\n */\n get isSupported() {\n return this._effectWrapper.drawWrapper.effect.isSupported;\n }\n /**\n * The aspect ratio of the output texture.\n */\n get aspectRatio() {\n if (this._shareOutputWithPostProcess) {\n return this._shareOutputWithPostProcess.aspectRatio;\n }\n if (this._forcedOutputTexture) {\n return this._forcedOutputTexture.width / this._forcedOutputTexture.height;\n }\n return this.width / this.height;\n }\n /**\n * Get a value indicating if the post-process is ready to be used\n * @returns true if the post-process is ready (shader is compiled)\n */\n isReady() {\n return this._effectWrapper.isReady();\n }\n /**\n * Binds all textures and uniforms to the shader, this will be run on every pass.\n * @returns the effect corresponding to this post process. Null if not compiled or not ready.\n */\n apply() {\n // Check\n if (!this._effectWrapper.isReady()) {\n return null;\n }\n // States\n this._engine.enableEffect(this._effectWrapper.drawWrapper);\n this._engine.setState(false);\n this._engine.setDepthBuffer(false);\n this._engine.setDepthWrite(false);\n // Alpha\n if (this.alphaConstants) {\n this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a);\n }\n // Bind the output texture of the preivous post process as the input to this post process.\n let source;\n if (this._shareOutputWithPostProcess) {\n source = this._shareOutputWithPostProcess.inputTexture;\n } else if (this._forcedOutputTexture) {\n source = this._forcedOutputTexture;\n } else {\n source = this.inputTexture;\n }\n if (!this.externalTextureSamplerBinding) {\n var _source;\n this._effectWrapper.drawWrapper.effect._bindTexture(\"textureSampler\", (_source = source) === null || _source === void 0 ? void 0 : _source.texture);\n }\n // Parameters\n this._effectWrapper.drawWrapper.effect.setVector2(\"scale\", this._scaleRatio);\n this.onApplyObservable.notifyObservers(this._effectWrapper.drawWrapper.effect);\n this._effectWrapper.bind();\n return this._effectWrapper.drawWrapper.effect;\n }\n _disposeTextures() {\n if (this._shareOutputWithPostProcess || this._forcedOutputTexture) {\n this._disposeTextureCache();\n return;\n }\n this._disposeTextureCache();\n this._textures.dispose();\n }\n _disposeTextureCache() {\n for (let i = this._textureCache.length - 1; i >= 0; i--) {\n this._textureCache[i].texture.dispose();\n }\n this._textureCache.length = 0;\n }\n /**\n * Sets the required values to the prepass renderer.\n * @param prePassRenderer defines the prepass renderer to setup.\n * @returns true if the pre pass is needed.\n */\n setPrePassRenderer(prePassRenderer) {\n if (this._prePassEffectConfiguration) {\n this._prePassEffectConfiguration = prePassRenderer.addEffectConfiguration(this._prePassEffectConfiguration);\n this._prePassEffectConfiguration.enabled = true;\n return true;\n }\n return false;\n }\n /**\n * Disposes the post process.\n * @param camera The camera to dispose the post process on.\n */\n dispose(camera) {\n camera = camera || this._camera;\n this._disposeTextures();\n let index;\n if (this._scene) {\n index = this._scene.postProcesses.indexOf(this);\n if (index !== -1) {\n this._scene.postProcesses.splice(index, 1);\n }\n }\n if (this._parentContainer) {\n const index = this._parentContainer.postProcesses.indexOf(this);\n if (index > -1) {\n this._parentContainer.postProcesses.splice(index, 1);\n }\n this._parentContainer = null;\n }\n index = this._engine.postProcesses.indexOf(this);\n if (index !== -1) {\n this._engine.postProcesses.splice(index, 1);\n }\n if (!camera) {\n return;\n }\n camera.detachPostProcess(this);\n index = camera._postProcesses.indexOf(this);\n if (index === 0 && camera._postProcesses.length > 0) {\n const firstPostProcess = this._camera._getFirstPostProcess();\n if (firstPostProcess) {\n firstPostProcess.markTextureDirty();\n }\n }\n this.onActivateObservable.clear();\n this.onAfterRenderObservable.clear();\n this.onApplyObservable.clear();\n this.onBeforeRenderObservable.clear();\n this.onSizeChangedObservable.clear();\n this.onEffectCreatedObservable.clear();\n }\n /**\n * Serializes the post process to a JSON object\n * @returns the JSON object\n */\n serialize() {\n const serializationObject = SerializationHelper.Serialize(this);\n const camera = this.getCamera() || this._scene && this._scene.activeCamera;\n serializationObject.customType = \"BABYLON.\" + this.getClassName();\n serializationObject.cameraId = camera ? camera.id : null;\n serializationObject.reusable = this._reusable;\n serializationObject.textureType = this._textureType;\n serializationObject.fragmentUrl = this._fragmentUrl;\n serializationObject.parameters = this._parameters;\n serializationObject.samplers = this._samplers;\n serializationObject.uniformBuffers = this._uniformBuffers;\n serializationObject.options = this._options;\n serializationObject.defines = this._postProcessDefines;\n serializationObject.textureFormat = this._textureFormat;\n serializationObject.vertexUrl = this._vertexUrl;\n serializationObject.indexParameters = this._indexParameters;\n return serializationObject;\n }\n /**\n * Clones this post process\n * @returns a new post process similar to this one\n */\n clone() {\n const serializationObject = this.serialize();\n serializationObject._engine = this._engine;\n serializationObject.cameraId = null;\n const result = PostProcess.Parse(serializationObject, this._scene, \"\");\n if (!result) {\n return null;\n }\n result.onActivateObservable = this.onActivateObservable.clone();\n result.onSizeChangedObservable = this.onSizeChangedObservable.clone();\n result.onApplyObservable = this.onApplyObservable.clone();\n result.onBeforeRenderObservable = this.onBeforeRenderObservable.clone();\n result.onAfterRenderObservable = this.onAfterRenderObservable.clone();\n result._prePassEffectConfiguration = this._prePassEffectConfiguration;\n return result;\n }\n /**\n * Creates a material from parsed material data\n * @param parsedPostProcess defines parsed post process data\n * @param scene defines the hosting scene\n * @param rootUrl defines the root URL to use to load textures\n * @returns a new post process\n */\n static Parse(parsedPostProcess, scene, rootUrl) {\n const postProcessType = GetClass(parsedPostProcess.customType);\n if (!postProcessType || !postProcessType._Parse) {\n return null;\n }\n const camera = scene ? scene.getCameraById(parsedPostProcess.cameraId) : null;\n return postProcessType._Parse(parsedPostProcess, camera, scene, rootUrl);\n }\n /**\n * @internal\n */\n static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {\n return SerializationHelper.Parse(() => {\n return new PostProcess(parsedPostProcess.name, parsedPostProcess.fragmentUrl, parsedPostProcess.parameters, parsedPostProcess.samplers, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable, parsedPostProcess.defines, parsedPostProcess.textureType, parsedPostProcess.vertexUrl, parsedPostProcess.indexParameters, false, parsedPostProcess.textureFormat);\n }, parsedPostProcess, scene, rootUrl);\n }\n}\n__decorate([serialize()], PostProcess.prototype, \"uniqueId\", void 0);\n__decorate([serialize()], PostProcess.prototype, \"name\", null);\n__decorate([serialize()], PostProcess.prototype, \"width\", void 0);\n__decorate([serialize()], PostProcess.prototype, \"height\", void 0);\n__decorate([serialize()], PostProcess.prototype, \"renderTargetSamplingMode\", void 0);\n__decorate([serializeAsColor4()], PostProcess.prototype, \"clearColor\", void 0);\n__decorate([serialize()], PostProcess.prototype, \"autoClear\", void 0);\n__decorate([serialize()], PostProcess.prototype, \"forceAutoClearInAlphaMode\", void 0);\n__decorate([serialize()], PostProcess.prototype, \"alphaMode\", null);\n__decorate([serialize()], PostProcess.prototype, \"alphaConstants\", void 0);\n__decorate([serialize()], PostProcess.prototype, \"enablePixelPerfectMode\", void 0);\n__decorate([serialize()], PostProcess.prototype, \"forceFullscreenViewport\", void 0);\n__decorate([serialize()], PostProcess.prototype, \"scaleMode\", void 0);\n__decorate([serialize()], PostProcess.prototype, \"alwaysForcePOT\", void 0);\n__decorate([serialize(\"samples\")], PostProcess.prototype, \"_samples\", void 0);\n__decorate([serialize()], PostProcess.prototype, \"adaptScaleToCurrentViewport\", void 0);\nRegisterClass(\"BABYLON.PostProcess\", PostProcess);","map":{"version":3,"names":["__decorate","SmartArray","Observable","Vector2","Effect","serialize","serializeAsColor4","SerializationHelper","GetClass","RegisterClass","AbstractEngine","GetExponentOfTwo","EffectWrapper","prototype","setTextureFromPostProcess","channel","postProcess","name","_postProcessInput$tex","_postProcessInput","postProcessInput","_forcedOutputTexture","_textures","data","_currentRenderTextureInd","_bindTexture","texture","setTextureFromPostProcessOutput","_postProcess$_outputT","_postProcess$_outputT2","_outputTexture","_engine","_samplers","PostProcess","ForceGLSL","force","RegisterShaderCodeProcessing","postProcessName","customShaderCodeProcessing","_effectWrapper","value","alphaMode","samples","_samples","n","Math","min","getCaps","maxMSAASamples","forEach","setSamples","shaderLanguage","_shaderLanguage","getEffectName","_fragmentUrl","onActivate","callback","_onActivateObserver","onActivateObservable","remove","add","onSizeChanged","_onSizeChangedObserver","onSizeChangedObservable","onApply","_onApplyObserver","onApplyObservable","onBeforeRender","_onBeforeRenderObserver","onBeforeRenderObservable","onAfterRender","_onAfterRenderObserver","onAfterRenderObservable","inputTexture","restoreDefaultInputTexture","markTextureDirty","getCamera","_camera","texelSize","_shareOutputWithPostProcess","_texelSize","copyFromFloats","width","height","constructor","fragmentUrl","parameters","samplers","_size","camera","samplingMode","engine","reusable","defines","textureType","vertexUrl","indexParameters","blockCompilation","textureFormat","extraInitializations","_parentContainer","nodeMaterialSource","autoClear","forceAutoClearInAlphaMode","animations","enablePixelPerfectMode","forceFullscreenViewport","scaleMode","alwaysForcePOT","adaptScaleToCurrentViewport","_webGPUReady","_reusable","_renderId","externalTextureSamplerBinding","_textureCache","_scaleRatio","Zero","size","uniformBuffers","effectWrapper","Array","isArray","_options$uniforms","_options$samplers","_options$size","_options$camera","_options$samplingMode","_options$defines","_options$textureType","_options$vertexUrl","_options$blockCompila","_options$textureForma","_options$shaderLangua","_options$uniformBuffe","options","uniforms","join","useExistingThinPostProcess","useShaderStore","useAsPostProcess","fragmentShader","getScene","getEngine","undefined","onEffectCreatedObservable","_scene","attachPostProcess","postProcesses","push","uniqueId","getUniqueId","_options","renderTargetSamplingMode","_textureType","_textureFormat","indexOf","_vertexUrl","_parameters","_uniformBuffers","_indexParameters","importPromises","_gatherImports","isWebGPU","_postConstructor","useWebGPU","list","Promise","all","getClassName","getEffect","drawWrapper","effect","shareOutputWith","_disposeTextures","useOwnOutput","length","updateEffect","onCompiled","onError","_postProcessDefines","isReusable","_createRenderTargetTexture","textureSize","textureOptions","i","postProcessChannel","_generateDepthBuffer","generateDepthBuffer","tex","createRenderTargetTexture","lastUsedRenderId","_flushTextureCache","currentRenderId","currentlyUsed","j","dispose","splice","resize","needMipMaps","forceDepthStencil","reset","firstPP","_postProcesses","generateMipMaps","generateStencilBuffer","isStencilEnable","type","format","label","notifyObservers","_getTarget","target","cache","activate","sourceTexture","_this$_engine$_debugI","_this$_engine","scene","maxSize","maxTextureSize","requiredWidth","getRenderWidth","requiredHeight","getRenderHeight","desiredWidth","desiredHeight","currentViewport","needPOTTextures","updateRenderTargetTextureSampleCount","bindFramebuffer","_debugInsertMarker","call","clear","clearColor","_allowPostProcessClearColor","isSupported","aspectRatio","isReady","apply","enableEffect","setState","setDepthBuffer","setDepthWrite","alphaConstants","setAlphaConstants","r","g","b","a","source","_source","setVector2","bind","_disposeTextureCache","setPrePassRenderer","prePassRenderer","_prePassEffectConfiguration","addEffectConfiguration","enabled","index","detachPostProcess","firstPostProcess","_getFirstPostProcess","serializationObject","Serialize","activeCamera","customType","cameraId","id","clone","result","Parse","parsedPostProcess","rootUrl","postProcessType","_Parse","getCameraById","targetCamera"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/postProcess.js"],"sourcesContent":["import { __decorate } from \"../tslib.es6.js\";\nimport { SmartArray } from \"../Misc/smartArray.js\";\nimport { Observable } from \"../Misc/observable.js\";\nimport { Vector2 } from \"../Maths/math.vector.js\";\nimport { Effect } from \"../Materials/effect.js\";\n\nimport { serialize, serializeAsColor4 } from \"../Misc/decorators.js\";\nimport { SerializationHelper } from \"../Misc/decorators.serialization.js\";\nimport { GetClass, RegisterClass } from \"../Misc/typeStore.js\";\nimport { AbstractEngine } from \"../Engines/abstractEngine.js\";\nimport { GetExponentOfTwo } from \"../Misc/tools.functions.js\";\nimport { EffectWrapper } from \"../Materials/effectRenderer.js\";\nAbstractEngine.prototype.setTextureFromPostProcess = function (channel, postProcess, name) {\n let postProcessInput = null;\n if (postProcess) {\n if (postProcess._forcedOutputTexture) {\n postProcessInput = postProcess._forcedOutputTexture;\n }\n else if (postProcess._textures.data[postProcess._currentRenderTextureInd]) {\n postProcessInput = postProcess._textures.data[postProcess._currentRenderTextureInd];\n }\n }\n this._bindTexture(channel, postProcessInput?.texture ?? null, name);\n};\nAbstractEngine.prototype.setTextureFromPostProcessOutput = function (channel, postProcess, name) {\n this._bindTexture(channel, postProcess?._outputTexture?.texture ?? null, name);\n};\n/**\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)\n * @param channel Name of the sampler variable.\n * @param postProcess Post process to get the input texture from.\n */\nEffect.prototype.setTextureFromPostProcess = function (channel, postProcess) {\n this._engine.setTextureFromPostProcess(this._samplers[channel], postProcess, channel);\n};\n/**\n * (Warning! setTextureFromPostProcessOutput may be desired instead)\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)\n * @param channel Name of the sampler variable.\n * @param postProcess Post process to get the output texture from.\n */\nEffect.prototype.setTextureFromPostProcessOutput = function (channel, postProcess) {\n this._engine.setTextureFromPostProcessOutput(this._samplers[channel], postProcess, channel);\n};\n/**\n * PostProcess can be used to apply a shader to a texture after it has been rendered\n * See https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses\n */\nexport class PostProcess {\n /**\n * Force all the postprocesses to compile to glsl even on WebGPU engines.\n * False by default. This is mostly meant for backward compatibility.\n */\n static get ForceGLSL() {\n return EffectWrapper.ForceGLSL;\n }\n static set ForceGLSL(force) {\n EffectWrapper.ForceGLSL = force;\n }\n /**\n * Registers a shader code processing with a post process name.\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\n * @param customShaderCodeProcessing shader code processing to associate to the post process name\n */\n static RegisterShaderCodeProcessing(postProcessName, customShaderCodeProcessing) {\n EffectWrapper.RegisterShaderCodeProcessing(postProcessName, customShaderCodeProcessing);\n }\n /** Name of the PostProcess. */\n get name() {\n return this._effectWrapper.name;\n }\n set name(value) {\n this._effectWrapper.name = value;\n }\n /**\n * Type of alpha mode to use when performing the post process (default: Engine.ALPHA_DISABLE)\n */\n get alphaMode() {\n return this._effectWrapper.alphaMode;\n }\n set alphaMode(value) {\n this._effectWrapper.alphaMode = value;\n }\n /**\n * Number of sample textures (default: 1)\n */\n get samples() {\n return this._samples;\n }\n set samples(n) {\n this._samples = Math.min(n, this._engine.getCaps().maxMSAASamples);\n this._textures.forEach((texture) => {\n texture.setSamples(this._samples);\n });\n }\n /**\n * Gets the shader language type used to generate vertex and fragment source code.\n */\n get shaderLanguage() {\n return this._shaderLanguage;\n }\n /**\n * Returns the fragment url or shader name used in the post process.\n * @returns the fragment url or name in the shader store.\n */\n getEffectName() {\n return this._fragmentUrl;\n }\n /**\n * A function that is added to the onActivateObservable\n */\n set onActivate(callback) {\n if (this._onActivateObserver) {\n this.onActivateObservable.remove(this._onActivateObserver);\n }\n if (callback) {\n this._onActivateObserver = this.onActivateObservable.add(callback);\n }\n }\n /**\n * A function that is added to the onSizeChangedObservable\n */\n set onSizeChanged(callback) {\n if (this._onSizeChangedObserver) {\n this.onSizeChangedObservable.remove(this._onSizeChangedObserver);\n }\n this._onSizeChangedObserver = this.onSizeChangedObservable.add(callback);\n }\n /**\n * A function that is added to the onApplyObservable\n */\n set onApply(callback) {\n if (this._onApplyObserver) {\n this.onApplyObservable.remove(this._onApplyObserver);\n }\n this._onApplyObserver = this.onApplyObservable.add(callback);\n }\n /**\n * A function that is added to the onBeforeRenderObservable\n */\n set onBeforeRender(callback) {\n if (this._onBeforeRenderObserver) {\n this.onBeforeRenderObservable.remove(this._onBeforeRenderObserver);\n }\n this._onBeforeRenderObserver = this.onBeforeRenderObservable.add(callback);\n }\n /**\n * A function that is added to the onAfterRenderObservable\n */\n set onAfterRender(callback) {\n if (this._onAfterRenderObserver) {\n this.onAfterRenderObservable.remove(this._onAfterRenderObserver);\n }\n this._onAfterRenderObserver = this.onAfterRenderObservable.add(callback);\n }\n /**\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\n * render it's output into this texture and this texture will be used as textureSampler in the fragment shader of this post process.\n */\n get inputTexture() {\n return this._textures.data[this._currentRenderTextureInd];\n }\n set inputTexture(value) {\n this._forcedOutputTexture = value;\n }\n /**\n * Since inputTexture should always be defined, if we previously manually set `inputTexture`,\n * the only way to unset it is to use this function to restore its internal state\n */\n restoreDefaultInputTexture() {\n if (this._forcedOutputTexture) {\n this._forcedOutputTexture = null;\n this.markTextureDirty();\n }\n }\n /**\n * Gets the camera which post process is applied to.\n * @returns The camera the post process is applied to.\n */\n getCamera() {\n return this._camera;\n }\n /**\n * Gets the texel size of the postprocess.\n * See https://en.wikipedia.org/wiki/Texel_(graphics)\n */\n get texelSize() {\n if (this._shareOutputWithPostProcess) {\n return this._shareOutputWithPostProcess.texelSize;\n }\n if (this._forcedOutputTexture) {\n this._texelSize.copyFromFloats(1.0 / this._forcedOutputTexture.width, 1.0 / this._forcedOutputTexture.height);\n }\n return this._texelSize;\n }\n /** @internal */\n constructor(name, fragmentUrl, parameters, samplers, _size, camera, samplingMode = 1, engine, reusable, defines = null, textureType = 0, vertexUrl = \"postprocess\", indexParameters, blockCompilation = false, textureFormat = 5, shaderLanguage, extraInitializations) {\n /** @internal */\n this._parentContainer = null;\n /**\n * Width of the texture to apply the post process on\n */\n this.width = -1;\n /**\n * Height of the texture to apply the post process on\n */\n this.height = -1;\n /**\n * Gets the node material used to create this postprocess (null if the postprocess was manually created)\n */\n this.nodeMaterialSource = null;\n /**\n * Internal, reference to the location where this postprocess was output to. (Typically the texture on the next postprocess in the chain)\n * @internal\n */\n this._outputTexture = null;\n /**\n * If the buffer needs to be cleared before applying the post process. (default: true)\n * Should be set to false if shader will overwrite all previous pixels.\n */\n this.autoClear = true;\n /**\n * If clearing the buffer should be forced in autoClear mode, even when alpha mode is enabled (default: false).\n * By default, the buffer will only be cleared if alpha mode is disabled (and autoClear is true).\n */\n this.forceAutoClearInAlphaMode = false;\n /**\n * Animations to be used for the post processing\n */\n this.animations = [];\n /**\n * Enable Pixel Perfect mode where texture is not scaled to be power of 2.\n * Can only be used on a single postprocess or on the last one of a chain. (default: false)\n */\n this.enablePixelPerfectMode = false;\n /**\n * Force the postprocess to be applied without taking in account viewport\n */\n this.forceFullscreenViewport = true;\n /**\n * Scale mode for the post process (default: Engine.SCALEMODE_FLOOR)\n *\n * | Value | Type | Description |\n * | ----- | ----------------------------------- | ----------- |\n * | 1 | SCALEMODE_FLOOR | [engine.scalemode_floor](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_floor) |\n * | 2 | SCALEMODE_NEAREST | [engine.scalemode_nearest](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_nearest) |\n * | 3 | SCALEMODE_CEILING | [engine.scalemode_ceiling](https://doc.babylonjs.com/api/classes/babylon.engine#scalemode_ceiling) |\n *\n */\n this.scaleMode = 1;\n /**\n * Force textures to be a power of two (default: false)\n */\n this.alwaysForcePOT = false;\n this._samples = 1;\n /**\n * Modify the scale of the post process to be the same as the viewport (default: false)\n */\n this.adaptScaleToCurrentViewport = false;\n this._webGPUReady = false;\n this._reusable = false;\n this._renderId = 0;\n /**\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).\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\n * internal structures (materialContext) will be dirtified, which may impact performances\n */\n this.externalTextureSamplerBinding = false;\n /**\n * Smart array of input and output textures for the post process.\n * @internal\n */\n this._textures = new SmartArray(2);\n /**\n * Smart array of input and output textures for the post process.\n * @internal\n */\n this._textureCache = [];\n /**\n * The index in _textures that corresponds to the output texture.\n * @internal\n */\n this._currentRenderTextureInd = 0;\n this._scaleRatio = new Vector2(1, 1);\n this._texelSize = Vector2.Zero();\n // Events\n /**\n * An event triggered when the postprocess is activated.\n */\n this.onActivateObservable = new Observable();\n /**\n * An event triggered when the postprocess changes its size.\n */\n this.onSizeChangedObservable = new Observable();\n /**\n * An event triggered when the postprocess applies its effect.\n */\n this.onApplyObservable = new Observable();\n /**\n * An event triggered before rendering the postprocess\n */\n this.onBeforeRenderObservable = new Observable();\n /**\n * An event triggered after rendering the postprocess\n */\n this.onAfterRenderObservable = new Observable();\n let size = 1;\n let uniformBuffers = null;\n let effectWrapper;\n if (parameters && !Array.isArray(parameters)) {\n const options = parameters;\n parameters = options.uniforms ?? null;\n samplers = options.samplers ?? null;\n size = options.size ?? 1;\n camera = options.camera ?? null;\n samplingMode = options.samplingMode ?? 1;\n engine = options.engine;\n reusable = options.reusable;\n defines = Array.isArray(options.defines) ? options.defines.join(\"\\n\") : (options.defines ?? null);\n textureType = options.textureType ?? 0;\n vertexUrl = options.vertexUrl ?? \"postprocess\";\n indexParameters = options.indexParameters;\n blockCompilation = options.blockCompilation ?? false;\n textureFormat = options.textureFormat ?? 5;\n shaderLanguage = options.shaderLanguage ?? 0 /* ShaderLanguage.GLSL */;\n uniformBuffers = options.uniformBuffers ?? null;\n extraInitializations = options.extraInitializations;\n effectWrapper = options.effectWrapper;\n }\n else if (_size) {\n if (typeof _size === \"number\") {\n size = _size;\n }\n else {\n size = { width: _size.width, height: _size.height };\n }\n }\n const useExistingThinPostProcess = !!effectWrapper;\n this._effectWrapper =\n effectWrapper ??\n new EffectWrapper({\n name,\n useShaderStore: true,\n useAsPostProcess: true,\n fragmentShader: fragmentUrl,\n engine: engine || camera?.getScene().getEngine(),\n uniforms: parameters,\n samplers,\n uniformBuffers,\n defines,\n vertexUrl,\n indexParameters,\n blockCompilation: true,\n shaderLanguage,\n extraInitializations: undefined,\n });\n this.name = name;\n this.onEffectCreatedObservable = this._effectWrapper.onEffectCreatedObservable;\n if (camera != null) {\n this._camera = camera;\n this._scene = camera.getScene();\n camera.attachPostProcess(this);\n this._engine = this._scene.getEngine();\n this._scene.postProcesses.push(this);\n this.uniqueId = this._scene.getUniqueId();\n }\n else if (engine) {\n this._engine = engine;\n this._engine.postProcesses.push(this);\n }\n this._options = size;\n this.renderTargetSamplingMode = samplingMode ? samplingMode : 1;\n this._reusable = reusable || false;\n this._textureType = textureType;\n this._textureFormat = textureFormat;\n this._shaderLanguage = shaderLanguage || 0 /* ShaderLanguage.GLSL */;\n this._samplers = samplers || [];\n if (this._samplers.indexOf(\"textureSampler\") === -1) {\n this._samplers.push(\"textureSampler\");\n }\n this._fragmentUrl = fragmentUrl;\n this._vertexUrl = vertexUrl;\n this._parameters = parameters || [];\n if (this._parameters.indexOf(\"scale\") === -1) {\n this._parameters.push(\"scale\");\n }\n this._uniformBuffers = uniformBuffers || [];\n this._indexParameters = indexParameters;\n if (!useExistingThinPostProcess) {\n this._webGPUReady = this._shaderLanguage === 1 /* ShaderLanguage.WGSL */;\n const importPromises = [];\n this._gatherImports(this._engine.isWebGPU && !PostProcess.ForceGLSL, importPromises);\n this._effectWrapper._webGPUReady = this._webGPUReady;\n this._effectWrapper._postConstructor(blockCompilation, defines, extraInitializations, importPromises);\n }\n }\n _gatherImports(useWebGPU = false, list) {\n // this._webGPUReady is used to detect when a postprocess is intended to be used with WebGPU\n if (useWebGPU && this._webGPUReady) {\n list.push(Promise.all([import(\"../ShadersWGSL/postprocess.vertex.js\")]));\n }\n else {\n list.push(Promise.all([import(\"../Shaders/postprocess.vertex.js\")]));\n }\n }\n /**\n * Gets a string identifying the name of the class\n * @returns \"PostProcess\" string\n */\n getClassName() {\n return \"PostProcess\";\n }\n /**\n * Gets the engine which this post process belongs to.\n * @returns The engine the post process was enabled with.\n */\n getEngine() {\n return this._engine;\n }\n /**\n * The effect that is created when initializing the post process.\n * @returns The created effect corresponding to the postprocess.\n */\n getEffect() {\n return this._effectWrapper.drawWrapper.effect;\n }\n /**\n * To avoid multiple redundant textures for multiple post process, the output the output texture for this post process can be shared with another.\n * @param postProcess The post process to share the output with.\n * @returns This post process.\n */\n shareOutputWith(postProcess) {\n this._disposeTextures();\n this._shareOutputWithPostProcess = postProcess;\n return this;\n }\n /**\n * Reverses the effect of calling shareOutputWith and returns the post process back to its original state.\n * This should be called if the post process that shares output with this post process is disabled/disposed.\n */\n useOwnOutput() {\n if (this._textures.length == 0) {\n this._textures = new SmartArray(2);\n }\n this._shareOutputWithPostProcess = null;\n }\n /**\n * Updates the effect with the current post process compile time values and recompiles the shader.\n * @param defines Define statements that should be added at the beginning of the shader. (default: null)\n * @param uniforms Set of uniform variables that will be passed to the shader. (default: null)\n * @param samplers Set of Texture2D variables that will be passed to the shader. (default: null)\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\n * @param onCompiled Called when the shader has been compiled.\n * @param onError Called if there is an error when compiling a shader.\n * @param vertexUrl The url of the vertex shader to be used (default: the one given at construction time)\n * @param fragmentUrl The url of the fragment shader to be used (default: the one given at construction time)\n */\n updateEffect(defines = null, uniforms = null, samplers = null, indexParameters, onCompiled, onError, vertexUrl, fragmentUrl) {\n this._effectWrapper.updateEffect(defines, uniforms, samplers, indexParameters, onCompiled, onError, vertexUrl, fragmentUrl);\n this._postProcessDefines = Array.isArray(this._effectWrapper.options.defines) ? this._effectWrapper.options.defines.join(\"\\n\") : this._effectWrapper.options.defines;\n }\n /**\n * The post process is reusable if it can be used multiple times within one frame.\n * @returns If the post process is reusable\n */\n isReusable() {\n return this._reusable;\n }\n /** invalidate frameBuffer to hint the postprocess to create a depth buffer */\n markTextureDirty() {\n this.width = -1;\n }\n _createRenderTargetTexture(textureSize, textureOptions, channel = 0) {\n for (let i = 0; i < this._textureCache.length; i++) {\n if (this._textureCache[i].texture.width === textureSize.width &&\n this._textureCache[i].texture.height === textureSize.height &&\n this._textureCache[i].postProcessChannel === channel &&\n this._textureCache[i].texture._generateDepthBuffer === textureOptions.generateDepthBuffer &&\n this._textureCache[i].texture.samples === textureOptions.samples) {\n return this._textureCache[i].texture;\n }\n }\n const tex = this._engine.createRenderTargetTexture(textureSize, textureOptions);\n this._textureCache.push({ texture: tex, postProcessChannel: channel, lastUsedRenderId: -1 });\n return tex;\n }\n _flushTextureCache() {\n const currentRenderId = this._renderId;\n for (let i = this._textureCache.length - 1; i >= 0; i--) {\n if (currentRenderId - this._textureCache[i].lastUsedRenderId > 100) {\n let currentlyUsed = false;\n for (let j = 0; j < this._textures.length; j++) {\n if (this._textures.data[j] === this._textureCache[i].texture) {\n currentlyUsed = true;\n break;\n }\n }\n if (!currentlyUsed) {\n this._textureCache[i].texture.dispose();\n this._textureCache.splice(i, 1);\n }\n }\n }\n }\n /**\n * Resizes the post-process texture\n * @param width Width of the texture\n * @param height Height of the texture\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)\n * @param needMipMaps True if mip maps need to be generated after render (default: false)\n * @param forceDepthStencil True to force post-process texture creation with stencil depth and buffer (default: false)\n */\n resize(width, height, camera = null, needMipMaps = false, forceDepthStencil = false) {\n if (this._textures.length > 0) {\n this._textures.reset();\n }\n this.width = width;\n this.height = height;\n let firstPP = null;\n if (camera) {\n for (let i = 0; i < camera._postProcesses.length; i++) {\n if (camera._postProcesses[i] !== null) {\n firstPP = camera._postProcesses[i];\n break;\n }\n }\n }\n const textureSize = { width: this.width, height: this.height };\n const textureOptions = {\n generateMipMaps: needMipMaps,\n generateDepthBuffer: forceDepthStencil || firstPP === this,\n generateStencilBuffer: (forceDepthStencil || firstPP === this) && this._engine.isStencilEnable,\n samplingMode: this.renderTargetSamplingMode,\n type: this._textureType,\n format: this._textureFormat,\n samples: this._samples,\n label: \"PostProcessRTT-\" + this.name,\n };\n this._textures.push(this._createRenderTargetTexture(textureSize, textureOptions, 0));\n if (this._reusable) {\n this._textures.push(this._createRenderTargetTexture(textureSize, textureOptions, 1));\n }\n this._texelSize.copyFromFloats(1.0 / this.width, 1.0 / this.height);\n this.onSizeChangedObservable.notifyObservers(this);\n }\n _getTarget() {\n let target;\n if (this._shareOutputWithPostProcess) {\n target = this._shareOutputWithPostProcess.inputTexture;\n }\n else if (this._forcedOutputTexture) {\n target = this._forcedOutputTexture;\n this.width = this._forcedOutputTexture.width;\n this.height = this._forcedOutputTexture.height;\n }\n else {\n target = this.inputTexture;\n let cache;\n for (let i = 0; i < this._textureCache.length; i++) {\n if (this._textureCache[i].texture === target) {\n cache = this._textureCache[i];\n break;\n }\n }\n if (cache) {\n cache.lastUsedRenderId = this._renderId;\n }\n }\n return target;\n }\n /**\n * Activates the post process by intializing the textures to be used when executed. Notifies onActivateObservable.\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.\n * @param camera The camera that will be used in the post process. This camera will be used when calling onActivateObservable.\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)\n * @param forceDepthStencil If true, a depth and stencil buffer will be generated. (default: false)\n * @returns The render target wrapper that was bound to be written to.\n */\n activate(camera, sourceTexture = null, forceDepthStencil) {\n camera = camera || this._camera;\n const scene = camera.getScene();\n const engine = scene.getEngine();\n const maxSize = engine.getCaps().maxTextureSize;\n const requiredWidth = ((sourceTexture ? sourceTexture.width : this._engine.getRenderWidth(true)) * this._options) | 0;\n const requiredHeight = ((sourceTexture ? sourceTexture.height : this._engine.getRenderHeight(true)) * this._options) | 0;\n let desiredWidth = this._options.width || requiredWidth;\n let desiredHeight = this._options.height || requiredHeight;\n const needMipMaps = this.renderTargetSamplingMode !== 7 &&\n this.renderTargetSamplingMode !== 1 &&\n this.renderTargetSamplingMode !== 2;\n let target = null;\n if (!this._shareOutputWithPostProcess && !this._forcedOutputTexture) {\n if (this.adaptScaleToCurrentViewport) {\n const currentViewport = engine.currentViewport;\n if (currentViewport) {\n desiredWidth *= currentViewport.width;\n desiredHeight *= currentViewport.height;\n }\n }\n if (needMipMaps || this.alwaysForcePOT) {\n if (!this._options.width) {\n desiredWidth = engine.needPOTTextures ? GetExponentOfTwo(desiredWidth, maxSize, this.scaleMode) : desiredWidth;\n }\n if (!this._options.height) {\n desiredHeight = engine.needPOTTextures ? GetExponentOfTwo(desiredHeight, maxSize, this.scaleMode) : desiredHeight;\n }\n }\n if (this.width !== desiredWidth || this.height !== desiredHeight || !(target = this._getTarget())) {\n this.resize(desiredWidth, desiredHeight, camera, needMipMaps, forceDepthStencil);\n }\n this._textures.forEach((texture) => {\n if (texture.samples !== this.samples) {\n this._engine.updateRenderTargetTextureSampleCount(texture, this.samples);\n }\n });\n this._flushTextureCache();\n this._renderId++;\n }\n if (!target) {\n target = this._getTarget();\n }\n // Bind the input of this post process to be used as the output of the previous post process.\n if (this.enablePixelPerfectMode) {\n this._scaleRatio.copyFromFloats(requiredWidth / desiredWidth, requiredHeight / desiredHeight);\n this._engine.bindFramebuffer(target, 0, requiredWidth, requiredHeight, this.forceFullscreenViewport);\n }\n else {\n this._scaleRatio.copyFromFloats(1, 1);\n this._engine.bindFramebuffer(target, 0, undefined, undefined, this.forceFullscreenViewport);\n }\n this._engine._debugInsertMarker?.(`post process ${this.name} input`);\n this.onActivateObservable.notifyObservers(camera);\n // Clear\n if (this.autoClear && (this.alphaMode === 0 || this.forceAutoClearInAlphaMode)) {\n this._engine.clear(this.clearColor ? this.clearColor : scene.clearColor, scene._allowPostProcessClearColor, true, true);\n }\n if (this._reusable) {\n this._currentRenderTextureInd = (this._currentRenderTextureInd + 1) % 2;\n }\n return target;\n }\n /**\n * If the post process is supported.\n */\n get isSupported() {\n return this._effectWrapper.drawWrapper.effect.isSupported;\n }\n /**\n * The aspect ratio of the output texture.\n */\n get aspectRatio() {\n if (this._shareOutputWithPostProcess) {\n return this._shareOutputWithPostProcess.aspectRatio;\n }\n if (this._forcedOutputTexture) {\n return this._forcedOutputTexture.width / this._forcedOutputTexture.height;\n }\n return this.width / this.height;\n }\n /**\n * Get a value indicating if the post-process is ready to be used\n * @returns true if the post-process is ready (shader is compiled)\n */\n isReady() {\n return this._effectWrapper.isReady();\n }\n /**\n * Binds all textures and uniforms to the shader, this will be run on every pass.\n * @returns the effect corresponding to this post process. Null if not compiled or not ready.\n */\n apply() {\n // Check\n if (!this._effectWrapper.isReady()) {\n return null;\n }\n // States\n this._engine.enableEffect(this._effectWrapper.drawWrapper);\n this._engine.setState(false);\n this._engine.setDepthBuffer(false);\n this._engine.setDepthWrite(false);\n // Alpha\n if (this.alphaConstants) {\n this.getEngine().setAlphaConstants(this.alphaConstants.r, this.alphaConstants.g, this.alphaConstants.b, this.alphaConstants.a);\n }\n // Bind the output texture of the preivous post process as the input to this post process.\n let source;\n if (this._shareOutputWithPostProcess) {\n source = this._shareOutputWithPostProcess.inputTexture;\n }\n else if (this._forcedOutputTexture) {\n source = this._forcedOutputTexture;\n }\n else {\n source = this.inputTexture;\n }\n if (!this.externalTextureSamplerBinding) {\n this._effectWrapper.drawWrapper.effect._bindTexture(\"textureSampler\", source?.texture);\n }\n // Parameters\n this._effectWrapper.drawWrapper.effect.setVector2(\"scale\", this._scaleRatio);\n this.onApplyObservable.notifyObservers(this._effectWrapper.drawWrapper.effect);\n this._effectWrapper.bind();\n return this._effectWrapper.drawWrapper.effect;\n }\n _disposeTextures() {\n if (this._shareOutputWithPostProcess || this._forcedOutputTexture) {\n this._disposeTextureCache();\n return;\n }\n this._disposeTextureCache();\n this._textures.dispose();\n }\n _disposeTextureCache() {\n for (let i = this._textureCache.length - 1; i >= 0; i--) {\n this._textureCache[i].texture.dispose();\n }\n this._textureCache.length = 0;\n }\n /**\n * Sets the required values to the prepass renderer.\n * @param prePassRenderer defines the prepass renderer to setup.\n * @returns true if the pre pass is needed.\n */\n setPrePassRenderer(prePassRenderer) {\n if (this._prePassEffectConfiguration) {\n this._prePassEffectConfiguration = prePassRenderer.addEffectConfiguration(this._prePassEffectConfiguration);\n this._prePassEffectConfiguration.enabled = true;\n return true;\n }\n return false;\n }\n /**\n * Disposes the post process.\n * @param camera The camera to dispose the post process on.\n */\n dispose(camera) {\n camera = camera || this._camera;\n this._disposeTextures();\n let index;\n if (this._scene) {\n index = this._scene.postProcesses.indexOf(this);\n if (index !== -1) {\n this._scene.postProcesses.splice(index, 1);\n }\n }\n if (this._parentContainer) {\n const index = this._parentContainer.postProcesses.indexOf(this);\n if (index > -1) {\n this._parentContainer.postProcesses.splice(index, 1);\n }\n this._parentContainer = null;\n }\n index = this._engine.postProcesses.indexOf(this);\n if (index !== -1) {\n this._engine.postProcesses.splice(index, 1);\n }\n if (!camera) {\n return;\n }\n camera.detachPostProcess(this);\n index = camera._postProcesses.indexOf(this);\n if (index === 0 && camera._postProcesses.length > 0) {\n const firstPostProcess = this._camera._getFirstPostProcess();\n if (firstPostProcess) {\n firstPostProcess.markTextureDirty();\n }\n }\n this.onActivateObservable.clear();\n this.onAfterRenderObservable.clear();\n this.onApplyObservable.clear();\n this.onBeforeRenderObservable.clear();\n this.onSizeChangedObservable.clear();\n this.onEffectCreatedObservable.clear();\n }\n /**\n * Serializes the post process to a JSON object\n * @returns the JSON object\n */\n serialize() {\n const serializationObject = SerializationHelper.Serialize(this);\n const camera = this.getCamera() || (this._scene && this._scene.activeCamera);\n serializationObject.customType = \"BABYLON.\" + this.getClassName();\n serializationObject.cameraId = camera ? camera.id : null;\n serializationObject.reusable = this._reusable;\n serializationObject.textureType = this._textureType;\n serializationObject.fragmentUrl = this._fragmentUrl;\n serializationObject.parameters = this._parameters;\n serializationObject.samplers = this._samplers;\n serializationObject.uniformBuffers = this._uniformBuffers;\n serializationObject.options = this._options;\n serializationObject.defines = this._postProcessDefines;\n serializationObject.textureFormat = this._textureFormat;\n serializationObject.vertexUrl = this._vertexUrl;\n serializationObject.indexParameters = this._indexParameters;\n return serializationObject;\n }\n /**\n * Clones this post process\n * @returns a new post process similar to this one\n */\n clone() {\n const serializationObject = this.serialize();\n serializationObject._engine = this._engine;\n serializationObject.cameraId = null;\n const result = PostProcess.Parse(serializationObject, this._scene, \"\");\n if (!result) {\n return null;\n }\n result.onActivateObservable = this.onActivateObservable.clone();\n result.onSizeChangedObservable = this.onSizeChangedObservable.clone();\n result.onApplyObservable = this.onApplyObservable.clone();\n result.onBeforeRenderObservable = this.onBeforeRenderObservable.clone();\n result.onAfterRenderObservable = this.onAfterRenderObservable.clone();\n result._prePassEffectConfiguration = this._prePassEffectConfiguration;\n return result;\n }\n /**\n * Creates a material from parsed material data\n * @param parsedPostProcess defines parsed post process data\n * @param scene defines the hosting scene\n * @param rootUrl defines the root URL to use to load textures\n * @returns a new post process\n */\n static Parse(parsedPostProcess, scene, rootUrl) {\n const postProcessType = GetClass(parsedPostProcess.customType);\n if (!postProcessType || !postProcessType._Parse) {\n return null;\n }\n const camera = scene ? scene.getCameraById(parsedPostProcess.cameraId) : null;\n return postProcessType._Parse(parsedPostProcess, camera, scene, rootUrl);\n }\n /**\n * @internal\n */\n static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {\n return SerializationHelper.Parse(() => {\n return new PostProcess(parsedPostProcess.name, parsedPostProcess.fragmentUrl, parsedPostProcess.parameters, parsedPostProcess.samplers, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable, parsedPostProcess.defines, parsedPostProcess.textureType, parsedPostProcess.vertexUrl, parsedPostProcess.indexParameters, false, parsedPostProcess.textureFormat);\n }, parsedPostProcess, scene, rootUrl);\n }\n}\n__decorate([\n serialize()\n], PostProcess.prototype, \"uniqueId\", void 0);\n__decorate([\n serialize()\n], PostProcess.prototype, \"name\", null);\n__decorate([\n serialize()\n], PostProcess.prototype, \"width\", void 0);\n__decorate([\n serialize()\n], PostProcess.prototype, \"height\", void 0);\n__decorate([\n serialize()\n], PostProcess.prototype, \"renderTargetSamplingMode\", void 0);\n__decorate([\n serializeAsColor4()\n], PostProcess.prototype, \"clearColor\", void 0);\n__decorate([\n serialize()\n], PostProcess.prototype, \"autoClear\", void 0);\n__decorate([\n serialize()\n], PostProcess.prototype, \"forceAutoClearInAlphaMode\", void 0);\n__decorate([\n serialize()\n], PostProcess.prototype, \"alphaMode\", null);\n__decorate([\n serialize()\n], PostProcess.prototype, \"alphaConstants\", void 0);\n__decorate([\n serialize()\n], PostProcess.prototype, \"enablePixelPerfectMode\", void 0);\n__decorate([\n serialize()\n], PostProcess.prototype, \"forceFullscreenViewport\", void 0);\n__decorate([\n serialize()\n], PostProcess.prototype, \"scaleMode\", void 0);\n__decorate([\n serialize()\n], PostProcess.prototype, \"alwaysForcePOT\", void 0);\n__decorate([\n serialize(\"samples\")\n], PostProcess.prototype, \"_samples\", void 0);\n__decorate([\n serialize()\n], PostProcess.prototype, \"adaptScaleToCurrentViewport\", void 0);\nRegisterClass(\"BABYLON.PostProcess\", PostProcess);\n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