David Luebke 1 6/4/2016 Non-Photorealistic Rendering Painting, Drawing, Sketching.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

Saito, T. and Takahashi, T. Comprehensible Rendering of 3-D Shapes Proc. of SIGGRAPH '90 Genesis of Image Space NPR.
Exploration of bump, parallax, relief and displacement mapping
David Luebke 1 4/28/2015 Aliasing & Antialiasing.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Non-Photorealistic Rendering FORMS. Mesh (~170) Parametric (~16) Implicit/CSG (~9) Volumetric (~28) 3D Object Representation in NPR Point Cloud (~4)
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
David Luebke1/19/99 CS 551/651: Antialiasing David Luebke
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
The Flat Shape “Everything around us is shaped”. The flat shapes are visual elements that are used to create images. The simple flat shapes are triangle,
Non-Photorealistic Rendering: Toon Shading David Luebke University of Virginia.
Non-Photo Realistic Rendering Jian Huang CS594 Fall 2003 This set of slides are modified from the NPR Course during SIGGRAPH’2003.
Aliasing & Antialiasing
Week 9 - Wednesday.  What did we talk about last time?  Fresnel reflection  Snell's Law  Microgeometry effects  Implementing BRDFs  Image based.
Hardware Support for Non-photorealistic Rendering: A summary Paper last updated by Ramesh Raskar February 2002 Presented by Rachel Probert.
Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova.
Skin Rendering GPU Graphics Gary J. Katz University of Pennsylvania CIS 665 Adapted from David Gosselin’s Power Point and article, Real-time skin rendering,
Suggestive Contours Final programming assignment Advanced topics in Computer Graphics.
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Painterly Rendering for Animation Barbara J. Meier Walt Disney Feature Animation SIGGRAPH 96.
Non-photorealistic Rendering Pablo Picasso - The Bird Cage No electrons were harmed during the production of this presentation.
Non-Photorealistic Rendering - This is the attempt to make a realistic scene or object look as if it were hand drawn.
Week 14 - Wednesday.  What did we talk about last time?  Collision handling  Collision detection  Collision determination  Collision response  BSPs.
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
CS 431/636 Advanced Rendering Techniques
David Luebke 1 9/4/2015 CS 551/651: Advanced Computer Graphics Antialiasing Continued: Prefiltering and Supersampling.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
BASIC ELEMENTS OF ART: line, shape, form, value, color & texture
ELEMENTS OF ART Beginning Drawing NOTES
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
Week 11 - Thursday.  What did we talk about last time?  Image processing  Blurring  Edge detection  Color correction  Tone mapping  Lens flare.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
BASIC DRAWING SKILLS 6 th Grade Art & Introduction to Art Ms. McDaniel.
Cel Shading Jason McCollum. Overview Nonphotorealistic Rendering (NPR) Cel-shading Concepts Demonstration.
Paint By Numbers The goal of a visual artist (Hagen): Without modeling detail, painters use brush strokes to: –Represent objects –Direct attention The.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
1 Artificial Intelligence: Vision Stages of analysis Low level vision Surfaces and distance Object Matching.
Non-Photorealistic Rendering: Toon Shading David Luebke University of Virginia.
03/28/03© 2005 University of Wisconsin NPR Today “Comprehensible Rendering of 3-D Shapes”, Takafumi Saito and Tokiichiro Takahashi, SIGGRAPH 1990 “Painterly.
Realtime NPR Toon and Pencil Shading Joel Jorgensen May 4, 2010.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
David Luebke 1 12/2/2015 CS 551/651: Advanced Computer Graphics Advanced Ray Tracing Radiosity.
Sang Il Park Sejong University
Ramesh Raskar University of North Carolina at Chapel Hill Ramesh Raskar University of North Carolina at Chapel Hill Image Precision Silhouette Edges Michael.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
Cel shading By jared brock.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
Real Time Nonphotorealistic Rendering. How to achieve real time NPR? Economy of line: present a lot of information with very few strokes. Silhouettes.
DPL2/10/2016 CS 551/651: Final Review David Luebke
Painterly Rendering for Animation Introduction speaks of focus and detail –Small brush strokes focus and provide detail –Large strokes are abstract and.
Non-Photorealistic Rendering CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.
CS 445 / 645: Introductory Computer Graphics Review.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
DPL3/10/2016 CS 551/651: Simplification Continued David Luebke
Non-Photorealistic Rendering FORMS. Model dependent Threshold dependent View dependent Outline form of the object Interior form of the object Boundary.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
David Luebke 3/17/2016 Advanced Computer Graphics Antialiasing David Luebke
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
Non-photorealistic rendering
Elements of Art Art I
Week 14 - Wednesday CS361.
Distributed Ray Tracing
Jim X. Chen George Mason University
Distributed Ray Tracing
Distributed Ray Tracing
Presentation transcript:

