source: trunk/tests/planet_test/planet.vert @ 328

Last change on this file since 328 was 324, checked in by epyon, 11 years ago
  • planet test added (will be expanded later)
File size: 953 bytes
Line 
1#version 120
2
3attribute vec3 nv_position;
4
5//varying vec3 v_light_vector;
6//varying vec3 v_view_vector;
7//varying vec2 v_texcoord;
8varying vec3 v_world_pos;
9varying vec3 v_camera_loc;
10varying vec3 v_light_loc;
11
12uniform mat4 nv_m_mvp;
13uniform mat4 nv_m_model;
14uniform mat4 nv_m_model_inv;
15uniform vec3 nv_v_camera_position;
16uniform vec3 center;
17uniform vec3 light_position;
18
19void main(void)
20{
21        vec4 position   = vec4( nv_position, 1.0 );
22        //v_normal        = normalize( mix( nv_normal, nv_next_normal, nv_interpolate ) );
23        //v_texcoord      = nv_texcoord;
24        v_world_pos     = vec3( nv_m_model_inv * position );
25        gl_Position     = nv_m_mvp * position;
26
27        v_camera_loc    = vec3( nv_m_model_inv * vec4 (nv_v_camera_position, 1.0) );
28        v_light_loc     = vec3( nv_m_model_inv * vec4 (light_position, 1.0) );
29
30        //v_view_vector  = normalize( nv_position - camera_loc  );
31        //v_light_vector = normalize( nv_position - light_loc );
32}
Note: See TracBrowser for help on using the repository browser.