#include "version.sh"

in float alpha_f;
uniform vec4 Cd_f;
uniform float alphaFactor;

layout(location = 0) out vec4 fragColor;

void main()
{
    fragColor = Cd_f;
    fragColor.a *= alpha_f;
    float a = fragColor.a;
    
    vec4 factor = vec4(-3.3809523809893371e-001,
                       3.5047619047812621e+000,
                       -6.6904761905066588e+000,
                       4.5238095238243377e+000);
    
    float a2 = a * a;
    float a4 = a2 * a2;
    vec4 as = vec4(a, a2, a2*a, a4);
    
    fragColor.a = 1.3654442160282443e-014 + dot(factor, as);
    fragColor.a *= alphaFactor;
}
