Lecture outline Graphics and Interaction Surface rendering and shading. Shading techniques. Introduction. Surface rendering and shading

Similar documents
Graphics and Interaction Surface rendering and shading

Illumination and Shading

How do we draw a picture?

Pipeline Operations. CS 4620 Lecture 10

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

surface: reflectance transparency, opacity, translucency orientation illumination: location intensity wavelength point-source, diffuse source

Illumination Models & Shading

Mach band effect. The Mach band effect increases the visual unpleasant representation of curved surface using flat shading.

Dithering and Rendering. CS116B Chris Pollett Apr 18, 2004.

Introduction to Computer Graphics 7. Shading

Interpolation using scanline algorithm

9. Illumination and Shading

CS5620 Intro to Computer Graphics

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

CS770/870 Spring 2017 Color and Shading

Pipeline Operations. CS 4620 Lecture 14

Introduction to Computer Graphics. Farhana Bandukwala, PhD Lecture 14: Light Interacting with Surfaces

Rendering. Illumination Model. Wireframe rendering simple, ambiguous Color filling flat without any 3D information

3D Rasterization II COS 426

w Foley, Section16.1 Reading

Graphics Hardware and Display Devices

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

CPSC / Illumination and Shading

CS 130 Final. Fall 2015

CEng 477 Introduction to Computer Graphics Fall

Illumination and Shading

Homework #2. Shading, Ray Tracing, and Texture Mapping

Visualisatie BMT. Rendering. Arjan Kok

CS Illumination and Shading. Slide 1

Computer Graphics. Illumination and Shading

Computer Graphics. Illumination and Shading

University of Victoria CSC 305 Shading. Brian Wyvill 2016

From Graphics to Visualization

CPSC 314 LIGHTING AND SHADING

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

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

Computer Graphics Introduction. Taku Komura

Illumination and Shading

CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department

CS 325 Computer Graphics

Graphics and Interaction Rendering pipeline & object modelling

Illumination & Shading: Part 1

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Introduction Rasterization Z-buffering Shading. Graphics 2012/2013, 4th quarter. Lecture 09: graphics pipeline (rasterization and shading)

Illumination and Shading

Complex Features on a Surface. CITS4241 Visualisation Lectures 22 & 23. Texture mapping techniques. Texture mapping techniques

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

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

Computer Graphics I Lecture 11

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Fog and Cloud Effects. Karl Smeltzer Alice Cao John Comstock

Shading Algorithms. Ron Goldman Department of Computer Science Rice University

Today s class. Simple shadows Shading Lighting in OpenGL. Informationsteknologi. Wednesday, November 21, 2007 Computer Graphics - Class 10 1

Surface Rendering Methods

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

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

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE 167: Lecture #8: Lighting. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Graphics for VEs. Ruth Aylett

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Fast Phong Shading by Gary Bishop

Computer Graphics MTAT Raimond Tunnel

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

CSE 167: Introduction to Computer Graphics Lecture #8: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016

Computer Graphics. Illumination Models and Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

Lighting and Shading

CEng 477 Introduction to Computer Graphics Fall 2007

Chapter 7 - Light, Materials, Appearance

CS 488. More Shading and Illumination. Luc RENAMBOT

Lighting/Shading III. Week 7, Wed Mar 3

Reading. Shading. An abundance of photons. Introduction. Required: Angel , 6.5, Optional: Angel 6.4 OpenGL red book, chapter 5.

CS 130 Exam I. Fall 2015

Chapter 10. Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

The Rasterization Pipeline

LIGHTING AND SHADING

Level of Details in Computer Rendering

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2014

CS130 : Computer Graphics Lecture 8: Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

Reading. 18. Projections and Z-buffers. Required: Watt, Section , 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading:

Homework #2. Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Illumination and Shading

Sung-Eui Yoon ( 윤성의 )

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

- Rasterization. Geometry. Scan Conversion. Rasterization

THE AUSTRALIAN NATIONAL UNIVERSITY Final Examinations(Semester 2) COMP4610/COMP6461 (Computer Graphics) Final Exam

Objectives. Introduce Phong model Introduce modified Phong model Consider computation of required vectors Discuss polygonal shading.

Reflection and Shading

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

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

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

CS Surface Rendering

Local Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

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

