{"ast":null,"code":"import { PostProcessRenderEffect } from \"../PostProcesses/RenderPipeline/postProcessRenderEffect.js\";\nimport { ExtractHighlightsPostProcess } from \"./extractHighlightsPostProcess.js\";\nimport { BlurPostProcess } from \"./blurPostProcess.js\";\nimport { BloomMergePostProcess } from \"./bloomMergePostProcess.js\";\nimport { Texture } from \"../Materials/Textures/texture.js\";\nimport { ThinBloomEffect } from \"./thinBloomEffect.js\";\n/**\n * The bloom effect spreads bright areas of an image to simulate artifacts seen in cameras\n */\nexport class BloomEffect extends PostProcessRenderEffect {\n /**\n * The luminance threshold to find bright areas of the image to bloom.\n */\n get threshold() {\n return this._thinBloomEffect.threshold;\n }\n set threshold(value) {\n this._thinBloomEffect.threshold = value;\n }\n /**\n * The strength of the bloom.\n */\n get weight() {\n return this._thinBloomEffect.weight;\n }\n set weight(value) {\n this._thinBloomEffect.weight = value;\n }\n /**\n * Specifies the size of the bloom blur kernel, relative to the final output size\n */\n get kernel() {\n return this._thinBloomEffect.kernel;\n }\n set kernel(value) {\n this._thinBloomEffect.kernel = value;\n }\n get bloomScale() {\n return this._thinBloomEffect.scale;\n }\n /**\n * Creates a new instance of @see BloomEffect\n * @param sceneOrEngine The scene or engine the effect belongs to.\n * @param bloomScale The ratio of the blur texture to the input texture that should be used to compute the bloom.\n * @param bloomWeight The strength of bloom.\n * @param bloomKernel The size of the kernel to be used when applying the blur.\n * @param pipelineTextureType The type of texture to be used when performing the post processing.\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)\n */\n constructor(sceneOrEngine, bloomScale, bloomWeight, bloomKernel, pipelineTextureType = 0, blockCompilation = false) {\n const engine = sceneOrEngine._renderForCamera ? sceneOrEngine.getEngine() : sceneOrEngine;\n super(engine, \"bloom\", () => {\n return this._effects;\n }, true);\n /**\n * @internal Internal\n */\n this._effects = [];\n this._thinBloomEffect = new ThinBloomEffect(\"bloom\", engine, bloomScale, blockCompilation);\n this._downscale = new ExtractHighlightsPostProcess(\"highlights\", {\n size: 1.0,\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\n engine,\n textureType: pipelineTextureType,\n blockCompilation,\n effectWrapper: this._thinBloomEffect._downscale\n });\n this._blurX = new BlurPostProcess(\"horizontal blur\", this._thinBloomEffect._blurX.direction, this._thinBloomEffect._blurX.kernel, {\n size: bloomScale,\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\n engine,\n textureType: pipelineTextureType,\n blockCompilation,\n effectWrapper: this._thinBloomEffect._blurX\n });\n this._blurX.alwaysForcePOT = true;\n this._blurX.autoClear = false;\n this._blurY = new BlurPostProcess(\"vertical blur\", this._thinBloomEffect._blurY.direction, this._thinBloomEffect._blurY.kernel, {\n size: bloomScale,\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\n engine,\n textureType: pipelineTextureType,\n blockCompilation,\n effectWrapper: this._thinBloomEffect._blurY\n });\n this._blurY.alwaysForcePOT = true;\n this._blurY.autoClear = false;\n this.kernel = bloomKernel;\n this._effects = [this._downscale, this._blurX, this._blurY];\n this._merge = new BloomMergePostProcess(\"bloomMerge\", this._downscale, this._blurY, bloomWeight, {\n size: bloomScale,\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\n engine,\n textureType: pipelineTextureType,\n blockCompilation,\n effectWrapper: this._thinBloomEffect._merge\n });\n this._merge.autoClear = false;\n this._effects.push(this._merge);\n }\n /**\n * Disposes each of the internal effects for a given camera.\n * @param camera The camera to dispose the effect on.\n */\n disposeEffects(camera) {\n for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {\n this._effects[effectIndex].dispose(camera);\n }\n }\n /**\n * @internal Internal\n */\n _updateEffects() {\n for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {\n this._effects[effectIndex].updateEffect();\n }\n }\n /**\n * Internal\n * @returns if all the contained post processes are ready.\n * @internal\n */\n _isReady() {\n return this._thinBloomEffect.isReady();\n }\n}","map":{"version":3,"names":["PostProcessRenderEffect","ExtractHighlightsPostProcess","BlurPostProcess","BloomMergePostProcess","Texture","ThinBloomEffect","BloomEffect","threshold","_thinBloomEffect","value","weight","kernel","bloomScale","scale","constructor","sceneOrEngine","bloomWeight","bloomKernel","pipelineTextureType","blockCompilation","engine","_renderForCamera","getEngine","_effects","_downscale","size","samplingMode","BILINEAR_SAMPLINGMODE","textureType","effectWrapper","_blurX","direction","alwaysForcePOT","autoClear","_blurY","_merge","push","disposeEffects","camera","effectIndex","length","dispose","_updateEffects","updateEffect","_isReady","isReady"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/bloomEffect.js"],"sourcesContent":["import { PostProcessRenderEffect } from \"../PostProcesses/RenderPipeline/postProcessRenderEffect.js\";\nimport { ExtractHighlightsPostProcess } from \"./extractHighlightsPostProcess.js\";\nimport { BlurPostProcess } from \"./blurPostProcess.js\";\nimport { BloomMergePostProcess } from \"./bloomMergePostProcess.js\";\nimport { Texture } from \"../Materials/Textures/texture.js\";\nimport { ThinBloomEffect } from \"./thinBloomEffect.js\";\n/**\n * The bloom effect spreads bright areas of an image to simulate artifacts seen in cameras\n */\nexport class BloomEffect extends PostProcessRenderEffect {\n /**\n * The luminance threshold to find bright areas of the image to bloom.\n */\n get threshold() {\n return this._thinBloomEffect.threshold;\n }\n set threshold(value) {\n this._thinBloomEffect.threshold = value;\n }\n /**\n * The strength of the bloom.\n */\n get weight() {\n return this._thinBloomEffect.weight;\n }\n set weight(value) {\n this._thinBloomEffect.weight = value;\n }\n /**\n * Specifies the size of the bloom blur kernel, relative to the final output size\n */\n get kernel() {\n return this._thinBloomEffect.kernel;\n }\n set kernel(value) {\n this._thinBloomEffect.kernel = value;\n }\n get bloomScale() {\n return this._thinBloomEffect.scale;\n }\n /**\n * Creates a new instance of @see BloomEffect\n * @param sceneOrEngine The scene or engine the effect belongs to.\n * @param bloomScale The ratio of the blur texture to the input texture that should be used to compute the bloom.\n * @param bloomWeight The strength of bloom.\n * @param bloomKernel The size of the kernel to be used when applying the blur.\n * @param pipelineTextureType The type of texture to be used when performing the post processing.\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)\n */\n constructor(sceneOrEngine, bloomScale, bloomWeight, bloomKernel, pipelineTextureType = 0, blockCompilation = false) {\n const engine = sceneOrEngine._renderForCamera ? sceneOrEngine.getEngine() : sceneOrEngine;\n super(engine, \"bloom\", () => {\n return this._effects;\n }, true);\n /**\n * @internal Internal\n */\n this._effects = [];\n this._thinBloomEffect = new ThinBloomEffect(\"bloom\", engine, bloomScale, blockCompilation);\n this._downscale = new ExtractHighlightsPostProcess(\"highlights\", {\n size: 1.0,\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\n engine,\n textureType: pipelineTextureType,\n blockCompilation,\n effectWrapper: this._thinBloomEffect._downscale,\n });\n this._blurX = new BlurPostProcess(\"horizontal blur\", this._thinBloomEffect._blurX.direction, this._thinBloomEffect._blurX.kernel, {\n size: bloomScale,\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\n engine,\n textureType: pipelineTextureType,\n blockCompilation,\n effectWrapper: this._thinBloomEffect._blurX,\n });\n this._blurX.alwaysForcePOT = true;\n this._blurX.autoClear = false;\n this._blurY = new BlurPostProcess(\"vertical blur\", this._thinBloomEffect._blurY.direction, this._thinBloomEffect._blurY.kernel, {\n size: bloomScale,\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\n engine,\n textureType: pipelineTextureType,\n blockCompilation,\n effectWrapper: this._thinBloomEffect._blurY,\n });\n this._blurY.alwaysForcePOT = true;\n this._blurY.autoClear = false;\n this.kernel = bloomKernel;\n this._effects = [this._downscale, this._blurX, this._blurY];\n this._merge = new BloomMergePostProcess(\"bloomMerge\", this._downscale, this._blurY, bloomWeight, {\n size: bloomScale,\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\n engine,\n textureType: pipelineTextureType,\n blockCompilation,\n effectWrapper: this._thinBloomEffect._merge,\n });\n this._merge.autoClear = false;\n this._effects.push(this._merge);\n }\n /**\n * Disposes each of the internal effects for a given camera.\n * @param camera The camera to dispose the effect on.\n */\n disposeEffects(camera) {\n for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {\n this._effects[effectIndex].dispose(camera);\n }\n }\n /**\n * @internal Internal\n */\n _updateEffects() {\n for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {\n this._effects[effectIndex].updateEffect();\n }\n }\n /**\n * Internal\n * @returns if all the contained post processes are ready.\n * @internal\n */\n _isReady() {\n return this._thinBloomEffect.isReady();\n }\n}\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,4DAA4D;AACpG,SAASC,4BAA4B,QAAQ,mCAAmC;AAChF,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,qBAAqB,QAAQ,4BAA4B;AAClE,SAASC,OAAO,QAAQ,kCAAkC;AAC1D,SAASC,eAAe,QAAQ,sBAAsB;AACtD;AACA;AACA;AACA,OAAO,MAAMC,WAAW,SAASN,uBAAuB,CAAC;EACrD;AACJ;AACA;EACI,IAAIO,SAASA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACC,gBAAgB,CAACD,SAAS;EAC1C;EACA,IAAIA,SAASA,CAACE,KAAK,EAAE;IACjB,IAAI,CAACD,gBAAgB,CAACD,SAAS,GAAGE,KAAK;EAC3C;EACA;AACJ;AACA;EACI,IAAIC,MAAMA,CAAA,EAAG;IACT,OAAO,IAAI,CAACF,gBAAgB,CAACE,MAAM;EACvC;EACA,IAAIA,MAAMA,CAACD,KAAK,EAAE;IACd,IAAI,CAACD,gBAAgB,CAACE,MAAM,GAAGD,KAAK;EACxC;EACA;AACJ;AACA;EACI,IAAIE,MAAMA,CAAA,EAAG;IACT,OAAO,IAAI,CAACH,gBAAgB,CAACG,MAAM;EACvC;EACA,IAAIA,MAAMA,CAACF,KAAK,EAAE;IACd,IAAI,CAACD,gBAAgB,CAACG,MAAM,GAAGF,KAAK;EACxC;EACA,IAAIG,UAAUA,CAAA,EAAG;IACb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