[0.3 released] Noise++: A coherent noise-generating library
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
[0.3 released] Noise++: A coherent noise-generating library
Noise++ is a coherent noise-generating library I created for my current project. It's released under BSD license.
http://noisepp.sourceforge.net/
Features:
coherent noise modules (perlin noise, ridged-multifractal, ...)
value transformation modules (addition, multipy, ...)
selection module
coordinate transformation modules (scale, transform, turbulence, ...)
1D, 2D and 3D versions of all modules
supports single and double precision
very well optimized (much faster than libnoise - check comparision example)
supports multi-threading
all 3D and most 2D noise generation modules produce the same output than the corresponding libnoise modules
I hope this will be useful for some of you.
Download:
Source Package: noisepp-0.3.zip
Performance comparision example binary for Windows: noisepp-0.3-test-bin.zip
Editor binary for Windows: noisepp-0.3-editor-bin.zip
Regards,
kickin_bear
http://noisepp.sourceforge.net/
Features:
coherent noise modules (perlin noise, ridged-multifractal, ...)
value transformation modules (addition, multipy, ...)
selection module
coordinate transformation modules (scale, transform, turbulence, ...)
1D, 2D and 3D versions of all modules
supports single and double precision
very well optimized (much faster than libnoise - check comparision example)
supports multi-threading
all 3D and most 2D noise generation modules produce the same output than the corresponding libnoise modules
I hope this will be useful for some of you.
Download:
Source Package: noisepp-0.3.zip
Performance comparision example binary for Windows: noisepp-0.3-test-bin.zip
Editor binary for Windows: noisepp-0.3-editor-bin.zip
Regards,
kickin_bear
Last edited by kickin_bear on Tue Jun 24, 2008 7:37 pm, edited 4 times in total.
- HexiDave
- OGRE Expert User
- Posts: 1538
- Joined: Sat Jan 14, 2006 8:00 pm
- x 1
Just tested it out - the speed is definitely there. Hopefully the quality is as good. And, yes, the one thing that irked me about libnoise was that it didn't have 2D noise functions as well.
If the quality is good, I'll probably make the switch - nicely done
A few suggestions from the example:
1. I don't know how it works for Linux machines, but on Windows as soon as it's done running the test, the window closes - there's nothing at the end to hold it on-screen. Try putting a "All done!" message followed by "cin.get();" to keep it in place so we can see the message.
2. Might be worth it to use #if's for the multi-thread example code, otherwise you have to comment it all out for it to compile.
3. There was something else - I'll edit if I can remember.
If the quality is good, I'll probably make the switch - nicely done
A few suggestions from the example:
1. I don't know how it works for Linux machines, but on Windows as soon as it's done running the test, the window closes - there's nothing at the end to hold it on-screen. Try putting a "All done!" message followed by "cin.get();" to keep it in place so we can see the message.
2. Might be worth it to use #if's for the multi-thread example code, otherwise you have to comment it all out for it to compile.
3. There was something else - I'll edit if I can remember.
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
thanks for your suggestions
I added them to the new release.
Also added an example binary (compiled in double precision).
About noise quality: The noise quality should be the same as in libnoise. Don't checked this for all cases, but I'm very sure for the perlin noise module. The example generates 1,000,000 values with libnoise and Noise++ and the mean difference is 1e-11 with double precision enabled.
I added them to the new release.
Also added an example binary (compiled in double precision).
About noise quality: The noise quality should be the same as in libnoise. Don't checked this for all cases, but I'm very sure for the perlin noise module. The example generates 1,000,000 values with libnoise and Noise++ and the mean difference is 1e-11 with double precision enabled.
- HexiDave
- OGRE Expert User
- Posts: 1538
- Joined: Sat Jan 14, 2006 8:00 pm
- x 1
- Praetor
- OGRE Retired Team Member
- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
I don't know what exactly makes it faster than libnoise. I have just read some articles about the noise functions and tried to implement them. I don't excepted it to be that fast but I think it's mainly because nearly any function is declared as inline and I tried to help the compiler optimizing the code by marking variables as const and so on. Another thing is that I use a Pipeline. For example for the noise module you have to calculate scale factors for each octave, which can be done once after the parameters are set. I do this when adding an Module to the Pipeline. Libnoise has no way to realize when the module parameters are completely set and so it calculates this scale factors each time you call GetValue()
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
Yes there is a roadmap. At first I'll add some modules that create color and normal maps from the noise output. The colors will be generated not only by heights but also by slope. After that I plan to make an editor for Noise++'s noise-generation-pipelines where you can manage modules, their parameters, see a live view of the output and finally export them to easily load an entire noise-generation-pipeline into your game.
- Praetor
- OGRE Retired Team Member
- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
- steven
- Gnoll
- Posts: 657
- Joined: Mon Feb 28, 2005 1:53 pm
- Location: Australia - Canberra (ex - Switzerland - Geneva)
- Contact:
Seems very nice. I will definitely keep an eye on it.
For several reasons we didn't use the boost::Thread anymore in our engine.
Do you think you could make the multithread support generic enough that we can supply our own thread?
[EDIT]
I see that all the thread code is in NoiseThreadedPipeline.h.
This is nice it shouldn't be too complicated to modify this file to add our own thread.
Really nice job.
[/EDIT]
For several reasons we didn't use the boost::Thread anymore in our engine.
Do you think you could make the multithread support generic enough that we can supply our own thread?
[EDIT]
I see that all the thread code is in NoiseThreadedPipeline.h.
This is nice it shouldn't be too complicated to modify this file to add our own thread.
Really nice job.
[/EDIT]
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
Yes currently all thread code is in NoiseThreadedPipeline.h, but there will be some elsewhere in the future. I already wrote my own thread library (it is integrated in Noise++ in the svn trunk) using pthreads in Linux or Windows threads. Will make a release after some testing ...
If you want to use your own implementation you can just modify the threadpp::... classes then.
Edit:
version 0.0.3 released
If you want to use your own implementation you can just modify the threadpp::... classes then.
Edit:
version 0.0.3 released
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
Editor progress
I've just released a first editor binary snapshot (source is avaible through SVN)
Currently there are only a few modules supported but the interface is nearly done.
On my TODO list:
Add all module types supported by Noise++
Add export function for binary files which can be easily imported with the Noise++ library
Add material support to colorize the output (maybe with exporter, too)
Any suggestions and comments are welcome
- SpannerMan
- Gold Sponsor
- Posts: 446
- Joined: Fri May 02, 2003 10:05 am
- Location: UK
- Contact:
- NoodlesOnMyBack
- Goblin
- Posts: 200
- Joined: Tue Feb 05, 2008 4:14 am
- Location: Buenos Aires, Argentina
- Contact:
-
- Gnome
- Posts: 331
- Joined: Thu Oct 25, 2007 12:21 pm
- Location: The Netherlands
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
I hope it meets your expectationsMartinBean wrote:Holy Crap!!
I've been working with libnoise, but stopped because it is so slow.
Lets see how this one is doing
Last night I had a look at CUDA and after the editor is done (and I have a new graphics card) a CUDA port of Noise++ is the next thing on my TODO list
-
- Gnome
- Posts: 331
- Joined: Thu Oct 25, 2007 12:21 pm
- Location: The Netherlands
A long time a go I looked at CUDA too, to do the heavy calcs on the GPU.
I stopped because I needed to spend my time somewhere else
But I really think it is the way to go!!
Realtime endless terrain generation with noise, that would minimize the download size considerably!
I stopped because I needed to spend my time somewhere else
But I really think it is the way to go!!
Realtime endless terrain generation with noise, that would minimize the download size considerably!
I have not failed... I've just found many ways that wont work
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
new release, finally.
I used my 4-day-weekend (our A-levels wrote their "Abitur" exams) to create another release. Big changelog since last release:
fixed perlin module getter function name
added editor
added select and turbulence module
added scale parameter to perlin, billow and ridged-multi module
removed module dimension specialization. there is now only one module class for each module type
added module IDs
added validators to curve and terrace editor modules
made Pipeline::addJob thread safe
added streams, reader and writer to noise utils and an export function to the editor
added some noise utils (image, system, renderer)
added tree loop validator
added new example and Code::Blocks project files
improved comparision example
added exceptions
added plane builder
added missing header to Thread++ include file
added premake files
added editor BMP export function and BuilderCallback class
improved documentation, added job queue, improved editor BMP export
added getElementID and getElementPtr function to pipeline
switched to 2-clause BSD license
I opened a wiki with and build instructions and tutorials.
The editor is not yet done and bugfree, but it is in a state you can use it.
If you have problems, suggestions or other comments just post them here.
And if there is someone who wants to write some more documentation on the wiki (modules, editor, etc.) just contact me and I give you write permissions.
I bought a Geforce 9600GT last week so I will start writing a CUDA-port when I have time to (school again tomorow ... ... I hate it)
Download:
Source Package: noisepp-0.1.zip
Performance comparision example binary for Windows: noisepp-0.1-test-bin.zip
Editor binary for Windows: noisepp-0.1-editor-bin.zip
fixed perlin module getter function name
added editor
added select and turbulence module
added scale parameter to perlin, billow and ridged-multi module
removed module dimension specialization. there is now only one module class for each module type
added module IDs
added validators to curve and terrace editor modules
made Pipeline::addJob thread safe
added streams, reader and writer to noise utils and an export function to the editor
added some noise utils (image, system, renderer)
added tree loop validator
added new example and Code::Blocks project files
improved comparision example
added exceptions
added plane builder
added missing header to Thread++ include file
added premake files
added editor BMP export function and BuilderCallback class
improved documentation, added job queue, improved editor BMP export
added getElementID and getElementPtr function to pipeline
switched to 2-clause BSD license
I opened a wiki with and build instructions and tutorials.
The editor is not yet done and bugfree, but it is in a state you can use it.
If you have problems, suggestions or other comments just post them here.
And if there is someone who wants to write some more documentation on the wiki (modules, editor, etc.) just contact me and I give you write permissions.
I bought a Geforce 9600GT last week so I will start writing a CUDA-port when I have time to (school again tomorow ... ... I hate it)
Download:
Source Package: noisepp-0.1.zip
Performance comparision example binary for Windows: noisepp-0.1-test-bin.zip
Editor binary for Windows: noisepp-0.1-editor-bin.zip
- Brocan
- Orc
- Posts: 441
- Joined: Tue Aug 01, 2006 1:43 am
- Location: Spain!!
- x 8
I'm going to use this to build my planets. Thank you for the lib .
Edit: Uhm, in the editor the checkboard texture haven't parameters and when i try to generate it, nothing happens
One advice, when you choose a new module, a separation between purely source modules and blending modules would be great
Edit: Uhm, in the editor the checkboard texture haven't parameters and when i try to generate it, nothing happens
One advice, when you choose a new module, a separation between purely source modules and blending modules would be great
- kickin_bear
- Kobold
- Posts: 31
- Joined: Sun Apr 06, 2008 10:06 pm
- Location: Karlsruhe, Germany
the checkerboard uses bit operators internally to generate. So it will change color each unit, which is the default viewing size ( from (0|0) to (1|1) ).
you have to modify it using a scale point module.
you have to modify it using a scale point module.
Thanks for advice, I'll do that.One advice, when you choose a new module, a separation between purely source modules and blending modules would be great
- HexiDave
- OGRE Expert User
- Posts: 1538
- Joined: Sat Jan 14, 2006 8:00 pm
- x 1
Hmm, well, I feel a bit silly as I just ported Libnoise over to use "fast" perlin noise (wanted all the old bits of my work to function as it was) and started building my own editor. I'll keep trucking on mine as I like the feature list it has too (plus, I get to finally learn all about the horrors of Managed C++)
Have you had a chance yet to work the non-SSE speed-boosts that Ysaneya wrote about (http://www.gamedev.net/community/forums ... cyear=2007 bottom of the page)? Only took a few minutes to re-work Libnoise's generation code to abuse that and I went from taking 4.5 seconds to generate 1024x1024 samples at 12 octaves (in 3D, of course) to 0.9 seconds. That's one hell of an improvement for such a small amount of work.
Have you had a chance yet to work the non-SSE speed-boosts that Ysaneya wrote about (http://www.gamedev.net/community/forums ... cyear=2007 bottom of the page)? Only took a few minutes to re-work Libnoise's generation code to abuse that and I went from taking 4.5 seconds to generate 1024x1024 samples at 12 octaves (in 3D, of course) to 0.9 seconds. That's one hell of an improvement for such a small amount of work.
-
- OGRE Contributor
- Posts: 265
- Joined: Sun Mar 25, 2007 1:48 pm
- x 2
About the first "trick" - he uses a ternary function (which might be faster than floorf, actually) encapsulated in a define, so it might be easy to change.
It seems he doesn't use the second trick either, but I cannot imagine it would be hard to add (just a change to interpGradientCoherentNoise function, I think).
kickin_bear, I would be very interested in how these optimizations work. If you have the time maybe you could add them to your perfomance comparison?
Code: Select all
#define NOISE_GENERATOR_INTEGER_CLAMP_X \
const int x0 = (x > Real(0.0) ? (int)x : (int)x - 1); \
const int x1 = x0 + 1;
kickin_bear, I would be very interested in how these optimizations work. If you have the time maybe you could add them to your perfomance comparison?
- HexiDave
- OGRE Expert User
- Posts: 1538
- Joined: Sat Jan 14, 2006 8:00 pm
- x 1
The thing is, it's not the "floorf" function that's killing it, it's the conversion from float to int. That assembly code with the (x - 0.5f) - which does the flooring - got me a about a second of time shaved off from my initial test with "vanilla" Libnoise. The second thing was really what did the trick, so be sure to give that a look more than anything.
noise++ is pretty much Libnoise with some new toys thrown in, so the results should be pretty much the same (remember, I was testing 3D noise, so 2D noise should be quite a bit faster).
noise++ is pretty much Libnoise with some new toys thrown in, so the results should be pretty much the same (remember, I was testing 3D noise, so 2D noise should be quite a bit faster).