if (this.reflectance != null) {
boolean fromFront = x.getNormal().dot(v) < 0.0;
SphericalCoordinates out = RandomUtil.diffuse(ru, rv);
if (!fromFront) {
out = out.opposite();
}
Ray3 ray = new Ray3(x.getPosition(), out.toCartesian(x.getShadingBasis()));
boolean toFront = ray.direction().dot(x.getNormal()) > 0.0;