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-03-10 17:34:11 +0300
committerClément Foucault <foucault.clem@gmail.com>2021-03-10 19:57:09 +0300
commitd89fb77d894e8652608ebf78657bd199bfb3bbee (patch)
tree952ee64a887cd8544d88fc4074b37ab30c37793c /source/blender/draw/engines/eevee/eevee_lightprobes.c
parent9957096f35fcb9d63ae611464667638dcbfb6dd6 (diff)
EEVEE: GGX: Use distribution of visible normal for sampling
This changes the sampling routine to use the method described in "A Simpler and Exact Sampling Routine for the GGXDistribution of Visible Normals" by Eric Heitz. http://jcgt.org/published/0007/04/01/slides.pdf This avoids generating bad rays and thus improve noise level in screen- space reflections / refraction.
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, 3 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index 0ce94b8f1b1..3e1d4a8aaa6 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -245,7 +245,7 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata,
DRW_shgroup_uniform_float(grp, "intensityFac", &pinfo->intensity_fac, 1);
DRW_shgroup_uniform_float(grp, "sampleCount", &pinfo->samples_len, 1);
DRW_shgroup_uniform_float(grp, "invSampleCount", &pinfo->samples_len_inv, 1);
- DRW_shgroup_uniform_float(grp, "roughnessSquared", &pinfo->roughness, 1);
+ DRW_shgroup_uniform_float(grp, "roughness", &pinfo->roughness, 1);
DRW_shgroup_uniform_float(grp, "lodFactor", &pinfo->lodfactor, 1);
DRW_shgroup_uniform_float(grp, "lodMax", &pinfo->lod_rt_max, 1);
DRW_shgroup_uniform_float(grp, "texelSize", &pinfo->texel_size, 1);
@@ -1045,8 +1045,8 @@ void EEVEE_lightbake_filter_glossy(EEVEE_ViewLayerData *sldata,
/* 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 */
+ pinfo->roughness = square_f(pinfo->roughness);
+ CLAMP(pinfo->roughness, 1e-4f, 0.9999f); /* Avoid artifacts */
#if 1 /* Variable Sample count and bias (fast) */
switch (i) {