Sign in to follow this  
l0calh05t

wavelet noise

Recommended Posts

l0calh05t    1796
well, i read the pixar paper on wavelet noise (http://graphics.pixar.com/WaveletNoise/paper.pdf) and wanted to try it out using the sample code they provided, but i'm getting values in the range of -3e23 which is... way off. has anyone tried implementing this themselves?

Share this post


Link to post
Share on other sites
moosedude    145
Hows your gaussianNoise() function implemented? I couldn't see an implementation for it in the paper and thats the first place I would check for errors, it says it requires a range from -1 to 1.

otherwise I would go through the code with a fine-tooth comb seeing if I copied it right :)

Share this post


Link to post
Share on other sites
l0calh05t    1796
here's my gaussian noise function:

const static int q = 15;
const static float c1 = (1 << q) - 1.f;
const static float c2 = ((int)(c1 / 3.f)) + 1.f;
const static float c3 = 1.f / c1;

float gaussianNoise() {
float random = ((float)rand() / (float)(RAND_MAX + 1));
return (2.f * ((random * c2) + (random * c2) + (random * c2)) - 3.f * (c2 - 1.f)) * c3;
}

it outputs values in the range of (-1,1)
and im fairly sure i copied the code right...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this