vrshoot

view 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 source
1 uniform sampler2D tex;
3 varying vec3 vpos, norm;
4 varying vec2 texcoord;
6 void main()
7 {
8 vec3 n = normalize(norm);
9 vec3 ldir = normalize(vec3(-0.5, 0.5, 2));
11 float ndotl = max(dot(n, ldir), 0.0);
13 vec3 color = vec3(0.8, 0.8, 0.8) * ndotl;
15 vec4 tex = texture2D(tex, texcoord.xy);
18 gl_FragColor.rgb = color * tex.rgb;
19 gl_FragColor.a = tex.a;
20 }