Hi guys, I am planning to write a ray tracer in Rust. One of the requirements of doing so is to have PRNGs per thread, each seeded with a unique number. The PRNG does not need to be cryptographically secure, but has to be statistically good. I am planning to use the
Pcg64Mcg PRNG everywhere in a hierarchical fashion: one master PRNG, and each spawned slave PRNG inside a thread would take its seed from the master PRNG. This would satisfy all the criteria for reproducibility and good quality pseud-random numbers.
I am planning to use Rayon and the rand crates for this.
On doing some searching, it seems there has been some activity on both Rayon and rand sides to add support for each:
However, there does not seem to be any documentation in either crates on how to leverage this. If someone could provide some pointers on how to do it, or point to some example resources/documentation, it’d be great! I’m still quite beginner to Rust so any help would be appreciated!