36
Introduction to Introduction to Subdivision Subdivision surfaces surfaces Martin Reimers Martin Reimers CMA, University of Oslo CMA, University of Oslo

Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Embed Size (px)

Citation preview

Page 1: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Introduction toIntroduction to Subdivision surfaces Subdivision surfaces

Martin ReimersMartin Reimers

CMA, University of OsloCMA, University of Oslo

Page 2: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

OverviewOverview

Basic ideas, curvesBasic ideas, curves

Subdivision SurfacesSubdivision Surfaces

AnalysisAnalysis

Page 3: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Subdivision conceptSubdivision concept

Polygon V=VPolygon V=V00

Subdivision rule VSubdivision rule Vjj !! V Vj+1j+1

1.1. Refine VRefine Vjj

2.2. Reposition verticesReposition vertices

Get VGet V11,V,V22,,

Page 4: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Spline curve subdivisionSpline curve subdivisionGet PGet Pj+1j+1 from P from Pjj by ”corner cutting”: by ”corner cutting”:(Chaikins algorithm ’74)(Chaikins algorithm ’74)

vv2k2k =(3=(3vvk-1k-1+ + vvkk)/4)/4 vv2k+12k+1 =( =( vvk-1k-1+3+3vvkk)/4)/4

Subdivision matrix M:Subdivision matrix M:

VV11 is a quadratic spline (smooth curve) is a quadratic spline (smooth curve)

jk

jk

jk

jj

v

v

v

MVV

1

11

13

31

13

4

1

Page 5: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Spline curve subdivisionSpline curve subdivision

Average twiceAverage twice

vv2k2k =(=(vvk-1k-1+ 6+ 6vvkk ++vvk+1k+1)/ 8)/ 8

vv2k+12k+1=(=(vvkk++vvk+1k+1)/2)/2

Subdivision matrix M s.t. Subdivision matrix M s.t.

VV11 is a cubic spline is a cubic spline

Lane&Riesefeldt[80]: Average d-1 times to get degree dLane&Riesefeldt[80]: Average d-1 times to get degree d

ManyMany other schemes, e.g. interpolating 4-pt scheme other schemes, e.g. interpolating 4-pt scheme

