metasurf

view examples/volume/sdr/frag.glsl @ 6:c1a60ab45bf7

added commandline option in volume example to set the iso threshold
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 26 Oct 2011 23:38:20 +0300
parents
children
line source
1 varying vec3 vpos, ldir, norm;
3 void main()
4 {
5 vec3 n = normalize(norm);
6 vec3 l = normalize(ldir);
7 vec3 v = -normalize(vpos);
8 vec3 h = normalize(v + l);
10 const vec3 kd = vec3(0.87, 0.82, 0.74);
12 float diff = abs(dot(n, l));
13 float spec = pow(abs(dot(n, h)), 60.0);
15 vec3 dcol = kd * diff;
16 vec3 scol = vec3(0.8, 0.8, 0.8) * spec;
18 gl_FragColor = vec4(dcol + scol, 1.0);
19 }