subdivision surfacesmisha/fall19/19.pdf · subdivision surfaces michael kazhdan (601.457/657)...

Post on 19-Jun-2020

35 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Subdivision Surfaces

Michael Kazhdan

(601.457/657)

Subdivision for Modeling and Animation, Zorin et al. 2000

Announcements

• Assignment 3 has been posted Requires linking to the OpenGL libraries

» ASAP: Make sure you can compile!

Minor changes to AffineShape::drawOpenGL()» See Assignment3 web-page announcements

Implementations of Shape::updateBoundingBox() will

not be made available until after the Assignment2

deadline (+5 days) has passed

Surfaces

• What makes a good surface representation? Concise

Local support

Affine invariant

Arbitrary topology

Guaranteed smoothness

Natural parameterization

Efficient display

Efficient intersections

Subdivision Surfaces

• Properties: Concise

Local support

Affine invariant

Arbitrary topology

Guaranteed smoothness

Natural parameterization

Efficient display

Efficient intersections

Pixar

Subdivision

• How do you make a smooth curve?

Zorin & SchroederSIGGRAPH 99

Course Notes

We want to “smooth out” severe angles

Subdivision

• How do you make a smooth curve?

Zorin & SchroederSIGGRAPH 99

Course Notes

We want to “smooth out” severe angles

Subdivision Surfaces

• Coarse mesh & subdivision rule Define smooth surface as limit of

sequence of refinements

Zorin & SchroederSIGGRAPH 99

Course Notes

Key Questions

• How to subdivide the mesh? Aim for properties like smoothness

• How to store the mesh? Aim for efficiency of implementing subdivision rules

Zorin & SchroederSIGGRAPH 99

Course Notes

General Subdivision Scheme

• How to subdivide the mesh?Two parts:

» Refinement: Add new vertices and connect (topological)

» Smoothing:Move vertex positions (geometric)

Loop Subdivision Scheme

• How to subdivide the mesh?» Refinement:

Subdivide each triangle into 4 triangles by

splitting each edge and connecting new vertices

Zorin & SchroederSIGGRAPH 99

Course Notes

Loop Subdivision Scheme

Zorin & SchroederSIGGRAPH 99

Course Notes

Existing vertex being moved

from one level to the next

• How to subdivide the mesh:» Refinement

» Smoothing (existing vertices): Choose new location as weighted average of original vertex

and its neighbors

Loop Subdivision Scheme

What about vertices that have more

Or less than 6 neighboring faces?What about (extraordinary) vertices with

more/less than 6 neighboring faces?

New_position = (1 − 𝑘)original_position + sum(*each_original_vertex)

• How to subdivide the mesh:» Refinement

» Smoothing (existing vertices): Choose new location as weighted average of original vertex

and its neighbors

Zorin & SchroederSIGGRAPH 99

Course Notes

Loop Subdivision Scheme

What about vertices that have more

Or less than 6 neighboring faces?What about (extraordinary) vertices with

more/less than 6 neighboring faces?

New_position = (1 − 𝑘)original_position + sum(*each_original_vertex)

• How to subdivide the mesh:» Refinement

» Smoothing (existing vertices): Choose new location as weighted average of original vertex

and its neighbors

Zorin & SchroederSIGGRAPH 99

Course Notes

𝟎 𝟏/𝒌:

• As increases, the contribution from adjacent

vertices plays a more important role.

• If = 0, the subdivision is interpolatory.

Where do existing vertices move?

• Choose so that the limit surface has guaranteed smoothness properties

» Original Loop

𝛽 =1

2

5

8−

3

8+1

4cos

2𝜋

𝑘

2

» Warren

𝛽 =

3

8𝑘𝑘 > 3

3

16𝑘 = 3

Loop Subdivision Scheme

• How to subdivide the mesh:» Refinement

» Smoothing (inserted vertices):Choose location as weighted average of original vertices in

local neighborhood

New vertex being inserted

Zorin & SchroederSIGGRAPH 99

Course Notes

Boundary Cases?

• What about boundary vertices / edges? Existing vertex adjacent to an incomplete “triangle fan”

New vertex bordered by only one triangle

Zorin & SchroederSIGGRAPH 99

Course Notes

Boundary Cases?

• Rules for boundary vertices / edges: Refine as though the vertices/edges are on the

(boundary) curve

Zorin & SchroederSIGGRAPH 99

Course Notes1/8 1/83/4 1/2 1/2

Loop Subdivision Scheme

Limit surface has provable smoothness properties!

Loop Subdivision Scheme

Geri’s Game, Pixar

Loop Subdivision Scheme

