CSC 2521 Final Project Report. Hanieh Bastani

Similar documents
Non-Photorealistic Experimentation Jhon Adams

CMSC 491A/691A Artistic Rendering. Announcements

Exaggerated Shading for Depicting Shape and Detail. Szymon Rusinkiewicz Michael Burns Doug DeCarlo

Let s start with occluding contours (or interior and exterior silhouettes), and look at image-space algorithms. A very simple technique is to render

Computer Graphics. Shading. Based on slides by Dianna Xu, Bryn Mawr College

Non-Photo Realistic Rendering. Jian Huang

Real-Time Non- Photorealistic Rendering

How do we draw a picture?

Parameterization. Michael S. Floater. November 10, 2011

View-Independent Non-photorealistic Real-time Rendering for Terrain

9. Illumination and Shading

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

CS 4620 Midterm, March 21, 2017

Shading. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller/Fuhrmann

Example Examination 2IV

Hot Topics in Visualization

Feature Lines on Surfaces

Hot Topics in Visualization. Ronald Peikert SciVis Hot Topics 12-1

Advanced Real- Time Cel Shading Techniques in OpenGL Adam Hutchins Sean Kim

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Parameterization of triangular meshes

For each question, indicate whether the statement is true or false by circling T or F, respectively.

Introduction to Visualization and Computer Graphics

CS 130 Final. Fall 2015

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Geometric Features for Non-photorealistiic Rendering

Chapter 7 - Light, Materials, Appearance

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Differential Geometry: Circle Patterns (Part 1) [Discrete Conformal Mappinngs via Circle Patterns. Kharevych, Springborn and Schröder]

Drawing Fast The Graphics Pipeline

CSE 167: Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Computer Graphics Coursework 1

Chapter 26 Geometrical Optics

CS Illumination and Shading. Slide 1

05 - Surfaces. Acknowledgements: Olga Sorkine-Hornung. CSCI-GA Geometric Modeling - Daniele Panozzo

SURFACE CONSTRUCTION USING TRICOLOR MARCHING CUBES

Hermite Curves. Hermite curves. Interpolation versus approximation Hermite curve interpolates the control points Piecewise cubic polynomials

Lecture Notes (Reflection & Mirrors)

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

Lecture 21: Shading. put your trust in my shadow. Judges 9:15

Drawing Fast The Graphics Pipeline

Previously... contour or image rendering in 2D

Computer Graphics Fundamentals. Jon Macey

Line Drawing. Introduction to Computer Graphics Torsten Möller / Mike Phillips. Machiraju/Zhang/Möller

CS337 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics. Bin Sheng Representing Shape 9/20/16 1/15

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

8. Hidden Surface Elimination

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics 1/15

Drawing Fast The Graphics Pipeline

A concave mirror is a converging mirror because parallel rays will. A convex mirror is a diverging mirror because parallel rays will

Chapter 23. Geometrical Optics (lecture 1: mirrors) Dr. Armen Kocharian

CIS 4930/ SCIENTIFICVISUALIZATION

Part Images Formed by Flat Mirrors. This Chapter. Phys. 281B Geometric Optics. Chapter 2 : Image Formation. Chapter 2: Image Formation

0. Introduction: What is Computer Graphics? 1. Basics of scan conversion (line drawing) 2. Representing 2D curves

Shading Algorithms. Ron Goldman Department of Computer Science Rice University

3/1/2010. Acceleration Techniques V1.2. Goals. Overview. Based on slides from Celine Loscos (v1.0)

Generalized barycentric coordinates

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

Illumination & Shading: Part 1

Level of Details in Computer Rendering

the gamedesigninitiative at cornell university Lecture 17 Color and Textures

the gamedesigninitiative at cornell university Lecture 16 Color and Textures

Detail control in line drawings of 3D meshes

Line Drawing. Foundations of Computer Graphics Torsten Möller

the gamedesigninitiative at cornell university Lecture 17 Color and Textures

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

BCC Multi Stretch Wipe

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

Consistent Normal Interpolation

I d like to start this section with a quote from David Byrne in an article for Utne. In the article he was mostly talking about 2D design and

CS5620 Intro to Computer Graphics

CS 4620 Midterm 1. Tuesday 22 October minutes

Rendering If we have a precise computer representation of the 3D world, how realistic are the 2D images we can generate? What are the best way to mode

9. Three Dimensional Object Representations

(Discrete) Differential Geometry

Scalar Field Visualization I

TSBK03 Screen-Space Ambient Occlusion

Chapter IV Fragment Processing and Output Merging. 3D Graphics for Game Programming

Non-Photorealistic Rendering

MARCHING CUBES AND VARIANTS

City Research Online. Permanent City Research Online URL:

BCC Linear Wipe. When the Invert Wipe Checkbox is selected, the alpha channel created by the wipe inverts.

Graphics and Interaction Rendering pipeline & object modelling

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

Paint by Numbers and Comprehensible Rendering of 3D Shapes

Rasterization. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 16

Revolve Vertices. Axis of revolution. Angle of revolution. Edge sense. Vertex to be revolved. Figure 2-47: Revolve Vertices operation

10.6 Render - Freestyle

Volume Illumination and Segmentation

Visualization Computer Graphics I Lecture 20

Height Fields and Contours Scalar Fields Volume Rendering Vector Fields [Angel Ch. 12] April 23, 2002 Frank Pfenning Carnegie Mellon University

Contours & Implicit Modelling 4

Hidden surface removal. Computer Graphics

Computer Graphics I Lecture 11