2/)(

8/)6(

2/)(

....

0440

0161

0044

......

8

1

1

11

1

1

11

kk

kkk

kk

k

k

kjj

vv

vvv

vv

v

v

v

MVV

Page 6: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Subdivision SurfacesSubdivision SurfacesSame concept: Refine piecewise linear geometrySame concept: Refine piecewise linear geometry

VV0 0 V V11 V V2 2 V V11

Properties of limit surface VProperties of limit surface V11?? Continuous, smooth, fair…?Continuous, smooth, fair…?

Page 7: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Applications: modelingApplications: modeling

Page 8: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Applications: animationApplications: animation

Page 9: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Applications: gamesApplications: games

Half-life 2 (Released Nov 2004)

Page 10: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Spline surface subdivisionSpline surface subdivisionVV00 – regular control mesh (grid) in 3D – regular control mesh (grid) in 3D Generalize univariate subdivision rule:Generalize univariate subdivision rule:

RefineRefineRepositionReposition

Still linear rules, subdivision matrixStill linear rules, subdivision matrix

VVj+1j+1=M=MVVjj

VVjj converge to bi-quadratic spline converge to bi-quadratic spline Generalize: d-1 averages gives bi-degree d Generalize: d-1 averages gives bi-degree d

16/316/9

16/1

Mask

16/3

Page 11: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Doo-Sabin scheme Doo-Sabin scheme (‘78) (‘78)

Generalization: arbitrary mesh Generalization: arbitrary mesh

n-sided facesn-sided faces

Any valence (Not only 4)Any valence (Not only 4)

Masks:Masks:

Still have Still have VVj+1j+1=M=MVVjj (linearity)(linearity)

0

1

2

3

4

n

njjj 4

/2cos23

40,

Page 12: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Doo Sabin SubdivisionDoo Sabin Subdivision

Generalize bi-quadratic spline to arbitrary meshGeneralize bi-quadratic spline to arbitrary mesh

Smooth CSmooth C11 limit surface [DS,Peters&Reif98] limit surface [DS,Peters&Reif98]

Page 13: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Catmull-Clark Subdivision Catmull-Clark Subdivision (‘78) (‘78)

16

1

16

1

16

1

16

1

16

616

6

4

1

4

1

4

1

4

1

Edge maskFace mask

nn 1

Vertex mask

As before: VVj+1j+1=M =M VVjj

Constants:3/2n2 =1/4n2 (others possible)

Generalize bi-cubic splines Generalize bi-cubic splines limit is Climit is C22 exept in irregular points, [Peters&Reif98] exept in irregular points, [Peters&Reif98]

Page 14: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Catmull-Clark schemeCatmull-Clark schemeImplementation version

n

ivnf

1

1FACE

VERTEX

j

jj

jii fn

en

vn

nv

221

112

42121 ffvv

e

EDGE

Page 15: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Catmull-Clark, special rulesCatmull-Clark, special rulesCrease/bdy masks

Piecewise smooth surface

8

6

8

1

8

1

2

12

1

Page 16: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Loop’s scheme (‘87)Loop’s scheme (‘87)

EdgeEdge

VertexVertex

nn

n1

nn

nn

nn

nn

nn

8

3

8

1

8

3

8

1

22

cos234064

1

nn

Page 17: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Loop’s scheme (‘87)Loop’s scheme (‘87)

EdgeEdge

VertexVertex

22

cos234040

1

nn

Implementation version

8

3

8

1

8

3

8

1

nn

n1

nn

nn

nn

nn

nn

Page 18: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Loop, special rulesLoop, special rules

Bdy/crease: cubic spline rulesBdy/crease: cubic spline rules

2

1

2

1

8

1

8

18

6

Edge Rule Vertex Rule

Other rules / effects possible (e.g. piecewise smooth)

Page 19: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Loop’s schemeLoop’s scheme

Generalize 3-direction (quartic) box-splinesGeneralize 3-direction (quartic) box-splines

CC22 almost everywhere, C almost everywhere, C11 in irregular points in irregular points

Can be seen as a refine and average schemeCan be seen as a refine and average scheme

Page 20: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Famous schemesFamous schemes

Page 21: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Subdivision schemesSubdivision schemesMany schemes, ways to refine mesh etc.Many schemes, ways to refine mesh etc.

Mesh types: tris, quads, hex…, combinationsMesh types: tris, quads, hex…, combinationsInterpolating/ApproximatingInterpolating/Approximating(Non)Uniform(Non)Uniform(Non)Stationary(Non)Stationary(Non)Linear(Non)Linear

””Subdivision zoo”Subdivision zoo”Midpoint scheme [Peters&Reif]Midpoint scheme [Peters&Reif]√√3 scheme [Kobbelt]3 scheme [Kobbelt]””Refine&average” [Stam/Warren et al]Refine&average” [Stam/Warren et al]4-8 subdivision [Velho&Zorin]4-8 subdivision [Velho&Zorin]Tri/Quad schemesTri/Quad schemesInterpolating curvesInterpolating curves……many moremany more

Page 22: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Pros and consPros and consPros:Pros:

Many of the pros of splinesMany of the pros of splinesFlexible wrt. topology/meshFlexible wrt. topology/meshNo gaps or seams!No gaps or seams!Features are ”easy”Features are ”easy”Simple to implementSimple to implementEfficient to visualizeEfficient to visualizeSimple/intuitive to manipulateSimple/intuitive to manipulate

Cons:Cons:No global closed form (but locally)No global closed form (but locally)Evaluation not straight forward (but…)Evaluation not straight forward (but…)CCkk , k>1 is hard , k>1 is hardArtefacts (ripples etc.)Artefacts (ripples etc.)CC cannot make convex surface if n>5 CC cannot make convex surface if n>5 [Peters&Reif04][Peters&Reif04]

Geri’s Game (Pixar studios)

Splines in Toy Story 1

Page 23: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Limit surface analysis Limit surface analysis

Consider Loop schemeConsider Loop schemeLinearLinearAffine invariantAffine invariantConvex hull propertyConvex hull propertyStationaryStationarySymmetricSymmetricSmooth in regular regionsSmooth in regular regions

Study properties of VStudy properties of V11 = lim = limj j !! 11VVjj

Limit points and normals Limit points and normals GG11 (tangent plane) continuity (tangent plane) continuityCC11 continuity continuityCCk k continuity, k=2,…continuity, k=2,…

a1

a2

N

a0

Page 24: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Parametric representationParametric representation

Limit surface is parametric over VLimit surface is parametric over Vjj

s : Vs : Vjj !! RR33

p p 22 V Vjj is mapped to s(v) is mapped to s(v) 22 V V11

VV11 is a spline in regular regions is a spline in regular regions

i.e. has a polynomial representation i.e. has a polynomial representation

Regular regions join smoothlyRegular regions join smoothly

What about irregular points/regions?What about irregular points/regions? Polynomial patchon regular region

Page 25: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Irregular pointsIrregular pointsSurrounded by regular rings (eventually):Surrounded by regular rings (eventually):

Subdivision Subdivision

Preserves valence Preserves valence

Adds regular verticesAdds regular vertices

So So

regular region growsregular region grows

irregular region shrinksirregular region shrinks

Refinement adds a (regular) spline ring around IPRefinement adds a (regular) spline ring around IP

All points but IP is in regular region eventually All points but IP is in regular region eventually

Rings join smoothlyRings join smoothly

Page 26: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Spline ringsSpline rings

Study irregular vertex v and neighbourhood PStudy irregular vertex v and neighbourhood P jj

What does PWhat does P11 look like around v? look like around v? Regular spline ring depends only on PRegular spline ring depends only on Pjj

xxjj::nn !! RRnn = {1, = {1,,n},n}££L, j=0,1,… L, j=0,1,…

xxjj = = B Bii p piijj==BB P Pjj

Smooth ”basis” functions BSmooth ”basis” functions B11,,,B,BNN

BBi i : : nn!! RR

0 0 ·· B Bii ·· 1, 1, B Bii =1, =1,

Limit points are convex comb. of PLimit points are convex comb. of Pjj

L

v

Page 27: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

The local subdivision matrixThe local subdivision matrixSquare matrix S such that for all jSquare matrix S such that for all j

PPj+1j+1=S P=S Pjj=S=Sjj P P00

S determines limit surface locally S determines limit surface locally

S is non-defective, S=QS is non-defective, S=QQQ-1-1

Q = (Q = (qq00,,qq11,,qqLL) eigenvectors) eigenvectors = diag(= diag(00,,11,,) |) |00||¸̧||11||¸̧…… Eigen-expansion Eigen-expansion

PPjj= Q= QjjQQ-1 -1 PP0 0 == iijj qqii aai , i , aaii22 RR33

Spectral properties of S are fundamental!!!Spectral properties of S are fundamental!!!

v

Page 28: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

EigenfunctionsEigenfunctions

Recall Recall

xxjj = = B Bii p piijj==BB P Pj j ==BB S Sjj P P00

== B B Q Q jj Q Q-1-1 P P00

Define eigenfunctions Define eigenfunctions BBQ = (Q = (00,,,,NN))

i i : : nn!! R R

ii:= := BB qq

ii

Eigen-expansion: Eigen-expansion:

xxjj = =iijj ii aaii

Page 29: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Limit surfaceLimit surfaceLimit surface PLimit surface P11 = = x xjj ( (nn))

xxjj = = i=1i=1ii

jj ii aai i , j=0,1,2,, j=0,1,2,

Can show (Loop’s and others)Can show (Loop’s and others)

0 0 =1 > =1 > = = 11==22 > > 3 3

qq11 qq2 2 linearly independentlinearly independentqq00=(1,1,=(1,1,,1),1)

00´́1 since 1 since B Bii =1 =1

Thus Thus xxjj =a =a00++jj ( (11 a a

11 + +

22 a a

22 )+ o( )+ o(jj) ) !! aa00

aa00 = = ll00 P P00 where where ll00 is left eigenvector of a n+1 system is left eigenvector of a n+1 system

In fact: In fact: PPjj converge to s(v)= converge to s(v)=aa00

The limit surface is continuous in vThe limit surface is continuous in v

Page 30: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Tangent planeTangent planeEach spline ring Each spline ring xxjj is C is C11 and hence G and hence G11

xxjj = a= a00 + + j j 1 1 aa11++ 22 aa2 2 + + jj

DifferentiateDifferentiate DDuu x xjj = = j j (D(Duu 1 1 aa11++ DDuu

22 aa22+ + DDvv x xjj = = j j (D(Dvv 1 1 aa11++ DDvv

22 aa22+ +

Normal(Normal(xxjj)) = D= Duu x xjj ££ D Dvv x xjj /||D /||Duu x xjj ££ D Dvv x xjj|| || !! aa11££aa2 2 /||/||aa11££aa22|| ||

Limit normal is well defined and continuous if Limit normal is well defined and continuous if

andand a a11££aa2 2 0 0

Then Limit surface is GThen Limit surface is G1 1 for generic initial datafor generic initial data

Tangent vectors Tangent vectors aa11, , aa22 found using left eigenvectors of small system found using left eigenvectors of small system

a1

a2

N

021

21

vv

uu

DD

DD

a0

Page 31: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

CC1 1 regularity regularity VV11 is C is C11 if it is C if it is C11 fcn. over the Tangent Plane (TP) fcn. over the Tangent Plane (TP)

xxjj= = aa00 + + jj ( (11 aa11+ + 22 aa22)+o()+o(jj) , ) , aaii 22 RR33

””rings rings xxjj converge uniformly to tangent plane” converge uniformly to tangent plane”TP component scaled by TP component scaled by

j+1j+1 ( (11 aa11+ + 22 aa2 2 )= )= ( (jj ( (11 aa11+ + 22 aa2 2 ))))

So TP parameterized by similar ringsSo TP parameterized by similar rings

aa00 + + jj ( (11 aa11+ + 22 aa22), j=0,1,), j=0,1,

Param. is injective if Param. is injective if 11aa11+ + 22aa2 2 isis

Then the limit surface is CThen the limit surface is C11 around around aa00

a2 a1

a0

Page 32: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Characteristic mapCharacteristic map

Defined as Defined as ::=(=(11,,): ): nn!! RR22

==B B ((qq11,q,q22))

TheoremTheorem[Reif95]: P[Reif95]: P11 is Cis C11 for generic initial data if for generic initial data if

:=:=11==22>|>|33| with | with qq11,,qq22 lin. independent lin. independent

is regular and injectiveis regular and injective

Conditions means Conditions means has a cont. Inverse, has a cont. Inverse,PP11 is a graph over TP near IP, thus C is a graph over TP near IP, thus C11 regular regular

can be used to parameterize Pcan be used to parameterize P11

Many schemes are CMany schemes are C1 1 (DS, CC, Loop, Midpoint…)(DS, CC, Loop, Midpoint…)[Peters&Reif,Umlauf,…][Peters&Reif,Umlauf,…]

Not injectiveNot injective

nn))

nn

Injective

nn))

Page 33: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Spectral analysisSpectral analysis

S often block circulantS often block circulant )) find Q and find Q and with Fourier techniques with Fourier techniques

