Illumination and Shading

Slides:



Advertisements
Similar presentations
Computer Graphics - Shading -
Advertisements

1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Visual Appearance (Shading & Texture mapping)
CSPC 352: Computer Graphics
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 Computer Graphics By : Mohammed abu Lamdy ITGD3107 University of Palestine Supervision: Assistant Professor Dr. Sana’a Wafa Al-Sayegh.
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.
Based on slides created by Edward Angel
Illumination Model & Surface-rendering Method 박 경 와.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of New Mexico
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Lighting/Shading III Week.
Rendering (彩現 渲染).
IMGD 1001: Illumination by Mark Claypool
Lighting and Shading Wen-Chieh (Steve) Lin
7M836 Animation & Rendering
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Lighting and Shading Week.
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.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
Illumination and Shading
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Course Website: Computer Graphics 16: Illumination.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
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: Introductory Computer Graphics
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
CS 325 Introduction to Computer Graphics 03 / 26 / 2010 Instructor: Michael Eckmann.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
Steve Sterley. Real World Lighting Physical objects tend to interact with light in three ways: Absorption (black body) Reflection (mirror) Transmission.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
CS 450: COMPUTER GRAPHICS BASIC ILLUMINATION SPRING 2015 DR. MICHAEL J. REALE.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Local Illumination and Shading
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Illumination and Shading Sang Il Park Sejong University.
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
Lighting and Reflection Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Illumination Models. Introduction 1 Illumination model: Given a point on a surface, what is the perceived color and intensity? Known as Lighting Model,
CS552: Computer Graphics Lecture 33: Illumination and Shading.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Computer Graphics: Illumination
Illumination Models and Surface-Rendering Methods CEng 477 Introduction to Computer Graphics.
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
CS552: Computer Graphics Lecture 35: Rendering. Recap Illumination Model o Light Source and surface o Effect of multiple light source o Colored lights.
Unit-7 Lighting and Shading
Chapter 14 Shading Models.
CSC461: Lecture 23 Shading Computation
Illumination and Shading
Fundamentals of Computer Graphics Part 6 Shading
Isaac Gang University of Mary Hardin-Baylor
Computer Graphics (Fall 2003)
Chapter 14 Shading Models.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
CS 480/680 Computer Graphics Shading.
Presentation transcript:

Illumination and Shading Sang Il Park Sejong University

Photorealism in Computer Graphics Photorealism in computer graphics involves Accurate representations of surface properties, and Good physical descriptions of the lighting effects Modeling the lighting effects that we see on an object is a complex process, involving principles of both physics and psychology Physical illumination models involve Material properties, object position relative to light sources and other objects, the features of the light sources, and so on

Illumination and Rendering An illumination model in computer graphics also called a lighting model or a shading model used to calculate the color of an illuminated position on the surface of an object Approximations of the physical laws A surface-rendering method determine the pixel colors for all projected positions in a scene

Light Sources Point light sources Infinitely distant light sources Emitting radiant energy at a single point Specified with its position and the color of the emitted light Infinitely distant light sources A large light source, such as sun, that is very far from a scene Little variation in its directional effects Specified with its color value and a fixed direction for the light rays

Light Sources Directional light sources Area light sources Produces a directional beam of light Spotlight effects Area light sources

Light Sources Radial intensity attenuation As radiant energy travels, its amplitude is attenuated by the factor Sometimes, more realistic attenuation effects can be obtained with an inverse quadratic function of distance The intensity attenuation is not applied to light sources at infinity because all points in the scene are at a nearly equal distance from a far-off source

Light Sources Angular intensity attenuation For a directional light, we can attenuate the light intensity angularly as well as radially

Surface Lighting Effects An illumination model computes the lighting effects for a surface using the various optical properties Degree of transparency, color reflectance, surface texture The reflection (phong illumination) model describes the way incident light reflects from an opaque surface Diffuse, ambient, specular reflections Simple approximation of actual physical models

Diffuse Reflection Incident light is scattered with equal intensity in all directions Such surfaces are called ideal diffuse reflectors (also referred to as Lambertian reflectors)

Diffuse Reflection Light intensity is independent of angle of reflection Light intensity depends on angle of incidence

Diffuse Reflection : the intensity of the light source : diffuse reflection coefficient, : the surface normal (unit vector) : the direction of light source, (unit vector)

Ambient Light Multiple reflection of nearby (light-reflecting) objects yields a uniform illumination A form of diffuse reflection independent of he viewing direction and the spatial orientation of a surface Ambient illumination is constant for an object : the incident ambient intensity : ambient reflection coefficient, the proportion reflected away from the surface

Ambient + Diffuse

Specular Reflection Perfect reflector (mirror) reflects all lights to the direction where angle of reflection is identical to the angle of incidence It accounts for the highlight Near total reflector reflects most of light over a range of positions close to the direction

Specular Reflection Phong specular-reflection model Note that N, L, and R are coplanar, but V may not be coplanar to the others : intensity of the incident light : color-independent specular coefficient : the gloss of the surface

Specular Reflection Glossiness of surfaces

Specular Reflection Specular-reflection coefficient ks is a material property For some material, ks varies depending on q ks =1 if q =90° Calcularing the reflection vector R

Specular Reflection Simplified Phong model using halfway vector H is constant if both viewer and the light source are sufficiently far from the surface

Ambient+Diffuse+Specular Reflections Single light source Multiple light source Emission and attenuation

Parameter Choosing Tips For a RGB color description, each intensity and reflectance specification is a three-element vector The sum of reflectance coefficients is usually smaller than one Try n in the range [0, 100] Use a small ka (~0.1) Example Metal: n=90, ka=0.1, kd=0.2, ks=0.5

Atmospheric Effects A hazy atmosphere makes colors fade and objects appear dimmer Hazy-atmosphere effect is often simulated with an exponential attenuation function such as Higher values for r produce a denser atmosphere

Polygon Rendering Methods We could use an illumination model to determine the surface intensity at every projected pixel position Or, we could apply the illumination model to a few selected points and approximate the intensity at the other surface positions Curved surfaces are often approximated by polygonal surfaces So, polygonal (piecewise planar) surfaces often need to be rendered as if they are smooth

Constant-Intensity Surface Rendering Constant (flat) shading Each polygon is one face of a polyhedron and is not a section of a curved-surface approximation mesh

Intensity-Interpolation Surface Rendering Gouraud shading Rendering a curved surface that is approximated with a polygon mesh Interpolate intensities at polygon vertices Procedure Determine the average unit normal vector at each vertex 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

Intensity-Interpolation Surface Rendering Normal vectors at vertices Averaging the normal vectors for each polygon sharing that vertex 4 3 2 1 ) ( N v + =

Intensity-Interpolation Surface Rendering Intensity interpolation along scan lines I4 and I5 are interpolated along y-axis, and then Ip is interpolated along x-axis Incremental calculation is also possible y 3 1 p scan line 4 5 2 x

Intensity-Interpolation Surface Rendering

Gouraud Shading Problems Lighting in the polygon interior is inaccurate Mach band effect Optical illusion

Mach Band Effect These “Mach Bands” are not physically there. Instead, they are illusions due to excitation and inhibition in our neural processing The bright bands at 45 degrees (and 135 degrees) are illusory. The intensity of each square is the same.

Normal-Vector Interpolation Surface Rendering Phong shading Interpolate normal vectors at polygon vertices Procedure Determine the average unit normal vector at each vertex 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 n1 n2 n3

Gouraud versus Phong Shading Gouraud shading is faster than Phong shading OpenGL supports Gouraud shading Phong shading is more accurate