Post on 04-Jan-2016
description
transcript
CNM 190CNM 190Advanced Digital AnimationAdvanced Digital Animation
Lec 06 : Advanced Procedural Lec 06 : Advanced Procedural ModelingModeling
Dan GarciaDan Garcia, EECS (co-instructor), EECS (co-instructor)
Greg Niemeyer, Art (co-instructor)Greg Niemeyer, Art (co-instructor)
Jeremy Huddleston, EECS (TA)Jeremy Huddleston, EECS (TA)
Sanjay BakshiSanjay Bakshi, Pixar (guest lecturer), Pixar (guest lecturer)
Pixar’s “A Bug’s Life” (with procedural models abounding)Pixar’s “A Bug’s Life” (with procedural models abounding)
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
2/17Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
OverviewOverview
Dan on Advanced Dan on Advanced Procedural ModelingProcedural Modeling Randomness Randomness
revisitedrevisited Particle systemsParticle systems Genetic algorithmsGenetic algorithms How do we do it?How do we do it? Set dressingSet dressing Character generationCharacter generation Hair & FurHair & Fur ConclusionConclusion
Sanjay on what is Sanjay on what is done at Pixardone at Pixar
3/17Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
Randomness revisitedRandomness revisited
What if we want a characters What if we want a characters distribution to resemble distribution to resemble demographics of Cal ugrads?demographics of Cal ugrads?
osr2.berkeley.edu/Public/STUDENT.DATA/PUBLICATIONS/UG/ugsp06.html
Gender
MenWomen
Ethnicity
American IndianAsianAfrican-AmericanHispanicCaucasianOtherNo DataInternational
How can we useHow can we userandom()random()??
54%54% 46%46%
4/17Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
Simple, slice up [0,1)!Simple, slice up [0,1)!
Just use range = to that of distribution!Just use range = to that of distribution! >>> >>> g = random() g = random() # [0, 1) gender# [0, 1) gender >>> >>> e = random() e = random() # [0, 1) ethnic# [0, 1) ethnic
And then use if … else from data!And then use if … else from data! >>> >>> ifif g < .46: g < .46: # 46% male# 46% male ... ... MakeCharacter(male)MakeCharacter(male) ... ... else:else: ... ... MakeCharacter(female)MakeCharacter(female)
……and similarly for ethnicity, height, etcand similarly for ethnicity, height, etc
5/17Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
I must program to I must program to randomize?randomize?
Maya has randomness at many Maya has randomness at many levelslevels Demo of Maya’s help, specifically Demo of Maya’s help, specifically
Functions49.htmlFunctions49.html http://localhost:4448/Maya6.5/en_US/index.htmlhttp://localhost:4448/Maya6.5/en_US/index.html
It has most of the functions built-in!It has most of the functions built-in! seed()seed() rand()rand() gauss() gauss() noise()noise() gauss(5)gauss(5)
6/17Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
Particle systemsParticle systems Typically used to Typically used to
simulate fuzzy simulate fuzzy phonomenaphonomena Smoke, Explosions, Smoke, Explosions,
Water, Sparks, Dust, Water, Sparks, Dust, StarsStars
EmitterEmitter controls controls particle generation, particle generation, simulationsimulation
What is involved with What is involved with the geometry?the geometry? Typically output as Typically output as
textured billboard quadtextured billboard quad Or, single pixelOr, single pixel Or, metaball (for gooey Or, metaball (for gooey
materials)materials)
QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.
pixar cosmic voyage
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
en.wikipedia.org/wiki/Particle_systems
7/17Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
Genetic AlgorithmsGenetic Algorithms
Karl Sims blew away Karl Sims blew away his colleagues with his colleagues with his 1994 seminal his 1994 seminal work on evolved work on evolved creaturescreatures
QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.
evolved virtual creatures
web.genarts.com/karl/
QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
8/17Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
Genetic AlgorithmsGenetic Algorithms GenotypeGenotype is the genetic is the genetic
information that codes the information that codes the creation of an individualcreation of an individual
PhenotypePhenotype is the is the individualindividual
SelectionSelection is the process is the process by which fitness of by which fitness of phenotypes is determinedphenotypes is determined
ReproductionReproduction is the is the process by which new process by which new genotypes are generated genotypes are generated from existing onesfrom existing ones
There must be There must be probabilistic probabilistic mutationsmutations with some frequencywith some frequency
QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.
panspermia
web.genarts.com/karl/papers/siggraph91.html
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
9/17Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
How do we do it in How do we do it in Renderman?Renderman?
Easy!Easy! Renderman supports a library that you can compile Renderman supports a library that you can compile
with your C program that will help you output with your C program that will help you output RIBRIB RIB is the intermediate file that Renderman readsRIB is the intermediate file that Renderman reads The result of a render is a The result of a render is a tifftiff file (or multiple file (or multiple tifftiffs)s) Demo of simple.c and hard.cDemo of simple.c and hard.c
QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
renderman.pixar.com/products/whatsrenderman/www.cs.berkeley.edu/~ddgarcia/renderman/
10/17
Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
How do we do it in How do we do it in Maya?Maya?
Easy!Easy! Every action you perform in Maya is available in the Script EditorEvery action you perform in Maya is available in the Script Editor You can generate this text You can generate this text explicitlyexplicitly through a program using through a program using
the techniques we just discussed. E.g., Name it the techniques we just discussed. E.g., Name it Foo.melFoo.mel Or you can use MEL as a programming language (it looks like C) Or you can use MEL as a programming language (it looks like C)
and do all your scripting there!and do all your scripting there! Open this in Maya (double-click, or use the Script Editor)Open this in Maya (double-click, or use the Script Editor)
Demos of makeAntenna.mel and makeMenger.melDemos of makeAntenna.mel and makeMenger.mel
11/17
Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
Set DressingSet Dressing
““The process of selecting, designing, adapting The process of selecting, designing, adapting to, or modifying the performance space for a to, or modifying the performance space for a
given purpose. This includes the use of given purpose. This includes the use of stagecraft elements as well as the structure stagecraft elements as well as the structure
of the stage and its components.”of the stage and its components.”
en.wikipedia.org/wiki/Set_dressing
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
12/17
Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
Set Dressing : Hand vs Set Dressing : Hand vs ProceduralProcedural
Which elements of the scene below were Which elements of the scene below were placed by hand and which were placed placed by hand and which were placed procedurally?procedurally? In general, when would you author code to place In general, when would you author code to place
set elements? How much randomness would you set elements? How much randomness would you allow?allow?
en.wikipedia.org/wiki/Set_dressing
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
13/17
Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
Procedural Tree Set Procedural Tree Set Dressing IDressing I
Consider the problem of placing trees in Consider the problem of placing trees in a forest in a natural waya forest in a natural way How would you place them so that they How would you place them so that they
don’t overlap?don’t overlap? What are some ideas?What are some ideas?
14/17
Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
Procedural Tree Set Procedural Tree Set Dressing IIDressing II
Random TreesRandom Trees Pick random points and Pick random points and
remove if new tree is too remove if new tree is too close to existing treeclose to existing tree
Start with trees regularly Start with trees regularly spaced and then perturb spaced and then perturb (wiggle)(wiggle)
Add “relax” step which Add “relax” step which treats each point as treats each point as having “negative having “negative gravity” to push away gravity” to push away nearby pointsnearby points
Find out what “right” Find out what “right” answer is (check forestry answer is (check forestry research) or by looking research) or by looking at real forests and at real forests and simulatesimulate
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
Voronoi diagramVoronoi diagramof random pointsof random points
15/17
Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
Procedural Character Procedural Character GenerationGeneration
Create a procedural character model that has Create a procedural character model that has enough parameters to capture what you wantenough parameters to capture what you want
Find out what distribution you would like (see Find out what distribution you would like (see first slides) of the parametersfirst slides) of the parameters
Populate your world (for each character, assign Populate your world (for each character, assign the properties, including location) the properties, including location)
16/17
Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
Hair and FurHair and Fur Used to be a hard problemUsed to be a hard problem Algorithms now exist to allow animators to Algorithms now exist to allow animators to
either let dynamics control it completely OR to either let dynamics control it completely OR to animate “control hairs” (which control a patch)animate “control hairs” (which control a patch) It’s even built into Maya!It’s even built into Maya!
See the work in Monsters, Inc and NarniaSee the work in Monsters, Inc and Narnia
QuickTime™ and aTIFF (Uncompressed) decompressorare needed to see this picture.
monster’s DVD
17/17
Procedural Modeling Basicshttp://inst.eecs.berkeley.edu/~selfpace/
C10 Hearst Field Annex; 642-9920
CNM190
ConclusionConclusion
Set dressing Set dressing grounds scene in grounds scene in believable believable surroundingssurroundings
Crowds need lots Crowds need lots randomness with randomness with character selectioncharacter selection
Next week:Next week: Skeletons & RiggingSkeletons & Rigging