1 / 19

Honours Graphics 2008

Honours Graphics 2008. Session 4. Today’s focus. Colors Vertex coloring Gourad and Phong lighting Problems with transparency. Colors. A great variety of color models exist, such as CIE XYZ, HUV, Lab, RGB, etc.

casey-booth
Download Presentation

Honours Graphics 2008

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Honours Graphics 2008 Session 4

  2. Today’s focus • Colors • Vertex coloring • Gourad and Phong lighting • Problems with transparency

  3. Colors • A great variety of color models exist, such as CIE XYZ, HUV, Lab, RGB, etc. • Stems from work that demonstrated that human eye senses three color spectrums, namely red, green and blue • Green appears brightest, while human eyes are most sensitive to variation in blue

  4. Colors, cont. • The premise of color spaces is the realization that a triplet of values is sufficient to uniquely describe a color • Computers normally make use of RGB color space – as it is simple and thus easily implementable in hardware

  5. RGB • In RGB each color is defined by three components that represent the red, green and blue weighting of the color • Typical for modern computers is making use of 8bits per color channel allowing for a 24bit description of color – equivalent to 2^24 = 16 777 216 distinct colors.

  6. RGB, cont. • In 24bit RGB each color component can vary in value between 0 and 255 • Imaging programs, and modern graphics hardware, typically normalize the colors to a range between 0 and 1 • This allows imaging and color computations independent of the color depth

  7. Vertex coloring • Both DirectX and OpenGL allow the specification of vertex coloring. The colors specified are then blended across the vertices

  8. Vertex coloring, cont. • When tris are textured, the result can be modulated with the computed vertex coloring

  9. Vertex coloring, cont. • Vertex coloring can be used in a variety of useful ways; such as implementing coarse shadows in terrain:

  10. Vertex coloring, cont. • Another example, particle systems may make use of generic white textures and color the particle using vertex coloring • Any continuous, area covering shading can be implemented in vertex colors, such as infra-red display

  11. Lighting models • Displaying an object with some degree of accuracy requires a convincing use of light and shadow • This in turn requires some underlying lighting model to approximate the behavior of light, such as the Gouraud and Phone lighting models Image curtesy wikipedia

  12. Gouraud • Henri Gouraud, published 1971 • Obtain vertex normals by averaging normal of polygons meeting at vertex • Compute lighting via Phong reflection • Bi-linear interpolation of color values at vertices • Essentially “free” in modern graphics hardware due to vertex coloring

  13. Phong • Bui Toung Phong, published 1973 • Distinguish between Phong illumination and Phong shading • Phong illumination (also reflection or lighting) describes a model for light reflectivity • Phong shading (or interpolation) is better approximation to lightning than Gouraud shading

  14. Phong illumination model • Describes reflections through ambient, diffuse and specular components Image curtesy wikipaedia

  15. Phong shading • Improves on Gouraud shading, instead of interpolating colors it interpolates normals which are then used with the Phong illumination model

  16. Transparency problem • Partial transparency is a useful tool for a wide variety of graphics effects (particle systems, windows, etc.) • A problem exists with transparency order though: if multiple transparent areas overlap, then the order in which they are rendered changes the result

  17. Transparency problem, cont. • The solution is to ensure they’re rendered from back to front • Hardware may eventually automate this

  18. Homework • Implement the ROAM terrain algori--- nah, I’m kidding, no homework today

More Related