layout (location = 0) in vec2 coords; out vec2 tex_coord; uniform vec2 screen; uniform vec2 offset; uniform vec2 size; void main() { tex_coord = coords; gl_Position = vec4((vec2(offset.x, screen.y - offset.y) + (coords * vec2(size.x, -size.y))) / screen * 2.0 - 1.0, 0.0, 1.0); }