diff options
author | 3gg <3gg@shellblade.net> | 2025-06-27 10:18:39 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2025-06-27 10:18:39 -0700 |
commit | bd57f345ed9dbed1d81683e48199626de2ea9044 (patch) | |
tree | 4221f2f2a7ad2244d2e93052bd68187ec91b8ea9 /shaders/view_texture.vert | |
parent | 9a82ce0083437a4f9f58108b2c23b957d2249ad8 (diff) |
Diffstat (limited to 'shaders/view_texture.vert')
-rw-r--r-- | shaders/view_texture.vert | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/shaders/view_texture.vert b/shaders/view_texture.vert new file mode 100644 index 0000000..4e3c7d7 --- /dev/null +++ b/shaders/view_texture.vert | |||
@@ -0,0 +1,13 @@ | |||
1 | layout (location = 0) in vec2 Position; | ||
2 | |||
3 | out vec2 Texcoord; | ||
4 | |||
5 | void main() | ||
6 | { | ||
7 | Texcoord = Position * vec2(0.5) + vec2(0.5);// Map from [-1, +1] to [0, 1]. | ||
8 | // The Gfx library is written to work with the glTF sample models, which | ||
9 | // seem to want the textures loaded "as is" without flipping. Flip the | ||
10 | // y-coordinate here so that the texture appears as expected. | ||
11 | Texcoord.y = 1.0 - Texcoord.y; | ||
12 | gl_Position = vec4(Position, 0.0, 1.0); | ||
13 | } | ||