Pixar

Smooth surfaces can be

constructed from coarse meshes!

Loop Subdivision Scheme

Pixar

Zorin & SchroederSIGGRAPH 99

Course Notes

Sharp creases can be specified by specifying that

certain curves should subdivide as boundary curves.

Subdivision Schemes

• There are different subdivision schemes Different methods for refining topology

Different rules for positioning vertices

» Interpolating versus approximating

Zorin & Schroeder, SIGGRAPH 99 , Course Notes

Subdivision Schemes

• There are different subdivision schemes Different methods for refining topology

Different rules for positioning vertices

» Interpolating versus approximating

Zorin & Schroeder, SIGGRAPH 99 , Course Notes

In general, forcing the subdivision to be interpolating removes

degrees of freedom, making the solution less smooth.

Subdivision Schemes

Zorin & SchroederSIGGRAPH 99

Course Notes

Key Questions

• How to refine the mesh? Aim for properties like smoothness

• How to store the mesh? Aim for efficiency in implementing subdivision rules

Zorin & SchroederSIGGRAPH 99

Course Notes

Subdivision Smoothness

To determine the smoothness of the subdivision:

• Repeatedly apply the subdivision scheme

• Look at the neighborhood in the limit

Subdivision Smoothness

To determine the smoothness of the subdivision:

• Repeatedly apply the subdivision scheme

• Look at the neighborhood in the limit

Subdivision Smoothness

To determine the smoothness of the subdivision:

• Repeatedly apply the subdivision scheme

• Look at the neighborhood in the limit

Subdivision Smoothness

To determine the smoothness of the subdivision:

• Repeatedly apply the subdivision scheme

• Look at the neighborhood in the limit

Subdivision Smoothness

To determine the smoothness of the subdivision:

• Repeatedly apply the subdivision scheme

• Look at the neighborhood in the limit

Subdivision Smoothness

To determine the smoothness of the subdivision:

• Repeatedly apply the subdivision scheme

• Look at the neighborhood in the limit

Subdivision Smoothness

To determine the smoothness of the subdivision:

• Repeatedly apply the subdivision scheme

• Look at the neighborhood in the limit

Subdivision Smoothness

To determine the smoothness of the subdivision:

• Repeatedly apply the subdivision scheme

• Look at the neighborhood in the limit

Subdivision Smoothness

To determine the smoothness of the subdivision:

• Repeatedly apply the subdivision scheme

• Look at the neighborhood in the limit.

Subdivision Smoothness

To determine the smoothness of the subdivision:

• Repeatedly apply the subdivision scheme

• Look at the neighborhood in the limit.

Computing infinitely many iterations is

computationally prohibitive!

Subdivision Matrix

• Compute the new positions/vertices as a linear

combination of previous ones.

𝑝0

𝑝1𝑝6

𝑝5

𝑝4 𝑝3

𝑝2 𝑝0’𝑝5’

𝑝4’ 𝑝3’

𝑝2’

𝑝1’𝑝6’

Subdivision Matrix

• Compute the new positions/vertices as a linear

combination of previous ones.

𝑝0

𝑝1𝑝6

𝑝5

𝑝4 𝑝3

𝑝2 𝑝0’𝑝5’

𝑝4’ 𝑝3’

𝑝2’

𝑝1’𝑝6’

Subdivision Matrix𝑝0′

𝑝1′

𝑝2′

𝑝3′

𝑝4′

𝑝5′

𝑝6′

=1

16

10 1 1 1 1 1 16 6 2 0 0 0 26 2 6 2 0 0 06 0 2 6 2 0 06 0 0 2 6 2 06 0 0 0 2 6 26 2 0 0 0 2 6

𝑝0𝑝1𝑝2𝑝3𝑝4𝑝5𝑝6

Note:

The entries of the left and right vectors are 3D positions.

• We apply the matrix to each coordinate independently

Subdivision Matrix

• Compute the new positions/vertices as a linear

combination of previous ones.

• To find the limit position of 𝑝0, repeatedly apply

the subdivision matrix.

• Use eigenvalue

decomposition to

compute the 𝑛th

power of the matrix

efficiently.

𝑝0(𝑛)

𝑝1(𝑛)

𝑝2(𝑛)

𝑝3(𝑛)

𝑝4(𝑛)

𝑝5(𝑛)

𝑝6(𝑛)

=1

16

10 1 1 1 1 1 16 6 2 0 0 0 26 2 6 2 0 0 06 0 2 6 2 0 06 0 0 2 6 2 06 0 0 0 2 6 26 2 0 0 0 2 6

