Advanced Computer Graphics CS 563: Non Photorealistic Rendering - - PowerPoint PPT Presentation

advanced computer graphics cs 563 non photorealistic
SMART_READER_LITE
LIVE PREVIEW

Advanced Computer Graphics CS 563: Non Photorealistic Rendering - - PowerPoint PPT Presentation

Advanced Computer Graphics CS 563: Non Photorealistic Rendering Frederik Clinckemaillie Computer Science Dept. Worcester Polytechnic Institute (WPI) Uses of Non Photorealistic R Rendering d i Different styles of Non Photorealistic


slide-1
SLIDE 1

Advanced Computer Graphics CS 563: Non‐Photorealistic Rendering Frederik Clinckemaillie

Computer Science Dept. Worcester Polytechnic Institute (WPI)

slide-2
SLIDE 2

Uses of Non‐Photorealistic R d i Rendering

 Different styles of Non Photorealistic  Different styles of Non‐Photorealistic

Rendering(NPR) are used for different reasons

 Displaying information  Displaying information  Creating emotion  Imitate art style  Imitate art style

slide-3
SLIDE 3
slide-4
SLIDE 4

T Sh di Toon Shading

 Cartoon‐like rending effects  Silhouette Edges  Simple Shading:

Simple Shading:

 Solid shading  Two‐tone shading  Specular/Diffuse three‐tone shading

slide-5
SLIDE 5

C l Sh di Cel Shading

 Solid Shading is trivial  Solid Shading is trivial  Two‐Tone Shading

l l h d ff h d d d ( * l) f

 Calculate the diffuse shading dot product (n * l) for

each vertex

 If n * l < 0 surface is facing away  If n l < 0, surface is facing away

 Use values on a 1‐D texture map  Implemented on CPU or as Vertex Shader  Implemented on CPU or as Vertex Shader  Tone Mapping

slide-6
SLIDE 6

Additional Work in Cel Shading

 Card and Mitchell [2002]  Card and Mitchell [2002]

 Determined how to perform algorithm on GPU

effectively effectively

 Barla et al. [2001]

 Added view dependent effects by using 2 D maps  Added view‐dependent effects by using 2‐D maps

 Rusinkiewicz et al. [2006]

P d Alt t h di d l ith hi h t t

 Proposed Alternate shading model with high‐contrast

by adjusting effective light position

slide-7
SLIDE 7

C l Sh di ( t ) Cel Shading (cont.)

 Specular/Diffuse three tone shading  Specular/Diffuse three‐tone shading

 Calculate the specular shading dot product (L * R) for

each vertex each vertex

 Map to 1‐D texture map

slide-8
SLIDE 8

Silh tt Ed R d i Silhouette Edge Rendering

 Adds silhouettes to emphasize edges  Adds silhouettes to emphasize edges  Different categories of algorithms:

S f A l

 Surface Angle  Procedural Geometry

Image Processing

 Image Processing  Vector Edge Detection  Hybrid  Hybrid

slide-9
SLIDE 9

T f Ed Types of Edges:

 Boundary edge  Boundary edge

 One not shared by two polygons

C d

 Crease edge:

 Angle is greater than 60 degrees

l d

 Material edge

 One where polygons are different materials

 Silhouette edge

 Two neighboring triangles face different directions as

d compared to eye vector

slide-10
SLIDE 10

S f A l Silh tti Surface Angle Silhouetting

 Using the dot product of the viewpoint and the  Using the dot product of the viewpoint and the

surface normal R lt d t i l

 Results are mapped to circle map  Results close to 0 are near

Silhouette edge

 Does not work for with

Surfaces with hard edges

 No vertex interpolation

p

slide-11
SLIDE 11

P d l G t Silh tti Procedural Geometry Silhouetting

 Render front faces normally render the edges of  Render front faces normally, render the edges of

the backfaces behind front faces Z bi th d

 Z‐bias method

 Move backfaces closer so that edges become in front

Ed thi k i t t t

 Edges thickness is not constant

slide-12
SLIDE 12

P d l G t Silh tti Procedural Geometry Silhouetting

 Backface triangles are fattened  Backface triangles are fattened.  Slope of triangle and distance

from viewer determine fattening

 Corners are cut of to avoid

elongated corners

slide-13
SLIDE 13

R lt Results

slide-14
SLIDE 14

H l M th d Halo Method

 Move the backfaces outwards by shifting their  Move the backfaces outwards by shifting their

vertices along the shared vertex normals C t h l b hi d f t f

 Creates a halo behind front faces

slide-15
SLIDE 15

Li it ti Limitations

 Fattening cannot work on curved surfaces  Fattening cannot work on curved surfaces  Shell techniques work on curved surfaces only if

th f t ti b di l d the surface representation can be displaced along surface normals Z bi k ith ll d f

 Z‐bias works with all curved surfaces  Little control over edge appearance  Semitransparent surfaces are difficult to render  Edges look poor without antialiasing

slide-16
SLIDE 16

Silh tti b I P i Silhouetting by Image Processing

 Entirely based on data stored in buffers  Entirely based on data stored in buffers  No modifications on the geometry of the scene  Look for silhouette edges by searching for z‐

buffer discontinuities

slide-17
SLIDE 17

Silh tt Ed R d i Silhouette Edge Rendering

 Process:  Process:

 Use Vertex shaders to render the world space normals

and z‐depth to a texture and z depth to a texture

 Normals are colors, z‐depths are alpha channels  Implement a Sobel edge detection filter

p e e t a Sobe edge detect o te

 Benefits

 Handles all primitives  Handles all primitives  Meshes do not need to be connected or consistent

 Flaws  Flaws

 Edges might not be found if discontinuities are small

slide-18
SLIDE 18
slide-19
SLIDE 19

Silh tt Ed D t ti Silhouette Edge Detection

 Other methods have weaknesses:  Other methods have weaknesses:

 Often need two passes to render the silhouette  No control on edge rendering style  No control on edge rendering style

 Detect silhouette edges and render them directly

Ob i fi l h li d d

 Obtain more fine control on how lines are rendered  Edges become independent of the model

A d i d fi d b

 An edge is defined by:

(n0 *v > 0) != (n1 * v > 0)

slide-20
SLIDE 20

Fi di Silh tt Ed Finding Silhouette Edges

 Standard: Loop through list of edges  Standard: Loop through list of edges  Improving efficiency:

l d l l

 Removing triangles inside planar polygons  Storing dot products for faces

I i ilh il i

 In static scenes, preserve silhouettes until view moves

a certain distance

slide-21
SLIDE 21

H b id Silh tti Hybrid Silhouetting

 Northrup and Markosian

p

 Find a list of silhouette edges.  Render all triangles and silhouette edges  Render all triangles and silhouette edges,

assigning each a different ID number(color)

 ID buffer is read back and visible silhouette edges  ID buffer is read back and visible silhouette edges

are determined from it

 Visible segments are then checked for overlaps  Visible segments are then checked for overlaps

and linked together

 Stylized strokes are added on path  Stylized strokes are added on path

slide-22
SLIDE 22
slide-23
SLIDE 23

References

T Ak i M ll E i H i d N H

Tomas Akenine‐Moller, Eric Haines, and Naty Ho

  • man. Real‐Time Rendering, Third edition. Wellesley, MA: A K Peters, Ltd.,

2008.