Modified Noise for Evaluation on Graphics Hardware Marc Olano - - PowerPoint PPT Presentation

modified noise for evaluation on graphics hardware
SMART_READER_LITE
LIVE PREVIEW

Modified Noise for Evaluation on Graphics Hardware Marc Olano - - PowerPoint PPT Presentation

Introduction & Background Modifications Conclusion Modified Noise for Evaluation on Graphics Hardware Marc Olano Computer Science and Electrical Engineering University of Maryland, Baltimore County Graphics Hardware 2005 Introduction


slide-1
SLIDE 1

Introduction & Background Modifications Conclusion

Modified Noise for Evaluation on Graphics Hardware

Marc Olano

Computer Science and Electrical Engineering University of Maryland, Baltimore County

Graphics Hardware 2005

slide-2
SLIDE 2

Introduction & Background Modifications Conclusion

Outline

Introduction & Background Modifications Conclusion

slide-3
SLIDE 3

Introduction & Background Modifications Conclusion

Outline

Introduction & Background Noise? Perlin noise Modifications Conclusion

slide-4
SLIDE 4

Introduction & Background Modifications Conclusion

Why Noise?

  • Introduced by [Perlin, 1985]
  • Heavily used in production animation
  • Technical Achievement Oscar in 1997
  • “Salt,” adds spice to shaders
slide-5
SLIDE 5

Introduction & Background Modifications Conclusion

Why Noise?

  • Introduced by [Perlin, 1985]
  • Heavily used in production animation
  • Technical Achievement Oscar in 1997
  • “Salt,” adds spice to shaders

+ =

slide-6
SLIDE 6

Introduction & Background Modifications Conclusion

Noise Characteristics

  • Random
  • No correlation between distant values
  • Repeatable/deterministic
  • Same argument always produces same value
  • Band-limited
  • Most energy in one octave (e.g. between f & 2f)

1 2 3 4 5 6 7

slide-7
SLIDE 7

Introduction & Background Modifications Conclusion

Noise Characteristics

  • Random
  • No correlation between distant values
  • Repeatable/deterministic
  • Same argument always produces same value
  • Band-limited
  • Most energy in one octave (e.g. between f & 2f)

1 2 3 4 5 6 7

slide-8
SLIDE 8

Introduction & Background Modifications Conclusion

Noise Characteristics

  • Random
  • No correlation between distant values
  • Repeatable/deterministic
  • Same argument always produces same value
  • Band-limited
  • Most energy in one octave (e.g. between f & 2f)

1 2 3 4 5 6 7

slide-9
SLIDE 9

Introduction & Background Modifications Conclusion

Gradient Noise

  • Original Perlin noise [Perlin, 1985]
  • Perlin Improved noise [Perlin, 2002]
  • Lattice based
  • Value=0 at integer lattice points
  • Gradient defined at integer lattice
  • Interpolate between
  • 1/2 to 1 cycle each unit

1 2 3 4 5 6 7 1 2 3 4 5 6 7

Original Improved

slide-10
SLIDE 10

Introduction & Background Modifications Conclusion

Gradient Noise

  • Original Perlin noise [Perlin, 1985]
  • Perlin Improved noise [Perlin, 2002]
  • Lattice based
  • Value=0 at integer lattice points
  • Gradient defined at integer lattice
  • Interpolate between
  • 1/2 to 1 cycle each unit

1 2 3 4 5 6 7 1 2 3 4 5 6 7

Original Improved

slide-11
SLIDE 11

Introduction & Background Modifications Conclusion

Gradient Noise

  • Original Perlin noise [Perlin, 1985]
  • Perlin Improved noise [Perlin, 2002]
  • Lattice based
  • Value=0 at integer lattice points
  • Gradient defined at integer lattice
  • Interpolate between
  • 1/2 to 1 cycle each unit

1 2 3 4 5 6 7 1 2 3 4 5 6 7

Original Improved

slide-12
SLIDE 12

Introduction & Background Modifications Conclusion

Value Noise

  • Lattice based
  • Value defined at integer lattice points
  • Interpolate between
  • At most 1/2 cycle each unit
  • Significant low-frequency content
  • Easy hardware implementation with lower quality

1 2 3 4 5 6 7 1 2 3 4 5 6 7

Linear Interp Cubic Interp

slide-13
SLIDE 13

Introduction & Background Modifications Conclusion

Value Noise

  • Lattice based
  • Value defined at integer lattice points
  • Interpolate between
  • At most 1/2 cycle each unit
  • Significant low-frequency content
  • Easy hardware implementation with lower quality

