vrshoot
annotate sdr/texmap.p.glsl @ 3:c179c72369be
rename candy->vr
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 03 Feb 2014 08:52:13 +0200 |
parents | |
children |
rev | line source |
---|---|
nuclear@1 | 1 uniform sampler2D tex; |
nuclear@1 | 2 |
nuclear@1 | 3 varying vec3 vpos, norm; |
nuclear@1 | 4 varying vec2 texcoord; |
nuclear@1 | 5 |
nuclear@1 | 6 void main() |
nuclear@1 | 7 { |
nuclear@1 | 8 vec3 n = normalize(norm); |
nuclear@1 | 9 vec3 ldir = normalize(vec3(-0.5, 0.5, 2)); |
nuclear@1 | 10 |
nuclear@1 | 11 float ndotl = max(dot(n, ldir), 0.0); |
nuclear@1 | 12 |
nuclear@1 | 13 vec3 color = vec3(0.8, 0.8, 0.8) * ndotl; |
nuclear@1 | 14 |
nuclear@1 | 15 vec4 tex = texture2D(tex, texcoord.xy); |
nuclear@1 | 16 |
nuclear@1 | 17 |
nuclear@1 | 18 gl_FragColor.rgb = color * tex.rgb; |
nuclear@1 | 19 gl_FragColor.a = tex.a; |
nuclear@1 | 20 } |