Ignore:
Timestamp:
05/16/14 05:48:01 (11 years ago)
Author:
epyon
Message:
  • mesh data interface and usage
  • new wavefront importer (old pending removal)
  • updates to test projects
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/render_test/box.vert

    r46 r238  
    11#version 120
    2 attribute vec3 coords;
    3 attribute vec3 material;
     2attribute vec3 nv_position;
     3attribute vec3 nv_color;
     4uniform mat4 nv_m_mvp;
     5
    46varying vec3 f_coord;
    57varying vec3 f_normal;
    68varying vec3 f_material;
    79varying float f_diffuse_value;
    8 uniform mat4 matrix_mvp;
    910uniform vec3 light;
    1011
    1112void main(void) {
    1213        f_normal = vec3(0,0,0);
    13         f_normal[int(abs(material.y)-1)] = sign( material.y );
     14        f_normal[int(abs(nv_color.y)-1)] = sign( nv_color.y );
    1415        vec3 vnormal  = normalize(f_normal);
    15         vec3 vlight   = normalize(light - coords);
     16        vec3 vlight   = normalize(light - nv_position);
    1617        float diffuse = max(dot(vlight, vnormal), 0.0);
    1718        f_diffuse_value = diffuse;
    18         f_coord = coords;
    19         f_material = material;
    20         gl_Position = matrix_mvp * vec4(coords, 1.0);
     19        f_coord = nv_position;
     20        f_material = nv_color;
     21        gl_Position = nv_m_mvp * vec4(nv_position, 1.0);
    2122}
Note: See TracChangeset for help on using the changeset viewer.