precision mediump float;

attribute vec2 position;
varying vec2 uv;

void main() {
	gl_Position = vec4(position, -1.0, 1.0);
	uv = .5 * (position + vec2(1.0));
}
precision mediump float;

varying vec2 uv;

uniform sampler2D smp;
uniform float fade;

void main() {
	gl_FragColor = texture2D(smp, uv);
	gl_FragColor.w = 1.0 - fade;
}
precision mediump float;

uniform mat4 modelmat;
uniform mat4 pmat;
uniform float t;
uniform float mt;

attribute vec3 position;
attribute vec3 position2;

void main() {
	/* XXX this sucks */
	vec3 pos = mix(position, position2, smoothstep(0.0, 1.0, mt));
	vec4 wpos = modelmat * vec4(pos, 1.0);
	gl_Position = pmat * wpos;
}
precision mediump float;

uniform float t;

void main() {
	gl_FragColor = vec4(0.0, 0.0, 1.0, min(1.0, t * t / 16.0));
}