Chapter 10 Computer Graphics Computer Graphics is the study of how to use computers to produce and manipulate visual (digital) data. Topics include: Understanding and manipulating “real” images Photographs, ads Creating and producing series of images Animation, movies Video games Outputting images Graphical output, such as graphs and charts GUIs Computer Graphics
Creation and processing of 2D images Creation (of 2D graphics) Converts shapes into patterns of pixels Image processing Analyzes images for patterns of pixels for enhancement, changes, etc. ex: Microsoft’s Paint for producing 2-dimensional images ex: Photoshop for eliminating red eye Computer Graphics
Three dimensional images 3D graphics Must first “create” three-dimensional images “photograph” the virtual world that is created Produce the image through large computational process Convert 3D “photograph” into 2-D image Research is ongoing for 3-dimensional graphics projector, 3-D GUI Image processing Enhancement, perhaps using A.I. Computer Graphics
3 steps in producing a 3D image Modeling Constructing/ building a scene from graphic data and algorithms Rendering Converting 3D scene to 2D representation Perspective projection Image window defines boundary of final image Displaying Converting to pixels, storing in frame buffer, display using graphics cards, typically real-time Computer Graphics
Modeling Lower or higher quality images depending on their use (foreground objects, for example, need high quality) Consider higher quality .jpg file depending on number of pixels used (resolution) Higher quality objects require longer rendering process Note: we do not convert to pixels until the very end, because pixels are not upwardly scalable Computer Graphics
Modeling Describe each object as a set of small connecting planar (2D) patches or polygons These polygons form a polygonal mesh to approximate the object Using more (smaller) polygons gives higher resolution Represent each polygon by an equation, perhaps a quadratic equation, if possible Or build physical model and digitize it by using a pen device to record points on the model Or, if too complex for either of the above (i.e., actual trees), write program to generate shape Computer Graphics
Rendering Light-Surface Interaction How light is reflected off an opaque surface Depends on nature of surface Light rays reflected over smooth surfaces (specular light) provide bright highlights Light rays, scattered (diffused) as they ricochet over jagged surfaces, are close to actual color Surfaces that are not exposed to direct light may be illuminated by scattered reflected rays Ambient light may result in uniform or mostly dark areas Computer Graphics
Light-Surface interaction Refraction with a transparent surface Light rays pass through the object Rays are bent (refracted) depending on refractive index of material Rendering software must know Refractive indexes of material Which side of object is inside or outside Is light entering or leaving the object Computer Graphics
Rendering Pipeline Clipping – picking those 3-D objects that you want from “view volume” Scan conversion or rasterization Vector graphics into pixels Projecting the clippings patched into pixel positions Hidden-surface removal Eliminating “background” surfaces Shading to make the 2-D rendering look like 3-D Computer Graphics
Graphics hardware Graphics cards or adapters attached to bus Accomplishes the steps in rendering pipeline Other devices see www.glassner.com/andrew/cg/graphics.htm Computer Graphics
GPUs and graphics hardware Multiple cores Accelerated Graphics Port or PCI-X Bus PCI -X Clock 66MHz - 133MHz Number of bits 64 Data per Clock Cycle 1, 2, 4 Maximum Transfer Rate 533MB/s to 4266MB/s Bus AGP (accelerated graphics port) Clock 66MHz Number of bits 32/ 64 Data per Clock Cycle 1-8 Maximum Transfer Rate 266MB/s- 2133MB/s to4266MB/s Computer Graphics