From c2164e579c3dde8c0fbb42e0c146bfd5ad1b563b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Thu, 15 Nov 2018 18:13:07 +0100 Subject: 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. --- source/blender/draw/engines/eevee/eevee_lightprobes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/draw/engines/eevee/eevee_lightprobes.c') 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) { -- cgit v1.2.3