Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.

Slides:



Advertisements
Similar presentations
SI23 Introduction to Computer Graphics
Advertisements

5.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 5 A Simple Reflection Model.
Illumination Lighting and Shading CSE 470/598 Introduction to Computer Graphics Arizona State University Dianne Hansford.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 6.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
Lighting and Illumination Lighting is the major problem in computer graphics, for either realism or real-time compositions- harder than modeling Consider.
Light Issues in Computer Graphics Presented by Saleema Amershi.
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
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of New Mexico
Rendering (彩現 渲染).
IMGD 1001: Illumination by Mark Claypool
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.
Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 9: 3D & Projections Basics.
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.
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
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.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
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.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Basic Illumination BRANCH :- ELECTRICAL (C11) Gohil Amit M. ( ) Joshi Jay P. ( ) Barot Mahesh P. ( ) Pandya Bhrugu I.
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.
Course Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Applied Mathematics Lecture and laboratory.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Local Illumination and Shading
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
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
Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 9: 3D & Projections Basics.
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,
Computer Graphics Lecture 30 Mathematics of Lighting and Shading - IV Taqdees A. Siddiqi
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
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Shading To determine the correct shades of color on the surface of graphical objects.
Unit-7 Lighting and Shading
CSE 470 Introduction to Computer Graphics Arizona State University
Fundamentals of Computer Graphics Part 6 Shading
Isaac Gang University of Mary Hardin-Baylor
An Algorithm of Eye-Based Ray Tracing on MATLAB
Illumination and Shading
Advanced Computer Graphics
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
CS 480/680 Computer Graphics Shading.
Lighting Calculations
Presentation transcript:

Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 12 : Lighting Basics

Written by: Itzik Ben Shabat Tutorial Contents Introduction to Lighting Lighting model Ambient Diffusive Specular Phong model summary Blins correction Calculation example – sphere MATLAB Lighting shading Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering

Written by: Itzik Ben Shabat Introduction to lighting Lighting plays an important role in rendering realistic scenes Lighting models can simulate shading, reflections etc. Local illumination is based on the interaction of a light source and a point on a surface The main local illumination model in this coure is Phong which is composed of 3 components Ambient Diffusive Specular At each surface point we calculate the contribution od every component Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering

Written by: Itzik Ben Shabat Ambient Component Global effect of light (source at infinity) I out = k ambient · I ambient_source I – Light intensity / Illumination K – reflection constant Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering

Written by: Itzik Ben Shabat Diffusive Component Correlates to surface roughness (at microscopic level) I out =k diffusive · I in cos(θ i ) or I out =k diffusive · I in n ·l Θ i - angle between normal and light ray L – light ray vector (unit size from surface to light source) N – normal at surface point (unit size) Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering

Written by: Itzik Ben Shabat Specular Component Shiny materials show highlights from light sources The highlight depends on our position (in relation to the surface the light is reflected from) Surfaces are not perfectly smooth, therefore there will be variations Phong modeled the variation empirically I out =k specular ·I light ·cos s (φ) or I out =k specular ·I light ·(v·r) s S – shininess factor V – unit vector from surface point to observer eye r - unit vector of reflection direction r=2(LN)N-L Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering

Written by: Itzik Ben Shabat Phong model summary In reality we can have more than one light source Therefore Phong model transforms to I out = k ambient ·I ambient + ΣI light ·(k diffuse ·(n·l)+ k specular ·(v·r) s ) Note – k and i can have 3 RGB components. The multiplication results in a vector (multiply each component seperately i.e (Kr,Kg,Kb) · (Ir,Ig,Ib) = (Ir · Kr, Ig · Kg, Ib · Kb) Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering

Written by: Itzik Ben Shabat Phong model summary Below is a graphical illustration of the contribution of each component Image taken from wikipedia - linklink Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering

Written by: Itzik Ben Shabat Blins Correction Blin introduced a correction for the specular component H=Normalized(L+V) Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering I out = K specular ·I light ·(H·n) s Ф=2α

Written by: Itzik Ben Shabat Calculation example – Sphere Sphere equation (centered in [0,0,0]) R 2 =x 2 +y 2 +z 2 Normal Given that R=1 The surface color is blue [ka kd ks s]=[[ ] [ ] [ ] 20] – rgb format Observer at [0 2 0] Assuming we have a white light source at y axis infinity (rays are parallel and in direction ([0 -1 0])) Calculate the light intensity (I) using phong model at [x y z]=[0 1 0] [x y z]=[0 0 1] Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering

Written by: Itzik Ben Shabat Calculate normals: N 1 =[0,1,0] N 2 =[0,0,1] L=[0 1 0] Calculate V: V 1 = Normalized([0 2 0]-[0 1 0])=[0 1 0] V 2 = Normalized( [0 2 0]-[0 0 1]) = Normalized([0 2 -1]) = Calculate r: r1 = [0 1 0] r2 = [0 -1 0] Calculation example – Sphere Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering

Written by: Itzik Ben Shabat Calculation example – Sphere Ambient - I out = k ambient · I ambient_source I a1 = [ ] * [1 1 1] = [ ] I a2 = [ ] * [ 1 1 1]=[ ] Diffusive - I out =k diffusive · I in n ·l I d1 = [ ] * [1 1 1] · [0 1 0] · [0 1 0] = [ ] I d2 = [ ] * [1 1 1] · [0 0 1] · [0 1 0] = [0 0 0] Specular – I out =k specular ·I light ·(v·r) s I s1 = [ ] *[1 1 1] ·([0 1 0] ·[0 1 0] ) 20 = [ ] I s2 = [ ] *[1 1 1] ·([0 2/5 -1/5] ·[0 -1 0] ) 20 =~ [0 0 0] I1= [ ]+[ ] + [ ] = [ ] I2 = [ ] It can be seen in the image that in the center of the sphere the intensity is high (due to the specular highlights) and at the top its much darker since there is only ambient component * marks an element by element multiplication Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering

Written by: Itzik Ben Shabat Shading Gouraud shading – interpolation of vertex intensities Phong shading – interpulation of normal vectors Note: in advanced Matlab versions phong does not work Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering phongGouraudflatnoneType Result

Written by: Itzik Ben Shabat Sources and Refrences Mathworks Documentation Center Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering