42
Noises & Turbulences Noises & Turbulences

Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Embed Size (px)

Citation preview

Page 1: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Noises & TurbulencesNoises & Turbulences

Page 2: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Why Noises?Why Noises?

• One of the most popular procedural technique• Very few things in nature are regular • Great variety of noises exists• The simplest way = white noise:

out = random();– A very bad way of generating noise

• No memory• No spatial relation to anything• Not visually interesting

Page 3: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

What is Noise?What is Noise?

• Defined by Defined by noise functionnoise function

• RR →→ RR function functionstatistically invariant to translationstatistically invariant to translation

• RR22 → R→ R function function+ statistically invariant to rotationstatistically invariant to rotation

• Any Any RRnn → R→ R function function+ sharp frequency spectrumsharp frequency spectrum

Page 4: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Lattice NoisesLattice Noises

• Need to relate noise to space– Output = noise(point coord);

• Family of lattice noises:– Generate a 1D/2D/3D grid– Compute random values at grid points– Store values– During rendering: interpolate neighbors

• Questions to make a practical algorithm– What are the values at the nodes?– Interpolation strategy?

Page 5: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

• First noise in CGFirst noise in CG• Ken Perlin: Ken Perlin: An Image SynthesizerAn Image Synthesizer, 1985, 1985• Originally defined as a lattice gradient noiseOriginally defined as a lattice gradient noise• Interpolation dependentInterpolation dependent

different interpolation exampledifferent interpolation example

Perlin NoisePerlin Noise

Page 6: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Perlin Noise HistoryPerlin Noise History

• Tron 1981Tron 1981

Page 7: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Lattice Noise TypesLattice Noise Types

• Value noise– n-linear interpolation in between random values

• Gradient noise– Store gradient vectors in the nodes– Values are zero at the nodes

• Value-gradient noisea) weighted sum of value & gradientb) Hermite interpolation

• Lattice convolution noise– convolution interpolation

Page 8: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Value-Gradient ComparisonValue-Gradient Comparison

Value / ValGrad 0.25 / ValGrad 0.5 / ValGrad 0.75 / GradientValue / ValGrad 0.25 / ValGrad 0.5 / ValGrad 0.75 / Gradient

Page 9: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Ridged NoiseRidged Noise

Value / ValGrad 0.25 / ValGrad 0.5 / ValGrad 0.75 / GradientValue / ValGrad 0.25 / ValGrad 0.5 / ValGrad 0.75 / Gradient

Palette modulation used for interpolationPalette modulation used for interpolation

Page 10: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

• Most Simple = Most Simple = nn-linear-linear

1D linear1D linear 2D bilinear 2D bilinear

InterpolationsInterpolations

Page 11: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Interpolation Blending FunctionsInterpolation Blending Functions

• Linear interpolation on Linear interpolation on ff(0), (0), ff(1):(1):ff((xx) = (1-) = (1-xx) ) ff(0) + (0) + xx ff(1)(1)

uses blending functions (1-uses blending functions (1-xx), ), xx

• In general:In general:ff((xx) = u() = u(xx) ) ff(0) + v(x) (0) + v(x) ff(1)(1)

• Requirements on blending functions (Requirements on blending functions (xx 0,10,1))a)a) uu((xx) + ) + vv((xx) = 1) = 1

b)b) uu(0) = 1 (0) = 1 vv(0) = 0(0) = 0

c)c) uu(1) = 0(1) = 0 vv(1) = 1(1) = 1

Page 12: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Smooth InterpolationsSmooth Interpolations

• CC22 continuity = ? continuity = ?• Additional requirements on blending functionsAdditional requirements on blending functions• Null derivations:Null derivations:

d)d) uu’(0) = 0’(0) = 0 vv’(0) = 0’(0) = 0

e)e) uu’(1) = 0’(1) = 0 vv’(1) = 0’(1) = 0

• One Solution: Hermite cubics POne Solution: Hermite cubics P11, P, P44

• uu((xx) = 2) = 2xx33 + 3 + 3xx22 + 1 + 1• vv((xx) = -2) = -2xx33 + 3 + 3xx22