1 2 3 4 5 6 7 1 2 3 4 5 6 7

Linear Interp Cubic Interp

slide-14
SLIDE 14

Introduction & Background Modifications Conclusion

Value Noise

  • Lattice based
  • Value defined at integer lattice points
  • Interpolate between
  • At most 1/2 cycle each unit
  • Significant low-frequency content
  • Easy hardware implementation with lower quality

1 2 3 4 5 6 7 1 2 3 4 5 6 7

Linear Interp Cubic Interp

slide-15
SLIDE 15

Introduction & Background Modifications Conclusion

Value Noise

  • Lattice based
  • Value defined at integer lattice points
  • Interpolate between
  • At most 1/2 cycle each unit
  • Significant low-frequency content
  • Easy hardware implementation with lower quality

1 2 3 4 5 6 7 1 2 3 4 5 6 7

Linear Interp Cubic Interp

slide-16
SLIDE 16

Introduction & Background Modifications Conclusion

Hardware Noise

  • Value noise
  • PixelFlow [Lastra et al., 1995]
  • Perlin Noise Pixel Shaders [Hart, 2001]
  • Noise textures
  • Gradient noise
  • Hardware [Perlin, 2001]
  • Complex composition [Perlin, 2004]
  • Shader implementation [Green, 2005]
slide-17
SLIDE 17

Introduction & Background Modifications Conclusion

Noise Details

  • Subclass of gradient noise
  • Original Perlin
  • Perlin Improved
  • All of our proposed modifications
slide-18
SLIDE 18

Introduction & Background Modifications Conclusion

Find the Lattice

  • Lattice-based noise: must find nearest lattice points
  • Point

p = ( px, py, pz)

  • has integer lattice location
  • pi = (⌊

px⌋, ⌊ py⌋, ⌊ pz⌋) = (X, Y , Z)

  • and fractional location in cell
  • pf =

p − pi = (x, y, z)

slide-19
SLIDE 19

Introduction & Background Modifications Conclusion

Find the Lattice

  • Lattice-based noise: must find nearest lattice points
  • Point

p = ( px, py, pz)

  • has integer lattice location
  • pi = (⌊

px⌋, ⌊ py⌋, ⌊ pz⌋) = (X, Y , Z)

  • and fractional location in cell
  • pf =

p − pi = (x, y, z)

slide-20
SLIDE 20

Introduction & Background Modifications Conclusion

Find the Lattice

  • Lattice-based noise: must find nearest lattice points
  • Point

p = ( px, py, pz)

  • has integer lattice location
  • pi = (⌊

px⌋, ⌊ py⌋, ⌊ pz⌋) = (X, Y , Z)

  • and fractional location in cell
  • pf =

p − pi = (x, y, z)

X Y

slide-21
SLIDE 21

Introduction & Background Modifications Conclusion

Find the Lattice

  • Lattice-based noise: must find nearest lattice points
  • Point

p = ( px, py, pz)

  • has integer lattice location
  • pi = (⌊

px⌋, ⌊ py⌋, ⌊ pz⌋) = (X, Y , Z)

  • and fractional location in cell
  • pf =

p − pi = (x, y, z)

x y X Y

slide-22
SLIDE 22

Introduction & Background Modifications Conclusion

Gradient

  • Random vector at each lattice point is a function of

pi g( pi)

  • A function with that gradient

grad( p) = g( pi) • pf = gx( pi) ∗ x + gy( pi) ∗ y + gz( pi) ∗ z

slide-23
SLIDE 23

Introduction & Background Modifications Conclusion

Gradient

  • Random vector at each lattice point is a function of

pi g( pi)

  • A function with that gradient

grad( p) = g( pi) • pf = gx( pi) ∗ x + gy( pi) ∗ y + gz( pi) ∗ z

slide-24
SLIDE 24

Introduction & Background Modifications Conclusion

Gradient

  • Random vector at each lattice point is a function of

pi g( pi)

  • A function with that gradient

grad( p) = g( pi) • pf = gx( pi) ∗ x + gy( pi) ∗ y + gz( pi) ∗ z

slide-25
SLIDE 25

Introduction & Background Modifications Conclusion

Interpolate

  • Interpolate nearest 2n gradient functions
  • 2D noise(

p) is influenced by

  • pi + (0, 0) ;

pi + (0, 1) ; pi + (1, 0) ; pi + (1, 1)

  • Linear interpolation
  • lerp(t, a, b) = (1 − t) a + t b
  • Smooth interpolation
  • fade(t) =
  • 3t2 − 2t3

