Assigning colour to pixels or fragments. Modelling Illumination. We shall see how it is done in a rasterization model. CS475/CS675 - Lecture 14

Size: px
Start display at page:

Download "Assigning colour to pixels or fragments. Modelling Illumination. We shall see how it is done in a rasterization model. CS475/CS675 - Lecture 14"

Transcription

1 - Computer Graphics Assigig colour to pixels or fragmets. Modellig Illumiatio Illumiatio Model : The Phog Model For a sigle light source total illumiatio at ay poit is give by: ecture 14: I =k a I a k d I d k s I s We shall see how it is doe i a rasterizatio model. where k a I a is the cotributio due to ambiet reflectio k d I d is the cotributio due to diffuse reflectio k s I s is the cotributio due to specular reflectio 2 Ambiet Illumiatio: I a 3 Diffuse Illumiatio: Diffuse Illumiatio: I d = I cos Represets the reflectio of all idirect illumiatio. Assumes Ideal Diffuse Surface that reflects light equally i all directio. Has the same value everywhere. Surface is very rough at microscopic level. For e.g., Chalk ad Clay. Is a approximatio to computig Global Illumiatio. I d = I cos Reflects light accordig to ambert's Cosie aw I d = I cos =I. : vector to the light source I : itesity of the light source From (14/08/2009) : surface ormal 4 5 6

