source: trunk/tests/md3_test/md3_cpu.vert @ 321

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