Last change
on this file since 79 was
46,
checked in by epyon, 12 years ago
|
- tests directory added
- render_test added (old visual test with new syntax)
|
File size:
579 bytes
|
Line | |
---|
1 | #version 120
|
---|
2 | attribute vec3 coords;
|
---|
3 | attribute vec3 material;
|
---|
4 | varying vec3 f_coord;
|
---|
5 | varying vec3 f_normal;
|
---|
6 | varying vec3 f_material;
|
---|
7 | varying float f_diffuse_value;
|
---|
8 | uniform mat4 matrix_mvp;
|
---|
9 | uniform vec3 light;
|
---|
10 |
|
---|
11 | void main(void) {
|
---|
12 | f_normal = vec3(0,0,0);
|
---|
13 | f_normal[int(abs(material.y)-1)] = sign( material.y );
|
---|
14 | vec3 vnormal = normalize(f_normal);
|
---|
15 | vec3 vlight = normalize(light - coords);
|
---|
16 | float diffuse = max(dot(vlight, vnormal), 0.0);
|
---|
17 | f_diffuse_value = diffuse;
|
---|
18 | f_coord = coords;
|
---|
19 | f_material = material;
|
---|
20 | gl_Position = matrix_mvp * vec4(coords, 1.0);
|
---|
21 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.