• Create Account

## Improving Perlin Noise

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

9 replies to this topic

### #1MrSplosion  Members

Posted 23 January 2012 - 07:31 PM

So I've created perlin noise (with the help of the community) but I'm not quite finished yet. Here is what I've been able to produce (ignore the outlying pixels):

With this accomplished I would now like to make it look more "cloudy". Where most of the image is white but there are certain spots with black. Like this:

Yeah it looks pretty good and I've been tweaking the variables but nothing look as good as my picture. I would image the function for this would be pretty complex and I'm not a math wizard. So how can I accomplish this? Is it even possible?

Thanks!

### #2RulerOfNothing  Members

Posted 23 January 2012 - 07:44 PM

You could try having all points with an intensity/height below some threshold be black, and the rest of the points be white. You should probably smooth your output before you do this however.

### #3MrSplosion  Members

Posted 23 January 2012 - 08:05 PM

You could try having all points with an intensity/height below some threshold be black, and the rest of the points be white. You should probably smooth your output before you do this however.

You mean like say if this value is under x make it white and if it's over x make it black? Because I've already thought about this and it doesn't quite have the desired look:

It doesn't look clumpy enough if you will. Maybe it's because I should do this for every octave instead of just the summed up one? Or maybe there's more to it? Maybe instead of making each octave a value between 0 and 1 I make it a value of either 0 or 1. I just don't know.

### #4RulerOfNothing  Members

Posted 23 January 2012 - 08:13 PM

Alright, did you try smoothing the output of your perlin noise? By this, I mean taking the array of values, then for each point you get the average of the point's neighbours and put this in a new array, then copy the new array over the old array.

### #5Sandman  Members

Posted 24 January 2012 - 06:49 AM

Rather than smoothing, try dropping some of the higher frequency octaves. No point in generating a load of detail and then doing more work to smooth it.

### #6MrSplosion  Members

Posted 24 January 2012 - 03:46 PM

Thank you guys! This works here's the best I've been able to make:

I'll tweak it around but if anyone know a better or more efficiency way or whatever I'm open to anything.

### #7AllEightUp  Moderators

Posted 24 January 2012 - 07:42 PM

You might also want to try using the bias functionality:

// You'll need to replace pow and log, I have template versions which call appropriate
// functions such as ::powf versus ::pow etc.

template< typename T > inline
const T Bias( const T b, const T x )
{
return( Pow(T(x), Log(T(b))/Log(T(0.5))) );
}


What you do with this is put it on the output of the noise function and set it to say '0.4f', "then" do your step function. It is fairly difficult to explain without pictures but a .4 value will make the overall image more "peaked" and move the high detail data "down" but it won't loose such detail it will simply end up being "blurred" around the cutoff point you use in the step function. (I.e. step function is basically the "if( v>=a ) output=color0 else output=color1;")

The key item is to play with your noise function values first. What is the step size between each level of noise for instance? Using high (>0.5f) stepping means each level of noise has a greater effect on the overall "shape" of the result, low values and added detail moves towards pixel level detail (or noise if you let it go too far). The additive nature between levels of noise can also have a lot of impact, and with high scale you usually use a lower blend and vice-a-versa.

I would highly suggest looking at the book "Texturing and Modelling: A Procedural Approach" as it goes through a great many ways to mess with a pure noise output and make it do things you wouldn't expect it was capable of doing. The book supplies a number of useful functions such as the bias function I posted above and with a full library of such functions, chaining things together to make some very amazing outputs becomes quite a bit more simplified than if you just keep poking at code in various ways. (You can of course always "flatten" all the math later if you get the perfect setup.) Another suggested area of research would be the functions in Renderman Shading Language as most of them exist because of the guys in the suggested book they form a basic language of working with and modifying various items such as noise. (I.e. step, pulse, etc.)

Manipulating Perlin noise is an art form. I've been using it since the 80's and can make it do a hell of a lot of different things but I think in terms of my library of functions first and how you could bias/gain/step/pulse etc the noise to fit a desired output. Without a similar vocabulary of helper functions I'm a bit limited in how I can describe things without sounding completely obtuse.

### #8MaxDZ8  Members

Posted 25 January 2012 - 01:31 AM

I typically play a bit in image editors first to have a rough understanding on how to accomplish a certain effect. Have a try.

Previously "Krohm"

### #9Sandman  Members

Posted 25 January 2012 - 07:29 AM

You could also look into Worley Noise - a couple of layers of this combined with your threshold filter might give suitable results.

### #10AllEightUp  Moderators

Posted 25 January 2012 - 08:49 PM

You could also look into Worley Noise - a couple of layers of this combined with your threshold filter might give suitable results.

Worley noise is very fun to play with but it is really much better at doing patterns such as cobblestone, lizard like skin, scales, etc. It generally doesn't produce something I would call good output for a terrain type pattern such as the desired output here.

Thinking of noise functions though, I would suggest looking at Simplex Noise as a replacement for the various gradient/vector noise implementations folks probably have running around. It is considerably faster, fixes a couple issues which can cause recognizable patterns (various continuity issues in the derivatives if I remember correctly) and a couple other things I don't remember. Overall though, while it is a bit different in output it is much easier to control due to the underlying fixes. Perlin released this a couple years ago but it seems a lot of folks missed it and continue to use the older variations.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.