HIDIHO!

flash and you and me and you

fake plastic clouds

Tags: , , , ,



yesterday UP (by pixar) was released in France and we saw it with my best half.
for a while now I wanted to create procedural clouds.
don’t ask me why, there are things like this…
so the most common way to do so is to use a Perlin Noise. although I had read lots of esoteric things about procedural noise and Perlin noises especially, I never found the agorithm before.
so here you go with Ken Perlin’s noise:

+ some interseting resources I found about the topic:

As the PerlinNooise is one of the default methods of BitmapData, I guess it is performed somewhere on the graphics card.
my implementation is far too expensive and barely has a learning purpose value but it’s fun… at least I love it :)
for fast and clean result, you should try out nutsu‘s Frocessing take on PerlinNoise
click on the ‘reseed’ button to reset the noise:
perlin cloud
then:

  • animate: will animate the cloud namely incrementing the perlinZ value of Perlin class
  • frequency:determines the ‘size’ of the noise, the smaller the frequency, the bigger the waves.
  • amplitude:is some kind of ‘multiplier’ for the brightness
  • persistence:determines how much of the porevious octave is kept when merging the layers
  • octaves:determines the amount of layers (influences the complexity of the final noise)

I strongly recommend you not to run the animate mode with more than 1 octave.
the size of the bitmapData is rather small (120*60 +/-) then it’s strectched by 4, otherwise it would just crash :)
you’ll get the sources here: perlin.zip it contains the PerlinNoise.as that has a static

PerlinNoise.compute( x, y, z );

method that returns a Number comprised between 0 and 1 depending on the frequency/amplitude/octaves/persistence and is used to set each pixel of the final picture.
yeah and with a big resolution, it does look like clouds :)

Tags: , , , ,

5 Responses to “fake plastic clouds”


  1. makc
    on Jul 31st, 2009
    @ 12:05 am

    “I strongly recommend you not to run the animate mode with more than 1 octave.” unfortunately it starts to look remotely realistic at 5 octaves :( even then, I think what gives it away is completely chaotic transformation, I mean in real clouds there is always some noticeable direction caused by wind… and I am pretty sure just scrolling this picture will not cut it.


  2. Mario Klingemann
    on Jul 31st, 2009
    @ 1:54 am

    You might want to try out my last year’s optimized version of the perlin noise algorithm: http://www.quasimondo.com/archives/000672.php


  3. nicoptere
    on Jul 31st, 2009
    @ 11:19 am

    mario > I didn’t mention your article which is a shame.


  4. localToGlobal » Blog Archive » news review -> 31th week of 2009
    on Jul 31st, 2009
    @ 3:46 pm

    [...] fake plastic clouds by nicoptere [...]


  5. Armetiz
    on Oct 20th, 2009
    @ 9:52 am

    Great job !
    Really impresive to see.

Leave a Reply

© 2009 HIDIHO!. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.