COMP30019 Graphics and Interaction Perspective & Polygonal Geometry

SEOUL NATIONAL UNIVERSITY

Normal Maps and Cube Maps. What are they and what do they mean?

03 RENDERING PART TWO

Rendering Light Reflection Models

Transcription:

Lecture outline 433-324 Graphics and Interaction Surface rendering and shading Department of Computer Science and Software Engineering The Introduction Surface rendering and shading Gouraud shading Phong shading Shading techniques How are polygonal surfaces rendered? Aim: understand how to use illumination models to create realistic shading through surface rendering. Reading: Foley Section 14.2 Shading models for polygons. How do we put these formulas to use? For polyhedral objects, we can use flat shading or full shading. In flat shading, compute the shading at some representative point of each (visible) polygon face (may be a vertex, or the centroid of the face, assuming it lies within the face). Then use this computed value to fill the whole polygon. In full shading, do the complete shading calculation at each pixel as the polygon is displayed.

In flat shading, the same value is used to render the entire polygon, it misses out on shading variations. It is therefore realistic only for distant viewer and distant light source. If our polyhedron is really intended as an approximation to a curved object, then either flat shading or full shading are inappropriate. The discontinuities in surface normal where the face meet will lead to artefactual discontinuities in the shading. There are two cures for this: Gouraud shading and Phong shading. In both, compute an average surface normal at each visible vertex, by averaging the normals of the faces that meet there. Gouraud shading Normalised polygon surface normals averaged to obtain vertex normals in Gouraud shading (Foley Figure 14.18). Because of the contrast enhancing caused by lateral inhibition in our visual systems, these false edges are strongly perceived and are therefore even more objectionable. N 3 N v N 1 N 2 N 4

Calculating surface normals Assuming all polygons store vertices in same walking order, the sign for surface normals should be correct and obtained simply calculating the cross products of the vectors (p 2 p 1 ) and (p 3 p 2 ). In Gouraud shading, compute the shading at each vertex. When filling a polygon in a scan-line fashion, interpolate the shading linearly along each edge, and then interpolate linearly along each scan-line segment (Foley Figure 14.19). y N p 2 p 3 y 1 l 1 y 1 y s l a = l 1 (l 1 l 2 ) y 1 y 2 p 1 y s y 2 l 2 l a l p l b Scan line y 1 y s l b = l 1 (l 1 l 3 ) y 1 y 3 p 5 p 4 y 3 l 3 x b x p l p = l b (l b l a ) x b x a N =(p 2 p 1 ) (p 3 p 2 ) Orientation dependence The results of interpolated-shading is not independent of the projected polygons position (Foley Figure 14.22). Gouraud shading is also called intensity interpolated shading. A B D P B A P C D C (a) (b)

Perspective distortion Imagine you have a polygon with vertex 1 more distorted than vertex 2. In this case you get perspective distortion, since perspective foreshortening means that the difference from one scan line to another increases in the direction of the further coordinate. Phong shading Phong shading is similar to Gouraud, except interpolate the surface normals, and do full shading calculation at every pixel using these interpolated normals (Foley Figure 14.20). N 0 N a N b N c N 1 P 0 P a P b P c P 1 Under these conditions you can get polygonal silhouettes and edges can look weird. Normal vector interpolation used in Phong shading. What is the computational cost of Phong versus Gouraud? Gouraud shading (left) Phong shading (right) with highlight falling at left vertex (Foley Figure 14.21). Highlight falling in centre of polygon face (Foley Figure 14.21).

Gouraud shading with specular reflection Unrepresentative vertex normals Averaged vertex normals may not represent surface geometry adequately (Foley Figure 14.24). Intensity interpolation (Gouraud shading) can be used with specular reflection but get less pronounced highlights (according to specular reflection coefficient). Summary If interpolation is used, this example should appear like corrugated iron! In this example, there will be little or no variation in the shade, if the light source is distant. This is because we interpolate between the normals, therefore the actual surface normal information inbetween is lost! Particularly true for objects represented by with lots of small polygons. Polygons can be rendered to produce curved surfaces by calculating surface normals at vertices and performing either interpolation over intensity (Gouraud shading), or interpolation over surfaces normals (Phong shading). Phong shading requires calculation of the illumination model at each pixel, whereas Gouraud shading only requires calculating the illumination model at each vertex.