#version 330

#include "alpha.h"
#include "inputColorHelper.h"

uniform  sampler2DRect inputTex0;
uniform  sampler2DRect inputTexMask;
uniform vec4 endColor;
uniform float endOpacity;



in vec2 fsTexture;
in vec2 fsTextureMask;
out vec4 outColor;

void main()
{
    outColor=texture(inputTex0, fsTexture).rrrr;

    outColor=processColorProfile(outColor);

#ifdef USE_MASK
    multiplyOpacity(outColor, texture(inputTexMask, fsTextureMask).a);
#endif

#ifdef USE_END_COLOR
    mixColor(outColor, endColor, outColor, endOpacity);
#endif

}
