Ignore:
Timestamp:
05/17/14 02:35:19 (11 years ago)
Author:
epyon
Message:
  • massive update of mesh handling
  • universal mesh handling routines
  • removed a lot of legacy code
  • significantly streamlined MD5 loading
  • all tests updated to new features
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/md2_test/obj.vert

    r189 r239  
    1212varying vec2 v_texcoord;
    1313
    14 uniform mat4 matrix_mvp;
    15 uniform mat4 nv_m_modelview;
    16 uniform mat4 nv_m_projection;
    17 uniform mat3 nv_m_normal;
     14uniform mat4 nv_m_mvp;
     15uniform mat4 nv_m_model;
     16uniform mat4 nv_m_model_inv;
     17uniform vec3 nv_v_camera_position;
     18uniform vec3 light_position;
    1819uniform float nv_interpolate;
    19 uniform vec3 light_position;
    2020
    21 void main(void) {
    22         vec4 vertex     = vec4( mix( nv_position, nv_next_position, nv_interpolate ), 1.0 );
    23         vec3 eye_pos    = vec3( nv_m_modelview * vertex );
    24         v_normal        = normalize( nv_m_normal * mix( nv_normal, nv_next_normal, nv_interpolate ) );
    25         v_light_vector  = vec3( normalize( light_position - eye_pos ) );
    26         v_view_vector   = vec3( normalize( -eye_pos ) );
     21void main(void)
     22{
     23        vec4 position   = vec4( mix( nv_position, nv_next_position, nv_interpolate ), 1.0 );
     24        v_normal        = normalize( mix( nv_normal, nv_next_normal, nv_interpolate ) );
     25        v_texcoord      = nv_texcoord;
     26        gl_Position     = nv_m_mvp * position;
    2727
    28         v_texcoord      = nv_texcoord;
    29         gl_Position     = matrix_mvp * vertex;
     28        vec3 camera_loc = vec3(nv_m_model_inv * vec4 (nv_v_camera_position, 1.0) );
     29        vec3 light_loc  = vec3(nv_m_model_inv * vec4 (light_position, 1.0) );
     30
     31        v_view_vector  = normalize( nv_position - camera_loc  );
     32        v_light_vector = normalize( nv_position - light_loc );
    3033}
Note: See TracChangeset for help on using the changeset viewer.