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-03-09 18:27:24 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-03-09 18:27:24 +0300
commit29f3af95272590d26f610ae828b2eeee89c82a00 (patch)
treea696a58a2561c48f7ec6166e369e22081e0a64d8 /source/blender/draw/intern/shaders/common_smaa_lib.glsl
parentdcb93126876879d969a30a7865700abd072066f8 (diff)
GPencil: Refactor of Draw Engine, Vertex Paint and all internal functions
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes. Also, a huge code cleanup has been done at all levels. Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development. Differential Revision: https://developer.blender.org/D6293
Diffstat (limited to 'source/blender/draw/intern/shaders/common_smaa_lib.glsl')
-rw-r--r--source/blender/draw/intern/shaders/common_smaa_lib.glsl11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/draw/intern/shaders/common_smaa_lib.glsl b/source/blender/draw/intern/shaders/common_smaa_lib.glsl
index 09b573d4bb5..45d9f54d943 100644
--- a/source/blender/draw/intern/shaders/common_smaa_lib.glsl
+++ b/source/blender/draw/intern/shaders/common_smaa_lib.glsl
@@ -692,6 +692,10 @@ void SMAANeighborhoodBlendingVS(float2 texcoord, out float4 offset)
//-----------------------------------------------------------------------------
// Edge Detection Pixel Shaders (First Pass)
+# ifndef SMAA_LUMA_WEIGHT
+# define SMAA_LUMA_WEIGHT float4(0.2126, 0.7152, 0.0722, 0.0)
+# endif
+
/**
* Luma Edge Detection
*
@@ -716,7 +720,8 @@ float2 SMAALumaEdgeDetectionPS(float2 texcoord,
# endif
// Calculate lumas:
- float4 weights = float4(0.2126 * 0.5, 0.7152 * 0.5, 0.0722 * 0.5, 0.5);
+ // float4 weights = float4(0.2126, 0.7152, 0.0722, 0.0);
+ float4 weights = SMAA_LUMA_WEIGHT;
float L = dot(SMAASamplePoint(colorTex, texcoord).rgba, weights);
float Lleft = dot(SMAASamplePoint(colorTex, offset[0].xy).rgba, weights);
@@ -727,9 +732,11 @@ float2 SMAALumaEdgeDetectionPS(float2 texcoord,
delta.xy = abs(L - float2(Lleft, Ltop));
float2 edges = step(threshold, delta.xy);
+# ifndef SMAA_NO_DISCARD
// Then discard if there is no edge:
if (dot(edges, float2(1.0, 1.0)) == 0.0)
discard;
+# endif
// Calculate right and bottom deltas:
float Lright = dot(SMAASamplePoint(colorTex, offset[1].xy).rgba, weights);
@@ -793,9 +800,11 @@ float2 SMAAColorEdgeDetectionPS(float2 texcoord,
// We do the usual threshold:
float2 edges = step(threshold, delta.xy);
+# ifndef SMAA_NO_DISCARD
// Then discard if there is no edge:
if (dot(edges, float2(1.0, 1.0)) == 0.0)
discard;
+# endif
// Calculate right and bottom deltas:
float3 Cright = SMAASamplePoint(colorTex, offset[1].xy).rgb;