Fix convergence by storing in color.w the number of successful samples, and dividing afterward