[Cg1] Re: Replacing Mersenne Twister
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:
> that's fine as long as you keep the interface and the implementation
> remains self-contained.
> On 12/20/2018 11:11 AM, s8makrus at stud.uni-saarland.de wrote:
>> 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,
>> Cg1 mailing list
>> Cg1 at cg.uni-saarland.de
> Cg1 mailing list
> Cg1 at cg.uni-saarland.de
Pascal Grittmann, M.Sc.
Computer Graphics Group
Saarland Informatics Campus E1.1
66123 Saarbruecken, Germany
Phone: +49 681 302 3833
More information about the Cg1