ld33_umonster
view 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 |
line source
1 varying vec3 vdir, ldir, normal;
2 varying vec4 shadow_tc;
4 void main()
5 {
6 gl_Position = ftransform();
8 vec3 vpos = (gl_ModelViewMatrix * gl_Vertex).xyz;
9 normal = normalize(gl_NormalMatrix * gl_Normal);
10 vdir = -vpos;
11 ldir = gl_LightSource[0].position.xyz - vpos;
12 gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
14 mat4 offmat = mat4(0.5, 0.0, 0.0, 0.0,
15 0.0, 0.5, 0.0, 0.0,
16 0.0, 0.0, 0.5, 0.0,
17 0.5, 0.5, 0.5, 1.0);
18 mat4 tex_matrix = offmat * gl_TextureMatrix[1];
20 shadow_tc = tex_matrix * vec4(vpos, 1.0);
21 }