1 varying mediump vec2 vTexCoord;
2 uniform sampler2D sTexture;
3 uniform sampler2D sMask;
4 uniform lowp vec4 uTextColorAnimatable;
5 uniform lowp vec4 uColor;
6 uniform lowp vec3 mixColor;
10 mediump vec4 textTexture = texture2D( sTexture, vTexCoord );
11 mediump float maskTexture = texture2D( sMask, vTexCoord ).r;
13 // Set the color of non-transparent pixel in text to what it is animated to.
14 // Markup text with multiple text colors are not animated (but can be supported later on if required).
15 // Emoji color are not animated.
16 mediump float vstep = step( 0.0001, textTexture.a );
17 textTexture.rgb = mix( textTexture.rgb, uTextColorAnimatable.rgb, vstep * maskTexture );
19 // Draw the text as overlay above the style
20 gl_FragColor = textTexture * uColor * vec4( mixColor, 1.0 );