#version 110

varying vec2 vertex_uv;

uniform sampler2D texture0;
uniform sampler2D texture1;
uniform float mix;
uniform float scale0;
uniform float scale1;

void
main (void)
{
  vec4 texel0 = texture2D(texture0,
    vec2(vertex_uv.x * scale0, vertex_uv.y * scale0));
  vec4 texel1 = texture2D(texture1,
    vec2(vertex_uv.x * scale1, vertex_uv.y * scale1));

  vec3 c0 = texel0.rgb * texel0.a;
  vec3 c1 = (texel1.rgb * texel1.a) * mix;

  gl_FragColor = vec4(c0 + c1, 1.0);
}