• ff((xx) = 2( ) = 2( ff(0) – (0) – ff(1) )x(1) )x33 + 3( + 3( ff(1) – (1) – ff(0) )(0) )22 + + ff(0)(0)

Page 13: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

• Zero derivates Zero derivates flats in lattice points flats in lattice points • Use derivates aligned to neighborsUse derivates aligned to neighbors

zero derivateszero derivates aligned derivates aligned derivates

1D Cubic Interpolations1D Cubic Interpolations

Page 14: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

2D Cubic Interpolations2D Cubic Interpolations

zero derivateszero derivates aligned derivates aligned derivates

Page 15: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Composed InterpolationsComposed Interpolations

• Blending in 1D: Blending in 1D: ff((xx) = (1-) = (1-xx) ) ff(0) + (0) + xx ff(1)(1)

• What about What about ff((xx) = (1-) = (1-xx) ) uu00((xx) + ) + xx uu11((xx) )

• Set requirementsSet requirements• Solution = smoothest cubic interpolationSolution = smoothest cubic interpolation

Page 16: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Cosine InterpolationCosine Interpolation

• Blending functionsBlending functions• uu((xx) = ( cos() = ( cos(xx) + 1) / 2) + 1) / 2• vv((xx) = ( 1 – cos() = ( 1 – cos(xx) ) / 2) ) / 2

• Slower computationSlower computation

Page 17: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Sharp Interpolations ExampleSharp Interpolations Example

Page 18: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Deformed Lattice InterpolationsDeformed Lattice Interpolations

• Radial interpolationRadial interpolation– ((rr, , ) coordinate system) coordinate system– radius, angleradius, angle– principle same as for ortho-latticesprinciple same as for ortho-lattices

Page 19: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Lattice Noises in 3DLattice Noises in 3D

• Stored lattice = memory consumptiveStored lattice = memory consumptive• Store onlyStore only

– 256 random values256 random values– Permutation tablePermutation table

• Referencing:Referencing:Value table index:

P[ ix+P[ iy+P[iz] ] ]

P - permutation table

• Suppressed periodic structureSuppressed periodic structure

Page 20: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Convolution NoisesConvolution Noises

1.1. Generate random latticeGenerate random lattice

2.2. Apply convolution filter until necessaryApply convolution filter until necessary• Gaussian convolutionGaussian convolution

• Values are averaged Values are averaged averaged noiseaveraged noise

K

1

9

1 1 1

1 1 1

1 1 1

Page 21: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Averaged NoiseAveraged Noise

• Control = number of iterationsControl = number of iterations

• Modifications: anisotropic filtersModifications: anisotropic filters

K

1

55

0 0 5 0 0

0 1 10 1 0

1 2 10 2 10

0

1

0

10

5

1

0

0

0

→→ →→

Page 22: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Other Noise TypesOther Noise Types

• Spot Noise (van Wijk, 1991)Spot Noise (van Wijk, 1991)• Sparse convolution noise (Lewis 1989)Sparse convolution noise (Lewis 1989)

– Interpolation of randomly located random valuesInterpolation of randomly located random values– Suppresses grid artifactsSuppresses grid artifacts

• fBm (Fractal Brownian Move)fBm (Fractal Brownian Move)– frequency basedfrequency based

• Integral NoiseIntegral Noise– noise(noise(xx) = ) = ff( noise(( noise(xx-1) )-1) )

• Voronoi NoiseVoronoi Noise

Page 23: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Spot NoiseSpot Noise

• 1D spot noise function:1D spot noise function:

• Composition of spot function Composition of spot function hh((xx): ):

→→

Page 24: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Integral Noise Integral Noise

• nn-th integration of white noise-th integration of white noise

Page 25: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Integral Noise AlgorithmIntegral Noise Algorithm

• Init: randomly generate Init: randomly generate ff(0), (0), ff11(0), … (0), … ffnn-1-1(0)(0)• In step In step xx::

