I want to write a shader that generates random numbers based on Gaussian Distribution in range [-X, X] or [0, X]. I thought of using noise*() where, * = 1,2,3,4, but unfortunately came to know, through this forum, that they are not supported on NVIDIA Cards.
(I have GeForce 8800GS).
Then I thought of writing my own code using rand(). I am doubtful whether is there a rand() in GLSL as in C programming?
Is there any other good suggestion to generate normally distribute random number generator without using rand()?
You could then transform the random numbers to a Gaussian distribution by using the Gaussian CDF. Store the CDF in a 1D texture (x = -5…5 or -6…6 should do), then use the random number as texcoord. Or approximate it some other way
Sorry, I was a bit quick, you want to use the inverse CDF. It is given in the same section as the link I gave above. So generate numbers in 0…1 and look up the inverse CDF.