for original noise 10t3 − 15t4 + 6t5 for improved noise

  • flerp(t, a, b) = lerp(fade(t), a, b)
slide-26
SLIDE 26

Introduction & Background Modifications Conclusion

Interpolate

  • Interpolate nearest 2n gradient functions
  • 2D noise(

p) is influenced by

  • pi + (0, 0) ;

pi + (0, 1) ; pi + (1, 0) ; pi + (1, 1)

  • Linear interpolation
  • lerp(t, a, b) = (1 − t) a + t b
  • Smooth interpolation
  • fade(t) =
  • 3t2 − 2t3

for original noise 10t3 − 15t4 + 6t5 for improved noise

  • flerp(t, a, b) = lerp(fade(t), a, b)
slide-27
SLIDE 27

Introduction & Background Modifications Conclusion

Interpolate

  • Interpolate nearest 2n gradient functions
  • 2D noise(

p) is influenced by

  • pi + (0, 0) ;

pi + (0, 1) ; pi + (1, 0) ; pi + (1, 1)

  • Linear interpolation
  • lerp(t, a, b) = (1 − t) a + t b
  • Smooth interpolation
  • fade(t) =
  • 3t2 − 2t3

for original noise 10t3 − 15t4 + 6t5 for improved noise

  • flerp(t, a, b) = lerp(fade(t), a, b)
slide-28
SLIDE 28

Introduction & Background Modifications Conclusion

Interpolate

  • Interpolate nearest 2n gradient functions
  • 2D noise(

p) is influenced by

  • pi + (0, 0) ;

pi + (0, 1) ; pi + (1, 0) ; pi + (1, 1)

  • Linear interpolation
  • lerp(t, a, b) = (1 − t) a + t b
  • Smooth interpolation
  • fade(t) =
  • 3t2 − 2t3

for original noise 10t3 − 15t4 + 6t5 for improved noise

  • flerp(t, a, b) = lerp(fade(t), a, b)
slide-29
SLIDE 29

Introduction & Background Modifications Conclusion

Interpolate

  • Interpolate nearest 2n gradient functions
  • 2D noise(

p) is influenced by

  • pi + (0, 0) ;

pi + (0, 1) ; pi + (1, 0) ; pi + (1, 1)

  • Linear interpolation
  • lerp(t, a, b) = (1 − t) a + t b
  • Smooth interpolation
  • fade(t) =
  • 3t2 − 2t3

for original noise 10t3 − 15t4 + 6t5 for improved noise

  • flerp(t, a, b) = lerp(fade(t), a, b)
slide-30
SLIDE 30

Introduction & Background Modifications Conclusion

Interpolate

  • Interpolate nearest 2n gradient functions
  • 2D noise(

p) is influenced by

  • pi + (0, 0) ;

pi + (0, 1) ; pi + (1, 0) ; pi + (1, 1)

  • Linear interpolation
  • lerp(t, a, b) = (1 − t) a + t b
  • Smooth interpolation
  • fade(t) =
  • 3t2 − 2t3

for original noise 10t3 − 15t4 + 6t5 for improved noise

  • flerp(t, a, b) = lerp(fade(t), a, b)
slide-31
SLIDE 31

Introduction & Background Modifications Conclusion

Interpolate

  • Interpolate nearest 2n gradient functions
  • 2D noise(

p) is influenced by

  • pi + (0, 0) ;

pi + (0, 1) ; pi + (1, 0) ; pi + (1, 1)

  • Linear interpolation
  • lerp(t, a, b) = (1 − t) a + t b
  • Smooth interpolation
  • fade(t) =
  • 3t2 − 2t3

for original noise 10t3 − 15t4 + 6t5 for improved noise

  • flerp(t, a, b) = lerp(fade(t), a, b)
slide-32
SLIDE 32

Introduction & Background Modifications Conclusion

Interpolate

  • Interpolate nearest 2n gradient functions
  • 2D noise(

p) is influenced by

  • pi + (0, 0) ;

pi + (0, 1) ; pi + (1, 0) ; pi + (1, 1)

  • Linear interpolation
  • lerp(t, a, b) = (1 − t) a + t b
  • Smooth interpolation
  • fade(t) =
  • 3t2 − 2t3

for original noise 10t3 − 15t4 + 6t5 for improved noise

  • flerp(t, a, b) = lerp(fade(t), a, b)
slide-33
SLIDE 33

Introduction & Background Modifications Conclusion

Interpolate

  • Interpolate nearest 2n gradient functions
  • 2D noise(

p) is influenced by

  • pi + (0, 0) ;

