Non-photorealistic Rendering Pablo Picasso - The Bird Cage No electrons were harmed during the...

Post on 23-Dec-2015

216 views 0 download

Tags:

Transcript of Non-photorealistic Rendering Pablo Picasso - The Bird Cage No electrons were harmed during the...

Non-photorealistic Rendering

Pablo Picasso - The Bird CageNo electrons were harmed during the production of this presentation.

Non-photorealistic Rendering

• Interactive Technical Illustration– Bruce Gooch, Peter-Pike J.Sloan, Amy Gooch,

Peter Shirley, Richard Riesenfeld(CS Dept, University of Utah)

• Image Precision Silhouette Edges– Ramesh Raskar (UNC @ Chapel Hill)– Michael Cohen (Microsoft Research)

Interactive Technical Illustration

Using NPR techniques to clarify an illustration.

http://www.cs.utah.edu/~bgooch/ITI

Interactive Technical Illustration

• Technical documentation illustrations are typically 2D, static and hand-drawn.

• Uses abstraction to convey information on shape, structure and material composition.

• How can technical illustration techniques be applied to an interactive 3D display ?

2D Principles Applied

Use line weight to suggest structure :– single line weight.– heavy edges, thin inner lines.– vary weight to improve perspective.

Three common shading models :– diffuse

• interpolate from cool to warm color

– metallic– banded

• ( a |cos t| + (1-a) ) ^ p

• produces a “back-splash” of light.

Model’s inner lines can be used as highlights.

2D Principles Applied

2D Principles Applied

Shadowing can hint at 3D structure.– Used only when doesn’t mask details.– Will use cast shadow on ground plane.– High accuracy is not really important.

Interactive Principles Applied

The object moves, not the viewer:– Moving highlights convey more information.– Each object is lit independently.

• Multiple highlights would be confusing.

Implementation

• Silhouettes and important edges– Hardware vs. software– Line style.

• Shading– Metal shading

• Shadowing– Soft vs. hard shadows.

Silhouettes & Important Edges

“A silhouette is an edge that is connected to both a front-facing and a back-facing polygon.”

• Hardware Method• GL & the stencil buffer.

Draw shaded front faces

Draw front faces in line mode in stencil buffer

Draw back faces in line mode Setting color if stencil buffer was set,decrementing stencil buffer if drawn.

• Environment map.

Silhouettes & Important Edges

• Software Method - Math and bottlenecks :– Equation to determine silhouette edges.– Tested faster using a hierarchical Gauss map.– Parallelizable.

Not a silhouette edge. A silhouette edge.

Silhouettes & Important Edges

• Line weight and creases:– Use shading or texture mapping to vary weight.– Extract creases and draw as white highlights.

• Can be covered by silhouette or shading.

• Doesn’t state HOW the creases are extracted.

Silhouettes & Important Edges

• Line weight and creases:– Use shading or texture mapping to vary weight.– Extract creases and draw as white highlights.– Draw thick boundary lines.

• Draw only over the object (stencil buffer).

– Draw boundary silhouettes.• Software edge list limits redrawing.

– Fill gaps with large points at edge ends.

Shading

• Hardware environment mapping is used for its flexibility.

• Metal shading– Create a metal texture.– Add Phong highlights.– Sufficient to convey material

information.

Shadowing

• Cast only shadows on the ground plane.

• Soft shadows :– Project shadow on a stack of slightly offset

planes and accumulate them.– Assumes the silhouette

remains the same.– Not exact, but faster.

Image Precision Silhouette Edges

A hack that does the job quickly.

http://www.cs.unc.edu/~raskar/Sil/

Image Precision Silhouette Edges

The problem:– Find all silhouette edges.– Render only those which are not occluded.

Image Precision Silhouette Edges

The problem:– Find all silhouette edges.– Render only those which are not occluded.

• Gooch’s answer :– Find them all.– Render them all. Several times if needs be.

Image Precision Silhouette Edges

The problem:– Find all silhouette edges.– Render only those which are not occluded.

• Raskar’s answer :– Cheat.

The method

• First render the front-facing polygons.

• Render the back-facing polygons in black.– If needed, BF polygons can be found by

reading back the frame buffer.

Problem:This produces silhouettes at most 1 pixel wide.

We need some preprocessing to be done.

How to render the BF polygons

• Render them as thick wireframe.– Easy and fast.– May leave gaps when lines get too thick.

• Translate the back-facing polygons.– e.g. using glPolygonOffset().– May not give uniform outlines.

• Use view dependent modifications.– Can have ‘artistic’ results.

Results

Wireframe Translation Fattening

40 fps 50 fps 11.5 fps

Original Venus model : 5672 triangles, 66 fps

Conclusion...