vrshoot

diff sdr/texmap.p.glsl @ 1:e7ca128b8713

looks nice :)
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 02 Feb 2014 00:35:22 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/sdr/texmap.p.glsl	Sun Feb 02 00:35:22 2014 +0200
     1.3 @@ -0,0 +1,20 @@
     1.4 +uniform sampler2D tex;
     1.5 +
     1.6 +varying vec3 vpos, norm;
     1.7 +varying vec2 texcoord;
     1.8 +
     1.9 +void main()
    1.10 +{
    1.11 +	vec3 n = normalize(norm);
    1.12 +	vec3 ldir = normalize(vec3(-0.5, 0.5, 2));
    1.13 +
    1.14 +	float ndotl = max(dot(n, ldir), 0.0);
    1.15 +
    1.16 +	vec3 color = vec3(0.8, 0.8, 0.8) * ndotl;
    1.17 +
    1.18 +	vec4 tex = texture2D(tex, texcoord.xy);
    1.19 +
    1.20 +
    1.21 +	gl_FragColor.rgb = color * tex.rgb;
    1.22 +	gl_FragColor.a = tex.a;
    1.23 +}