DominantDominant eigenpair: eigenpair: 00, , qq00

Controls continuity, convergenceControls continuity, convergence

00=1>|=1>|11| and | and qq00=(1,=(1,,1) (Affine invariance),1) (Affine invariance)

SubdominantSubdominant eigenpairs: eigenpairs: :=:=11¸̧22¸̧Controls tangent plane continuity Controls tangent plane continuity

Want 1> Want 1> := := 11==22>|>|33| and | and qq11,,qq22 lin. indep. lin. indep.

Sub-subdominantSub-subdominant eigenpairs: eigenpairs: :=:=33¸̧4 4 ¸̧Controls curvatureControls curvature

Want Want 2 2 ¸̧ | |||

Page 34: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Continuous Curvature – CContinuous Curvature – C22

MUCHMUCH harder to get harder to get

Holy grailHoly grail: : CC2 2 , local, stationary, , local, stationary, 0, low degree 0, low degreeLarge support / High degree ?Large support / High degree ?[Prautzsch/Reif]: pol. scheme must have d[Prautzsch/Reif]: pol. scheme must have d¸̧ 2k+2 for C 2k+2 for Ckk Thus degree Thus degree ¸̧ 6 for C 6 for C22

Non-stationary? Non-stationary?

0 in irregular points [Prautzsch&Umlauf]0 in irregular points [Prautzsch&Umlauf]

