Vector3 source = RandomUtil.uniformOnUpperHemisphere(rng).toCartesian(Basis3.fromW(zenith));
if (source.dot(x.getNormal()) > 0.0) {
double sdotn = source.dot(x.getShadingNormal());
Color radiance = lambda.getColorModel().getContinuous(new SkyRadianceSpectrum(source)).sample(lambda);
target.addLightSample(new DirectionalLightSample(x, source, radiance.times(sdotn), shadows));
}
if (daytime && sun.dot(x.getNormal()) > 0.0) {
double sdotn = sun.dot(x.getShadingNormal());
target.addLightSample(new DirectionalLightSample(x, sun, solarRadiance.sample(lambda).times(sdotn), shadows));