Komputer Grafik 2 (AK045206) Shading 1/17 Realisme : Shading.

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.
Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
3D Graphics Rendering and Terrain Modeling
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.
 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
Illumination and Shading
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.
Osvetljevanje in senčenje (lighting - shading)
Illumination Model & Surface-rendering Method 박 경 와.
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.
IMGD 1001: Illumination by Mark Claypool
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Lighting and Shading Wen-Chieh (Steve) Lin
(conventional Cartesian reference system)
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.
Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006
Fundamentals of Computer Graphics Part 6 Shading prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
CS 445 / 645 Introduction to Computer Graphics Lecture 18 Shading Shading.
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.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
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.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
CS 325 Introduction to Computer Graphics 03 / 26 / 2010 Instructor: Michael Eckmann.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Lighting/Shading III Week.
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.
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.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Local Illumination and Shading
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
CDS 301 Fall, 2008 From Graphics to Visualization Chap. 2 Sep. 3, 2009 Jie Zhang Copyright ©
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,
CPSC 314 LIGHTING AND SHADING UGRAD.CS.UBC.CA/~CS314 slide credits: Mikhail Bessmeltsev et al 1.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Computer Graphics (Fall 2006) COMS 4160, Lecture 16: Illumination and Shading 1
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.
3D Graphics Rendering PPT By Ricardo Veguilla.
Chapter 14 Shading Models.
CSC461: Lecture 23 Shading Computation
Vectors, Normals, & Shading
Lighting/Shading III Week 7, Wed Mar 3
Introduction to Meshes
CSC418 Computer Graphics Shading Color.
Illumination and Shading
Computer Graphics (Fall 2003)
Chapter 14 Shading Models.
Presentation transcript:

Komputer Grafik 2 (AK045206) Shading 1/17 Realisme : Shading

Komputer Grafik 2 (AK045206) Shading 2/17 Outline Shading Models : Direct Line –Flat Shading –Gouraud Shading –Phong Shading Shading Models : Indirect Line

Komputer Grafik 2 (AK045206) Shading 3/17 Shading Models (Direct lighting) Flat Shading –Compute Phong lighting once for entire polygon Gouraud Shading –Compute Phong lighting at the vertices and interpolate lighting values across polygon Phong Shading –Compute averaged vertex normals –Interpolate normals across polygon and perform Phong lighting across polygon

Komputer Grafik 2 (AK045206) Shading 4/17 The simplest approach, flat shading, calculates illumination at a single point for each polygon. We can refine it a bit by evaluating the Phong lighting model at each pixel of each polygon, but the result is still clearly faceted: To get smoother-looking surfaces we introduce vertex normals 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 Flat Shading

Komputer Grafik 2 (AK045206) Shading 5/17 Vertex normals may be –Provided with the model –Computed from first principles –Approximated by averaging the normals of the facets that share the vertex Flat Shading : Vertex Normal

Komputer Grafik 2 (AK045206) Shading 6/17 This is the most common approach –Perform Phong lighting at the vertices –Linearly interpolate the resulting colors over faces Along edges Along scanlines –This is what OpenGL does Gouraud Shading C1C1 C2C2 C3C3 c 1 + t 1 (c 2 -c 1 ) c 1 + t 2 (c 3 -c 1 ) c 1 + t 1 (c 2 -c 1 ) + t 3 (c 1 + t 2 (c 3 -c 1 )- c 1 + t 1 (c 2 -c 1 ))

Komputer Grafik 2 (AK045206) Shading 7/17 Artifacts –Often appears dull, chalky –Lacks accurate specular component If included, will be averaged over entire polygon Gouraud Shading C1C1 C2C2 C3C3 Can’t shade that effect!

Komputer Grafik 2 (AK045206) Shading 8/17 Artifacts –Mach Banding Artifact at discontinuities in intensity or intensity slope Gouraud Shading C1C1 C2C2 C3C3 C4C4 Discontinuity in rate of color change occurs here

Komputer Grafik 2 (AK045206) Shading 9/17 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 Same input as Gouraud shading Usually very smooth-looking results: But, considerably more expensive Phong Shading

Komputer Grafik 2 (AK045206) Shading 10/17 Phong Shading Linearly interpolate the vertex normals –Compute lighting equations at each pixel –Can use specular component N2N2 N3N3 N4N4 Remember: Normals used in diffuse and specular terms Discontinuity in normal’s rate of change is harder to detect

Komputer Grafik 2 (AK045206) Shading 11/17 Perspective Distortion         Z – into the scene Image plane Break up large polygons with many smaller ones Notice that linear interpolation in screen space does not align with linear interpolation in world space

Komputer Grafik 2 (AK045206) Shading 12/17 Z – into the scene Image plane Break up large polygons with many smaller ones Notice that linear interpolation in screen space does not align with linear interpolation in world space Perspective Distortion

Komputer Grafik 2 (AK045206) Shading 13/17 Interpolation dependent on polygon orientation  A D C B Interpolate between AB and AD  B A D C Interpolate between CD and AD Rotate - 90 o and color same point

Komputer Grafik 2 (AK045206) Shading 14/17 Problems at Shared Vertices Vertex B is shared by the two rectangles on the right, but not by the one on the left The first portion of the scanline is interpolated between DE and AC The second portion of the scanline is interpolated between BC and GH A large discontinuity could arise B A C E D F H G

Komputer Grafik 2 (AK045206) Shading 15/17 Polygonal silhouettes remain Shortcomings of Shading Gouraud Phong

Komputer Grafik 2 (AK045206) Shading 16/17 Shading Models (Indirect lighting) Ray Tracing Radiosity

Komputer Grafik 2 (AK045206) Shading 17/17 Referensi F.S.Hill, Jr., COMPUTER GRAPHICS – Using Open GL, Second Edition, Prentice Hall, 2001 CS 445/645 : Introduction to Computer Graphics, Slide-Presentation, Virginia University