Neccessary condition for bounded curvature : |Neccessary condition for bounded curvature : |||2 2 ¸̧ | |33||

Has been used to construct/improve schemesHas been used to construct/improve schemes[Prautzsch&Umlauf][Prautzsch&Umlauf]

Page 35: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

Scheme manipulationScheme manipulation

Recall S=Q Recall S=Q Q Q-1-1

Manipulate Manipulate Set e.g. |Set e.g. |33||·· | |||22

New eigenvalues in New eigenvalues in 22

New scheme SNew scheme S22=Q=Q22QQ-1-1 with better properties with better properties

e.g. bounded curvature, Ce.g. bounded curvature, C22

Note: May destroy other properties, e.g. symmetryNote: May destroy other properties, e.g. symmetry

Page 36: Introduction to Subdivision surfaces Martin Reimers CMA, University of Oslo

ConclusionConclusion

Subdivision very useful in computer graphicsSubdivision very useful in computer graphics

Better methods needed for high end CADBetter methods needed for high end CAD

Analysis of linear schemes based on linear algebraAnalysis of linear schemes based on linear algebra

Limit points and tangent vectors easy to findLimit points and tangent vectors easy to find

Nonlinear/Nonstationary: Not much is known??, harder!Nonlinear/Nonstationary: Not much is known??, harder!