UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Lighting.

Slides:



Advertisements
Similar presentations
Polygon Rendering Flat Rendering Goraud Rendering Uses Phong Reflectance Phong Rendering.
Advertisements

Computer Graphics I, Fall 2010 Shading II.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 6.
CS 480/680 Computer Graphics Shading 2 Dr. Frederick C Harris, Jr.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
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
3/23/2005 © Dr. Zachary Wartell 1 Illumination Models and Surface- Rendering Methods.
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Status – Week 277 Victor Moya.
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.
CS5500 Computer Graphics March 26, Shading Reference: Ed Angel’s book.
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.
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.
Illumination.
CS 445 / 645: Introductory Computer Graphics
Computer Graphics Lighting.
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.
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.
Computer Graphics I, Fall 2010 Shading in OpenGL.
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.
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.
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.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 9 Lighting and Texturing.
Graphics Graphics Korea University cgvr.korea.ac.kr Lighting, Fogging, Alpha Blending & Progressive Meshes Byeong-Seon Jeong
Local Illumination and Shading
Day 06 Vertex Shader for Ambient-Diffuse-Specular Lighting.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
Current Student – University of Wisconsin – Stout Applied Mathematics and Computer Science: Software Development Associate Degree in Computer Programming.
Lighting and Shading Part 2. Global Ambient Light There are at least 8 OpenGL lights and 1 Global Ambient Setting the Global Ambient globalAmbient[] =
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.
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 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.
Computer Graphics Lecture 26 Mathematics of Lighting and Shading Part II Taqdees A. Siddiqi
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Chapter 5. Lighting Computer Graphics (spring, 2009) School of Computer Science University of Seoul.
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.
Shading To determine the correct shades of color on the surface of graphical objects.
Deferred Lighting.
Illumination Model How to compute color to represent a scene
CSE 470 Introduction to Computer Graphics Arizona State University
Isaac Gang University of Mary Hardin-Baylor
Chapter IX Lighting.
Computer Graphics Material Colours and Lighting
CS 480/680 Computer Graphics Shading.
Presentation transcript:

UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Lighting

Goals 1. Understand the general lighting problem 2. Review the classic lighting equation

The lighting equation

Approximating the equation  The general problem is intractable  We must construct approximate models  Models for light sources and for materials (reflection)  Multiple light sources are used simultaneously  Each light’s contribution calculated in isolation  Multiple models are used simultaneously  Each model handles just one aspect of light transfer  Apply all models to all lights  Add the results to combine them

The classic reflection models  Have been used for many years  Lambert’s diffuse lighting model: I=NL  Non-reflective: no change with location of the viewer  Phong’s specular lighting model: I=(RV) P  R=2(NL)N - L  Reflective: changes as the viewer changes location  Specular model tends to be optional I=observed light intensity L=direction to the light N=surface normal V=direction to the viewer R=reflection vector P=specular power L, N, V, R are normalized

The classic light source models  Each model returns:  How much light is received (RGB light intensity)  The L, used by the reflection model  Ambient light is just a constant RGB  Models light coming from everywhere (white noise)  Reflection model not applied (there’s no L)  Directional light has a constant RGB and L  Models the sun – light coming from very far away  Point and spot light use formulas for RGB and L

D3D lights  typedef struct _D3DLIGHT9 {  D3DLIGHTTYPE Type; /* Type of light source */  D3DCOLORVALUE Diffuse; /* Diffuse color of light */  D3DCOLORVALUE Specular; /* Specular color of light */  D3DCOLORVALUE Ambient; /* Ambient color of light */  D3DVECTOR Position; /* Position in world space */  D3DVECTOR Direction; /* Direction in world space */  float Range; /* Cutoff range */  float Falloff; /* Falloff */  float Attenuation0; /* Constant attenuation */  float Attenuation1; /* Linear attenuation */  float Attenuation2; /* Quadratic attenuation */  float Theta; /* Inner angle of spotlight cone */  float Phi; /* Outer angle of spotlight cone */  } D3DLIGHT9;

Material properties  The reflection models used are a material property  The specular power is also a material property  Coefficients are material properties, too  Ambient, diffuse, specular and emissive  Emissive is just added to the rest  Part of the material is applied in the pixel shader  The texture is just an ambient/diffuse coefficient!  Specular (and emissive) are added there, too

D3D materials  typedef struct _D3DMATERIAL9 {  D3DCOLORVALUE Diffuse; /* Diffuse color RGBA */  D3DCOLORVALUE Ambient; /* Ambient color RGB */  D3DCOLORVALUE Specular; /* Specular 'shininess' */  D3DCOLORVALUE Emissive; /* Emissive color RGB */  float Power; /* Sharpness if specular highlight */  } D3DMATERIAL9;  typedef enum _D3DMATERIALCOLORSOURCE  {  D3DMCS_MATERIAL = 0, // Color from material is used  D3DMCS_COLOR1 = 1, // Diffuse vertex color is used  D3DMCS_COLOR2 = 2, // Specular vertex color is used  D3DMCS_FORCE_DWORD = 0x7fffffff, // force 32-bit size enum  } D3DMATERIALCOLORSOURCE;

Implementation notes  Many 3D accelerators since the late 90’s have included hardware to perform all of this  D3D calls it the “fixed-function pipeline”  It’s completely removed in D3D10  All of this must be done in shaders!  More flexibility = more work