non-photorealistic rendering · 2007. 4. 4. · non-photorealistic rendering eecs 487 cadmus 3d...

51
1 Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today Miraculous performance leaps Stunning price cuts Curiously low impact Games Movies

Upload: others

Post on 23-Sep-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

1

Non-photorealistic Rendering

EECS 487

Cadmus

3D Computer Graphics Today

• Miraculous performance leaps• Stunning price cuts• Curiously low impact

GamesMovies

Page 2: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

2

Problem: Content Creation

Available tools are difficult (Maya, 3DS…)• Evolved from CAD (precise modeling)• Requires special skills• Geared toward trained experts• Realism – no stylization or abstraction

Realism is expensive!

Page 3: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

3

Realistic Modeling and Rendering of Plant EcosystemsRealistic Modeling and Rendering of Plant EcosystemsDeussenDeussen,, HanrahanHanrahan, , LintermannLintermann, , MechMech, ,

Pharr, &Pharr, & PrusinkiewiczPrusinkiewicz. SIGGRAPH 1998.. SIGGRAPH 1998.

The The LoraxLorax. Dr. Seuss.. Dr. Seuss.

Page 4: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

4

Non-photorealistic rendering (NPR)

Extreme reduction of detailsSelective enhancementStylization and abstraction

• Complexity is suggested

Proposal: Model by Drawing

Draw shape and stylePermit abstraction /

stylizationStroke-based NPR

Page 5: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

5

Potential Advantages

• Gain abstraction, stylization• Re-use drawing skills• Re-use existing images• Re-use existing shapes• Fast, lightweight modeling• New applications, users

education, architecture, design, animation, advertising, games…

Research Challenges: NPR

Stroke generation• Levels of detail• Temporal coherence• Pattern synthesis

Media simulationDirect user control

Picture element: pixel or stroke?

Page 6: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

6

Pen & Ink [Winkenbach 94]

Previous work

Paint [Hertzmann 98]Watercolor [Curtis 97]

Technical Illustration [Saito 90]

Painterly rendering for video [Litwinowicz 97]

Painterly rendering for3D models [Meier 96]

Previous work

Page 7: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

7

[Kowalski 99] [Praun 01][Gooch 98]

Previous work

[Tolba 01][Cohen 00] [Bourguignon 01]

Previous work

Page 8: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

8

Teddy: A Sketching Interface for 3D Freeform Design. Igarashi, Matsuoka & Tanaka. SIGGRAPH 1999.

Previous work

SKETCH: An Interface for Sketching 3D Scenes. Zeleznik, Herndon & Hughes. SIGGRAPH 1996.

Previous work

Page 9: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

9

Talk overview

Technical illustrationPen & inkPainterly renderingSilhouette detectionGraftalsWYSIWYG NPRCoherent stylized silhouettes

Technical illustration

Saito and Takahashi, Siggraph 90Purpose: render 3D models in styles that

are more “comprehensible”Method:

• Render various intermediate images• Do image-processing operations on

them• Combine the results

Page 10: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

10

Page 11: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

11

Page 12: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

12

Problem

Parameters need careful tuning for good results

Talk overview

Technical illustrationPen & inkPainterly renderingSilhouette detectionGraftalsWYSIWYG NPRCoherent stylized silhouettes

Page 13: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

13

Pen and Ink

Winkenbach and Salesin, Siggraph 94Purpose: render 3D models as pen & ink

drawingsMethod:

• annotate model with procedural “textures”

• Render tonal “reference image”• Use it to guide pen and ink textures

Page 14: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

14

Page 15: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

15

Page 16: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

16

Pen and Ink

Salisbury, Anderson, Lischinski and Salesin, Siggraph 96

Purpose: define a scale-independent representation for pen & ink images

Page 17: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

17

Page 18: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

18

Salisbury et al., cont’d

Method:• Store lo-res greyscale image

annotated with discontinuities• filter greyscale image to desired size,

run stroke generation algorithm on it

Page 19: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

19

Page 20: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

20

Problems

Only produces still images• Would not provide temporal

coherenceWhat’s the application?

Talk overview

Technical illustrationPen & inkPainterly renderingSilhouette detectionGraftalsWYSIWYG NPRCoherent stylized silhouettes

Page 21: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

21

Painterly rendering

Meier, Siggraph 96

Problem: produce animations in a “painterly” style with temporal coherence of strokes

Method:

• Populate surfaces with stroke “particles”

• Render with the help of reference images

Page 22: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

22

Page 23: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

23

video

Problem

Particles have fixed distribution• Need prescribed camera path

Page 24: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

24

Talk overview

Technical illustrationPen & inkPainterly renderingSilhouette detectionGraftalsWYSIWYG NPRCoherent stylized silhouettes

Silhouette detection

Real-Time Nonphotorealistic Rendering. Markosian, Kowalski, Trychin, Bourdev, Goldstein, & Hughes. SIGGRAPH 1997.

Page 25: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

25

Applications

Visualization

Fast, simple “line drawing” style

Observation: silhouette edges are• sparse• connected in long chains• temporally coherent

Page 26: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

26

Randomized silhouette detection

Check a fraction of edges. • Find one, find whole chain

Check old silhouettes

Analysis

For fixed probability:check edges

