Lighting & Shading.

Slides:



Advertisements
Similar presentations
Computer Graphics - Shading -
Advertisements

5.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 5 A Simple Reflection Model.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Computer Graphics (Fall 2008) COMS 4160, Lecture 18: Illumination and Shading 1
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.
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
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of New Mexico
Computer Graphics - Class 10
Rendering (彩現 渲染).
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)
Computer Graphics (Spring 2008) COMS 4160, Lecture 15: Illumination and Shading
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
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.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
LIGHTING Part One - Theory based on Chapter 6. Lights in the real world Lights bounce off surfaces and reflect colors, scattering light in many directions.
Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror.
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
Lecture 5: 3D Rendering Pipeline (II) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
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.
Shading and Illumination. OpenGL Shading Without ShadingWith Shading.
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
David Luebke 1 10/26/2015 Lighting CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
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.
CSE 381 – Advanced Game Programming GLSL Lighting.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Visual Appearance Chapter 4 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Local Illumination and Shading
Cornell CS465 Spring 2004 Lecture 4© 2004 Steve Marschner 1 Shading CS 465 Lecture 4.
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Illumination Model How to compute color to represent a scene As in taking a photo in real life: – Camera – Lighting – Object Geometry Material Illumination.
CDS 301 Fall, 2008 From Graphics to Visualization Chap. 2 Sep. 3, 2009 Jie Zhang Copyright ©
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.
CPSC 314 LIGHTING AND SHADING UGRAD.CS.UBC.CA/~CS314 slide credits: Mikhail Bessmeltsev et al 1.
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
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.
Unit-7 Lighting and Shading
Illumination Model How to compute color to represent a scene
CSE 470 Introduction to Computer Graphics Arizona State University
Fundamentals of Computer Graphics Part 6 Shading
Isaac Gang University of Mary Hardin-Baylor
Exploring Shaders in Unity
Chapter IX Lighting.
Illumination and Shading
Advanced Computer Graphics
Computer Graphics Material Colours and Lighting
Computer Graphics (Fall 2003)
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
CS 480/680 Computer Graphics Shading.
Presentation transcript:

Lighting & Shading

Illumination Without Local Global

Global Illumination Interaction with matter Consider multiple reflections, transmission, shadows Rendering Equation: BRDF

Local Illumination - Phong Lighting General Idea: Consider only (non-area) light sources that are directly visible from the point on the objects surface without reflections. Each point is illuminated independent of its “global” surroundings (except “self”-occlusion of light sources) Idea: Approximate illumination by three additive components, representing ambient, diffuse and specular lighting.

Local Illumination Ambient Lighting Hack for replacing true global illumination (i.e. light bouncing off from other objects) No direction Incoming light component that is identical everywhere in the whole scene where ka is the ambient material coefficient of reflection with 0.0 <= ka <= 1.0 and Ia is the intensity of the ambient light

Local Illumination Diffuse Lighting Rough material Brightness ~ incoming Energy (Lambertian reflection) Object scatters light into all directions equally Heuristic reflection model but plausible for certain materials

Local Illumination Diffuse Lighting Power per unit area arriving at point x depends on the angle of the surface to the light direction (Johann Friedrich Lambert) dA dA‘ Iin N J

Local Illumination Diffuse Lighting Rough material Brightness ~ incoming Energy (Lambertian reflection) Object scatters light into all directions equally Heuristic reflection model but physically plausible for certain kd N  L Intersection Point

Local Illumination Specular Lighting Glossy/smooth material Light is mostly reflected into the directions around the mirror direction RL of L Diffuse Glossy Specular

Local Illumination Specular Lighting: The Phong model Use cosine power as heuristic Light is mostly reflected into the directions around the mirror direction RL of L (Rapid decay) Perfect mirroring only in direction RL (perfect mirror: n  ) a cosn N RL eye L a V J J

Local Illumination Careful! If a light is situated behind the object (α > 90°) then cos(α) < 0.  Discard negative intensity values by clamping the dot products dot to the range [0,1] ! dot = max(0,dot) ka = 0.1 kd = 0.5 ks = 0.4 Phong Ambient Diffuse Specular

Incorporating color So far we have only dealt with Intensity: One possible approach to incorporate color: diffusely reflected light results from the reflection via multiple scattering events in the micro-scale geometry  reflected light is coloured by selective absorption by the surface i.e. a green surface absorbs all wavelengths except green specularly reflected light interacts once with the surface and is thus not “coloured” by the surface i.e. the reflection of a light source remains the colour of the source

Color of Material and Light Usually we define Colors as 3 component vector C(r,g,b) Therefore the Phong model becomes: Camb global ambient lighting color defined once in the whole scene Cdiff defined per material Cspec specified per light source (To increase flexibility the specular color can additionally be scaled by a color defined per material)

Graphics Pipeline (DirectX 10) IB Input Data VB Memory Input Assembler Buffer Resources: Stage (IA) Buffers, Textures, Constant Buffers Vertex Shader Texture, Constant Buffer Stage (VS) Geometry Shader Texture, Constant Buffer Stage (GS) Stream Output Buffer Stage (SO) Rasterizer Stage (RS) Pixel Shader Texture, Constant Buffer Stage (PS) Output Merger States Stage (OM) Output Data Buffer, Texture, Constant Buffer

Shading: Flat vs. Gouraud vs. Phong Phong Lighting Flat Shading Phong Lighting Gouraud Shading Phong Lighting Phong Shading

Shading: Gouraud vs. Phong Gouraud Shading Phong Shading evaluates lighting per vertex evaluates lighting per fragment