source: trunk/tests/render_test/box.vert @ 46

Last change on this file since 46 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
2attribute vec3 coords;
3attribute vec3 material;
4varying vec3 f_coord;
5varying vec3 f_normal;
6varying vec3 f_material;
7varying float f_diffuse_value;
8uniform mat4 matrix_mvp;
9uniform vec3 light;
10
11void 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.