David Luebke 1 6/4/2016 Non-Photorealistic Rendering Painting, Drawing, Sketching

David Luebke 2 6/4/2016 Admin ● Reminder: no class Monday ■ Optional review/Q&A session: Thursday May 1, 3 PM ● Reminder: final exam Monday, May 5, 9 AM ● Reminder: assn4 due Monday ■ Late days okay, but not beyond 11:59 PM Wednesday

David Luebke 3 6/4/2016 Recap: Stochastic Sampling ● Sampling theory tells us that with a regular sampling grid, frequencies higher than the Nyquist limit will alias ● Q: What about irregular sampling? ● A: High frequencies appear as noise, not aliases ● This turns out to bother our visual system less!

David Luebke 4 6/4/2016 Recap: Stochastic Sampling ● Poisson distribution: ■ Completely random ■ Add points at random until area is full. ■ Uniform distribution: some neighboring samples close together, some distant

David Luebke 5 6/4/2016 Recap: Stochastic Sampling ● Poisson disc distribution: ■ Poisson distribution, with minimum-distance constraint between samples ■ Add points at random, removing again if they are too close to any previous points ● Jittered distribution ■ Start with regular grid of samples ■ Perturb each sample slightly in a random direction ■ More “clumpy” or granular in appearance

David Luebke 6 6/4/2016 Recap: Stochastic Sampling ● Spectral characteristics of these distributions: ■ Poisson: completely uniform (white noise). High and low frequencies equally present ■ Poisson disc: Pulse at origin (DC component of image), surrounded by empty ring (no low frequencies), surrounded by white noise ■ Jitter: Approximates Poisson disc spectrum, but with a smaller empty disc.

David Luebke 7 6/4/2016 Stochastic Sampling: The Exciting Conclusion ● Distributed ray tracing is an elegant technique that tackles many problems at once ■ Stochastic ray tracing: distribute rays stochastically across pixel ■ Distributed ray tracing: distribute rays stochastically across everything

David Luebke 8 6/4/2016 Distributed Ray Tracing ● Distribute rays stochastically across: ■ Pixel for antialiasing ■ Light source for soft shadows ■ Reflection function for soft (glossy) reflections ■ Time for motion blur ■ Lens for depth of field ● Cook: 16 rays suffice for all of these

David Luebke 9 6/4/2016 Distributed Ray Tracing ● Distributed ray tracing is basically a Monte Carlo estimation technique ● Practical details: ■ Use lookup tables (LUTs) for distributing rays across functions ■ See W&W Figure p 263 ● Learn lots more about this in Image Synthesis

David Luebke 10 6/4/2016 Non-Photorealistic Rendering ● Next topic: Non-Photorealistic Rendering

David Luebke 11 6/4/2016 Non-Photorealistic Rendering “Using a term like ‘nonlinear science’ is like referring to the bulk of zoology as ‘the study of nonelephant animals’” ● Photorealism: age-old goal of graphics ● Non-photorealistic rendering ■ Broadly, techniques for rendering that don’t strive for realism, but style, expressiveness, abstraction, uncertainty, etc ■ A terrible, terrible term that we’re probably stuck with ○ Better terms: stylized rendering, artistic rendering, abstract rendering

David Luebke 12 6/4/2016 Stylized Rendering ● NPR is most commonly used to refer to graphics techniques that emulate a particular artistic style or medium ■ Impressionistic painting ■ Pen-and-ink (cross hatching, outlining, etc) ■ Colored-pencil, copperplate engraving, you name it ■ Cartoon drawing

David Luebke 13 6/4/2016 Toon shading ● Toon shading is the term that we use to refer to cartoon-like rendering effects ● Tendencies in cartoon/comic style: ■ Simple, flat shading (cel shading) ○ Two-tone (light/shadow) or three-tone (light/shadow/highlight) ■ Edge highlighting ○ Boundary (border edge) ○ Crease (hard edge) ○ Material edge ○ Silhouette edge

David Luebke 14 6/4/2016 Silhouette Rendering ● Boundary (border edge) ■ Not shared by two polygons ■ E.g. the edge of a sheet of paper ■ Solid models usually have no boundaries ● Crease (hard edge) ■ Shared by two polygons at a dihedral angle greater than some threshold (often 60°) ■ Or a vertex with two normals/two colocated vertices ■ Ridge or valley edges

David Luebke 15 6/4/2016 Silhouette Rendering ● Material edge ■ Triangles sharing edge have different materials/texture maps/etc ■ Or just an edge that the artist wants to emphasize ● Silhouette edge ■ Triangles sharing edge face different directions (towards/away from viewer) ■ Lots of techniques to find at runtime!

