jes-ruby/runtime/shaders/text.v.glsl

17 lines
419 B
GLSL

uniform vec2 screen_size;
uniform vec2 position;
attribute vec4 coords;
varying vec2 texture_coord_v;
void main(void)
{
// Map coordinates such that:
// (0 .. screen_size.x) => (-1.0 .. 1.0)
gl_Position = vec4(2.0 * (position.x + coords.x) / screen_size.x - 1.0,
2.0 * (position.y + coords.y) / screen_size.y - 1.0,
0, 1);
texture_coord_v = coords.zw;
}