7

I need to generate normally-distributed pseudo-random numbers in a GLSL version 120 fragment shader.

They don't even have to be particularly good pseudo-random numbers. But they do need to be normally distributed.

I think I know where to look if I want to write my own random number generator, but I wanted to see if such a thing had already been invented. I'd also be grateful for any links to uniformly distributed random number generators in GLSL 120.

As a note, I've already seen the random noise generation question for GLSL. Unfortunately, it looks like simplex and Perlin noise has some kind of multimodal distribution. I suppose I could just use the mod function, but I wondered if there was a more appropriate method.

Community
  • 1
  • 1
Translunar
  • 3,739
  • 33
  • 55
  • 1
    If others are curious, there are some noise functions included in GLSL 120, such as `noise1` and `noise2`. I haven't had a chance to verify that they're normally distributed, though. – Translunar Mar 06 '14 at 20:35
  • 1
    see http://stackoverflow.com/a/3956538/2521214 – Spektre Nov 05 '15 at 09:29

0 Answers0