We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Toxi's simplex noise help
Page Index Toggle Pages: 1
Toxi's simplex noise help (Read 1433 times)
Toxi's simplex noise help
Jun 30th, 2008, 2:57pm
 
Has anyone used Toxi's noise libraries, and could they point me to some example source if possible.

Because of the limitations of Processing's Noise() function - i.e. it doesn't create even amounts of noise, shying away from values close to 0.0 and 1.0, I needed a new Perlin Noise function and heard about Simplex Noise.

I downloaded Toxi's lib and tried to run a simple test, but my first problem is that the SimplexNoise() function returns a double, and I can't figure out how to convert this to a float, which as far as I can tell, is what I need to do.

Any help or suggestions please,
Thanks,
Glenn.



Re: Toxi's simplex noise help
Reply #1 - Jun 30th, 2008, 3:10pm
 
"(float)SimplexNoise()" will convert the double to a float (or however you actually call the noise function it)
Re: Toxi's simplex noise help
Reply #2 - Jun 30th, 2008, 3:50pm
 
aaaaa! yes the (float) syntax worked, it's not documented that you can do that though!

anyway, i got past the first hurdle, but from what I can see there is still the same problem of not perfectly even noise distribution, there seems to be a slight fall off very close to 0.0 and 1.0

any further help welcome,
thanks again,
Glenn.
Re: Toxi's simplex noise help
Reply #3 - Jun 30th, 2008, 4:24pm
 
I believe that perlin noise in inherently not evenly distributed, and it conforms to a bell curve distribution. I think it's an inherent feature of how it works.
Re: Toxi's simplex noise help
Reply #4 - Jun 30th, 2008, 4:27pm
 
Oh right, thanks John,
As long as I know it isn't some sort of bug,
I'll find a work around to get what I want,
Cheers,
Glenn.
Re: Toxi's simplex noise help
Reply #5 - Jul 1st, 2008, 11:17pm
 
Hi Glenn, I generally run a cubic smooth (3*n*n - 2*n*n*n) on any noise values (n is the 0...1 value returned from the fractal perlin noise function) to 'stretch' the results to cover more of the 0...1 range, and generally increase the contrast of the results. While mathematically it still doesn't give a uniform distribution of values, I find that the results are much more usable for driving parameters which are expecting inputs in the range 0...1.

For even more contrast you could run the function twice, or use a quintic smooth n*n*n*(n*(n*6 - 15) + 10), or any other easeInOut smoothing function which in this case will effectively 'crush the blacks' and 'boost the hilights' without any clamping.

P.S. a bit of trivia, the cubic smooth was used by perlin in the original noise algorithm for smoothly interpolating between pseudo-random values, and the quintic smooth was used in his 2002 improved algorithm...
Re: Toxi's simplex noise help
Reply #6 - Jul 6th, 2008, 4:02pm
 
Thank you Memo for that!!!!
Page Index Toggle Pages: 1