Save this PDF as:

Size: px
Start display at page:

## Transcription

1 Lessons Learned from HW Shading CS Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Only have an idle() function if something is animated Set idle function to NULL, when animation is not running If an interaction (keyboard, mouse or menu) changes something that requires a screen update, put glutpostredisplay at the end of the associated callback function Only send geometry (vertices & colors) when it changes IOW, If geometry never changes, only send it once Make sure your transformation matrices are applied in the correct order Objectives Why we need shading Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build a simple reflection model---the Phong model--- that can be used with real time graphics hardware Suppose we build a model of a sphere using many polygons and color it with one color. We get something like But we want Shading Scattering Why does the image of a real sphere look like this? Light-material interactions cause each point to have a different color or shade Need to consider - Light sources - Material properties - Location of viewer - Surface orientation Light strikes A - Some scattered - Some absorbed Some of scattered light strikes B - Some scattered - Some absorbed Some of this scattered light strikes A and so on

2 Rendering Equation Global Effects The infinite scattering and absorption of light can be described by the rendering equation - Cannot be solved in general - Ray tracing is a special case for perfectly reflecting surfaces Rendering equation is global and includes - Shadows - Multiple scattering from object to object shadow translucent surface multiple reflection Local vs Global Rendering Light-Material Interaction Correct shading requires a global calculation involving all objects and light sources - Incompatible with pipeline model which shades each polygon independently (local rendering) However, in computer graphics, especially real time graphics, we are happy if things look right - There are many techniques for approximating global effects Light that strikes an object is partially absorbed and partially scattered (reflected) The amount reflected determines the color and brightness of the object - A surface appears red under white light because the red component of the light is reflected and the rest is absorbed The reflected light is scattered in a manner that depends on the smoothness and orientation of the surface 0 Light Sources Simple Light Sources General light sources are difficult to work with because we must integrate light coming from all points on the source Point source - Model with position and color - Distant source = infinite distance away (parallel) Spotlight - Restrict light from ideal point source Ambient light - Same amount of light everywhere in scene - Can model contribution of many sources and reflecting surfaces

3 Surface Types Phong Shading Model The smoother a surface, the more reflected light is concentrated in the direction a perfect mirror would reflected the light A very rough surface scatters light in all directions smooth surface rough surface A simple model that can be computed rapidly Has three components - Diffuse - Specular - Ambient Uses four vectors - To light source - To viewer - Normal - Perfect reflector Ideal Reflector Lambertian Surface Normal is determined by local orientation Angle of incidence = angle of reflection The three vectors must be coplanar r = (l n ) n - l Perfectly diffuse reflector Light scattered equally in all directions Amount of light reflected is proportional to the vertical component of incoming light - reflected light ~cos θ i - cos θ i = l n if vectors normalized - There are also three coefficients, k r, k b, k g that show how much of each color component is reflected Specular Surfaces Most surfaces are neither ideal diffusers nor perfectly specular (ideal reflectors) Smooth surfaces show specular highlights due to incoming light being reflected in directions concentrated close to the direction of a perfect reflection specular highlight

4 Modeling Specular Relections The Shininess Coefficient Phong proposed using a term that dropped off as the angle between the viewer and the ideal reflection increased Values of α between 00 and 00 correspond to metals Values between and 0 give surface that look like plastic I r ~ k s I cos α φ reflected shininess coef intensity incoming intensity absorption coef φ cos α φ -0 φ 0 0 Ambient Light Ambient light is the result of multiple interactions between (large) light sources and the objects in the environment Amount and color depend on both the color of the light(s) and the material properties of the object Add k a I a to diffuse and specular terms reflection coef intensity of ambient light Distance Terms The light from a point source that reaches a surface is inversely proportional to the square of the distance between them We can add a factor of the form /(a + bd +cd ) to the diffuse and specular terms The constant and linear terms soften the effect of the point source

