UTK CS 594 - Review 2 - Illumination, Shading, Texturing and Anti-aliasing

Unformatted text preview:

Review 2: Illumination, Shading, Texturing and Anti-aliasingIllumination Vs. ShadingLocal illuminationBasic Illumination ModelAmbient light (background light)Ambient LightDiffuse LightLambert’s LawThe Diffuse ComponentPowerPoint PresentationSpecular LightPhong’s Model for SpecularSlide 13Slide 14Slide 15Putting It All TogetherSlide 17Smooth ShadingGouraud ShadingSlide 20Slide 21Slide 22What Dreams May ComeHow to efficiently add graphics detail?Texture MappingSlide 26What is a Texture?RGB TexturesOpacity TexturesBump MappingDisplacement MappingTexture and Texel(u,v) tupleTwo-Stage MappingImage space scanSlide 36Inverse MappingTexture space scanSlide 39Slide 40Slide 41Slide 42SamplingSampling TheoremSampling and Anti-aliasingTwo possible solutionsQuality considerationsSlide 48Slide 49Summed Area Table (SAT)Slide 51Slide 52Slide 53Slide 54Review 2: Illumination, Shading, Texturing and Anti-aliasingJian Huang, CS594, Spring 2002Illumination 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.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 calculating 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 reflectorPhong IlluminationMoving LightChange nPutting It All Together•Single Light (white light source)Flat ShadingSmooth Shading•Need to have per-vertex normals•Gouraud Shading –Interpolate color across triangles–Fast, supported by most of the graphics accelerator cards•Phong Shading –Interpolate normals across triangles–More accurate, but slow. Not widely supported by hardwareGouraud Shading•Normals are computed at the polygon vertices•If we only have per-face normals, the normal at each vertex is the average of the normals of its adjacent faces•Intensity interpolation: linearly interpolate the pixel intensity (color) across a polygon surfaceGouraud ShadingPhong Shading Model Gouraud shading does not properly handle specular highlights, specially when the n parameter is large (small highlight).Reason: colors are interpolated.Solution: (Phong Shading Model)1. Compute averaged normal at vertices.2. Interpolate normals along edges and scan-lines. (component by component)3. Compute per-pixel illumination.Phong ShadingWhat Dreams May ComeHow to efficiently add graphics detail?•Solution - (its really a cheat!!)•How?MAP surface detail from a predefined (easy to model) table (“texture”) to a simple polygonTexture Mapping•Problem #1–Fitting a square peg in a round hole–We deal with non-linear transformations–Which parts map where?Texture Mapping•Problem #2–Mapping from a pixel to a “texel”–Aliasing is a huge problem!What is a Texture?•Given the (texture/image index) (u,v), want:–FF(u,v) ==> a continuous reconstruction•= { R(u,v), G(u,v), B(u,v) }•= { I(u,v) }•= { index(u,v) }•= { alpha(u,v) }•= { normals(u,v) }•= { surface_height(u,v) }•= ...RGB Textures•Places an image on the object•“Typical” texture mappingOpacity Textures•A binary mask, really redefines the geometry.Bump Mapping•This modifies the surface normals.•More on this later.Displacement Mapping•Modifies the surface position in the direction of the surface normal.Texture and Texel•Each pixel in a texture map is called a Texel•Each Texel is associated with a (u,v) 2D texture coordinate•The range of u, v is [0.0,1.0](u,v) tuple•For any (u,v) in the range of (0-1, 0-1), we can find the corresponding value in the texture using some interpolationTwo-Stage Mapping1. Model the mapping: (x,y,z) -> (u,v)2. Do the mappingImage space scanFor each yFor each xcompute u(x,y) and v(x,y)copy texture(u,v) to image(x,y)•Samples


View Full Document

UTK CS 594 - Review 2 - Illumination, Shading, Texturing and Anti-aliasing

Documents in this Course
Load more
Download Review 2 - Illumination, Shading, Texturing and Anti-aliasing
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 Review 2 - Illumination, Shading, Texturing and Anti-aliasing 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 Review 2 - Illumination, Shading, Texturing and Anti-aliasing 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?