Apply PreMultipliedAlpha on BorderlineColor
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / graphics / shaders / bubble-effect.frag
1 varying mediump vec2 vTexCoord;
2 uniform lowp vec4 uColor;
3 uniform sampler2D sBackground;
4 uniform sampler2D sBubbleShape;
5 varying mediump float vPercentage;
6 varying mediump vec2 vEffectTexCoord;
7
8 void main()
9 {
10   // Get the emit pisition color, and Mix with the actor color
11   mediump vec4 fragColor = texture2D(sBackground, vEffectTexCoord)*uColor;
12
13   // Apply the shape defined by the texture contained sBubbleShape
14   // And make the opacity being 0.7, and animate from 0.7 to 0 during the last 1/3 of movement
15   fragColor.a*= texture2D(sBubbleShape, vTexCoord).a * ( 2.1 - max( vPercentage*2.1, 1.4 ) );
16
17   gl_FragColor = fragColor;
18 }