5 Light Sources Material Properties In the Phong Model, we add the results from each light source Each light source has separate diffuse, specular, and ambient terms to allow for maximum flexibility even though this form does not have a physical justification Separate red, green and blue components Hence, coefficients for each point source - I dr, I dg, I db, I sr, I sg, I sb, I ar, I ag, I ab Material properties match light source properties - Nine absorbtion coefficients k dr, k dg, k db, k sr, k sg, k sb, k ar, k ag, k ab - Shininess coefficient α Adding up the Components Too Intense For each light source and each color component, the Phong model can be written (without the distance terms) as With multiple light sources, it is easy to generated values of I > One solution is to set the color value to be MIN(I, ) An object can change color, saturating towards white Ex. (0., 0., 0.) + (0., 0., 0.) = (0., 0.,.0) I =k d I d l n + k s I s (v r ) α + k a I a For each color component we add contributions from all light sources Another solution is to renormalize the intensities to vary from 0 to if one I >. Requires calculating all I s before rendering anything. No over-saturation, but image may be too bright, and contrasts a little off. Image-processing on image to be rendered (with original I s) will produce better results, but is costly. Larry F. Hodges, G. Drew Kessler Modified Phong Model The Halfway Vector The specular term in the Phong model is problematic because it requires the calculation of a new reflection vector and view vector for each vertex Blinn suggested an approximation using the halfway vector that is more efficient h is normalized vector halfway between l and v h = ( l + v )/ l + v 0

6 Using the halfway vector Example Replace (v r ) α by (n h ) β β is chosen to match shineness Note that halfway angle is half of angle between r and v if vectors are coplanar Resulting model is known as the modified Phong or Blinn lighting model - Specified in OpenGL standard Only differences in these teapots are the parameters in the modified Phong model Computation of Vectors Computing Reflection Direction l and v are specified by the application Can compute r from l and n Problem is determining n For simple surfaces n can be determined, but how we determine n differs depending on underlying representation of surface OpenGL leaves determination of normal to application - Exception for GLU quadrics and Bezier surfaces which are deprecated Angle of incidence = angle of reflection Normal, light direction and reflection direction are coplaner Want all three to be unit length r = (l n)n l Plane Normals Normal to Sphere Equation of plane: ax+by+cz+d = 0 From Chapter we know that plane is determined by three points p 0, p, p or normal n and p 0 Normal can be obtained by Implicit function f(x,y,z)=0 Normal given by gradient Sphere f(p)=p p - n = [ f/ x, f/ y, f/ z] T =p n = (p -p 0 ) (p -p 0 )

7 Parametric Form General Case For sphere x=x(u,v)=cos u sin v y=y(u,v)=cos u cos v z= z(u,v)=sin u Tangent plane determined by vectors p/ u = [ x/ u, y/ u, z/ u]t p/ v = [ x/ v, y/ v, z/ v]t We can compute parametric normals for other simple cases - Quadrics - Parameteric polynomial surfaces Bezier surface patches (Chapter 0) Normal given by cross product n = p/ u p/ v Objectives Shading in OpenGL CS Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Introduce the OpenGL shading methods - per vertex vs per fragment shading - Where to carry out Discuss polygonal shading - Flat - Smooth - Gouraud 0 OpenGL shading Normalization Need - Normals - Material properties - Lights - State-based shading functions have been deprecated (glnormal, glmaterial, gllight) - Get computed in application or send attributes to shaders Cosine terms in lighting calculations can be computed using dot product Unit length vectors simplify calculation Usually we want to set the magnitudes to have unit length but - Length can be affected by transformations - Note that scaling does not preserved length GLSL has a normalization function