pi + (0, 1) ; pi + (1, 0) ; pi + (1, 1)

  • Linear interpolation
  • lerp(t, a, b) = (1 − t) a + t b
  • Smooth interpolation
  • fade(t) =
  • 3t2 − 2t3

for original noise 10t3 − 15t4 + 6t5 for improved noise

  • flerp(t, a, b) = lerp(fade(t), a, b)
slide-34
SLIDE 34

Introduction & Background Modifications Conclusion

Interpolate

  • Interpolate nearest 2n gradient functions
  • 2D noise(

p) is influenced by

  • pi + (0, 0) ;

pi + (0, 1) ; pi + (1, 0) ; pi + (1, 1)

  • Linear interpolation
  • lerp(t, a, b) = (1 − t) a + t b
  • Smooth interpolation
  • fade(t) =
  • 3t2 − 2t3

for original noise 10t3 − 15t4 + 6t5 for improved noise

  • flerp(t, a, b) = lerp(fade(t), a, b)
slide-35
SLIDE 35

Introduction & Background Modifications Conclusion

Hash

  • n-D gradient function built from 1D components

g( pi)

  • Both original and improved use a permutation table hash
  • Original: g is a table of unit vectors
  • Improved: g is derived from bits of final hash
slide-36
SLIDE 36

Introduction & Background Modifications Conclusion

Hash

  • n-D gradient function built from 1D components

g(hash(X, Y , Z))

  • Both original and improved use a permutation table hash
  • Original: g is a table of unit vectors
  • Improved: g is derived from bits of final hash
slide-37
SLIDE 37

Introduction & Background Modifications Conclusion

Hash

  • n-D gradient function built from 1D components

g(hash(Z + hash(Y + hash(X))))

  • Both original and improved use a permutation table hash
  • Original: g is a table of unit vectors
  • Improved: g is derived from bits of final hash
slide-38
SLIDE 38

Introduction & Background Modifications Conclusion

Hash

  • n-D gradient function built from 1D components

g(hash(Z + hash(Y + hash(X))))

  • Both original and improved use a permutation table hash
  • Original: g is a table of unit vectors
  • Improved: g is derived from bits of final hash
slide-39
SLIDE 39

Introduction & Background Modifications Conclusion

Hash

  • n-D gradient function built from 1D components

g(hash(Z + hash(Y + hash(X))))

  • Both original and improved use a permutation table hash
  • Original: g is a table of unit vectors
  • Improved: g is derived from bits of final hash
slide-40
SLIDE 40

Introduction & Background Modifications Conclusion

Outline

Introduction & Background Modifications Corner Gradients Factorization Hash Conclusion

slide-41
SLIDE 41

Introduction & Background Modifications Conclusion

Gradient Vectors of n-D Noise

  • Original: on the surface of a n-sphere
  • Found by hash of

pi into gradient table

  • Improved: at the edges of an n-cube
  • Found by decoding bits of hash of

pi

slide-42
SLIDE 42

Introduction & Background Modifications Conclusion

Gradient Vectors of n-D Noise

  • Original: on the surface of a n-sphere
  • Found by hash of

pi into gradient table

  • Improved: at the edges of an n-cube
  • Found by decoding bits of hash of

pi

slide-43
SLIDE 43

Introduction & Background Modifications Conclusion

Gradients of noise(x,y,0) or noise(x,0)

  • Why?
  • Cheaper low-D noise matches slice of higher-D
  • Reuse textures (for full noise or partial computation)
  • Original: new short gradient vectors
  • Improved: gradients in new directions
  • Possibly including 0 gradient vector!
slide-44
SLIDE 44

Introduction & Background Modifications Conclusion

Gradients of noise(x,y,0) or noise(x,0)

  • Why?
  • Cheaper low-D noise matches slice of higher-D
  • Reuse textures (for full noise or partial computation)
  • Original: new short gradient vectors
  • Improved: gradients in new directions
  • Possibly including 0 gradient vector!
slide-45
SLIDE 45

Introduction & Background Modifications Conclusion

Gradients of noise(x,y,0) or noise(x,0)

  • Why?
  • Cheaper low-D noise matches slice of higher-D
  • Reuse textures (for full noise or partial computation)
  • Original: new short gradient vectors
  • Improved: gradients in new directions
  • Possibly including 0 gradient vector!
slide-46
SLIDE 46

Introduction & Background Modifications Conclusion

Solution?

  • Observe: use gradient function, not vector alone

grad = gx x + gy y + gz z

  • In any integer plane, fractional z = 0

grad = gx x + gy y + 0

  • Any choice keeping projection of vectors the same will work
  • Improved noise uses cube edge centers
  • Instead use cube corners!
