[0.3 released] Noise++: A coherent noise-generating library

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
beaugard
OGRE Contributor
OGRE Contributor
Posts: 265
Joined: Sun Mar 25, 2007 1:48 pm
x 2

Post by beaugard »

The thing is, it's not the "floorf" function that's killing it, it's the conversion from float to int.
alrite... I had a faint recollection of certain msvc math functions being insanely slow due to ... some bizarre reason (internationalization? sounds impossible).
User avatar
kickin_bear
Kobold
Posts: 31
Joined: Sun Apr 06, 2008 10:06 pm
Location: Karlsruhe, Germany

Post by kickin_bear »

okay, I have implemented the fast noise algorithm. Here are the performance results on my machine (AMD Athlon64 X2 6000+ running 64-bit Linux):

Code: Select all

Using 2 threads for generation with threaded pipeline.
calculating test value at (1.2|0.2)
Noise++ (2D): 0.413553
Noise++ (3D): 0.413553
prepare for generating 10 million points ... go!
generating using Pipeline3D .......... done
time: 3.27976 sec
3.049 million pixels per second
generating using Pipeline2D .......... done
time: 1.89004 sec
5.2909 million pixels per second
generating using ThreadedPipeline3D .......... done
time: 1.79362 sec
5.57531 million pixels per second
generating using ThreadedPipeline2D .......... done
time: 1.04024 sec
9.61316 million pixels per second
--- NOW RUNNING TEST WITH A PERLIN NOISE MODULE USING FAST NOISE ---
Using 2 threads for generation with threaded pipeline.
calculating test value at (1.2|0.2)
Noise++ (2D): -0.953872
Noise++ (3D): -0.953872
prepare for generating 10 million points ... go!
generating using Pipeline3D .......... done
time: 2.19408 sec
4.55773 million pixels per second
generating using Pipeline2D .......... done
time: 1.56804 sec
6.37737 million pixels per second
generating using ThreadedPipeline3D .......... done
time: 1.24294 sec
8.04543 million pixels per second
generating using ThreadedPipeline2D .......... done
time: 0.885842 sec
11.2887 million pixels per second
Refering to the floor optimation:
I have already removed them and replaced them by simple integer conversions (e.g. (int)floatValue)
I'm not very experienced with assembler but if I understand Ysaneya's assembly it just puts the float value onto the stack and pops it back as an integer value. And this should be the same assembly my compiler generates automatically when I do the conversion by writing (int)floatValue (I at least expect the compilers to be that intelligent :wink:)
I think the major speedup of the first improvement is the missing floor function.
I uploaded the changes to SVN. To switch to the fast noise method just call PerlinModule::setQuality(), BillowModule::setQuality() or RidgedMultiModule::setQuality() with NOISE_QUALITY_FAST_LOW, NOISE_QUALITY_FAST_STD or NOISE_QUALITY_FAST_HIGH.

Edit:
version 0.2 released
Note:
When using the new fast noise quality setting in the Noise++ Editor you have to set the scaling parameter to about 1 to keep the values in the range from -1 to 1 to get right colors.
I have downloaded the CUDA SDK today and the speed is definitively there. But I realized that it only supports single precision. The benefit of a CUDA using Noise++ library would definitively creating high-resolutioned, big seamless worlds in realtime. When you're talking about generating planets, do you mean little versions of them or earth-like ones? Or to come to the point: Do you need double precision or is single precision enough?
beaugard
OGRE Contributor
OGRE Contributor
Posts: 265
Joined: Sun Mar 25, 2007 1:48 pm
x 2

Post by beaugard »

Wonderful! Vacation starts on thursday, and then I'll finally have time to work on Ogre-related stuff. Timing couldn't be better :)

Thats a pretty good performance improvement (~30% or something). How many octaves are you using? Ysaneya used a lot of octaves (12, actually), maybe that is why your speed improvement is not as big as his?
User avatar
kickin_bear
Kobold
Posts: 31
Joined: Sun Apr 06, 2008 10:06 pm
Location: Karlsruhe, Germany

Post by kickin_bear »

yes I used the default octave count of 6. When using 12 octaves I get a speedup from 6.3822 sec to 4.09812 sec for 3D noise and 3.54089 sec to 2.85517 sec for 2D noise.
beaugard
OGRE Contributor
OGRE Contributor
Posts: 265
Joined: Sun Mar 25, 2007 1:48 pm
x 2

Post by beaugard »

So you make 10 million points of 12-octave 3d noise in 4s. 400ns per point. Sounds good. Is this on low quality setting?
User avatar
kickin_bear
Kobold
Posts: 31
Joined: Sun Apr 06, 2008 10:06 pm
Location: Karlsruhe, Germany

Post by kickin_bear »

default quality settings (using a third-order s-curve interpolant)
here is a sample:
Image
and for comparision using normal noise:
Image
User avatar
kickin_bear
Kobold
Posts: 31
Joined: Sun Apr 06, 2008 10:06 pm
Location: Karlsruhe, Germany

