#version 330

uniform sampler2DRect inputTex;
uniform sampler2DRect inputTex1;
uniform float transitionProgress=1.0;
uniform float transitionAlpha=1.0;
uniform float baseAlpha=1.0;
uniform int transitionState;

in vec2 fsTexture;
in vec2 fsTexture2;
in vec2 fsTextureNormalized;
out vec4 outColor;

void main()
{
    vec4 colorA = texture(inputTex, fsTexture)*baseAlpha;
    vec4 colorB = texture(inputTex1, fsTexture2)*baseAlpha;

    float tp=(1.0-transitionProgress)*1.1;
    
    float diffIn=fsTextureNormalized.x-(tp-.1);
    diffIn=clamp(diffIn*10.0,0.0,1.0);
    
    float diffOut=tp-fsTextureNormalized.x;
    diffOut=clamp(diffOut*10.0,0.0,1.0);

    outColor=colorA*diffIn+colorB*diffOut;
}


