217a95fbd19e26729b865add117270bcaac4b5ff1f868a6b77108f0685078248.json 28 KB

1
  1. {"ast":null,"code":"import { EffectWrapper } from \"../Materials/effectRenderer.js\";\nimport { Engine } from \"../Engines/engine.js\";\n/**\n * Post process used to apply a blur effect\n */\nexport class ThinBlurPostProcess extends EffectWrapper {\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(Promise.all([import(\"../ShadersWGSL/kernelBlur.fragment.js\"), import(\"../ShadersWGSL/kernelBlur.vertex.js\")]));\n } else {\n list.push(Promise.all([import(\"../Shaders/kernelBlur.fragment.js\"), import(\"../Shaders/kernelBlur.vertex.js\")]));\n }\n }\n /**\n * Constructs a new blur post process\n * @param name Name of the effect\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\n * @param direction Direction in which to apply the blur\n * @param kernel Kernel size of the blur\n * @param options Options to configure the effect\n */\n constructor(name, engine = null, direction, kernel, options) {\n const blockCompilationFinal = !!(options !== null && options !== void 0 && options.blockCompilation);\n super({\n ...options,\n name,\n engine: engine || Engine.LastCreatedEngine,\n useShaderStore: true,\n useAsPostProcess: true,\n fragmentShader: ThinBlurPostProcess.FragmentUrl,\n uniforms: ThinBlurPostProcess.Uniforms,\n samplers: ThinBlurPostProcess.Samplers,\n vertexUrl: ThinBlurPostProcess.VertexUrl,\n blockCompilation: true\n });\n this._packedFloat = false;\n this._staticDefines = \"\";\n /**\n * Width of the texture to apply the blur on\n */\n this.textureWidth = 0;\n /**\n * Height of the texture to apply the blur on\n */\n this.textureHeight = 0;\n this.options.blockCompilation = blockCompilationFinal;\n if (direction !== undefined) {\n this.direction = direction;\n }\n if (kernel !== undefined) {\n this.kernel = kernel;\n }\n }\n /**\n * Sets the length in pixels of the blur sample region\n */\n set kernel(v) {\n if (this._idealKernel === v) {\n return;\n }\n v = Math.max(v, 1);\n this._idealKernel = v;\n this._kernel = this._nearestBestKernel(v);\n if (!this.options.blockCompilation) {\n this._updateParameters();\n }\n }\n /**\n * Gets the length in pixels of the blur sample region\n */\n get kernel() {\n return this._idealKernel;\n }\n /**\n * Sets whether or not the blur needs to unpack/repack floats\n */\n set packedFloat(v) {\n if (this._packedFloat === v) {\n return;\n }\n this._packedFloat = v;\n if (!this.options.blockCompilation) {\n this._updateParameters();\n }\n }\n /**\n * Gets whether or not the blur is unpacking/repacking floats\n */\n get packedFloat() {\n return this._packedFloat;\n }\n bind() {\n super.bind();\n this._drawWrapper.effect.setFloat2(\"delta\", 1 / this.textureWidth * this.direction.x, 1 / this.textureHeight * this.direction.y);\n }\n /** @internal */\n _updateParameters(onCompiled, onError) {\n // Generate sampling offsets and weights\n const N = this._kernel;\n const centerIndex = (N - 1) / 2;\n // Generate Gaussian sampling weights over kernel\n let offsets = [];\n let weights = [];\n let totalWeight = 0;\n for (let i = 0; i < N; i++) {\n const u = i / (N - 1);\n const w = this._gaussianWeight(u * 2.0 - 1);\n offsets[i] = i - centerIndex;\n weights[i] = w;\n totalWeight += w;\n }\n // Normalize weights\n for (let i = 0; i < weights.length; i++) {\n weights[i] /= totalWeight;\n }\n // Optimize: combine samples to take advantage of hardware linear sampling\n // Walk from left to center, combining pairs (symmetrically)\n const linearSamplingWeights = [];\n const linearSamplingOffsets = [];\n const linearSamplingMap = [];\n for (let i = 0; i <= centerIndex; i += 2) {\n const j = Math.min(i + 1, Math.floor(centerIndex));\n const singleCenterSample = i === j;\n if (singleCenterSample) {\n linearSamplingMap.push({\n o: offsets[i],\n w: weights[i]\n });\n } else {\n const sharedCell = j === centerIndex;\n const weightLinear = weights[i] + weights[j] * (sharedCell ? 0.5 : 1);\n const offsetLinear = offsets[i] + 1 / (1 + weights[i] / weights[j]);\n if (offsetLinear === 0) {\n linearSamplingMap.push({\n o: offsets[i],\n w: weights[i]\n });\n linearSamplingMap.push({\n o: offsets[i + 1],\n w: weights[i + 1]\n });\n } else {\n linearSamplingMap.push({\n o: offsetLinear,\n w: weightLinear\n });\n linearSamplingMap.push({\n o: -offsetLinear,\n w: weightLinear\n });\n }\n }\n }\n for (let i = 0; i < linearSamplingMap.length; i++) {\n linearSamplingOffsets[i] = linearSamplingMap[i].o;\n linearSamplingWeights[i] = linearSamplingMap[i].w;\n }\n // Replace with optimized\n offsets = linearSamplingOffsets;\n weights = linearSamplingWeights;\n // Generate shaders\n const maxVaryingRows = this.options.engine.getCaps().maxVaryingVectors - (this.options.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? 1 : 0); // Because of the additional builtins\n const freeVaryingVec2 = Math.max(maxVaryingRows, 0) - 1; // Because of sampleCenter\n let varyingCount = Math.min(offsets.length, freeVaryingVec2);\n let defines = \"\";\n defines += this._staticDefines;\n // The DOF fragment should ignore the center pixel when looping as it is handled manually in the fragment shader.\n if (this._staticDefines.indexOf(\"DOF\") != -1) {\n defines += `#define CENTER_WEIGHT ${this._glslFloat(weights[varyingCount - 1])}\\n`;\n varyingCount--;\n }\n for (let i = 0; i < varyingCount; i++) {\n defines += `#define KERNEL_OFFSET${i} ${this._glslFloat(offsets[i])}\\n`;\n defines += `#define KERNEL_WEIGHT${i} ${this._glslFloat(weights[i])}\\n`;\n }\n let depCount = 0;\n for (let i = freeVaryingVec2; i < offsets.length; i++) {\n defines += `#define KERNEL_DEP_OFFSET${depCount} ${this._glslFloat(offsets[i])}\\n`;\n defines += `#define KERNEL_DEP_WEIGHT${depCount} ${this._glslFloat(weights[i])}\\n`;\n depCount++;\n }\n if (this.packedFloat) {\n defines += `#define PACKEDFLOAT 1`;\n }\n this.options.blockCompilation = false;\n this.updateEffect(defines, null, null, {\n varyingCount: varyingCount,\n depCount: depCount\n }, onCompiled, onError);\n }\n /**\n * Best kernels are odd numbers that when divided by 2, their integer part is even, so 5, 9 or 13.\n * Other odd kernels optimize correctly but require proportionally more samples, even kernels are\n * possible but will produce minor visual artifacts. Since each new kernel requires a new shader we\n * want to minimize kernel changes, having gaps between physical kernels is helpful in that regard.\n * The gaps between physical kernels are compensated for in the weighting of the samples\n * @param idealKernel Ideal blur kernel.\n * @returns Nearest best kernel.\n */\n _nearestBestKernel(idealKernel) {\n const v = Math.round(idealKernel);\n for (const k of [v, v - 1, v + 1, v - 2, v + 2]) {\n if (k % 2 !== 0 && Math.floor(k / 2) % 2 === 0 && k > 0) {\n return Math.max(k, 3);\n }\n }\n return Math.max(v, 3);\n }\n /**\n * Calculates the value of a Gaussian distribution with sigma 3 at a given point.\n * @param x The point on the Gaussian distribution to sample.\n * @returns the value of the Gaussian function at x.\n */\n _gaussianWeight(x) {\n //reference: Engines/ImageProcessingBlur.cpp #dcc760\n // We are evaluating the Gaussian (normal) distribution over a kernel parameter space of [-1,1],\n // so we truncate at three standard deviations by setting stddev (sigma) to 1/3.\n // The choice of 3-sigma truncation is common but arbitrary, and means that the signal is\n // truncated at around 1.3% of peak strength.\n //the distribution is scaled to account for the difference between the actual kernel size and the requested kernel size\n const sigma = 1 / 3;\n const denominator = Math.sqrt(2.0 * Math.PI) * sigma;\n const exponent = -(x * x / (2.0 * sigma * sigma));\n const weight = 1.0 / denominator * Math.exp(exponent);\n return weight;\n }\n /**\n * Generates a string that can be used as a floating point number in GLSL.\n * @param x Value to print.\n * @param decimalFigures Number of decimal places to print the number to (excluding trailing 0s).\n * @returns GLSL float string.\n */\n _glslFloat(x, decimalFigures = 8) {\n return x.toFixed(decimalFigures).replace(/0+$/, \"\");\n }\n}\n/**\n * The vertex shader url\n */\nThinBlurPostProcess.VertexUrl = \"kernelBlur\";\n/**\n * The fragment shader url\n */\nThinBlurPostProcess.FragmentUrl = \"kernelBlur\";\n/**\n * The list of uniforms used by the effect\n */\nThinBlurPostProcess.Uniforms = [\"delta\", \"direction\"];\n/**\n * The list of samplers used by the effect\n */\nThinBlurPostProcess.Samplers = [\"circleOfConfusionSampler\"];","map":{"version":3,"names":["EffectWrapper","Engine","ThinBlurPostProcess","_gatherImports","useWebGPU","list","_webGPUReady","push","Promise","all","constructor","name","engine","direction","kernel","options","blockCompilationFinal","blockCompilation","LastCreatedEngine","useShaderStore","useAsPostProcess","fragmentShader","FragmentUrl","uniforms","Uniforms","samplers","Samplers","vertexUrl","VertexUrl","_packedFloat","_staticDefines","textureWidth","textureHeight","undefined","v","_idealKernel","Math","max","_kernel","_nearestBestKernel","_updateParameters","packedFloat","bind","_drawWrapper","effect","setFloat2","x","y","onCompiled","onError","N","centerIndex","offsets","weights","totalWeight","i","u","w","_gaussianWeight","length","linearSamplingWeights","linearSamplingOffsets","linearSamplingMap","j","min","floor","singleCenterSample","o","sharedCell","weightLinear","offsetLinear","maxVaryingRows","getCaps","maxVaryingVectors","shaderLanguage","freeVaryingVec2","varyingCount","defines","indexOf","_glslFloat","depCount","updateEffect","idealKernel","round","k","sigma","denominator","sqrt","PI","exponent","weight","exp","decimalFigures","toFixed","replace"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/thinBlurPostProcess.js"],"sourcesContent":["import { EffectWrapper } from \"../Materials/effectRenderer.js\";\nimport { Engine } from \"../Engines/engine.js\";\n/**\n * Post process used to apply a blur effect\n */\nexport class ThinBlurPostProcess extends EffectWrapper {\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(Promise.all([import(\"../ShadersWGSL/kernelBlur.fragment.js\"), import(\"../ShadersWGSL/kernelBlur.vertex.js\")]));\n }\n else {\n list.push(Promise.all([import(\"../Shaders/kernelBlur.fragment.js\"), import(\"../Shaders/kernelBlur.vertex.js\")]));\n }\n }\n /**\n * Constructs a new blur post process\n * @param name Name of the effect\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\n * @param direction Direction in which to apply the blur\n * @param kernel Kernel size of the blur\n * @param options Options to configure the effect\n */\n constructor(name, engine = null, direction, kernel, options) {\n const blockCompilationFinal = !!options?.blockCompilation;\n super({\n ...options,\n name,\n engine: engine || Engine.LastCreatedEngine,\n useShaderStore: true,\n useAsPostProcess: true,\n fragmentShader: ThinBlurPostProcess.FragmentUrl,\n uniforms: ThinBlurPostProcess.Uniforms,\n samplers: ThinBlurPostProcess.Samplers,\n vertexUrl: ThinBlurPostProcess.VertexUrl,\n blockCompilation: true,\n });\n this._packedFloat = false;\n this._staticDefines = \"\";\n /**\n * Width of the texture to apply the blur on\n */\n this.textureWidth = 0;\n /**\n * Height of the texture to apply the blur on\n */\n this.textureHeight = 0;\n this.options.blockCompilation = blockCompilationFinal;\n if (direction !== undefined) {\n this.direction = direction;\n }\n if (kernel !== undefined) {\n this.kernel = kernel;\n }\n }\n /**\n * Sets the length in pixels of the blur sample region\n */\n set kernel(v) {\n if (this._idealKernel === v) {\n return;\n }\n v = Math.max(v, 1);\n this._idealKernel = v;\n this._kernel = this._nearestBestKernel(v);\n if (!this.options.blockCompilation) {\n this._updateParameters();\n }\n }\n /**\n * Gets the length in pixels of the blur sample region\n */\n get kernel() {\n return this._idealKernel;\n }\n /**\n * Sets whether or not the blur needs to unpack/repack floats\n */\n set packedFloat(v) {\n if (this._packedFloat === v) {\n return;\n }\n this._packedFloat = v;\n if (!this.options.blockCompilation) {\n this._updateParameters();\n }\n }\n /**\n * Gets whether or not the blur is unpacking/repacking floats\n */\n get packedFloat() {\n return this._packedFloat;\n }\n bind() {\n super.bind();\n this._drawWrapper.effect.setFloat2(\"delta\", (1 / this.textureWidth) * this.direction.x, (1 / this.textureHeight) * this.direction.y);\n }\n /** @internal */\n _updateParameters(onCompiled, onError) {\n // Generate sampling offsets and weights\n const N = this._kernel;\n const centerIndex = (N - 1) / 2;\n // Generate Gaussian sampling weights over kernel\n let offsets = [];\n let weights = [];\n let totalWeight = 0;\n for (let i = 0; i < N; i++) {\n const u = i / (N - 1);\n const w = this._gaussianWeight(u * 2.0 - 1);\n offsets[i] = i - centerIndex;\n weights[i] = w;\n totalWeight += w;\n }\n // Normalize weights\n for (let i = 0; i < weights.length; i++) {\n weights[i] /= totalWeight;\n }\n // Optimize: combine samples to take advantage of hardware linear sampling\n // Walk from left to center, combining pairs (symmetrically)\n const linearSamplingWeights = [];\n const linearSamplingOffsets = [];\n const linearSamplingMap = [];\n for (let i = 0; i <= centerIndex; i += 2) {\n const j = Math.min(i + 1, Math.floor(centerIndex));\n const singleCenterSample = i === j;\n if (singleCenterSample) {\n linearSamplingMap.push({ o: offsets[i], w: weights[i] });\n }\n else {\n const sharedCell = j === centerIndex;\n const weightLinear = weights[i] + weights[j] * (sharedCell ? 0.5 : 1);\n const offsetLinear = offsets[i] + 1 / (1 + weights[i] / weights[j]);\n if (offsetLinear === 0) {\n linearSamplingMap.push({ o: offsets[i], w: weights[i] });\n linearSamplingMap.push({ o: offsets[i + 1], w: weights[i + 1] });\n }\n else {\n linearSamplingMap.push({ o: offsetLinear, w: weightLinear });\n linearSamplingMap.push({ o: -offsetLinear, w: weightLinear });\n }\n }\n }\n for (let i = 0; i < linearSamplingMap.length; i++) {\n linearSamplingOffsets[i] = linearSamplingMap[i].o;\n linearSamplingWeights[i] = linearSamplingMap[i].w;\n }\n // Replace with optimized\n offsets = linearSamplingOffsets;\n weights = linearSamplingWeights;\n // Generate shaders\n const maxVaryingRows = this.options.engine.getCaps().maxVaryingVectors - (this.options.shaderLanguage === 1 /* ShaderLanguage.WGSL */ ? 1 : 0); // Because of the additional builtins\n const freeVaryingVec2 = Math.max(maxVaryingRows, 0) - 1; // Because of sampleCenter\n let varyingCount = Math.min(offsets.length, freeVaryingVec2);\n let defines = \"\";\n defines += this._staticDefines;\n // The DOF fragment should ignore the center pixel when looping as it is handled manually in the fragment shader.\n if (this._staticDefines.indexOf(\"DOF\") != -1) {\n defines += `#define CENTER_WEIGHT ${this._glslFloat(weights[varyingCount - 1])}\\n`;\n varyingCount--;\n }\n for (let i = 0; i < varyingCount; i++) {\n defines += `#define KERNEL_OFFSET${i} ${this._glslFloat(offsets[i])}\\n`;\n defines += `#define KERNEL_WEIGHT${i} ${this._glslFloat(weights[i])}\\n`;\n }\n let depCount = 0;\n for (let i = freeVaryingVec2; i < offsets.length; i++) {\n defines += `#define KERNEL_DEP_OFFSET${depCount} ${this._glslFloat(offsets[i])}\\n`;\n defines += `#define KERNEL_DEP_WEIGHT${depCount} ${this._glslFloat(weights[i])}\\n`;\n depCount++;\n }\n if (this.packedFloat) {\n defines += `#define PACKEDFLOAT 1`;\n }\n this.options.blockCompilation = false;\n this.updateEffect(defines, null, null, {\n varyingCount: varyingCount,\n depCount: depCount,\n }, onCompiled, onError);\n }\n /**\n * Best kernels are odd numbers that when divided by 2, their integer part is even, so 5, 9 or 13.\n * Other odd kernels optimize correctly but require proportionally more samples, even kernels are\n * possible but will produce minor visual artifacts. Since each new kernel requires a new shader we\n * want to minimize kernel changes, having gaps between physical kernels is helpful in that regard.\n * The gaps between physical kernels are compensated for in the weighting of the samples\n * @param idealKernel Ideal blur kernel.\n * @returns Nearest best kernel.\n */\n _nearestBestKernel(idealKernel) {\n const v = Math.round(idealKernel);\n for (const k of [v, v - 1, v + 1, v - 2, v + 2]) {\n if (k % 2 !== 0 && Math.floor(k / 2) % 2 === 0 && k > 0) {\n return Math.max(k, 3);\n }\n }\n return Math.max(v, 3);\n }\n /**\n * Calculates the value of a Gaussian distribution with sigma 3 at a given point.\n * @param x The point on the Gaussian distribution to sample.\n * @returns the value of the Gaussian function at x.\n */\n _gaussianWeight(x) {\n //reference: Engines/ImageProcessingBlur.cpp #dcc760\n // We are evaluating the Gaussian (normal) distribution over a kernel parameter space of [-1,1],\n // so we truncate at three standard deviations by setting stddev (sigma) to 1/3.\n // The choice of 3-sigma truncation is common but arbitrary, and means that the signal is\n // truncated at around 1.3% of peak strength.\n //the distribution is scaled to account for the difference between the actual kernel size and the requested kernel size\n const sigma = 1 / 3;\n const denominator = Math.sqrt(2.0 * Math.PI) * sigma;\n const exponent = -((x * x) / (2.0 * sigma * sigma));\n const weight = (1.0 / denominator) * Math.exp(exponent);\n return weight;\n }\n /**\n * Generates a string that can be used as a floating point number in GLSL.\n * @param x Value to print.\n * @param decimalFigures Number of decimal places to print the number to (excluding trailing 0s).\n * @returns GLSL float string.\n */\n _glslFloat(x, decimalFigures = 8) {\n return x.toFixed(decimalFigures).replace(/0+$/, \"\");\n }\n}\n/**\n * The vertex shader url\n */\nThinBlurPostProcess.VertexUrl = \"kernelBlur\";\n/**\n * The fragment shader url\n */\nThinBlurPostProcess.FragmentUrl = \"kernelBlur\";\n/**\n * The list of uniforms used by the effect\n */\nThinBlurPostProcess.Uniforms = [\"delta\", \"direction\"];\n/**\n * The list of samplers used by the effect\n */\nThinBlurPostProcess.Samplers = [\"circleOfConfusionSampler\"];\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,gCAAgC;AAC9D,SAASC,MAAM,QAAQ,sBAAsB;AAC7C;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,SAASF,aAAa,CAAC;EACnDG,cAAcA,CAACC,SAAS,EAAEC,IAAI,EAAE;IAC5B,IAAID,SAAS,EAAE;MACX,IAAI,CAACE,YAAY,GAAG,IAAI;MACxBD,IAAI,CAACE,IAAI,CAACC,OAAO,CAACC,GAAG,CAAC,CAAC,MAAM,CAAC,uCAAuC,CAAC,EAAE,MAAM,CAAC,qCAAqC,CAAC,CAAC,CAAC,CAAC;IAC5H,CAAC,MACI;MACDJ,IAAI,CAACE,IAAI,CAACC,OAAO,CAACC,GAAG,CAAC,CAAC,MAAM,CAAC,mCAAmC,CAAC,EAAE,MAAM,CAAC,iCAAiC,CAAC,CAAC,CAAC,CAAC;IACpH;EACJ;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;EACIC,WAAWA,CAACC,IAAI,EAAEC,MAAM,GAAG,IAAI,EAAEC,SAAS,EAAEC,MAAM,EAAEC,OAAO,EAAE;IACzD,MAAMC,qBAAqB,GAAG,CAAC,EAACD,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEE,gBAAgB;IACzD,KAAK,CAAC;MACF,GAAGF,OAAO;MACVJ,IAAI;MACJC,MAAM,EAAEA,MAAM,IAAIX,MAAM,CAACiB,iBAAiB;MAC1CC,cAAc,EAAE,IAAI;MACpBC,gBAAgB,EAAE,IAAI;MACtBC,cAAc,EAAEnB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