slide-47
SLIDE 47

Introduction & Background Modifications Conclusion

Solution?

  • Observe: use gradient function, not vector alone

grad = gx x + gy y + gz z

  • In any integer plane, fractional z = 0

grad = gx x + gy y + 0

  • Any choice keeping projection of vectors the same will work
  • Improved noise uses cube edge centers
  • Instead use cube corners!
slide-48
SLIDE 48

Introduction & Background Modifications Conclusion

Solution?

  • Observe: use gradient function, not vector alone

grad = gx x + gy y + gz z

  • In any integer plane, fractional z = 0

grad = gx x + gy y + 0

  • Any choice keeping projection of vectors the same will work
  • Improved noise uses cube edge centers
  • Instead use cube corners!
slide-49
SLIDE 49

Introduction & Background Modifications Conclusion

Solution?

  • Observe: use gradient function, not vector alone

grad = gx x + gy y + gz z

  • In any integer plane, fractional z = 0

grad = gx x + gy y + 0

  • Any choice keeping projection of vectors the same will work
  • Improved noise uses cube edge centers
  • Instead use cube corners!
slide-50
SLIDE 50

Introduction & Background Modifications Conclusion

Solution?

  • Observe: use gradient function, not vector alone

grad = gx x + gy y + gz z

  • In any integer plane, fractional z = 0

grad = gx x + gy y + 0

  • Any choice keeping projection of vectors the same will work
  • Improved noise uses cube edge centers
  • Instead use cube corners!
slide-51
SLIDE 51

Introduction & Background Modifications Conclusion

Corner Gradients

  • Simple binary selection from hash bits

±x, ±y, ±z

  • Perlin mentions “clumping” for corner gradient selection
  • Not very noticeable in practice
  • Already happens in any integer plane of improved noise
slide-52
SLIDE 52

Introduction & Background Modifications Conclusion

Corner Gradients

  • Simple binary selection from hash bits

±x, ±y, ±z

  • Perlin mentions “clumping” for corner gradient selection
  • Not very noticeable in practice
  • Already happens in any integer plane of improved noise

Edge Centers Corner

slide-53
SLIDE 53

Introduction & Background Modifications Conclusion

Separable Computation

  • Like to store computation in texture
  • Texture sampling 3-4x highest frequency
  • 1D & 2D OK size, 3D gets big, 4D impossible
  • Factor into lower-D textures
  • (e.g. write noise(

px, py, pz) as several x/y terms)

slide-54
SLIDE 54

Introduction & Background Modifications Conclusion

Separable Computation

  • Like to store computation in texture
  • Texture sampling 3-4x highest frequency
  • 1D & 2D OK size, 3D gets big, 4D impossible
  • Factor into lower-D textures
  • (e.g. write noise(

px, py, pz) as several x/y terms)

slide-55
SLIDE 55

Introduction & Background Modifications Conclusion

Separable Computation

  • Like to store computation in texture
  • Texture sampling 3-4x highest frequency
  • 1D & 2D OK size, 3D gets big, 4D impossible
  • Factor into lower-D textures
  • (e.g. write noise(

px, py, pz) as several x/y terms)

slide-56
SLIDE 56

Introduction & Background Modifications Conclusion

Separable Computation

  • Like to store computation in texture
  • Texture sampling 3-4x highest frequency
  • 1D & 2D OK size, 3D gets big, 4D impossible
  • Factor into lower-D textures
  • (e.g. write noise(

px, py, pz) as several x/y terms)

slide-57
SLIDE 57

Introduction & Background Modifications Conclusion

Separable Computation

  • Like to store computation in texture
  • Texture sampling 3-4x highest frequency
  • 1D & 2D OK size, 3D gets big, 4D impossible
  • Factor into lower-D textures
  • (e.g. write noise(

px, py, pz) as several x/y terms)

noise( px, py, pz) = flerp(z,xyz-term+xyz-term ∗ z xyz-term+xyz-term ∗ (z − 1))

slide-58
SLIDE 58

Introduction & Background Modifications Conclusion

Separable Computation

  • Like to store computation in texture
  • Texture sampling 3-4x highest frequency
  • 1D & 2D OK size, 3D gets big, 4D impossible
  • Factor into lower-D textures
  • (e.g. write noise(

px, py, pz) as several x/y terms)

noise( px, py, pz) = flerp(z,xy-term(Z0)+xy-term(Z0) ∗ z xy-term(Z1)+xy-term(Z1) ∗ (z − 1))

slide-59
SLIDE 59

