procedural texturing and modeling advanced animation and motion capture (aa&mc)

61
Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Upload: phebe-wilcox

Post on 11-Jan-2016

239 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Procedural Texturingand

Modeling

Advanced Animation andMotion Capture (AA&MC)

Page 2: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Topics covered:

Fractals & Noisea. Randomb. Pseudo-randomc. Perlin Noised. Iterated functionse. Spiral Phyllotaxis

2D and 3D Texturesa. Surface texturesb. Cellular texturesc. 3D Texturesd. Hypertextures

Grammarsa. Recursionb. L-Systems

Procedural Modelinga. Instancingb. Replicationc. Placement

Page 3: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

NoiseWhat is randomness?

Page 4: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Randomness:

Some definitions…

“Having no definite aim or purpose; not sent or guided in a particular direction..” Oxford English Directionary

“Free will is limited to low-level decision making.” Martin Luther

“God does not play dice with the universe.” Albert Einstein

“Don’t tell God what to do.” Neils Bohr

“[God] gave humans free will. He gave them free will because aworld of mere automata could never love..” C.S. Lewis

Randomness in the universe implies free will.

Page 5: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Michael Noll, 1962. Computer Composition with LinesBased on Piet Mondrian’s Composition with Lines

Page 6: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Bela Julesz, Hungarian psychologistRandom-dot stereograms. 3D object hidden in random images.

Page 7: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Is it random? What makes it random?

Page 8: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)
Page 9: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

How do we get true randomnesss?

Which of these are random?

a. Throwing dice

b. Roulette wheel

c. Temparature of a specific point in nature

d. The next number I say

e. Digits of PI

Page 10: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Roulette wheel

The Eudaemonic Pie, 1985. Thomas A. Bass.

Describe a group of physics graduates from University of Santa Cruz whoknew that roulette wheels obey Newtonian physics, but is justvery sensitive to initial conditions. Using miniaturized computers, hidden in special shoes, they could capture the state of the ball and the wheel, and could increasetheir odds by 44%.

Page 11: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Hardware Random Number Genarators

Best sources of physical randomness so far:- Nuclear decay of atoms.- Photos traveling through a partial mirror

SSL Accelerator card Applications to cryptography.Many security systems are based on a random key.If the key is not really random, system is not safe.

Page 12: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

How do computers generate random numbers?

Numbers are generated as a sequence, starting from some seed point.Problem is finding the next number so that it has nothing to do with the last.

Why is this hard? Because computers are deterministic. The computer program to get Tn+1 is an exact sequence of steps. So if youfigure out what is Tn, my program will give you Tn+1.Computer has no free will to choose a different number.

?

Tn Tn+1

Page 13: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Plot of the rand() function in C.

int r = rand();

Page 14: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

When your computer really needs something random, how does it do it?

srand ( time() ); // check the second hand on the clock

int r = rand(); // get random number

This says the seed of the random number generator is based on the when you tell the program to run.

All numbers after that will look random.If you start the program over, a different clock timeis used for the sequence.

These are called pseudo-random sequences.

Page 15: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Randomness in Computer Graphics

We actually like pseudo-random sequences in graphics.

Why?

1. Results can be reproduced, while still appearing random. Useful for testing.

2. Randomness that depends on time will not jump around from one frame to the next. e.g. Random placement of trees in a game.

3. Faster to compute

Page 16: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Computer Graphics

Patterns in nature are semi-random.

Wood chips.

Page 17: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)
Page 18: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Sheet metal

Random noiseScaled on one axis

Natural and Man-Made Patternsoften have a grain.

Wood – due to process of growthMetal – due to process of cleaning

Page 19: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Fractals

Nature often exhibits pattens of a fractal structure.

“Clouds are not spheres, mountains are not cones, coastlines are not circles, and bark is not smooth..”

Benoit Mandelbrot, French-American (b. 1924)The Fractal Geometry of Nature, 1982