Post by kickin_bear »

I have just uploaded a new release with some bugfixes:

:arrow: fixed generator for low quality 3D noise
:arrow: fixed a bug in ridged multi module: the spectral weight parameters were wrong when using a frequency other than one
:arrow: added scale factor when using fast noise (to get results in a similar range by default) and quality parameter for turbulence module; increased file version
:arrow: fixed use of fast noise in billow module
User avatar
Brocan
Orc
Posts: 441
Joined: Tue Aug 01, 2006 1:43 am
Location: Spain!!
x 8

Post by Brocan »

Are you going to implement fBm (fractal Brownian motion) over next releases? :D
User avatar
petrocket
Gremlin
Posts: 178
Joined: Tue Mar 20, 2007 3:29 am
x 10
Contact:

Re: [0.3 released] Noise++: A coherent noise-generating libr

Post by petrocket »

I'm pretty sure all the noise so far has been fBm (fractal brownian motion), judging by how often the word 'octaves' gets thrown around.
Ogre API & Manual | Ogre Wiki

blog | website | work

Follow me on twitter @ twitter.com/petrocket
User avatar
AndiNo
Halfling
Posts: 46
Joined: Wed May 30, 2007 7:57 pm
x 2

Re: [0.3 released] Noise++: A coherent noise-generating libr

Post by AndiNo »

Sorry for reviving such an old thread, I just found no other website related to Noise++.
The Noise++ wiki has been down for at least several days. I am currently integrating Noise++ into my game which works well so far. Now I want to load a pipeline which was exported by the Noise++ editor. Does anyone here know how to correctly load a given pipeline file and use it? The doxygen documentation on the necessary classes is not really extensive and as I said the wiki is dead for now. I'll be thankful for any help!
User avatar
sleo
Gremlin
Posts: 171
Joined: Sun Jun 05, 2011 6:49 am
Location: Vodka Federation
x 18

Re: [0.3 released] Noise++: A coherent noise-generating libr

Post by sleo »

AndiNo, do you have looked at toimage/main.cpp?

Is this library generate same output as libnoise if quality was set to highest?
kickin_bear wrote: :arrow: all 3D and most 2D noise generation modules produce the same output than the corresponding libnoise modules
I compared low to fast low, default to fast default, high to fast high and they are completely different.
Brocan wrote:Are you going to implement fBm (fractal Brownian motion) over next releases? :D
Module Perlin already fractal Brownian motion. If you use octaves count = 1, then it is not fractal Brownian motion, it is gradient noise, if you use octaves count > 1 then it is fractal Brownian motion. But for naturish pinkish/brownish fractal noise you need to use much octaves count, prefebably octaves_count = texture_size / 4. It is just my perception, not real facts :) Real facts seems says that you need octaves_count = 1 - 0.5 * log2(s*s).

Module Checkerboard seems don't work in editor. Later: ah it works using ScalePoint, by default it only showing left top white checker square.

I haven't found most important module - Cache.
User avatar
AndiNo
Halfling
Posts: 46
Joined: Wed May 30, 2007 7:57 pm
x 2

Re: [0.3 released] Noise++: A coherent noise-generating libr

Post by AndiNo »

I just received a mail that you posted here, 3 months after it happened ^^
Currently I'm not using Noise++ anymore. I made some tests with other software and it works quite well for me. But thanks for the help anyway :)
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [0.3 released] Noise++: A coherent noise-generating libr

Post by jacmoe »

So, seeing that Noise++ is not maintained anymore ..
What are you using for coherent noise?
Libnoise or Noise++ or something else? :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
AndiNo
Halfling
Posts: 46
Joined: Wed May 30, 2007 7:57 pm
x 2

Re: [0.3 released] Noise++: A coherent noise-generating libr

Post by AndiNo »

The last time I worked on my program I was using the Accidental Noise Library made by J. Tippetts. It seems to work quite right, however it seems to be a bit slow. On the other hand that may very well be due to my constellation of noise modules.
By the time I switched over from Noise++ it was not officially released under its current title.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: [0.3 released] Noise++: A coherent noise-generating libr

Post by jacmoe »

Thanks AndiNo - didn't know about ANL. :)

Speed isn't a concern to be honest as it's not to be used at real-time.

Libnoise is not exactly up-to-date either: average time of last mod is 6-7 years! Making Noise++ with its 4 years since last update seem new.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: [0.3 released] Noise++: A coherent noise-generating libr

Post by lingfors »

I'm thinking about implementing a Cuda noise library when I have time.
petersvp
Gnoblar
Posts: 22
Joined: Fri Mar 08, 2013 12:50 pm
Location: Bulgaria

Re: [0.3 released] Noise++: A coherent noise-generating libr

Post by petersvp »

Using ANL here (Accidental noise library). Mostly because of its flexibility.
Post Reply