8 Specifying a Point Light Source Distance and Direction For each light source, we can set its position and an RGBA for the diffuse, specular, and ambient components vec diffuse0 = vec(.0, 0.0, 0.0,.0); vec ambient0 = vec(.0, 0.0, 0.0,.0); vec specular0 = vec(.0, 0.0, 0.0,.0); vec light0_pos =vec(.0,.0,,0,.0); The source colors are specified in RGBA The position is given in homogeneous coordinates - If w =.0, we are specifying a finite location - If w =0.0, we are specifying a parallel source with the given direction vector The coefficients in distance terms are usually quadratic (/(a+b*d+c*d*d)) where d is the distance from the point being rendered to the light source Spotlights Global Ambient Light Derive from point source - Direction - Cutoff - Attenuation Proportional to cos α φ Ambient light depends on color of light sources - A red light in a white room will cause a red ambient term that disappears when the light is turned off A global ambient term is often helpful for testing -θ φ θ Moving Light Sources Material Properties Light sources are geometric objects whose positions or directions are affected by the model-view matrix Depending on where we place the position (direction) setting function, we can - Move the light source(s) with the object(s) - Fix the object(s) and move the light source(s) - Fix the light source(s) and move the object(s) - Move the light source(s) and object(s) independently Material properties should match the terms in the light model Reflectivities w component gives opacity (alpha) vec ambient = vec(0., 0., 0.,.0); vec diffuse = vec(.0, 0., 0.0,.0); vec specular = vec(.0,.0,.0,.0); GLfloat shine = 00.0

13 HW Suggestions HW Suggestions Next implement Phong shading algorithm in fragment shader Be sure to use the same material and lighting values for both shading algorithms Provide a way to switch between the two Provide interface for changing the object s material properties. The three choices should be significantly different. Add a second light nd light will need its own transformation Allow user to move light Keep track of which coordinate system you are calculating your surface colors in. Is it in world coordinates or camera coordinates?

### Three-Dimensional Graphics V. Guoying Zhao 1 / 55

Computer Graphics Three-Dimensional Graphics V Guoying Zhao 1 / 55 Shading Guoying Zhao 2 / 55 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material

### 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

### Comp 410/510 Computer Graphics. Spring Shading

Comp 410/510 Computer Graphics Spring 2017 Shading Why we need shading Suppose we build a model of a sphere using many polygons and then color it using a fixed color. We get something like But we rather

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

### Objectives. Continue discussion of shading Introduce modified Phong model Consider computation of required vectors

Objectives Continue discussion of shading Introduce modified Phong model Consider computation of required vectors 1 Lambertian Surface Perfectly diffuse reflector Light scattered equally in all directions

Illumination & Shading Goals Introduce the types of light-material interactions Build a simple reflection model---the Phong model--- that can be used with real time graphics hardware Why we need Illumination

### Shading II. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Shading II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Objectives Continue discussion of shading Introduce modified Phong model

Why we need shading? Suppose we build a model of a sphere using many polygons and color it with glcolor. We get something like But we want Light-material interactions cause each point to have a different

### 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

### Objectives. Introduce the OpenGL shading Methods 1) Light and material functions on MV.js 2) per vertex vs per fragment shading 3) Where to carry out

Objectives Introduce the OpenGL shading Methods 1) Light and material functions on MV.js 2) per vertex vs per fragment shading 3) Where to carry out 1 Steps in OpenGL shading Enable shading and select

### Objectives. Shading II. Distance Terms. The Phong Reflection Model

