ShadingContext context = new MinimalShadingContext(rng);
generateImportanceSampledSurfacePoint(x, context, rng.next(), rng.next(), rng.next());
context.getModifier().modify(context);
Point3 p = context.getPosition();
Material mat = material;//context.getMaterial();
Vector3 v = x.getPosition().unitVectorFrom(p);
Vector3 n = context.getShadingNormal();
double d2 = x.getPosition().squaredDistanceTo(p);
double atten = Math.max(n.dot(v), 0.0) * surfaceArea / (4.0 * Math.PI * d2);
Color ri = mat.emission(context, v, lambda).times(atten);
LightSample sample = new PointLightSample(x, p, ri);
target.addLightSample(sample);