EEVEE: RenderPass: Improve AO pass if screen space radius is small

This just bypass the occlusion computation if there is no occlusion
data. This avoids weird looking occlusion due to the screen space
geometric normal reconstruction.
This commit is contained in:
Clément Foucault 2021-03-08 17:16:46 +01:00
parent 0983e66e03
commit 1540f1df07
1 changed files with 6 additions and 3 deletions

View File

@ -99,9 +99,12 @@ void main()
OcclusionData data = occlusion_load(vP, 1.0);
float visibility = diffuse_occlusion(data, V, N, Ng);
FragColor = vec4(visibility);
if (min_v4(abs(data.horizons)) != M_PI) {
FragColor = vec4(diffuse_occlusion(data, V, N, Ng));
}
else {
FragColor = vec4(1.0);
}
}
}