blob: 312fcd6fe379a75fb08214dab7bba1aec067ae38 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// -*- mode: c -*-
#ifdef GLSL330
layout (location = 0) in vec3 position;
#elif defined(GLSL130)
in vec3 position;
#elif defined(GLSL120)
attribute vec3 position;
#endif
#ifdef GLSL120
varying vec3 fragDir;
#else
out vec3 fragDir;
#endif
uniform mat4 view;
uniform mat4 projection;
void main() {
// Remove the translation part of the view matrix.
mat4 viewDir = mat4(mat3(view));
fragDir = position;
gl_Position = projection * viewDir * vec4(position, 1.0);
}
|