Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-05-12 18:47:48 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-05-12 18:48:28 +0300
commitf24e9bb0380936bcaf6c194b54342a2977784cff (patch)
tree96d8919928e1a02e7eeead2242e0a3a439ceccc7 /source/blender/draw/engines
parentbe4b3c64ad76a4bf12ac1cbcd948f8d9bc7be20e (diff)
GPencil: Add new parameter for SMAA threshold
This parameter allows to define the threshold for SMAA algorithm. Differential Revision: https://developer.blender.org/D7708
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_antialiasing.c2
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_shader.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_antialiasing.c b/source/blender/draw/engines/gpencil/gpencil_antialiasing.c
index e81073db4a5..4dd5e3b2da1 100644
--- a/source/blender/draw/engines/gpencil/gpencil_antialiasing.c
+++ b/source/blender/draw/engines/gpencil/gpencil_antialiasing.c
@@ -115,6 +115,8 @@ void GPENCIL_antialiasing_init(struct GPENCIL_Data *vedata)
DRW_shgroup_uniform_texture(grp, "colorTex", pd->color_tx);
DRW_shgroup_uniform_texture(grp, "revealTex", pd->reveal_tx);
DRW_shgroup_uniform_vec4_copy(grp, "viewportMetrics", metrics);
+ DRW_shgroup_uniform_float_copy(
+ grp, "lumaWeight", pd->scene->grease_pencil_settings.smaa_threshold);
DRW_shgroup_clear_framebuffer(grp, GPU_COLOR_BIT, 0, 0, 0, 0, 0.0f, 0x0);
DRW_shgroup_call_procedural_triangles(grp, NULL, 1);
diff --git a/source/blender/draw/engines/gpencil/gpencil_shader.c b/source/blender/draw/engines/gpencil/gpencil_shader.c
index fe095b1b916..6284e0a648c 100644
--- a/source/blender/draw/engines/gpencil/gpencil_shader.c
+++ b/source/blender/draw/engines/gpencil/gpencil_shader.c
@@ -135,10 +135,11 @@ GPUShader *GPENCIL_shader_antialiasing(int stage)
},
.defs =
(const char *[]){
+ "uniform float lumaWeight;\n",
"#define SMAA_GLSL_3\n",
"#define SMAA_RT_METRICS viewportMetrics\n",
"#define SMAA_PRESET_HIGH\n",
- "#define SMAA_LUMA_WEIGHT float4(1.0, 1.0, 1.0, 0.0)\n",
+ "#define SMAA_LUMA_WEIGHT float4(lumaWeight, lumaWeight, lumaWeight, 0.0)\n",
"#define SMAA_NO_DISCARD\n",
stage_define,
NULL,