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>2018-11-15 21:41:15 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-11-15 22:04:47 +0300
commit1b321048a7ebbb99d62c8d8e74446153ef487a59 (patch)
treeafc153fe72ef11b0de9ef9def0d54de09c5b5799 /source/blender/draw/engines/eevee/eevee_lightprobes.c
parentf8964809b82e679d58669342ee0035db01a6c0c9 (diff)
Eevee: Add Glossy Reflection clamping
This enables reducing the noise comming from very bright light sources (like a sun) that can be found in distant HDRIs. The lost energy may be replaced manually by a sunlight that compensate the this loss. This clamping only concerns Reflection Cubmaps and is done on all on all of them. Setting to 0.0 disables it (default).
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_lightprobes.c')
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightprobes.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index e4659306f5c..56690551e9c 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -376,6 +376,7 @@ void EEVEE_lightbake_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata,
DRW_shgroup_uniform_float(grp, "lodMax", &pinfo->lod_rt_max, 1);
DRW_shgroup_uniform_float(grp, "texelSize", &pinfo->texel_size, 1);
DRW_shgroup_uniform_float(grp, "paddingSize", &pinfo->padding_size, 1);
+ DRW_shgroup_uniform_float(grp, "fireflyFactor", &pinfo->firefly_fac, 1);
DRW_shgroup_uniform_int(grp, "Layer", &pinfo->layer, 1);
DRW_shgroup_uniform_texture(grp, "texHammersley", e_data.hammersley);
// DRW_shgroup_uniform_texture(grp, "texJitter", e_data.jitter);
@@ -1102,7 +1103,7 @@ static void eevee_lightbake_render_scene_to_planars(
void EEVEE_lightbake_filter_glossy(
EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata,
struct GPUTexture *rt_color, struct GPUFrameBuffer *fb,
- int probe_idx, float intensity, int maxlevel)
+ int probe_idx, float intensity, int maxlevel, float firefly_fac)
{
EEVEE_PassList *psl = vedata->psl;
EEVEE_LightProbesInfo *pinfo = sldata->probes;
@@ -1151,6 +1152,7 @@ void EEVEE_lightbake_filter_glossy(
pinfo->samples_len_inv = 1.0f / pinfo->samples_len;
pinfo->lodfactor = bias + 0.5f * log((float)(target_size * target_size) * pinfo->samples_len_inv) / log(2);
+ pinfo->firefly_fac = (firefly_fac > 0.0) ? firefly_fac : 1e16;
GPU_framebuffer_ensure_config(&fb, {
GPU_ATTACHMENT_NONE,