Illumination Behaviour of light. Shading Overview Classical real-time shading: – vertices projected to screen – lighting calculation done at each vertex.

Slides:



Advertisements
Similar presentations
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Advertisements

Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.
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
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Sep 21, Fall 2005ITCS4010/ Computer Graphics Overview Color Displays Drawing Pipeline.
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.
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.
Sep 21, Fall 2006IAT 4101 Computer Graphics Overview Color Displays Drawing Pipeline.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Lighting & Shading.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
SET09115 Intro Graphics Programming
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.:
Polygon Shading. Assigning color to a shape to make graphical scenes look realistic, or artistic, or whatever effect we’re attempting to achieve But first.
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.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
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.
I-1 Steps of Image Generation –Create a model of the objects –Create a model for the illumination of the objects –Create an image (render) the result I.
Color and Resolution Introduction to Digital Imaging.
Computer Science Term 1, 2006 Tutorial 5 The Final Exam.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
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.
Illumination and Shading
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.
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.
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
Computer Graphics (Fall 2006) COMS 4160, Lecture 16: Illumination and Shading 1
Computer Graphics (fall,2010) School of Computer Science University of Seoul Minho Kim.
Shading CS 465 Lecture 4 © 2004 Steve Marschner • 1.
Computer Graphics Chapter 9 Rendering.
Visual Appearance Chapter 4
CSE 470 Introduction to Computer Graphics Arizona State University
Chapter IX Lighting.
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics Material Colours and Lighting
Computer Graphics (Fall 2003)
Presentation transcript:

Illumination Behaviour of light

Shading Overview Classical real-time shading: – vertices projected to screen – lighting calculation done at each vertex – results interpolated along line (linear interpolation) to interior of polygon (bilinear interpolation) per-pixel shading: – uses interpolated values and texture lookups as input into program that calculates pixel color

Classic Lighting Model Actual behavior of light extremely complex Widely used simplification in graphics: – diffuse lighting matte surface directional light – specular lighting shiny surface directional light – ambient lighting omnidirectional light

Three-term Lighting Model Shading calculation done with three components: – diffuse (Lambertian) direct lighting I d = N L – specular direct lighting I s = (V R)^n – ambient I a = c

Diffuse component Matte objects: “ not at all shiny ” chalk, paper, rough wood, concrete Intensity of reflected light depends on angle between light source and surface normal Does not depend on viewing direction

Diffuse component I d = N L N is surface normal L is direction towards light N L

Specular component Highlights on “ shiny ” (highly reflective) surfaces Intensity depends on angle between viewing direction and direction of ideal reflection

Specular component Given viewing direction and reflection direction, find cosine of angle between (by taking dot product) and raise to a power Lower powers give more spread-out highlights, and higher powers focus the highlight I s = (V R)^n

Specular Component I s = (V R)^n V is view direction R is reflection direction R V

Highlight spread dot product of normalized vectors is cosine of angle between vectors (V R)^n = (cos α)^n Parameter n controls width of highlight: – low n (say 1-5): broad highlight – large n: (say ): sharp highlight

Specular component How to compute reflection direction? R = -L + 2*(L N)N

Ambient component Some amount of light always present Add small constant light intensity Just a hack to account for scattered light reaching everywhere Ambient occlusion: small-scale self- shadowing, can be precomputed (static scene) or computed in real time (SSAO, Crysis)

Three-term Lighting Model Shading calculation done with three components: – I = k d (N L) + k s (V R)^n + k a – k is surface albedo – Actually have three such equations, one each for R, G, and B – Not shown: lighting modulated by color of surface (material properties), incoming light

3-term lighting "Phong" because per-pixel lighting

Light Attenuation Light intensity falls off with distance from source – 1/r^2 physically correct for point sources, but works poorly in practice – hacked 1/(c 1 + c 2 r + c 3 r^2) sometimes used Atmospheric haze: cue for large distances

Interpolation Remember – information available only at vertices Classically, lighting calculation done only at vertices also Need to interpolate to remainder of primitive flat shading also possible

Linear Interpolation Linear interpolation: simplest method to interpolate i(t) = i(0)*(1-t) + i(1)*t, t in (0,1) values known at 0 and 1, interpolated otherwise Widely used – here just for shading lines

Gouraud Shading Compute illumination at vertices Bilinearly interpolate to interior Gouraud shading proper: – compute surface normals from polygon (cross product) – average all polygon normals touching vertex to obtain vertex normal

Gouraud Shading

Phong Shading Lighting can change faster than geometry With insufficient vertex density, features can be missed Phong shading: – interpolate normals to triangle interior – perform per-pixel lighting Much more costly but better effect

Phong vs Gouraud shading Historically, Gouraud usually used in real-time graphics – "why do all video games look the same?" Now, pixel shaders are the norm – per-pixel lighting possible (expected)

Custom Shading With the advent of programmable shaders, we are no longer restricted to the 3-term lighting model Pixel shaders now standard Phong shading other, specialized lighting models, effects

Color

What is color, anyway? We think of it as a property of an object – “blue shirt”, etc. Complex relationship between properties of material, lighting conditions, and properties of receptor – in graphics, need to account for properties of display device as well (monitor, printer)

Human Color Vision Cones: three types – red (rho), green (gamma), blue (beta) Rho: 64% of cones Gamma: 32% of cones Beta: only 2% of cones, present outside foveal region Rho and Gamma spectral sensitivities overlap considerably

Metamerism Possible for distinct spectra to evoke the same sensor response Metamers: sets of spectra which are perceived as the same color Human vision system has 3 receptor types, so three-dimensional color space needed

Adelson’s shadow

3D color space RGB: most common in graphics, tied to output capabilities of CRT monitors

RGB Additive color model – light Primary colors: R, G, B – (x,0,0), (0,x,0), (0,0,x) Secondary colors: yellow, magenta, cyan – (x,x,0), (x,0,x), (0,x,x) Host of other colors

CMYK Cyan, Magenta, Yellow, blacK (key) subtractive color model for ink

Three-term Lighting Model I = k d (N L) + k s (V R)^n + k a Important quantities: – material of surface – normal vector – shininess – light direction, eye direction Where they come from – property of model/configuration – interpolated from vertex – stored in texture (or computed procedurally)

Toon Shading Shading style characterized by – large flat-colored regions "shading" quantized into few colors – black outlines denoting silhouettes internal object boundaries – (eg, eyes) creases – Recent toon shaders often omit outlines

Quantized Shading Create 1D texture map showing progression of colors Calculate lighting as normal (diffuse+specular) Use lighting result to index into texture If only few colors, can use if statements – bad for reusability, good for rapid prototyping

Outlines Silhouettes: where depth differences exceed a threshold – can render to texture and find depth differences in second pass of pixel shader Boundaries: property of model, annotated Creases: property of model – could be annotated (artist, precomputed) – could be obtained by differencing normal map in pixel shader

Local Illumination Considers only information at shaded point on surface Traditionally, 3-term lighting model Missing many elements that contribute to appearance of surface – indirect lighting – shadows – subsurface scattering, participating medium

Subsurface Scattering [Wann Jensen, 2001]