3. Computer Graphics Sungmin Kim http://latam.jnu.ac.kr Computer Graphics Definition Introduction Research field related to the activities that includes graphics as input and output Importance Interactive shape manipulations plays a major role in CAD/CAM/CAE Computer graphics is an essential part of CAD/CAM/CAE software Graphics programming Device drivers A set of machine dependent codes that directly controls the DPU Graphics libraries A set of subroutines for specific purposes 1
Introduction History CORE SIGGRAPH (Special Interest Group on Computer Graphics) on ACM (Association for Computing Machinery) Limited support for existing devices GKS GKS-3D ISO (International Standards Organization) Standard for 2-D and 3-D graphics PHIGS PEX ISO Standard graphics library for workstations OpenGL Silicon Graphics De facto standard Raster Graphics Pixel (Picture Element) based 2-D Graphics Bitmap structure Independent processing regardless of scene complexity Suitable for detailed expression Scaling or rotation may cause quality degradation BMP, GIF, JPG, TIF, PCX,... 2
2-D Graphics Vector Graphics Coordinate system based Vector calculus Processing time depends on scene complexity Difficult to express details of an object Non-destructive scaling and rotation DXF, IGES, WMF, AI,... Volume Graphics Voxel (volume element) based 3-D Graphics Space division method Independent processing with scene complexity Hardware acceleration method has not been established Used for medical applications http://www.nlm.nih.gov/research/visible/animations.html 3
3-D Graphics Surface Graphics Based on geometric primitives Uses polygonal mesh, B-Spline, or NURBS (Non Uniform Rational B-Spline), etc. Processing speed depends on scene complexity Easy for hardware acceleration Used for most computer graphics applications Hybrid application with raster graphics Objects Representation Parametric surface Define surface by parametric function f(u,v) : R 2 R 3 For example, a sphere can be defined as below 4
Objects Representation (Cont d) Polygonal mesh Collection of triangular elements (vertices + edges) face normal vector Object Preparation Modeling packages 3D Studio Max Maya SoftImage LightWave 3D scan data RapidForm 5
Lighting Importance Lighting enhances the reality of scene Realistic appearance may be a crucial factor for specific application Difficulties Effects of various light sources and colors Sun, fire, light bulb,... Effects of material surface property and color Shiny, dull,... Lighting (Cont d) Light sources Directional (Parallel) Point Spot (Specular) Ambient (Incident) 6
Lighting (Cont d) Ambient lighting Effect of indirect lighting Realization of color Diffuse lighting Shading effect Specular lighting Creating highlights Shading Evaluation of lighting equation Calculate for each vertex on the mesh Interpolate for the rest of the mesh Type Flat shading Gouraudshading Phong shading Flat Shading 7
Shading (Cont d) Gouraud shading Evaluate color at each vertex Interpolate the color of interior points Interpolate Color Shading (Cont d) Phong shading Interpolate normal vectors for interior points Evaluate lighting equation for each point More accurate shading Realization of specular light (highlight) Interpolate Normal 8
Texture Mapping Importance Enhance visual quality of object without increasing scene complexity Procedure Prepare 2D texture image Assign texture coordinates to each vertex Rendering Global lighting (Illumination) Color is determined by multiple interactions among light sources and reflective surfaces Recursive reflection of light between surfaces accounts for subtle shading Type Ray casting Ray tracing 9
Rendering (Cont d) Ray tracing Rendering technique that mimics physical processes of light Extremely intensive computation Transparency Refraction and reflection Lighting and shadow References 10