Simplex noise

Last updated
Simplex noise SimplexNoise2D.png
Simplex noise

Simplex noise is the result of an n-dimensional noise function comparable to Perlin noise ("classic" noise) but with fewer directional artifacts, in higher dimensions, and a lower computational overhead. Ken Perlin designed the algorithm in 2001 [1] to address the limitations of his classic noise function, especially in higher dimensions.

Contents

The advantages of simplex noise over Perlin noise:

Whereas classical noise interpolates between the gradients at the surrounding hypergrid end points (i.e., northeast, northwest, southeast and southwest in 2D[ citation needed ]), simplex noise divides the space into simplices (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 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.

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 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, 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*
n
lattice, which is essentially the vertex arrangement of a hypercubic honeycomb 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, (xb' = floor(x'), yb' = floor(y'), ...), and its internal coordinates (xi' = x'xb', yi' = y'yb', ...).

Simplicial subdivision

Once the above is determined, the values of the internal coordinate (xi', yi', ...) are sorted in decreasing order, to determine which skewed Schläfli orthoscheme 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 yi' coordinate is the largest, so it is added first. It is then followed by the xi' coordinate, and finally zi'.

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:

From there, each vertex's summed kernel contribution is determined using the expression

where r2 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.

Uses of implementations in 3D and higher for textured image synthesis were covered by U.S. patent 6,867,776 , if the algorithm were implemented using the specific techniques described in any of the patent claims, which expired on January 8, 2022.

See also

Related Research Articles

In elementary geometry, a polytope is a geometric object with flat sides (faces). Polytopes are the generalization of three-dimensional polyhedra to any number of dimensions. Polytopes may exist in any general number of dimensions n as an n-dimensional polytope or n-polytope. For example, a two-dimensional polygon is a 2-polytope and a three-dimensional polyhedron is a 3-polytope. In this context, "flat sides" means that the sides of a (k + 1)-polytope consist of k-polytopes that may have (k – 1)-polytopes in common.

<span class="mw-page-title-main">Tesseract</span> Four-dimensional analogue of the cube

In geometry, a tesseract or 4-cube is a four-dimensional hypercube, analogous to a two-dimensional square and a three-dimensional cube. Just as the perimeter of the square consists of four edges and the surface of the cube consists of six square faces, the hypersurface of the tesseract consists of eight cubical cells, meeting at right angles. The tesseract is one of the six convex regular 4-polytopes.

<span class="mw-page-title-main">Simplex</span> Multi-dimensional generalization of triangle

In geometry, a simplex 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. For example,

<span class="mw-page-title-main">Hypercube</span> Convex polytope, the n-dimensional analogue of a square and a cube

In geometry, a hypercube is an n-dimensional analogue of a square and a cube ; the special case for n = 4 is known as a tesseract. It is a closed, compact, convex figure whose 1-skeleton consists of groups of opposite parallel line segments aligned in each of the space's dimensions, perpendicular to each other and of the same length. A unit hypercube's longest diagonal in n dimensions is equal to .

<span class="mw-page-title-main">Simplicial complex</span> Mathematical set

In mathematics, a simplicial complex is a set composed of points, line segments, triangles, and their n-dimensional counterparts. Simplicial complexes should not be confused with the more abstract notion of a simplicial set appearing in modern simplicial homotopy theory. The purely combinatorial counterpart to a simplicial complex is an abstract simplicial complex. To distinguish a simplicial complex from an abstract simplicial complex, the former is often called a geometric simplicial complex.

<span class="mw-page-title-main">Perlin noise</span> Type of gradient noise in computer graphics

Perlin noise is a type of gradient noise developed by Ken Perlin in 1983. It has many uses, including but not limited to: procedurally generating terrain, applying pseudo-random changes to a variable, and assisting in the creation of image textures. It is most commonly implemented in two, three, or four dimensions, but can be defined for any number of dimensions.

<span class="mw-page-title-main">Regular polytope</span> Polytope with highest degree of symmetry

In mathematics, a regular polytope is a polytope whose symmetry group acts transitively on its flags, thus giving it the highest degree of symmetry. In particular, all its elements or j-faces — cells, faces and so on — are also transitive on the symmetries of the polytope, and are themselves regular polytopes of dimension jn.

<span class="mw-page-title-main">Barycentric subdivision</span>

In mathematics, the barycentric subdivision is a standard way to subdivide a given simplex into smaller ones. Its extension on simplicial complexes is a canonical method to refine them. Therefore, the barycentric subdivision is an important tool in algebraic topology.

<span class="mw-page-title-main">Cross-polytope</span> Regular polytope dual to the hypercube in any number of dimensions

