Noise and procedural techniques
Download
1 / 19

Noise and Procedural Techniques - PowerPoint PPT Presentation


  • 138 Views
  • Uploaded on

Noise and Procedural Techniques. John Spitzer Simon Green NVIDIA Corporation. Overview. What is procedural texturing? Advantages and disadvantages When to use procedural texturing What is noise? Ideal noise characteristics Spectral synthesis Demos. What is Procedural Texturing?.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Noise and Procedural Techniques' - adair


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Noise and procedural techniques

Noise and Procedural Techniques

John Spitzer

Simon Green

NVIDIA Corporation


Overview
Overview

  • What is procedural texturing?

  • Advantages and disadvantages

  • When to use procedural texturing

  • What is noise?

  • Ideal noise characteristics

  • Spectral synthesis

  • Demos...


What is procedural texturing
What is Procedural Texturing?

  • Code vs. tables

  • Classic time vs. storage space trade-off


Advantages of procedural texturing
Advantages of Procedural Texturing

  • Compact- code is small (compared to textures)

  • No fixed resolution- "infinite" detail, limited only by precision

  • Unlimited extent- can cover arbitrarily large areas, no repeating

  • Parameterized- can easily generate a large no. of variations on a theme

  • Solid texturing (avoids 2D mapping problem)


Disadvantages of procedural texturing
Disadvantages of Procedural Texturing

  • Computation time (big ouch!)

  • Hard to code and debug

  • Aliasing


When to use procedural textures
When to use Procedural Textures

  • Don’t use them just for the hell of it!

  • Procedurals are good for animating effects – fire, water, clouds, explosions…

  • ..or anywhere where a repeating texture would be obvious

  • Combine the best aspects of both techniques – e.g. painted maps + noise to add variation


Procedural noise
Procedural Noise

  • Noise is an important part of many procedural textures

  • Used everywhere in production rendering

  • Procedural noise provides a controlled method of adding randomness to:

    • Color, texture

    • Bump map / displacement maps

    • Animation

    • Terrains, anything else…


Ideal noise characteristics
Ideal Noise Characteristics

  • Can’t just use rand()!

  • An ideal noise function has:

    • repeatable pseudorandom values

    • specific range (typically [-1,1] or [0,1])

    • band-limited frequency ~= 1

    • no obvious repeating patterns

    • invariance under rotation and translation

  • “Random yet smooth”


What does noise look like
What does Noise look like?

  • Imagine creating a big block of random numbers and blurring them:


What does noise look like1
What does Noise look like?

  • Random values at integer positions

  • Varies smoothly in-between. In 1D:

noise(x)

1

x

0

1

2

3

4

5

6

7

8

-1

  • This is value noise, gradient noise is zero at integer positions


Spectral synthesis
Spectral Synthesis

  • Narrow-band noise by itself is not very exciting

  • Summations of multiple frequencies are!

  • Like Fourier synthesis (summing sine waves)

  • Each layer is known as an “octave” since the frequency typically doubles each time

  • Increase in frequency known as “lacunarity” (gap)

  • Change in amplitude/weight known as “gain”


Fractal sum
Fractal Sum

1/2

+1/4

Freq = 1

Freq = 2

=

+1/8

+1/16

Freq = 4

Freq = 8


Turbulence
Turbulence

  • Ken Perlin’s trick – assumes noise is signed [-1,1]

  • Exactly like fBm, but take absolute value of noise

  • Introduces discontinuities that make the image more “billowy”

float turbulence(float3 p, int octaves, float lacunarity, float gain){ float sum = 0; float amp = 1; for(int i=0; i<octaves; i++) { sum += amp * abs(noise(p)); p *= lacunarity; amp *= gain; } return sum;}



Pixel shader noise
Pixel Shader Noise

  • Implementation of Perlin’s original (Academy-award winning) algorithm

  • Gradient noise over R3, scalar output

  • Uses 2 1D textures as look-up tables

  • Compiles to around 40 instructions


Pixel shader noise using 3d textures
Pixel Shader Noise using 3D Textures

  • Pre-compute 3D texture containing random values

  • Pre-filtering with tri-cubic filter helps avoid linear interpolation artifacts

  • 4 lookups into a single 64x64x64 3D texture produces reasonable looking turbulence



Using noise to perturb patterns
Using Noise to Perturb Patterns

colormap(sin(x + turbulence(P)))


Questions comments feedback
Questions, comments, feedback?

  • John Spitzer, [email protected]

  • Simon Green, [email protected]

  • www.nvidia.com/developer


ad