diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-03-19 22:28:33 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-03-19 23:11:06 +0300 |
commit | b96acd0663b589e5519a97c4f435d37e507fb8c1 (patch) | |
tree | 8fc0c7528b45ee4ab8ec8e00962162d3cf76fac9 /source/blender/draw/engines/eevee/eevee_volumes.c | |
parent | 89ef0da5513a2bc85a518b0941807ecdd6980a66 (diff) |
EEVEE: Volumetrics: Add back support for light clamp
The new clamping works by modifying the lamp internal radius which
then soften the light contribution.
However this does remove more light compare to the old solution.
This is because the clamp now affects the light over a much larger
distance since it is smoother. Old scene needs manual tweaking.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_volumes.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_volumes.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c index 136737f7d8b..aee260a542e 100644 --- a/source/blender/draw/engines/eevee/eevee_volumes.c +++ b/source/blender/draw/engines/eevee/eevee_volumes.c @@ -184,9 +184,7 @@ void EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) float integration_start = scene_eval->eevee.volumetric_start; float integration_end = scene_eval->eevee.volumetric_end; - /* TODO(fclem) Use clamp to modulate the light radius for - * volume lighting and avoid very bright highlights. */ - // common_data->vol_light_clamp = scene_eval->eevee.volumetric_light_clamp; + effects->volume_light_clamp = scene_eval->eevee.volumetric_light_clamp; common_data->vol_shadow_steps = (float)scene_eval->eevee.volumetric_shadow_samples; if ((scene_eval->eevee.flag & SCE_EEVEE_VOLUMETRIC_SHADOWS) == 0) { common_data->vol_shadow_steps = 0; @@ -218,10 +216,9 @@ void EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } /* Disable clamp if equal to 0. */ - /* TODO(fclem) Re-implement */ - // if (common_data->vol_light_clamp == 0.0) { - // common_data->vol_light_clamp = FLT_MAX; - // } + if (effects->volume_light_clamp == 0.0) { + effects->volume_light_clamp = FLT_MAX; + } common_data->vol_use_lights = (scene_eval->eevee.flag & SCE_EEVEE_VOLUMETRIC_LIGHTS) != 0; common_data->vol_use_soft_shadows = (scene_eval->eevee.flag & SCE_EEVEE_SHADOW_SOFT) != 0; |