/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{glsl as e}from"../../shaderModules/glsl.js";import{Texture2DBindUniform as s}from"../../shaderModules/Texture2DBindUniform.js";import{blurSizePixels as r}from"../../../effects/ssao/SSAO.js";function t(t,o){o.receiveAmbientOcclusion?(t.uniforms.add(new s("ssaoTex",e=>e.ssao?.getTexture())),t.constants.add("blurSizePixelsInverse","float",1/r),t.code.add(e`float evaluateAmbientOcclusionInverse() {
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
}
float evaluateAmbientOcclusion() {
return 1.0 - evaluateAmbientOcclusionInverse();
}`)):t.code.add(e`float evaluateAmbientOcclusionInverse() { return 1.0; }
float evaluateAmbientOcclusion() { return 0.0; }`)}export{t as EvaluateAmbientOcclusion};
