diff options
Diffstat (limited to 'tests/gl/tutorial2.vert')
-rw-r--r-- | tests/gl/tutorial2.vert | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/gl/tutorial2.vert b/tests/gl/tutorial2.vert new file mode 100644 index 00000000..d9de08e3 --- /dev/null +++ b/tests/gl/tutorial2.vert @@ -0,0 +1,19 @@ +#version 150 +// in_Position was bound to attribute index 0 and in_Color was bound to attribute index 1 +in vec2 in_Position; +in vec3 in_Color; + +// We output the ex_Color variable to the next shader in the chain +out vec3 ex_Color; +void main(void) { + // Since we are using flat lines, our input only had two points: x and y. + // Set the Z coordinate to 0 and W coordinate to 1 + + gl_Position = vec4(in_Position.x, in_Position.y, 0.0, 1.0); + + // GLSL allows shorthand use of vectors too, the following is also valid: + // gl_Position = vec4(in_Position, 0.0, 1.0); + // We're simply passing the color through unmodified + + ex_Color = in_Color; +} |