diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-03-02 01:56:30 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-03-02 15:08:57 +0300 |
commit | 1e7d8a4ad512236ebc3bfbc31d8e155a574dba07 (patch) | |
tree | b846b846770ed330ddb6ac42645d5362a45ae6d1 /source/blender | |
parent | e1f3996d740cf8c0299ce6ea76362648f421fa41 (diff) |
EEVEE: Depth of field: Do not shrink highlights when using overblur
This fixes the issue of bokeh size being smaller when using overblur.
The additional overblur needs to be centered on the outer radius.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_depth_of_field.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c index 33d45d61d42..5f8e0106337 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c @@ -273,9 +273,12 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), float minimal_overblur = 1.0f / sqrtf(sample_count); float user_overblur = scene_eval->eevee.bokeh_overblur / 100.0f; - effects->dof_coc_params[1] *= minimal_overblur + user_overblur; + minimal_overblur *= effects->dof_coc_params[1]; + user_overblur *= effects->dof_coc_params[1]; + + effects->dof_coc_params[1] = minimal_overblur + user_overblur; /* Avoid dilating the shape. Over-blur only soften. */ - effects->dof_jitter_radius -= effects->dof_coc_params[1]; + effects->dof_jitter_radius -= minimal_overblur + user_overblur * 0.5f; } } else { |