0.0. ffnn(x) = random((x) = random(xx) ) ……i. i. f fii(x) = (x) = ffii((xx-1) + -1) + ffi+i+11((xx))……n.n. f f(x) = (x) = ff00(x)(x)n+1.n+1. remember remember ff((xx), ), ff11((xx), … ), … ffnn-1-1((xx))

• ffii(x) = (x) = ii-th derivate of -th derivate of ff((xx))

Page 26: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

2D Integral Noise Example2D Integral Noise Example

• Vertical, horizontal edge = 1D noiseVertical, horizontal edge = 1D noise• Inner points are zig-zag traversedInner points are zig-zag traversed• point[x,y] = composition of point[x-1,y] & point[x,y-1] point[x,y] = composition of point[x-1,y] & point[x,y-1]

Page 27: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Voronoi NoiseVoronoi Noise

1.1. Randomly distribute Randomly distribute nn points points

2.2. Visualize distance to the nearest neighbourVisualize distance to the nearest neighbour

Page 28: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

TurbulencesTurbulences

• Image modulation functionsImage modulation functions• Output = Output = ff( ( xx + turb( + turb(xx) )) )• Usual requirement = continuityUsual requirement = continuity• Modulation sourceModulation source

– Simple imageSimple image– Explicit functionExplicit function

Page 29: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

• Original function = identityOriginal function = identity

• Lower turbulence is 3 times greater than upperLower turbulence is 3 times greater than upper

1D Turbulence Example1D Turbulence Example

Page 30: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Perlin TurbulencePerlin Turbulence

• kk = smallest number satisfying = smallest number satisfying1/21/2kk+1+1 < pixel size < pixel size

• Sum of noise functionsSum of noise functions• Fractal character: Fractal character:

– doubling frequencydoubling frequency– Halving amplitudeHalving amplitude

• Noise function = Perlin noiseNoise function = Perlin noise

turb xnoise xi

ii

k

( )( )

2

20

Page 31: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

• ii = octave number (frequency = 2 = octave number (frequency = 2 ii))

Composing Perlin TurbulenceComposing Perlin Turbulence

Page 32: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

1D Perlin Turbulence1D Perlin Turbulence

• Frequency self-similarityFrequency self-similarity• Not visually attractive in 1DNot visually attractive in 1D

Page 33: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

2D Perlin Turbulence2D Perlin Turbulence

• Noise functions:Noise functions:

• Composition:Composition:

Page 34: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Perlin Turbulence ExamplePerlin Turbulence Example

• Direct visualizationDirect visualization– fractal terrainsfractal terrains– cloudsclouds

Page 35: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Turbulence Modulated ImagesTurbulence Modulated Images

• Image to modulate = clampImage to modulate = clamp• Turbulence used: 2D averaged noiseTurbulence used: 2D averaged noise

Page 36: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Perlin Turbulence CloudsPerlin Turbulence Clouds

→→

Page 37: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

• Clamp = sin(y)Clamp = sin(y)• Perlin turbulencePerlin turbulence

smaller turbulence larger turbulencesmaller turbulence larger turbulence

MarbleMarble

Page 38: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

WoodWood

• Clamp = rotation sineClamp = rotation sine• Brown paletteBrown palette

Page 39: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Other Turbulence ExamplesOther Turbulence Examples

Page 40: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

FireFire

• 3D turbulence (2D + time) of a flame3D turbulence (2D + time) of a flame

Page 41: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

Fire AnimationFire Animation

Page 42: Noises & Turbulences. Why Noises? One of the most popular procedural technique Very few things in nature are regular Great variety of noises exists The

LiteratureLiterature

• David Ebert, Kent Musgrave, Darwyn Peachey, David Ebert, Kent Musgrave, Darwyn Peachey, Ken Perlin, and Worley. Ken Perlin, and Worley. Texturing and Modeling: A Procedural Texturing and Modeling: A Procedural ApproachApproach. . Academic Press, October 1994. Academic Press, October 1994. ISBN 0-12-228760-6.ISBN 0-12-228760-6.

• Ken Perlin: www.noisemachine.com• Tons of examples on www