[Cg1] Re: Replacing Mersenne Twister

Pascal Grittmann grittmann at cg.uni-saarland.de
Thu Dec 20 11:58:58 CET 2018


Considering the couple of million rays you have to trace, the thousands 
(or millions) of triangles and other solids with textures you have to 
store, and the millions of trigonometric functions and square roots you 
have to evaluate, I'd say that the performance of the random number 
generator is probably the least of your concerns. (Always profile before 
you optimize!) Also, using another random number generator is unlikely 
to visibly (or even measurably) improve the image. And, of course, any 
change in code can always introduce new (sometimes hard to spot) bugs.

If you really want to improve the image quality, or reduce the required 
number of samples per pixel for a nice image, the best way to achieve 
that would be by replacing the pseudorandom numbers by a low-discrepancy 
sequence, like a Sobol (https://en.wikipedia.org/wiki/Sobol_sequence), 
or to stratify samples within the pixels (that is, make them *less* 
random). See also: 



On 20/12/2018 11:26, Stefan Lemme wrote:
> Hi,
> that's fine as long as you keep the interface and the implementation 
> remains self-contained.
> Best,
> Stefan
> On 12/20/2018 11:11 AM, s8makrus at stud.uni-saarland.de wrote:
>> Hi!
>> The Mersenne Twister Engine is known to be slow due it's huge 
>> internal state. Also, the pseudorandom numbers it produces are of 
>> poor quality.
>> May we use a 'better' engine like the ones from the PCG family?
>> Best regards,
>> Matthis
>> _______________________________________________
>> Cg1 mailing list
>> Cg1 at cg.uni-saarland.de
>> http://mail.cg.uni-saarland.de/mailman/listinfo/cg1
> _______________________________________________
> Cg1 mailing list
> Cg1 at cg.uni-saarland.de
> http://mail.cg.uni-saarland.de/mailman/listinfo/cg1

Pascal Grittmann, M.Sc.
Saarland University
Computer Graphics Group
Saarland Informatics Campus E1.1
Room E17
66123 Saarbruecken, Germany
Phone: +49 681 302 3833

More information about the Cg1 mailing list