Last change
on this file since 90 was
46,
checked in by epyon, 12 years ago
|
- tests directory added
- render_test added (old visual test with new syntax)
|
File size:
764 bytes
|
Line | |
---|
1 | #version 120
|
---|
2 | varying vec3 f_coord;
|
---|
3 | varying vec3 f_normal;
|
---|
4 | varying vec3 f_material;
|
---|
5 | varying float f_diffuse_value;
|
---|
6 | uniform sampler2D tex;
|
---|
7 | uniform vec3 light;
|
---|
8 |
|
---|
9 | void main(void) {
|
---|
10 | float w = f_material.x;
|
---|
11 | bool secondary = f_normal.y < 0.1;
|
---|
12 | float remmod = floor( w / 16 + 0.5 );
|
---|
13 | float modulus = w - remmod * 16;
|
---|
14 | float dist = distance( light, f_coord );
|
---|
15 | float dmod = clamp(5.0 - dist, 0.0, 1.0) * f_diffuse_value;
|
---|
16 |
|
---|
17 | if (secondary)
|
---|
18 | gl_FragColor = texture2D(tex, vec2((fract(f_coord.z - f_coord.x) + modulus ), ( fract(-f_coord.y) + remmod) ) / 16.0);
|
---|
19 | else
|
---|
20 | gl_FragColor = texture2D(tex, vec2((fract(f_coord.z) + modulus ), ( fract(f_coord.x) + remmod) ) / 16.0);
|
---|
21 | gl_FragColor = vec4( gl_FragColor.xyz * (f_diffuse_value + 0.4), 1.0 );
|
---|
22 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.