CoherentNoise procedural generation library - RELEASED

CoherentNoise is a comprehensive library for noise generation. It’s inspired by libNoise C++ library.
CoherentNoise allows to generate just about any noise function you ever heard about, including Perlin noise, multifractal noise and Voronoi diagrams. Noise functions can be modified and combined in an intuitive way, allowing for literally countless combinations. There are more than 30 different generators to create, modify and combine noise, and all of them are easily extensible in case you need something very special.
Noise can be used to programmatically create textures, terrain heightmaps, game levels and, well, just about anything.

Check out this demo: http://chaoscultgames.com/products/CN/demo.html. It uses CoherentNoise to generate terrain on the fly, so that it never ends and never repeats.

A manual is also available for download at http://chaoscultgames.com/products/CN/CoherentNoiseManual.pdf.

CoherentNoise is available in AssetStore for free. Check it out now!
It’s also an open-source product now. Source files can be found in SVN repository on Assembla

Thats great, exactly what i needed ! =)

Very interesting, but you should make an editor and a plug and play system like Filter Forge. That would awesome! Or try to convert Filter Forge presets?

I might do just that, yes. That would be not only awesome, but more expensive too (-8

No one bought the library for $50. So I’ve decided to make it free, and open-source to boot!

Check it out, it no longer costs you anything.

The price still seems to be $50 in the asset store. Anyway, I don’t usually mind paying $10-30 for assets/scripts/extensions but higher price than that is usually the limit for me. This is because I am just a hobbyist and I don’t make any money with Unity.

Strangely, the price indeed has not changed, although the package manager shows it as “Free”. I’ve contacted Unity with this, hopefully they’ll fix the price soon.

Meanwhile, you can get all the scripts from SVN.

I am not sure if I understand what can be done with this. I would like to create randomness (for example Perlin noise) to my grass textures in my game. Would this be possible with this CoherentNoise library?

Yes, but probably not in real-time. I.e. you can generate a number of different grass textures and then use them on your terrain or whatever.

So is there any way to convert this back to Unity 2.6? (The reason I’m using 2.6 is that it messes up all of the shaders and levels when I upgrade to Unity 3)

Thanks!

I never tested with 2.6, but I see no reason for the library not to work. It hardly uses anything Unity-specific.

This is absolutely amazing!Can it be used even if the user is gonna sell his game (that uses CoherentNoise) ?

Yes, you can use it however you like. I’m not sure what exact license is for Asset Store free packages, but I am pretty sure they can be used in commercial games freely. I certainly don’t have any objections, use it by all means!

Awesome!You’re great!

Cool! It would be great to have a previewer-tweaker in package to be able to tweak settings in runtime.

Here it is: routine for realtime changes of RidgeNoise parameters. Though, still no luck with terrain tweaking: i would like to have plain territory with sevaral mountains. If anybody has settings for it - you’re wellcome to share. I guess, i should scale its ox-oy axis’s

Now i got something like this:

using UnityEngine;
using CoherentNoise;
using CoherentNoise.Generation;
using CoherentNoise.Generation.Displacement;
using CoherentNoise.Generation.Fractal;
using CoherentNoise.Generation.Modification;
using CoherentNoise.Generation.Patterns;
using CoherentNoise.Texturing;

public class NoiseTest : MonoBehaviour
{
	private ParticleSystem.Particle[] points;
	private int count = 0;
	
	float _freq = 1;
	float _lac = 1.2f;
	float _oct = 4;
	
	float _exp = 1;
	float _off = 1;
	float _gain = 2;
	
	float _mul = 0.6f;
	
    // Use this for initialization
    private void Awake()
    {
		Debug.Log("Starting particles");
       	points = new ParticleSystem.Particle[64*64];
		
		Rebuild();
    }
	
	private void Rebuild()
	{
		var desert = //new Gain(
   //         new ValueNoise2D(23456) * 0.6f, 0.1f);
			new RidgeNoise(23478568)
                {
				 	Frequency = _freq, // 1
					Lacunarity = _lac, // 2.17
					OctaveCount = (int)_oct, // 4
			
					Exponent = _exp, // 1
					Offset = _off, // 1
					Gain = _gain // 2
                    
                } * _mul ; //, 0.3f);
		
		
		var terrainGenerator = desert.ScaleShift(0.5f, 0.5f);
		
		count = 0;
		for (int x = -31; x < 32; x++)
		{
			for (int y = -31; y < 32; y++)
			{	
				int z = 0;

				float groundHeight = terrainGenerator.GetValue(x, y, 0);
				
				points[count].position = new Vector3(x, groundHeight, y);
				points[count].color = new Color(0f, 0f, 0f);
				points[count].size = 1f;
			
				count++;
			}
		}
	}
	
	void OnGUI () 
	{
		GUI.Label(new Rect(10,0,150,50), "Freq : " + _freq);
		_freq = GUI.HorizontalScrollbar(new Rect(120, 0, 100, 20), _freq, 0.1f, 0.0f, 5.0f); 
	    
		GUI.Label(new Rect(10,40,150,50), "Lac : " + _lac);
		_lac = GUI.HorizontalScrollbar(new Rect(120, 40, 100, 20), _lac, 0.1f, 0.0f, 5.0f); 
		
		GUI.Label(new Rect(10,80,150,50), "Oct (int) : " + _oct);
		_oct = GUI.HorizontalScrollbar(new Rect(120, 80, 100, 20), _oct, 0.1f, 2.0f, 12.0f); 
		
		
		GUI.Label(new Rect(10,140,150,50), "Exp : " + _exp);
		_exp = GUI.HorizontalScrollbar(new Rect(120, 140, 100, 20), _exp, 0.1f, 0.0f, 5.0f); 
	    
		GUI.Label(new Rect(10,180,150,50), "Offset : " + _off);
		_off = GUI.HorizontalScrollbar(new Rect(120, 180, 100, 20), _off, 0.1f, 0.0f, 5.0f); 
		
		GUI.Label(new Rect(10,220,150,50), "Gain : " + _gain);
		_gain = GUI.HorizontalScrollbar(new Rect(120, 220, 100, 20), _gain, 0.1f, 0.0f, 5.0f); 
		
		
		GUI.Label(new Rect(10,260,150,50), "Multiplier : " + _mul);
		_mul = GUI.HorizontalScrollbar(new Rect(120, 260, 100, 20), _mul, 0.1f, 0.0f, 5.0f); 
		
		
		if (GUI.Button(new Rect(50, 300, 100, 50), "Rebuild"))
			Rebuild();
	}
	
    private void Update()
    {
		particleSystem.SetParticles(points, points.Length);      
    }
}

Actually, theese settings looking not bad ( Turbulence Library | VFX Shaders | Unity Asset Store) . The most important are Frequency, Amplitude and Lacunarity, but your ValueNoise/ValueNoise2D has only Period property.

Nice settings for BillowNoise.

Even better settings for BillowNoise.
Sorry for double-triple-quadro-posting, but i hope this info can be usefull.

VeTal, You should download the Terrain Toolkit from the asset store (it’s free) and look at some of their presets; it uses similar noise functions to Coherent Noise. Also, for best results, you should combine noise generators; you can do like a voronoi one to get big mountain peaks and then multiply with PinkNoise over it to get small hills and smooth out the jagged parts of the terrain.