diff options
author | Adam Nydahl <Loginer> | 2019-05-27 18:07:17 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-27 18:13:09 +0300 |
commit | 7353e0563ee2aa0c6393112139ea38debdd18b54 (patch) | |
tree | 8d85f0ae6966b4cb3b6499c4dc04da09f7965602 /source/blender/draw/engines | |
parent | 7a308e65ef1f85629dc3a766452407924e00f75d (diff) |
Eevee: Fix Aliasing in Light Probes
Differential Revision: https://developer.blender.org/D4869
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightprobes.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index 388a8b5e73d..78565f9c465 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -1053,7 +1053,7 @@ void EEVEE_lightbake_filter_glossy(EEVEE_ViewLayerData *sldata, /* 3 - Render to probe array to the specified layer, do prefiltering. */ int mipsize = GPU_texture_width(light_cache->cube_tx.tex); for (int i = 0; i < maxlevel + 1; i++) { - float bias = (i == 0) ? -1.0f : 1.0f; + float bias = 0.0f; pinfo->texel_size = 1.0f / (float)mipsize; pinfo->padding_size = (i == maxlevel) ? 0 : (float)(1 << (maxlevel - i - 1)); pinfo->padding_size *= pinfo->texel_size; @@ -1063,22 +1063,27 @@ void EEVEE_lightbake_filter_glossy(EEVEE_ViewLayerData *sldata, pinfo->roughness *= pinfo->roughness; /* Distribute Roughness accros lod more evenly */ CLAMP(pinfo->roughness, 1e-8f, 0.99999f); /* Avoid artifacts */ -#if 1 /* Variable Sample count (fast) */ +#if 1 /* Variable Sample count and bias (fast) */ switch (i) { case 0: pinfo->samples_len = 1.0f; + bias = -1.0f; break; case 1: - pinfo->samples_len = 16.0f; + pinfo->samples_len = 32.0f; + bias = 1.0f; break; case 2: - pinfo->samples_len = 32.0f; + pinfo->samples_len = 40.0f; + bias = 2.0f; break; case 3: pinfo->samples_len = 64.0f; + bias = 2.0f; break; default: pinfo->samples_len = 128.0f; + bias = 2.0f; break; } #else /* Constant Sample count (slow) */ |