Introduction to Computer Graphics Modeling (2) April 23, 2020 - - PowerPoint PPT Presentation

introduction to computer graphics modeling 2
SMART_READER_LITE
LIVE PREVIEW

Introduction to Computer Graphics Modeling (2) April 23, 2020 - - PowerPoint PPT Presentation

Introduction to Computer Graphics Modeling (2) April 23, 2020 Kenshi Takayama Subdivision surfaces First, well look at its theoretical basis: B-Spline curves Basis 2 Example: 2D polyline represented as function X-coord Y Look


slide-1
SLIDE 1

Introduction to Computer Graphics – Modeling (2) –

April 23, 2020 Kenshi Takayama

slide-2
SLIDE 2

Subdivision surfaces

2

First, we’ll look at its theoretical basis:

B-Spline curves

Basis

slide-3
SLIDE 3

Example: 2D polyline represented as function

3

(1.4, -1.6) (-0.4, -3.0) (-1.4, -1.3) (-0.3, -0.3) (-0.7, 1.1) (-1.2, 2.0) (-2.2, 3.2) Parameter t 1 2 3 4 5 6 1 2

  • 1
  • 2

X-coord

Look at X-coord function

t=0 t=6 X Y

slide-4
SLIDE 4

Representing polyline using linear basis

4

1.4 ×

  • 0.4 ×
  • 1.4 ×
  • 0.3 ×
  • 0.7 ×
  • 1.2 ×
  • 2.2 ×

X-coord

slide-5
SLIDE 5

de Boor’s n-th order basis

  • Recursively defined:
  • 𝐶" 𝑢 = $1, 0 ≤ 𝑢 < 1

0, otherwise

  • 𝐶# 𝑢 = $

# 𝐶#%& 𝑢 + #'&%$ #

𝐶#%&(𝑢 − 1)

  • Properties:
  • n-th order piecewise polynomial
  • Zero outside [0, n+1] (local support)
  • Cn-1 continuous

5

𝐶!(𝑢) 𝐶"(𝑢) 𝐶#(𝑢) 1 1/2 2/3 3/4 𝑢 𝑢 𝑢 1 2 3 4 1/6 𝐶#

$ 1 = 1/2

Linear Quadratic Cubic

slide-6
SLIDE 6

6

1.4 ×

  • 0.4 ×
  • 1.4 ×
  • 0.3 ×
  • 0.7 ×
  • 1.2 ×
  • 2.2 ×

Using quadratic basis è quadratic B-spline

slide-7
SLIDE 7

Using cubic basis è cubic B-spline

7

1.4 ×

  • 0.4 ×
  • 1.4 ×
  • 0.3 ×
  • 0.7 ×
  • 1.2 ×
  • 2.2 ×
slide-8
SLIDE 8

Important property of basis: partition-of-unity

  • X-coord of B-spline: 𝑦 𝑢 = ∑! 𝑦! 𝐶" 𝑢 − 𝑗
  • Consider moving all control points 𝑦! by the same amount 𝑑 :
  • 𝑦 𝑢 = ∑0 𝑦0 + 𝑑 𝐶# 𝑢 − 𝑗

= ∑0 𝑦0𝐶# 𝑢 − 𝑗 + 𝑑 ∑0 𝐶# 𝑢 − 𝑗

  • Partition-of-unity ensures that the entire curve is also moved by 𝑑

8

t 1/2 1 t 2/3 1/2 1 1/2 t 1/2 1

𝑢! 2 𝑢 − 1 ! 2 − 2𝑢 − 1 ! + 4 6

Quadratic basis 1

slide-9
SLIDE 9

Cubic B-spline vs. Cubic Catmull-Rom spline

9

Piecewise cubic Piecewise cubic Linear combination of cubic bases

