Update ssao.frag

Sorry,It should be spelled bias
This commit is contained in:
binary 2019-12-03 19:06:56 +08:00 committed by GitHub
parent 364c4695a9
commit 6849c14ee4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,7 +41,7 @@ void main()
// Calculate occlusion value
float occlusion = 0.0f;
// remove banding
float bais = 0.01f;
const float bias = 0.01f;
for(int i = 0; i < SSAO_KERNEL_SIZE; i++)
{
vec3 samplePos = TBN * uboSSAOKernel.samples[i].xyz;
@ -59,9 +59,9 @@ void main()
#ifdef RANGE_CHECK
// Range check
float rangeCheck = smoothstep(0.0f, 1.0f, SSAO_RADIUS / abs(fragPos.z - sampleDepth));
occlusion += (sampleDepth >= samplePos.z + bais ? 1.0f : 0.0f) * rangeCheck;
occlusion += (sampleDepth >= samplePos.z + bias ? 1.0f : 0.0f) * rangeCheck;
#else
occlusion += (sampleDepth >= samplePos.z + bais ? 1.0f : 0.0f);
occlusion += (sampleDepth >= samplePos.z + bias ? 1.0f : 0.0f);
#endif
}
occlusion = 1.0 - (occlusion / float(SSAO_KERNEL_SIZE));