Non-Photorealistic Rendering CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.

Slides:



Advertisements
Similar presentations
Why is photorealism the aim? People paint! What is NPR? NPR issues NonPhotorealistic Rendering.
Advertisements

Computer graphics & visualization Real-Time Pencil Rendering Marc Treib.
Exploration of advanced lighting and shading techniques
Saito, T. and Takahashi, T. Comprehensible Rendering of 3-D Shapes Proc. of SIGGRAPH '90 Genesis of Image Space NPR.
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
CS 4363/6353 BASIC RENDERING. THE GRAPHICS PIPELINE OVERVIEW Vertex Processing Coordinate transformations Compute color for each vertex Clipping and Primitive.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Walk-Through Illustrations: Frame-Coherent Pen-and-Ink Style in a Game Engine Bert Greudenberg Maic Masuch Thomas Strothotte.
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.
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.
Hardware Support for Non-photorealistic Rendering: A summary Paper last updated by Ramesh Raskar February 2002 Presented by Rachel Probert.
1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
(conventional Cartesian reference system)
Suggestive Contours Final programming assignment Advanced topics in Computer Graphics.
NPR - 2D to 3D, painting and rendering Daniel Teece Walt Disney Feature Animation Daniel Teece Walt Disney Feature Animation
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie Non-Photorealistic Rendering Techniques for a Game Engine COMP 238 Final Project.
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 Greg Turk College of Computing and GVU Center.
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.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
Computer graphics & visualization NPR – Non-photorealistic rendering.
Computer-Generated Pen- and-Ink Illustration Georges Winkenbach, David H. Salesin.
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
03/30/05© 2005 University of Wisconsin NPR Today “Stylized Rendering Techniques for Scalable Real-Time 3D Animation”, Adam Lake, Carl Marshall, Mark Harris.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
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.
TERRAIN SET09115 Intro to Graphics Programming. Breakdown  Basics  What do we mean by terrain?  How terrain rendering works  Generating terrain 
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
Cel Shading Jason McCollum. Overview Nonphotorealistic Rendering (NPR) Cel-shading Concepts Demonstration.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Paint By Numbers The goal of a visual artist (Hagen): Without modeling detail, painters use brush strokes to: –Represent objects –Direct attention The.
Rendering Complexity in Computer-Generated Pen- and-Ink Illustrations Brett Wilson & Kwan-Liu Ma The University of California, Davis.
Non-Photorealistic Rendering Motivation: Much of the graphical imagery created is not photographic in nature Particularly in some domains: –Art –Animation.
3D animation is rendered clip of animated 3D objects in a 3D environment. An example: Examples of movies released in 3D are Toy Story, Cars, Shrek, Wall-E,
David Luebke 1 6/4/2016 Non-Photorealistic Rendering Painting, Drawing, Sketching.
Shader Study 이동현. Vision engine   Games Helldorado The Show Warlord.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
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.
Ramesh Raskar University of North Carolina at Chapel Hill Ramesh Raskar University of North Carolina at Chapel Hill Image Precision Silhouette Edges Michael.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Cel shading By jared brock.
Computer-Generated Medical, Technical, and Scientific Illustration SIGGRAPH 2005 Course #31 Half-Day, Tuesday, 2 August, 8:30 am - 12:15 pm Level: Intermediate.
Non-Photorealistic Rendering FORMS. Model dependent Threshold dependent View dependent Outline form of the object Interior form of the object Boundary.
Real Time Nonphotorealistic Rendering. How to achieve real time NPR? Economy of line: present a lot of information with very few strokes. Silhouettes.
X-Toon: An Extended Toon Shader Pascal Barla, Joelle Thollot ARTIS GRAVIR/IMAGE INRIA Lee Markosian University of Michigan.
Painterly Rendering for Animation Introduction speaks of focus and detail –Small brush strokes focus and provide detail –Large strokes are abstract and.
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.
Non-photorealistic rendering
Week 14 - Wednesday CS361.
Non-Photorealistic Rendering Techniques for a Game Engine
Deferred Lighting.
Stylized Environmental Rendering
Cel Shading Jason McCollum.
Introduction to Meshes
Presentation transcript:

