Chapter 14 Shading Models.

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

SI23 Introduction to Computer Graphics
7.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 7 Polygon Shading Techniques.
Polygon Rendering Flat Rendering Goraud Rendering Uses Phong Reflectance Phong Rendering.
Computer Graphics Inf4/MSc Computer Graphics Lecture 13 Illumination I – Local Models.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Lighting/Shading III Week.
Computer Graphics - Class 10
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Lighting/Shading III Week.
1 of 29 Interesting Illumination Demo There’s a very nice Java illumination model demo which may help you understand the effects of different kinds of.
(conventional Cartesian reference system)
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
CS 376 Introduction to Computer Graphics 03 / 30 / 2007 Instructor: Michael Eckmann.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
©Larry F. Hodges (modified by Amos Johnson) 1 Shading Models.
Coordinate Systems X Y Z (conventional Cartesian reference system) X Y Z.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Lighting and Shading Week.
Polygon Shading. Assigning color to a shape to make graphical scenes look realistic, or artistic, or whatever effect we’re attempting to achieve But first.
CS 445 / 645 Introduction to Computer Graphics Lecture 18 Shading Shading.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
Illumination and Shading How to shade surfaces based on the position,orientation,characteristics of the surfaces and the light sources illuminating them.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Komputer Grafik 2 (AK045206) Shading 1/17 Realisme : Shading.
Illumination and Shading
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
CS 445 / 645 Introduction to Computer Graphics Lecture 15 Shading Shading.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Local Illumination and Shading
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Chris Mayer & Nic Shulver Shading Definitions Light emanating from small surfaces is called a Point light sourcee.g. the sun (not really small though!)
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
Illumination and Shading Sang Il Park Sejong University.
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Schedule Update GP 4 – Tesselation/Cg GDS 4 – Subdiv Surf. GP 5 – Object Modeling Lab: Mini-proj Setup GDS 5 – Maya Modeling MCG 6 – Intersections GP 6.
Illumination Models. Introduction 1 Illumination model: Given a point on a surface, what is the perceived color and intensity? Known as Lighting Model,
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Applications and Rendering pipeline
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
CS552: Computer Graphics Lecture 35: Rendering. Recap Illumination Model o Light Source and surface o Effect of multiple light source o Colored lights.
Photorealistic Rendering vs. Interactive 3D Graphics
Computer Graphics Chapter 9 Rendering.
POLYGON MESH Advance Computer Graphics
Rendering Process of producing “realistic” images or pictures
3D Graphics Rendering PPT By Ricardo Veguilla.
Chapter 10: Computer Graphics
Chapter 14 Shading Models.
CSC461: Lecture 23 Shading Computation
Lighting/Shading III Week 7, Wed Mar 3
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
Illumination and Shading
CS5500 Computer Graphics May 29, 2006
Illumination and Shading
14th Lecture – Final Lecture
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics (Fall 2003)
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

Chapter 14 Shading Models

3D Viewing Pipeline Primitives Object space World space Camera space Modeling Transformation World space Viewing Transformation Camera space Hidden Surface Removal Lighting & Shading 3D-Clipping Projection Normalized view space Scan conversion, Hiding Image space, Device coordinates May 6, 2019 Computer Graphics Image

Viewing Models Need for different models Light Models: To take care of Light, its intensity and effect on different textures. Shading Models: To take care of type of surface – its shape, texture etc. and rendering the intensity at every point of the surface. Colour Models: Various colour schemes present to represent the calculated intensities on your computer. May 6, 2019 Computer Graphics

Shading Models Shading Models: We have an illumination model for given point on a surface and every point on the surface is unique. Should we calculate intensity of light at all points of the object? If our surface is defined as mesh of polygons, which point should be used? May 6, 2019 Computer Graphics

Shading Models Keep in mind: It’s a fairly expensive calculation Several possible answers, each with different implications for the visual quality of the result Three common techniques are Constant shading (No Shading) Faceted shading Gouraud shading Phong shading Shading models dictate how often the color computation is performed. May 6, 2019 Computer Graphics