𝑛 𝑝0𝑝1𝑝2𝑝3𝑝4𝑝5𝑝6

Subdivision Matrix

• Compute the new positions/vertices as a linear

combination of previous ones.

• To find the limit position of 𝑝0, repeatedly apply

the subdivision matrix.

• Use eigenvalue

decomposition to

compute the 𝑛th

power of the matrix

efficiently.

𝑝0(𝑛)

𝑝1(𝑛)

𝑝2(𝑛)

𝑝3(𝑛)

𝑝4(𝑛)

𝑝5(𝑛)

𝑝6(𝑛)

=1

16

10 1 1 1 1 1 16 6 2 0 0 0 26 2 6 2 0 0 06 0 2 6 2 0 06 0 0 2 6 2 06 0 0 0 2 6 26 2 0 0 0 2 6

𝑛 𝑝0𝑝1𝑝2𝑝3𝑝4𝑝5𝑝6

If, after a change of basis we have 𝑀 = 𝐴−1𝐷𝐴, where 𝐷 is a

diagonal matrix, then:

𝑀𝑛 = 𝐴−1𝐷𝐴 𝐴−1𝐷𝐴 ⋯ 𝐴−1𝐷𝐴 𝐴−1𝐷𝐴= 𝐴−1𝐷𝑛𝐴

Since 𝐷 is diagonal, raising 𝐷 to the 𝑛th power just amounts to

raising each of the diagonal entries of 𝐷 to the 𝑛th power.

𝐷𝑛 =𝜆0 ⋯ 0⋮ ⋱ ⋮0 ⋯ 𝜆6

𝑛

=𝜆0𝑛 ⋯ 0⋮ ⋱ ⋮0 ⋯ 𝜆6

𝑛

• If 𝜆𝑖 > 1 for any 0 ≤ 𝑖 ≤ 6, then 𝐷𝑛 blows up as 𝑛 → ∞.

• If 𝜆𝑖 < 1 for all 0 ≤ 𝑖 ≤ 6, then 𝐷𝑛 collapses as 𝑛 → ∞.

• If 𝜆𝑖 = −1 for any 0 ≤ 𝑖 ≤ 6, then 𝐷𝑛 cannot

converge as 𝑛 → ∞.

Subdivision Matrix

Set 𝑀∞ to be the matrix:

𝑀∞ = 𝐴−1𝜆0∞ ⋯ 0⋮ ⋱ ⋮0 ⋯ 𝜆6

∞𝐴

with 𝜆𝑖∞ = 1 if 𝜆𝑖 = 1, and 𝜆𝑖

∞ = 0 otherwise.

The limit of the point 𝑝0 under repeated subdivision

is the vector 𝑝0∞, with:

𝑝0∞

𝑝6∞

= 𝑀∞

𝑝0

⋮𝑝6

Subdivision Matrix

Set 𝑀∞ to be the matrix:

𝑀∞ = 𝐴−1𝜆0∞ ⋯ 0⋮ ⋱ ⋮0 ⋯ 𝜆6

∞𝐴

with 𝜆𝑖∞ = 1 if 𝜆𝑖 = 1, and 𝜆𝑖

∞ = 0 otherwise.

The limit of the point 𝑝0 under repeated subdivision

is the vector 𝑝0∞, with:

𝑝0∞

𝑝6∞

= 𝑀∞

𝑝0

⋮𝑝6

Using a similar approach we can derive an

expression for the normal at the limit point.

• For the normal to be well-defined, we get

additional constraints on diagonal values.

Local support

Local support

Modifying a vertex position at the coarser level

Local support

Modifying a vertex position at the coarser level We modify positions in the one-ring at the next level

Local support

Modifying a vertex position at the coarser level We modify positions in the one-ring at the next level

» Which modifies positions in the one-ring at the next level

Because we refine by a factor of two at each level, the

effects are limited within the two-ring at the original level.

Key Questions

• How to refine the mesh? Aim for properties like smoothness

• How to store the mesh? Aim for efficiency in implementing subdivision rules

Zorin & SchroederSIGGRAPH 99

Course Notes

Polygon Meshes

• Mesh Representations Independent faces

Vertex and face tables

Adjacency lists

Winged-Edge

Independent Faces

• Each face lists vertex coordinates

Independent Faces

• Each face lists vertex coordinates Redundant vertices

No vertex-adjacency info

Independent Faces

• Each face lists vertex coordinates Redundant vertices

No vertex-adjacency info

Moving a vertex requires changing

the coordinates of each instance!

Vertex and Face Tables

• Each face lists vertex references

Vertex and Face Tables

