Ported LibNoise noise library from LibNoise.Xna to Unity. Like those two, it is released under the LGPL so it can be used and modified pretty much however you like.
Generates Perlin, RiggedMultifractal,Voronoi and Billow noises and has Operators for combining them. Noise2D is a convenience class for creating Texture2D from noises.
Now also available from github, thanks to Arges:
Simple Demo scene included in attached Unitypackage.
I’ve found so many great free resources for unity. This project was an easy karma builder and I learned a bunch in the process. Let me know if any issues crop up.
var island_p = Spheres(0.20);
var const_sub_p = Const(-0.4); //Distance to edge. Smaller number makes it closer to the edge
var const_mult_p = Const(5.0); //falloff
var moduleBase = new Add(island_p, const_sub_p);
var islandmult_p = new Multiply(moduleBase, const_mult_p);
var m_noiseMap = new Noise2D(512, 512, islandmult_p);
If I run into the answer I’ll edit this post. But can I recycle the variables? moduleBase = new Multiply(yada,yada); throws an error
BCE0022: Cannot convert 'LibNoise.Unity.Operator.Multiply' to 'LibNoise.Unity.Operator.Add'.
Same here… I’m looking through the source code to figure this out…
It seems to be an oversight I believe… if you look through the Select class, you’ll see that the constructor maps the input module to m_modules[0], and the ‘controller’ to m_modules[1]… now, the Controller property maps the given value to m_modules[2], so I believe we are supposed to pass both input modules to the constructor, and set the control module through it’s property… Even though the contructor says the second module is the controller…
I haven’t tried it yet, but let’s see how it goes… I’ll post back with any news
BTW, great work on this port!! my terrain is looking infinitely better now
Cheers
EDIT: Got it to work!! the constructor indeed has those parameters mislabeled, and there is one other thing:
the Select constructor is calling it’s base class with only 2 module “slots”, so I just tweaked the constructor to pass 3 to the base call… (you gotta do this, or else you get an index out of range exception)
Anyways, it works!! thanks a million for the port!!