1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.

Slides:



Advertisements
Similar presentations
Real-Time Rendering of Cartoon Smoke and Clouds
Advertisements

Saito, T. and Takahashi, T. Comprehensible Rendering of 3-D Shapes Proc. of SIGGRAPH '90 Genesis of Image Space NPR.
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Optimized Stencil Shadow Volumes
Computer Graphics methods
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
Two Methods for Fast Ray-Cast Ambient Occlusion Samuli Laine and Tero Karras NVIDIA Research.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
Non-Photorealistic Rendering: Toon Shading David Luebke University of Virginia.
9/25/2001CS 638, Fall 2001 Today Shadow Volume Algorithms Vertex and Pixel Shaders.
1 Dr. Scott Schaefer Shadows. 2/40 Shadows Shadows provide clues about depth Make scenes appear more realistic.
Dual Marching Cubes: An Overview
Hardware Support for Non-photorealistic Rendering: A summary Paper last updated by Ramesh Raskar February 2002 Presented by Rachel Probert.
I3D Fast Non-Linear Projections using Graphics Hardware Jean-Dominique Gascuel, Nicolas Holzschuch, Gabriel Fournier, Bernard Péroche I3D 2008.
Suggestive Contours for Conveying Shape Doug DeCarlo, Adam Finkelstein, Szymon Rusinkiewicz, and Anthony Santella.
Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova.
Shape from Contours and Multiple Stereo A Hierarchical, Mesh-Based Approach Hendrik Kück, Wolfgang Heidrich, Christian Vogelgsang.
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering Cass Everitt and Mark J. Kilgard Speaker: Alvin Date: 5/28/2003 NVIDIA.
Modelling. Outline  Modelling methods  Editing models – adding detail  Polygonal models  Representing curves  Patched surfaces.
A Real-Time Soft Shadow Volume Algorithm DTU Vision days Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology Sweden
Shadow Algorithms Gerald Matzka Computer Science Seminar.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Suggestive Contours Final programming assignment Advanced topics in Computer Graphics.
Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges Tomas Akenine-Möller Ulf Assarsson Department of Computer Engineering, Chalmers University.
Z-Buffer Optimizations Patrick Cozzi Analytical Graphics, Inc.
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
© 2004 Tomas Akenine-Möller1 Shadow Generation Hardware Vision day at DTU 2004 Tomas Akenine-Möller Lund University.
Week 14 - Wednesday.  What did we talk about last time?  Collision handling  Collision detection  Collision determination  Collision response  BSPs.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Computer Graphics Shadows
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Hidden Surface Removal
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
Erdem Alpay Ala Nawaiseh. Why Shadows? Real world has shadows More control of the game’s feel  dramatic effects  spooky effects Without shadows the.
Computer Graphics Mirror and Shadows
Shadow Algorithms Ikrima Elhassan.
CS-321 Dr. Mark L. Hornick 1 3-D Object Modeling.
CS 638, Fall 2001 Today Light Mapping (Continued) Bump Mapping with Multi-Texturing Multi-Pass Rendering.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CSE 381 – Advanced Game Programming Basic 3D Graphics
Interactive Rendering of Meso-structure Surface Details using Semi-transparent 3D Textures Vision, Modeling, Visualization Erlangen, Germany November 16-18,
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
CHAPTER 11 Shadows © 2008 Cengage Learning EMEA. LEARNING OBJECTIVES In this chapter you will learn about: – –Shadow rendering algorithms – –Blinn’s shadow.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
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.
Non-Photorealistic Rendering: Toon Shading David Luebke University of Virginia.
Computer graphics & visualization Shadows / Transparency.
Based on paper by: Rahul Khardekar, Sara McMains Mechanical Engineering University of California, Berkeley ASME 2006 International Design Engineering Technical.
Ramesh Raskar University of North Carolina at Chapel Hill Ramesh Raskar University of North Carolina at Chapel Hill Image Precision Silhouette Edges Michael.
Aaron Hertzmann New York University
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
1 Perception and VR MONT 104S, Fall 2008 Lecture 20 Computer Graphics and VR.
Advanced Programmable Shading: Beyond Per-vertex and Per-pixel Shading.
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.
Non-Photorealistic Rendering CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
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.
Graphics Pipeline Bringing it all together. Implementation The goal of computer graphics is to take the data out of computer memory and put it up on the.
1 Geometry for Game. Geometry Geometry –Position / vertex normals / vertex colors / texture coordinates Topology Topology –Primitive »Lines / triangles.
Week 14 - Wednesday CS361.
Chapter 10 Computer Graphics
3D Graphics Rendering PPT By Ricardo Veguilla.
Jim X. Chen George Mason University
Suggestive Contours with Geometry Shader
Presentation transcript:

