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:
authorInes Almeida <britalmeida@gmail.com>2018-10-13 20:49:26 +0300
committerInes Almeida <britalmeida@gmail.com>2018-10-13 20:49:26 +0300
commitab62b7e971ab446c8c286fac305a846f83161e50 (patch)
tree7fd5a67b9653e2e10efee94374e812e76da86a05 /source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_glow_resolve_frag.glsl
parentcc8424e73324b772621045c1856f9a8869faa859 (diff)
parentdd6bf3f84a9137affbcd8ba0fc957c32b8c0aff7 (diff)
Merge branch 'origin/blender2.8' into temp-ui-layout-2.8temp-ui-layout-2.8
Diffstat (limited to 'source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_glow_resolve_frag.glsl')
-rw-r--r--source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_glow_resolve_frag.glsl46
1 files changed, 46 insertions, 0 deletions
diff --git a/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_glow_resolve_frag.glsl b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_glow_resolve_frag.glsl
new file mode 100644
index 00000000000..010c4ef4a88
--- /dev/null
+++ b/source/blender/draw/engines/gpencil/shaders/fx/gpencil_fx_glow_resolve_frag.glsl
@@ -0,0 +1,46 @@
+/* ******************************************************************* */
+/* Resolve GLOW pass */
+/* ******************************************************************* */
+uniform sampler2D strokeColor;
+uniform sampler2D strokeDepth;
+uniform sampler2D glowColor;
+uniform sampler2D glowDepth;
+uniform int alpha_mode;
+
+out vec4 FragColor;
+
+void main()
+{
+ vec4 outcolor;
+ ivec2 uv = ivec2(gl_FragCoord.xy);
+
+ float stroke_depth = texelFetch(strokeDepth, uv.xy, 0).r;
+ vec4 src_pixel= texelFetch(strokeColor, uv.xy, 0);
+ vec4 glow_pixel= texelFetch(glowColor, uv.xy, 0);
+ float glow_depth = texelFetch(glowDepth, uv.xy, 0).r;
+
+ if (alpha_mode == 0) {
+ outcolor = src_pixel + glow_pixel;
+ }
+ else {
+ if ((src_pixel.a < 0.1) || (glow_pixel.a < 0.1)) {
+ outcolor = src_pixel + glow_pixel;
+ }
+ else {
+ outcolor = src_pixel;
+ }
+ }
+
+ if (src_pixel.a < glow_pixel.a) {
+ gl_FragDepth = glow_depth;
+ }
+ else {
+ gl_FragDepth = stroke_depth;
+ }
+
+ if (outcolor.a < 0.001) {
+ discard;
+ }
+
+ FragColor = outcolor;
+}