[Bf-blender-cvs] [49a442bcd9a] temp-greasepencil-vfx: Use XY blur values for RIm

Antonio Vazquez noreply at git.blender.org
Tue Jul 3 19:42:54 CEST 2018


Commit: 49a442bcd9a044b2bedb0368d2ae3c7eff1d1dd6
Author: Antonio Vazquez
Date:   Tue Jul 3 10:32:30 2018 +0200
Branches: temp-greasepencil-vfx
https://developer.blender.org/rB49a442bcd9a044b2bedb0368d2ae3c7eff1d1dd6

Use XY blur values for RIm

Use only one value is not enough to get some artistics effects.

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

M	source/blender/draw/engines/gpencil/gpencil_shader_fx.c
M	source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_frag.glsl
M	source/blender/makesdna/DNA_shader_fx_types.h
M	source/blender/shader_fx/intern/FX_shader_rim.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
index 056b4cca720..4f7f97abd1d 100644
--- a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
+++ b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c
@@ -384,7 +384,7 @@ static void DRW_gpencil_fx_rim(
 	DRW_shgroup_uniform_vec4(fx_shgrp, "rim_color", &fxd->rim_rgba[0], 1);
 	DRW_shgroup_uniform_vec4(fx_shgrp, "mask_color", &fxd->mask_rgba[0], 1);
 	DRW_shgroup_uniform_int(fx_shgrp, "mode", &fxd->mode, 1);
-	DRW_shgroup_uniform_int(fx_shgrp, "blur", &fxd->blur, 1);
+	DRW_shgroup_uniform_int(fx_shgrp, "blur", &fxd->blur[0], 2);
 
 	DRW_shgroup_uniform_vec3(fx_shgrp, "loc", &ob->loc[0], 1);
 	DRW_shgroup_uniform_float(fx_shgrp, "pixsize", stl->storage->pixsize, 1);
diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_frag.glsl
index 378c1386931..f429ad7d0d9 100644
--- a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_rim_frag.glsl
@@ -8,7 +8,7 @@ uniform int offset[2];
 uniform vec4 rim_color;
 uniform vec4 mask_color;
 uniform int mode;
-uniform int blur;
+uniform int blur[2];
 
 uniform vec3 loc;
 uniform float pixsize;   /* rv3d->pixsize */
diff --git a/source/blender/makesdna/DNA_shader_fx_types.h b/source/blender/makesdna/DNA_shader_fx_types.h
index 47bdc5d04de..ddabd1c504d 100644
--- a/source/blender/makesdna/DNA_shader_fx_types.h
+++ b/source/blender/makesdna/DNA_shader_fx_types.h
@@ -151,8 +151,7 @@ typedef struct RimShaderFxData {
 	float rim_rgba[4];
 	float mask_rgba[4];
 	int   mode;
-	int   blur;
-	char pad[4];
+	int   blur[2];
 	ShaderFxData_runtime runtime;
 } RimShaderFxData;
 
diff --git a/source/blender/shader_fx/intern/FX_shader_rim.c b/source/blender/shader_fx/intern/FX_shader_rim.c
index 5e5f21b8496..05dec1b8c09 100644
--- a/source/blender/shader_fx/intern/FX_shader_rim.c
+++ b/source/blender/shader_fx/intern/FX_shader_rim.c
@@ -43,7 +43,7 @@ static void initData(ShaderFxData *fx)
 	ARRAY_SET_ITEMS(gpfx->rim_rgba, 1.0f, 1.0f, 0.5f, 0.9f);
 	ARRAY_SET_ITEMS(gpfx->mask_rgba, 0.0f, 0.0f, 0.0f, 1.0f);
 	gpfx->mode = eShaderFxRimMode_Multiply;
-	gpfx->blur = 0;
+	ARRAY_SET_ITEMS(gpfx->blur, 0, 0);
 }
 
 static void copyData(const ShaderFxData *md, ShaderFxData *target)



More information about the Bf-blender-cvs mailing list