#version 100
precision mediump float;
precision highp int;

struct Gradient
{
    vec4 color1;
    vec4 color2;
};

uniform Gradient _gradient;

uniform mediump sampler2D cover;

varying highp vec2 vUV;
varying highp vec2 vCoverUV;

void main()
{
    gl_FragData[0] = mix(_gradient.color1, _gradient.color2, vec4(clamp(vUV.x, 0.0, 1.0)));
    float c = min(abs(texture2D(cover, vCoverUV).x), 1.0);
    gl_FragData[0] *= c;
}

