blob: d95b71b5d80c1b1e807818b401de3049f046c095 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// -*- mode: c -*-
#ifdef GLSL330
layout (location = 0) in vec2 position;
#elif defined(GLSL130)
in vec2 position;
#elif defined(GLSL120)
attribute vec2 position;
#endif
uniform mat4 mvp;
uniform vec4 color;
void main(void) {
// Short-circuit because the fragments will just be discarded
// anyway.
if (color.a <= 0.0) {
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
} else {
gl_Position = mvp * vec4(position.xy, 0.0, 1.0);
}
}
|