DOC PREVIEW
UTK CS 594 - Illumination and Shading

This preview shows page 1-2-3-24-25-26-27-49-50-51 out of 51 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 51 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Illumination and ShadingIllumination Vs. ShadingIllumination (Lighting) ModelGlobal IlluminationLocal illuminationBasic Illumination ModelAmbient light (background light)Ambient LightDiffuse LightLambert’s LawThe Diffuse ComponentPowerPoint PresentationSpecular LightPhong’s Model for SpecularSlide 15Slide 16Slide 17Half VectorSlide 19Putting It All TogetherMultiple Light SourceSlide 22Slide 23Slide 24Constant ShadingSlide 26Slide 27Slide 28Polygon Mesh ShadingSlide 30Smooth ShadingGouraud ShadingLinear InterpolationLinear Interpolation in a TriangleSlide 35Slide 36Slide 37Slide 38Slide 39Slide 40Slide 41Slide 42Slide 43Light SourcesSpot LightSlide 46Light Source AttenuationMore on Homogeneous CoordinatesTransforming NormalsSlide 50Slide 51Illumination and ShadingJian Huang, CS594, Fall 2001This set of slides reference slides used at Ohio State for instruction by Prof. Machiraju and Prof. Han-Wei Shen.Illumination Vs. ShadingIllumination (lighting) model: determine the color of a surface point by simulating some light attributes.Shading model: applies the illumination models at a set of points and colors the whole image.Illumination (Lighting) Model•To model the interaction of light with surfaces to determine the final color & brightness of the surface–Global illumination–Local illuminationGlobal Illumination•Global Illumination models: take into account the interaction of light from all the surfaces in the scene. (will cover under the Radiosity section)Local illumination•Only consider the light, the observer position, and the object material propertiesBasic Illumination Model•Simple and fast method for calculating surface intensity at a given point•Lighting calculation are based on:–The background lighting conditions–The light source specification: color, position–Optical properties of surfaces: •Glossy OR matte•Opaque OR transparent (control refection and absorption)Ambient light (background light)•The light that is the result from the light reflecting off other surfaces in the environment•A general level of brightness for a scene that is independent of the light positions or surface directions -> ambient light•Has no direction•Each light source has an ambient light contribution, Ia•For a given surface, we can specify how much ambient light the surface can reflect using an ambient reflection coefficient : Ka (0 < Ka < 1)Ambient Light•So the amount of light that the surface reflect is thereforeIamb = Ka * IaDiffuse Light•The illumination that a surface receives from a light source and reflects equally in all directions•This type of reflection is called Lambertian Reflection (thus, Lambertian surfaces)•The brightness of the surface is indepenent of the observer position (since the light is reflected in all direction equally)Lambert’s Law•How much light the surface receives from a light source depends on the angle between its angle and the vector from the surface point to the light (light vector)•Lambert’s law: the radiant energy ’Id’ from a small surface da for a given light source is: Id = IL * cos )IL : the intensity of the light sourceis the angle between the surface normal (N) and light vector (L)The Diffuse Component•Surface’s material property: assuming that the surface can reflect Kd (0<Kd<1), diffuse reflection coefficient) amount of diffuse light: Idiff = Kd * IL * cos)If N and L are normalized, cos) = N*LIdiff = Kd * IL * (N*L)•The total diffuse reflection = ambient + diffuseIdiff = Ka * Ia + Kd * IL * (N*L)ExamplesSphere diffusely lighted from various angles !Specular LightThese are the bright spots on objects (such as polished metal, apple ...)Light reflected from the surface unequally to all directions.The result of near total reflection of the incident light in a concentrated region around the specular reflection anglePhong’s Model for Specular•How much reflection light you can see depends on where you arePhong Illumination CurvesSpecular exponents are much larger than 1;Values of 100 are not uncommon.n: glossiness, rate of falloffSpecular Highlights•Shiny surfaces change appearance when viewpoint is changed•Specularities are caused by microscopically smooth surfaces.•A mirror is a perfect specular reflectorReflected Ray LNRVLN(N•L)Project L onto NL2N(N•L)Double length of vectorLR = 2N(N•L) - LSubtract LHow to calculate R? R + L = 2(N*L) NR = 2(N*L) N - LHalf Vector•An alternative way of computing phong lighting is: Is = ks * Is * (N*H)n •H (halfway vector): halfway between V and L: (V+L)/2•Fuzzier highlightLNHVPhong IlluminationMoving LightChange nPutting It All Together•Single Light (white light source)Multiple Light Source•IL: light intensity•For multiple light sources–Repeat the diffuse and specular calculations for each light source–Add the components from all light sources–The ambient term contributes only once•The different reflectance coefficients can differ. –Simple “metal”: ks and kd share material color, –Simple plastic: ks is white•Remember, when cosine is negative lighting term is zero!OpenGL Materials GLfloat white8[] = {.8, .8, .8, 1.}, white2 = {.2,.2,.2,1.},black={0.,0.,0.}; GLfloat mat_shininess[] = {50.}; /* Phong exponent */ glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, black); glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, white8); glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, white2); glMaterialfv( GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);OpenGL Lighting GLfloat white[] = {1., 1., 1., 1.}; GLfloat light0_position[] = {1., 1., 5., 0.}; /* directional light (w=0) */ glLightfv(GL_LIGHT0, GL_POSITION, light0_position); glLightfv(GL_LIGHT0, GL_DIFFUSE, white); glLightfv(GL_LIGHT0, GL_SPECULAR, white); glEnable(GL_LIGHT0); glEnable(GL_NORMALIZE); /* normalize normal vectors */ glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);/* two-sided lighting*/ glEnable(GL_LIGHTING);Shading Models for Polygons Constant Shading (flat shading) Compute illumination at any one point on the surface. Use face or one normal from a pair of edges. Good for far away light and viewer or if facets approximate surface well. Per-Pixel Shading Compute illumination at e very point on the surface. Interpolated Shading Compute illumination at vertices and interpolate colorConstant Shading•Compute illumination only at one point on the surface•Okay to use if all


View Full Document

UTK CS 594 - Illumination and Shading

Documents in this Course
Load more
Download Illumination and Shading
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Illumination and Shading and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Illumination and Shading 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?