7 uniform float shininess;
12 varying vec2 tex_coord;
18 vec3 p = normalize(pos);
19 vec3 n = normalize(normal);
20 vec3 l = normalize(ldir);
22 vec3 r = normalize(-reflect(l, n));
23 vec3 vdir = normalize(-p);
25 float cdiff = max(dot(l, n), 0.0);
26 float cspec = pow(max(dot(r, vdir), 0.0), shininess);
28 vec4 texel = texture2D(tex, tex_coord);
29 color.xyz = diffuse.xyz * cdiff * texel.xyz + specular.xyz * cspec;