Shading II Objectives Introduce distance terms to the shading model. More details about the Phong model (lightmaterial interaction). Introduce the Blinn lighting model (also known as the modified Phong

### Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Orthogonal Projection Matrices 1 Objectives Derive the projection matrices used for standard orthogonal projections Introduce oblique projections Introduce projection normalization 2 Normalization Rather

### ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

ECS 175 COMPUTER GRAPHICS Ken Joy Winter 2014 Shading To be able to model shading, we simplify Uniform Media no scattering of light Opaque Objects No Interreflection Point Light Sources RGB Color (eliminating

CS 543: Computer Graphics Illumination & Shading I Robert W. Lindeman Associate Professor Interactive Media & Game Development Department of Computer Science Worcester Polytechnic Institute gogo@wpi.edu

### 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

### CS5620 Intro to Computer Graphics

So Far wireframe hidden surfaces Next step 1 2 Light! Need to understand: How lighting works Types of lights Types of surfaces How shading works Shading algorithms What s Missing? Lighting vs. Shading

### Color and Light. CSCI 4229/5229 Computer Graphics Summer 2008

Color and Light CSCI 4229/5229 Computer Graphics Summer 2008 Solar Spectrum Human Trichromatic Color Perception Are A and B the same? Color perception is relative Transmission,Absorption&Reflection Light

### 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.

### 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

### 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

### CS Illumination and Shading. Slide 1

CS 112 - Illumination and Shading Slide 1 Illumination/Lighting Interaction between light and surfaces Physics of optics and thermal radiation Very complex: Light bounces off several surface before reaching

### Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Lighting and Shading Slides: Tamar Shinar, Victor Zordon Why we need shading Suppose we build a model of a sphere using many polygons and color each the same color. We get something like But we want 2

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

Shading and Illumination OpenGL Shading Without Shading With Shading Physics Bidirectional Reflectance Distribution Function (BRDF) f r (ω i,ω ) = dl(ω ) L(ω i )cosθ i dω i = dl(ω ) L(ω i )( ω i n)dω

### Introduction to Computer Graphics. Farhana Bandukwala, PhD Lecture 14: Light Interacting with Surfaces

Introduction to Computer Graphics Farhana Bandukwala, PhD Lecture 14: Light Interacting with Surfaces Outline Computational tools Reflection models Polygon shading Computation tools Surface normals Vector

### CEng 477 Introduction to Computer Graphics Fall

Illumination Models and Surface-Rendering Methods CEng 477 Introduction to Computer Graphics Fall 2007 2008 Illumination Models and Surface Rendering Methods In order to achieve realism in computer generated

### 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:

### Methodology for Lecture. Importance of Lighting. Outline. Shading Models. Brief primer on Color. Foundations of Computer Graphics (Spring 2010)

Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 11: OpenGL 3 http://inst.eecs.berkeley.edu/~cs184 Methodology for Lecture Lecture deals with lighting (teapot shaded as in HW1) Some Nate

### CSE 167: Lecture #7: Color and Shading. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

CSE 167: Introduction to Computer Graphics Lecture #7: Color and Shading Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011 Announcements Homework project #3 due this Friday,

### Lighting and Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch

15-462 Computer Graphics I Lecture 7 Lighting and Shading February 12, 2002 Frank Pfenning Carnegie Mellon University http://www.cs.cmu.edu/~fp/courses/graphics/ Light Sources Phong Illumination Model

### Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Shading Models There are two main types of rendering that we cover, polygon rendering ray tracing Polygon rendering is used to apply illumination models to polygons, whereas ray tracing applies to arbitrary

### Illumination and Shading ECE 567

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

### Computer Viewing. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Computer Viewing CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce the mathematics of projection Introduce OpenGL viewing functions Look at

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

CSE 167: Introduction to Computer Graphics Lecture #8: Lighting Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011 Announcements Homework project #4 due Friday, October 28 Introduction:

### Raytracing CS148 AS3. Due :59pm PDT

Raytracing CS148 AS3 Due 2010-07-25 11:59pm PDT We start our exploration of Rendering - the process of converting a high-level object-based description of scene into an image. We will do this by building

### CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

CENG 477 Introduction to Computer Graphics Ray Tracing: Shading Last Week Until now we learned: How to create the primary rays from the given camera and image plane parameters How to intersect these rays

### 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

### CSE 681 Illumination and Phong Shading

CSE 681 Illumination and Phong Shading Physics tells us What is Light? We don t see objects, we see light reflected off of objects Light is a particle and a wave The frequency of light What is Color? Our

### The Rasterization Pipeline

Lecture 5: The Rasterization Pipeline Computer Graphics and Imaging UC Berkeley What We ve Covered So Far z x y z x y (0, 0) (w, h) Position objects and the camera in the world Compute position of objects

### Deferred Rendering Due: Wednesday November 15 at 10pm

CMSC 23700 Autumn 2017 Introduction to Computer Graphics Project 4 November 2, 2017 Deferred Rendering Due: Wednesday November 15 at 10pm 1 Summary This assignment uses the same application architecture

Illumination and Shading Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL computes illumination at vertices illumination Shading

### Introduction to 3D Graphics

Introduction to 3D Graphics Using OpenGL 3D 1/46 Classical Polygon Graphics (H/W) Pipeline Mesh objects with 3D polygons (triangles or quads usually) Apply material properties to each object (for reflectance

### 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:

### So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

11 11.1 Basics So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources. Global models include incident light that arrives

### COMP environment mapping Mar. 12, r = 2n(n v) v

Rendering mirror surfaces The next texture mapping method assumes we have a mirror surface, or at least a reflectance function that contains a mirror component. Examples might be a car window or hood,

Illumination and Shading Illumination and Shading z Illumination Models y Ambient y Diffuse y Attenuation y Specular Reflection z Interpolated Shading Models y Flat, Gouraud, Phong y Problems CS4451: Fall

### Turn on the Lights: Reflectance

Turn on the Lights: Reflectance Part 2: Shading Tuesday, October 15 2012 Lecture #14 Goal of Shading Model simple light sources Point light sources Extended light sources Ambient lighting Model lighting

### Recall: Indexing into Cube Map

Recall: Indexing into Cube Map Compute R = 2(N V)N-V Object at origin Use largest magnitude component of R to determine face of cube Other 2 components give texture coordinates V R Cube Map Layout Example

9. Illumination and Shading Approaches for visual realism: - Remove hidden surfaces - Shade visible surfaces and reproduce shadows - Reproduce surface properties Texture Degree of transparency Roughness,

### Shading , Fall 2004 Nancy Pollard Mark Tomczak

15-462, Fall 2004 Nancy Pollard Mark Tomczak Shading Shading Concepts Shading Equations Lambertian, Gouraud shading Phong Illumination Model Non-photorealistic rendering [Shirly, Ch. 8] Announcements Written

DH2323 DGI15 INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION LIGHTING AND SHADING Christopher Peters HPCViz, KTH Royal Institute of Technology, Sweden chpeters@kth.se http://kth.academia.edu/christopheredwardpeters

### Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling Strategies" Ø The Hall illumination model. Ø Original ray tracing paper

CS 431/636 Advanced Rendering Techniques Ø Dr. David Breen Ø Korman 105D Ø Wednesday 6PM 8:50PM Presentation 6 5/16/12 Questions from ast Time? Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling

### Interpolation using scanline algorithm

Interpolation using scanline algorithm Idea: Exploit knowledge about already computed color values. Traverse projected triangle top-down using scanline. Compute start and end color value of each pixel

### Light Sources. Spotlight model

lecture 12 Light Sources sunlight (parallel) Sunny day model : "point source at infinity" - lighting - materials: diffuse, specular, ambient spotlight - shading: Flat vs. Gouraud vs Phong light bulb ambient

### OpenGL shaders and programming models that provide object persistence

OpenGL shaders and programming models that provide object persistence COSC342 Lecture 22 19 May 2016 OpenGL shaders We discussed forms of local illumination in the ray tracing lectures. We also saw that

### CS 5625 Lec 2: Shading Models

CS 5625 Lec 2: Shading Models Kavita Bala Spring 2013 Shading Models Chapter 7 Next few weeks Textures Graphics Pipeline Light Emission To compute images What are the light sources? Light Propagation Fog/Clear?

Illumination and Shading Light sources emit intensity: assigns intensity to each wavelength of light Humans perceive as a colour - navy blue, light green, etc. Exeriments show that there are distinct I

### Illumination Models and Surface-Rendering Methods. Chapter 10

Illumination Models and Surface-Rendering Methods Chapter 10 Illumination and Surface- Rendering Given scene specifications object positions, optical properties of the surface, viewer position, viewing

### Ambient reflection. Jacobs University Visualization and Computer Graphics Lab : Graphics and Visualization 407

Ambient reflection Phong reflection is a local illumination model. It only considers the reflection of light that directly comes from the light source. It does not compute secondary reflection of light

### Lights, Colour and Materials In OpenGL

Illumination Models Lights, Colour and Materials In OpenGL Illumination models are used to generate the colour of an object s surface at a given point on that surface. The factors that govern the illumination

### Introduction to 3D Graphics

Introduction to 3D Graphics Using OpenGL 3D 1/46 Classical Polygon Graphics (H/W) Pipeline Mesh objects with 3D polygons (triangles or quads usually) Apply material properties to each object (for reflectance

### 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

### Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Objectives Learn the basic design of a graphics system Introduce

### Photorealism: Ray Tracing

Photorealism: Ray Tracing Reading Assignment: Chapter 13 Local vs. Global Illumination Local Illumination depends on local object and light sources only Global Illumination at a point can depend on any

### Surface Reflection Models

Surface Reflection Models Frank Losasso (flosasso@nvidia.com) Introduction One of the fundamental topics in lighting is how the light interacts with the environment. The academic community has researched

### Rendering Light Reflection Models

Rendering Light Reflection Models Visual Imaging in the Electronic Age Donald P. Greenberg October 3, 2017 Lecture #13 Program of Computer Graphics, Cornell University General Electric - 167 Cornell in

### Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Computergrafik Matthias Zwicker Universität Bern Herbst 2016 Today More shading Environment maps Reflection mapping Irradiance environment maps Ambient occlusion Reflection and refraction Toon shading

Shaders Oscar 1/43 Apodaca and Gritz, Advanced RenderMan Pixel Color Irradiance measures the power per unit area hitting a pixel E = න L i cos θ i dω i (obtained by integrating an equation form last class)

### Notes on Computer Graphics and OpenGL. Thomas Strathmann

Notes on Computer Graphics and OpenGL Thomas Strathmann February 2, 2011 Preface The purpose of this document is to server as a sort of logbook in which I put down all the interesting math and assorted

### CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

CMSC427 Advanced shading getting global illumination by local methods Credit: slides Prof. Zwicker Topics Shadows Environment maps Reflection mapping Irradiance environment maps Ambient occlusion Reflection

### Computer Graphics - Week 4

Computer Graphics - Week 4 Bengt-Olaf Schneider IBM T.J. Watson Research Center Questions about Last Week? Information about ACIS will be available tomorrow... Check the newsgroup You should have started

### Computer Graphics I. Assignment 3

UNIVERSITÄT DES SAARLANDES Dr.-Ing. Hendrik P.A. Lensch Max Planck Institut Informatik Art Tevs (tevs@mpi-inf.mpg.de) Boris Ajdin (bajdin@mpi-inf.mpg.de) Matthias Hullin (hullin@mpi-inf.mpg.de) 12. November

### CS 4620 Midterm, March 21, 2017

CS 460 Midterm, March 1, 017 This 90-minute exam has 4 questions worth a total of 100 points. Use the back of the pages if you need more space. Academic Integrity is expected of all students of Cornell

### 6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm In this assignment, you will add an interactive preview of the scene and solid

### Lighting/Shading II. Week 7, Mon Mar 1

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Lighting/Shading II Week 7, Mon Mar 1 http://www.ugrad.cs.ubc.ca/~cs314/vjan2010 News Homework 3 out today Homework

### Three Main Themes of Computer Graphics

Three Main Themes of Computer Graphics Modeling How do we represent (or model) 3-D objects? How do we construct models for specific objects? Animation How do we represent the motion of objects? How do

Fall 2017 CSCI 420: Computer Graphics 5.2 Shading in OpenGL Hao Li http://cs420.hao-li.com 1 Outline Normal Vectors in OpenGL Polygonal Shading Light Sources in OpenGL Material Properties in OpenGL Example:

### Shaders. Slide credit to Prof. Zwicker

Shaders Slide credit to Prof. Zwicker 2 Today Shader programming 3 Complete model Blinn model with several light sources i diffuse specular ambient How is this implemented on the graphics processor (GPU)?

### Building Models. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Building Models CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce simple data structures for building polygonal models - Vertex lists - Edge

### 6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm In this assignment, you will add an interactive preview of the scene and solid

Computer Graphics (Fall 2008) COMS 4160, Lecture 19: Illumination and Shading 2 http://www.cs.columbia.edu/~cs4160 Radiance Power per unit projected area perpendicular to the ray per unit solid angle in

### x ~ Hemispheric Lighting

Irradiance and Incoming Radiance Imagine a sensor which is a small, flat plane centered at a point ~ x in space and oriented so that its normal points in the direction n. This sensor can compute the total

### CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer. by Emmanuel Agu

CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer by Emmanuel Agu Ray Casting (Appel, 1968) direct illumination Recursive ray tracing (Whitted, 1980) Pseudocode for Ray Tracer

### C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE UGRAD.CS.UBC.C A/~CS314 Mikhail Bessmeltsev 1 WHAT IS RENDERING? Generating image from a 3D scene 2 WHAT IS RENDERING? Generating image

### Shading, lighting, & BRDF Theory. Cliff Lindsay, PHD

Shading, lighting, & BRDF Theory Cliff Lindsay, PHD Overview of today s lecture BRDF Characteristics Lights in terms of BRDFs Classes of BRDFs Ambient light & Shadows in terms of BRDFs Decomposing Reflection

### Lecture 4: Reflection Models

Lecture 4: Reflection Models CS 660, Spring 009 Kavita Bala Computer Science Cornell University Outline Light sources Light source characteristics Types of sources Light reflection Physics-based models

### CSE Intro to Computer Graphics. ANSWER KEY: Midterm Examination. November 18, Instructor: Sam Buss, UC San Diego

CSE 167 - Intro to Computer Graphics ANSWER KEY: Midterm Examination November 18, 2003 Instructor: Sam Buss, UC San Diego Write your name or initials on every page before beginning the exam. You have 75

### CS 184: Assignment 2 Scene Viewer

CS 184: Assignment 2 Scene Viewer Ravi Ramamoorthi 1 Goals and Motivation This is a more substantial assignment than homework 1, including more transformations, shading, and a viewer for a scene specified

### Shading Algorithms. Ron Goldman Department of Computer Science Rice University

Shading Algorithms Ron Goldman Department of Computer Science Rice University Illumination and Shading Standard Assumptions Curved surfaces are approximated by planar polygons. All light sources are point

### Lecture 17: Recursive Ray Tracing. Where is the way where light dwelleth? Job 38:19

Lecture 17: Recursive Ray Tracing Where is the way where light dwelleth? Job 38:19 1. Raster Graphics Typical graphics terminals today are raster displays. A raster display renders a picture scan line

### The Graphics Pipeline and OpenGL III: OpenGL Shading Language (GLSL 1.10)!

! The Graphics Pipeline and OpenGL III: OpenGL Shading Language (GLSL 1.10)! Gordon Wetzstein! Stanford University! EE 267 Virtual Reality! Lecture 4! stanford.edu/class/ee267/! Updates! for 24h lab access:

### Materials & Shadows. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Winter 2017

Materials & Shadows Steve Rotenberg CSE168: Rendering Algorithms UCSD, Winter 2017 Diffuse Surfaces In an earlier lecture, we discussed diffuse surfaces We looked at the idealized Lambertian diffuse case

### Computergraphics Exercise 15/ Shading & Texturing

Computergraphics Exercise 15/16 3. Shading & Texturing Jakob Wagner for internal use only Shaders Vertex Specification define vertex format & data in model space Vertex Processing transform to clip space

### Supplement to Lecture 22

Supplement to Lecture 22 Programmable GPUs Programmable Pipelines Introduce programmable pipelines - Vertex shaders - Fragment shaders Introduce shading languages - Needed to describe shaders - RenderMan

### Classic Rendering Pipeline

CS580: Classic Rendering Pipeline Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/gcg/ Course Objectives Understand classic rendering pipeline Just high-level concepts, not all the