SHADING METHODS POLYGON RENDERING METHODS FACETED SHADING Is used for objects defined as polyhedral. INTERPOLATION SHADING Used for polyhedron-mesh approximation of curved surfaces GOURAUD SHADING Interpolate intensity PHONG SHADING Interpolate surface normal CONSTANT SHADING No Shading May 6, 2019 Computer Graphics

INTERPOLATION SHADING CONSTANT SHADING Effects of different shading techniques FACETED SHADING INTERPOLATION SHADING GOURAUD SHADING PHONG SHADING May 6, 2019 Computer Graphics

INTERPOLATION SHADING OBJECT MODEL Effects of different shading techniques FACETED SHADING INTERPOLATION SHADING GOURAUD SHADING PHONG SHADING May 6, 2019 Computer Graphics

Shading Models We will start to look at shading or rendering methods commonly used in computer graphics Constant surface shading/rendering Faceted surface shading/rendering Gouraud surface shading/rendering Phong surface shading/rendering May 6, 2019 Computer Graphics

Contents Constant Intensity Shading Faceted Shading Gouraud Shading Phong and Fast Phong Shading

Constant Intensity Shading Constant intensity shading also refer to as no shading. It is done by giving same color to every polygon in the object. Thus entire object is painted with the same color. It is the simplest, but not realistic. May 6, 2019 Computer Graphics

Contents Constant Intensity Shading Faceted Shading Gouraud Shading Phong and Fast Phong Shading

Faceted Shading Also known as flat shading or fast shading it is an extension to Constant intensity shading. The entire object is divided into number of polygons surfaces called facets. Determine the orientation of each facet and does one color computation for each polygon or facet. It is simple, fast (?) and produce better results than no shading. May 6, 2019 Computer Graphics

Faceted Shading Original Faceted Shaded Just add lots and lots of polygons – however, this is SLOW! May 6, 2019 Computer Graphics

Faceted Shading Still it is not realistic as For point sources, the direction to light varies across the facet For specular reflectance, direction to eye varies across the facet We have to determine the orientation of each facet we have to find the normal for each facet. This approximation effect the result. May 6, 2019 Computer Graphics

Faceted Shading To determine the orientation of each facet we introduce vertex normal at each vertex Usually different from facet normal Used only for shading Think of as a better approximation of the real surface that the polygons approximate May 6, 2019 Computer Graphics

Faceted Shading Vertex normals may be Approximated by averaging the normals of the facets that share the vertex Provided with the model Computed from first principles May 6, 2019 Computer Graphics

Faceted Shading It is very useful for quickly displaying the general appearance of surfaces It is more applicable when the object must be polyhedron and not an approximation of an object with a curved surface. All light sources illuminating the object are sufficiently far from the surface so that N.L and the attenuation functions are constant over the surface. The viewing position is sufficiently far from the surface so that V.R is constant over the surface. May 6, 2019 Computer Graphics

Contents Constant Intensity Shading Faceted Shading Gouraud Shading Phong and Fast Phong Shading

Gouraud Shading Gouraud surface shading was developed in the 1970s by Henri Gouraud while working at the University of Utah along with Ivan Sutherland and David Evans Often also called intensity-interpolation surface rendering This is the most common approach Intensity levels are calculated at each vertex Linearly interpolate the resulting colors over faces Along edges Along scanlines May 6, 2019 Computer Graphics

Gouraud Shading To render a polygon, Gouraud surface rendering proceeds as follows: Determine the average unit normal vector at each vertex of the polygon Apply an illumination model at each polygon vertex to obtain the light intensity at that position Linearly interpolate the vertex intensities over the projected area of the polygon May 6, 2019 Computer Graphics

Gouraud Shading The average unit normal vector at v is given as: Step 1: Determine the average unit normal vector at each vertex of the polygon The average unit normal vector at v is given as: or more generally: N2 Nv N4 N3 N1 v May 6, 2019 Computer Graphics