- Exhibit scale invariance. Same structure at different scales.

- Exhibit self-similarity.

- Exhibit Fractal dimensionality.

Page 20: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Perlin Noise

Fractal noise.

Simple idea: Generate random noise at different scales (frequencies) and add them together.

Ken Perlin, New York University.Invented in 1982. Academy award for Tron.

Page 21: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

ChaosThe property of a non-linear system to be stable at times, but occasionally enter into a chaotic, seemingly-random state.

Exhibited by many physical systems:

Page 22: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Simple Example – Logistic Map

Based on the logistic map, developed to study population dynamics.

x = r x ( 1 – x )

Creates a number sequence. Where:

0 < Xn < 1 Ratio of existing populaton to maximum possible population. % population

r Combined rate for reproduction and starvation.

So we have two competing factors:r Xn Says that population will increase based on

the previous population.

r (1-Xn) Says that population will decrease based due to starvation based on how close we are to maximum.

n+1 n n

Biologist Robert May, 1976. Mathematics first from Pierre Francois Verhulst (1804)

Page 23: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Bifurcation Diagram

Page 24: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Iterated Functions

All these systems share a common feature:

How to Generate a sequence Tn+1 from Tn.

- Noise Generator is pseudo-random sequence

- Roulette Generator is the law of Newtonian physics

- Chaos Generator is a non-linear system /w feedback

- Logistic Map Generator is competition between population factors

Iterative functions describe many basic processes in nature.The previous state of the system determines the next state.

See the chaos game, Michael Barnsley. Method of making geometric fractals.

Page 25: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Spiral Phyllotaxis

Many patterns in nature can be understood withvery simple iterated functions.

Wilhelm Hofmeister, 1868.

Two leaves appear on opposite sides. A third appears between them.The first two push the 3rd away. The result is the golden angle.

Iteration, adding new leaves, settles into the minimization of energy,which results in the golden ratio (angle).

Page 26: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Fermat’s Spiral

o

Phyllotaxis pattern found in sunflowers.

Page 27: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

A Collision-based Model of Spiral Phyllotaxis, 1992Deborah Fowler, Przemyslaw Prusinkiewicz, Johannes Battjes

Page 28: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

http://algorithmicbotany.org/papers/#abop

“The Algorithmic Beauty of Plants”

Przemyslaw Prusinkiewicz

Entire book available online:

Page 29: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Procedural Textures – 2D and 3D

Deals specifically with generated images and volumesand their application to graphics.

f ( x, y ) = image

f ( x, y, z) = volume

Page 30: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Procedural Textures – 2D and 3D

f ( x, y ) defines an image, or surface texture.

Image f ( x, y )

Object Polygon

World space Texture space

Texture mapping. Two-dimensional function is mapped onto thethree dimensional geometry. Process is usually done withinverse sampling, where you look up the desired value in f.

Page 31: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Texture mappingTexture appears on surface, and follows surface distortions of the object.

Page 32: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Volumetric Textures

f ( x, y, z) Texture is defined at every point in space.

f ( x, y, z ) defines a volume texture

Volume f ( x, y, z )Object Polygon

World space Volume Texture space

Texture color is selected directly from the 3D volume location.

Page 33: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Wood and marble are naturallydescribed as volumetric textures.

Page 34: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Modeling and Rendering of Weathered StoneJulie Dorsey, Alan Edelman, Henrik Jensen, Justin Legakis, Hans Pedersen

Combine Perlin noise with other simluated physical processes, such as rain or rust, and layer them together.

Page 35: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)
Page 36: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Texture mapping:

- Faster to compute

- Less memory to store (only if you need to save)

- Texture appears on the surface of object

- Texture distorts with changes in the object.

Volume textures:

- Slower to compute

- More memory to store (only if you need to save)

- Texture remains rigid relative to object.

- Object changes in shape will move through the texture.

- Good for rigid objects with cracks or breaks.

