Last change
on this file since 351 was
321,
checked in by epyon, 11 years ago
|
- updated all tests to new nova
- cleaned up tests paths
- general cleanup of tests and test data
|
File size:
1.1 KB
|
Line | |
---|
1 | #version 120
|
---|
2 |
|
---|
3 | attribute vec2 nv_texcoord;
|
---|
4 | attribute vec3 nv_position;
|
---|
5 | attribute vec3 nv_normal;
|
---|
6 | attribute vec3 nv_tangent;
|
---|
7 |
|
---|
8 | varying vec3 v_normal;
|
---|
9 | varying vec3 v_light_vector;
|
---|
10 | varying vec3 v_view_vector;
|
---|
11 | varying vec4 v_position;
|
---|
12 | varying vec2 v_texcoord;
|
---|
13 | varying mat3 v_m33_tangent;
|
---|
14 |
|
---|
15 | uniform mat4 nv_m_model;
|
---|
16 | uniform mat4 nv_m_modelview;
|
---|
17 | uniform mat4 nv_m_projection;
|
---|
18 | uniform mat3 nv_m_normal;
|
---|
19 | uniform mat4 nv_m_mvp;
|
---|
20 | uniform float nv_interpolate;
|
---|
21 | uniform vec3 light_position;
|
---|
22 |
|
---|
23 | void main(void) {
|
---|
24 | vec4 vertex = vec4( nv_position, 1.0 );
|
---|
25 | vec3 eye_pos = vec3( nv_m_modelview * vertex );
|
---|
26 | v_normal = normalize( nv_m_normal * nv_normal );
|
---|
27 | v_light_vector = vec3( normalize( light_position - eye_pos ) );
|
---|
28 | v_view_vector = vec3( normalize( -eye_pos ) );
|
---|
29 |
|
---|
30 | v_m33_tangent[0] = normalize(nv_m_normal * nv_tangent);
|
---|
31 | v_m33_tangent[2] = v_normal;
|
---|
32 | v_m33_tangent[1] = normalize(cross(v_m33_tangent[2], v_m33_tangent[0]));
|
---|
33 |
|
---|
34 | v_texcoord = nv_texcoord;
|
---|
35 | v_position = nv_m_model * vertex;
|
---|
36 | gl_Position = nv_m_mvp * vertex;
|
---|
37 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.