Vector3 r = ray.direction();
Vector3 in = adjoint ? r.opposite() : v;
Vector3 out = adjoint ? v.opposite() : r;
double pdf = w * sr.getPDF() + (1.0 - w) * inner.getScatteringPDF(x, v, r, adjoint, lambda);
Color bsdf = inner.bsdf(x, in, out, lambda);
return new ScatteredRay(ray, bsdf.divide(pdf), sr.getType(), pdf, sr.isTransmitted());
}
}
} else {
ScatteredRay sr = inner.scatter(x, v, adjoint, lambda, ru, rv, ref.seed);
if (sr != null) {