3 ms·
Thanks!! I've been looking for an algo to draw pixel positions in a pseudorandom way only once. I didn't know a way to do it without storing and shuffling all p
by readyplayernull 2y ago
Thanks!! I've been looking for an algo to draw pixel positions in a pseudorandom way only once. I didn't know a way to do it without storing and shuffling all positions. Now, I only need to draw a centered filled circle, so there might be a prime number for it, and even if the prime only does it for a given amount of points, I could switch to other primes until the circle is filled, and get an optimal and compressed single-visit scattering algo.
- meindnoch 2y agoMind you, placing many pixels at coordinates from a linear congruential generator will not look random at all.
- satvikpendem 2y agoHave you seen this algorithm for dithering? Reminds me of your problem. https://news.ycombinator.com/item?id=42808889 https://news.ycombinator.com/item?id=42808889
- readyplayernull 2y agoYes, but another requirement is the algo to be very fast, and dithering takes way more operations than the proposed Fermat PRNG.
- bazzargh 2y agothis is something you should read https://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/ https://extremelearning.com.au/unreasonable-effectiveness-of... (it's effectively the fermat prng described, but goes into more depth)