Fix T81741 EEVEE: Ambient Occlusion does not converge properly

This was due to the AO random sampling using the same "seed" as
the AA jitter. Decorelating the noise fixes the issue.
This commit is contained in:
Clément Foucault 2021-03-08 17:21:17 +01:00
parent 30cb4326fe
commit bf799cb12c
Notes: blender-bot 2023-02-14 06:17:17 +01:00
Referenced by issue #81741, Eevee Ambient Occlusion is very noisy even with high sample count
1 changed files with 5 additions and 1 deletions

View File

@ -60,7 +60,11 @@ vec2 get_ao_area(float view_depth, float radius)
vec2 get_ao_noise(void)
{
return texelfetch_noise_tex(gl_FragCoord.xy).xy;
vec2 noise = texelfetch_noise_tex(gl_FragCoord.xy).xy;
/* Decorrelate noise from AA. */
/* TODO(fclem) we should use a more general approach for more random number dimentions. */
noise = fract(noise * 6.1803402007);
return noise;
}
vec2 get_ao_dir(float jitter)