diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-11-15 20:13:07 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-11-15 20:16:30 +0300 |
commit | c2164e579c3dde8c0fbb42e0c146bfd5ad1b563b (patch) | |
tree | 631fedacdf5e4830acf2a54c6ab7bc4225e48f04 /source/blender/draw/engines/eevee/eevee_lightprobes.c | |
parent | 11b3954346b1e4ee2d70d8f4efa2e1a57c9fbef8 (diff) |
Eevee: Add irradiance smoothing
This is a parameter that will make the interpolation between irradiance
cells of a same Irradiance Volume smoother, reducing the weight of the
light leaking correction factors.
It is usefull in some cases to avoid harsh lighting transition that can
happen when a sample point it near a surface.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_lightprobes.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightprobes.c | 4 |
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 256425221f4..e4659306f5c 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -833,6 +833,8 @@ void EEVEE_lightprobes_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *ved EEVEE_StorageList *stl = vedata->stl; LightCache *light_cache = stl->g_data->light_cache; EEVEE_LightProbesInfo *pinfo = sldata->probes; + const DRWContextState *draw_ctx = DRW_context_state_get(); + const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph); eevee_lightprobes_extract_from_cache(sldata->probes, light_cache); @@ -843,6 +845,7 @@ void EEVEE_lightprobes_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *ved sldata->common_data.prb_lod_cube_max = (float)light_cache->mips_len - 1.0f; sldata->common_data.prb_lod_planar_max = (float)MAX_PLANAR_LOD_LEVEL; sldata->common_data.prb_irradiance_vis_size = light_cache->vis_res; + sldata->common_data.prb_irradiance_smooth = SQUARE(scene_eval->eevee.gi_irradiance_smoothing); sldata->common_data.prb_num_render_cube = max_ii(1, light_cache->cube_len); sldata->common_data.prb_num_render_grid = max_ii(1, light_cache->grid_len); sldata->common_data.prb_num_planar = pinfo->num_planar; @@ -859,7 +862,6 @@ void EEVEE_lightprobes_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *ved if (!DRW_state_is_image_render() && !DRW_state_is_opengl_render() && (pinfo->do_grid_update || pinfo->do_cube_update)) { - const DRWContextState *draw_ctx = DRW_context_state_get(); BLI_assert(draw_ctx->evil_C); if (draw_ctx->scene->eevee.flag & SCE_EEVEE_GI_AUTOBAKE) { |