Page 37: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Cellular Textures

There are other ways to generate the texture function f ( x, y )aside from using random noise.

Generate a set of polygonsin the plane (2D).

Compute the distance tothe nearest edge.

Page 38: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Crocodile skin

Page 39: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Procedural Texturing – Types of mappings

Texture mapping assigns a function f to the color of a point on an object.

Different features of an object can be modified by procedural textures.

Page 40: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Bump mapping modifies the surface normal based on the function f.

The surface normal determines the visible orientation of the surface for lighting calculations.

Notice the silouette doesnot look bumpy.

The geometry is not changed, only the surface direction relativeto the light source.

Procedural Texturing – Types of mappings

Page 41: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Environment mapping modifies the reflected ray color based on function f.

Procedural Texturing – Types of mappings

Useful for reflective surfaces.

Notice that the geometry of the surface is still not changed.The sphere is still smooth.

Page 42: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Displacement mapping modifies the actual surface position based on function f.

Procedural Texturing – Types of mappings

Most realistic for any rough surface.Notice silouette is also bumpy.

Can be expensive to compute. May need to increase the geometricdetail of the object in order to give a good appearance.

Page 43: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)
Page 44: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Grammars and L-Systems

How can we change the structure of something?

With procedural textures there is essentially one object, the function or system, which can change over time. Differences are between points in space or sequences in time.

What if we want to modify the objectitself, change its change or add new shapes?

Page 45: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Example:

Page 46: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Aristid Lindenmayer, 1968. Hungarian biologist and botanist.

L-Systems

Process of replacement can be formalized using a grammar,or parallel rewriting system, called an L-system.

An L-system is a tuple (set of three things):

G = ( V, w, P )

V = Alphabet. Set of symbols that can be replaced.

w = Start or axiom.

P = Set of production rules.

Page 47: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Variables: A B

Start: A

Rules: A -> B B -> AB

Process:

1. Take the Start (w) as the current string2. Apply the production rule to every symbol in the current string.3. When finished, call this the new string.4. Repeat

start: Aiteration 1: B (rule A->B)iteration 2: AB (rule B->AB)iteration 3: BAB (rules A->B, B->AB)iteration 4: ABBAB (rules B->AB, A->B, B->AB)

Page 48: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

L-Systems can have a physical interpretation, if we assign meaning to letters.

Page 49: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

L-System Plants

Page 50: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

L-system Weeds

Page 51: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)
Page 52: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Procedural Cities

L-systems can be used to describe many objects where thestructure changes iteratively, such as city blocks.

http://www.youtube.com/watch?v=yI5YOFR1Wus

Page 53: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Procedural Buildings

Generative Modeling Language (GML)“A Generative Theory of Shape”, Michael Leyton. (availabe online)

Page 54: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Procedural Furniture

Parametric modeling allow you to change the size and shapeof various parts of an object continuously.

Page 55: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Instancing and Replication

L-system

or.. How to make a complete forest. (First try)

Structureof branches

Noise

Noise can tell us where to plant trees.L-system can tell us how to build a three-dimensional tree.

But do we make one tree and copy it, or do we make lots of different trees?

Page 56: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

Some times instancing can look pretty good. Pines trees all look similar.

Page 57: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)
Page 58: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

In other cases, instancing does not produce enough visual variation.This also depends on the placement algorithm.

Page 59: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

1 instance

2 instances

Page 60: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

1 instance

8 instances

Page 61: Procedural Texturing and Modeling Advanced Animation and Motion Capture (AA&MC)

http://www.youtube.com/watch?v=rl5p63JabrA

Procedural Modeling - Efficiency

Procedural modeling can produce a lot of geometry.

Steps must be taken to reduce the number of polygons.

1. Level of detail – Only create new geometry where it is needed 2. Instancing – Copy geometry already in memory instead of rebuilding

3. Imposters – Use a picture for distant objects instead of rendering the whole thing.

1

2

3