source: trunk/tests/md3_test/md3_gpu.vert

Last change on this file 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: 909 bytes
Line 
1#version 120
2
3attribute vec2 nv_texcoord;
4attribute vec3 nv_position;
5attribute vec3 nv_normal;
6attribute vec3 nv_next_position;
7attribute vec3 nv_next_normal;
8
9varying vec3 v_normal;
10varying vec3 v_light_vector;
11varying vec3 v_view_vector;
12varying vec2 v_texcoord;
13
14uniform mat4 nv_m_mvp;
15uniform mat4 nv_m_modelview;
16uniform mat4 nv_m_projection;
17uniform mat3 nv_m_normal;
18uniform float nv_interpolate;
19uniform vec3 light_position;
20
21void main(void) {
22        vec4 vertex     = vec4( mix( nv_position, nv_next_position, nv_interpolate ), 1.0 );
23        v_normal        = normalize( nv_m_normal * mix( nv_normal, nv_next_normal, nv_interpolate ) );
24       
25        vec3 eye_pos    = vec3( nv_m_modelview * vertex );
26        v_light_vector  = vec3( normalize( light_position - eye_pos ) );
27        v_view_vector   = vec3( normalize( -eye_pos ) );
28
29        v_texcoord      = nv_texcoord;
30        gl_Position     = nv_m_mvp * vertex;
31}
Note: See TracBrowser for help on using the repository browser.