[Bf-blender-cvs] [241ceceac8b] greasepencil-refactor: GPencil: fix compilation error

Clément Foucault noreply at git.blender.org
Fri Dec 20 13:38:59 CET 2019


Commit: 241ceceac8b1fa6c7d956ea56c79bd2c3bc807bd
Author: Clément Foucault
Date:   Fri Dec 20 13:53:05 2019 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB241ceceac8b1fa6c7d956ea56c79bd2c3bc807bd

GPencil: fix compilation error

===================================================================

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 78a2a23a2b3..8cfabbf98f5 100644
--- a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
+++ b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
@@ -1108,6 +1108,8 @@ static void gpencil_vfx_blur(BlurShaderFxData *fx, Object *ob, gpIterVfxData *it
 
   float winmat[4][4], persmat[4][4];
   float blur_size[2] = {fx->radius[0], fx->radius[1]};
+  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) {
     /* Compute circle of confusion size. */
@@ -1117,9 +1119,7 @@ static void gpencil_vfx_blur(BlurShaderFxData *fx, Object *ob, gpIterVfxData *it
   else {
     /* Modify by distance to camera and object scale. */
     DRW_view_winmat_get(NULL, winmat, false);
-    DRW_view_persmat_get(NULL, persmat, false);
     const float *vp_size = DRW_viewport_size_get();
-    const float w = fabsf(mul_project_m4_v3_zfac(persmat, ob->obmat[3]));
     float world_pixel_scale = 1.0f / 2000.0f;
     float scale = mat4_to_scale(ob->obmat);
     float distance_factor = world_pixel_scale * scale * winmat[1][1] * vp_size[1] / w;



More information about the Bf-blender-cvs mailing list