diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-12-22 18:34:29 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-12-22 18:34:29 +0000 |
commit | 24253190c92c9d7ef669061670a3b7596f9ee190 (patch) | |
tree | f03d785e30a7783b5e0d5e7b669cd2997d5877ed /resources/textureshader.vert | |
parent | b885965a6375f98d6bec63a43233461f9f42006d (diff) | |
download | YAGE-24253190c92c9d7ef669061670a3b7596f9ee190.tar.gz YAGE-24253190c92c9d7ef669061670a3b7596f9ee190.zip |
Changing directories and adding input support
Diffstat (limited to 'resources/textureshader.vert')
-rw-r--r-- | resources/textureshader.vert | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/resources/textureshader.vert b/resources/textureshader.vert new file mode 100644 index 00000000..3277d8b0 --- /dev/null +++ b/resources/textureshader.vert @@ -0,0 +1,23 @@ +#version 450 + +layout(location = 0) in vec2 vertex_position; +layout(location = 1) in vec4 vertex_colour; +layout(location = 2) in vec2 vertex_uv; + +layout(location = 0) out vec2 fragment_position; +layout(location = 1) out vec4 fragment_colour; +layout(location = 2) out vec2 fragment_uv; + +uniform mat4 P; + +void main() +{ + gl_Position.xy = (P*vec4(vertex_position, 0.0, 1.0)).xy; + gl_Position.z = 0.0; + gl_Position.w = 1.0; + + fragment_position = vertex_position; + fragment_colour = vertex_colour; + fragment_uv = vec2(vertex_uv.x, 1-vertex_uv.y); + +} |