Thursday, February 27, 2014

Noise Generation Multi-Threading

Multi-threading is an extremely powerful tool at a coder's disposal, but it is devilishly hard to understand and control. Before multiple cores became common on computers, multi-threading was a way for multiple programs to run "simultaneously". In reality, the programs just took turns on the processor. But with the advent of multi-core cpus, on which actual simultaneous processing is possible, multi-threading actually gives you a significant speed increase if used correctly. In this tutorial, we will look at using multi-threading to increase the speed of noise generation. This speed boost can be significant. With noise, since almost all of the calculations can be done concurrently, you will get a speed boost similar to the number of cores you have. (I get an average of for all types of noise of 1.8 times faster on my dual-core machine)

Tuesday, February 25, 2014

Advanced Voronoi Noise Generation

The method for generating Voronoi noise in Simple Voronoi Noise Generation can only be used for groups of points. But Voronoi noise works with so much more than just points. In fact, Voronoi noise generated from other shapes can lead to some really cool effects, like these ghostly rings:

Saturday, February 22, 2014

Simple Voronoi Noise Generation

Voronoi noise is a very broad type of noise. It can look like many different things that don't seem to be related to one another. It can make the image below or (with some tweaking) it can make the background image of this website. It can make a beehive, or it can be a explosion dust cloud. It can even be used for things besides just noise. As you are probably beginning to realize, it is a very powerful tool in your noise generation arsenel.



Friday, February 21, 2014

Perlin Noise Generation

Perlin noise (named for its inventor, Ken Perlin) is very similar in appearance to interpolated noise. But in the code, it couldn't be more different. It is a lot more complicated; it has gradient maps, dot products, stuff that will make your head spin. So why not use interpolated noise, if it is so much easier? Speed. Perlin noise is a pretty good amount faster than interpolated noise. So strap on your mental seatbelts, because we're in for a wild ride.

Tuesday, February 18, 2014

Fractal Noise Generation

Fractal noise (also called fractional Brownian noise or fBm) is probably the most popular method of generating noise, and with good reason. It gives very natural and beautiful looking results, while still allowing the coder to control many aspects of it's generation. Speedwise, it is pretty average, not the fastest, but by no means the slowest either.
Here is what it looks like:

Monday, February 17, 2014

Interpolated Noise Generation

And now we come to the generation of interpolated noise. Interpolated Noise looks much smoother and more natural than raw noise. The basic steps of interpolating noise are simple: to find the value of a coordinate, find the nearest neighbors in the base noise array, and interpolate between them. Here are the steps are visually:

Sunday, February 16, 2014

Interpolation

In many cases, you want a smooth transition from one value to the next. This is because, jagged color changes look very unnatural. Enter interpolation. Interpolation is simply a technical term for finding intermediate values between two known values. Interpolation has many applications, from smoothing noise arrays to simple gui fade-ins. Here is what simple interpolation looks like:


Saturday, February 15, 2014

Basic Noise Generation

In order to produce more complex (and better looking) noise like Fractal Noise, it is important to have a good, robust noise generator. A noise generator is simply a random number generator that takes a seed and one or more coordinates. It must also produce the same value over and over again for a given set of inputs. Ideally, these values should be between 0 and 1, but that is not required.