Why Do We Care About Lighting? Computer Graphics Lighting. The Surface Normal. Flat Shading (Per-face) Setting a Surface Normal in OpenGL
|
|
- Heather Snow
- 6 years ago
- Views:
Transcription
1 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 Without lightig Lightig.pptx With lightig The Surface Normal 3 Settig a Surface Normal i OpeGL 4 A surface ormal is a vector perpedicular to the surface. Sometimes surface ormals are defied or computed per-face. = ( P - P0 ) x ( P P0 ) Sometimes they are defied per-vertex to best approximate the uderlyig surface that the face is represetig. 0 0 glnormal3f( x, y, z ); glbegi( GL_TRIANGLES ); glvertex3f( x, y, z ); glvertex3f( x, y, z ); Per-face Settig a Surface Normal i OpeGL 5 Flat Shadig (Per-face) 6 glbegi(gl_triangles ); glnormal3f( x0, y0, z0 ); glnormal3f( x, y, z ); glvertex3f( x, y, z ); glnormal3f( x, y, z ); glvertex3f( x, y, z ); Per-vertex glshademodel( GL_FLAT ); glnormal3f( x, y, z ); glbegi(gl_triangles ); glvertex3f( x, y, z ); glvertex3f( x, y, z );
2 Smooth Shadig (Per-vertex) 7 8 glshademodel( GL_SMOOTH ); glbegi(gl_triangles ); glnormal3f( x0, y0, z0 ); glnormal3f( x, y, z ); glvertex3f( x, y, z ); glnormal3f( x, y, z ); glvertex3f( x, y, z ); 9 OpeGL Surface Normals Need to be Uitized by Someoe The OpeGL built-i Lightig Model 0 glnormal3f( x, y, z ); R OpeGL expects the ormal vector to be a uit vector, that is: x + y + z = I L E If it is ot, or if you are usig scalig trasformatios, you ca force OpeGL to do the uitizig for you with: gleable( GL_NORMALIZE ); P P I L R E Poit beig illumiated Light itesity Uit vector from poit to light Uit vector surface ormal Perfect reflectio uit vector Uit vector to eye positio The OpeGL built-i Lightig Model Diffuse Lightig works because of spreadig out the same amout of light eergy across more surface area. Ambiet = a costat Accouts for light boucig everywhere Diffuse = I*cosΘ. Diffuse = I*cosΘ Accouts for the agle betwee the icomig light ad the surface ormal 3. Specular = I*cos S Accouts for the agle betwee the perfect reflector ad the eye. The expoet, S, accouts for surface shiiess Note that cosθ is just the dot product betwee uit vectors L ad Note that cos is just the dot product betwee uit vectors R ad E
3 The Specular Lightig equatio is a heuristic that approximates reflectio from a rough surface Specular = I*cos S 3 Ambiet + The Three Elemets of Lightig 4 S shiiess /S roughess Diffuse + R Specular E = Poit Types of Light Sources 5 Poit Light at the Eye Lightig Examples 6 Directioal (Parallel, Su) Poit Light at the Origi Spotlight Lightig Examples 7 Colored Lights Shiig o Colored Objects 8 Spot Lights L R L G L B White Light What the light ca produce E R E G E B What the eye sees M R M G M B What the material ca reflect Gree Light E R = L R * M R E G = L G * M G E B = L B * M B 3
4 Too May Lightig Optios 9 Ways to Simplify Too May Lightig Optios 0 If there is oe light ad oe material, the followig thigs ca be set idepedetly: Global scee ambiet red, gree, blue Light positio: x, y, z Light ambiet red, gree, blue Light diffuse red, gree, blue Light specular red, gree, blue Material reactio to ambiet red, gree, blue Material reactio to diffuse red, gree, blue Material reactio to specular red, gree, blue Material specular shiiess. Set the ambiet light globally usig, for example, gllightmodelfv( GL_LIGHT_MODEL_AMBIENT, MulArray3(.3f, White ) ) I.e., set it to some low itesity of white.. Set the light s ambiet compoet to zero. 3. Set the light s diffuse ad specular compoets to the full color of the light. 4. Set each material s ambiet ad diffuse to the full color of the object. 5. Set each material s specular compoet to some fractio of white. This makes for 5 thigs that ca be set for just oe light ad oe material! While may combiatios are possible, some make more sese tha others. float White[ ] =.,.,.,. ; // utility to create a array from 3 separate values: Settig the Material Characteristics float * Array3( float a, float b, float c ) static float array[4]; array[0] = a; array[] = b; array[] = c; array[3] =.; retur array; // utility to create a array from a multiplier ad a array: float * MulArray3( float factor, float array0[3] ) static float array[4]; glmaterialfv( GL_BACK, GL_AMBIENT, MulArray3(.4, White ) ); glmaterialfv( GL_BACK, GL_DIFFUSE, MulArray3(., White ) ); glmaterialfv( GL_BACK, GL_SPECULAR, Array3( 0., 0., 0. ) ); glmaterialf ( GL_BACK, GL_SHININESS, 5. ); glmaterialfv( GL_BACK, GL_EMISSION, Array3( 0., 0., 0. ) ); glmaterialfv( GL_FRONT, GL_AMBIENT, MulArray3(., rgb ) ); glmaterialfv( GL_FRONT, GL_DIFFUSE, MulArray3(., rgb ) ); glmaterialfv( GL_FRONT, GL_SPECULAR, MulArray3(.7, White ) ); glmaterialf ( GL_FRONT, GL_SHININESS, 8. ); glmaterialfv( GL_FRONT, GL_EMISSION, Array3( 0., 0., 0. ) ); array[0] = factor * array0[0]; array[] = factor * array0[]; array[] = factor * array0[]; array[3] =.; retur array; Settig the Light Characteristics 3 Settig the Light Positio 4 gllightmodelfv( GL_LIGHT_MODEL_AMBIENT, MulArray3(., White ) ); gllightmodeli ( GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE ); gllightfv( GL_LIGHT0, GL_AMBIENT, Array3( 0., 0., 0. ) ); gllightfv( GL_LIGHT0, GL_DIFFUSE, LightColor ); gllightfv( GL_LIGHT0, GL_SPECULAR, LightColor ); glloadidetity( ); The light positio gets trasformed by the value of the ModelView matrix at the momet the light positio is set. // if we do this, the the light will be wrt the scee at XLIGHT, YLIGHT, ZLIGHT: gllightfv( GL_LIGHT0, GL_POSITION, Array3(XLIGHT, YLIGHT, ZLIGHT) ); You ca have multiple lights gllightf ( GL_LIGHT0, GL_CONSTANT_ATTENUATION,. ); gllightf ( GL_LIGHT0, GL_LINEAR_ATTENUATION, 0. ); gllightf ( GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0. ); // this is here because we are goig to do object (ad thus ormal) scalig: gleable( GL_NORMALIZE ); // traslate the object ito the viewig volume: glulookat( XEYE, YEYE, ZEYE, 0., 0., 0., 0.,., 0. ); // if we do this, the the light will be wrt the eye at XLIGHT, YLIGHT, ZLIGHT: Atteuatio = where d is the distace from the light to the poit beig lit // gllightfv( GL_LIGHT0, GL_POSITION, Array3(XLIGHT, YLIGHT, ZLIGHT) ); 4
5 // perform the rotatios ad scalig about the origi: glrotatef( Xrot,., 0., 0. ); glrotatef( Yrot, 0.,., 0. ); glscalef( Scale, Scale, Scale ); // if we do this, the the light will be wrt to the object at XLIGHT, YLIGHT, ZLIGHT: // gllightfv( GL_LIGHT0, GL_POSITION, Array3(XLIGHT, YLIGHT, ZLIGHT) ); // specify the shadig model: glshademodel( GL_SMOOTH ); // eable lightig: gleable( GL_LIGHTING ); gleable( GL_LIGHT0 ); // draw the objects:... You ca eable ad disable lightig at all. (This toggles betwee usig the lightig equatios say ad what glcolor3f( ) says You ca eable ad disable each light idepedetly It is usually good form to disable the lightig after you are doe usig it 5 Sidebar: Why are Light Positios 4-elemet arrays where the 4 th elemet is.0? Homogeeous Coordiates! float * Array3( float a, float b, float c ) static float array[4]; array[0] = a; array[] = b; array[] = c; array[3] =.; retur array; We usually thik of a 3D poit as beig represeted by a triple: (x,y,z). Usig homogeeous coordiates, we add a 4 th umber: (x,y,z,w) Graphics systems take (x,y,z,w) ad the divide x, y, ad z by w before usig them. x y z X, Y, Z w w w Thus (,,3,), (,4,6,), (-,-,-3,-) all represet the same 3D poit. 6 This Lets us Represet Poits at Ifiity 7 Additioal Parameters for Spotlights 8 This is useful to be able specify a parallel light source by placig the light source locatio at ifiity. The poit (,,3,) represets the 3D poit (,,3) The poit (,,3,.5) represets the 3D poit (,4,6) The poit (,,3,.0) represets the poit (00,00,300) So, (,,3,0) represets a poit at ifiity, but alog the ray from the origi through (,,3). gllightfv( GL_LIGHT0, GL_SPOT_DIRECTION, Array3(xdir,ydir,zdir) ) Specifies the spotlight-poitig directio. This gets trasformed by the curret value of the ModelView matrix. gllightf( GL_LIGHT0, GL_SPOT_EXPONENT, e ) Specifies the spotlight directioal itesity. This acts very much like the expoet i the specular lightig equatio. Poits-at-ifiity are used for parallel light sources ad some shadow algorithms gllightf( GL_LIGHT0, GL_SPOT_CUTOFF, deg ) Specifies the spotlight maximum spread agle. Shortcuts I Like void SetMaterial( float r, float g, float b, float shiiess ) glmaterialfv( GL_BACK, GL_EMISSION, Array3( 0., 0., 0. ) ); glmaterialfv( GL_BACK, GL_AMBIENT, MulArray3(.4f, White ) ); glmaterialfv( GL_BACK, GL_DIFFUSE, MulArray3(., White ) ); glmaterialfv( GL_BACK, GL_SPECULAR, Array3( 0., 0., 0. ) ); glmaterialf ( GL_BACK, GL_SHININESS,.f ); glmaterialfv( GL_FRONT, GL_EMISSION, Array3( 0., 0., 0. ) ); glmaterialfv( GL_FRONT, GL_AMBIENT, Array3( r, g, b ) ); glmaterialfv( GL_FRONT, GL_DIFFUSE, Array3( r, g, b ) ); glmaterialfv( GL_FRONT, GL_SPECULAR, MulArray3(.8f, White ) ); glmaterialf ( GL_FRONT, GL_SHININESS, shiiess ); Defiitio of GL_FRONT ad GL_BACK: Vertices are CCW whe GL_FRONT side viewed from the outside 0 GL_BACK side 9 Vertices are CW whe viewed from the outside Shortcuts I Like void SetPoitLight( it ilight, float x, float y, float z, float r, float g, float b ) gllightfv( ilight, GL_POSITION, Array3( x, y, z ) ); gllightfv( ilight, GL_AMBIENT, Array3( 0., 0., 0. ) ); gllightfv( ilight, GL_DIFFUSE, Array3( r, g, b ) ); gllightfv( ilight, GL_SPECULAR, Array3( r, g, b ) ); gllightf ( ilight, GL_CONSTANT_ATTENUATION,. ); gllightf ( ilight, GL_LINEAR_ATTENUATION, 0. ); gllightf ( ilight, GL_QUADRATIC_ATTENUATION, 0. ); gleable( ilight ); void SetSpotLight( it ilight, float x, float y, float z, float xdir, float ydir, float zdir, float r, float g, float b ) gllightfv( ilight, GL_POSITION, Array3( x, y, z ) ); gllightfv( ilight, GL_SPOT_DIRECTION, Array3(xdir,ydir,zdir) ); gllightf( ilight, GL_SPOT_EXPONENT,. ); gllightf( ilight, GL_SPOT_CUTOFF, 45. ); gllightfv( ilight, GL_AMBIENT, Array3( 0., 0., 0. ) ); gllightfv( ilight, GL_DIFFUSE, Array3( r, g, b ) ); gllightfv( ilight, GL_SPECULAR, Array3( r, g, b ) ); gllightf ( ilight, GL_CONSTANT_ATTENUATION,. ); gllightf ( ilight, GL_LINEAR_ATTENUATION, 0. ); gllightf ( ilight, GL_QUADRATIC_ATTENUATION, 0. ); gleable( ilight ); Computer Graphics 30 5
6 Sidebar: Note that we are computig the light itesity at each vertex 3 first, ad the iterpolatig that itesity across the polygo secod That is, you are oly usig the lightig model at each vertex. You ca do a eve better job if you iterpolate the ormal across the polygo first, ad the compute the light itesity with the lightig model at each fragmet secod: But, for that you will eed the Shaders course (CS 457/557) 3 Per-vertex Per-fragmet Per-vertex Per-fragmet Sidebar: Smooth Shadig ca also iterpolate vertex colors, 33 ot just the results of the lightig model Flat glshademodel( GL_SMOOTH ); Smooth Shadig ca also iterpolate vertex colors, ot just the results of the lightig model This is especially useful whe usig colors for scietific visualizatio: 34 glbegi(gl_triangles ); glcolor3f( r0, g0, b0 ); glvertex3f( x, y, z ); Smooth Tricky Lightig Situatios 35 Tricky Lightig Situatios 36 Watch for these i movies! Notice the lightig i the fur! Feathers Hair Fur Disey 6
Computer Graphics Lighting
Lighting 1 Mike Bailey mjb@cs.oregonstate.edu This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License Lighting.pptx Why Do We Care About Lighting?
More informationComputer Graphics Lighting. Why Do We Care About Lighting?
Lighting 1 Mike Bailey mjb@cs.oregonstate.edu This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License Lighting.pptx Why Do We Care About Lighting?
More informationAmbient 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
More informationLighting 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 informationNormals. 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 informationAssigning colour to pixels or fragments. Modelling Illumination. We shall see how it is done in a rasterization model. CS475/CS675 - Lecture 14
- 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
More informationINF3320 Computer Graphics and Discrete Geometry
INF3320 Computer Graphics and Discrete Geometry Visual appearance Christopher Dyken and Martin Reimers 23.09.2009 Page 1 Visual appearance Real Time Rendering: Chapter 5 Light Sources and materials Shading
More informationComputer 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 informationOpenGL 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 informationAPI for creating a display window and using keyboard/mouse interations. See RayWindow.cpp to see how these are used for Assignment3
OpenGL Introduction Introduction OpenGL OpenGL is an API for computer graphics. Hardware-independent Windowing or getting input is not included in the API Low-level Only knows about triangles (kind of,
More informationLight 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
More informationLighting. CSC 7443: Scientific Information Visualization
Lighting Why Lighting? What light source is used and how the object response to the light makes difference Ocean looks bright bluish green in sunny day but dim gray green in cloudy day Lighting gives you
More informationCS Computer Graphics: Illumination and Shading I
CS 543 - Computer Graphics: Illumination and Shading I by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Illumination and Shading Problem: Model light/surface point interactions to determine
More informationCS Computer Graphics: Illumination and Shading I
CS 543 - Computer Graphics: Illumination and Shading I by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Illumination and Shading Problem: Model light/surface point interactions to determine
More informationIllumination and Shading
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
More informationToday s class. Simple shadows Shading Lighting in OpenGL. Informationsteknologi. Wednesday, November 21, 2007 Computer Graphics - Class 10 1
Today s class Simple shadows Shading Lighting in OpenGL Wednesday, November 21, 27 Computer Graphics - Class 1 1 Simple shadows Simple shadows can be gotten by using projection matrices Consider a light
More informationShading and Illumination
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ω
More informationLecture 4 Advanced Computer Graphics (CS & SE )
Lecture 4 Advanced Computer Graphics (CS & SE 233.420) Topics Covered Animation Matrices Viewing Lighting Animating Interactive Programs Consider planet.c Want to animate rotating the Earth around the
More informationThree-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
More informationIllumination Model. The governing principles for computing the. Apply the lighting model at a set of points across the entire surface.
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
More informationWhy we need shading?
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
More informationCS Surface Rendering
CS10101001 Surface Rendering Junqiao Zhao 赵君峤 Department of Computer Science and Technology College of Electronics and Information Engineering Tongji University Surface rendering How do we choose a color
More informationOverview. Shading. Shading. Why we need shading. Shading Light-material interactions Phong model Shading polygons Shading in OpenGL
Overview Shading Shading Light-material interactions Phong model Shading polygons Shading in OpenGL Why we need shading Suppose we build a model of a sphere using many polygons and color it with glcolor.
More informationThe 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 informationPattern 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 information27 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 informationGraphics and Visualization
International University Bremen Spring Semester 2006 Recap Hierarchical Modeling Perspective vs Parallel Projection Representing solid objects Displaying Wireframe models is easy from a computational
More informationVirtual Reality for Human Computer Interaction
Virtual Reality for Human Computer Interaction Appearance: Lighting Representation of Light and Color Representation of Light and Color Do we need to represent all I! to represent a color C(I)? Representation
More informationCEng 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
More informationLights, 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
More informationDisplay Issues Week 5
CS 432/637 INTERACTIVE COMPUTER GRAPHICS Display Issues Week 5 David Breen Department of Computer Science Drexel University Based on material from Ed Angel, University of New Mexico Objectives Consider
More informationAlpha 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 informationPractical 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 informationCOMP 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蔡侑庭 (Yu-Ting Tsai) National Chiao Tung University, Taiwan. Prof. Wen-Chieh Lin s CG Slides OpenGL 2.1 Specification
蔡侑庭 (Yu-Ting Tsai) Department of Computer Science National Chiao Tung University, Taiwan Prof. Wen-Chieh Lin s CG Slides OpenGL 2.1 Specification OpenGL Programming Guide, Chap. 5 2 http://caig.cs.nctu.edu.tw/course/cg2007/files
More informationComputer 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 informationComputer 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 informationReading. Shading. Introduction. An abundance of photons. Required: Angel , Optional: OpenGL red book, chapter 5.
Reading Required: Angel 6.1-6.5, 6.7-6.8 Optional: Shading OpenGL red book, chapter 5. 1 2 Introduction So far, we ve talked exclusively about geometry. What is the shape of an obect? How do I place it
More informationIllumination / 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 informationComputer 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 informationCS 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 informationMath Section 2.2 Polynomial Functions
Math 1330 - Sectio. Polyomial Fuctios Our objectives i workig with polyomial fuctios will be, first, to gather iformatio about the graph of the fuctio ad, secod, to use that iformatio to geerate a reasoably
More informationOrientation. Orientation 10/28/15
Orietatio Orietatio We will defie orietatio to mea a object s istataeous rotatioal cofiguratio Thik of it as the rotatioal equivalet of positio 1 Represetig Positios Cartesia coordiates (x,y,z) are a easy
More informationIntMu.Lab5. Download all the files available from
IntMu.Lab5 0. Download all the files available from http://www.dee.isep.ipp.pt/~jml/intmu/lab5: wget http://www.dee.isep.ipp.pt/~jml/intmu/lab5/makefile make getall Analyze the program windmill.c. Compile
More informationIMP: 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 informationParabolic Path to a Best Best-Fit Line:
Studet Activity : Fidig the Least Squares Regressio Lie By Explorig the Relatioship betwee Slope ad Residuals Objective: How does oe determie a best best-fit lie for a set of data? Eyeballig it may be
More informationLecture 7 7 Refraction and Snell s Law Reading Assignment: Read Kipnis Chapter 4 Refraction of Light, Section III, IV
Lecture 7 7 Refractio ad Sell s Law Readig Assigmet: Read Kipis Chapter 4 Refractio of Light, Sectio III, IV 7. History I Eglish-speakig coutries, the law of refractio is kow as Sell s Law, after the Dutch
More informationLecture 1: Introduction and Strassen s Algorithm
5-750: Graduate Algorithms Jauary 7, 08 Lecture : Itroductio ad Strasse s Algorithm Lecturer: Gary Miller Scribe: Robert Parker Itroductio Machie models I this class, we will primarily use the Radom Access
More informationRendering. 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 informationRealtime 3D Computer Graphics & Virtual Reality. Shading and Color. Introduction to Lighting and Shading
Realtime 3D Computer Graphics & Virtual Reality Shading and Color Introduction to Lighting and Shading Illumination models express how light affects a surface s color at a given point. Shading models use
More informationReading. Shading. An abundance of photons. Introduction. Required: Angel , 6.5, Optional: Angel 6.4 OpenGL red book, chapter 5.
Reading Required: Angel 6.1-6.3, 6.5, 6.7-6.8 Optional: Shading Angel 6.4 OpenGL red book, chapter 5. 1 2 Introduction An abundance of photons So far, we ve talked exclusively about geometry. Properly
More informationParametric 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 informationUnderstand how real-world lighting conditions are approximated by OpenGL
OpenGL Programming Guide (Addison-Wesley Publishing Company) Chapter 5 Lighting Chapter Objectives After reading this chapter, you ll be able to do the following: Understand how real-world lighting conditions
More informationChapter 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 informationA 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 informationLight Transport Baoquan Chen 2017
Light Transport 1 Physics of Light and Color It s all electromagnetic (EM) radiation Different colors correspond to radiation of different wavelengths Intensity of each wavelength specified by amplitude
More informationIntro to Scientific Computing: Solutions
Itro to Scietific Computig: Solutios Dr. David M. Goulet. How may steps does it take to separate 3 objects ito groups of 4? We start with 5 objects ad apply 3 steps of the algorithm to reduce the pile
More informationLigh%ng and Shading. Ligh%ng and Shading. q Is this a plate or a ball? q What color should I set for each pixel?
Ligh%ng and Shading Ligh%ng and Shading Is this a plate or a ball? What color should I set for each pixel? 1 Physical Reality As light hits the surface: Part is absorbed Part is reflected Visible light
More informationLight 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 informationTexture 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 informationMethodology 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
More informationUNIT 7 LIGHTING AND SHADING. 1. Explain phong lighting model. Indicate the advantages and disadvantages. (Jun2012) 10M
UNIT 7 LIGHTING AND SHADING 1. Explain phong lighting model. Indicate the advantages and disadvantages. (Jun2012) 10M Ans: Phong developed a simple model that can be computed rapidly It considers three
More informationEECS 442 Computer vision. Multiple view geometry Affine structure from Motion
EECS 442 Computer visio Multiple view geometry Affie structure from Motio - Affie structure from motio problem - Algebraic methods - Factorizatio methods Readig: [HZ] Chapters: 6,4,8 [FP] Chapter: 2 Some
More informationPhysics 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 informationIllumination and Shading ECE 567
Illumination and Shading ECE 567 Overview Lighting Models Ambient light Diffuse light Specular light Shading Models Flat shading Gouraud shading Phong shading OpenGL 2 Introduction To add realism to drawings
More informationChapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved.
Chapter 9 Poiters ad Dyamic Arrays Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 9.1 Poiters 9.2 Dyamic Arrays Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Slide 9-3
More informationCS 683: Advanced Design and Analysis of Algorithms
CS 683: Advaced Desig ad Aalysis of Algorithms Lecture 6, February 1, 2008 Lecturer: Joh Hopcroft Scribes: Shaomei Wu, Etha Feldma February 7, 2008 1 Threshold for k CNF Satisfiability I the previous lecture,
More informationThe number n of subintervals times the length h of subintervals gives length of interval (b-a).
Simulator with MadMath Kit: Riema Sums (Teacher s pages) I your kit: 1. GeoGebra file: Ready-to-use projector sized simulator: RiemaSumMM.ggb 2. RiemaSumMM.pdf (this file) ad RiemaSumMMEd.pdf (educator's
More informationEECS 442 Computer vision. Multiple view geometry Affine structure from Motion
EECS 442 Computer visio Multiple view geometry Affie structure from Motio - Affie structure from motio problem - Algebraic methods - Factorizatio methods Readig: [HZ] Chapters: 6,4,8 [FP] Chapter: 2 Some
More informationFundamentals of Computer Graphics Lecture 7 Visual realism Part 1: Lighting and rendering Yong-Jin Liu liuyongjin@tsinghua.edu.cn Material by S.M.Lea (UNC) Visual Realism Requirements Light Sources Materials
More informationApparent 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 informationEigenimages. 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 informationThe isoperimetric problem on the hypercube
The isoperimetric problem o the hypercube Prepared by: Steve Butler November 2, 2005 1 The isoperimetric problem We will cosider the -dimesioal hypercube Q Recall that the hypercube Q is a graph whose
More information5.2 Shading in OpenGL
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:
More informationCSC 220: Computer Organization Unit 11 Basic Computer Organization and Design
College of Computer ad Iformatio Scieces Departmet of Computer Sciece CSC 220: Computer Orgaizatio Uit 11 Basic Computer Orgaizatio ad Desig 1 For the rest of the semester, we ll focus o computer architecture:
More informationShading. Brian Curless CSE 457 Spring 2015
Shading Brian Curless CSE 457 Spring 2015 1 Reading Required: Angel chapter 5. Optional: OpenGL red book, chapter 5. 2 Basic 3D graphics With affine matrices, we can now transform virtual 3D objects in
More informationShading in OpenGL. Outline. Defining and Maintaining Normals. Normalization. Enabling Lighting and Lights. Outline
CSCI 420 Computer Graphics Lecture 10 Shading in OpenGL Normal Vectors in OpenGL Polygonal Shading Light Source in OpenGL Material Properties in OpenGL Approximating a Sphere [Angel Ch. 6.5-6.9] Jernej
More informationIllumination & Shading I
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
More informationLighting. Chapter 5. Chapter Objectives. After reading this chapter, you'll be able to do the following:
Chapter 5 Lighting Chapter Objectives After reading this chapter, you'll be able to do the following: Understand how real-world lighting conditions are approximated by OpenGL Render illuminated objects
More informationA Taste of Maya. Character Setup
This tutorial goes through the steps to add aimatio cotrols to a previously modeled character. The character i the scee below is wearig clothes made with Cloth ad the sceery has bee created with Pait Effects.
More informationThe Graphs of Polynomial Functions
Sectio 4.3 The Graphs of Polyomial Fuctios Objective 1: Uderstadig the Defiitio of a Polyomial Fuctio Defiitio Polyomial Fuctio 1 2 The fuctio ax a 1x a 2x a1x a0 is a polyomial fuctio of degree where
More informationChapter 3. Floating Point Arithmetic
COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Iterface 5 th Editio Chapter 3 Floatig Poit Arithmetic Review - Multiplicatio 0 1 1 0 = 6 multiplicad 32-bit ALU shift product right multiplier add
More informationTransitioning to BGP
Trasitioig to BGP ISP Workshops These materials are licesed uder the Creative Commos Attributio-NoCommercial 4.0 Iteratioal licese (http://creativecommos.org/liceses/by-c/4.0/) Last updated 24 th April
More informationAccuracy Improvement in Camera Calibration
Accuracy Improvemet i Camera Calibratio FaJie L Qi Zag ad Reihard Klette CITR, Computer Sciece Departmet The Uiversity of Aucklad Tamaki Campus, Aucklad, New Zealad fli006, qza001@ec.aucklad.ac.z r.klette@aucklad.ac.z
More informationThe Closest Line to a Data Set in the Plane. David Gurney Southeastern Louisiana University Hammond, Louisiana
The Closest Lie to a Data Set i the Plae David Gurey Southeaster Louisiaa Uiversity Hammod, Louisiaa ABSTRACT This paper looks at three differet measures of distace betwee a lie ad a data set i the plae:
More informationLecture 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 informationShading. CSE 457 Winter 2015
Shading CSE 457 Winter 2015 Reading Required: Angel chapter 5. Optional: OpenGL red book, chapter 5. 2 Basic 3D graphics With affine matrices, we can now transform virtual 3D objects in their local coordinate
More information// double buffering and RGB glutinitdisplaymode(glut_double GLUT_RGBA); // your own initializations
#include int main(int argc, char** argv) { glutinit(&argc, argv); Typical OpenGL/GLUT Main Program // GLUT, GLU, and OpenGL defs // program arguments // initialize glut and gl // double buffering
More informationEVALUATION OF TRIGONOMETRIC FUNCTIONS
EVALUATION OF TRIGONOMETRIC FUNCTIONS Whe first exposed to trigoometric fuctios i high school studets are expected to memorize the values of the trigoometric fuctios of sie cosie taget for the special
More informationLighting/Shading III. Week 7, Wed Mar 3
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Lighting/Shading III Week 7, Wed Mar 3 http://www.ugrad.cs.ubc.ca/~cs314/vjan2010 reminders News don't need to tell
More informationCS 148, Summer 2012 Introduction to Computer Graphics and Imaging
http://www.ann.jussieu.fr/~frey/papers/scivi/cook%20r.l.,%20a%20reflectance%20model%20for%20computer%20graphics.pdf CS 148, Summer 2012 Introduction to Computer Graphics and Imaging f(~v 2 ) A 3 A 1 f(~v
More informationOutline. Other Graphics Technology. OpenGL Background and History. Platform Specifics. The Drawing Process
Outline 433-380 Graphics and Computation Introduction to OpenGL OpenGL Background and History Other Graphics Technology Drawing Viewing and Transformation Lighting GLUT Resources Some images in these slides
More informationGraphics and Computation Introduction to OpenGL
433-380 Graphics and Computation Introduction to OpenGL Some images in these slides are taken from The OpenGL Programming Manual, which is copyright Addison Wesley and the OpenGL Architecture Review Board.
More informationSurface Rendering Methods
Surface Rendering Methods 6 th Week, 2008 Sun-Jeong Kim Polygon Rendering Methods Determining the surface intensity at every projected pixel position using an illumination model Light-material interactions
More informationBezier 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 informationChapter 3. Illumination Models and Surface-Rendering Methods. Department of Computer Science and Engineering
Chapter 3 Illumination Models and Surface-Rendering Methods 3-1 3.1 Overview For a realistic display of a scene the lighting effects should appear naturally. An illumination model, also called a lighting
More informationImage Segmentation EEE 508
Image Segmetatio Objective: to determie (etract) object boudaries. It is a process of partitioig a image ito distict regios by groupig together eighborig piels based o some predefied similarity criterio.
More informationBasic 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 informationVision & Perception. Simple model: simple reflectance/illumination model. image: x(n 1,n 2 )=i(n 1,n 2 )r(n 1,n 2 ) 0 < r(n 1,n 2 ) < 1
Visio & Perceptio Simple model: simple reflectace/illumiatio model Eye illumiatio source i( 1, 2 ) image: x( 1, 2 )=i( 1, 2 )r( 1, 2 ) reflectace term r( 1, 2 ) where 0 < i( 1, 2 ) < 0 < r( 1, 2 ) < 1
More informationUsing VTR Emulation on Avid Systems
Usig VTR Emulatio o Avid Systems VTR emulatio allows you to cotrol a sequece loaded i the Record moitor from a edit cotroller for playback i the edit room alog with other sources. I this sceario the edit
More information