export declare const hbao = "\nvarying vec2 vUv;\n\nuniform highp sampler2D depthTexture;\n\nuniform mat4 projectionViewMatrix;\nuniform int frame;\n\nuniform sampler2D blueNoiseTexture;\nuniform vec2 blueNoiseRepeat;\nuniform vec2 texSize;\n\nuniform float aoDistance;\nuniform float distancePower;\nuniform float bias;\nuniform float thickness;\n\n#include \n// HBAO Utils\n#include \n\nfloat getOcclusion(const vec3 cameraPosition, const vec3 worldPos, const vec3 worldNormal, const float depth, const int seed, inout float totalWeight) {\n vec4 blueNoise = sampleBlueNoise(blueNoiseTexture, seed, blueNoiseRepeat, texSize);\n\n vec3 sampleWorldDir = cosineSampleHemisphere(worldNormal, blueNoise.rg);\n\n vec3 sampleWorldPos = worldPos + aoDistance * pow(blueNoise.b, distancePower + 1.0) * sampleWorldDir;\n\n // Project the sample position to screen space\n vec4 sampleUv = projectionViewMatrix * vec4(sampleWorldPos, 1.);\n sampleUv.xy /= sampleUv.w;\n sampleUv.xy = sampleUv.xy * 0.5 + 0.5;\n\n // Get the depth of the sample position\n float sampleDepth = textureLod(depthTexture, sampleUv.xy, 0.0).r;\n\n // Compute the horizon line\n float deltaDepth = depth - sampleDepth;\n\n // distance based bias\n float d = distance(sampleWorldPos, cameraPosition) / aoDistance;\n deltaDepth *= 0.001 * d * d;\n\n float th = thickness * 0.01;\n\n float theta = dot(worldNormal, sampleWorldDir);\n totalWeight += theta;\n\n if (deltaDepth < th) {\n float horizon = sampleDepth + deltaDepth * bias * 1000.;\n\n float occlusion = max(0.0, horizon - depth) * theta;\n\n float m = max(0., 1. - deltaDepth / th);\n occlusion = 10. * occlusion * m / d;\n\n occlusion = max(0.0, occlusion);\n occlusion = sqrt(occlusion);\n return occlusion;\n }\n\n return 0.;\n}\n\nvoid main() {\n float depth = textureLod(depthTexture, vUv, 0.0).r;\n\n // filter out background\n if (depth == 1.0) {\n discard;\n return;\n }\n\n vec4 cameraPosition = cameraMatrixWorld * vec4(0.0, 0.0, 0.0, 1.0);\n\n vec3 worldPos = getWorldPos(depth, vUv);\n vec3 worldNormal = getWorldNormal(vUv);\n\n float ao = 0.0, totalWeight = 0.0;\n\n for (int i = 0; i < spp; i++) {\n int seed = i;\n#ifdef animatedNoise\n seed += frame;\n#endif\n\n float occlusion = getOcclusion(cameraPosition.xyz, worldPos, worldNormal, depth, seed, totalWeight);\n ao += occlusion;\n }\n\n if (totalWeight > 0.) ao /= totalWeight;\n\n // clamp ao to [0, 1]\n ao = clamp(1. - ao, 0., 1.);\n\n gl_FragColor = vec4(worldNormal, ao);\n}\n"; //# sourceMappingURL=hbao.d.ts.map