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_fill_frag.glsl')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl18
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
index 7e8f59cf917..0c290260b20 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
@@ -26,9 +26,11 @@ uniform int viewport_xray;
uniform int shading_type[2];
uniform vec4 wire_color;
-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;
/* keep this list synchronized with list in gpencil_draw_utils.c */
#define SOLID 0
@@ -216,7 +218,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);
}
}