Introduction & Background Modifications Conclusion

Factorization Details

noise( p) = flerp(z,zconst( px, py, Z0)+zgrad( px, py, Z0) ∗ z, zconst( px, py, Z1)+zgrad( px, py, Z1) ∗ (z − 1))

  • With nested hash,

zconst( px, py, Z0)= zconst( px, py + hash(Z0)) zgrad ( px, py, Z0)= zgrad ( px, py + hash(Z0))

  • With corner gradients, zconst = noise!
slide-60
SLIDE 60

Introduction & Background Modifications Conclusion

Factorization Details

noise( p) = flerp(z,zconst( px, py, Z0)+zgrad( px, py, Z0) ∗ z, zconst( px, py, Z1)+zgrad( px, py, Z1) ∗ (z − 1))

  • With nested hash,

zconst( px, py, Z0)= zconst( px, py + hash(Z0)) zgrad ( px, py, Z0)= zgrad ( px, py + hash(Z0))

  • With corner gradients, zconst = noise!
slide-61
SLIDE 61

Introduction & Background Modifications Conclusion

Factorization Details

noise( p) = flerp(z,zconst( px, py, Z0)+zgrad( px, py, Z0) ∗ z, zconst( px, py, Z1)+zgrad( px, py, Z1) ∗ (z − 1))

  • With nested hash,

zconst( px, py, Z0)= zconst( px, py + hash(Z0)) zgrad ( px, py, Z0)= zgrad ( px, py + hash(Z0))

  • With corner gradients, zconst = noise!
slide-62
SLIDE 62

Introduction & Background Modifications Conclusion

Perlin’s Hash

  • 256-element permutation array
  • Turns each integer 0-255 into a different integer 0-255
  • Chained lookups

g(hash(Z + hash(Y + hash(X))))

  • Must compute for each lattice point around

p

  • Even with a 2D hash(Y + hash(X)) texture, that’s
  • 2 hash lookups for 1D noise
  • 4 hash lookups for 2D noise
  • 12 hash lookups for 3D noise
  • 20 hash lookups for 4D noise
slide-63
SLIDE 63

Introduction & Background Modifications Conclusion

Perlin’s Hash

  • 256-element permutation array
  • Turns each integer 0-255 into a different integer 0-255
  • Chained lookups

g(hash(Z + hash(Y + hash(X))))

  • Must compute for each lattice point around

p

  • Even with a 2D hash(Y + hash(X)) texture, that’s
  • 2 hash lookups for 1D noise
  • 4 hash lookups for 2D noise
  • 12 hash lookups for 3D noise
  • 20 hash lookups for 4D noise
slide-64
SLIDE 64

Introduction & Background Modifications Conclusion

Perlin’s Hash

  • 256-element permutation array
  • Turns each integer 0-255 into a different integer 0-255
  • Chained lookups

g(hash(Z + hash(Y + hash(X))))

  • Must compute for each lattice point around

p

  • Even with a 2D hash(Y + hash(X)) texture, that’s
  • 2 hash lookups for 1D noise
  • 4 hash lookups for 2D noise
  • 12 hash lookups for 3D noise
  • 20 hash lookups for 4D noise
slide-65
SLIDE 65

Introduction & Background Modifications Conclusion

Perlin’s Hash

  • 256-element permutation array
  • Turns each integer 0-255 into a different integer 0-255
  • Chained lookups

g(hash(Z + hash(Y + hash(X))))

  • Must compute for each lattice point around

p

  • Even with a 2D hash(Y + hash(X)) texture, that’s
  • 2 hash lookups for 1D noise
  • 4 hash lookups for 2D noise
  • 12 hash lookups for 3D noise
  • 20 hash lookups for 4D noise
slide-66
SLIDE 66

Introduction & Background Modifications Conclusion

Perlin’s Hash

  • 256-element permutation array
  • Turns each integer 0-255 into a different integer 0-255
  • Chained lookups

g(hash(Z + hash(Y + hash(X))))

  • Must compute for each lattice point around

p

  • Even with a 2D hash(Y + hash(X)) texture, that’s
  • 2 hash lookups for 1D noise
  • 4 hash lookups for 2D noise
  • 12 hash lookups for 3D noise
  • 20 hash lookups for 4D noise
slide-67
SLIDE 67

Introduction & Background Modifications Conclusion

Perlin’s Hash

  • 256-element permutation array
  • Turns each integer 0-255 into a different integer 0-255
  • Chained lookups

g(hash(Z + hash(Y + hash(X))))

  • Must compute for each lattice point around