1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges

2 Goal Find and stroke feature edges on the GPU

3 Feature Edges Contour Front-face meets back-face Boundary Ridge Valley Silhouette Subset of contour All defined by derivatives of normals… i.e. for nice polyhedra, adjacent face normals

4 Feature Tests eye = center of projection – v 0  = depth complexity v3v3 v2v2 v0v0 v1v1 nAnA nBnB n1n1 n0n0 A B eye

5 Challenge GPU limitations: No “Edge Processor” No access to adjacency No previous state for coherence Cannot create or destroy edge geometry Vertex Processor Pixel Processor Rasterizer Triangles Edges Adjacency Vertices x x

6 Related Work CPU Silhouettes Exhaustive: Sutherland (circa ’77) Randomized: Markosian et al. ’97 Cutting sphere: Gooch ’99 Dual space: Zorin and Hertzmann ’00 GPU Silhouettes G-Buffer: Saito and Takahashi ’90; McCool ’03 Environment maps: Gooch ’99, Deitrich ’99 Halo: Raskar ’01, ’02 Pixel Processor + Readback: Brabec and Seidel ’03 Edge vertices: Card & Mitchell ’02, Brennan ’03, Gooch ’03 (None allow thick lines or brush strokes)

7 Vertex Attributes GPUs allow 16 vertex “attributes” Can store other information… i.e. adjacent face normals The edge from v 0 to v 1 with adjacent faces A and B. v0v0 v1v1 nAnA nBnB A B

8 Agnosticism The GPU doesn’t care Attributes don’t have to be texture coords, colors Face list doesn’t have to describe faces Just has to have the right form Face list: set of indices into vertex table Vertex attributes: set of 4-vectors e.g. store information about an EDGE of the model mesh: In each VERTEX structure we send to the GPU Call these “edge vertices”

9 Edge Vertices Make a new mesh Every edge becomes two vertices, Connected by a line Use vertex processor to find vertices on contours Hide non-contours when rendering Degenerate polygons,  = 0, etc. ( n A  eye > 0) xor ( n B  eye > 0) v0v0 v1v1 nAnA nBnB A B

10 Our Contribution Extend Edge Vertices with More edge types Ridge, Valley, Silhouette Smooth Silhouette Suggestive Contour Brush strokes Animation Plan for Future Hardware

11 The Edge-Mesh Every edge becomes four identical* vertices Connected into a quadrilateral Store adjacent vertices, not face normals v3v3 v2v2 v0v0 v1v1 nAnA nBnB n1n1 n0n0 A B  (i) = 3D Vectors * Differentiated by i = {0, 1, 2, 3} Scalar texture parameter

12 Rendering Test edges on the vertex processor Feature Edge: Extrude into a screen-space rectangle Choose vertex position from i Non-Feature Edge: Hide beyond clipping plane Early-out avoids rasterization overhead Animation: Animate v and n as a regular vertex and vertex-normal i=0 i=1 i=2 i=3 v0v0 v1v1

13 Result

14 Building a Style

15

16 Performance

17 Thick Lines Thick quads leave visible gaps at joints Common problem (e.g. Raskar ’02)

