double sinv = 1.0 / (scene.spp + RenderConstants.SPP_PASS);
samples[offset+0] = (samples[offset+0] * scene.spp + sr) * sinv;
samples[offset+1] = (samples[offset+1] * scene.spp + sg) * sinv;
samples[offset+2] = (samples[offset+2] * scene.spp + sb) * sinv;
if (scene.finalizeBuffer()) {
scene.finalizePixel(x, y);
}
offset += 3;
}