tavli
diff sdr/phong.v.glsl @ 15:b1a195c3ee16
added shaders
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 28 Jun 2015 08:34:24 +0300 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/sdr/phong.v.glsl Sun Jun 28 08:34:24 2015 +0300 1.3 @@ -0,0 +1,12 @@ 1.4 +varying vec3 vdir, ldir, normal; 1.5 + 1.6 +void main() 1.7 +{ 1.8 + gl_Position = ftransform(); 1.9 + 1.10 + vec3 vpos = (gl_ModelViewMatrix * gl_Vertex).xyz; 1.11 + normal = gl_NormalMatrix * gl_Normal; 1.12 + vdir = -vpos; 1.13 + ldir = gl_LightSource[0].position.xyz - vpos; 1.14 + gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; 1.15 +}