File: normal_map_vertex.glsl

package info (click to toggle)
openclonk 8.1-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 169,520 kB
  • sloc: cpp: 180,479; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 145; sh: 101; javascript: 34
file content (39 lines) | stat: -rw-r--r-- 677 bytes parent folder | download | duplicates (5)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
in vec3 oc_Position;
in vec3 oc_Normal;
in vec2 oc_TexCoord;

out vec3 vtxNormal;
out vec2 texcoord;

uniform mat4 projectionMatrix;
uniform mat4 modelviewMatrix;

#ifndef OPENCLONK
#define slice(x)

void main()
{
#endif

slice(texcoord)
{
  texcoord = oc_TexCoord;
}

slice(normal)
{
  // Dummy variable, it's not used in the fragment shader.
  // TODO: Improve construction of shaders so this is not needed,
  // but it's probably optimized out anyway. Also, remove
  // the oc_Normal attribute which is unused.
  vtxNormal = vec3(0.0, 0.0, 0.0);
}

slice(position)
{
  gl_Position = projectionMatrix * modelviewMatrix * vec4(oc_Position, 1.0);
}

#ifndef OPENCLONK
}
#endif