From bd57f345ed9dbed1d81683e48199626de2ea9044 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Fri, 27 Jun 2025 10:18:39 -0700 Subject: Restructure project --- shaders/view_texture.vert | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 shaders/view_texture.vert (limited to 'shaders/view_texture.vert') 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 @@ +layout (location = 0) in vec2 Position; + +out vec2 Texcoord; + +void main() +{ + Texcoord = Position * vec2(0.5) + vec2(0.5);// Map from [-1, +1] to [0, 1]. + // The Gfx library is written to work with the glTF sample models, which + // seem to want the textures loaded "as is" without flipping. Flip the + // y-coordinate here so that the texture appears as expected. + Texcoord.y = 1.0 - Texcoord.y; + gl_Position = vec4(Position, 0.0, 1.0); +} -- cgit v1.2.3