Non-Photorealistic Rendering CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia

2 David Luebke Real-Time Rendering Demo Today: Sean Arietta, Super Mario Sunshine Thursday: Greg Tylka

3 David Luebke Real-Time Rendering Assignments Assn 4 description due tonight at midnight –Remember to post these on forum, not send by –Assn 4 due Mar 31, integrated demo Mar 23

4 David Luebke Real-Time Rendering 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 term that we may be stuck with Better terms: stylized rendering, artistic rendering, abstract rendering, comprehensible rendering, etc.

5 David Luebke Real-Time Rendering Stylized Rendering NPR usually 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

6 David Luebke Real-Time Rendering 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

7 David Luebke Real-Time Rendering Toon Shading Cel shading –Threshold the lighting equation Ex: the Cg program we looked at Diffuse below 0.5 ? dark color : light color Specular above 0.5 ? hilight color : diffuse color If no pixel shaders, can use N ● L to look up a 1-D texture containing the shaded colors –In general, can think of these procedures as remapping the traditional lighting equation elements ( tone mapping )

8 David Luebke Real-Time Rendering 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

9 David Luebke Real-Time Rendering 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!

10 David Luebke Real-Time Rendering Finding/Rendering Silhouette Edges Surface angle silhouetting –Again, like the Cg program we looked at –Calculate N●V, if below threshold  draw black –Problem: depends on surface curvature (see Fig 7.5)

11 David Luebke Real-Time Rendering Procedural Geometry Silhouetting Idea: render the geometry in such a way that the silhouettes “fall out” Ex: –Draw frontfacing polygons –Draw backfacing polygons But draw them in thick (2-pixel) wireframe Or draw them in wireframe, z-biased forward a bit Or “fatten” them Or displace them along their normals (“halo” effect)

12 David Luebke Real-Time Rendering Results WireframeTranslationFattening 40 fps 50 fps 11.5 fps Original Venus model : 5672 triangles, 66 fps

13 David Luebke Real-Time Rendering Image Processing Silhouetting Idea: analyze the image after it’s rendered, and extract silhouettes (like edge detection) Can help by rendering e.g. depth image, object-ID image, normal image Perfect for fragment program!

14 David Luebke Real-Time Rendering Silhouette Edge Detection Idea: find silhouette edges geometrically and render them explicitly –Hierarchy of normal cones –Lots of other interesting geometric approaches Most work, but gives the most flexibility in how silhouettes are drawn

15 David Luebke Real-Time Rendering Recap: Edge Highlighting Toon shading (and other NPR techniques based on drawing) requires drawing/highlighting some edges: –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)

16 David Luebke Real-Time Rendering Recap: Silhouette Edges Surface angle silhouetting –Calc N●V, if below threshold  draw black Best as a per-pixel routine The Cg program we looked at Options: 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)

Recap: Silhouette Edges Procedural Geometry Silhouetting –Idea: render geometry such 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

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 hierarchy or randomized coherent search Most work, but gives most flexibility in how silhouettes drawn –GPU variant: Draw degenerate quadrilateral at each edge “Fatten” quad into a “fin” when edge is on silhouette –Fin thickness based on distance to eyepoint –Vertex shader & replicated vertices today  geometry shader!

19 David Luebke Real-Time Rendering 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, geometry shader Similar but more complicated technique for highlighting valley edges

20 David Luebke Real-Time Rendering 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

21 David Luebke Real-Time Rendering 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

22 David Luebke Real-Time Rendering 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

23 David Luebke Real-Time Rendering Painterly Rendering More info if time permits…

24 David Luebke Real-Time Rendering 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…

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

26 David Luebke Real-Time Rendering Other Styles Technical Illustration

Generalizing NPR Recent work by researchers in NPR attempts to generalize many of these concepts: Coherent Stylized Silhouettes Kalnins, Davidson, Markosian, Finkelstein

Generalizing NPR Recent work by researchers in NPR attempts to generalize many of these concepts: Suggestive Contours DeCarlo, Finkelstein, Reinkiewicz, Santella

Gallery of NPR images Technical Illustration Coherent Stylized Silhouettes Suggestive Contours SIGGRAPH papers… NPAR