18 Solution: End Caps s0s0 s1s1 p m0m0 m1m1 quad start cap finish cap “outside” “inside” Computed in screen space Follow projected normals m 0, m 1 The only mutual information between adjacent edges!

19 Result No Caps Caps Works well for smooth objects…

20 Heuristic can Fail Vertex normals poorly reflect curvature for this object and our heuristic fails.

21 Heuristic can Fail Hidden Failures: Cap is on the wrong side, but the gap is inside the object.

22 Heuristic can Fail Visible Failure: Cap is on the wrong side and the gap is outside the object.

23 Analysis of Failure Failure occurs when s is on the “concave” side of joint: i.e. 2D curvature is negative Probability of failure increases when: Curvature is high and tessellation is low Vertex normal represents curvature poorly f e

24 Brush Textures

25 Screen vs. Object Space s = v x | v y Good for still and high-poly models s 0 = r s 1 = r + L Good for animated low-poly models Attached to vertices during animation

26 Applications “Zero CPU cycles were harmed in the rendering of the following images.”

27 Bunny-Bot Crayon-Bot Pen-Bot Blue Print-BotWispy-Bot Different Strokes

28 Ink & Wash

29 Hidden Line

30 Toon Fur

31 J. Lengyel’s Realistic Fur Algorithm Shells Stack 16 sparse textures Perform extrusion in vertex shader Looks like fur when viewed “head on” Looks like 16 dots when viewed “side on” Fins Striped texture near CONTOURS Looks like fur when viewed “side on” We move this onto GPU Anisotropic shading Images from Lengyel et. al, Real-Time Fur over Arbitrary Surfaces

32 Realistic Fur

33 Shadow Volumes Find polyhedron bounding shadowed points Any intersected surface is shadowed Compute intersection via stencil operations Caps –At the object and infinity –E. Lengyel implemented with GPU Sides –Find CONTOUR edges –Extrude each one into a quad Dark Cap (at infinity) Light Cap Side

34 Shadows

35 Zorin-Hertzmann Smooth Silhouettes v0v0 v1v1 v2v2 A n2n2 n1n1 n0n0 B Extend edge vertex to Define an “above-water” function f = eye n Either 0 or 2 edges have zero-crossings in f Estimate zero-crossing points A, B and connect them f 0 = 0.8 f 2 = -0.1 f 1 = -0.2 f A  0 f B  0

36 Animation

37 DeCarlo et. al’s Suggestive Contours* Smooth silhouettes with new above-water function Only stroke when “ ” –i.e. Pack  1,  2, t 1, t 2, n, v (x4, for a quad) into edge vertex A B

38 * Don’t try our S.C. method at home on GeForceFX… it is too hard to squeeze the curvature data into only 16 attributes! Just use DeCarlo’s image space algorithm, or…

39 GeForce 6800 GeForce 6800 and Radeon X800 support texture reads in the vertex processor. Commercially available by August. Pointers (stored in textures) cut redundant data. Using 16-bit pointers: Current: E = x 4 = 304 bytes New: E = x 4 + = 14 bytes 20x improvement! (# is a pointer to a regular mesh vertex)

40 GeForce 7800? DirectX Next specification allows geometry to be created and destroyed– this eliminates the need for degenerate quads…

41 Follow-Up Jorn Loviscach extended our method to halos with MAX alpha blending and suggests a new curved silhouette algorithm.

42 Acknowledgements Evasion Group, INRIA Rhone-Alpes NVIDIA Tomer Moscovich

43

44 Feature Expressions eye = center of projection – v 0  = depth complexity v3v3 v2v2 v0v0 v1v1 nAnA nBnB n1n1 n0n0 A B eye n A = (v 1 – v 0 )  (v 2 – v 0 ) n B = (v 3 – v 0 )  (v 1 – v 0 )

45 Silhouettes 1. Set S := (S + 1) mod If S == 0 then clear stencil buffer to Render the model, setting stencil to S wherever the depth test passes 4. Set the stencil test to pass where stencil == S 5. Render contour edges