mirror of https://github.com/kivy/kivy.git
Fixed several effects to honour background alpha
This commit is contained in:
parent
34327e0670
commit
85781e7173
|
@ -177,14 +177,14 @@ vec4 effect(vec4 color, sampler2D texture, vec2 tex_coords, vec2 coords)
|
||||||
effect_invert = '''
|
effect_invert = '''
|
||||||
vec4 effect(vec4 color, sampler2D texture, vec2 tex_coords, vec2 coords)
|
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 = '''
|
effect_mix = '''
|
||||||
vec4 effect(vec4 color, sampler2D texture, vec2 tex_coords, vec2 coords)
|
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;
|
* 0.09;
|
||||||
sum += texture2D(texture, vec2(tex_coords.x + 4.0*dt, tex_coords.y))
|
sum += texture2D(texture, vec2(tex_coords.x + 4.0*dt, tex_coords.y))
|
||||||
* 0.05;
|
* 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;
|
* 0.09;
|
||||||
sum += texture2D(texture, vec2(tex_coords.x, tex_coords.y + 4.0*dt))
|
sum += texture2D(texture, vec2(tex_coords.x, tex_coords.y + 4.0*dt))
|
||||||
* 0.05;
|
* 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) );
|
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) );
|
//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);
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue