Color sum = sc.getColorModel().getBlack(lambda);
for (LightSample sample : sc.getLightSamples()) {
if (!sample.castShadowRay(sc)) {
Vector3 in = sample.getDirToLight().opposite();
Vector3 out = sc.getIncident().opposite();
Color bsdf = mat.bsdf(sc, in, out, lambda);
double dot = Math.abs(in.dot(normal));
sum = sum.plus(sample.getRadiantIntensity().times(bsdf.times(dot)));
}
}
return sum;