2 Diffuse Illumiatio: I d =I cos Reflects light accordig to ambert's Cosie aw I d =I cos =I..V Specular Illumiatio: I s = I cos v = I R Specular Illumiatio: Ideal specular surface reflects oly alog oe directio. Reflected itesity is view depedet Mostly it is alog the reflected ray but as we move away some of the reflectio is slightly offset from the reflected ray due to microscopic surface irregularites. R R, 0 are i opposite directios the the dot product is egative. Use max. If ad to get the correct value. If r is distace to the light source ad I t is its true itesity the a distace based atteuatio ca be modelled by a iverse square falloff, i.e., I = I t / r 2 7 V 8 H V I local =k a I a are material costats defiig the amout of light that is reflected as ambiet, diffuse ad specular. They may be defied i as three values with R, G, B compoets. v 10 1 i m k d I d i k s I si Global Illumiatio Model I glo bal = I local k r I refected k t I trasmitted ka, kd, ks 9 ocal Illumiatio Model R I =k a I a k d I d k s I s The Bli-Phog Illumiatio Model cos The Phog Illumiatio Model.V I s = I cos v = I R 2 is called the coefficiet of shiiess ad I =I t / r V = V H V '. ) I s = I cos ϕ=i ( H v = = v = or v =

3 Surface Material Properties Colour For each object there ca be a 1 i m k d I d i k s I si Where ad how is colour of objects computed? Remember differetly coloured light is at differet wavelegth so: 1 i m 1 i m gleable(g_ight0); Property for the lights is defied usig: glightfv(geum light, Geum pame, Gfloat *param) light is the light eum like G_IGHT1 pame ca be G_AMBIET, G_DIFFUSE, G_SPECUAR, G_POSITIO, G_SPOT_CUTOFF, G_SPOT_DIRECTIO, G_SPOT_EXPOET, G_COSTAT_ATTEUATIO, G_IEAR_ATTEUATIO, ad G_QUADRATIC_ATTEUATIO Gfloat light_ambiet(0.0, 0.0, 0.0, 1.0); Gfloat light_diffuse(1.0, 1.0, 1.0, 1.0); Gfloat light_specular(0.0, 1.0, 0.0, 1.0); glmaterialfv(geum face, Geum pame, cost Gfloat* params); face ca be G_FROT, G_BACK or G_FROT_AD_BACK pame ca be The colour is computed at: I =k a I a glightfv(g_ight0, G_AMBIET, light_ambiet); glightfv(g_ight0, G_DIFFUSE, light_diffuse); glightfv(g_ight0, G_SPECUAR, light_specular); glightfv(g_ight0, G_POSITIO, light_positio); gleable(g_ight0); Costat o iterpolatio of itesity, oe itesity for whole object. o depth cues. Material properties ca be specified usig Gfloat light_positio(3.0, 4.0, 0.0, 1.0); Deprecated OG2.x cotet. See the shadig tutorial istead. For example: Deprecated OG2.x cotet. See the shadig tutorial istead. gleable(g_ightig); S i k d C d I di k s C s I si k r C r I r k t C t I t Every G implemetatio has at least 8 lights. k d C d I di k s C s I si k r C r I r k t C t I t Eablig lightig ad idividual lights Accoutig for shadows: I =k a C d I a OpeG uses the local Phog Illumiatio Model. I =k a I a Diffuse colour, Specular colour, Reflected colour ad Trasmitted colour I = k a C d I a G_AMBIET, G_DIFFUSE, G_SPECUAR, G_EMISSIO, G_SHIIESS, G_AMBIET_AD_DIFFUSE 1 i m k d I di k s I si Deprecated OG2.x cotet. See the shadig tutorial istead ecture

4 Faceted Oe itesity per polygo computed from the surface ormal ad light vector. (G_FAT) - ecture Gouraud iear iterpolatio of itesity across triagles to elimiate edge discotiuity. (G_SMOOTH) - ecture Shadows, texture mappig, reflectio mappig simulatig GI. Phog Iterpolatio of surface ormals. Still local illumiatio o GI. - ecture Faceted Fast Surface does ot look smooth if a piece wise liear approximatio to a flat surface is beig doe Mach Bad Efect accetuate the facets. Faceted glshademodel(g_fat);

5 Gouraud iearly iterpolate itesity alog sca lies: elimiates itesity discotiuities at polygo edges; still have gradiet discotiuities, mach badig is largely ameliorated, ot elimiated. must differetiate desired creases from tesselatio artifacts (edges of cube vs. edges o tesselated sphere). 1 Calculate approximate vertex ormals as a average of ormals of polygos meetig at that vertex. 5 eighborig polygos sharig vertices ad edges approximate smoothly curved surfaces ad will ot have greatly differig surface ormals hece this approximatio is reasoable. Calculate itesity at vertices. i 4 v 2 i i=1 i vec3 VertexPositio; iearly iterpolate itesity alog sca lies: elimiates itesity discotiuities at polygo edges; still have gradiet discotiuities, mach badig is largely ameliorated, ot elimiated. must differetiate desired creases from tesselatio artifacts (edges of cube vs. edges o tesselated sphere). Iterpolate itesity alog polygo edges. Iterpolate alog sca lies I a= I 1 3 I b= I 1 25 y s y2 y 1 y 2 ys y 3 y 1 y 3 I2 I 3 y2 y 1 y 2 y3 y1 y s y1 y3 I p =I a i vec2 VertexTex; out Data I1 Ia ys y 1 y s i vec3 Vertexormal; Ib Ip I2 x b x p x b x a sca lie data; struct ightifo vec3 Positio; vec3 a; vec3 d; vec3 s; ; I3 I b x p xa x b x a vec3 FrotColor; vec3 BackColor; vec2 TexCoord; 26 struct MaterialIfo vec3 Ka; vec3 Kd; vec3 Ks; float Shiiess; ; void geteyespace( out vec3 orm, out vec3 positio ) orm = ormalize( ormalmatrix * Vertexormal ); //Ambiet reflectivity //Diffuse reflectivity //Specular reflectivity //Specular shiiess factor glshademodel(g_smooth); retur ambiet + diffuse + spec; void mai() vec3 eyeorm; vec3 eyepositio; geteyespace( eyeorm, eyepositio ); positio = vec3( ModelViewMatrix * vec4( VertexPositio, 1 ) ); data.frotcolor = vec3(0); vec3 light( it lightidex, vec3 positio, vec3 orm ) vec3 s = ormalize( vec3( ight[lightidex].positio - positio ) ); vec3 v = ormalize( -positio.xyz ); 27 Gouraud spec = ight[lightidex].s * Material.Ks * pow( max( dot(r,v), 0.0 ), Material.Shiiess ); uiform mat4 ModelViewMatrix; uiform mat3 ormalmatrix; uiform mat4 MVP; if ( sdot > 0.0 ) uiform MaterialIfo Material; //ight Positio i eye-coords //Ambiet light itesity //Diffuse light itesity //Specular light itesity vec3 spec = vec3( 0.0 ); uiform ightifo ight[ightcout]; Gouraud : Vertex Shader #versio 430 y1 v = i =1 Gouraud data.backcolor = vec3(0); for( it i=0; i<ightcout; ++i ) data.frotcolor += light( i, eyepositio, eyeorm ); 28 vec3 r = reflect( -s, orm ); data.backcolor += vec3 ambiet = ight[lightidex].a * Material.Ka; float sdot = max( dot( s, orm ), 0.0 ); data.texcoord = VertexTex; vec3 diffuse = ight[lightidex].d * Material.Kd * sdot; light( i, eyepositio, -eyeorm ); gl_positio = MVP * vec4( VertexPositio, 1 ); 29 30

6 Gouraud Itegrates well with scalie rasterizatio. O a edge I / y is costat. vs. Faceted Gouraud Ca miss specular highlights because it iterpolates vertex colors istead of calculatig the itesity at every surface poit. Half Way vector Viewpoit Iterpolate ormals istead comes closer to actual surface ormal. Called Phog (ote: OT Phog Illumiatio Model) Ib Ia Gouraud Ib Iterpolate ormals alog sca lies. ormalize after iterpolatig (expesive!). ot available i plai OpeG doe as per pixel lightig o hardware. Still o Global Illumiatio most of the effects of Ray Tracig still missig. Ia Faceted Phog Gouraud Actual 32 33

Normals. In OpenGL the normal vector is part of the state Set by glnormal*()

Normals. In OpenGL the normal vector is part of the state Set by glnormal*() Ray Tracig 1 Normals OpeG the ormal vector is part of the state Set by glnormal*() -glnormal3f(x, y, z); -glnormal3fv(p); Usually we wat to set the ormal to have uit legth so cosie calculatios are correct

More information

OpenGL Illumination example. 2IV60 Computer graphics set 8: Illumination Models and Surface-Rendering Methods. Introduction 2.

OpenGL Illumination example. 2IV60 Computer graphics set 8: Illumination Models and Surface-Rendering Methods. Introduction 2. OpeG Illumiatio example 2I60 Computer graphics set 8: Illumiatio Models ad Surface-ederig Methods Jack va Wijk TU/e Glfloat lightpos[] = {2.0, 0.0, 3.0, 0.0}; Glfloat whitecolor[] = {1.0, 1.0, 1.0, 1.0};

More information

Computer Graphics. Surface Rendering Methods. Content. Polygonal rendering. Global rendering. November 14, 2005

Computer Graphics. Surface Rendering Methods. Content. Polygonal rendering. Global rendering. November 14, 2005 Computer Graphics urface Rederig Methods November 4, 2005 Cotet Polygoal rederig flat shadig Gouraud shadig Phog shadig Global rederig ray tracig radiosity Polygoal Rederig hadig a polygoal mesh flat or

More information

Lighting and Shading. Outline. Raytracing Example. Global Illumination. Local Illumination. Radiosity Example

Lighting and Shading. Outline. Raytracing Example. Global Illumination. Local Illumination. Radiosity Example CSCI 480 Computer Graphics Lecture 9 Lightig ad Shadig Light Sources Phog Illumiatio Model Normal Vectors [Agel Ch. 6.1-6.4] February 13, 2013 Jerej Barbic Uiversity of Souther Califoria http://www-bcf.usc.edu/~jbarbic/cs480-s13/

More information

Computer Graphics. Shading. Page. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science, Technion. The Physics

Computer Graphics. Shading. Page. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science, Technion. The Physics Comuter Grahics Illumiatio Models & The Physics 2 Local vs. Global Illumiatio Models Examle Local model direct ad local iteractio of each object with the light. Ambiet Diffuse Global model: iteractios

More information

Why Do We Care About Lighting? Computer Graphics Lighting. The Surface Normal. Flat Shading (Per-face) Setting a Surface Normal in OpenGL

Why Do We Care About Lighting? Computer Graphics Lighting. The Surface Normal. Flat Shading (Per-face) Setting a Surface Normal in OpenGL Lightig Why Do We Care About Lightig? Lightig dis-ambiguates 3D scees This work is licesed uder a Creative Commos Attributio-NoCommercial- NoDerivatives 4.0 Iteratioal Licese Mike Bailey mjb@cs.oregostate.edu

More information

Illumination Model. The governing principles for computing the. Apply the lighting model at a set of points across the entire surface.

Illumination Model. The governing principles for computing the. Apply the lighting model at a set of points across the entire surface. Illumination and Shading Illumination (ighting) Model the interaction of light with surface oints to determine their final color and brightness OenG comutes illumination at vertices illumination Shading

More information

Texture Mapping. Jian Huang. This set of slides references the ones used at Ohio State for instruction.

Texture Mapping. Jian Huang. This set of slides references the ones used at Ohio State for instruction. Texture Mappig Jia Huag This set of slides refereces the oes used at Ohio State for istructio. Ca you do this What Dreams May Come Texture Mappig Of course, oe ca model the exact micro-geometry + material

More information

Practical Implementation at tri-ace

Practical Implementation at tri-ace Physically Based Shadig Models i Film ad Game Productio: Practical Implemetatio at tri-ace 1. Itroductio Yoshiharu Gotada tri-ace, Ic. I this paper, we preset our practical examples of physically based

More information

Eigenimages. Digital Image Processing: Bernd Girod, 2013 Stanford University -- Eigenimages 1

Eigenimages. Digital Image Processing: Bernd Girod, 2013 Stanford University -- Eigenimages 1 Eigeimages Uitary trasforms Karhue-Loève trasform ad eigeimages Sirovich ad Kirby method Eigefaces for geder recogitio Fisher liear discrimat aalysis Fisherimages ad varyig illumiatio Fisherfaces vs. eigefaces

More information

The Nature of Light. Chapter 22. Geometric Optics Using a Ray Approximation. Ray Approximation

The Nature of Light. Chapter 22. Geometric Optics Using a Ray Approximation. Ray Approximation The Nature of Light Chapter Reflectio ad Refractio of Light Sectios: 5, 8 Problems: 6, 7, 4, 30, 34, 38 Particles of light are called photos Each photo has a particular eergy E = h ƒ h is Plack s costat

More information

Wavelet Transform. CSE 490 G Introduction to Data Compression Winter Wavelet Transformed Barbara (Enhanced) Wavelet Transformed Barbara (Actual)

Wavelet Transform. CSE 490 G Introduction to Data Compression Winter Wavelet Transformed Barbara (Enhanced) Wavelet Transformed Barbara (Actual) Wavelet Trasform CSE 49 G Itroductio to Data Compressio Witer 6 Wavelet Trasform Codig PACW Wavelet Trasform A family of atios that filters the data ito low resolutio data plus detail data high pass filter

More information

COMP 558 lecture 6 Sept. 27, 2010

COMP 558 lecture 6 Sept. 27, 2010 Radiometry We have discussed how light travels i straight lies through space. We would like to be able to talk about how bright differet light rays are. Imagie a thi cylidrical tube ad cosider the amout

More information

Eigenimages. Digital Image Processing: Bernd Girod, Stanford University -- Eigenimages 1

Eigenimages. Digital Image Processing: Bernd Girod, Stanford University -- Eigenimages 1 Eigeimages Uitary trasforms Karhue-Loève trasform ad eigeimages Sirovich ad Kirby method Eigefaces for geder recogitio Fisher liear discrimat aalysis Fisherimages ad varyig illumiatio Fisherfaces vs. eigefaces

More information

A Practical and Robust Bump-mapping Technique for Today s GPUs

A Practical and Robust Bump-mapping Technique for Today s GPUs A Practical ad Robust Bump-mappig Techique for Today s GPUs Mark J. Kilgard NVIDIA Corporatio 3535 Moroe Street Sata Clara, CA 95051 (408) 615-2500 mjk@vidia.com March 30, 2000 Copyright NVIDIA Corporatio,

More information

-=Bui Tuong Phong's Lighting=- University of Utah, but with shaders. Anton Gerdelan Trinity College Dublin

-=Bui Tuong Phong's Lighting=- University of Utah, but with shaders. Anton Gerdelan Trinity College Dublin -=Bui Tuong Phong's Lighting=- University of Utah, 1973 but with shaders Anton Gerdelan Trinity College Dublin Before we do anything - normals Q. What does a normal do? Q. How do we usually calculate them?

More information

CS Polygon Scan Conversion. Slide 1

CS Polygon Scan Conversion. Slide 1 CS 112 - Polygo Sca Coversio Slide 1 Polygo Classificatio Covex All iterior agles are less tha 180 degrees Cocave Iterior agles ca be greater tha 180 degrees Degeerate polygos If all vertices are colliear

More information

CGT520 Lighting. Lighting. T-vertices. Normal vector. Color of an object can be specified 1) Explicitly as a color buffer

