layout( set = 0, binding = 1, std140 ) uniform FragData
{
vec4 uTextColorAnimatable;
- vec4 uAtlasRect;
vec4 uColor;
vec3 mixColor;
- float opacity;
float preMultipliedAlpha;
};
layout( location = 0 ) out vec4 fragColor;
-vec4 visualMixColor()
-{
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );
-}
-
void main()
{
- vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );
- float textTexture = texture( sTexture, texCoord ).r;
+ float textTexture = texture( sTexture, vTexCoord ).r;
// Set the color of the text to what it is animated to.
- fragColor = uTextColorAnimatable * textTexture * uColor * visualMixColor();
+ fragColor = uTextColorAnimatable * textTexture * uColor * vec4(mixColor,1.0);
}