Sunday, 4 March 2012

Perlin noise everywhere

When I started making Balls Abound I wanted to create a subtle cartoon environment with a sense of realism unbeknownst in origin to the casual observer. I wanted nothing static on the screen, as there is very little static content in real life.  Here is a sample of what I came up with:

I had read about Perlin noise and its use in generating cloud effects in real time a while back, and always wanted to build something with it. I ended up going overboard with Perlin noise in Balls Abound, and it is used all over the place.

The splash screen uses Perlin noise to adjust the z depth and scale of the characters being rendered. Using a noise equation that takes in x, y, and z parameters I feed in the character x and y position and the current time for z, and you get back a noise value that you can assign to the characters z depth. Playing with the scale of the parameters you pass in to the noise equation you can get back all sorts of interesting patterns.

Perlin noise is also used heavily in the coconut grid. The coconuts rotation is dictated by Perlin noise generated from the coconut position and current time.

The flickering of the torches and the swaying of the palm trees are also controlled by Perlin noise. I really can't believe how useful this stuff is. Thank you Ken Perlin!

No comments:

Post a Comment