CGT520 Lighting. Lighting. T-vertices. Normal vector. Color of an object can be specified 1) Explicitly as a color buffer CGT520 Lighting Lighting Color of an object can be specified 1) Explicitly as a color buffer Bedrich Benes, Ph.D. Purdue University Department of Computer Graphics 2) Implicitly from the illumination model.

More information

Pipeline Operations. CS 4620 Lecture 10

Pipeline Operations. CS 4620 Lecture 10 Pipeline Operations CS 4620 Lecture 10 2008 Steve Marschner 1 Hidden surface elimination Goal is to figure out which color to make the pixels based on what s in front of what. Hidden surface elimination

More information

Light and shading. Source: A. Efros

Light and shading. Source: A. Efros Light ad shadig Source: A. Efros Image formatio What determies the brightess of a image piel? Sesor characteristics Light source properties Eposure Surface shape ad orietatio Optics Surface reflectace

More information

Physics 11b Lecture #19

Physics 11b Lecture #19 Physics b Lecture #9 Geometrical Optics S&J Chapter 34, 35 What We Did Last Time Itesity (power/area) of EM waves is give by the Poytig vector See slide #5 of Lecture #8 for a summary EM waves are produced

More information

Illumination and Shading

Illumination and Shading Illumination and Shading Illumination (Lighting)! Model the interaction of light with surface points to determine their final color and brightness! The illumination can be computed either at vertices or

