POV-Ray : Newsgroups : povray.general : Requesting ideas/opinions for RNG seeding syntax : Re: Requesting ideas/opinions for RNG seeding syntax Server Time
30 Jul 2024 14:24:58 EDT (-0400)
  Re: Requesting ideas/opinions for RNG seeding syntax  
From: Slime
Date: 20 May 2009 01:46:51
Message: <4a13994b$1@news.povray.org>
>  Enhance seed() so that it will take an optional second parameter

I don't think that's a good way to do it. The problem is that the second 
parameter is confusing to people who don't already know the function. Even 
if the parameter is passed as a named constant, like RNG_SUCHANDSUCH (which 
in POV-Ray would probably require #including a file with a name you'll 
forget), this isn't the sort of thing that's useful as a parameter, because 
you're never going to want to change it dynamically. I think it would be 
simpler and clearer to use a separate function for different random number 
generators, like rand_suchandsuch( seed ).

> 1) Simply don't support seeds larger than 32-bit. This would work, but 
> would
>   be a bit of a bummer because the capabilities of higher-quality RNGs
>   wouldn't be fully utilized.

I would go with this, because it's easy for the user. In my life, I will 
never see more than 2^32 images, so that many different random number 
streams aren't necessary. The biggest advantages of other RNGs are the 
randomness of their behavior over multiple calls, not the number of 
different streams.

Keep in mind that, in practice, when you are writing a scene and need to 
come up with a seed you just type in a "random" number. If it gives bad 
results, you type in another one. Maybe instead you'll do something that's 
calculated, like frame_number, or the time of day, or something like that, 
but even in these cases, when are you going to run out of values?

At the very least, the simplicity of seed(345) should be available so users 
don't have to learn more than they already do to use a conceptually simple 
feature.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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