alrite... I had a faint recollection of certain msvc math functions being insanely slow due to ... some bizarre reason (internationalization? sounds impossible).The thing is, it's not the "floorf" function that's killing it, it's the conversion from float to int.
[0.3 released] Noise++: A coherent noise-generating library
-
- OGRE Contributor
- Posts: 265
- Joined: Sun Mar 25, 2007 1:48 pm
- x 2
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
okay, I have implemented the fast noise algorithm. Here are the performance results on my machine (AMD Athlon64 X2 6000+ running 64-bit Linux):
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 )
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?
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
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 )
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?
-
- OGRE Contributor
- Posts: 265
- Joined: Sun Mar 25, 2007 1:48 pm
- x 2
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?
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?
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
I have just uploaded a new release with some bugfixes:
fixed generator for low quality 3D noise
fixed a bug in ridged multi module: the spectral weight parameters were wrong when using a frequency other than one
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
fixed use of fast noise in billow module
fixed generator for low quality 3D noise
fixed a bug in ridged multi module: the spectral weight parameters were wrong when using a frequency other than one
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
fixed use of fast noise in billow module
- 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
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.
- AndiNo
- Halfling
- Posts: 46
- Joined: Wed May 30, 2007 7:57 pm
- x 2
Re: [0.3 released] Noise++: A coherent noise-generating libr
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!
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!
- 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
AndiNo, do you have looked at toimage/main.cpp?
Is this library generate same output as libnoise if quality was set to highest?
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.
Is this library generate same output as libnoise if quality was set to highest?
I compared low to fast low, default to fast default, high to fast high and they are completely different.kickin_bear wrote: all 3D and most 2D noise generation modules produce the same output than the corresponding libnoise modules
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).Brocan wrote:Are you going to implement fBm (fractal Brownian motion) over next releases?
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.
- AndiNo
- Halfling
- Posts: 46
- Joined: Wed May 30, 2007 7:57 pm
- x 2
Re: [0.3 released] Noise++: A coherent noise-generating libr
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
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
- jacmoe
- 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
So, seeing that Noise++ is not maintained anymore ..
What are you using for coherent noise?
Libnoise or Noise++ or something else?
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.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- AndiNo
- Halfling
- Posts: 46
- Joined: Wed May 30, 2007 7:57 pm
- x 2
Re: [0.3 released] Noise++: A coherent noise-generating libr
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.
By the time I switched over from Noise++ it was not officially released under its current title.
- jacmoe
- 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
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.
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.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- 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
I'm thinking about implementing a Cuda noise library when I have time.
-
- Gnoblar
- Posts: 22
- Joined: Fri Mar 08, 2013 12:50 pm
- Location: Bulgaria
Re: [0.3 released] Noise++: A coherent noise-generating libr
Using ANL here (Accidental noise library). Mostly because of its flexibility.