More information

Pattern Recognition Systems Lab 1 Least Mean Squares

Pattern Recognition Systems Lab 1 Least Mean Squares Patter Recogitio Systems Lab 1 Least Mea Squares 1. Objectives This laboratory work itroduces the OpeCV-based framework used throughout the course. I this assigmet a lie is fitted to a set of poits usig

More information

Computational Geometry

Computational Geometry Computatioal Geometry Chapter 4 Liear programmig Duality Smallest eclosig disk O the Ageda Liear Programmig Slides courtesy of Craig Gotsma 4. 4. Liear Programmig - Example Defie: (amout amout cosumed

More information

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation Lecture 17: Shading in OpenGL CITS3003 Graphics & Animation E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Objectives Introduce the OpenGL shading methods - per vertex shading

More information

Computer Graphics Hardware An Overview

Computer Graphics Hardware An Overview Computer Graphics Hardware A Overview Graphics System Moitor Iput devices CPU/Memory GPU Raster Graphics System Raster: A array of picture elemets Based o raster-sca TV techology The scree (ad a picture)

More information

Consider the following population data for the state of California. Year Population

Consider the following population data for the state of California. Year Population Assigmets for Bradie Fall 2016 for Chapter 5 Assigmet sheet for Sectios 5.1, 5.3, 5.5, 5.6, 5.7, 5.8 Read Pages 341-349 Exercises for Sectio 5.1 Lagrage Iterpolatio #1, #4, #7, #13, #14 For #1 use MATLAB

More information

Alpha Individual Solutions MAΘ National Convention 2013

Alpha Individual Solutions MAΘ National Convention 2013 Alpha Idividual Solutios MAΘ Natioal Covetio 0 Aswers:. D. A. C 4. D 5. C 6. B 7. A 8. C 9. D 0. B. B. A. D 4. C 5. A 6. C 7. B 8. A 9. A 0. C. E. B. D 4. C 5. A 6. D 7. B 8. C 9. D 0. B TB. 570 TB. 5

More information

EE123 Digital Signal Processing

EE123 Digital Signal Processing Last Time EE Digital Sigal Processig Lecture 7 Block Covolutio, Overlap ad Add, FFT Discrete Fourier Trasform Properties of the Liear covolutio through circular Today Liear covolutio with Overlap ad add

More information

Lighting and Shading II. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Lighting and Shading II. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015 Lighting and Shading II 1 Objectives Continue discussion of shading Introduce modified Phong model Consider computation of required vectors 2 Ambient Light Ambient light is the result of multiple interactions

More information

Objectives Shading in OpenGL. Front and Back Faces. OpenGL shading. Introduce the OpenGL shading methods. Discuss polygonal shading

Objectives Shading in OpenGL. Front and Back Faces. OpenGL shading. Introduce the OpenGL shading methods. Discuss polygonal shading Objectives Shading in OpenGL Introduce the OpenGL shading methods - per vertex shading vs per fragment shading - Where to carry out Discuss polygonal shading - Flat - Smooth - Gouraud CITS3003 Graphics

More information

Learning to Shoot a Goal Lecture 8: Learning Models and Skills

Learning to Shoot a Goal Lecture 8: Learning Models and Skills Learig to Shoot a Goal Lecture 8: Learig Models ad Skills How do we acquire skill at shootig goals? CS 344R/393R: Robotics Bejami Kuipers Learig to Shoot a Goal The robot eeds to shoot the ball i the goal.

More information

Cubic Polynomial Curves with a Shape Parameter

Cubic Polynomial Curves with a Shape Parameter roceedigs of the th WSEAS Iteratioal Coferece o Robotics Cotrol ad Maufacturig Techology Hagzhou Chia April -8 00 (pp5-70) Cubic olyomial Curves with a Shape arameter MO GUOLIANG ZHAO YANAN Iformatio ad

More information

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models Computergrafik Thomas Buchberger, Matthias Zwicker Universität Bern Herbst 2008 Today Introduction Local shading models Light sources strategies Compute interaction of light with surfaces Requires simulation

More information

CPSC 314 LIGHTING AND SHADING

CPSC 314 LIGHTING AND SHADING CPSC 314 LIGHTING AND SHADING UGRAD.CS.UBC.CA/~CS314 slide credits: Mikhail Bessmeltsev et al 1 THE RENDERING PIPELINE Vertices and attributes Vertex Shader Modelview transform Per-vertex attributes Vertex

More information

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11 Pipeline Operations CS 4620 Lecture 11 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives to pixels RASTERIZATION

More information

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source Topic 9: Lighting & Reflection models Lighting & reflection The Phong reflection model diffuse component ambient component specular component Spot the differences Terminology Illumination The transport

More information

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people GLSL Introduction Fu-Chung Huang Thanks for materials from many other people Shader Languages Currently 3 major shader languages Cg (Nvidia) HLSL (Microsoft) Derived from Cg GLSL (OpenGL) Main influences

More information

Illumination and Shading

Illumination and Shading Illumination and Shading Computer Graphics COMP 770 (236) Spring 2007 Instructor: Brandon Lloyd 2/14/07 1 From last time Texture mapping overview notation wrapping Perspective-correct interpolation Texture

More information

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component Topic 9: Lighting & Reflection models Lighting & reflection The Phong reflection model diffuse component ambient component specular component Spot the differences Terminology Illumination The transport

More information

Rendering. Ray Tracing

Rendering. Ray Tracing CS475m - Compter Graphics Lectre 16 : 1 Rederig Drawig images o the compter scree. We hae see oe rederig method already. Isses: Visibility What parts of a scee are isible? Clippig Cllig (Backface ad Occlsio)

More information

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops. OpenGl Pipeline Individual Vertices Transformed Vertices Commands Processor Per-vertex ops Primitive assembly triangles, lines, points, images Primitives Fragments Rasterization Texturing Per-fragment

More information

Pipeline Operations. CS 4620 Lecture 14

Pipeline Operations. CS 4620 Lecture 14 Pipeline Operations CS 4620 Lecture 14 2014 Steve Marschner 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives

More information

CS 4731: Computer Graphics Lecture 16: Phong Illumination and Shading. Emmanuel Agu

CS 4731: Computer Graphics Lecture 16: Phong Illumination and Shading. Emmanuel Agu CS 4731: Computer Graphics Lecture 16: Phong Illumination and Shading Emmanuel Agu Recall: Setting Light Property Define colors and position a light GLfloat light_ambient[] = {0.0, 0.0, 0.0, 1.0}; GLfloat

More information

游戏设计与开发. Outline. Game Programming Topics. Building A Game

游戏设计与开发. Outline. Game Programming Topics. Building A Game 1896 1935 1987 2006 Outlie 游戏设计与开发 Real Time Requiremet A Coceptual Rederig Pipelie The Graphics Processig Uit (GPU) Example 技术篇 : 实时图形硬件 Game Programmig Topics Focus: Buildig game ad virtual world High-level

More information

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models Computergrafik Matthias Zwicker Universität Bern Herbst 2009 Today Introduction Local shading models Light sources strategies Compute interaction of light with surfaces Requires simulation of physics Global

More information

CS452/552; EE465/505. Lighting & Shading

CS452/552; EE465/505. Lighting & Shading CS452/552; EE465/505 Lighting & Shading 2-17 15 Outline! More on Lighting and Shading Read: Angel Chapter 6 Lab2: due tonight use ASDW to move a 2D shape around; 1 to center Local Illumination! Approximate

More information

Illumination & Shading: Part 1

Illumination & Shading: Part 1 Illumination & Shading: Part 1 Light Sources Empirical Illumination Shading Local vs Global Illumination Lecture 10 Comp 236 Spring 2005 Computer Graphics Jargon: Illumination Models Illumination - the

More information

condition w i B i S maximum u i

condition w i B i S maximum u i ecture 10 Dyamic Programmig 10.1 Kapsack Problem November 1, 2004 ecturer: Kamal Jai Notes: Tobias Holgers We are give a set of items U = {a 1, a 2,..., a }. Each item has a weight w i Z + ad a utility

More information

CSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 CSE 167: Introduction to Computer Graphics Lecture #8: GLSL Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Homework project #4 due Friday, November 2 nd Introduction:

More information

Aberrations in Lens & Mirrors (Hecht 6.3)

Aberrations in Lens & Mirrors (Hecht 6.3) Aberratios i Les & Mirrors (Hecht 6.3) Aberratios are failures to focus to a "poit" Both mirrors ad les suffer from these Some are failures of paraxial assumptio 3 5 θ θ si( θ ) = θ + L 3! 5! Paraxial

More information

Computer Graphics, Lecture 6 February 4, 2009

Computer Graphics, Lecture 6 February 4, 2009 Lightig ad shadig Lightig Lightig & Shadig Lightig efes to modeig ight souces, sufaces, ad the iteactio betwee them Compute Gaphics 1, Spig 2009 Shadig efes to how ightig is pefomed with poygoa objects

More information

EE 584 MACHINE VISION

EE 584 MACHINE VISION METU EE 584 Lecture Notes by A.Aydi ALATAN 0 EE 584 MACHINE VISION Itroductio elatio with other areas Image Formatio & Sesig Projectios Brightess Leses Image Sesig METU EE 584 Lecture Notes by A.Aydi ALATAN

More information

Computer Graphics. Illumination and Shading

Computer Graphics. Illumination and Shading () Illumination and Shading Dr. Ayman Eldeib Lighting So given a 3-D triangle and a 3-D viewpoint, we can set the right pixels But what color should those pixels be? If we re attempting to create a realistic

More information

Apparent Depth. B' l'

Apparent Depth. B' l' REFRACTION by PLANE SURFACES Apparet Depth Suppose we have a object B i a medium of idex which is viewed from a medium of idex '. If '

More information

Chapter 18: Ray Optics Questions & Problems

Chapter 18: Ray Optics Questions & Problems Chapter 18: Ray Optics Questios & Problems c -1 2 1 1 1 h s θr= θi 1siθ 1 = 2si θ 2 = θ c = si ( ) + = m = = v s s f h s 1 Example 18.1 At high oo, the su is almost directly above (about 2.0 o from the

More information

w Foley, Section16.1 Reading

w Foley, Section16.1 Reading Shading w Foley, Section16.1 Reading Introduction So far, we ve talked exclusively about geometry. w What is the shape of an object? w How do I place it in a virtual 3D space? w How do I know which pixels

More information

INF3320 Computer Graphics and Discrete Geometry

INF3320 Computer Graphics and Discrete Geometry INF3320 Computer Graphics and Discrete Geometry Texturing Christopher Dyken Martin Reimers 06.10.2010 Page 1 Texturing Linear interpolation Real Time Rendering: Chapter 5: Visual Appearance Chapter 6:

More information

Homework 1 Solutions MA 522 Fall 2017

Homework 1 Solutions MA 522 Fall 2017 Homework 1 Solutios MA 5 Fall 017 1. Cosider the searchig problem: Iput A sequece of umbers A = [a 1,..., a ] ad a value v. Output A idex i such that v = A[i] or the special value NIL if v does ot appear

More information

surface: reflectance transparency, opacity, translucency orientation illumination: location intensity wavelength point-source, diffuse source

surface: reflectance transparency, opacity, translucency orientation illumination: location intensity wavelength point-source, diffuse source walters@buffalo.edu CSE 480/580 Lecture 18 Slide 1 Illumination and Shading Light reflected from nonluminous objects depends on: surface: reflectance transparency, opacity, translucency orientation illumination:

More information

Illumination and Shading with GLSL/WebGL

Illumination and Shading with GLSL/WebGL Illumination and Shading with GLSL/WebGL Illumination with Shaders! Remember the local illumination model (Phong illumination) Illumination = ambient + diffuse + specular = Ka x Ia + Kd x Id x (N.L) +

More information

Numerical Methods Lecture 6 - Curve Fitting Techniques

Numerical Methods Lecture 6 - Curve Fitting Techniques Numerical Methods Lecture 6 - Curve Fittig Techiques Topics motivatio iterpolatio liear regressio higher order polyomial form expoetial form Curve fittig - motivatio For root fidig, we used a give fuctio

More information

The Virtual Point Light Source Model the Practical Realisation of Photometric Stereo for Dynamic Surface Inspection

The Virtual Point Light Source Model the Practical Realisation of Photometric Stereo for Dynamic Surface Inspection The Virtual Poit Light Source Model the Practical Realisatio of Photometric Stereo for Dyamic Surface Ispectio Lydo Smith ad Melvy Smith Machie Visio Laboratory, Faculty of Computig, Egieerig ad Mathematical

More information

Computer Graphics (CS 543) Lecture 8a: Per-Vertex lighting, Shading and Per-Fragment lighting

Computer Graphics (CS 543) Lecture 8a: Per-Vertex lighting, Shading and Per-Fragment lighting Computer Graphics (CS 543) Lecture 8a: Per-Vertex lighting, Shading and Per-Fragment lighting Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Computation of Vectors To calculate

More information

University of Victoria CSC 305 Shading. Brian Wyvill 2016

University of Victoria CSC 305 Shading. Brian Wyvill 2016 University of Victoria CSC 305 Shading Brian Wyvill 2016 The illuminating Hemisphere Energy and Intensity Energy is the intensity integrated over the solid angle through which it acts. Intensity is not

More information

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY 1(84) Information Coding / Computer Graphics, ISY, LiTH TSBK 07 Computer Graphics Ingemar Ragnemalm, ISY 1(84) Lecture 5 3D graphics part 3 Illumination Illumination applied: Shading Surface detail: Mappings

More information

27 Refraction, Dispersion, Internal Reflection

27 Refraction, Dispersion, Internal Reflection Chapter 7 Refractio, Dispersio, Iteral Reflectio 7 Refractio, Dispersio, Iteral Reflectio Whe we talked about thi film iterferece, we said that whe light ecouters a smooth iterface betwee two trasparet

More information

Lecture 6. Lecturer: Ronitt Rubinfeld Scribes: Chen Ziv, Eliav Buchnik, Ophir Arie, Jonathan Gradstein

Lecture 6. Lecturer: Ronitt Rubinfeld Scribes: Chen Ziv, Eliav Buchnik, Ophir Arie, Jonathan Gradstein 068.670 Subliear Time Algorithms November, 0 Lecture 6 Lecturer: Roitt Rubifeld Scribes: Che Ziv, Eliav Buchik, Ophir Arie, Joatha Gradstei Lesso overview. Usig the oracle reductio framework for approximatig

More information

Parametric curves. Reading. Parametric polynomial curves. Mathematical curve representation. Brian Curless CSE 457 Spring 2015

Parametric curves. Reading. Parametric polynomial curves. Mathematical curve representation. Brian Curless CSE 457 Spring 2015 Readig Required: Agel 0.-0.3, 0.5., 0.6-0.7, 0.9 Parametric curves Bria Curless CSE 457 Sprig 05 Optioal Bartels, Beatty, ad Barsy. A Itroductio to Splies for use i Computer Graphics ad Geometric Modelig,

More information

Derivation of perspective stereo projection matrices with depth, shape and magnification consideration

Derivation of perspective stereo projection matrices with depth, shape and magnification consideration Derivatio of perspective stereo projectio matrices with depth, shape ad magificatio cosideratio Patrick Oberthür Jauary 2014 This essay will show how to costruct a pair of stereoscopic perspective projectio

More information

IMP: Superposer Integrated Morphometrics Package Superposition Tool

IMP: Superposer Integrated Morphometrics Package Superposition Tool IMP: Superposer Itegrated Morphometrics Package Superpositio Tool Programmig by: David Lieber ( 03) Caisius College 200 Mai St. Buffalo, NY 4208 Cocept by: H. David Sheets, Dept. of Physics, Caisius College

More information

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people GLSL Introduction Fu-Chung Huang Thanks for materials from many other people Programmable Shaders //per vertex inputs from main attribute aposition; attribute anormal; //outputs to frag. program varying

More information

Lecture 24: Bezier Curves and Surfaces. thou shalt be near unto me Genesis 45:10

Lecture 24: Bezier Curves and Surfaces. thou shalt be near unto me Genesis 45:10 Lecture 24: Bezier Curves ad Surfaces thou shalt be ear uto me Geesis 45:0. Iterpolatio ad Approximatio Freeform curves ad surfaces are smooth shapes ofte describig ma-made objects. The hood of a car,

More information

Lecture 18. Optimization in n dimensions

Lecture 18. Optimization in n dimensions Lecture 8 Optimizatio i dimesios Itroductio We ow cosider the problem of miimizig a sigle scalar fuctio of variables, f x, where x=[ x, x,, x ]T. The D case ca be visualized as fidig the lowest poit of

More information

Stereoscopic Imaging ( 양안식 3D) 4Stereoscopic Imaging 의원리 4Stereoscopic Imaging 기법들 4Stereoscopic 3D

Stereoscopic Imaging ( 양안식 3D) 4Stereoscopic Imaging 의원리 4Stereoscopic Imaging 기법들 4Stereoscopic 3D Stereoscopic Imagig ( 양안식 3D) 4Stereoscopic Imagig 의원리 4Stereoscopic Imagig 기법들 4Stereoscopic 3D 거리 (Depth) 의인식 o Stereopsis ( 양안시 / 입체시 ) o Accommodatio of the eye ( 원근조절 ) o Occlusio of oe object by

More information

Computer Graphics. Shading. Based on slides by Dianna Xu, Bryn Mawr College

Computer Graphics. Shading. Based on slides by Dianna Xu, Bryn Mawr College Computer Graphics Shading Based on slides by Dianna Xu, Bryn Mawr College Image Synthesis and Shading Perception of 3D Objects Displays almost always 2 dimensional. Depth cues needed to restore the third

More information

Lab 9 - Metal and Glass

Lab 9 - Metal and Glass Lab 9 - Metal and Glass Let the form of an object be what it may, light, shade, and perspective will always make it beautiful. -John Constable Prologue Support code: /course/cs1230/src/labs/lab09 This

More information

Illumination / Reflection Models. Illumination / Reflection Models

Illumination / Reflection Models. Illumination / Reflection Models llumitio / eflectio Moels ( x, y, z) Light Source + t λ 580φ 0θ 0 igorous Physics π 760 π L( t, x, y, z, φ, θ, λ) ( t, x, y, z, φ, θ, λ) θφλt Simplifie Physics Tricks, Hcks, Kluges Wht looks goo Direct

More information

Basic Optics: Index of Refraction

Basic Optics: Index of Refraction Basic Optics: Idex of Refractio Deser materials have lower speeds of light Idex of Refractio = where c = speed of light i vacuum v = velocity i medium Eve small chages ca create differece i Higher idex

More information

CS 418: Interactive Computer Graphics. Basic Shading in WebGL. Eric Shaffer

CS 418: Interactive Computer Graphics. Basic Shading in WebGL. Eric Shaffer CS 48: Interactive Computer Graphics Basic Shading in WebGL Eric Shaffer Some slides adapted from Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 205 Phong Reflectance Model Blinn-Phong

More information

A New Morphological 3D Shape Decomposition: Grayscale Interframe Interpolation Method

A New Morphological 3D Shape Decomposition: Grayscale Interframe Interpolation Method A ew Morphological 3D Shape Decompositio: Grayscale Iterframe Iterpolatio Method D.. Vizireau Politehica Uiversity Bucharest, Romaia ae@comm.pub.ro R. M. Udrea Politehica Uiversity Bucharest, Romaia mihea@comm.pub.ro

More information

Reading. Subdivision curves and surfaces. Subdivision curves. Chaikin s algorithm. Recommended:

Reading. Subdivision curves and surfaces. Subdivision curves. Chaikin s algorithm. Recommended: Readig Recommeded: Stollitz, DeRose, ad Salesi. Wavelets for Computer Graphics: Theory ad Applicatios, 996, sectio 6.-6.3, 0., A.5. Subdivisio curves ad surfaces Note: there is a error i Stollitz, et al.,

More information

Bezier curves. Figure 2 shows cubic Bezier curves for various control points. In a Bezier curve, only

Bezier curves. Figure 2 shows cubic Bezier curves for various control points. In a Bezier curve, only Edited: Yeh-Liag Hsu (998--; recommeded: Yeh-Liag Hsu (--9; last updated: Yeh-Liag Hsu (9--7. Note: This is the course material for ME55 Geometric modelig ad computer graphics, Yua Ze Uiversity. art of

More information

Mathematics and Art Activity - Basic Plane Tessellation with GeoGebra

Mathematics and Art Activity - Basic Plane Tessellation with GeoGebra 1 Mathematics ad Art Activity - Basic Plae Tessellatio with GeoGebra Worksheet: Explorig Regular Edge-Edge Tessellatios of the Cartesia Plae ad the Mathematics behid it. Goal: To eable Maths educators

More information

Using Shaders for Lighting

Using Shaders for Lighting Using Shaders for Lighting Mike Bailey mjb@cs.oregonstate.edu Lighting Definitions L N R E N = Normal L = Light vector E = Eye vector R = Light reflection vector ER = Eye reflection vector Color = LightColor

More information

GRADIENT DESCENT. Admin 10/24/13. Assignment 5. David Kauchak CS 451 Fall 2013

GRADIENT DESCENT. Admin 10/24/13. Assignment 5. David Kauchak CS 451 Fall 2013 Adi Assiget 5 GRADIENT DESCENT David Kauchak CS 451 Fall 2013 Math backgroud Liear odels A strog high-bias assuptio is liear separability: i 2 diesios, ca separate classes by a lie i higher diesios, eed

More information

Using Shaders for Lighting

Using Shaders for Lighting 1 Using Shaders for Lighting This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License Mike Bailey mjb@cs.oregonstate.edu lighting.pptx Lighting Definitions

More information

The Rasterization Pipeline

The Rasterization Pipeline Lecture 5: The Rasterization Pipeline Computer Graphics and Imaging UC Berkeley CS184/284A, Spring 2016 What We ve Covered So Far z x y z x y (0, 0) (w, h) Position objects and the camera in the world

More information

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 11 Frieds, Overloaded Operators, ad Arrays i Classes Copyright 2014 Pearso Addiso-Wesley. All rights reserved. Overview 11.1 Fried Fuctios 11.2 Overloadig Operators 11.3 Arrays ad Classes 11.4

More information

Lenses and Imaging (Part I)

Lenses and Imaging (Part I) Leses ad Imagig (Part I) Why is imagig ecessary: Huyge s priciple Spherical & parallel ray budles, poits at ifiity efractio at spherical surfaces (paraial approimatio) Optical power ad imagig coditio Matri

More information

Projection Transformations. and

Projection Transformations. and 3D Viewig Projectio Trasormatios a Viewig i Pipelie Implemetatio o 3D Viewig 3-D worl cooriate output primitives Apply ormalizig i trasormatio Clip agaist caoical View Volume 2D evice cooriates Trasorm

More information

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1) Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1) Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Why do we need Lighting & shading? Sphere

More information

Section 7.2: Direction Fields and Euler s Methods

Section 7.2: Direction Fields and Euler s Methods Sectio 7.: Directio ields ad Euler s Methods Practice HW from Stewart Tetbook ot to had i p. 5 # -3 9-3 odd or a give differetial equatio we wat to look at was to fid its solutio. I this chapter we will

More information

Dynamic Programming and Curve Fitting Based Road Boundary Detection

Dynamic Programming and Curve Fitting Based Road Boundary Detection Dyamic Programmig ad Curve Fittig Based Road Boudary Detectio SHYAM PRASAD ADHIKARI, HYONGSUK KIM, Divisio of Electroics ad Iformatio Egieerig Chobuk Natioal Uiversity 664-4 Ga Deokji-Dog Jeoju-City Jeobuk

More information

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics V. Guoying Zhao 1 / 65

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics V. Guoying Zhao 1 / 65 Computer Graphics Three-Dimensional Graphics V Guoying Zhao 1 / 65 Shading Guoying Zhao 2 / 65 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material

More information

Propagation of light: rays versus wave fronts; geometrical and physical optics

Propagation of light: rays versus wave fronts; geometrical and physical optics Propagatio of light: rays versus wave frots; geometrical ad physical optics A ray is a imagiary lie alog the directio of propagatio of the light wave: this lie is perpedicular to the wave frot If descriptio

More information

Chapter 3 Classification of FFT Processor Algorithms

Chapter 3 Classification of FFT Processor Algorithms Chapter Classificatio of FFT Processor Algorithms The computatioal complexity of the Discrete Fourier trasform (DFT) is very high. It requires () 2 complex multiplicatios ad () complex additios [5]. As

More information

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Why do we need Lighting

More information

Diego Nehab. n A Transformation For Extracting New Descriptors of Shape. n Locus of points equidistant from contour

Diego Nehab. n A Transformation For Extracting New Descriptors of Shape. n Locus of points equidistant from contour Diego Nehab A Trasformatio For Extractig New Descriptors of Shape Locus of poits equidistat from cotour Medial Axis Symmetric Axis Skeleto Shock Graph Shaked 96 1 Shape matchig Aimatio Dimesio reductio

More information

Illumination Models & Shading

Illumination Models & Shading Illumination Models & Shading Lighting vs. Shading Lighting Interaction between materials and light sources Physics Shading Determining the color of a pixel Computer Graphics ZBuffer(Scene) PutColor(x,y,Col(P));

More information