[Bf-blender-cvs] [59221476b0d] master: Fix T94262: Grease Pencil Blur Effect DoF mode wrong
Philipp Oeser
noreply at git.blender.org
Mon Dec 20 22:02:55 CET 2021
Commit: 59221476b0d496ebf92a532d25b594f8540951c1
Author: Philipp Oeser
Date: Mon Dec 20 12:17:12 2021 +0100
Branches: master
https://developer.blender.org/rB59221476b0d496ebf92a532d25b594f8540951c1
Fix T94262: Grease Pencil Blur Effect DoF mode wrong
This was visible outside of camera view and was not respecting the
"Depth of Field" checkbox on the Camera properties.
Now return early if DoF should not be visible.
Maniphest Tasks: T94262
Differential Revision: https://developer.blender.org/D13631
===================================================================
M source/blender/draw/engines/gpencil/gpencil_shader_fx.c
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
index 315133186da..dfff45cbca5 100644
--- a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
+++ b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
@@ -99,6 +99,11 @@ static void gpencil_vfx_blur(BlurShaderFxData *fx, Object *ob, gpIterVfxData *it
return;
}
+ if ((fx->flag & FX_BLUR_DOF_MODE) && iter->pd->camera == NULL) {
+ /* No blur outside camera view (or when DOF is disabled on the camera). */
+ return;
+ }
+
DRWShadingGroup *grp;
const float s = sin(fx->rotation);
const float c = cos(fx->rotation);
@@ -108,7 +113,7 @@ static void gpencil_vfx_blur(BlurShaderFxData *fx, Object *ob, gpIterVfxData *it
DRW_view_persmat_get(NULL, persmat, false);
const float w = fabsf(mul_project_m4_v3_zfac(persmat, ob->obmat[3]));
- if ((fx->flag & FX_BLUR_DOF_MODE) && iter->pd->camera != NULL) {
+ if ((fx->flag & FX_BLUR_DOF_MODE)) {
/* Compute circle of confusion size. */
float coc = (iter->pd->dof_params[0] / -w) - iter->pd->dof_params[1];
copy_v2_fl(blur_size, fabsf(coc));
More information about the Bf-blender-cvs
mailing list