
uniform sampler2D texture;
uniform int need_swap;

varying mediump vec2 Frag_UV;
varying mediump vec4 Frag_Color;

void main()
{
	mediump vec4 color_orig = vec4(texture2D(texture, Frag_UV.xy).rgb, 1.0);
	mediump vec4 color = color_orig * color_orig;
	color = vec4(mix(
		color.rgb * color.rgb,
		color.rgb,
		(sin(Frag_UV.y * 1024.0 * 3.14159265359) + 1.0) * 0.5
	).rgb, 1.0);
	color.rgb = sqrt(color.rgb);
	if (need_swap != 0) {
		gl_FragColor = color.bgra;
	} else {
		gl_FragColor = color;
	}
}
