Stub for Perlin-like and value noise.Theoretical background stuff (that isn't useless)White noise
is like what one hears on a radio tuned to no station. It's also like old broadcast TVs on a channel with no signal. Generation a 2D texture of white noise is easy..just use any reasonable random number generator and set each pixel to a random value. But white noise isn't really very useful in creating content. What we really want is to be able to create random numbers, but random numbers that aren't totally independent of one another. What was want is to approximate a bandpass filtering of white noise. What? you cry! Sadly to explain requires a touch of notions from signal processing.
figured out that all signals can be exactly recreated by summing up an infinite number of functions. Originally considered were sinusoids (a.k.a sin or cos). A sine or cosine on a given amplitude is a nice pair of spikes in the frequency domain. (umm..forgot I said that if not clear) Here there some nice little pictures
of creating a square wave out of sinusoids. Hand-wavingly what you do is add together different (say) sine evaluations of different amplitudes, frequencies and phase shifts: Ai sin(Fix + Si)
to approximate the final signal (you need an infinite number to get it exact).
This is the basic notion behind signal processing. Generally in signal processing you take an existing signal and modify it for compression, some effect or whatever else. In terms of noise we want to do the opposite and procedurally create a signal. Instead of using sin or cosine as our "building block" we're going to use an approximation of band-pass filtered
white noise. Roughly the notion of the band-pass filtering is that we want a narrow range of frequencies for our building block so (like in the sin/cos example) we can vary the amplitude, frequency and phase shift of our function and combine some number of them together to create a signal.
Why bring any of this up? It's simple. The various noise functions all have some defects and additionally some are better at approximating band-pass filtering than others. Additionally they will have different distributions of amplitudes and frequency ranges. This boils down to you can't easily change between different noise functions as all you're neat effects would require at least tweaking if not a total rewrite. Now the issue with how good a given function is at band-pass filtering comes into play because (roughly speaking) the better it is at the filter, the less summation (evaluations of noise) is required to create the same complexity. The classic example here is that value-noise is very cheap to evaluate and so many people will use it when they would be better off using a more expensive function which requires less evaluations per sample.Value noiseValue noise
is the one of the original attempts at this style of noise generation. It is very often miscalled Perlin noise. Evaluation is very cheap, but it burden with serious defects and is very poor at band-pass filtering. Quality can be improved, but even the most basic improvements make it more expensive than gradient noise.Perlin gradient noisePerlin simplex noiseOthers
- Anisotropic noise
- Gabor noise: not the same family, but can generate similar results.
- Sparse convolution noise
- Wavelet noise
This wiki entry has had 19 revisions with contributions from 1 members.