1
float DirSpotLight(in int i,
12
vec3 dir = -normalize(vec3(gl_LightSource[i].spotDirection));
13
vec3 hv = normalize(eye + dir);
14
nDotVP = max(0.0, dot(normal, dir));
15
nDotHV = max(0.0, dot(normal, hv));
16
float shininess = gl_FrontMaterial.shininess;
20
pf = pow(nDotHV, shininess);
22
ambient += gl_LightSource[i].ambient;
23
diffuse += gl_LightSource[i].diffuse * nDotVP;
24
specular += gl_LightSource[i].specular * pf;
25
return length(vec3(gl_LightSource[i].position) - ecPosition3);