
uniform sampler2D textures[2];
uniform int need_swap;

varying mediump vec2 texcoord;
varying mediump float scanline_out;

void main()
{
	mediump vec4 color = texture2D(textures[0], texcoord);
	color = vec4(mix(
		color * color * color * 0.75,
		color,
		sin(scanline_out) * 0.5 + 0.5

	).rgb, 1.0);
	if (need_swap != 0) {
		gl_FragColor = color.bgra;
	} else {
		gl_FragColor = color;
	}
}
