quad_centering.vs.glsl
1 #version 420 2 3 // file: quad_centering.vs.glsl 4 // author: chmod777 5 // license: GNU AGPL v3 6 7 layout (location = 0) in vec2 coords; 8 layout (location = 1) in vec2 uv; 9 10 uniform vec2 viewGeometry; 11 uniform vec2 screenPos; 12 uniform vec2 imgSize; 13 14 out DataVS { 15 vec2 uv; 16 } vs_out; 17 18 void main() { 19 vs_out.uv = uv; 20 vec2 coord = fma(coords, imgSize, screenPos) / viewGeometry; 21 coord = fma(coord, vec2(2.0), vec2(-1.0)); 22 gl_Position = vec4(coord, 0, 1); 23 }