p

  • Even with a 2D hash(Y + hash(X)) texture, that’s
  • 2 hash lookups for 1D noise
  • 4 hash lookups for 2D noise
  • 12 hash lookups for 3D noise
  • 20 hash lookups for 4D noise
slide-68
SLIDE 68

Introduction & Background Modifications Conclusion

Perlin’s Hash

  • 256-element permutation array
  • Turns each integer 0-255 into a different integer 0-255
  • Chained lookups

g(hash(Z + hash(Y + hash(X))))

  • Must compute for each lattice point around

p

  • Even with a 2D hash(Y + hash(X)) texture, that’s
  • 2 hash lookups for 1D noise
  • 4 hash lookups for 2D noise
  • 12 hash lookups for 3D noise
  • 20 hash lookups for 4D noise
slide-69
SLIDE 69

Introduction & Background Modifications Conclusion

Perlin’s Hash

  • 256-element permutation array
  • Turns each integer 0-255 into a different integer 0-255
  • Chained lookups

g(hash(Z + hash(Y + hash(X))))

  • Must compute for each lattice point around

p

  • Even with a 2D hash(Y + hash(X)) texture, that’s
  • 2 hash lookups for 1D noise
  • 4 hash lookups for 2D noise
  • 12 hash lookups for 3D noise
  • 20 hash lookups for 4D noise
slide-70
SLIDE 70

Introduction & Background Modifications Conclusion

Alternative Hash

  • Many choices; I kept 1D chaining
  • Desired features
  • Low correlation of hash output for nearby inputs
  • Computable without lookup
  • Use a random number generator?
  • Seed
  • Successive calls give uncorrelated values
slide-71
SLIDE 71

Introduction & Background Modifications Conclusion

Alternative Hash

  • Many choices; I kept 1D chaining
  • Desired features
  • Low correlation of hash output for nearby inputs
  • Computable without lookup
  • Use a random number generator?
  • Seed
  • Successive calls give uncorrelated values
slide-72
SLIDE 72

Introduction & Background Modifications Conclusion

Alternative Hash

  • Many choices; I kept 1D chaining
  • Desired features
  • Low correlation of hash output for nearby inputs
  • Computable without lookup
  • Use a random number generator?
  • Seed
  • Successive calls give uncorrelated values
slide-73
SLIDE 73

Introduction & Background Modifications Conclusion

Random Number Generator Hash

  • Hash argument is seed
  • Most RNG are highly correlated for nearby seeds
  • Hash argument is number of times to call
  • Most RNG are expensive (or require n calls) to get nth number
  • Should noise(30) be 30 times slower than noise(1)?

permute table hash using seed=X

slide-74
SLIDE 74

Introduction & Background Modifications Conclusion

Random Number Generator Hash

  • Hash argument is seed
  • Most RNG are highly correlated for nearby seeds
  • Hash argument is number of times to call
  • Most RNG are expensive (or require n calls) to get nth number
  • Should noise(30) be 30 times slower than noise(1)?

permute table hash using X th random number

slide-75
SLIDE 75

Introduction & Background Modifications Conclusion

Blum-Blum Shub

xn+1 = x2

i mod M

M = product of two large primes

  • Uncorrelated for nearby seeds...
  • But large M is bad for hardware...
  • But reasonable results for smaller M...
  • And square and mod is simple to compute!

523*527

slide-76
SLIDE 76

Introduction & Background Modifications Conclusion

Blum-Blum Shub

xn+1 = x2

i mod M

M = product of two large primes

  • Uncorrelated for nearby seeds...
  • But large M is bad for hardware...
  • But reasonable results for smaller M...
  • And square and mod is simple to compute!

523*527

slide-77
SLIDE 77

Introduction & Background Modifications Conclusion

Blum-Blum Shub

xn+1 = x2

i mod M

M = product of two large primes

  • Uncorrelated for nearby seeds...
  • But large M is bad for hardware...
  • But reasonable results for smaller M...
  • And square and mod is simple to compute!

523*527

slide-78
SLIDE 78

Introduction & Background Modifications Conclusion

Blum-Blum Shub

xn+1 = x2

i mod M

M = product of two large primes

  • Uncorrelated for nearby seeds...
  • But large M is bad for hardware...
  • But reasonable results for smaller M...
  • And square and mod is simple to compute!

29*31

slide-79
SLIDE 79

Introduction & Background Modifications Conclusion

Blum-Blum Shub

xn+1 = x2

i mod M

M = product of two large primes

  • Uncorrelated for nearby seeds...
  • But large M is bad for hardware...
  • But reasonable results for smaller M...
  • And square and mod is simple to compute!

