#include "blur.glsllib"
uniform float AppFrame; // frame number since app starts
uniform float FPS;
varying vec2 crawl; // corona crawl direction and magnitude
void vert ()
{
SetupHorizontalGaussianBlur(Texture0Info.x, HBlurBias, TexCoord);
// compute crawl
float alpha = radians(CrawlAngle + 180.0);
crawl = vec2(CrawlLen * sin(alpha), CrawlLen * cos(alpha));
}
void frag()
{
//Passing in 1.0 means the value will not get alpha-multiplied again
float OutCol = GaussianAlphaBlur( GlowSampler, 1.0 );
OutCol *= Trailfade; // fade away glow color
OutCol += texture2D_0( TexCoord ).a; // add glow color in the original tex area
vec2 nuv = NoiseScale * TexCoord3 + AppFrame / FPS * crawl;
vec4 noise = texture2D_NoiseSamp(fract(nuv));
float ns = (1.0 - NoiseRatio) + NoiseRatio * NoiseBright * noise.x;
OutCol *= ns;
gl_FragColor = vec4( OutCol );
}
void vert ()
{
SetupVerticalGaussianBlur( Texture0Info.y, VBlurBias, TexCoord );
}
void frag() // PS_Blur_Vertical_9tap
{
float OutCol = GaussianAlphaBlur( Texture0, Texture0Info.z );
gl_FragColor = OutCol * vec4(GlowCol.rgb, 1.0);
}
void vert()
{
}
void frag ()
{
vec4 src = texture2D_0( TexCoord );
vec4 dst = texture2D_Sprite(TexCoord);
colorOutput( src * (1.0 - dst.a) + dst );
}