b205361dafce8f187e7b54b9143a77a27f896a37f1e8287ffe09b1ea9e7e1a62.json 76 KB

1
  1. {"ast":null,"code":"import { __decorate } from \"../../../tslib.es6.js\";\n/* eslint-disable @typescript-eslint/naming-convention */\nimport { Logger } from \"../../../Misc/logger.js\";\nimport { serialize } from \"../../../Misc/decorators.js\";\nimport { SerializationHelper } from \"../../../Misc/decorators.serialization.js\";\nimport { Vector3, TmpVectors, Vector2 } from \"../../../Maths/math.vector.js\";\nimport { Camera } from \"../../../Cameras/camera.js\";\nimport { Texture } from \"../../../Materials/Textures/texture.js\";\nimport { PostProcess } from \"../../../PostProcesses/postProcess.js\";\nimport { PostProcessRenderPipeline } from \"../../../PostProcesses/RenderPipeline/postProcessRenderPipeline.js\";\nimport { PostProcessRenderEffect } from \"../../../PostProcesses/RenderPipeline/postProcessRenderEffect.js\";\nimport { PassPostProcess } from \"../../../PostProcesses/passPostProcess.js\";\nimport { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { EngineStore } from \"../../../Engines/engineStore.js\";\nimport { SSAO2Configuration } from \"../../../Rendering/ssao2Configuration.js\";\nimport { RandomRange } from \"../../../Maths/math.scalar.functions.js\";\nimport { RawTexture } from \"../../../Materials/Textures/rawTexture.js\";\nimport \"../../../PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js\";\n/**\n * Render pipeline to produce ssao effect\n */\nexport class SSAO2RenderingPipeline extends PostProcessRenderPipeline {\n /**\n * Used in SSAO calculations to compensate for accuracy issues with depth values. Default 0.02.\n *\n * Normally you do not need to change this value, but you can experiment with it if you get a lot of in false self-occlusion on flat surfaces when using fewer than 16 samples. Useful range is normally [0..0.1] but higher values is allowed.\n */\n set epsilon(n) {\n this._epsilon = n;\n this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO());\n }\n get epsilon() {\n return this._epsilon;\n }\n /**\n * Number of samples used for the SSAO calculations. Default value is 8.\n */\n set samples(n) {\n this._samples = n;\n this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO());\n this._sampleSphere = this._generateHemisphere();\n }\n get samples() {\n return this._samples;\n }\n /**\n * Number of samples to use for antialiasing.\n */\n set textureSamples(n) {\n this._textureSamples = n;\n if (this._prePassRenderer) {\n this._prePassRenderer.samples = n;\n } else {\n this._originalColorPostProcess.samples = n;\n }\n }\n get textureSamples() {\n return this._textureSamples;\n }\n get _geometryBufferRenderer() {\n if (!this._forceGeometryBuffer) {\n return null;\n }\n return this._scene.geometryBufferRenderer;\n }\n get _prePassRenderer() {\n if (this._forceGeometryBuffer) {\n return null;\n }\n return this._scene.prePassRenderer;\n }\n /**\n * Skips the denoising (blur) stage of the SSAO calculations.\n *\n * Useful to temporarily set while experimenting with the other SSAO2 settings.\n */\n set bypassBlur(b) {\n const defines = this._getDefinesForBlur(this.expensiveBlur, b);\n const samplers = this._getSamplersForBlur(b);\n this._blurHPostProcess.updateEffect(defines.h, null, samplers);\n this._blurVPostProcess.updateEffect(defines.v, null, samplers);\n this._bypassBlur = b;\n }\n get bypassBlur() {\n return this._bypassBlur;\n }\n /**\n * Enables the configurable bilateral denoising (blurring) filter. Default is true.\n * Set to false to instead use a legacy bilateral filter that can't be configured.\n *\n * The denoising filter runs after the SSAO calculations and is a very important step. Both options results in a so called bilateral being used, but the \"expensive\" one can be\n * configured in several ways to fit your scene.\n */\n set expensiveBlur(b) {\n const defines = this._getDefinesForBlur(b, this._bypassBlur);\n this._blurHPostProcess.updateEffect(defines.h);\n this._blurVPostProcess.updateEffect(defines.v);\n this._expensiveBlur = b;\n }\n get expensiveBlur() {\n return this._expensiveBlur;\n }\n /**\n * Support test.\n */\n static get IsSupported() {\n const engine = EngineStore.LastCreatedEngine;\n if (!engine) {\n return false;\n }\n return engine._features.supportSSAO2;\n }\n /**\n * Gets active scene\n */\n get scene() {\n return this._scene;\n }\n /**\n * @constructor\n * @param name The rendering pipeline name\n * @param scene The scene linked to this pipeline\n * @param ratio The size of the postprocesses. Can be a number shared between passes or an object for more precision: { ssaoRatio: 0.5, blurRatio: 1.0 }\n * @param cameras The array of cameras that the rendering pipeline will be attached to\n * @param forceGeometryBuffer Set to true if you want to use the legacy geometry buffer renderer\n * @param textureType The texture type used by the different post processes created by SSAO (default: 0)\n */\n constructor(name, scene, ratio, cameras, forceGeometryBuffer = false, textureType = 0) {\n super(scene.getEngine(), name);\n // Members\n /**\n * @ignore\n * The PassPostProcess id in the pipeline that contains the original scene color\n */\n this.SSAOOriginalSceneColorEffect = \"SSAOOriginalSceneColorEffect\";\n /**\n * @ignore\n * The SSAO PostProcess id in the pipeline\n */\n this.SSAORenderEffect = \"SSAORenderEffect\";\n /**\n * @ignore\n * The horizontal blur PostProcess id in the pipeline\n */\n this.SSAOBlurHRenderEffect = \"SSAOBlurHRenderEffect\";\n /**\n * @ignore\n * The vertical blur PostProcess id in the pipeline\n */\n this.SSAOBlurVRenderEffect = \"SSAOBlurVRenderEffect\";\n /**\n * @ignore\n * The PostProcess id in the pipeline that combines the SSAO-Blur output with the original scene color (SSAOOriginalSceneColorEffect)\n */\n this.SSAOCombineRenderEffect = \"SSAOCombineRenderEffect\";\n /**\n * The output strength of the SSAO post-process. Default value is 1.0.\n */\n this.totalStrength = 1.0;\n /**\n * Maximum depth value to still render AO. A smooth falloff makes the dimming more natural, so there will be no abrupt shading change.\n */\n this.maxZ = 100.0;\n /**\n * In order to save performances, SSAO radius is clamped on close geometry. This ratio changes by how much.\n */\n this.minZAspect = 0.2;\n this._epsilon = 0.02;\n this._samples = 8;\n this._textureSamples = 1;\n /**\n * Force rendering the geometry through geometry buffer.\n */\n this._forceGeometryBuffer = false;\n /**\n * The radius around the analyzed pixel used by the SSAO post-process. Default value is 2.0\n */\n this.radius = 2.0;\n /**\n * The base color of the SSAO post-process\n * The final result is \"base + ssao\" between [0, 1]\n */\n this.base = 0;\n this._bypassBlur = false;\n this._expensiveBlur = true;\n /**\n * The number of samples the bilateral filter uses in both dimensions when denoising the SSAO calculations. Default value is 16.\n *\n * A higher value should result in smoother shadows but will use more processing time in the shaders.\n *\n * A high value can cause the shadows to get to blurry or create visible artifacts (bands) near sharp details in the geometry. The artifacts can sometimes be mitigated by increasing the bilateralSoften setting.\n */\n this.bilateralSamples = 16;\n /**\n * Controls the shape of the denoising kernel used by the bilateral filter. Default value is 0.\n *\n * By default the bilateral filter acts like a box-filter, treating all samples on the same depth with equal weights. This is effective to maximize the denoising effect given a limited set of samples. However, it also often results in visible ghosting around sharp shadow regions and can spread out lines over large areas so they are no longer visible.\n *\n * Increasing this setting will make the filter pay less attention to samples further away from the center sample, reducing many artifacts but at the same time increasing noise.\n *\n * Useful value range is [0..1].\n */\n this.bilateralSoften = 0;\n /**\n * How forgiving the bilateral denoiser should be when rejecting samples. Default value is 0.\n *\n * A higher value results in the bilateral filter being more forgiving and thus doing a better job at denoising slanted and curved surfaces, but can lead to shadows spreading out around corners or between objects that are close to each other depth wise.\n *\n * Useful value range is normally [0..1], but higher values are allowed.\n */\n this.bilateralTolerance = 0;\n this._bits = new Uint32Array(1);\n this._scene = scene;\n this._ratio = ratio;\n this._textureType = textureType;\n this._forceGeometryBuffer = forceGeometryBuffer;\n if (!this.isSupported) {\n Logger.Error(\"The current engine does not support SSAO 2.\");\n return;\n }\n const ssaoRatio = this._ratio.ssaoRatio || ratio;\n const blurRatio = this._ratio.blurRatio || ratio;\n // Set up assets\n if (this._forceGeometryBuffer) {\n var _scene$geometryBuffer;\n scene.enableGeometryBufferRenderer();\n if ((_scene$geometryBuffer = scene.geometryBufferRenderer) !== null && _scene$geometryBuffer !== void 0 && _scene$geometryBuffer.generateNormalsInWorldSpace) {\n Logger.Error(\"SSAO2RenderingPipeline does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!\");\n }\n } else {\n var _scene$prePassRendere;\n scene.enablePrePassRenderer();\n if ((_scene$prePassRendere = scene.prePassRenderer) !== null && _scene$prePassRendere !== void 0 && _scene$prePassRendere.generateNormalsInWorldSpace) {\n Logger.Error(\"SSAO2RenderingPipeline does not support generateNormalsInWorldSpace=true for the prepass renderer!\");\n }\n }\n this._createRandomTexture();\n this._originalColorPostProcess = new PassPostProcess(\"SSAOOriginalSceneColor\", 1.0, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), undefined, this._textureType);\n this._originalColorPostProcess.samples = this.textureSamples;\n this._createSSAOPostProcess(1.0, textureType);\n this._createBlurPostProcess(ssaoRatio, blurRatio, this._textureType);\n this._createSSAOCombinePostProcess(blurRatio, this._textureType);\n // Set up pipeline\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOOriginalSceneColorEffect, () => {\n return this._originalColorPostProcess;\n }, true));\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAORenderEffect, () => {\n return this._ssaoPostProcess;\n }, true));\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurHRenderEffect, () => {\n return this._blurHPostProcess;\n }, true));\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurVRenderEffect, () => {\n return this._blurVPostProcess;\n }, true));\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOCombineRenderEffect, () => {\n return this._ssaoCombinePostProcess;\n }, true));\n // Finish\n scene.postProcessRenderPipelineManager.addPipeline(this);\n if (cameras) {\n scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras);\n }\n }\n // Public Methods\n /**\n * Get the class name\n * @returns \"SSAO2RenderingPipeline\"\n */\n getClassName() {\n return \"SSAO2RenderingPipeline\";\n }\n /**\n * Removes the internal pipeline assets and detaches the pipeline from the scene cameras\n * @param disableGeometryBufferRenderer Set to true if you want to disable the Geometry Buffer renderer\n */\n dispose(disableGeometryBufferRenderer = false) {\n for (let i = 0; i < this._scene.cameras.length; i++) {\n const camera = this._scene.cameras[i];\n this._originalColorPostProcess.dispose(camera);\n this._ssaoPostProcess.dispose(camera);\n this._blurHPostProcess.dispose(camera);\n this._blurVPostProcess.dispose(camera);\n this._ssaoCombinePostProcess.dispose(camera);\n }\n this._randomTexture.dispose();\n if (disableGeometryBufferRenderer) {\n this._scene.disableGeometryBufferRenderer();\n }\n this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras);\n super.dispose();\n }\n // Private Methods\n /** @internal */\n _rebuild() {\n super._rebuild();\n }\n _getSamplersForBlur(disabled) {\n return disabled ? [\"textureSampler\"] : [\"textureSampler\", \"depthSampler\"];\n }\n _getDefinesForBlur(bilateral, disabled) {\n let define = \"#define BLUR\\n\";\n if (disabled) {\n define += \"#define BLUR_BYPASS\\n\";\n }\n if (!bilateral) {\n define += \"#define BLUR_LEGACY\\n\";\n }\n return {\n h: define + \"#define BLUR_H\\n\",\n v: define\n };\n }\n _createBlurPostProcess(ssaoRatio, blurRatio, textureType) {\n const defines = this._getDefinesForBlur(this.expensiveBlur, this.bypassBlur);\n const samplers = this._getSamplersForBlur(this.bypassBlur);\n this._blurHPostProcess = this._createBlurFilter(\"BlurH\", samplers, ssaoRatio, defines.h, textureType, true);\n this._blurVPostProcess = this._createBlurFilter(\"BlurV\", samplers, blurRatio, defines.v, textureType, false);\n }\n _createBlurFilter(name, samplers, ratio, defines, textureType, horizontal) {\n const blurFilter = new PostProcess(name, \"ssao2\", [\"outSize\", \"samples\", \"soften\", \"tolerance\"], samplers, ratio, null, Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, defines, textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {\n if (useWebGPU) {\n list.push(import(\"../../../ShadersWGSL/ssao2.fragment.js\"));\n } else {\n list.push(import(\"../../../Shaders/ssao2.fragment.js\"));\n }\n });\n blurFilter.onApply = effect => {\n if (!this._scene.activeCamera) {\n return;\n }\n const ssaoCombineSize = horizontal ? this._ssaoCombinePostProcess.width : this._ssaoCombinePostProcess.height;\n const originalColorSize = horizontal ? this._originalColorPostProcess.width : this._originalColorPostProcess.height;\n effect.setFloat(\"outSize\", ssaoCombineSize > 0 ? ssaoCombineSize : originalColorSize);\n effect.setInt(\"samples\", this.bilateralSamples);\n effect.setFloat(\"soften\", this.bilateralSoften);\n effect.setFloat(\"tolerance\", this.bilateralTolerance);\n if (this._geometryBufferRenderer) {\n effect.setTexture(\"depthSampler\", this._geometryBufferRenderer.getGBuffer().textures[0]);\n } else if (this._prePassRenderer) {\n effect.setTexture(\"depthSampler\", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]);\n }\n };\n blurFilter.samples = this.textureSamples;\n blurFilter.autoClear = false;\n return blurFilter;\n }\n //Van der Corput radical inverse\n _radicalInverse_VdC(i) {\n this._bits[0] = i;\n this._bits[0] = (this._bits[0] << 16 | this._bits[0] >> 16) >>> 0;\n this._bits[0] = (this._bits[0] & 0x55555555) << 1 | (this._bits[0] & 0xaaaaaaaa) >>> 1 >>> 0;\n this._bits[0] = (this._bits[0] & 0x33333333) << 2 | (this._bits[0] & 0xcccccccc) >>> 2 >>> 0;\n this._bits[0] = (this._bits[0] & 0x0f0f0f0f) << 4 | (this._bits[0] & 0xf0f0f0f0) >>> 4 >>> 0;\n this._bits[0] = (this._bits[0] & 0x00ff00ff) << 8 | (this._bits[0] & 0xff00ff00) >>> 8 >>> 0;\n return this._bits[0] * 2.3283064365386963e-10; // / 0x100000000 or / 4294967296\n }\n _hammersley(i, n) {\n return [i / n, this._radicalInverse_VdC(i)];\n }\n _hemisphereSample_uniform(u, v) {\n const phi = v * 2.0 * Math.PI;\n // rejecting samples that are close to tangent plane to avoid z-fighting artifacts\n const cosTheta = 1.0 - u * 0.85;\n const sinTheta = Math.sqrt(1.0 - cosTheta * cosTheta);\n return new Vector3(Math.cos(phi) * sinTheta, Math.sin(phi) * sinTheta, cosTheta);\n }\n _generateHemisphere() {\n const numSamples = this.samples;\n const result = [];\n let vector;\n let i = 0;\n while (i < numSamples) {\n if (numSamples < 16) {\n vector = this._hemisphereSample_uniform(Math.random(), Math.random());\n } else {\n const rand = this._hammersley(i, numSamples);\n vector = this._hemisphereSample_uniform(rand[0], rand[1]);\n }\n result.push(vector.x, vector.y, vector.z);\n i++;\n }\n return result;\n }\n _getDefinesForSSAO() {\n const defines = `#define SSAO\\n#define SAMPLES ${this.samples}\\n#define EPSILON ${this.epsilon.toFixed(4)}`;\n return defines;\n }\n _createSSAOPostProcess(ratio, textureType) {\n this._sampleSphere = this._generateHemisphere();\n const defines = this._getDefinesForSSAO();\n const samplers = [\"randomSampler\", \"depthSampler\", \"normalSampler\"];\n this._ssaoPostProcess = new PostProcess(\"ssao2\", \"ssao2\", [\"sampleSphere\", \"samplesFactor\", \"randTextureTiles\", \"totalStrength\", \"radius\", \"base\", \"range\", \"projection\", \"near\", \"texelSize\", \"xViewport\", \"yViewport\", \"maxZ\", \"minZAspect\", \"depthProjection\"], samplers, ratio, null, Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, defines, textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {\n if (useWebGPU) {\n list.push(import(\"../../../ShadersWGSL/ssao2.fragment.js\"));\n } else {\n list.push(import(\"../../../Shaders/ssao2.fragment.js\"));\n }\n });\n this._ssaoPostProcess.autoClear = false;\n this._ssaoPostProcess.onApply = effect => {\n if (!this._scene.activeCamera) {\n return;\n }\n effect.setArray3(\"sampleSphere\", this._sampleSphere);\n effect.setFloat(\"randTextureTiles\", 32.0);\n effect.setFloat(\"samplesFactor\", 1 / this.samples);\n effect.setFloat(\"totalStrength\", this.totalStrength);\n effect.setFloat2(\"texelSize\", 1 / this._ssaoPostProcess.width, 1 / this._ssaoPostProcess.height);\n effect.setFloat(\"radius\", this.radius);\n effect.setFloat(\"maxZ\", this.maxZ);\n effect.setFloat(\"minZAspect\", this.minZAspect);\n effect.setFloat(\"base\", this.base);\n effect.setFloat(\"near\", this._scene.activeCamera.minZ);\n if (this._scene.activeCamera.mode === Camera.PERSPECTIVE_CAMERA) {\n effect.setMatrix3x3(\"depthProjection\", SSAO2RenderingPipeline.PERSPECTIVE_DEPTH_PROJECTION);\n effect.setFloat(\"xViewport\", Math.tan(this._scene.activeCamera.fov / 2) * this._scene.getEngine().getAspectRatio(this._scene.activeCamera, true));\n effect.setFloat(\"yViewport\", Math.tan(this._scene.activeCamera.fov / 2));\n } else {\n var _this$_scene$activeCa, _this$_scene$activeCa2, _this$_scene$activeCa3, _this$_scene$activeCa4;\n const halfWidth = this._scene.getEngine().getRenderWidth() / 2.0;\n const halfHeight = this._scene.getEngine().getRenderHeight() / 2.0;\n const orthoLeft = (_this$_scene$activeCa = this._scene.activeCamera.orthoLeft) !== null && _this$_scene$activeCa !== void 0 ? _this$_scene$activeCa : -halfWidth;\n const orthoRight = (_this$_scene$activeCa2 = this._scene.activeCamera.orthoRight) !== null && _this$_scene$activeCa2 !== void 0 ? _this$_scene$activeCa2 : halfWidth;\n const orthoBottom = (_this$_scene$activeCa3 = this._scene.activeCamera.orthoBottom) !== null && _this$_scene$activeCa3 !== void 0 ? _this$_scene$activeCa3 : -halfHeight;\n const orthoTop = (_this$_scene$activeCa4 = this._scene.activeCamera.orthoTop) !== null && _this$_scene$activeCa4 !== void 0 ? _this$_scene$activeCa4 : halfHeight;\n effect.setMatrix3x3(\"depthProjection\", SSAO2RenderingPipeline.ORTHO_DEPTH_PROJECTION);\n effect.setFloat(\"xViewport\", (orthoRight - orthoLeft) * 0.5);\n effect.setFloat(\"yViewport\", (orthoTop - orthoBottom) * 0.5);\n }\n effect.setMatrix(\"projection\", this._scene.getProjectionMatrix());\n if (this._geometryBufferRenderer) {\n effect.setTexture(\"depthSampler\", this._geometryBufferRenderer.getGBuffer().textures[0]);\n effect.setTexture(\"normalSampler\", this._geometryBufferRenderer.getGBuffer().textures[1]);\n } else if (this._prePassRenderer) {\n effect.setTexture(\"depthSampler\", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]);\n effect.setTexture(\"normalSampler\", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(6)]);\n }\n effect.setTexture(\"randomSampler\", this._randomTexture);\n };\n this._ssaoPostProcess.samples = this.textureSamples;\n if (!this._forceGeometryBuffer) {\n this._ssaoPostProcess._prePassEffectConfiguration = new SSAO2Configuration();\n }\n }\n _createSSAOCombinePostProcess(ratio, textureType) {\n this._ssaoCombinePostProcess = new PostProcess(\"ssaoCombine\", \"ssaoCombine\", [], [\"originalColor\", \"viewport\"], ratio, null, Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, undefined, textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {\n if (useWebGPU) {\n list.push(import(\"../../../ShadersWGSL/ssaoCombine.fragment.js\"));\n } else {\n list.push(import(\"../../../Shaders/ssaoCombine.fragment.js\"));\n }\n });\n this._ssaoCombinePostProcess.onApply = effect => {\n const viewport = this._scene.activeCamera.viewport;\n effect.setVector4(\"viewport\", TmpVectors.Vector4[0].copyFromFloats(viewport.x, viewport.y, viewport.width, viewport.height));\n effect.setTextureFromPostProcessOutput(\"originalColor\", this._originalColorPostProcess);\n };\n this._ssaoCombinePostProcess.autoClear = false;\n this._ssaoCombinePostProcess.samples = this.textureSamples;\n }\n _createRandomTexture() {\n const size = 128;\n const data = new Uint8Array(size * size * 4);\n const randVector = Vector2.Zero();\n for (let index = 0; index < data.length;) {\n randVector.set(RandomRange(0, 1), RandomRange(0, 1)).normalize().scaleInPlace(255);\n data[index++] = Math.floor(randVector.x);\n data[index++] = Math.floor(randVector.y);\n data[index++] = 0;\n data[index++] = 255;\n }\n const texture = RawTexture.CreateRGBATexture(data, size, size, this._scene, false, false, 2);\n texture.name = \"SSAORandomTexture\";\n texture.wrapU = Texture.WRAP_ADDRESSMODE;\n texture.wrapV = Texture.WRAP_ADDRESSMODE;\n this._randomTexture = texture;\n }\n /**\n * Serialize the rendering pipeline (Used when exporting)\n * @returns the serialized object\n */\n serialize() {\n const serializationObject = SerializationHelper.Serialize(this);\n serializationObject.customType = \"SSAO2RenderingPipeline\";\n return serializationObject;\n }\n /**\n * Parse the serialized pipeline\n * @param source Source pipeline.\n * @param scene The scene to load the pipeline to.\n * @param rootUrl The URL of the serialized pipeline.\n * @returns An instantiated pipeline from the serialized object.\n */\n static Parse(source, scene, rootUrl) {\n return SerializationHelper.Parse(() => new SSAO2RenderingPipeline(source._name, scene, source._ratio, undefined, source._forceGeometryBuffer, source._textureType), source, scene, rootUrl);\n }\n}\nSSAO2RenderingPipeline.ORTHO_DEPTH_PROJECTION = [1, 0, 0, 0, 1, 0, 0, 0, 1];\nSSAO2RenderingPipeline.PERSPECTIVE_DEPTH_PROJECTION = [0, 0, 0, 0, 0, 0, 1, 1, 1];\n__decorate([serialize()], SSAO2RenderingPipeline.prototype, \"totalStrength\", void 0);\n__decorate([serialize()], SSAO2RenderingPipeline.prototype, \"maxZ\", void 0);\n__decorate([serialize()], SSAO2RenderingPipeline.prototype, \"minZAspect\", void 0);\n__decorate([serialize(\"epsilon\")], SSAO2RenderingPipeline.prototype, \"_epsilon\", void 0);\n__decorate([serialize(\"samples\")], SSAO2RenderingPipeline.prototype, \"_samples\", void 0);\n__decorate([serialize(\"textureSamples\")], SSAO2RenderingPipeline.prototype, \"_textureSamples\", void 0);\n__decorate([serialize()], SSAO2RenderingPipeline.prototype, \"_forceGeometryBuffer\", void 0);\n__decorate([serialize()], SSAO2RenderingPipeline.prototype, \"_ratio\", void 0);\n__decorate([serialize()], SSAO2RenderingPipeline.prototype, \"_textureType\", void 0);\n__decorate([serialize()], SSAO2RenderingPipeline.prototype, \"radius\", void 0);\n__decorate([serialize()], SSAO2RenderingPipeline.prototype, \"base\", void 0);\n__decorate([serialize(\"bypassBlur\")], SSAO2RenderingPipeline.prototype, \"_bypassBlur\", void 0);\n__decorate([serialize(\"expensiveBlur\")], SSAO2RenderingPipeline.prototype, \"_expensiveBlur\", void 0);\n__decorate([serialize()], SSAO2RenderingPipeline.prototype, \"bilateralSamples\", void 0);\n__decorate([serialize()], SSAO2RenderingPipeline.prototype, \"bilateralSoften\", void 0);\n__decorate([serialize()], SSAO2RenderingPipeline.prototype, \"bilateralTolerance\", void 0);\nRegisterClass(\"BABYLON.SSAO2RenderingPipeline\", SSAO2RenderingPipeline);","map":{"version":3,"names":["__decorate","Logger","serialize","SerializationHelper","Vector3","TmpVectors","Vector2","Camera","Texture","PostProcess","PostProcessRenderPipeline","PostProcessRenderEffect","PassPostProcess","RegisterClass","EngineStore","SSAO2Configuration","RandomRange","RawTexture","SSAO2RenderingPipeline","epsilon","n","_epsilon","_ssaoPostProcess","updateEffect","_getDefinesForSSAO","samples","_samples","_sampleSphere","_generateHemisphere","textureSamples","_textureSamples","_prePassRenderer","_originalColorPostProcess","_geometryBufferRenderer","_forceGeometryBuffer","_scene","geometryBufferRenderer","prePassRenderer","bypassBlur","b","defines","_getDefinesForBlur","expensiveBlur","samplers","_getSamplersForBlur","_blurHPostProcess","h","_blurVPostProcess","v","_bypassBlur","_expensiveBlur","IsSupported","engine","LastCreatedEngine","_features","supportSSAO2","scene","constructor","name","ratio","cameras","forceGeometryBuffer","textureType","getEngine","SSAOOriginalSceneColorEffect","SSAORenderEffect","SSAOBlurHRenderEffect","SSAOBlurVRenderEffect","SSAOCombineRenderEffect","totalStrength","maxZ","minZAspect","radius","base","bilateralSamples","bilateralSoften","bilateralTolerance","_bits","Uint32Array","_ratio","_textureType","isSupported","Error","ssaoRatio","blurRatio","_scene$geometryBuffer","enableGeometryBufferRenderer","generateNormalsInWorldSpace","_scene$prePassRendere","enablePrePassRenderer","_createRandomTexture","BILINEAR_SAMPLINGMODE","undefined","_createSSAOPostProcess","_createBlurPostProcess","_createSSAOCombinePostProcess","addEffect","_ssaoCombinePostProcess","postProcessRenderPipelineManager","addPipeline","attachCamerasToRenderPipeline","getClassName","dispose","disableGeometryBufferRenderer","i","length","camera","_randomTexture","detachCamerasFromRenderPipeline","_name","_rebuild","disabled","bilateral","define","_createBlurFilter","horizontal","blurFilter","isWebGPU","useWebGPU","list","push","onApply","effect","activeCamera","ssaoCombineSize","width","height","originalColorSize","setFloat","setInt","setTexture","getGBuffer","textures","getRenderTarget","getIndex","autoClear","_radicalInverse_VdC","_hammersley","_hemisphereSample_uniform","u","phi","Math","PI","cosTheta","sinTheta","sqrt","cos","sin","numSamples","result","vector","random","rand","x","y","z","toFixed","setArray3","setFloat2","minZ","mode","PERSPECTIVE_CAMERA","setMatrix3x3","PERSPECTIVE_DEPTH_PROJECTION","tan","fov","getAspectRatio","_this$_scene$activeCa","_this$_scene$activeCa2","_this$_scene$activeCa3","_this$_scene$activeCa4","halfWidth","getRenderWidth","halfHeight","getRenderHeight","orthoLeft","orthoRight","orthoBottom","orthoTop","ORTHO_DEPTH_PROJECTION","setMatrix","getProjectionMatrix","_prePassEffectConfiguration","viewport","setVector4","Vector4","copyFromFloats","setTextureFromPostProcessOutput","size","data","Uint8Array","randVector","Zero","index","set","normalize","scaleInPlace","floor","texture","CreateRGBATexture","wrapU","WRAP_ADDRESSMODE","wrapV","serializationObject","Serialize","customType","Parse","source","rootUrl","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js"],"sourcesContent":["import { __decorate } from \"../../../tslib.es6.js\";\n/* eslint-disable @typescript-eslint/naming-convention */\nimport { Logger } from \"../../../Misc/logger.js\";\nimport { serialize } from \"../../../Misc/decorators.js\";\nimport { SerializationHelper } from \"../../../Misc/decorators.serialization.js\";\nimport { Vector3, TmpVectors, Vector2 } from \"../../../Maths/math.vector.js\";\nimport { Camera } from \"../../../Cameras/camera.js\";\nimport { Texture } from \"../../../Materials/Textures/texture.js\";\nimport { PostProcess } from \"../../../PostProcesses/postProcess.js\";\nimport { PostProcessRenderPipeline } from \"../../../PostProcesses/RenderPipeline/postProcessRenderPipeline.js\";\nimport { PostProcessRenderEffect } from \"../../../PostProcesses/RenderPipeline/postProcessRenderEffect.js\";\nimport { PassPostProcess } from \"../../../PostProcesses/passPostProcess.js\";\nimport { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { EngineStore } from \"../../../Engines/engineStore.js\";\nimport { SSAO2Configuration } from \"../../../Rendering/ssao2Configuration.js\";\n\nimport { RandomRange } from \"../../../Maths/math.scalar.functions.js\";\nimport { RawTexture } from \"../../../Materials/Textures/rawTexture.js\";\nimport \"../../../PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js\";\n/**\n * Render pipeline to produce ssao effect\n */\nexport class SSAO2RenderingPipeline extends PostProcessRenderPipeline {\n /**\n * Used in SSAO calculations to compensate for accuracy issues with depth values. Default 0.02.\n *\n * Normally you do not need to change this value, but you can experiment with it if you get a lot of in false self-occlusion on flat surfaces when using fewer than 16 samples. Useful range is normally [0..0.1] but higher values is allowed.\n */\n set epsilon(n) {\n this._epsilon = n;\n this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO());\n }\n get epsilon() {\n return this._epsilon;\n }\n /**\n * Number of samples used for the SSAO calculations. Default value is 8.\n */\n set samples(n) {\n this._samples = n;\n this._ssaoPostProcess.updateEffect(this._getDefinesForSSAO());\n this._sampleSphere = this._generateHemisphere();\n }\n get samples() {\n return this._samples;\n }\n /**\n * Number of samples to use for antialiasing.\n */\n set textureSamples(n) {\n this._textureSamples = n;\n if (this._prePassRenderer) {\n this._prePassRenderer.samples = n;\n }\n else {\n this._originalColorPostProcess.samples = n;\n }\n }\n get textureSamples() {\n return this._textureSamples;\n }\n get _geometryBufferRenderer() {\n if (!this._forceGeometryBuffer) {\n return null;\n }\n return this._scene.geometryBufferRenderer;\n }\n get _prePassRenderer() {\n if (this._forceGeometryBuffer) {\n return null;\n }\n return this._scene.prePassRenderer;\n }\n /**\n * Skips the denoising (blur) stage of the SSAO calculations.\n *\n * Useful to temporarily set while experimenting with the other SSAO2 settings.\n */\n set bypassBlur(b) {\n const defines = this._getDefinesForBlur(this.expensiveBlur, b);\n const samplers = this._getSamplersForBlur(b);\n this._blurHPostProcess.updateEffect(defines.h, null, samplers);\n this._blurVPostProcess.updateEffect(defines.v, null, samplers);\n this._bypassBlur = b;\n }\n get bypassBlur() {\n return this._bypassBlur;\n }\n /**\n * Enables the configurable bilateral denoising (blurring) filter. Default is true.\n * Set to false to instead use a legacy bilateral filter that can't be configured.\n *\n * The denoising filter runs after the SSAO calculations and is a very important step. Both options results in a so called bilateral being used, but the \"expensive\" one can be\n * configured in several ways to fit your scene.\n */\n set expensiveBlur(b) {\n const defines = this._getDefinesForBlur(b, this._bypassBlur);\n this._blurHPostProcess.updateEffect(defines.h);\n this._blurVPostProcess.updateEffect(defines.v);\n this._expensiveBlur = b;\n }\n get expensiveBlur() {\n return this._expensiveBlur;\n }\n /**\n * Support test.\n */\n static get IsSupported() {\n const engine = EngineStore.LastCreatedEngine;\n if (!engine) {\n return false;\n }\n return engine._features.supportSSAO2;\n }\n /**\n * Gets active scene\n */\n get scene() {\n return this._scene;\n }\n /**\n * @constructor\n * @param name The rendering pipeline name\n * @param scene The scene linked to this pipeline\n * @param ratio The size of the postprocesses. Can be a number shared between passes or an object for more precision: { ssaoRatio: 0.5, blurRatio: 1.0 }\n * @param cameras The array of cameras that the rendering pipeline will be attached to\n * @param forceGeometryBuffer Set to true if you want to use the legacy geometry buffer renderer\n * @param textureType The texture type used by the different post processes created by SSAO (default: 0)\n */\n constructor(name, scene, ratio, cameras, forceGeometryBuffer = false, textureType = 0) {\n super(scene.getEngine(), name);\n // Members\n /**\n * @ignore\n * The PassPostProcess id in the pipeline that contains the original scene color\n */\n this.SSAOOriginalSceneColorEffect = \"SSAOOriginalSceneColorEffect\";\n /**\n * @ignore\n * The SSAO PostProcess id in the pipeline\n */\n this.SSAORenderEffect = \"SSAORenderEffect\";\n /**\n * @ignore\n * The horizontal blur PostProcess id in the pipeline\n */\n this.SSAOBlurHRenderEffect = \"SSAOBlurHRenderEffect\";\n /**\n * @ignore\n * The vertical blur PostProcess id in the pipeline\n */\n this.SSAOBlurVRenderEffect = \"SSAOBlurVRenderEffect\";\n /**\n * @ignore\n * The PostProcess id in the pipeline that combines the SSAO-Blur output with the original scene color (SSAOOriginalSceneColorEffect)\n */\n this.SSAOCombineRenderEffect = \"SSAOCombineRenderEffect\";\n /**\n * The output strength of the SSAO post-process. Default value is 1.0.\n */\n this.totalStrength = 1.0;\n /**\n * Maximum depth value to still render AO. A smooth falloff makes the dimming more natural, so there will be no abrupt shading change.\n */\n this.maxZ = 100.0;\n /**\n * In order to save performances, SSAO radius is clamped on close geometry. This ratio changes by how much.\n */\n this.minZAspect = 0.2;\n this._epsilon = 0.02;\n this._samples = 8;\n this._textureSamples = 1;\n /**\n * Force rendering the geometry through geometry buffer.\n */\n this._forceGeometryBuffer = false;\n /**\n * The radius around the analyzed pixel used by the SSAO post-process. Default value is 2.0\n */\n this.radius = 2.0;\n /**\n * The base color of the SSAO post-process\n * The final result is \"base + ssao\" between [0, 1]\n */\n this.base = 0;\n this._bypassBlur = false;\n this._expensiveBlur = true;\n /**\n * The number of samples the bilateral filter uses in both dimensions when denoising the SSAO calculations. Default value is 16.\n *\n * A higher value should result in smoother shadows but will use more processing time in the shaders.\n *\n * A high value can cause the shadows to get to blurry or create visible artifacts (bands) near sharp details in the geometry. The artifacts can sometimes be mitigated by increasing the bilateralSoften setting.\n */\n this.bilateralSamples = 16;\n /**\n * Controls the shape of the denoising kernel used by the bilateral filter. Default value is 0.\n *\n * By default the bilateral filter acts like a box-filter, treating all samples on the same depth with equal weights. This is effective to maximize the denoising effect given a limited set of samples. However, it also often results in visible ghosting around sharp shadow regions and can spread out lines over large areas so they are no longer visible.\n *\n * Increasing this setting will make the filter pay less attention to samples further away from the center sample, reducing many artifacts but at the same time increasing noise.\n *\n * Useful value range is [0..1].\n */\n this.bilateralSoften = 0;\n /**\n * How forgiving the bilateral denoiser should be when rejecting samples. Default value is 0.\n *\n * A higher value results in the bilateral filter being more forgiving and thus doing a better job at denoising slanted and curved surfaces, but can lead to shadows spreading out around corners or between objects that are close to each other depth wise.\n *\n * Useful value range is normally [0..1], but higher values are allowed.\n */\n this.bilateralTolerance = 0;\n this._bits = new Uint32Array(1);\n this._scene = scene;\n this._ratio = ratio;\n this._textureType = textureType;\n this._forceGeometryBuffer = forceGeometryBuffer;\n if (!this.isSupported) {\n Logger.Error(\"The current engine does not support SSAO 2.\");\n return;\n }\n const ssaoRatio = this._ratio.ssaoRatio || ratio;\n const blurRatio = this._ratio.blurRatio || ratio;\n // Set up assets\n if (this._forceGeometryBuffer) {\n scene.enableGeometryBufferRenderer();\n if (scene.geometryBufferRenderer?.generateNormalsInWorldSpace) {\n Logger.Error(\"SSAO2RenderingPipeline does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!\");\n }\n }\n else {\n scene.enablePrePassRenderer();\n if (scene.prePassRenderer?.generateNormalsInWorldSpace) {\n Logger.Error(\"SSAO2RenderingPipeline does not support generateNormalsInWorldSpace=true for the prepass renderer!\");\n }\n }\n this._createRandomTexture();\n this._originalColorPostProcess = new PassPostProcess(\"SSAOOriginalSceneColor\", 1.0, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), undefined, this._textureType);\n this._originalColorPostProcess.samples = this.textureSamples;\n this._createSSAOPostProcess(1.0, textureType);\n this._createBlurPostProcess(ssaoRatio, blurRatio, this._textureType);\n this._createSSAOCombinePostProcess(blurRatio, this._textureType);\n // Set up pipeline\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOOriginalSceneColorEffect, () => {\n return this._originalColorPostProcess;\n }, true));\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAORenderEffect, () => {\n return this._ssaoPostProcess;\n }, true));\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurHRenderEffect, () => {\n return this._blurHPostProcess;\n }, true));\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOBlurVRenderEffect, () => {\n return this._blurVPostProcess;\n }, true));\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.SSAOCombineRenderEffect, () => {\n return this._ssaoCombinePostProcess;\n }, true));\n // Finish\n scene.postProcessRenderPipelineManager.addPipeline(this);\n if (cameras) {\n scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras);\n }\n }\n // Public Methods\n /**\n * Get the class name\n * @returns \"SSAO2RenderingPipeline\"\n */\n getClassName() {\n return \"SSAO2RenderingPipeline\";\n }\n /**\n * Removes the internal pipeline assets and detaches the pipeline from the scene cameras\n * @param disableGeometryBufferRenderer Set to true if you want to disable the Geometry Buffer renderer\n */\n dispose(disableGeometryBufferRenderer = false) {\n for (let i = 0; i < this._scene.cameras.length; i++) {\n const camera = this._scene.cameras[i];\n this._originalColorPostProcess.dispose(camera);\n this._ssaoPostProcess.dispose(camera);\n this._blurHPostProcess.dispose(camera);\n this._blurVPostProcess.dispose(camera);\n this._ssaoCombinePostProcess.dispose(camera);\n }\n this._randomTexture.dispose();\n if (disableGeometryBufferRenderer) {\n this._scene.disableGeometryBufferRenderer();\n }\n this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras);\n super.dispose();\n }\n // Private Methods\n /** @internal */\n _rebuild() {\n super._rebuild();\n }\n _getSamplersForBlur(disabled) {\n return disabled ? [\"textureSampler\"] : [\"textureSampler\", \"depthSampler\"];\n }\n _getDefinesForBlur(bilateral, disabled) {\n let define = \"#define BLUR\\n\";\n if (disabled) {\n define += \"#define BLUR_BYPASS\\n\";\n }\n if (!bilateral) {\n define += \"#define BLUR_LEGACY\\n\";\n }\n return { h: define + \"#define BLUR_H\\n\", v: define };\n }\n _createBlurPostProcess(ssaoRatio, blurRatio, textureType) {\n const defines = this._getDefinesForBlur(this.expensiveBlur, this.bypassBlur);\n const samplers = this._getSamplersForBlur(this.bypassBlur);\n this._blurHPostProcess = this._createBlurFilter(\"BlurH\", samplers, ssaoRatio, defines.h, textureType, true);\n this._blurVPostProcess = this._createBlurFilter(\"BlurV\", samplers, blurRatio, defines.v, textureType, false);\n }\n _createBlurFilter(name, samplers, ratio, defines, textureType, horizontal) {\n const blurFilter = new PostProcess(name, \"ssao2\", [\"outSize\", \"samples\", \"soften\", \"tolerance\"], samplers, ratio, null, Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, defines, textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {\n if (useWebGPU) {\n list.push(import(\"../../../ShadersWGSL/ssao2.fragment.js\"));\n }\n else {\n list.push(import(\"../../../Shaders/ssao2.fragment.js\"));\n }\n });\n blurFilter.onApply = (effect) => {\n if (!this._scene.activeCamera) {\n return;\n }\n const ssaoCombineSize = horizontal ? this._ssaoCombinePostProcess.width : this._ssaoCombinePostProcess.height;\n const originalColorSize = horizontal ? this._originalColorPostProcess.width : this._originalColorPostProcess.height;\n effect.setFloat(\"outSize\", ssaoCombineSize > 0 ? ssaoCombineSize : originalColorSize);\n effect.setInt(\"samples\", this.bilateralSamples);\n effect.setFloat(\"soften\", this.bilateralSoften);\n effect.setFloat(\"tolerance\", this.bilateralTolerance);\n if (this._geometryBufferRenderer) {\n effect.setTexture(\"depthSampler\", this._geometryBufferRenderer.getGBuffer().textures[0]);\n }\n else if (this._prePassRenderer) {\n effect.setTexture(\"depthSampler\", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]);\n }\n };\n blurFilter.samples = this.textureSamples;\n blurFilter.autoClear = false;\n return blurFilter;\n }\n //Van der Corput radical inverse\n _radicalInverse_VdC(i) {\n this._bits[0] = i;\n this._bits[0] = ((this._bits[0] << 16) | (this._bits[0] >> 16)) >>> 0;\n this._bits[0] = ((this._bits[0] & 0x55555555) << 1) | (((this._bits[0] & 0xaaaaaaaa) >>> 1) >>> 0);\n this._bits[0] = ((this._bits[0] & 0x33333333) << 2) | (((this._bits[0] & 0xcccccccc) >>> 2) >>> 0);\n this._bits[0] = ((this._bits[0] & 0x0f0f0f0f) << 4) | (((this._bits[0] & 0xf0f0f0f0) >>> 4) >>> 0);\n this._bits[0] = ((this._bits[0] & 0x00ff00ff) << 8) | (((this._bits[0] & 0xff00ff00) >>> 8) >>> 0);\n return this._bits[0] * 2.3283064365386963e-10; // / 0x100000000 or / 4294967296\n }\n _hammersley(i, n) {\n return [i / n, this._radicalInverse_VdC(i)];\n }\n _hemisphereSample_uniform(u, v) {\n const phi = v * 2.0 * Math.PI;\n // rejecting samples that are close to tangent plane to avoid z-fighting artifacts\n const cosTheta = 1.0 - u * 0.85;\n const sinTheta = Math.sqrt(1.0 - cosTheta * cosTheta);\n return new Vector3(Math.cos(phi) * sinTheta, Math.sin(phi) * sinTheta, cosTheta);\n }\n _generateHemisphere() {\n const numSamples = this.samples;\n const result = [];\n let vector;\n let i = 0;\n while (i < numSamples) {\n if (numSamples < 16) {\n vector = this._hemisphereSample_uniform(Math.random(), Math.random());\n }\n else {\n const rand = this._hammersley(i, numSamples);\n vector = this._hemisphereSample_uniform(rand[0], rand[1]);\n }\n result.push(vector.x, vector.y, vector.z);\n i++;\n }\n return result;\n }\n _getDefinesForSSAO() {\n const defines = `#define SSAO\\n#define SAMPLES ${this.samples}\\n#define EPSILON ${this.epsilon.toFixed(4)}`;\n return defines;\n }\n _createSSAOPostProcess(ratio, textureType) {\n this._sampleSphere = this._generateHemisphere();\n const defines = this._getDefinesForSSAO();\n const samplers = [\"randomSampler\", \"depthSampler\", \"normalSampler\"];\n this._ssaoPostProcess = new PostProcess(\"ssao2\", \"ssao2\", [\n \"sampleSphere\",\n \"samplesFactor\",\n \"randTextureTiles\",\n \"totalStrength\",\n \"radius\",\n \"base\",\n \"range\",\n \"projection\",\n \"near\",\n \"texelSize\",\n \"xViewport\",\n \"yViewport\",\n \"maxZ\",\n \"minZAspect\",\n \"depthProjection\",\n ], samplers, ratio, null, Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, defines, textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {\n if (useWebGPU) {\n list.push(import(\"../../../ShadersWGSL/ssao2.fragment.js\"));\n }\n else {\n list.push(import(\"../../../Shaders/ssao2.fragment.js\"));\n }\n });\n this._ssaoPostProcess.autoClear = false;\n this._ssaoPostProcess.onApply = (effect) => {\n if (!this._scene.activeCamera) {\n return;\n }\n effect.setArray3(\"sampleSphere\", this._sampleSphere);\n effect.setFloat(\"randTextureTiles\", 32.0);\n effect.setFloat(\"samplesFactor\", 1 / this.samples);\n effect.setFloat(\"totalStrength\", this.totalStrength);\n effect.setFloat2(\"texelSize\", 1 / this._ssaoPostProcess.width, 1 / this._ssaoPostProcess.height);\n effect.setFloat(\"radius\", this.radius);\n effect.setFloat(\"maxZ\", this.maxZ);\n effect.setFloat(\"minZAspect\", this.minZAspect);\n effect.setFloat(\"base\", this.base);\n effect.setFloat(\"near\", this._scene.activeCamera.minZ);\n if (this._scene.activeCamera.mode === Camera.PERSPECTIVE_CAMERA) {\n effect.setMatrix3x3(\"depthProjection\", SSAO2RenderingPipeline.PERSPECTIVE_DEPTH_PROJECTION);\n effect.setFloat(\"xViewport\", Math.tan(this._scene.activeCamera.fov / 2) * this._scene.getEngine().getAspectRatio(this._scene.activeCamera, true));\n effect.setFloat(\"yViewport\", Math.tan(this._scene.activeCamera.fov / 2));\n }\n else {\n const halfWidth = this._scene.getEngine().getRenderWidth() / 2.0;\n const halfHeight = this._scene.getEngine().getRenderHeight() / 2.0;\n const orthoLeft = this._scene.activeCamera.orthoLeft ?? -halfWidth;\n const orthoRight = this._scene.activeCamera.orthoRight ?? halfWidth;\n const orthoBottom = this._scene.activeCamera.orthoBottom ?? -halfHeight;\n const orthoTop = this._scene.activeCamera.orthoTop ?? halfHeight;\n effect.setMatrix3x3(\"depthProjection\", SSAO2RenderingPipeline.ORTHO_DEPTH_PROJECTION);\n effect.setFloat(\"xViewport\", (orthoRight - orthoLeft) * 0.5);\n effect.setFloat(\"yViewport\", (orthoTop - orthoBottom) * 0.5);\n }\n effect.setMatrix(\"projection\", this._scene.getProjectionMatrix());\n if (this._geometryBufferRenderer) {\n effect.setTexture(\"depthSampler\", this._geometryBufferRenderer.getGBuffer().textures[0]);\n effect.setTexture(\"normalSampler\", this._geometryBufferRenderer.getGBuffer().textures[1]);\n }\n else if (this._prePassRenderer) {\n effect.setTexture(\"depthSampler\", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(5)]);\n effect.setTexture(\"normalSampler\", this._prePassRenderer.getRenderTarget().textures[this._prePassRenderer.getIndex(6)]);\n }\n effect.setTexture(\"randomSampler\", this._randomTexture);\n };\n this._ssaoPostProcess.samples = this.textureSamples;\n if (!this._forceGeometryBuffer) {\n this._ssaoPostProcess._prePassEffectConfiguration = new SSAO2Configuration();\n }\n }\n _createSSAOCombinePostProcess(ratio, textureType) {\n this._ssaoCombinePostProcess = new PostProcess(\"ssaoCombine\", \"ssaoCombine\", [], [\"originalColor\", \"viewport\"], ratio, null, Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, undefined, textureType, undefined, undefined, undefined, undefined, this._scene.getEngine().isWebGPU ? 1 /* ShaderLanguage.WGSL */ : 0 /* ShaderLanguage.GLSL */, (useWebGPU, list) => {\n if (useWebGPU) {\n list.push(import(\"../../../ShadersWGSL/ssaoCombine.fragment.js\"));\n }\n else {\n list.push(import(\"../../../Shaders/ssaoCombine.fragment.js\"));\n }\n });\n this._ssaoCombinePostProcess.onApply = (effect) => {\n const viewport = this._scene.activeCamera.viewport;\n effect.setVector4(\"viewport\", TmpVectors.Vector4[0].copyFromFloats(viewport.x, viewport.y, viewport.width, viewport.height));\n effect.setTextureFromPostProcessOutput(\"originalColor\", this._originalColorPostProcess);\n };\n this._ssaoCombinePostProcess.autoClear = false;\n this._ssaoCombinePostProcess.samples = this.textureSamples;\n }\n _createRandomTexture() {\n const size = 128;\n const data = new Uint8Array(size * size * 4);\n const randVector = Vector2.Zero();\n for (let index = 0; index < data.length;) {\n randVector.set(RandomRange(0, 1), RandomRange(0, 1)).normalize().scaleInPlace(255);\n data[index++] = Math.floor(randVector.x);\n data[index++] = Math.floor(randVector.y);\n data[index++] = 0;\n data[index++] = 255;\n }\n const texture = RawTexture.CreateRGBATexture(data, size, size, this._scene, false, false, 2);\n texture.name = \"SSAORandomTexture\";\n texture.wrapU = Texture.WRAP_ADDRESSMODE;\n texture.wrapV = Texture.WRAP_ADDRESSMODE;\n this._randomTexture = texture;\n }\n /**\n * Serialize the rendering pipeline (Used when exporting)\n * @returns the serialized object\n */\n serialize() {\n const serializationObject = SerializationHelper.Serialize(this);\n serializationObject.customType = \"SSAO2RenderingPipeline\";\n return serializationObject;\n }\n /**\n * Parse the serialized pipeline\n * @param source Source pipeline.\n * @param scene The scene to load the pipeline to.\n * @param rootUrl The URL of the serialized pipeline.\n * @returns An instantiated pipeline from the serialized object.\n */\n static Parse(source, scene, rootUrl) {\n return SerializationHelper.Parse(() => new SSAO2RenderingPipeline(source._name, scene, source._ratio, undefined, source._forceGeometryBuffer, source._textureType), source, scene, rootUrl);\n }\n}\nSSAO2RenderingPipeline.ORTHO_DEPTH_PROJECTION = [1, 0, 0, 0, 1, 0, 0, 0, 1];\nSSAO2RenderingPipeline.PERSPECTIVE_DEPTH_PROJECTION = [0, 0, 0, 0, 0, 0, 1, 1, 1];\n__decorate([\n serialize()\n], SSAO2RenderingPipeline.prototype, \"totalStrength\", void 0);\n__decorate([\n serialize()\n], SSAO2RenderingPipeline.prototype, \"maxZ\", void 0);\n__decorate([\n serialize()\n], SSAO2RenderingPipeline.prototype, \"minZAspect\", void 0);\n__decorate([\n serialize(\"epsilon\")\n], SSAO2RenderingPipeline.prototype, \"_epsilon\", void 0);\n__decorate([\n serialize(\"samples\")\n], SSAO2RenderingPipeline.prototype, \"_samples\", void 0);\n__decorate([\n serialize(\"textureSamples\")\n], SSAO2RenderingPipeline.prototype, \"_textureSamples\", void 0);\n__decorate([\n serialize()\n], SSAO2RenderingPipeline.prototype, \"_forceGeometryBuffer\", void 0);\n__decorate([\n serialize()\n], SSAO2RenderingPipeline.prototype, \"_ratio\", void 0);\n__decorate([\n serialize()\n], SSAO2RenderingPipeline.prototype, \"_textureType\", void 0);\n__decorate([\n serialize()\n], SSAO2RenderingPipeline.prototype, \"radius\", void 0);\n__decorate([\n serialize()\n], SSAO2RenderingPipeline.prototype, \"base\", void 0);\n__decorate([\n serialize(\"bypassBlur\")\n], SSAO2RenderingPipeline.prototype, \"_bypassBlur\", void 0);\n__decorate([\n serialize(\"expensiveBlur\")\n], SSAO2RenderingPipeline.prototype, \"_expensiveBlur\", void 0);\n__decorate([\n serialize()\n], SSAO2RenderingPipeline.prototype, \"bilateralSamples\", void 0);\n__decorate([\n serialize()\n], SSAO2RenderingPipeline.prototype, \"bilateralSoften\", void 0);\n__decorate([\n serialize()\n], SSAO2RenderingPipeline.prototype, \"bilateralTolerance\", void 0);\nRegisterClass(\"BABYLON.SSAO2RenderingPipeline\", SSAO2RenderingPipeline);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,uBAAuB;AAClD;AACA,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,SAAS,QAAQ,6BAA6B;AACvD,SAASC,mBAAmB,QAAQ,2CAA2C;AAC/E,SAASC,OAAO,EAAEC,UAAU,EAAEC,OAAO,QAAQ,+BAA+B;AAC5E,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,OAAO,QAAQ,wCAAwC;AAChE,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SAASC,yBAAyB,QAAQ,oEAAoE;AAC9G,SAASC,uBAAuB,QAAQ,kEAAkE;AAC1G,SAASC,eAAe,QAAQ,2CAA2C;AAC3E,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,WAAW,QAAQ,iCAAiC;AAC7D,SAASC,kBAAkB,QAAQ,0CAA0C;AAE7E,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