File: light-refract.vert

package info (click to toggle)
glmark2 2023.01%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 13,380 kB
  • sloc: cpp: 20,680; python: 13,052; ansic: 8,595; java: 1,246; xml: 383; makefile: 41; sh: 39
file content (28 lines) | stat: -rw-r--r-- 799 bytes parent folder | download | duplicates (3)
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
attribute vec3 position;
attribute vec3 normal;

uniform mat4 ModelViewProjectionMatrix;
uniform mat4 NormalMatrix;
uniform mat4 ModelViewMatrix;
uniform mat4 LightMatrix;

varying vec3 vertex_normal;
varying vec4 vertex_position;
varying vec4 MapCoord;

void main(void)
{
    vec4 current_position = vec4(position, 1.0);

    // Transform the normal to eye coordinates
    vertex_normal = normalize(vec3(NormalMatrix * vec4(normal, 1.0)));

    // Transform the current position to eye coordinates
    vertex_position = ModelViewMatrix * current_position;

    // Transform the current position for use as texture coordinates
    MapCoord = LightMatrix * current_position;

    // Transform the current position to clip coordinates
    gl_Position = ModelViewProjectionMatrix * current_position;
}