Step 2: Apply an illumination model at each polygon vertex Gouraud Shading Step 2: Apply an illumination model at each polygon vertex N2 Nv N4 N3 N1 v I4 I I3 I1 I2 You have to apply the illumination model to take of ambient light Diffuse reflection Specular reflection (?) Transparency (Refraction) May 6, 2019 Computer Graphics

Gouraud Shading Step 3: Linearly interpolate the vertex intensities over the projected area of the polygon along edges and along scan lines 1 2 3 4 5 x y Scan-line p May 6, 2019 Computer Graphics

Gouraud Shading Original Gouraud Shaded May 6, 2019 Computer Graphics

Gouraud Shading It can be combined with hidden surface algorithms to fill in visible surfaces/polygons along each scan line. It removes the intensity discontinuities associated with the constant shading. May 6, 2019 Computer Graphics

Gouraud Shading It can be combined with hidden surface algorithms to fill in visible surfaces/polygons along each scan line. It removes the intensity discontinuities associated with the constant shading. Gouraud is more efficient using an iterative approach May 6, 2019 Computer Graphics

Can’t shade that effect! Gouraud Shading Objects shaded with Gouraud shading often appears dull, chalky Lacks accurate specular component If included, will be averaged over entire polygon C1 C2 C3 Can’t shade that effect! May 6, 2019 Computer Graphics

Discontinuity in rate of color change occurs here Gouraud Shading Gouraud shading can introduce anomalies known as Mach bands Mach banding Artifact at discontinuities in intensity or intensity slope C1 C2 C3 C4 Discontinuity in rate of color change occurs here May 6, 2019 Computer Graphics

Mach Bands A psychological phenomenon whereby we see bright bands where two blocks of solid colour meet A good demo is available to experiment with this at: http://www.nbb.cornell.edu/neurobio/land/OldStudentProjects/cs490-96to97/anson/ MachBandingApplet/ Try playing with the various parameters and see if you can predict what the sphere will look like May 6, 2019 Computer Graphics

Contents Constant Intensity Shading Faceted Shading Gouraud Shading Phong and Fast Phong Shading

Phong Shading A more accurate interpolation based approach for rendering a polygon was developed by Phong Bui Tuong Basically the Phong surface rendering model interpolates normal vectors instead of intensity values and then compute the actual intensity value using Phong Lighting Model. Often also called normal or vector – interpolation surface rendering May 6, 2019 Computer Graphics

Phong Shading Phong shading is not the same as Phong lighting, though they are sometimes mixed up Phong lighting: the empirical model we’ve been discussing to calculate illumination at a point on a surface Phong shading: linearly interpolating the surface normal across the facet, applying the Phong lighting model at every pixel May 6, 2019 Computer Graphics

Phong Shading To render a polygon, Phong surface rendering proceeds as follows: Determine the average unit normal vector at each vertex of the polygon Linearly interpolate the vertex normals over the projected area of the polygon Apply an illumination model at positions along scan lines to calculate pixel intensities using the interpolated normal vectors May 6, 2019 Computer Graphics

Phong Shading Interpolating Normal N3 N1 N4 Np p N5 N2 Scan line May 6, 2019 Computer Graphics

Phong Shading Phong shading accept the same input as Gouraud shading and produce very smooth-looking results. Phong shading is considerably more expensive. Phong shading is much slower than Gouraud shading as the lighting model is revaluated so many times However, there are fast Phong surface rendering approaches that can be implemented iteratively. Typically Phong shading is implemented as part of a visible surface detection technique. May 6, 2019 Computer Graphics

Phong Shading An example of bad Vertex Averaging May 6, 2019 Computer Graphics

Phong Shading Examples May 6, 2019 Computer Graphics

Phong Shading Examples May 6, 2019 Computer Graphics

Summary For realistic rendering of polygons we need interpolation methods to determine lighting positions Flat shading is fast, but unrealistic Gouraud shading is better, but does not handle specular reflections very well Phong shading is better still, but can be slow May 6, 2019 Computer Graphics