David Luebke 16 6/4/2016 Summary: Edge Highlighting ● Toon shading (and other NPR techniques based on drawing) requires some edges be drawn or highlighted: ■ Silhouette edges ■ Mesh boundaries (always on silhouette) ■ Creases (ridge and valley) ■ Material boundaries ● Find first at run-time, precalculate the others (unless object is deformable)

David Luebke 17 6/4/2016 Recap: Silhouette Edges ● Surface angle silhouetting ■ Calc N●V, if below threshold  draw black ○ Best as a per-pixel routine ○ E.g., Assn4c ○ Also can do with a spheremap, or use a mip-map with top-level textures dark ■ Pros: ○ Uses the texture hardware  fast ○ Can antialias the resulting lines ■ Cons: ○ Line width depends on curvature ○ Doesn’t work for some models (e.g., a cube)

David Luebke 18 6/4/2016 Recap: Silhouette Edges ● Procedural Geometry Silhouetting ■ Idea: render the geometry in such a way that the silhouettes “fall out”, e.g.: ○ Draw frontfacing polygons ○ Draw backfacing polygons  But draw them in (possibly thick) wireframe  Or draw them z-biased forward a bit  Or “fatten” them  Or displace them along their normals (“halo” effect) –Flip normals –Amount of displacement varies w/ distance (why?) –Perfect task for vertex shader! ■ Pros: relatively robust, doesn’t need connectivity info ■ Cons: Wastes some fill & some polys, needs antialiasing

David Luebke 19 6/4/2016 Results WireframeTranslationFattening 40 fps 50 fps 11.5 fps Original Venus model : 5672 triangles, 66 fps

David Luebke 20 6/4/2016 Recap: Silhouette Edges ● Image Processing Silhouetting ■ Idea: analyze the image after it’s rendered, and extract silhouettes (i.e., edge detection) ■ Perfect for fragment program! ■ Can help by rendering e.g. depth image, object-ID image, normal image

David Luebke 21 6/4/2016 Recap: Silhouette Edges ● Silhouette Edge Detection ■ Idea: find silhouette edges geometrically on the CPU and render them explicitly ○ Brute force: test every edge to see if its adjoining polygons face opposite directions in eye space  Can speed this up with randomized coherent search ○ Most work, but gives the most flexibility in how silhouettes are drawn ■ GPU variant: ○ Draw degenerate quadrilateral at each edge ○ Use vertex shader to “fatten” quad into a “fin” when edge is on silhouette  Fin thickness based on distance to eyepoint

David Luebke 22 6/4/2016 Highlighting Ridge Edges ● Clever related technique by Raskar: ■ Add “fins” to every edge at dihedral angle ■ Size fins according to distance to viewer ■ Again, perfect for vertex shader ● Similar but more complicated technique for highlighting valley edges

David Luebke 23 6/4/2016 Drawing Lines: Outlining Polygons ● Surprisingly hard to draw polys as filled outlines ■ Problem: depth buffer values of edge & polys same ■ 2-pass technique: draw polys, then draw edges ○ Z-bias edges forward or polygons back ( glPolygonOffset ) ○ Works okay, but has occasional problems ■ 3-pass technique: ○ Render filled polygon  Disable depth buffer writes (leave depth test on)  Enable color buffer writes ○ Render polygon edges polygon  Normal depth & color buffering ○ Render filled polygon again  Enable depth buffer writes  Disable color buffer writes

David Luebke 24 6/4/2016 Drawing Lines: Hidden-Line Rendering ● Hidden-line vs. obscured line vs halos ■ Hidden-line ○ Draw polygons to depth buffer (not color buffer) ○ Draw edges using previous technique ■ Obscured (light, dotted, dashed) line ○ Draw all edges in obscured style ○ Draw polygons to depth buffer (not color buffer) ○ Draw edges using previous technique ■ Haloed line ○ Draw all edges as thick background-color lines ○ Draw edges using biasing, foreground-color

David Luebke 25 6/4/2016 Other Styles ● Impressionistic or “painterly” rendering: ■ Sprinkle particles on object surface ■ Draw particles as brushstrokes ■ Can render images to encode normals, surface curvature, depth, color/tone info

David Luebke 26 6/4/2016 Painterly Rendering ● More info if time permits…

David Luebke 27 6/4/2016 Other Styles ● Hatching: ■ Store different cross-hatch patterns representing different tones as textures ■ Clever ways to use texture hardware to blend between tones at run-time ● More info if time permits…

David Luebke 28 6/4/2016 Other Styles ● “Graftals” are a general term used for strokes, decals, little bits of geometry ● Dynamic placement of graftals to achieve certain effects/styles: