-
Notifications
You must be signed in to change notification settings - Fork 1
/
temp
56 lines (46 loc) · 1.83 KB
/
temp
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*********************************************************
Version 1.000
Code provided by Michael Hemsley and Anthony Dick
for the course
COMP SCI 3014/7090 Computer Graphics
School of Computer Science
University of Adelaide
Permission is granted for anyone to copy, use, modify, or distribute this
program and accompanying programs and documents for any purpose, provided
this copyright notice is retained and prominently displayed, along with
a note saying that the original programs are available from the aforementioned
course web page.
The programs and documents are distributed without any warranty, express or
implied. As the programs were written for research purposes only, they have
not been tested to the degree that would be advisable in any important
application. All use of these programs is entirely at the user's own risk.
*********************************************************/
#version 150
// manyAttributes.vp
// This shader passes on colour values to be interpolated by the fixed functionality
//
//Model, view, perspective matrix baked down into one uniform 4x4
uniform mat4 M_matrix;
uniform mat4 V_matrix;
uniform mat4 P_matrix;
uniform mat3 N_matrix;
in vec3 a_color;
in vec3 a_vertex;
in vec2 a_tex_coord;
in vec3 a_normal;
in vec4 a_tangent;
// This colour attribute will be sent out per-vertex and the fixed-functionality
// interpolates the colour (smooths the colour between) with connected vertices in the triangle
out vec2 st;
out vec3 color;
out vec3 normal;
out vec4 vertex;
out vec3 tangent;
void main(void) {
st = a_tex_coord;
vertex = V_matrix * M_matrix * vec4(a_vertex, 1.0);
gl_Position = P_matrix*V_matrix*M_matrix*vec4(a_vertex, 1.0);
color = a_color;
normal = normalize(N_matrix * a_normal);
tangent = normalize(N_matrix * vec3(a_tangent));
}