61

slide-80
SLIDE 80

Introduction & Background Modifications Conclusion

Modified Noise

  • Square and mod hash
  • M = 61
  • Corner gradient selection
  • One 2D texture for both 1D and 2D
  • Factor
  • Construct 3D and 4D from 2 or 4 2D texture lookups
slide-81
SLIDE 81

Introduction & Background Modifications Conclusion

Comparison

Perlin original Perlin improved Corner gradients Corner+Hash

slide-82
SLIDE 82

Introduction & Background Modifications Conclusion

Using Noise

3D noise 3D turbulence Wood Marble

slide-83
SLIDE 83

Introduction & Background Modifications Conclusion

Outline

Introduction & Background Modifications Conclusion

slide-84
SLIDE 84

Introduction & Background Modifications Conclusion

Conclusions

  • Three (mostly) independent modifications to Perlin noise
  • Corner gradient: can subset noise
  • noise(x) = noise(x,0)
  • noise(x,y) = noise(x,y,0)
  • Factorization: can superset noise
  • build 3D noise out of 2D
  • build 4D noise out of 3D
  • Computed hash
  • lookup-free noise
  • avoid potentially costly chained lookups
  • Admit a range of choices for texture vs. compute
slide-85
SLIDE 85

Introduction & Background Modifications Conclusion

Conclusions

  • Three (mostly) independent modifications to Perlin noise
  • Corner gradient: can subset noise
  • noise(x) = noise(x,0)
  • noise(x,y) = noise(x,y,0)
  • Factorization: can superset noise
  • build 3D noise out of 2D
  • build 4D noise out of 3D
  • Computed hash
  • lookup-free noise
  • avoid potentially costly chained lookups
  • Admit a range of choices for texture vs. compute
slide-86
SLIDE 86

Introduction & Background Modifications Conclusion

Conclusions

  • Three (mostly) independent modifications to Perlin noise
  • Corner gradient: can subset noise
  • noise(x) = noise(x,0)
  • noise(x,y) = noise(x,y,0)
  • Factorization: can superset noise
  • build 3D noise out of 2D
  • build 4D noise out of 3D
  • Computed hash
  • lookup-free noise
  • avoid potentially costly chained lookups
  • Admit a range of choices for texture vs. compute
slide-87
SLIDE 87

Introduction & Background Modifications Conclusion

Conclusions

  • Three (mostly) independent modifications to Perlin noise
  • Corner gradient: can subset noise
  • noise(x) = noise(x,0)
  • noise(x,y) = noise(x,y,0)
  • Factorization: can superset noise
  • build 3D noise out of 2D
  • build 4D noise out of 3D
  • Computed hash
  • lookup-free noise
  • avoid potentially costly chained lookups
  • Admit a range of choices for texture vs. compute
slide-88
SLIDE 88

Introduction & Background Modifications Conclusion

Future Work

  • Other computed hash functions?
  • Extend to simplex noise
  • Extend to other hash-based primitives
  • Tiled texture
  • Worley cellular textures
  • Further explore turbulence & fBm
  • Can we pre-bake the octaves together?
slide-89
SLIDE 89

Introduction & Background Modifications Conclusion

Questions?

www.umbc.edu/˜olano/noise

slide-90
SLIDE 90

Green, S. (2005). Implementing improved Perlin noise. In Pharr, M., editor, GPU Gems 2, chapter 26. Addison-Wesley. Hart, J. C. (2001). Perlin noise pixel shaders. In Akeley, K. and Neumann, U., editors, Graphics Hardware 2001, pages 87–94, Los Angeles, CA. SIGGRAPH/EUROGRAPHICS, ACM, New York. Lastra, A., Molnar, S., Olano, M., and Wang, Y. (1995). Real-time programmable shading. In I3D ’95: Proceedings of the 1995 symposium on Interactive 3D graphics. ACM Press. Perlin, K. (1985). An image synthesizer.

slide-91
SLIDE 91

In SIGGRAPH ’85: Proceedings of the 12th annual conference

  • n Computer graphics and interactive techniques, pages

287–296. ACM Press. Perlin, K. (2001). Noise hardware. In Olano, M., editor, Real-Time Shading SIGGRAPH Course Notes. Perlin, K. (2002). Improving noise. In SIGGRAPH ’02: Proceedings of the 29th annual conference

  • n Computer graphics and interactive techniques, pages

681–682. ACM Press. Perlin, K. (2004). Implementing improved Perlin noise. In Fernando, R., editor, GPU Gems, chapter 5. Addison-Wesley.