Jump to content
  • Advertisement
Sign in to follow this  
l0calh05t

wavelet noise

This topic is 3997 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!