aboutsummaryrefslogtreecommitdiff
path: root/shaders/view_texture.vert
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/view_texture.vert')
-rw-r--r--shaders/view_texture.vert13
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 @@
1layout (location = 0) in vec2 Position;
2
3out vec2 Texcoord;
4
5void 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}