varying vec2 v_uv;
#ifdef VERTEX_SHADER
attribute vec2 a_pos;
attribute vec2 i_pos;
attribute vec2 i_size;
attribute vec2 i_uv_pos;
attribute vec2 i_uv_size;
uniform mat3 u_matrix;
void main() {
v_uv = i_uv_pos + a_pos * i_uv_size;
vec3 pos = u_matrix * vec3(i_pos + a_pos * i_size, 1.0);
gl_Position = vec4(pos.xy, 0.0, pos.z);
}
#endif
#ifdef FRAGMENT_SHADER
uniform sampler2D u_texture;
void main() {
gl_FragColor = texture2D(u_texture, v_uv);
}
#endif