Illumination and Shading Sang Il Park Sejong University.

Slides:



Advertisements
Similar presentations
Computer Graphics - Shading -
Advertisements

1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Visual Appearance (Shading & Texture mapping)
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
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.
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.
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.
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
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.
Illumination and Shading
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
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.
Illumination and Shading
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.
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.
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.
In the name of God Computer Graphics. Where We Stand So far we know how to: –Transform between spaces –Draw polygons Next –Deciding a pixel’s intensity.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
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
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,
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.
Illumination : Hearn & Baker Ch. 10
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

Review Light Source Model Illumination Model

Review: Light Sources Point 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

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

Review: Illumination Model 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

Review: 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)

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

Review: 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

Review: 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

Review: 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

Review: Specular Reflection Specular-reflection coefficient k s is a material property –For some material, k s varies depending on  –k s =1 if  =90° Calcularing the reflection vector R

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 1.Determine the average unit normal vector at each vertex 2.Apply an illumination model at each polygon vertex to obtain the light intensity at that position 3.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 )( NNNN NNNN N v   

Intensity-Interpolation Surface Rendering Intensity interpolation along scan lines –I 4 and I 5 are interpolated along y-axis, and then –I p is interpolated along x-axis Incremental calculation is also possible y x p scan line

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 1.Determine the average unit normal vector at each vertex 2.Linearly interpolate the vertex normals over the projected area of the polygon 3.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

코딩 연습 Phone Illumination Model 을 직접 구현해 본다 (GL_LIGHTING 을 끈 상태로 직접 색을 계산하여 그려본다 ) 1. 조명을 설정한다. ( 위치 (lx,ly,lz) 및 Intensity) 2. 도형의 색을 설정 (ka, kd, ks) 3. 카메라의 위치 설정 (vx, vy, vz) 4. 그리고 있는 삼각형의 Normal Vector 계산 5.Phong Model 의 각각의 성분 계산 (ambient, diffuse, specular) 계산

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  produce a denser atmosphere