c655e93704f86f9a7aa0eb5e9c5c145c7096e64c25dcdcc8b89c59cb53d1d78c.json 11 KB

1
  1. {"ast":null,"code":"import { PostProcess } from \"./postProcess.js\";\nimport { ThinDepthOfFieldMergePostProcess } from \"./thinDepthOfFieldMergePostProcess.js\";\n/**\n * The DepthOfFieldMergePostProcess merges blurred images with the original based on the values of the circle of confusion.\n */\nexport class DepthOfFieldMergePostProcess extends PostProcess {\n /**\n * Gets a string identifying the name of the class\n * @returns \"DepthOfFieldMergePostProcess\" string\n */\n getClassName() {\n return \"DepthOfFieldMergePostProcess\";\n }\n /**\n * Creates a new instance of DepthOfFieldMergePostProcess\n * @param name The name of the effect.\n * @param originalFromInput Post process which's input will be used for the merge.\n * @param circleOfConfusion Circle of confusion post process which's output will be used to blur each pixel.\n * @param _blurSteps Blur post processes from low to high which will be mixed with the original image.\n * @param options The required width/height ratio to downsize to before computing the render pass.\n * @param camera The camera to apply the render pass to.\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\n * @param engine The engine which the post process will be applied. (default: current engine)\n * @param reusable If the post process can be reused on the same frame. (default: false)\n * @param textureType Type of textures used when performing the post process. (default: 0)\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(name, originalFromInput, circleOfConfusion, _blurSteps, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {\n const blockCompilationFinal = typeof options === \"number\" ? blockCompilation : !!options.blockCompilation;\n const localOptions = {\n samplers: ThinDepthOfFieldMergePostProcess.Samplers,\n size: typeof options === \"number\" ? options : undefined,\n camera,\n samplingMode,\n engine,\n reusable,\n textureType,\n ...options,\n blockCompilation: true\n };\n super(name, ThinDepthOfFieldMergePostProcess.FragmentUrl, {\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinDepthOfFieldMergePostProcess(name, engine, localOptions) : undefined,\n ...localOptions\n });\n this._blurSteps = _blurSteps;\n this.externalTextureSamplerBinding = true;\n this.onApplyObservable.add(effect => {\n effect.setTextureFromPostProcess(\"textureSampler\", originalFromInput);\n effect.setTextureFromPostProcessOutput(\"circleOfConfusionSampler\", circleOfConfusion);\n _blurSteps.forEach((step, index) => {\n effect.setTextureFromPostProcessOutput(\"blurStep\" + (_blurSteps.length - index - 1), step);\n });\n });\n if (!blockCompilationFinal) {\n this.updateEffect();\n }\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 */\n updateEffect(defines = null, uniforms = null, samplers = null, indexParameters, onCompiled, onError) {\n if (!defines) {\n defines = \"\";\n defines += \"#define BLUR_LEVEL \" + (this._blurSteps.length - 1) + \"\\n\";\n }\n super.updateEffect(defines, uniforms, samplers, indexParameters, onCompiled, onError);\n }\n}","map":{"version":3,"names":["PostProcess","ThinDepthOfFieldMergePostProcess","DepthOfFieldMergePostProcess","getClassName","constructor","name","originalFromInput","circleOfConfusion","_blurSteps","options","camera","samplingMode","engine","reusable","textureType","blockCompilation","blockCompilationFinal","localOptions","samplers","Samplers","size","undefined","FragmentUrl","effectWrapper","externalTextureSamplerBinding","onApplyObservable","add","effect","setTextureFromPostProcess","setTextureFromPostProcessOutput","forEach","step","index","length","updateEffect","defines","uniforms","indexParameters","onCompiled","onError"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/depthOfFieldMergePostProcess.js"],"sourcesContent":["import { PostProcess } from \"./postProcess.js\";\n\nimport { ThinDepthOfFieldMergePostProcess } from \"./thinDepthOfFieldMergePostProcess.js\";\n/**\n * The DepthOfFieldMergePostProcess merges blurred images with the original based on the values of the circle of confusion.\n */\nexport class DepthOfFieldMergePostProcess extends PostProcess {\n /**\n * Gets a string identifying the name of the class\n * @returns \"DepthOfFieldMergePostProcess\" string\n */\n getClassName() {\n return \"DepthOfFieldMergePostProcess\";\n }\n /**\n * Creates a new instance of DepthOfFieldMergePostProcess\n * @param name The name of the effect.\n * @param originalFromInput Post process which's input will be used for the merge.\n * @param circleOfConfusion Circle of confusion post process which's output will be used to blur each pixel.\n * @param _blurSteps Blur post processes from low to high which will be mixed with the original image.\n * @param options The required width/height ratio to downsize to before computing the render pass.\n * @param camera The camera to apply the render pass to.\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\n * @param engine The engine which the post process will be applied. (default: current engine)\n * @param reusable If the post process can be reused on the same frame. (default: false)\n * @param textureType Type of textures used when performing the post process. (default: 0)\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(name, originalFromInput, circleOfConfusion, _blurSteps, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {\n const blockCompilationFinal = typeof options === \"number\" ? blockCompilation : !!options.blockCompilation;\n const localOptions = {\n samplers: ThinDepthOfFieldMergePostProcess.Samplers,\n size: typeof options === \"number\" ? options : undefined,\n camera,\n samplingMode,\n engine,\n reusable,\n textureType,\n ...options,\n blockCompilation: true,\n };\n super(name, ThinDepthOfFieldMergePostProcess.FragmentUrl, {\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinDepthOfFieldMergePostProcess(name, engine, localOptions) : undefined,\n ...localOptions,\n });\n this._blurSteps = _blurSteps;\n this.externalTextureSamplerBinding = true;\n this.onApplyObservable.add((effect) => {\n effect.setTextureFromPostProcess(\"textureSampler\", originalFromInput);\n effect.setTextureFromPostProcessOutput(\"circleOfConfusionSampler\", circleOfConfusion);\n _blurSteps.forEach((step, index) => {\n effect.setTextureFromPostProcessOutput(\"blurStep\" + (_blurSteps.length - index - 1), step);\n });\n });\n if (!blockCompilationFinal) {\n this.updateEffect();\n }\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 */\n updateEffect(defines = null, uniforms = null, samplers = null, indexParameters, onCompiled, onError) {\n if (!defines) {\n defines = \"\";\n defines += \"#define BLUR_LEVEL \" + (this._blurSteps.length - 1) + \"\\n\";\n }\n super.updateEffect(defines, uniforms, samplers, indexParameters, onCompiled, onError);\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,kBAAkB;AAE9C,SAASC,gCAAgC,QAAQ,uCAAuC;AACxF;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,SAASF,WAAW,CAAC;EAC1D;AACJ;AACA;AACA;EACIG,YAAYA,CAAA,EAAG;IACX,OAAO,8BAA8B;EACzC;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACIC,WAAWA,CAACC,IAAI,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,UAAU,EAAEC,OAAO,EAAEC,MAAM,EAAEC,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,WAAW,GAAG,CAAC,EAAEC,gBAAgB,GAAG,KAAK,EAAE;IAC5J,MAAMC,qBAAqB,GAAG,OAAOP,OAAO,KAAK,QAAQ,GAAGM,gBAAgB,GAAG,CAAC,CAACN,OAAO,CAACM,gBAAgB;IACzG,MAAME,YAAY,GAAG;MACjBC,QAAQ,EAAEjB,gCAAgC,CAACkB,QAAQ;MACnDC,IAAI,EAAE,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