[Bf-blender-cvs] [96d8f1b9270] greasepencil-refactor: GPencil: Replace value by define

Antonio Vazquez noreply at git.blender.org
Wed Jan 8 10:52:00 CET 2020


Commit: 96d8f1b9270b95564bdb9ae597af18b77bbb06a4
Author: Antonio Vazquez
Date:   Wed Jan 8 10:51:51 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB96d8f1b9270b95564bdb9ae597af18b77bbb06a4

GPencil: Replace value by define

Instead to use hardcoded value, use the define.

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

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 1e2b373dc01..2c9e4e8006b 100644
--- a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
+++ b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
@@ -1052,7 +1052,7 @@ static void gpencil_vfx_blur(BlurShaderFxData *fx, Object *ob, gpIterVfxData *it
     /* Modify by distance to camera and object scale. */
     DRW_view_winmat_get(NULL, winmat, false);
     const float *vp_size = DRW_viewport_size_get();
-    float world_pixel_scale = 1.0f / 2000.0f;
+    float world_pixel_scale = 1.0f / GPENCIL_PIXEL_FACTOR;
     float scale = mat4_to_scale(ob->obmat);
     float distance_factor = world_pixel_scale * scale * winmat[1][1] * vp_size[1] / w;
     mul_v2_fl(blur_size, distance_factor);
@@ -1120,7 +1120,7 @@ static void gpencil_vfx_rim(RimShaderFxData *fx, Object *ob, gpIterVfxData *iter
   const float w = fabsf(mul_project_m4_v3_zfac(persmat, ob->obmat[3]));
 
   /* Modify by distance to camera and object scale. */
-  float world_pixel_scale = 1.0f / 2000.0f;
+  float world_pixel_scale = 1.0f / GPENCIL_PIXEL_FACTOR;
   float scale = mat4_to_scale(ob->obmat);
   float distance_factor = (world_pixel_scale * scale * winmat[1][1] * vp_size[1]) / w;
   mul_v2_fl(offset, distance_factor);
@@ -1396,7 +1396,7 @@ static void gpencil_vfx_wave(WaveShaderFxData *fx, Object *ob, gpIterVfxData *it
   mul_v3_fl(wave_center, 1.0f / w);
 
   /* Modify by distance to camera and object scale. */
-  float world_pixel_scale = 1.0f / 2000.0f;
+  float world_pixel_scale = 1.0f / GPENCIL_PIXEL_FACTOR;
   float scale = mat4_to_scale(ob->obmat);
   float distance_factor = (world_pixel_scale * scale * winmat[1][1] * vp_size[1]) / w;
 
@@ -1455,7 +1455,7 @@ static void gpencil_vfx_swirl(SwirlShaderFxData *fx, Object *UNUSED(ob), gpIterV
   mul_v3_fl(swirl_center, 1.0f / w);
 
   /* Modify by distance to camera and object scale. */
-  float world_pixel_scale = 1.0f / 2000.0f;
+  float world_pixel_scale = 1.0f / GPENCIL_PIXEL_FACTOR;
   float scale = mat4_to_scale(fx->object->obmat);
   float distance_factor = (world_pixel_scale * scale * winmat[1][1] * vp_size[1]) / w;



More information about the Bf-blender-cvs mailing list