POV-Ray : Newsgroups : povray.advanced-users : Random variation : Re: Random variation Server Time
29 Jul 2024 14:13:37 EDT (-0400)
  Re: Random variation  
From: Safari
Date: 28 Sep 2002 09:52:33
Message: <slrnapbd0v.18v.y7pt9001@safari.homelinux.net>
On 27 Sep 2002 11:54:18 -0400, Warp <war### [at] tagpovrayorg> wrote:
> Christopher James Huff <chr### [at] maccom> wrote:
>>>   I wonder if an approach like the drand48() function would be better.
> 
>> What approach would that be?
> 
>   From the drand48 man page:
> 
>      Functions  drand48()  and  erand48()   return   non-negative
>      double-precision floating-point values uniformly distributed
>      over the interval [0.0, 1.0].
...

some time ago I played with PRNG's... 
'worst-case' simulation or something.
25000 spheres were 'randomly' positioned.

'incr-seeds' means that for every sphere different initial seeds
were used (little bigger than for the previous sphere).
for every sphere position six (pseudo) random number generator
states (or seeds) were needed.
now, if spheres are not placed uniformly, it means that seed
values correlate with the output of the generator
(bad thing for a PRNG).

'one-seeding' means that for all of the 25000 sphere positions
only six seeds were used (and I mean six in TOTAL).
if spheres are not placed uniformly (in both -1 and -2 jpg),
it means that the PRNG plainly sucks.

I made patch for povray 3.5 which allows using GSL's RNG's
by defining env var POVRAY_USE_GSL and then wanted generator
in GSL_RNG_TYPE. if POVRAY_USE_GSL is not defined, SHA-512 is used.
of every PRNG in GSL v1.2, only mt19937 was 'okay' in my *humble*
opinion. YMMV.
(GSL+SHA-512 patch not available for public as for now)

scene file source
http://iki.fi/safari/prng/rnd_sphere2.pov

http://iki.fi/safari/prng/incr-seeds/rnd_sphere2-rand48-1.jpg
http://iki.fi/safari/prng/incr-seeds/rnd_sphere2-rand48-2.jpg
http://iki.fi/safari/prng/one-seeding/rnd_sphere2-rand48-1.jpg
http://iki.fi/safari/prng/one-seeding/rnd_sphere2-rand48-2.jpg

compare to a 'better' PRNG
http://iki.fi/safari/prng/incr-seeds/rnd_sphere2-sha-512-1.jpg
http://iki.fi/safari/prng/incr-seeds/rnd_sphere2-sha-512-2.jpg
http://iki.fi/safari/prng/one-seeding/rnd_sphere2-sha-512-1.jpg
http://iki.fi/safari/prng/one-seeding/rnd_sphere2-sha-512-2.jpg

and with povray 3.5's official PRNG
http://iki.fi/safari/prng/incr-seeds/rnd_sphere2-orig-1.jpg
http://iki.fi/safari/prng/incr-seeds/rnd_sphere2-orig-2.jpg
http://iki.fi/safari/prng/one-seeding/rnd_sphere2-orig-1.jpg
http://iki.fi/safari/prng/one-seeding/rnd_sphere2-orig-2.jpg

interesting, it's almost like rand48.

usually povray's PRNG is sufficient, but sometimes I get
artefacts in photon shooting (not evenly placed or something)...
and, of course, when using this kind of scene file :)

(yes, SHA1 would probably give same kind of results than SHA-512,
but that's another story)



-- 
Safari - y7p### [at] sneakemailcomgovinvalid
"Talk is cheap. Show me the code." - Linus Torvalds


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.