From 85781e7173d97aad36ad66abbbe7b26d9f9c8dfc Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Sat, 7 Jun 2014 18:03:52 +0100 Subject: [PATCH] Fixed several effects to honour background alpha --- kivy/uix/effectwidget.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kivy/uix/effectwidget.py b/kivy/uix/effectwidget.py index 0a82eb080..62feefd60 100644 --- a/kivy/uix/effectwidget.py +++ b/kivy/uix/effectwidget.py @@ -177,14 +177,14 @@ vec4 effect(vec4 color, sampler2D texture, vec2 tex_coords, vec2 coords) effect_invert = ''' vec4 effect(vec4 color, sampler2D texture, vec2 tex_coords, vec2 coords) { - return vec4(1.0 - color.xyz, 1.0); + return vec4(1.0 - color.xyz, color.w); } ''' effect_mix = ''' vec4 effect(vec4 color, sampler2D texture, vec2 tex_coords, vec2 coords) {{ - return vec4(color.{}, color.{}, color.{}, 1.0); + return vec4(color.{}, color.{}, color.{}, color.w); }} ''' @@ -211,7 +211,7 @@ vec4 effect(vec4 color, sampler2D texture, vec2 tex_coords, vec2 coords) * 0.09; sum += texture2D(texture, vec2(tex_coords.x + 4.0*dt, tex_coords.y)) * 0.05; - return sum; + return vec4(sum.xyz, color.w); }} ''' @@ -239,7 +239,7 @@ vec4 effect(vec4 color, sampler2D texture, vec2 tex_coords, vec2 coords) * 0.09; sum += texture2D(texture, vec2(tex_coords.x, tex_coords.y + 4.0*dt)) * 0.05; - return sum; + return vec4(sum.xys, sum); }} ''' @@ -269,7 +269,7 @@ vec4 effect(vec4 color, sampler2D texture, vec2 tex_coords, vec2 coords) float comp = smoothstep( 0.2, 0.7, sin(time) ); //col = mix( col, oricol, clamp(-2.0+2.0*q.x+3.0*comp,0.0,1.0) ); - return vec4(col,1.0); + return vec4(col, color.w); } '''