source: trunk/tests/md5_test/md5.vert @ 327

Last change on this file since 327 was 321, checked in by epyon, 11 years ago
  • updated all tests to new nova
  • cleaned up tests paths
  • general cleanup of tests and test data
File size: 1.1 KB
Line 
1#version 120
2
3attribute vec2 nv_texcoord;
4attribute vec3 nv_position;
5attribute vec3 nv_normal;
6attribute vec3 nv_tangent;
7
8varying vec3 v_normal;
9varying vec3 v_light_vector;
10varying vec3 v_view_vector;
11varying vec4 v_position;
12varying vec2 v_texcoord;
13varying mat3 v_m33_tangent;
14
15uniform mat4 nv_m_model;
16uniform mat4 nv_m_modelview;
17uniform mat4 nv_m_projection;
18uniform mat3 nv_m_normal;
19uniform mat4 nv_m_mvp;
20uniform float nv_interpolate;
21uniform vec3 light_position;
22
23void main(void) {
24        vec4 vertex     = vec4( nv_position, 1.0 );
25        vec3 eye_pos    = vec3( nv_m_modelview * vertex );
26        v_normal        = normalize( nv_m_normal * nv_normal );
27        v_light_vector  = vec3( normalize( light_position - eye_pos ) );
28        v_view_vector   = vec3( normalize( -eye_pos ) );
29
30        v_m33_tangent[0] = normalize(nv_m_normal * nv_tangent);
31        v_m33_tangent[2] = v_normal;
32        v_m33_tangent[1] = normalize(cross(v_m33_tangent[2], v_m33_tangent[0]));
33
34        v_texcoord      = nv_texcoord;
35        v_position      = nv_m_model * vertex;
36        gl_Position     = nv_m_mvp * vertex;
37}
Note: See TracBrowser for help on using the repository browser.