![SimplexNoise2D](https://upload.wikimedia.org/wikipedia/commons/5/54/SimplexNoise2D.png)
Simplex noise is the result of an ''n''-dimensional
noise
Noise is unwanted sound considered unpleasant, loud or disruptive to hearing. From a physics standpoint, there is no distinction between noise and desired sound, as both are vibrations through a medium, such as air or water. The difference arise ...
function comparable to
Perlin noise
Perlin noise is a type of gradient noise developed by Ken Perlin.
History
Ken Perlin developed Perlin noise in 1983 as a result of his frustration with the "machine-like" look of computer-generated imagery (CGI) at the time. He formally descr ...
("classic" noise) but with fewer
directional artifacts and, in higher dimensions, a lower computational overhead.
Ken Perlin
Kenneth H. Perlin is a professor in the Department of Computer Science at New York University, founding director of the Media Research Lab at NYU, director of the Future Reality Lab at NYU, and the Director of the Games for Learning Institute. He ...
designed the algorithm in 2001 to address the limitations of his classic noise function, especially in higher dimensions.
The advantages of simplex noise over Perlin noise:
* Simplex noise has lower computational complexity and requires fewer multiplications.
* Simplex noise scales to higher dimensions (4D, 5D) with much less computational cost: the complexity is
for
dimensions instead of the
of classic noise.
* Simplex noise has no noticeable directional artifacts (is visually
isotropic
Isotropy is uniformity in all orientations; it is derived . Precise definitions depend on the subject area. Exceptions, or inequalities, are frequently indicated by the prefix ' or ', hence ''anisotropy''. ''Anisotropy'' is also used to describe ...
), though noise generated for different dimensions is visually distinct (e.g. 2D noise has a different look than 2D slices of 3D noise, and it looks increasingly worse for higher dimensions
).
* Simplex noise has a well-defined and continuous gradient (almost) everywhere that can be computed quite cheaply.
* Simplex noise is easy to implement in hardware.
Whereas classical noise interpolates between the
gradients
In vector calculus, the gradient of a scalar-valued differentiable function of several variables is the vector field (or vector-valued function) \nabla f whose value at a point p is the "direction and rate of fastest increase". If the grad ...
at the surrounding hypergrid end points (i.e., northeast, northwest, southeast and southwest in 2D), simplex noise divides the space into
simplices
In geometry, a simplex (plural: simplexes or simplices) is a generalization of the notion of a triangle or tetrahedron to arbitrary dimensions. The simplex is so-named because it represents the simplest possible polytope in any given dimension. ...
(i.e.,
-dimensional triangles). This reduces the number of data points. While a hypercube in
dimensions has
corners, a simplex in
dimensions has only
corners. The triangles are
equilateral
In geometry, an equilateral triangle is a triangle in which all three sides have the same length. In the familiar Euclidean geometry, an equilateral triangle is also equiangular; that is, all three internal angles are also congruent to each othe ...
in 2D, but in higher dimensions the simplices are only approximately regular. For example, the tiling in the 3D case of the function is an orientation of the
tetragonal disphenoid honeycomb
The tetragonal disphenoid tetrahedral honeycomb is a space-filling tessellation (or honeycomb) in Euclidean 3-space made up of identical tetragonal disphenoidal cells. Cells are face-transitive with 4 identical isosceles triangle faces. John H ...
.
Simplex noise is useful for computer graphics applications, where noise is usually computed over 2, 3, 4, or possibly 5 dimensions. For higher dimensions, ''n''-spheres around ''n''-
simplex
In geometry, a simplex (plural: simplexes or simplices) is a generalization of the notion of a triangle or tetrahedron to arbitrary dimensions. The simplex is so-named because it represents the simplest possible polytope in any given dimension. ...
corners are not densely enough packed, reducing the support of the function and making it zero in large portions of space.
Algorithm detail
Simplex noise is most commonly implemented as a two-, three-, or four-dimensional
function
Function or functionality may refer to:
Computing
* Function key, a type of key on computer keyboards
* Function model, a structured representation of processes in a system
* Function object or functor or functionoid, a concept of object-oriente ...
, but can be defined for any number of dimensions. An implementation typically involves four steps: coordinate skewing, simplicial subdivision, gradient selection, and kernel summation.
Coordinate skewing
An input coordinate is transformed using the formula
:
:
:
where
:
This has the effect of placing the coordinate on an ''A'' lattice, which is essentially the
vertex arrangement
In geometry, a vertex arrangement is a set of points in space described by their relative positions. They can be described by their use in polytopes.
For example, a ''square vertex arrangement'' is understood to mean four points in a plane, equ ...
of a
hypercubic honeycomb
In geometry, a hypercubic honeycomb is a family of regular honeycombs (tessellations) in -dimensional spaces with the Schläfli symbols and containing the symmetry of Coxeter group (or ) for .
The tessellation is constructed from 4 -hypercube ...
that has been squashed along its main diagonal until the distance between the points (0, 0, ..., 0) and (1, 1, ..., 1) becomes equal to the distance between the points (0, 0, ..., 0) and (1, 0, ..., 0).
The resulting coordinate (''x'', ''y'', ...) is then used in order to determine which skewed unit hypercube cell the input point lies in, (''x
b'' = floor(''x''), ''y
b'' = floor(''y''), ...), and its internal coordinates (''x
i'' = ''x'' − ''x
b'', ''y
i'' = ''y'' − ''y
b'', ...).
Simplicial subdivision
Once the above is determined, the values of the internal coordinate (''x
i'', ''y
i'', ...) are sorted in decreasing order, to determine which skewed
Schläfli orthoscheme
In geometry, a Schläfli orthoscheme is a type of simplex. The orthoscheme is the generalization of the right triangle to simplex figures of any number of dimensions. Orthoschemes are defined by a sequence of edges (v_0v_1), (v_1v_2), \dots, (v_v ...
simplex the point lies in. Then the resulting simplex is composed of the vertices corresponding to an ordered edge traversal from (0, 0, ..., 0) to (1, 1, ..., 1), of which there are ''n''! possibilities, each of which corresponds to a single permutation of the coordinate. In other words, start with the zero coordinate and successively add-ones starting in the value corresponding to the largest internal coordinate's value, ending with the smallest.
For example, the point (0.4, 0.5, 0.3) would lie inside the simplex with vertices (0, 0, 0), (0, 1, 0), (1, 1, 0), (1, 1, 1). The ''y
i'' coordinate is the largest, so it is added first. It is then followed by the ''x
i'' coordinate, and finally ''z
i''.
Gradient selection
Each simplex vertex is added back to the skewed hypercube's base coordinate and hashed into a pseudo-random gradient direction. The hash can be implemented in numerous ways, though most often uses a permutation table or a bit manipulation scheme.
Care should be taken in the selection of the set of gradients to include, to keep directional artifacts to a minimum.
Kernel summation
The contribution from each of the ''n'' + 1 vertices of the simplex is factored in by a summation of radially symmetric kernels centered around each vertex. First, the unskewed coordinate of each of the vertices is determined using the inverse formula
:
:
:
where
:
This point is subtracted from the input coordinate to obtain the unskewed displacement vector. This unskewed displacement vector is used for two purposes:
* To compute the extrapolated gradient value using a
dot product
In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a scalar as a result". It is also used sometimes for other symmetric bilinear forms, for example in a pseudo-Euclidean space. is an algebra ...
.
* To determine ''d''
2, the squared distance to the point.
From there, each vertex's summed kernel contribution is determined using the equation
:
where ''r''
2 is usually set to either 0.5 or 0.6: the value 0.5 ensures no discontinuities, whereas 0.6 may increase visual quality in applications for which the discontinuities are not noticeable; 0.6 was used in Ken Perlin's original reference implementation.
Legal status
Uses of implementations in ''3D and higher'' for ''textured image synthesis'' were covered by , if the algorithm were implemented using the specific techniques described in any of the patent claims, which expired on January 8, 2022.
See also
*
OpenSimplex noise
OpenSimplex noise is an n-dimensional (up to 4D) gradient noise function that was developed in order to overcome the patent-related issues surrounding simplex noise, while likewise avoiding the visually-significant directional artifacts characte ...
*
Isotropy
Isotropy is uniformity in all orientations; it is derived . Precise definitions depend on the subject area. Exceptions, or inequalities, are frequently indicated by the prefix ' or ', hence ''anisotropy''. ''Anisotropy'' is also used to describe ...
References
External links
Short technical article with source code by Stefan Gustavson(PDF)
Another implementation of Simplex Noise in C++ (SimplexNoise1234)
{{Noise
Noise (graphics)
Computer graphic techniques