Last change
on this file since 189 was
189,
checked in by epyon, 12 years ago
|
- formats - full md2 implementation, including re-indexing and frame animation
- tests/md2_test - with Mancubi For Added Fun (tm)
|
File size:
910 bytes
|
Line | |
---|
1 | #version 120
|
---|
2 |
|
---|
3 | attribute vec2 nv_texcoord;
|
---|
4 | attribute vec3 nv_position;
|
---|
5 | attribute vec3 nv_normal;
|
---|
6 | attribute vec3 nv_next_position;
|
---|
7 | attribute vec3 nv_next_normal;
|
---|
8 |
|
---|
9 | varying vec3 v_normal;
|
---|
10 | varying vec3 v_light_vector;
|
---|
11 | varying vec3 v_view_vector;
|
---|
12 | varying vec2 v_texcoord;
|
---|
13 |
|
---|
14 | uniform mat4 matrix_mvp;
|
---|
15 | uniform mat4 nv_m_modelview;
|
---|
16 | uniform mat4 nv_m_projection;
|
---|
17 | uniform mat3 nv_m_normal;
|
---|
18 | uniform float nv_interpolate;
|
---|
19 | uniform vec3 light_position;
|
---|
20 |
|
---|
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 ) );
|
---|
27 |
|
---|
28 | v_texcoord = nv_texcoord;
|
---|
29 | gl_Position = matrix_mvp * vertex;
|
---|
30 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.