The Law of Reflection

Complex Shading Algorithms

Lighting and Shading II. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Transcription:

CSC 2521 Final Project Report Hanieh Bastani December, 2007

NPR Renderer: Overview I implemented a 3D NPR renderer which supports contours, suggestive contours, and toon shading. For this implementation, I used the trimesh2 library written by Szymon Rusinkiewicz. The mesh models used are in PLY format from the Suggestive Contours gallery page. I also used the rtsc software (http://www.cs.princeton.edu/gfx/proj/sugcon/index.html#software) as a learning tool and reference during the research phase of writing this implementation, and also adopted their method of calculating the directional derivatives (identified as DwKr in their implementation) of vertices for suggestive contours. I used the convention of normals pointing outward from the surface, to be consistent with the literature. Visibility issues are resolved by rejecting triangles that are entirely on the back face of the mesh. If the dot product of the view vector with the vertex normals yield a negative value, for all vertices across a triangle, the triangle lies on the back face of the mesh and is ignored. Contours Determining contours requires finding the zeros of the dot product between n and v, n being the surface normal at point p, v being the vector from the view position to the point p. Working with polygons in my implementation, n.v is calculated exhaustively for every vertex. As it is often the case, the zeros of n.v may occur between two vertices, which means one vertex has a positive n.v value, while another has a negative n.v value. Thus, for every triangle of the mesh, I perform a check for a sign change among the triangle vertices. If it is determined that n.v at one vertex has a different sign than the other two, a simple linear interpolation determines the point on the triangle edges at which n.v = 0. For example, 1

Figure 1: Elephant Contour with Toon Shading if n.v at vertex 0 has a different sign than n.v at vertex 1 and vertex 2, a linear interpolant finds the points p 1 and P 2 on the edges < vertex 0,vertex 1 > and < vertex 0,vertex 2 >, respectively. A line with a specified thickness is then drawn between p 1 and p 2. Figures 1 to 4 are the resulting contour renderings, shown with different styles of shading, covered in section. 2

Figure 2: Elephant Contour with Smooth Shading 3

Figure 3: Horse Contour with Smooth Shading (Front) 4

Suggestive Contours Figure 4: Horse Contour with Smooth Shading (Top) Calculating Radial Curvature Suggestive contours require the calculation of the radial curvature κ r at every vertex of the polygonal mesh, and are drawn where κ r = 0 subject to the constraint that the directional derivative in the direction of the view vector is positive. In my implementation, κ r for every vertex i is calculated as follows: k r [i] = meshobj > curv1[i] cos2t heta + meshobj > curv2[i] sin2t heta (1) where curv [i] indicates the principal curvatures at vertex i, provided by the trimesh2 library. T heta is the angle between the view vector and the principal directions corresponding to the principal curvatures, provided through the pdir* member of the mesh object in the trimesh2 library. cos2t heta and sin2t heta, representing cos 2 (θ) and sin 2 (θ) are calculated 5

Figure 5: Suggestive Contours on Elephant with Toon Shading with respect to the dot and cross products between the view vector and principal directions at the vertices. Figures 5 to 8 are the resulting suggestive contours renderings. Determining Zero Crossings To get the appearance of smooth contours, I check once again for triangles in which one vertex has a radial curvature with a different sign than the other two. Upon encountering such a triangle, I check the value of the directional derivatives D k of the vertices of the triangle. The directional derivatives must be positive, which would mean that the eye is viewing the 6

Figure 6: Suggestive Contours on Horse with Smooth Shading 7

Figure 7: Suggestive Contours on Cow with Toon Shading 8

Figure 8: Suggestive Contours on Cow with Smooth Shading 9

Figure 9: Suggestive Contours with No Line Stylization point from its convex side. If the D k values are negative, the exhaustive search for a potential suggestive contour continues. However, if they are positive, the two points at which k r = 0, lying on the edges leading to the vertex with a singular k r sign are approximated using linear interpolation, and are used to specify endpoints of a (suggestive) line. Styling Elements Figure 9 is an example of equal line density/thickness throughout the line drawings. Normally artists avoid such harsh lines, and tend to vary line intensities and/or thickness. The Siggraph lecture notes suggest varying line thickness as a function of the square root of the radial 10

Figure 10: Suggestive Contours with Alpha Line Stylization curvature. After some experimentation, I used the following expression to specify the alpha parameter of the line: 1.0 (p Kr α) (2) where α is some large number (10000 in most of my renderings), and p Kr is the interpolated radial curvature value of the zero crossing point. Figure 10 was rendered with alpha values based on κ r, and shows aesthetic improvement in terms of line smoothness and edge softness over the previous rendering. 11

Toon Shading I implemented two types of shadings, a smooth and a hard toon shading. A texture image is constructed for each type. The texture coordinates are assigned based on the dot product between the normal n at point p, and the vector from point p to the light position, call it l. For the hard shading, the texture image is constructed from multiple distinct colors, with no transitional colors. Hence, within a certain range of n.l the same color is used. As the values of n.l pass a specified threshold, the color changes abruptly. In the case of the smooth shading, the texture map varies smoothly by interpolating the color values of multiple specified colors. The user can specify color values, as well as the threshold parameter controlling the regions of the distinct parameters. Figures 11 to 13 show renderings with different shading parameters. 12

Figure 11: Cow Toon Shaded, Two Colors 13

Figure 12: Cow Toon Shaded, Three Colors, Threshold Between Regions (1) 14

Figure 13: Cow Toon Shaded, Three Colors, Threshold Between Regions (2) 15