Simulation noise: Difference between revisions

Content deleted Content added
Described how to get three of the most used instances of simulation noise
Atomvinter (talk | contribs)
 
(9 intermediate revisions by 4 users not shown)
Line 1:
{{Short description|Section of maths dealing with creating simulations}}
'''Simulation noise''' is a [[function (mathematics)|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.
{{No footnotes|date=October 2024}}
 
'''Simulation noise''' is a [[function (mathematics)|function]] that creates a [[divergence-free]] vector field. This signal can be used in artistic simulations for the purposespurpose of increasing the perception of extra detail.
 
The function can be calculated in three dimensions by dividing the space into a regular lattice grid. With each edge is associated a random value, indicating a rotational component of material revolving around the edge. By following rotating material into and out of faces, one can quickly sum the flux passing through each face of the lattice. Flux values at lattice faces are then interpolated to create a field value for all positions.
Line 9 ⟶ 12:
Other approaches developed later that use vector calculus identities to produce divergence free fields, such as "Curl-Noise" as suggested by Robert Bridson, and "Divergence-Free Noise" due to Ivan DeWolf. These often require calculation of lattice noise gradients, which sometimes are not readily available. A naive implementation would call a lattice noise function several times to calculate its gradient, resulting in more computation than is strictly necessary. Unlike these noises, simulation noise has a geometric rationale in addition to its mathematical properties. It simulates vortices scattered in space, to produce its pleasing aesthetic.
 
== Curl Noisenoise ==
The vector field esis created as follows, for eveyevery point (x,y,z) in the space a vector field '''G''' is created as follow, every component x, y and z of the vector field '''(Gx, Gy, Gz)''' is defined by a 3D perlin or simplex noise function depending onwith x, y and z as parameters. The partial derivative of Gx, Gy, and Gz respect to x, y and z is obtained with the gradient of the perlin or simplex noise by finite diferencesdifferences of implicit calculation inside the simplex noise.
 
The partial derivatives are used to calculate '''F''' as the curl of '''G''' given by
 
<math>F = (\frac{\partial Gz}{\partial y} - \frac{\partial Gy}{\partial z} ,\frac{\partial Gx}{\partial z} - \frac{\partial Gz}{\partial x},\frac{\partial Gy}{\partial x} - \frac{\partial Gx}{\partial y})</math>
 
== Bitangent Noisenoise ==
This method is based in the fact that the curl of the gradient of scalar field is zero and the identity that expand the divergence of a cross product of two vectors '''A''' and '''B''' as the difference of the dot products of each vector with the curl of the other:
 
<math>\nabla \times ( \nabla \varphi ) = \mathbf{0}.</math>
Line 25 ⟶ 28:
\,-\, \mathbf{A} \cdot (\nabla {\times} \mathbf{B})</math>
 
which means that if the divergencecurl of both vector fields is zero then the productdivergence of twothe gradientsproduct of scalartwo fieldsvectors isthat zero ifare the curlgradients of both vectorscalar fields is zero too. This result in a divergence free vector field by construction only calling 2two noise functions to create the scalar fields.
 
The vector field es created as follows, two scalar fields are calculated <math>\phi</math> and <math>\psi</math> using 3D perlin or simplex noise functions, then the gradients '''A''' and '''B''' of each of this fields is calculated, the cross product of '''A''' and '''B''' gives a divergence free vector field.
 
== Signed Distancedistance Noisenoise ==
The vector field is created based on the implicit equation of a closed and differentiable implicit surface '''S = F'''(x,y,z) = 0. For every point in the space, frecuentlyfrequently outside or near the surface, we get a normalvector '''ng''' that is normal to the surface is calculated, this is calculated the samegradient wayof asS the distance signed funcion, usingor the partial derivatives divided by the distancerespect to thex, surface.y Outsideand ofz, thethis surface all these normals point away from the surface. After that a scalar value pvector is calculatednot forunitary, thatbut pointwe incan the space usingget a 3Dunitary perlin or simplex noise function. Now we create a vector fieldnormal '''F''' = p'''n''' pointingby outsidedividing of the surface. Then theeach curlcomponent of this vector field gives the direction in every point inby the spacemagnitude whereof the particlesgradient should move'''g'''. ByOutside constructionof ohthe thissurface vectorsall Fthese willnormals point inaway a tangen direction to a isosurface given byfrom the same signed distance to the original surface. and can be used to confine the movements of each particle to stay in that surface
 
<math>
g=\nabla F(x, y, z) = \left(\frac{\partial F}{\partial x}, \frac{\partial F}{\partial y}, \frac{\partial F}{\partial z}\right)</math>
 
<math>
\mathbf{n} = \frac{g(x, y, z)}{\|\nabla F(x, y, z)\|}
</math>
 
<math>
\|\nabla F(x, y, z)\| = \sqrt{\left(\frac{\partial F}{\partial x}\right)^2 + \left(\frac{\partial F}{\partial y}\right)^2 + \left(\frac{\partial F}{\partial z}\right)^2}
</math>
 
Afterwards we calculate a scalar value p for that point in the space using a 3D perlin or simplex noise function. Now we create a vector field '''V''' = p'''n''' pointing outside of the surface. The curl of this vector field gives the direction in every point in the space where the particles should move.
 
<math>SDN = (\frac{\partial Vz}{\partial y} - \frac{\partial Vy}{\partial z} ,\frac{\partial Vx}{\partial z} - \frac{\partial Vz}{\partial x},\frac{\partial Vy}{\partial x} - \frac{\partial Vx}{\partial y})</math>
 
By construction this vector SDN will point in a tangent direction to an isosurface at the level of the signed distance to the original surface and can be used to confine the movements of the particles to stay in that surface.
 
 
 
== References ==
==Further reading==
*Patel, M & Taylor, N. December 2005. [https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.611.9001&rep=rep1&type=pdf Simple Divergence-Free Fields for Artistic Simulation]. ''[[Journal of Graphics Tools]]'', Volume 10, Number 4.
*Ivan DeWolf. 2005. [https://www.academia.edu/18125534/Divergence_Free_Noise Divergence-Free Noise].
 
{{Noise}}