17 template<
typename GeometryTraits,
typename Vector_t >
24 double cos_phi = geom.dot_product(n1, n2);
26 double gcontrast = std::sqrt(
fabs(1. - cos_phi) / (1. + cos_phi));
31 double n = geom.dot_product(ns, ldir);
32 double m = geom.dot_product(nd, ldir);
34 double theta = (std::max)(n, 0.);
35 double alpha = std::abs(m);
37 double lcontrast = (theta == 0 || (alpha != alpha))
40 return lcontrast * gcontrast;
44 template<
typename Light_t,
45 typename GeometryTraits,
46 typename HalfedgeGraph,
47 typename FaceNormalMap,
52 const HalfedgeGraph &mesh,
53 const FaceNormalMap &f_nm,
58 auto f2 =
face(op_f, mesh);
60 auto normal_f1 =
get(f_nm, f1);
61 auto normal_f2 =
get(f_nm, f2);