Returns a noise value (Perlin) in the range from 0 to 1. The arguments can be up to four floating point values or a sequence with up to 4 floating point values (e.g. a vec3 or a vec4) with an optional time value. The return value is a pseudo random number in the range from 0 to 1. Due to the nature of this noise implementation (gradient noise) the return value at integer lattice points is always 0.5.
As an example, here is a 2D slice (the grid shows the integer lattice):
Note
The actual function call depends on the number of arguments, so calling noise(x,y) is not the same as calling noise(x,y,0). The former case is a true 2D noise whereas the latter is 3D. The same difference exists between 3D and 4D.
Returns a signed noise value (Perlin) in the range from -1 to 1. A call to snoise(args) is equivalent to 2*noise(args)-1.
Periodic noise function. Basically this is the same as noise() but with a periodic return value: pnoise(point) = pnoise(point+period). The time value can be either part of the point or it can be specified separately. The point and period must always have the same dimension. The return value is in the range from 0 to 1.
Signed periodic noise function. The return value is in the range from -1 to 1. A call to spnoise(args) is equivalent to 2*pnoise(args)-1.
Returns a pseudo random number which is constant between integer lattice points. The return value is in the range from 0 to 1.
As an example, here is a 2D slice (the grid shows the integer lattice):
Signed cell noise. The return value is in the range from -1 to 1. A call to scellnoise(args) is equivalent to 2*cellnoise(args)-1.
Fractional Brownian motion. The argument point must be a sequence of either 2 or 3 float values (e.g. a vec3). This function is a sum of noise values with different frequencies and amplitudes and is equivalent to the following code:
# fBm
sum = 0.0
amp = 1.0
for i in range(octaves):
sum += amp*snoise(point)
amp *= gain
point *= lacunarity
The return value is in the range from 0 to 1.
As an example, here is a 2D slice (the grid shows the integer lattice):
The code of the turbulence function is very similar to fBm(). The difference is that it sums up abs(snoise()) instead of noise(). However, the return value is in the range from 0 to 1.
As an example, here is a 2D slice (the grid shows the integer lattice):
All of the above functions have a vector version that take the same input parameters but return a vector as result. The output always has the same dimension than the input. If the time value is specified separately it does not count to the dimension. For example a call to vnoise((x,y,z)) returns a vec3, just as a call to vnoise((x,y,z),t). However, a call to vnoise((x,y,z,t)) returns a vec4.
See cellnoise().
See scellnoise().
See turbulence().