• Each face lists vertex references✓Shared vertices

Moving a vertex requires changing

the coordinates of one point!

Vertex and Face Tables

• Each face lists vertex references✓Shared vertices

No (efficient) adjacency info

Adjacency Lists

• Store all vertex, edge, and face adjacencies

Adjacency Lists

• Store all vertex, edge, and face adjacencies ✓Efficient adjacency info

Adjacency Lists

• Store all vertex, edge, and face adjacencies ✓Efficient adjacency info

Extra storage

Variable size arrays

Changing the connectivity (e.g. subdividing)

requires adjusting many fields.

This makes it hard to work with because it creates

opportunities for inconsistency.

Partial Adjacency Lists

• Can we store only some (fixed-size) adjacency

relationships and derive others?

3

?

3

22?

?

3?

Winged Edge

• Adjacency encoded in edges All adjacencies in 𝑂(1) time

Little extra storage

Fixed-size records

Polygonal faces

Each edge stores:

4 “wing” edges

2 vertices

2 faces

Each face stores:

1 edge

Each vertex stores:

1 edge

Winged Edge

• Vertex table: A pointer to some incident edge

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge

• Vertex table: A pointer to some incident edge

Vertex positions (and other attributes)

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge

• Face table: A pointer to some incident edge

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge

• Edge table: Pointers to (S)tart and (E)nd vertices (orientation arbitrary)

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge

• Edge table: Pointers to (S)tart and (E)nd vertices (orientation arbitrary)

Pointers to (L)eft and (R)ight faces

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge

• Edge table: Pointers to (S)tart and (E)nd vertices (orientation arbitrary)

Pointers to (L)eft and (R)ight faces

Pointers to (L)eft and (R)ight edges

coming out of the (S)tart vertex

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge

• Edge table: Pointers to (S)tart and (E)nd vertices (orientation arbitrary)

Pointers to (L)eft and (R)ight faces

Pointers to (L)eft and (R)ight edges

coming out of the (S)tart vertex

Pointers to (L)eft and (R)ight edges

coming out of the (E)nd vertex

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge

Boundary edges: Have only have one incident face

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge

Boundary edges: Have only have one incident face

Wing edges are defined as though

the boundary was also a face

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge (Example)

Find CCW edges adjacent to 𝑣2.

Note:If 𝑣 is the (S)tart of edge 𝑒, the

next CCW edge is on the (L)eft side

of 𝑒 and comes out of the (S)tart.

Otherwise it is on the (R)ight side

of 𝑒 and comes out of the (E)nd.

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge (Example)

Find CCW edges adjacent to 𝑣2: Initialize: Choose the only edge coming out of 𝑣2 Do: Iterate CCW around 𝑣2 While: Haven’t cycled back to

the start edge

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge (Example)

Find CCW edges adjacent to 𝑣2: Initialize: Choose the only edge coming out of 𝑣2 Do: Iterate CCW around 𝑣2 While: Haven’t cycled back to

the start edge

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge (Example)

Find CCW edges adjacent to 𝑣2: Initialize: Choose the only edge coming out of 𝑣2 Do: Iterate CCW around 𝑣2 While: Haven’t cycled back to

the start edge

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge (Example)

Find CCW edges adjacent to 𝑣2: Initialize: Choose the only edge coming out of 𝑣2 Do: Iterate CCW around 𝑣2 While: Haven’t cycled back to

the start edge

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge (Example)

Find CCW edges adjacent to 𝑣2: Initialize: Choose the only edge coming out of 𝑣2 Do: Iterate CCW around 𝑣2 While: Haven’t cycled back to

the start edge

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge (Example)

Find CCW edges adjacent to 𝑣2: Initialize: Choose the only edge coming out of 𝑣2 Do: Iterate CCW around 𝑣2 While: Haven’t cycled back to

the start edge

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge (Example)

Find CCW edges adjacent to 𝑣2: Initialize: Choose the only edge coming out of 𝑣2 Do: Iterate CCW around 𝑣2 While: Haven’t cycled back to

the start edge

L RS E

S EL R L R

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

Winged Edge (Example)

Find CCW edges adjacent to 𝑣2: Initialize: Choose the only edge coming out of 𝑣2 Do: Iterate CCW around 𝑣2 While: Haven’t cycled back to

the start edge

L RS E

S EL R L R

Computational complexity is proportional to the size of the output.

(Independent of the size of the mesh.)

e1

e4

e5

e6

e7e3𝐹1

𝐹2

𝐹3v1

v2

v3

v4

v5e2

top related