Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2021-02-13 20:54:54 +0300
committerClément Foucault <foucault.clem@gmail.com>2021-02-13 20:55:52 +0300
commitaaf1650b099393c4cdcf44faf8e3a699e021f817 (patch)
tree11d154d82b6b8af14855ca5fb303b5e6b4624c12 /source/blender/draw/engines/eevee/eevee_lightprobes.c
parente7f61685edc03be69fec7268956a9e3d8df07fe7 (diff)
EEVEE: Change cubemap roughness fit
This changes the roughness mapping to better utilize the mip chain resolution. This improves glossy reflections with small roughness. Lightcache version bumped because old data does not have the same roughness mapping and cannot be used.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_lightprobes.c')
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightprobes.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index 395d4dc790d..7688039d0a8 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -1040,8 +1040,10 @@ void EEVEE_lightbake_filter_glossy(EEVEE_ViewLayerData *sldata,
pinfo->padding_size *= pinfo->texel_size;
pinfo->layer = probe_idx * 6;
pinfo->roughness = i / (float)maxlevel;
- pinfo->roughness *= pinfo->roughness; /* Disney Roughness */
- pinfo->roughness *= pinfo->roughness; /* Distribute Roughness across lod more evenly. */
+ /* Disney Roughness */
+ pinfo->roughness = square_f(pinfo->roughness);
+ /* Distribute Roughness across lod more evenly */
+ pinfo->roughness = square_f(square_f(pinfo->roughness));
CLAMP(pinfo->roughness, 1e-8f, 0.99999f); /* Avoid artifacts */
#if 1 /* Variable Sample count and bias (fast) */