- varying mediump vec2 vTexCoord;\n
- uniform sampler2D sTexture;\n
- uniform sampler2D sStyle;\n
- uniform sampler2D sMask;\n
- uniform lowp float uHasMultipleTextColors;\n
- uniform lowp vec4 uTextColorAnimatable;\n
- uniform mediump vec4 uAtlasRect;\n
- uniform lowp vec4 uColor;\n
- uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
- \n
- void main()\n
- {\n
- mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
- mediump vec4 textTexture = texture2D( sTexture, texCoord );\n
- mediump vec4 styleTexture = texture2D( sStyle, texCoord );\n
- mediump vec4 maskTexture = texture2D( sMask, texCoord );\n
-
- // Set the color of non-transparent pixel in text to what it is animated to.
- // Markup text with multiple text colors are not animated (but can be supported later on if required).
- // Emoji color are not animated.
- mediump vec4 textColor = textTexture * textTexture.a;\n
- mediump float vstep = step( 0.0001, textColor.a );\n
- textColor.rgb = mix( textColor.rgb, uTextColorAnimatable.rgb, vstep * maskTexture.a * ( 1.0 - uHasMultipleTextColors ) );\n
-
- // Draw the text as overlay above the style
- gl_FragColor = ( textColor + styleTexture * ( 1.0 - textTexture.a ) ) * uColor * vec4( mixColor, opacity );\n
- }\n
+ varying mediump vec2 vTexCoord;\n
+ uniform sampler2D sTexture;\n
+ uniform mediump vec4 uAtlasRect;\n
+ uniform lowp vec4 uColor;\n
+ uniform lowp vec3 mixColor;\n
+ uniform lowp float opacity;\n
+ \n
+ void main()\n
+ {\n
+ mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
+ gl_FragColor = texture2D( sTexture, texCoord ) * uColor * vec4( mixColor, opacity );\n
+ }\n