WavelengthPacket lambda = sc.getWavelengthPacket();
Color shade = sc.getColorModel().getBlack(lambda);
for (int i = 0; i < firstBounceRays; i++) {
ScatteredRay ray = sc.getMaterial().scatter(sc, sc.getIncident(), true, sc.getWavelengthPacket(), sampler.next(), sampler.next(), sampler.next());
if (ray != null) {
shade = shade.plus(sc.castRay(ray).times(ray.getColor()));
}
}
return shade.divide(firstBounceRays);
} else if (sc.getPathDepth() < maxDepth) {
ScatteredRay ray = sc.getScatteredRay();