#version 330

uniform sampler2DRect inputTex;
uniform float uDir=1.0;
uniform float uBlackLevel=0.0;
uniform float uIntensity=1.0;
uniform float uType=0.0;
uniform float uInvGamma=2.0;
uniform float uBlendValue=1.0;


const vec4 std601X = vec4(  0.299 ,  0.587,  0.114, 0.0  );
const vec4 std601Y = vec4( -0.169 , -0.331,  0.500, 0.0  );
const vec4 std601Z = vec4(  0.500 , -0.419, -0.081, 0.0  );

in vec2 fsTexture;
in float fsProgress;
out vec4 outColor;

void main()
{
    outColor = texture(inputTex, fsTexture);
    float scale=min(1.0,uBlendValue*(1.0-pow(1.0-fsProgress,uType)*uIntensity));
    scale=pow(scale,uInvGamma);
    outColor.rgb*=vec3(scale,scale,scale);
}


