Last change
on this file since 239 was
239,
checked in by epyon, 11 years ago
|
- 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 size:
996 bytes
|
Rev | Line | |
---|
[189] | 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 |
|
---|
[239] | 14 | uniform mat4 nv_m_mvp;
|
---|
| 15 | uniform mat4 nv_m_model;
|
---|
| 16 | uniform mat4 nv_m_model_inv;
|
---|
| 17 | uniform vec3 nv_v_camera_position;
|
---|
| 18 | uniform vec3 light_position;
|
---|
[189] | 19 | uniform float nv_interpolate;
|
---|
| 20 |
|
---|
[239] | 21 | void 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;
|
---|
[189] | 27 |
|
---|
[239] | 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 );
|
---|
[189] | 33 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.