diff options
| author | navewindre <boneyaard@gmail.com> | 2025-09-03 20:10:09 +0200 |
|---|---|---|
| committer | navewindre <boneyaard@gmail.com> | 2025-09-03 20:10:09 +0200 |
| commit | f8b92ce3aa08b1445c9f956d8166830946562d12 (patch) | |
| tree | 94e63a5aec9f8f52b577f56799e0c9201fd976a5 /assets/shaders/2d_overlay.vsh | |
a
Diffstat (limited to 'assets/shaders/2d_overlay.vsh')
| -rw-r--r-- | assets/shaders/2d_overlay.vsh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/assets/shaders/2d_overlay.vsh b/assets/shaders/2d_overlay.vsh new file mode 100644 index 0000000..512ef91 --- /dev/null +++ b/assets/shaders/2d_overlay.vsh @@ -0,0 +1,20 @@ +attribute vec4 in_position; +attribute vec2 in_texcoord; +attribute vec2 in_texcoord2; + +varying vec2 g_texcoord; +varying vec2 g_texcoord2; +uniform vec4 g_screenratio; + +void main() { + vec2 halfscreen = vec2( 1.0 / g_screenratio[0], 1.0 / g_screenratio[1] ); + + vec4 pos = in_position; + pos[0] -= halfscreen[0]; + pos[1] -= halfscreen[1]; + pos[1] *= -1.0; + + gl_Position = ( pos ) * g_screenratio; + g_texcoord = in_texcoord; + g_texcoord2 = in_texcoord2; +} |