Refinement scheme:• silhouette chains “persist” • mesh edges quadruple• silhouette edges double

)n(O

Page 27: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

27

n: number of edges in meshs: edges in given silhouette chainc: number of edges to check

P(miss the chain) c

n

sn��

���

� −=

���n�

n

�n�n�

ec

1n

1n

s1 −<�

���

�=���

����

�=�

���

�= −−−

� �e1 −−>

Proof:

n�c =ns β=note

take

P(hit the chain)

Example

Suppose at coarsest level mesh has 128 edges, and we want to detect a chain of 8 edges w/ probability p = 0.95

Then β ≈ 0.707

We must take α = –log(1 – p)/β ≈ 4.24

Page 28: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

28

Deterministic schemes

Hierarchical methods:pre-computed spatial data structure

Illustrating Smooth Surfaces. Hertzmann & Zorin. SIGGRAPH 2000.

Silhouette Clipping.Sander, Gu, Gortler, Hoppe, & Snyder. SIGGRAPH 2000.

Comparison

Randomized:• Simple• Effective• Small silhouettes come in late

Deterministic:• Requires pre-process• Not for animated models

Page 29: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

29

Talk overview

Technical illustrationPen & inkPainterly renderingSilhouette detectionGraftalsWYSIWYG NPRCoherent stylized silhouettes

Art-based Rendering of Fur, Grass and Trees. Kowalski, Markosian, Northrup, Bourdev, Barzel, Holden & Hughes. SIGGRAPH 1999.

Page 30: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

30

Dr. Seuss

Detail elements (graftals) generated as needed

Graftal textures

Page 31: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

31

Graftals

Oriented in local frameCan choose level of detail

Needed for placement of graftals:

Controlled screen-space densityPlacement on surfaces Controlled placement (e.g. at silhouettes)Persistence of graftals

Page 32: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

32

Page 33: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

33

Problems

Graftal textures defined in code• hard to edit• how to extend with UI?

Coherence• Graftals popping in/out• Better at low frame rates!

Page 34: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

34

Art-based Rendering w/ Continuous Levels of Detail. Markosian, Meier, Kowalski, Holden, Northrup, & Hughes. NPAR 2000.

Basic graftals

Collection of drawing primitives• triangle strips / fans

Canonical verticesLocal coordinate frame

Tuft: hierarchy of graftals

Page 35: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

35

The local frame

Base position (e.g. on surface)y´ (e.g. surface normal) x´ (e.g. cross product of y´ and view

vector)

y

x

canonical space

y´ x´

local frame

Placement and duplication

Designer creates a few “example graftals”Duplicates generated on surfaces

• explicitly• procedurally

Random variation

Page 36: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

36

Level of detail (LOD)

Graftal computes current LODDraws primitives that exceed threshold

Page 37: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

37

Computing LOD

LOD derived from:• apparent size• orientation• elapsed time

σ: ratio of current size to “rest” size

σσσσ = 1σσσσ = .7 σσσσ = 1.4

Page 38: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

38

Orientation

Value used to selectively suppress LODE.g.: 1 - |v · n|

Movie

Page 39: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

39

Discussion

Coherence: much better!Slower Introducing / removing elements

• Fading & thinning work well• Growing looks creepy

LOD mechanism too inflexibleNeed direct UI

Talk overview

Technical illustrationPen & inkPainterly renderingSilhouette detectionGraftalsWYSIWYG NPRCoherent stylized silhouettes

Page 40: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

40

WYSIWYG NPR: Drawing Strokes Directly on 3D Models.Kalnins, Markosian, Meier, Kowalski, Lee, Davidson, Webb, Hughes & Finkelstein. SIGGRAPH 2002.

Contributions

Direct user-control for NPRBetter silhouettesNew media simulationStroke synthesis by exampleHatching with LODs

Page 41: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

41

Overview of Components

Base CoatBrush StylePaper EffectDecalsOutlinesHatching

Brush Style

Per stroke:• Color • Width• Paper effect

Rendered as triangle strips.

Page 42: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

42

Strokes in OpenGL

Based on “Skeletal strokes” Hsu et al., UIST ’93

Paper Effect

Height field texture:• Peaks catch pigment• Valleys resist pigment

Height field texture:• Peaks catch pigment• Valleys resist pigment

Implementation:• Pixel shader

Implementation:• Pixel shader

Page 43: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

43

Re-map alpha with a “paper texture” heightfield

0 1

1

a

a’

0 1

1

a

a’

0 1

1

a

a’

peak valley intermediate

Page 44: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

44

Hatching: LOD

video

Page 45: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

45

Discussion

Huge benefit from user-control

Wide range of effects

Interactive rates

Future work

• Stroke patterns / synthesis

• Stroke behavior

• Graftals / LOD

• Silhouette coherence

Talk overview

Technical illustrationPen & inkPainterly renderingSilhouette detectionGraftalsWYSIWYG NPRCoherent stylized silhouettes

Page 46: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

46

Coherent Stylized Silhouettes.Kalnins, Davidson, Markosian & Finkelstein. SIGGRAPH 2003.

Goals

Coherence for stylized silhouettesBalance competing objectives:

• Coherence in 3D• 2D arc-length parameterization

Page 47: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

47

Terms

strokessilhouette paths brush paths

Overview of process

Each sample records parameter value

Page 48: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

48

Brush path generation

Brush path parameterization

s: arc-length parameter along brush patht: stylization parameterE.g.: t = ks (k is “stretch factor”)

Page 49: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

49

Optimization

Minimize “energy” that measures• Deviation from votes• Deviation from scaled arc-length• Bending

Energy terms are quadratic• Differentiate, solve system of equations

video

Page 50: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

50

Page 51: Non-photorealistic Rendering · 2007. 4. 4. · Non-photorealistic Rendering EECS 487 Cadmus 3D Computer Graphics Today • Miraculous performance leaps • Stunning price cuts •

51