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:
Diffstat (limited to 'source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl18
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
index f59c08730fe..d79b8fb4d8a 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
@@ -14,9 +14,11 @@ in vec4 mColor;
in vec2 mTexCoord;
out vec4 fragColor;
-uniform bool fade_on;
+uniform int fade_layer;
+uniform float fade_layer_factor;
+uniform bool fade_ob;
uniform vec3 fade_color;
-uniform float fade_factor;
+uniform float fade_ob_factor;
#define texture2D texture
@@ -110,7 +112,15 @@ void main()
}
/* Apply paper opacity */
- if (fade_on == true) {
- fragColor.rgb = mix(fade_color.rgb, fragColor.rgb, fade_factor);
+ if (fade_layer == 1) {
+ /* Layer is below, mix with background. */
+ fragColor.rgb = mix(fade_color.rgb, fragColor.rgb, fade_layer_factor);
+ }
+ else if (fade_layer == 2) {
+ /* Layer is above, change opacity. */
+ fragColor.a *= fade_layer_factor;
+ }
+ else if (fade_ob == true) {
+ fragColor.rgb = mix(fade_color.rgb, fragColor.rgb, fade_ob_factor);
}
}