Given coordinate value at each knot 𝑢 = 𝑢(, compute derivative at each knot Hermite interpolation for each interval

Representation Defined as

Continuity across intervals

C1-continuous C2-continuous

Passes through CPs?

Yes No

slide-10
SLIDE 10

From B-spline to subdivision

10

slide-11
SLIDE 11

Another important property of basis function

  • Can be decomposed into weighted sum of the same basis functions

with halved support

11

Quadratic

=

1 3 2 2.5 1.5 0.5

×3/4 ×3/4 ×1/4 ×1/4

slide-12
SLIDE 12

Decomposing quadratic B-spline

12

1.4 ×

  • 0.4 ×
  • 1.4 ×
  • 0.3 ×
  • 0.7 ×
  • 1.2 ×
  • 2.2 ×
slide-13
SLIDE 13

Decomposing quadratic B-spline

13

3/4 1/4

3 4 1.4 + 1 4 −0.4

1.4 ×

  • 0.4 ×
  • 1.4 ×
  • 0.3 ×
  • 0.7 ×
  • 1.2 ×
  • 2.2 ×

1/4 3/4

1 4 1.4 + 3 4 −0.4

slide-14
SLIDE 14

Decomposing quadratic B-spline

14

1 4 1.4 + 3 4 −0.4 3 4 1.4 + 1 4 −0.4 3 4 1.4 1 4 1.4 1 4 −0.4 + 3 4 −1.4 3 4 −0.4 + 1 4 −1.4 1 4 −1.4 + 3 4 −0.3 1 4 −0.3 + 3 4 −0.7 3 4 −0.3 + 1 4 −0.7 1 4 −0.7 + 3 4 −1.2 3 4 −0.7 + 1 4 −1.2 1 4 −1.2 + 3 4 −2.2 3 4 −1.2 + 1 4 −2.2 1 4 −2.2 3 4 −2.2 3 4 −1.4 + 1 4 −0.3

slide-15
SLIDE 15

Generating quadratic curves via subdivision

15

3/4 1/4 3/4 1/4 Stencil A 3/4 1/4 3/4 1/4 Stencil B

  • Split each vertex into 2 new vertices

(= For each edge, generate 2 new vertices)

slide-16
SLIDE 16

Generating quadratic surfaces via subdivision

16

Bi-quadratic basis: 𝐶"," 𝑡, 𝑢 = 𝐶" 𝑡 𝐶"(𝑢) 3/16 9/16 1/16 3/16 3/16 1/16 Stencil 3/16 9/16 3/4 1/4 3/4 1/4 ⊗

  • Split each vertex into 4 new vertices

(= For each face, generate 4 new vertices)

slide-17
SLIDE 17

Subdividing a torus

17

slide-18
SLIDE 18

For the case of cubic B-spline

18

×1/2 ×1/2 ×1/8 ×1/8 ×3/4

Cubic basis

=

1 3 2 2.5 1.5 0.5 4 3.5

slide-19
SLIDE 19

Decomposing cubic B-spline

19

1.4 ×

  • 0.4 ×
  • 1.4 ×
  • 0.3 ×
  • 0.7 ×
  • 1.2 ×
  • 2.2 ×
slide-20
SLIDE 20

Decomposing cubic B-spline

20

1.4 ×

  • 0.4 ×
  • 1.4 ×
  • 0.3 ×
  • 0.7 ×
  • 1.2 ×
  • 2.2 ×

1/2 1/2 1/8 3/4 1/8

slide-21
SLIDE 21

Decomposing cubic B-spline

21

1 8 1.4 + 3 4 −0.4 + 1 8 −1.4 1 2 1.4 + 1 2 −0.4 1 8 1.4 1 2 1.4 3 4 1.4 + 1 8 −0.4 1 8 −2.2 1 2 −2.2 1 8 −1.2 + 3 4 −2.2 1 8 −0.4 + 3 4 −1.4 + 1 8 −0.3 1 2 −0.4 + 1 2 −1.4 1 8 −1.4 + 3 4 −0.3 + 1 8 −0.7 1 2 −1.4 + 1 2 −0.3 1 8 −0.3 + 3 4 −0.7 + 1 8 −1.2 1 2 −0.3 + 1 2 −0.7 1 8 −0.7 + 3 4 −1.2 + 1 8 −2.2 1 2 −0.7 + 1 2 −1.2 1 2 −1.2 + 1 2 −2.2

slide-22
SLIDE 22

Generating cubic curves via subdivision

22

1/2 1/2 1/2 1/2 Stencil A 1/8 3/4 1/8 1/8 1/8 Stencil B 3/4

  • For each edge, generate a new vertex at its midpoint
  • Move each vertex to weighted average of its neighbors
slide-23
SLIDE 23

Generating cubic surfaces via subdivision

23

Bi-cubic basis: 𝐶#,# 𝑡, 𝑢 = 𝐶# 𝑡 𝐶#(𝑢) 1/4 1/4 “face point” stencil 1/4 1/4 1/2 1/2 1/2 1/2 ⊗ 1/4 1/4 1/4 1/4

  • For each face, generate a new vertex at its barycenter
slide-24
SLIDE 24

Generating cubic surfaces via subdivision

24

Bi-cubic basis: 𝐶#,# 𝑡, 𝑢 = 𝐶# 𝑡 𝐶#(𝑢) 1/16 3/8 “edge point” stencil 3/8 1/16 1/8 1/8 1/2 1/2 ⊗ 1/16 1/16 3/8 3/8 1/16 1/16 1/16 1/16 3/4

  • For each edge, generate a new vertex at weighted average of its neighbors
slide-25
SLIDE 25

Generating cubic surfaces via subdivision

25

Bi-cubic basis: 𝐶#,# 𝑡, 𝑢 = 𝐶# 𝑡 𝐶#(𝑢) 1/64 3/32 “vertex point” stencil 9/16 3/32 1/8 1/8 1/8 1/8 ⊗ 1/64 3/32 3/32 9/16 1/64 3/32 1/64 3/32 3/4 1/64 3/32 1/64 3/32 1/64 1/64 3/4

  • Move each vertex to weighted average of its neighbors
slide-26
SLIDE 26

Subdividing a torus

26

slide-27
SLIDE 27

Generalizing subdivision scheme

27

slide-28
SLIDE 28

Assumption in the aforementioned formulation

  • “Clean” quadrilateral decomposition of the region
  • “Clean” vertex: # of neighboring faces (valence) is 4
  • If valence is not 4 è singularity
  • Generally impossible to obtain

except special cases (torus)

  • Strength of subdivision schemes: applicable to singularities
  • Generalize stencils through geometric interpretations

28

slide-29
SLIDE 29

Generalizing quadratic stencil (Doo-Sabin)

29

9/16 3/16 1/16 3/16

𝑄 = 1 16 9 𝐵 + 3 𝐶 + 3 𝐷 + 𝐸 = 𝐵 + 𝐶 + 𝐷 + 𝐸 4 + 𝐵 + 𝐶 2 + 𝐵 + 𝐷 2 + 𝐵 4 è Applicable to general polygon mesh

A B D C P Barycenter Midpoint Midpoint For each polygon’s each vertex, generate a new vertex at the average of the polygon’s barycenter, its adjacent edges’ midpoints, and itself

slide-30
SLIDE 30

Examples of Doo-Sabin

30

slide-31
SLIDE 31

Examples of Doo-Sabin

31

slide-32
SLIDE 32

Generalizing cubic stencils (Catmull-Clark)

32

1/4 1/4 1/4 1/4

𝑄 = 𝐵& + 𝐵7 + 𝐵8 + 𝐵9 4 è Applicable to general polygon mesh

A1 A2 A3 A4 P For each polygon, generate a new vertex at its barycenter

slide-33
SLIDE 33

Generalizing cubic stencils (Catmull-Clark)

33

1/16 1/16

è Applicable to general polygon mesh

3/8 3/8 B2 B1 1/16 1/16 B3 B4 A1 A2

𝑄 = 3 8 𝐵& + 𝐵7 + 1 16 𝐶& + 𝐶7 + 𝐶8 + 𝐶9 = 𝐵& + 𝐵7 + 𝐶& + 𝐶7 4 + 𝐵& + 𝐵7 + 𝐶8 + 𝐶9 4 2 + 𝐵& + 𝐵7 2 2

P Barycenter Barycenter Midpoint For each edge, generate a new vertex at the average of the barycenters of its adjacent polygons and its midpoint

slide-34
SLIDE 34

Generalizing cubic stencils (Catmull-Clark)

34

è Applicable to general polygon mesh

𝑄 = 9 16 𝐵 + 3 32 𝐶! + 𝐶" + 𝐶# + 𝐶$ + 1 64 𝐷! + 𝐷" + 𝐷# + 𝐷$

= 1 4 𝐵 + 𝐶" + 𝐷" + 𝐶! 4 + 𝐵 + 𝐶! + 𝐷! + 𝐶# 4 + 𝐵 + 𝐶# + 𝐷# + 𝐶$ 4 + 𝐵 + 𝐶$ + 𝐷$ + 𝐶" 4 4

+ 2 4 𝐵 + 𝐶! 2 + 𝐵 + 𝐶" 2 + 𝐵 + 𝐶# 2 + 𝐵 + 𝐶$ 2 4 + 1 4 𝐵

Barycenter Midpoint

1/64 3/32 C1 1/64 C4 B1 1/64 3/32 C2 1/64 C3 B3 3/32 9/16 B2 3/32 B4 A When A’s valence is n, 𝑄 = 1 𝑜 𝑅 + 2 𝑜 𝑆 + 𝑜 − 3 𝑜 𝐵 P

Barycenter Barycenter Barycenter Midpoint Midpoint Midpoint

𝑆 𝑅

slide-35
SLIDE 35

Comparison

35

= cubic surface = quadratic surface

slide-36
SLIDE 36

Subdivision scheme for triangle meshes (Loop)

  • Based on B-spline basis defined
  • n triangular lattice
  • C2-continuous cubic surface except at singularities

36

When valence isn’t 6 è derived from complicated analysis (see Loop’s paper)

slide-37
SLIDE 37

Comparing Catmull-Clark & Loop

  • Catmull-Clark is de facto standard in CG industry
  • Quad meshes can naturally represent two principal curvature directions

37

Catmull-Clark Loop Catmull-Clark

slide-38
SLIDE 38

Other subdivision schemes

  • four-point method
  • Passes through CPs (interpolating)
  • çè approximating
  • Cannot be represented as polynomials
  • C1-continous
  • Surface version: butterfly method
  • Many more variants
  • Kobbelt’s method
  • 3-method
  • etc...

38

−1/16 −1/16 9/16 9/16

slide-39
SLIDE 39

Geri’s Game (Pixar, 1997)

  • First film using

subdivision surfaces

  • Previously (Toy Story),

tedious modeling work using B-splines

39

https://www.youtube.com/watch?v=9IYRC7g2ICg Subdivision surfaces in character animation [DeRose,Kass,Truong,SIGGRAPH98]

slide-40
SLIDE 40

Controlling smoothness

  • Can represent sharp edges by altering subdivision rules

40

Subdivision surfaces in character animation [DeRose,Kass,Truong,SIGGRAPH98] sharpness=0 sharpness=1 sharpness=2 sharpness=3 sharpness=∞

slide-41
SLIDE 41

Controlling smoothness

  • Can represent sharp edges by altering subdivision rules

41

Subdivision surfaces in character animation [DeRose,Kass,Truong,SIGGRAPH98]

slide-42
SLIDE 42

Resources for learning subdivision techniques

  • Smooth Subdivision Surfaces Based on Triangles [Loop, MSc. Thesis 87]
  • Thorough & visual explanation of literature (Doo-Sabin & Catmull-Clark)
  • Some known errors:

http://www.cs.berkeley.edu/~sequin/CS284/TEXT/LoopErrata.txt

  • Subdivision for Modeling and Animation [SIG00 Course]
  • Most famous survey, but a little arcane
  • http://www.cs.nyu.edu/~dzorin/sig00course/
  • OpenSubdiv from research to industry adoption [SIG13 Course]
  • More recent topics
  • http://dx.doi.org/10.1145/2504435.2504451

42

slide-43
SLIDE 43

Halfedge data structure

43

slide-44
SLIDE 44

Mesh representation using vertex & face lists

44

OFF 8 6 0

  • 0.5 -0.5 0.5

0.5 -0.5 0.5

  • 0.5 0.5 0.5

0.5 0.5 0.5

  • 0.5 0.5 -0.5

0.5 0.5 -0.5

  • 0.5 -0.5 -0.5

0.5 -0.5 -0.5 4 0 1 3 2 4 2 3 5 4 4 4 5 7 6 4 6 7 1 0 4 1 7 5 3 4 6 0 2 4

ß xyz coord of 0th vertex ß xyz coord of 7th vertex ß #vertices, #faces ß 0th face’s #vertices and vertex indices ß 6th face’s #vertices and vertex indices 6 1 2 3 4 5 7 Geometry data Topology data OFF file format x y z ・・・ ・・・

slide-45
SLIDE 45

Mesh representation using vertex & face lists

  • Info needed during mesh processing (e.g. subdivision)
  • Set of faces around a vertex
  • Set of faces adjacent to a face
  • Vertices at an edge’s endpoints
  • Faces at both sides of an edge
  • etc...
  • Can be stored as “array or arrays”, but consumes more memoryL

45

6 1 2 3 4 5 7

slide-46
SLIDE 46

Halfedge data structure

  • Store link information:

(1) Vertex à One of halfedges emanating from it (2) Face à One of halfedges composing it (3) Halfedge à Vertex that it points to (4) Halfedge à Face that it belongs to (5) Halfedge à Next halfedge (6) Halfedge à Halfedge opposite to it

  • Circling around a face:

(2) à (5) à (5) à ...

  • Circling around a vertex:

(1) à (6) à (5) à (6) à (5) à ...

46

http://www.openmesh.org/

slide-47
SLIDE 47

When a new face is added

  • Generate halfedges
  • Link vertex to halfedge (1)
  • Link halfedge to vertex (3)
  • Link halfedge to next halfedge (5)
  • Link halfedges to face (4)
  • Link face to halfedge (2)
  • Link halfedge to its opposite halfedge if such exists (6)

47

slide-48
SLIDE 48

Papers

  • Recursively generated B-spline surfaces on arbitrary topological meshes

[Catmull,Clark,CAD78]

  • A 4-point interpolatory subdivision scheme for curve design [Dyn,Levin,CAGD87]
  • A butterfly subdivision scheme for surface interpolation with tension control

[Dyn,Levine,Gregory,TOG90]

  • Sqrt(3)-subdivision [Kobbelt,SIGGRAPH00]
  • Exact evaluation of Catmull-Clark subdivision surfaces at arbitrary parameter values

[Stam,SIGGRAPH98]

  • Interactive multiresolution mesh editing [Zorin,Schroder,Sweldens,SIGGRAPH97]
  • Interpolating subdivision for meshes with arbitrary topology

[Zorin,Schroder,Sweldens,SIGGRAPH96]

48