Enum anl::BasisType
[−]
[src]
pub enum BasisType { Value, Gradient, Gradval, Simplex, White, }
Basis function types.
Variants
Value
Value
represents value noise which is generated by assigning a pseudo-random value in the range (-1,1) to every lattice point in the integral grid, then interpolating the corner values of the conceptual "cell" in which an input coordinate location is enclosed.
Gradient
Gradient
represents Perlin's original noise function. It is similar to VALUE noise in that values are assigned to each lattice point and interpolated; however; the values are calculated as the evaluation of a wavelet function centered on the lattice point. The result is smoother and with fewer grid artifacts. Gradient noise has the effect that the lattice wavelets evaluate to 0 at the lattice points, so the gradient function evaluates to 0 at all integral points in the grid, a fact that can have consequences in some applications, resulting in the appearance of grid-oriented artifacts.
Gradval
Gradval
is a hybrid calculated as the sum of GRADIENT and VALUE noises, and is an attempt to "hide" the grid-oriented artifacts that sometimes arise from GRADIENT noise alone. While the method does fix the problem of lattice points evaluating to 0, since both Gradval
and Value
are tied to the grid, artifacts can still occur. See Figure 3 for an example of Gradval
noise.
Simplex
Simplex
is a form of Perlin's improved noise function. Rather than interpolating the edges of a conceptual hyper-cube in N-dimensional space to obtain the noise value, simplex noise calculates a weighted sum of values assigned to the vertices of an N-dimensional "simplex". A "simplex" is the term for the simplest shape that can tile a given N-dimensional shape. For a 2D space, the simplex is an equilateral triangle. For the 3D space, it is a tetrahedron. Because a simplex has fewer vertices than the corresponding grid shape of the space, fewer calculations per sample point are required for simplex noise than for gradient or value noises. However, since simplex noise is calculated as a weighted sum of vertex contributions, rather than as an interpolation of lattice corners, simplex noise will ignore the interptype parameter passed in the constructor or via the setInterp() method. Since the size of an N-space's simplex is smaller than the corresponding unit of a grid lattice, simplex noise appears "denser" across a given region than gradient or value noise, a fact that should be taken into consideration. Simplex noise goes a long way toward reducing the appearance of grid-aligned artifacts. However, the noise is still aligned on a lattice structure, so artifacts are still there, noticeable or not. They often show up as diagonal lines slanting across the function.
White
White
noise is a representation of chaotic, random noise. Whereas the previous variants have all generated what is called a "continuously random" signal, WHITE noise generates a truly chaotic signal with no pattern at all.
Trait Implementations
impl Clone for BasisType
[src]
fn clone(&self) -> BasisType
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more