ld33_umonster

annotate sdr/shadow.v.glsl @ 7:92d662deb66e

capsule distance seems broken
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 25 Aug 2015 00:38:00 +0300
parents 4a6683050e29
children
rev   line source
nuclear@0 1 varying vec3 vdir, ldir, normal;
nuclear@0 2 varying vec4 shadow_tc;
nuclear@0 3
nuclear@0 4 void main()
nuclear@0 5 {
nuclear@0 6 gl_Position = ftransform();
nuclear@0 7
nuclear@0 8 vec3 vpos = (gl_ModelViewMatrix * gl_Vertex).xyz;
nuclear@7 9 normal = normalize(gl_NormalMatrix * gl_Normal);
nuclear@0 10 vdir = -vpos;
nuclear@0 11 ldir = gl_LightSource[0].position.xyz - vpos;
nuclear@0 12 gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
nuclear@0 13
nuclear@0 14 mat4 offmat = mat4(0.5, 0.0, 0.0, 0.0,
nuclear@0 15 0.0, 0.5, 0.0, 0.0,
nuclear@0 16 0.0, 0.0, 0.5, 0.0,
nuclear@0 17 0.5, 0.5, 0.5, 1.0);
nuclear@0 18 mat4 tex_matrix = offmat * gl_TextureMatrix[1];
nuclear@0 19
nuclear@0 20 shadow_tc = tex_matrix * vec4(vpos, 1.0);
nuclear@0 21 }