source: trunk/tests/objload_test/obj.vert @ 137

Last change on this file since 137 was 137, checked in by epyon, 12 years ago
  • objload test added ( to be expanded )
File size: 472 bytes
Line 
1#version 120
2attribute vec3 position;
3attribute vec2 texcoord;
4attribute vec3 normal;
5varying vec2 f_texcoord;
6varying float f_diffuse_value;
7uniform mat4 matrix_mvp;
8uniform vec3 light;
9
10void main(void) {
11        vec3 vnormal    = normalize(normal);
12        vec3 vlight     = normalize(light - position);
13        float diffuse   = max(dot(vlight, vnormal), 0.0);
14        f_diffuse_value = diffuse;
15        f_texcoord      = texcoord;
16        gl_Position     = matrix_mvp * vec4(position, 1.0);
17}
Note: See TracBrowser for help on using the repository browser.