intravenous
diff sdr/vein.p.glsl @ 3:94d4c60af435
some progress
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 22 Apr 2012 03:35:18 +0300 |
parents | |
children | c6a6a64df6de |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/sdr/vein.p.glsl Sun Apr 22 03:35:18 2012 +0300 1.3 @@ -0,0 +1,15 @@ 1.4 +varying vec3 vpos, vnorm; 1.5 +varying vec3 ldir, vdir; 1.6 + 1.7 +void main() 1.8 +{ 1.9 + vec3 n = normalize(vnorm); 1.10 + vec3 l = normalize(ldir); 1.11 + vec3 v = normalize(vdir); 1.12 + vec3 h = normalize(l + v); 1.13 + 1.14 + vec3 diff = vec3(0.8, 0.25, 0.2) * max(dot(l, n), 0.0); 1.15 + vec3 spec = vec3(0.6, 0.4, 0.32) * pow(max(dot(h, n), 0.0), 60.0); 1.16 + 1.17 + gl_FragColor = vec4(diff + spec, 1.0); 1.18 +}