// } else { // !disperse
double n1avg = ColorUtil.getMeanChannelValue(n1);
double k1avg = ColorUtil.getMeanChannelValue(k1);
double n2avg = ColorUtil.getMeanChannelValue(n2);
double k2avg = ColorUtil.getMeanChannelValue(k2);
Complex eta1 = new Complex(n1avg, k1avg);
Complex eta2 = new Complex(n2avg, k2avg);
Vector3 out = Optics.refract(v, eta1, eta2, normal);
boolean toSide = x.getNormal().dot(out) >= 0.0;
if (fromSide != toSide) {
return ScatteredRay.transmitSpecular(new Ray3(p, out), T.divide(1 - r), 1 - r);