Upload
victor-lucas
View
220
Download
0
Tags:
Embed Size (px)
Citation preview
Noises & TurbulencesNoises & Turbulences
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
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
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?
• 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
Perlin Noise HistoryPerlin Noise History
• Tron 1981Tron 1981
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
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
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
• Most Simple = Most Simple = nn-linear-linear
1D linear1D linear 2D bilinear 2D bilinear
InterpolationsInterpolations
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
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)
• 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
2D Cubic Interpolations2D Cubic Interpolations
zero derivateszero derivates aligned derivates aligned derivates
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
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
Sharp Interpolations ExampleSharp Interpolations Example
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
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
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
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
→→ →→
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
Spot NoiseSpot Noise
• 1D spot noise function:1D spot noise function:
• Composition of spot function Composition of spot function hh((xx): ):
→→
Integral Noise Integral Noise
• nn-th integration of white noise-th integration of white noise
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))
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]
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
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
• 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
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
• ii = octave number (frequency = 2 = octave number (frequency = 2 ii))
Composing Perlin TurbulenceComposing Perlin Turbulence
1D Perlin Turbulence1D Perlin Turbulence
• Frequency self-similarityFrequency self-similarity• Not visually attractive in 1DNot visually attractive in 1D
2D Perlin Turbulence2D Perlin Turbulence
• Noise functions:Noise functions:
• Composition:Composition:
Perlin Turbulence ExamplePerlin Turbulence Example
• Direct visualizationDirect visualization– fractal terrainsfractal terrains– cloudsclouds
Turbulence Modulated ImagesTurbulence Modulated Images
• Image to modulate = clampImage to modulate = clamp• Turbulence used: 2D averaged noiseTurbulence used: 2D averaged noise
Perlin Turbulence CloudsPerlin Turbulence Clouds
→→
• Clamp = sin(y)Clamp = sin(y)• Perlin turbulencePerlin turbulence
smaller turbulence larger turbulencesmaller turbulence larger turbulence
MarbleMarble
WoodWood
• Clamp = rotation sineClamp = rotation sine• Brown paletteBrown palette
Other Turbulence ExamplesOther Turbulence Examples
FireFire
• 3D turbulence (2D + time) of a flame3D turbulence (2D + time) of a flame
Fire AnimationFire Animation
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