Here's the macbeth color checker, with a varying number of samples/pixel. I experimented with drand48() and with the Mersenne Twister RNG, to see whether it would make any difference in convergence. Turns out that the Mersenne Twister is roughly 50% faster than drand48() on the Opteron machine I'm using, running SUSE 10.1, and g++ 4.1.1. It takes roughly 2.8 seconds for the image below to finish with 1024 samples per pixel, using the Mersenne Twister, while it takes 4.45 seconds using drand48().
On the left, I'm showing the images generated by the Mersenne Twister RNG. On the right, drand48().
![]() ![]() |
![]() ![]() |
![]() ![]() |
![]() ![]() |
![]() ![]() |
![]() ![]() |
![]() ![]() |
So... the Mersenne Twister is obviously faster, but does it have better convergence? I don't think it makes much sense to think of it in this low-dimensional case, but anyway.
Out of sheer ignorance of better methods, I decided a good way of testing which RNG converged faster was to convert the images to a decent lossless format like png, and see which file size was smaller (under the assumption that a less noisy file compresses better). Then, I saved a series of screenshots for each, and compared the file sizes. The following graph shows the ratio of file sizes (x axis: #samples/8; y axis: mersenne_twister/drand48):
They look almost the same, but if we disregard speed, drand48 seems to be slightly better, which is strange. I wonder if this is because drand48 is really a worse RNG, but in this low-dimensional case it sort of behaves like a quasi-Monte Carlo. Or maybe I'm just getting things from thin air.