• February 25, 2021, 04:43:47 PM

Login with username, password and session length

Author Topic:  state-less random numbers  (Read 135 times)

0 Members and 1 Guest are viewing this topic.

Offline hobold

  • Fractal Fluff
  • *****
  • Posts: 396
state-less random numbers
« on: December 19, 2020, 12:53:48 PM »
I dimly remember this topic came up before: random number generators without internal state.

Here is a talk given at GDC about using noise pattern generators instead of traditional random number generators:

The basic idea is to replace the usual
Code: [Select]
rnd_seed(some_seed);
number = rnd_get();
number = rnd_get();
...

with
Code: [Select]
number = noise_get(1, some_seed);
number = noise_get(2, some_seed);
number = noise_get(3, some_seed);
...

The talk explains in good detail how this can give better randomness with more control, while being faster to compute. I reference it here because this kind of noise generators should be much better suited for GPU programming.

Linkback: https://fractalforums.org/programming/11/state-less-random-numbers/3936/

Offline claude

  • 3f
  • ******
  • Posts: 1781
    • mathr.co.uk
Re: state-less random numbers
« Reply #1 on: December 19, 2020, 01:56:14 PM »
4-byte integer hash, full avalanche from https://burtleburtle.net/bob/hash/integer.html is what I use in GLSL, with floatBitsToUInt or whatever it's called, to go from coordinates to PRNG. hash(x ^ hash(y ^ hash(n))) is my general pattern.


clip
numbers in scientific notation

Started by claude on Code Snippets (fragments)

2 Replies
118 Views
Last post September 24, 2020, 01:50:56 AM
by 3DickUlus
xx
backward irrational numbers

Started by hgjf2 on Fractal Mathematics And New Theories

0 Replies
297 Views
Last post January 07, 2018, 06:28:56 PM
by hgjf2
xx
random thought

Started by weaverkneaver on Off Topic

2 Replies
359 Views
Last post June 30, 2019, 11:51:24 AM
by M8W
xx
Random minibrots

Started by pauldelbrot on UltraFractal

4 Replies
131 Views
Last post January 27, 2021, 05:34:12 PM
by pauldelbrot
xx
Perturbation Theory: How it's implemented without Complex Numbers

Started by Mr Rebooted on Fractal Mathematics And New Theories

4 Replies
258 Views
Last post November 18, 2020, 05:18:43 PM
by Adam Majewski