In geometry, a cross-polytope, hyperoctahedron, orthoplex, staurotope, or cocube is a regular, convex polytope that exists in n-dimensional Euclidean space. A 2-dimensional cross-polytope is a square, a 3-dimensional cross-polytope is a regular octahedron, and a 4-dimensional cross-polytope is a 16-cell. Its facets are simplexes of the previous dimension, while the cross-polytope's vertex figure is another cross-polytope from the previous dimension.

<span class="mw-page-title-main">Abstract simplicial complex</span> Mathematical object

In combinatorics, an abstract simplicial complex (ASC), often called an abstract complex or just a complex, is a family of sets that is closed under taking subsets, i.e., every subset of a set in the family is also in the family. It is a purely combinatorial description of the geometric notion of a simplicial complex. For example, in a 2-dimensional simplicial complex, the sets in the family are the triangles, their edges, and their vertices.

In algebraic topology, simplicial homology is the sequence of homology groups of a simplicial complex. It formalizes the idea of the number of holes of a given dimension in the complex. This generalizes the number of connected components.

In mathematics, the discrete Laplace operator is an analog of the continuous Laplace operator, defined so that it has meaning on a graph or a discrete grid. For the case of a finite-dimensional graph, the discrete Laplace operator is more commonly called the Laplacian matrix.

<span class="mw-page-title-main">Real coordinate space</span> Space formed by the n-tuples of real numbers

In mathematics, the real coordinate space or real coordinate n-space, of dimension n, denoted Rn or , is the set of all ordered n-tuples of real numbers, that is the set of all sequences of n real numbers, also known as coordinate vectors. Special cases are called the real lineR1, the real coordinate planeR2, and the real coordinate three-dimensional spaceR3. With component-wise addition and scalar multiplication, it is a real vector space.

<span class="mw-page-title-main">Regular grid</span> Tessellation of Euclidean space

A regular grid is a tessellation of n-dimensional Euclidean space by congruent parallelotopes. Its opposite is irregular grid.

Simulation noise is a function that creates a divergence-free vector field. This signal can be used in artistic simulations for the purposes of increasing the perception of extra detail.

<span class="mw-page-title-main">Demihypercube</span> Polytope constructed from alternation of an hypercube

In geometry, demihypercubes (also called n-demicubes, n-hemicubes, and half measure polytopes) are a class of n-polytopes constructed from alternation of an n-hypercube, labeled as n for being half of the hypercube family, γn. Half of the vertices are deleted and new facets are formed. The 2n facets become 2n(n−1)-demicubes, and 2n(n−1)-simplex facets are formed in place of the deleted vertices.

Simplicial continuation, or piecewise linear continuation, is a one-parameter continuation method which is well suited to small to medium embedding spaces. The algorithm has been generalized to compute higher-dimensional manifolds by and.

In algebra, a multilinear polynomial is a multivariate polynomial that is linear in each of its variables separately, but not necessarily simultaneously. It is a polynomial in which no variable occurs to a power of 2 or higher; that is, each monomial is a constant times a product of distinct variables. For example f(x,y,z) = 3xy + 2.5 y - 7z is a multilinear polynomial of degree 2 whereas f(x,y,z) = x² +4y is not. The degree of a multilinear polynomial is the maximum number of distinct variables occurring in any monomial.

<span class="mw-page-title-main">Simplicial honeycomb</span> Tiling of n-dimensional space

In geometry, the simplicial honeycomb is a dimensional infinite series of honeycombs, based on the affine Coxeter group symmetry. It is represented by a Coxeter-Dynkin diagram as a cyclic graph of n + 1 nodes with one node ringed. It is composed of n-simplex facets, along with all rectified n-simplices. It can be thought of as an n-dimensional hypercubic honeycomb that has been subdivided along all hyperplanes , then stretched along its main diagonal until the simplices on the ends of the hypercubes become regular. The vertex figure of an n-simplex honeycomb is an expanded n-simplex.

<span class="mw-page-title-main">OpenSimplex noise</span> N-dimensional gradient noise function

OpenSimplex noise is an n-dimensional 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 characteristic of Perlin noise.

References

  1. Ken Perlin, Noise hardware. In Real-Time Shading SIGGRAPH Course Notes (2001), Olano M., (Ed.). (pdf)
  2. Ken Perlin, Making noise. Based on a talk presented at GDCHardcore (Dec 9, 1999). (url)
  3. "image processing - Why does increasing simplex noise dimension wash it out?". Computer Graphics Stack Exchange. Retrieved 2021-03-10.