Sign in to follow this  

Unity Improving Perlin Noise

This topic is 2183 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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):

[img]http://i.imgur.com/4Ecsx.png[/img][img]http://i.imgur.com/yTRZV.png[/img][img]http://i.imgur.com/3uzE6.png[/img]


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:

[img]http://i.imgur.com/EOcVr.png[/img]


I checked out [url="http://freespace.virgin.net/hugo.elias/models/m_clouds.htm"]this[/url] article but It didn't work out very well as all I could accomplish was this:

[img]http://i.imgur.com/1taoa.png[/img]

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote name='RulerOfNothing' timestamp='1327369476' post='4905655']
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.
[/quote]

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:
[img]http://i.imgur.com/ovqnc.png[/img]

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Thank you guys! This works here's the best I've been able to make:
[img]http://i.imgur.com/Fjoly.png[/img]

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

Share this post


Link to post
Share on other sites
You might also want to try using the bias functionality:

[code]
// 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))) );
}
[/code]

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.[img]http://public.gamedev.net//public/style_emoticons/default/angry.png[/img]

Share this post


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

Share this post


Link to post
Share on other sites
You could also look into [url="http://www.gamedev.net/topic/576541-voronoi--worley-noise-knowlege-dump/"]Worley Noise[/url] - a couple of layers of this combined with your threshold filter might give suitable results.

Share this post


Link to post
Share on other sites
[quote name='Sandman' timestamp='1327498169' post='4906093']
You could also look into [url="http://www.gamedev.net/topic/576541-voronoi--worley-noise-knowlege-dump/"]Worley Noise[/url] - a couple of layers of this combined with your threshold filter might give suitable results.
[/quote]
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.

Share this post


Link to post
Share on other sites

This topic is 2183 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • By Jon Bon
      Concept for combat in Meteor Bombardment 2
    • By Jon Bon
      Concept for combat in Meteor Bombardment 2
    • By Strifexxx
      Hi guys, check out our new game about sticks. Feedback welcome!
      Download on Google Play: https://play.google.com/store/apps/details?id=com.cyberpony.Stickman.RacerRoadDraw
      Download on Appstore: https://itunes.apple.com/app/id1334280717
      Youtube: https://www.youtube.com/watch?v=vnJfF0pQr5c
      Stickman Racer Road Draw is a sequel to the legendary game of survival, where to make incredible tricks, driving different transport and getting into different crash! The game is made in the best traditions of simulator games with ragdoll physics elements. Make incredible jumps and tricks and destroy the enemy! Your task is make the finish alive or dead! 










      Website: http://strifexxx.wixsite.com/cyberpony
      Facebook: https://www.facebook.com/groups/577850349043463/
      VK: https://vk.com/club122273704
    • By Redlime
      I am a game development student working on a 2.5D beat 'em up brawler game in Unity as my final year project and I've been working on the ai for the enemies in the game. However, I've been unable to get the enemies to working properly as the enemies would be constantly stuttering and jerking while trying to follow the player. I've created a foreach statement and added some conditions that call for the robots to spread out and stay away from the player if it is not in an engaging enum state. This has been an issue plaguing the ai for a while now, analysing the animator, it seems like the robot's movement is instantaneously stopping and going which might be the reason causing this stuttering. But I'm not sure how to prevent the robot's movement from stopping and going. If anyone knows the reason why this is happening to the robots it would be much appreciated as my project is due soon and I'm still unable to fix such a game breaking bug! I've included a few videos below showing what is happening to my robots and also the stuttering shown inside the animator. I've also included the full script for my robots.
       
      Robots Stuttering
      Robots Stuttering Animator
      Robot.cs
    • By red1m3n
      Hi I'm a hobbyist getting together a team to pursue game creation, we'll do both 2D and 3D games, we would definitely build different types of games, and hopefully have a great time doing it. you dont have to have much experience, just enough that you think you can fill the position. I have plenty of ideas for games that I'd love your help with, and am completely open to fulfilling your game ideas . As of right now this is a for fun project thing, but if me and my team are satisfied with our work it can be published to steam or other platforms. 
      The positions I'm currently looking to fill are:
      2D Pixel artist
      3D Modeler 
      C# programmer
      Musician/Sound engineer
      I am currently working on a project it is a 2D Merchant adventure game with survival elements. It does not have a name yet, that's because I'm bad with names. 
       
      If interested please feel free to leave me a PM or email at dealtavu@gmail.com so we can talk more about it..
  • Popular Now