*/
@Override
public Color bsdf(SurfacePoint x, Vector3 in, Vector3 out,
WavelengthPacket lambda) {
Vector3 N = x.getNormal();
if (-N.dot(in) <= 0.0 || N.dot(out) <= 0.0) {
return lambda.getColorModel().getBlack(lambda);
}
in = in.unit();
out = out.unit();
Color d = diffuse.getColor(x, lambda);
Color s = specular.getColor(x, lambda);
Vector3 n = x.getShadingNormal();
Color D = d.divide(Math.PI);
double ci = -n.dot(in);
double co = n.dot(out);
Vector3 h = out.minus(in).unit();
double ch = n.dot(h);
double ch2 = ch * ch;
double sh2 = 1.0 - ch2;
double th2 = sh2 / ch2;