/* 04.03.1991 */
surface ACShader (
float Ka = 1.0;
float Kd = 0.1;
float Ks = 1.0;
float Kt = 0.0;
float transpAtt = 0;
float shine = 20;
color specularRGB = color(0.8, 0.8, 0.8);
color emissionRGB = color(0, 0, 0);
float emissionAtt = 0;
)
{ color Cspec;
point Nf, V;
float dist;
Nf = faceforward(normalize(N), I);
V = normalize(-I);
Os = 1 - Kt /* *pow(abs(V.Nf), transpAtt) */;
Ci = Os * Cs * (Ka * ambient() + Kd * diffuse(Nf));
dist = depth(P);
Ci += Os * emissionRGB / (1.0 + dist * emissionAtt);
Cspec = (shine > 0.5) ? specularRGB * Ks * specular(Nf, V, 1.0/shine) : 0;
Ci += Cspec;
Oi = Os;
}