diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-12-22 21:16:02 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-12-22 21:19:21 +0000 |
commit | fb8197839c0bebc20fd68ee3f280da934c49c473 (patch) | |
tree | e4ccb024144cb5b41f9e572984e3278c2b0b51d0 /examples/simplegame/textureshader.vert | |
parent | d6b25272499352383214c738faa8ce1870df37f3 (diff) | |
download | YAGE-fb8197839c0bebc20fd68ee3f280da934c49c473.tar.gz YAGE-fb8197839c0bebc20fd68ee3f280da934c49c473.zip |
Removing editor and refactoring code.
Diffstat (limited to 'examples/simplegame/textureshader.vert')
-rw-r--r-- | examples/simplegame/textureshader.vert | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/simplegame/textureshader.vert b/examples/simplegame/textureshader.vert new file mode 100644 index 00000000..3277d8b0 --- /dev/null +++ b/examples/simplegame/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); + +} |