changed shadow_factor() to handle one-sided objects