Basic Lighting and Shading. The Important Properties of Light It can Reflect, bend, spread and scatter.

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.
Computer Vision Radiometry. Bahadir K. Gunturk2 Radiometry Radiometry is the part of image formation concerned with the relation among the amounts of.
Polygon Rendering Flat Rendering Goraud Rendering Uses Phong Reflectance Phong Rendering.
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.
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
Illumination Model How to compute color to represent a scene As in taking a photo in real life: – Camera – Lighting – Object Geometry Material Illumination.
Lighting and Shading Wen-Chieh (Steve) Lin
3/23/2005 © Dr. Zachary Wartell 1 Illumination Models and Surface- Rendering Methods.
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
1 Lecture 9 Lighting Light Sources Reflectance Camera Models.
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 & Shading.
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.
LIGHTING JEFF CHASTINE 1. WHAT IS LIGHT? A very complex process Find a dark area – how is it being lit? Light bounces (mirrors, shiny objects) Light refracts.
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.:
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.
19/17/ :25 UML Graphics: Conceptual Model Real Object Human Eye Display Device Graphics System Synthetic Model Synthetic Camera Real Light Synthetic.
Human Eye and Color Rays of light enter the pupil and strike the back of the eye (retina) – signals go to the optic nerve and eventually to the brain Retina.
Shading and Illumination. OpenGL Shading Without ShadingWith Shading.
Lecture 14 Shading models 1.Shading Constant Shading (to be implemented) Gouraud Shading Phong Shading 2.Light and shading with OpenGL 1.
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.
Lighting Review & Example Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, November 17, 2003.
11/04/04© University of Wisconsin, CS559 Fall 2004 Last Time Visibility –Z-Buffer and transparency –A-buffer –Area subdivision –BSP Trees –Exact Cell-Portal.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Specular Reflection Lecture 27 Mon, Nov 10, 2003.
Local Illumination and Shading
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 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.
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: 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.
Computer Graphics (fall,2010) School of Computer Science University of Seoul Minho Kim.
1 Dr. Scott Schaefer Lighting. 2/49 Lighting/Illumination Color is a function of how light reflects from surfaces to the eye Global illumination accounts.
Graphics Graphics Korea University kucg.korea.ac.kr 1 Lights & Material 고려대학교 컴퓨터 그래픽스 연구실.
© University of Wisconsin, CS559 Spring 2004
Unit-7 Lighting and Shading
Illumination Model How to compute color to represent a scene
CSE 470 Introduction to Computer Graphics Arizona State University
Illumination and Shading
Fundamentals of Computer Graphics Part 6 Shading
Lighting – Light Sources
Isaac Gang University of Mary Hardin-Baylor
Last Time Liang-Barsky Details Weiler-Atherton clipping algorithm
CS 480/680 Computer Graphics Shading.
Lighting Calculations
Presentation transcript:

Basic Lighting and Shading

The Important Properties of Light It can Reflect, bend, spread and scatter

Most Common Light Sources Global Illumination Light Located at Infinity (Distant Light) Light Located Locally – Uniform Light (Ambient) – Point Source Intensity is L(p,P 0 ) = (1 / |p-p 0 | 2 ) L(P 0 ) – Spotlights (Directional Lights)

OpenGL Light Types Point Spotlight Ambient Distant

Point home.elka.pw.edu.pl/.../general/General.html

Spot home.elka.pw.edu.pl/.../general/General.html

Ambient (Area) home.elka.pw.edu.pl/.../general/General.html

Distant (Sun / Moon) home.elka.pw.edu.pl/.../general/General.html

Physical Light Bidirectional Reflection Distribution Function – (BRDF) This is based on 5 Variables: – Frequency – Source Vector (x,y) – Output Vector (x,y) It also requires a ‘real’ surface

This is a hugely expensive calculation Most light consists of a large frequency Range In games we have many fast ways of creating the effects of light

Firslty we need to get rid of the ‘spectrum’ The human Eye recognises colours through 3 types of cones – We can exploit this behaviour by directly addressing the cones

By exploiting this behaviour we can define the colour of light as RGB Varying the levels of Red, Green and Blue can make the eye ‘see’ every colour of the spectrum.

The downside to this simplification is that our model of light looses the ability to separate during reflections/refractions. As a solution to this we can either use multiple lights, or use explicit functions to ‘create’ light separation For offline rendering you may even consider doing a BRDF Rendering using a more complex Lighting method rojects/micro_rs/theory.html

Using Basic Lighting in OpenGL ed/Cg%20Effects%20Explained.htm

Enabling Lighting Enable Lighting in OpenGL glEnable(GL_LIGHTING) Enable Each Individual Light glEnable(GL_LIGHTi) i <= GL_MAX_LIGHTS All implementations support at least 8 lights

The 3 Functions to set you lights glLightfv(…) glLightf(…) glLightModelfv(…)

Specular Reflection Specular – The more specular a surface, the move light is reflected very closely to the angle of reflection – A mirror is a near perfect Specular Surface oomla/forum/files/specular_mat erial_test_01_168.jpg

Diffuse Reflection (Lambertian reflection)

Emissive It Glows! network.html

Translucent Surfaces hp?productid=1572&cat=293&page= 2 cts/Raytracer/

The End (for now)