intro_gray - Computer Graphics (4190.410) ) 2008. 3. 4...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Computer Graphics (4190.410) ) 2008. 3. 4 Syllabus Instructor: yshin@cse.snu.ac.kr yshin@cse snu ac kr Office: 302-322 302Phone: 880-6757 880- Teaching assistant: (intellee@cglab.snu.ac.kr) Office: 138-217 138Phone: 888-9789 888- Syllabus Textbooks D. Hearn and M.P. Baker,Computer Graphics, 2nd Ed, Prentice Hall D. Hearn and M.P. Baker,Computer Graphics with OpenGL, 3rd edition, Prentice Hall Direct X Course material PrePre-requisites Knowledge on C++ programming This syllabus and all subsequent information on the course will be available using the WWW. The home page : http://cglab.snu.ac.kr/lectures/08http://cglab.snu.ac.kr/lectures/08-1/graphics ://cglab.snu.ac.kr/lectures/08 Syllabus The Th goal of this course l f thi Introduction to the theory and p y practice of computer graphics Grading policy Midterm Exam: 30% Final Exam: 40% Assignments (3 to 5): 30% Penalty for late assignments : 10% per day Covered Topics Week 1 Week 2 Week 3 Week 4 Week 5 Week 6 Week 7 Week 8 Week 9 Week 10 Week 11 Week 12 Week 13 Week 14 Graphics introduction Scan conversion and clipping Windows Programming I Sampling Windows Programming II 2D & 3D Geometric transformation 2D viewing DirectX : Creating a device and rendering vertices Modeling & 3D Viewing g g 3D viewing Mid-term exam Hidden surface removal DirectX : Using matrices Lighting and shading DirectX : Lighting Color Curve and surfaces Curve and surfaces DirectX : Texture Mapping GUI DirectX : Fixed and programmable pipeline Final exam Why we use images/pictures? "One picture is better than a thousand words" "O b h h d d " Vision is the most important sense of humans Humans communicate well with images What is Computer Graphics? Computer graphics generally means creation, storage creation and manipulation of models and images Such models come from diverse and expanding set of fields including physical, mathematical, artistic, biological, and even conceptual (abstract) structures g , p ( ) Image Processing & Computer Vision Digital Image Processing g g g Techniques to transform an image into a meaningful signal Image Analysis (Computer Vision) Extracting symbolic information from the image. Applications Showing photos, pictures Presenting information g Bar charts 60 50 40 30 20 10 0 1 2 3 4 5 12 10 8 6 4 2 1 2 3 4 5 Pie charts h 0 1 2 3 4 S3 S2 S1 5 Curves 0.6 0.5 0.4 0.3 0.2 0.1 0 -0.1 -0.2 -0.3 -0.4 1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97 Surfaces Weather charts Graphical user interface icons, frames labels fields text-area, buttons popicons frames, labels, fields, text-area buttons, pop-up manuals,... Synthesizing images Virtual idol (Reiko Arisugawa) Ray tracing images Animation films Games Flight simulators Virtual reality provides true 3-d scenes and interactions 3HeadHead-mounted display (HMD) A system for tracking the position of HMD Data l D t glove Augmented reality Video or optics superimposes computer-generated data computeron real world Industry (CAD) Computer A t C t Art Medical Application d l l Volume data How we get an 2D image from the volume data (Ray casting based Volume Visualization) Treat each pixel as a light source Emit light from the image to the object space Sampled values along the ray are accumulated Nonperspective Perspective Virtual Angioscopy AAA, Stent AAA St t-graft D i Stentft Design Brain Subtraction CT CT Registration of PET & MR images MR PET CT Gastroscopy CT Gastroscopy CT C l Colon How we get Computer Image Rendering is the conversion of a scene into an image Input Scene/mode l render 2D Image Scene is composed of a "model" of what we want model to draw draw. Models are composed of "primitives" supported by primitives the rendering systems like Direct X or OpenGL. Models entered by hand or created by a program Polygon Based Model yg Any object can be broken down into polygons Each polygon is represented by vertices Vertex - a point in 2 or 3 dimensional space. How we get Computer Image Input computation Output How we d H draw a rectangle in a image plane of a computer? t l i i l f t ? Pixel and resolution An image = a set of Pixels (Picture element) Dimensions of the screen SVGA(800 lines 600 pixels) li i l ) XVGA(1024768) XVGA(12801024) XVGA(1280 1024) Computation Stage Input rendering Output Now that we have a model of what we want to draw, what goes on inside the computer to generate the output? we need to compute the location of each pixel and its color Generate (photorealistic) images from scenes (using lighting and shading) rendering Transformations Rasterization Partition the P titi th space 1. Define a set of points f (vertices) in 2D space space. 2. Given a set of vertices, ti draw lines between consecutive e t ces vertices. (7,9) (14,9) (7,3) (14,3) Find corresponding pixels Decide pixels on which each line locates Save the results of pixel values 000000000000000000000 000000011111111000000 000000010000001000000 000000010000001000000 000000010000001000000 000000011111111000000 000000000000000000000 000000000000000000000 Frame buffer Frame buffer a kind of memory with screen size Locates on graphics card Each pixel contains the color and/or transparency Output Input rendering Output We have an image (frame buffer or model), now we want to show it. Hardcopy (p int) Ha d op (print) Display p y Vector Raster Scan Frame buffer Monitor The values in the frame buffer are converted from a digital (1s and 0s representation, the bits) to an analog signal g that goes out to the monitor. A graphics card performs this operation, once per frame. This is done automatically ( y (not controlled by your code), yy ), and the conversion can be done while writing to the frame buffer. Frame buffer Monitor Display Monitor Raster Cathode Ray Tube(CRT) is the most common display device High Hi h resolution l ti Good color fidelity High Contrast (100:1) High update rates Color CRT (3 guns: Red, Green and Blue) 1 pixel Liquid Crystal Display(LCD) becomes more popular Flat panels Flicker free Decreased viewing angle Polarizers Light passes through Light is blocked Graphics rendering pipeline Coordinate Representation MCS: M d li C di t S t MCS Modeling Coordinate System. WCS: World Coordinate System. CS o d Coo d ate Syste VCS: Viewer Coordinate System. NDCS: Normalized Device Coordinate CS l d C d System. DCS or SCS: Device Coordinate System or Screen Coordinate System System. Rendering primitives Models { M d l = {geometric primitives} ti i iti } Rendering primitives directly supported in H/W include Points (pixels) (p ) Line segments Polygons (triangles) yg ( g ) Modeling primitives include these, but also Piecewise polynomial curves/surfaces Implicit surfaces Voxels .... Basic rendering algorithms Transformation : transform coordinates Clipping/Hidden surface removal Rasterization : convert a projected screenscreenspace primitive to a set of pixels i ii f i l Picking : select a 3D/2D object by clicking an input device over a pixel location Shading and illumination Animation Functions of a Graphic Package Graphics Library such as OpenGL, DirectX G hi Lib h O GL Di tX Provide primitives for graphic description p g p p Build and maintain graphic representation model Provide primitives for viewing operations use available H/W to perform such operations, if possible perform viewing operations not possible at H/W Support user i t S t interaction with application ti ith li ti program Interact directly with users to allow them modify gp , p viewing parameters, if possible Graphics System API CGI (Computer Graphics Interface) Graphics system: a library of graphics functions Graphics S/W Packages How you use a G hi package H Graphics k Application programmer s view programmer's vs. Package implementer's view Application G hi P k A li ti Graphics Packages Designed for nonprogrammer g p g Users can generate displays without worrying about how graphics operations work E.g., PowerPoint E g PowerPoint, Medical software, CAD software CAD, Postscript General Graphics Packages S/W evolution devicedevice-dependent s/w device-independent s/w device standard s/w Official Standards Core: ACM SIGGRAPH 1977, U.S. GKS : ANSI85, 2D, Europe GKSGKS-3D : ANSI88 PHIGS : ANSI88 - Hierarchical structures PHIGS+ : ISO 92 NonNon-official Standards X Window System, PEX Silicon Graphics OpenGL (1992) MicroSoft DirectX Sun Mircorsystems VRML Vector and Raster Early displays were vector displays: a list of line endpoints was used to move the electron beam along some random path, a so-called vector scan. soRaster displays (TVs etc) drive the beam in a regular pattern called a raster scan. Vector displays are almost extinct. p y Scan conversion: convert geometric primitives from conversion: vector scan descriptions (endpoints etc.) to raster scan descriptions (sets of pixels to turn on.) Frame buffers The picture drawn by a raster or bitmapped display is stored in memory as a 2-D array of pixels. The 2-D array of pixel values 22is ll d frame b ff i called a f buffer. (F (Frame buffer, refresh buffer, raster, b ff f h b ff t bitmap are used interchangeably.) Each row of pixels is called a scan-line or a raster line scanFrame buffer can be peripheral to the host or resident as part of the host computer's address space. p p The video hardware continuously scans the frame buffer. Types of display B&W displays: 1 bit/pixel (bitmap). Basic color displays: 8, 15, 16, or 24 bits. HighHigh-end displays: 96 or more bits. FullFull-color (RGB) displays For 24 bit color: store 8 bits each of red, green, and blue per pixel. E.g. (255,0,0) is pure red, and (255, 255, 255) is white. 2^24 = 16 million colors. 2 24 colors The video hardware uses the values to drive the R,G, and B guns. CLUT(Color Lookup table) A single number (e.g. 8 bits) stored at each pixel (e g pixel. Used as an index into an array of RGB triples. With 8 bits per pixel, you can get the 256 colors of your choice (except that the window system will probably reserve some). Simple things to fill up color-maps with: A grey ramp (for grey scale pictures) A bunch of random colors (for color drawings.) Deeper Frame Buffers Some frame buffers have 96 or more bits per pixel. What are they all for? We start with 24 bits for RGB. Alpha channel: an extra 8 bits per pixel, to represent pixel "transparency." Used for digital compositing. That's 32 bits. A Z-buffer, used to hold a "depth" value for each pixel. Used for Z, p p hidden surface 3-D drawing. 16 bits/pixel of "z" brings the total to 348 bits. Double buffering: For clean-looking flicker-free real time animation. cleanflickerTwo full frame buffers (including alpha and z). Only one at a time is visible--you can toggle instantly. visible-- Draw into the "back buffer" (invisible), then swap. Can be faked with off-screen bitmaps (slower ) off(slower.) 2 x 48 = 96. Display Resolution Spatial resolution: The maximum number of points that can be displayed without overlap on a CRT. Higher resolution gives a shaper image Intensity or color resolution depends on y p frame buffer resolution display H/W characteristics sampling method Raster CRT Display Dynamic display which means that the d sp ay eeds display needs to be refreshed in o de to e es ed order keep a pattern being displayed. Refreshing should be the responsibility of the device: buffer memory (frame buffer) a dedicated processor, called video controller, p , controller, constantly copies color intensity values from the frame buffer onto screen, scanline by scanline. Such a process is called refresh. Refresh rate = # of refreshes per second p Raster graphics system with a display processor Interlacing Lower refresh rates result in flickering, which is L f h t lt i fli k i hi h i the visually discernible disruption of light intensity on screen. An acceptable refresh rate is determined by the acuity of the human vision. Refresh rate must be matched with the excitement persistence of phosphor coating coating. Interlacing a usual frame display rate : 60 Hz divide a frame into even-numbered scan lines and evenoddodd-numbered scan-lines(each 1/60 sec) scan whole frame takes 1/60 + 1/60 = 1/30 sec Graphics Processor Graphics Adapter: frame buffer + display ( p yp ) controller (+ display processor) (e.g., VGA, XGA card) Common functions of display processor include Z-buffer for visible surface determination; line drawing; clipping; texture mapping; ... Graphics Hardware Graphics hardware is used on most PCs now p Dedicated hardware 2D and 3D graphics processing unit (GPU) nVIDIA : GeForce series (latest: GeForce 8800) ( ) ATI : Radeon series (latest: Radeon HD2900) GPU's highly parallel structure : up to 320 stream processors Graphics H d G hi Hardware (DirectX 9) (Di tX GPU Front End Primitive Assembly Rasterization and Interpolation Raster Operations Programmable Vertex Processor Programmable Fragment Processor texture Vertices Primitives Fragments g Pixels Why GPU? Computational power exceeds CPU C t ti l d CPU : 32.5GFlops, 17GB/s peak memory bandwidth GPU : 518.4GFlops, 35.2GB/s peak memory bandwidth GPUs are getting faster g g CPUs: annual growth 1.4 1.4 decade growth : 60 g 60 GPUs: annual growth > 2.3 2.3 decade growth > 1000 Why GPU? Why GPU's performance is increased more rapidly than CPU's? Semiconductor capability increasing CPU Optimized for sequential code p q CPU's transistors are dedicated to supporting nonnoncomputational tasks GPU The highly parallel nature of graphics Use additional transistors for computation Higher arithmetic intensity with the same transistor count Why GPU? CPU Sequential CPU X X 4 GPU Parallel GPU Output devices Stereoscopic viewing glasses: the user wears them to perceive stereoscopic view of 3D scenes displayed on screen. Used in screen-based Virtual Reality (VR). screenHas high resolution. Limited head-movement. head- HeadHead-mounted display (HMD): two small TV screens are embedded in a rack and placed in front of the two eyes. It allows full-freedom head movement, fulland gives the feel of immersion. Widely used in Virtual Reality (VR). A tracking system is used to report the position of HMD in 3D space. Plotter Laser printers Use laser beam to create a charge distribution on a drum coated with a photoelectric material. Toner is applied to the drum and then transferred to paper. pp p p To produce a color copy, the process is repeated three times for red, green and blue colors. InkInk-Jet printers Spray electrically charged ink on paper Ink stream is deflected by electric field Multiple jets of different color ink can shot simultaneously for producing color drawings Input devices Keyboard Mouse Trackball: a 2D input device, device usually used on a mouse or a laplaptop computer. Space ball: hand held, nonnonmovable. It uses a strain gauge to detect pull push and twist applied pull, push, to the ball, and translate them into 3D locations. Used for navigation in virtual environments, CAD, etc. l C Head Mounted Display: Although primary a display device it can also device, track positionand orientation Joystick: similar to the space ball. Can be movable and non-movable. non- Space ball Input devices Data l D t glove: a glove with sensors. l ith Used to control a virtual hand for grasping, dropping, g asping d opping and moving an mo ing object in a virtual environment. Image scanner: input still picture, photo, or slides as images into computer. computer Touch panel: highly transparent and embedded over a display surface. Digital camera: directly stores photo shots as images on a diskette. Digital video recorder: input a video clip in digital form; often used for teleconferencing. 3D handheld laser scanning digitizer Long Range Laser Scanning Motion Tracking sensors Color and Intensity light : made up of many little particles(photons) i l ( h ) particle model (cf. wave model) color : the frequency of a photon l h f f h 300 200 700 100 700 400 400 400 400 500 300 600 600 600 300 Intensity intensity 300 100 700 400 400 400 400 500 300 600 600 600 100 200 300 400 500 600 700nm 300 200 700 4 3 2 1 Spectrum intensity : the amount of light or the amount of a particular light, color actually reflected or transmitted from a physical object. cf) brightness : measured intensity after it is acquired acquired, sampled, and observed (with our eye) Color Model RGB color model : red red, green, blue additive model illumination based - the color that reaches your eye from your monitor depends on the illuminating light it emits. CMYK : cyan, magenta, cyan magenta yellow, and black subtractive model reflection based CG History Directions in Computer Graphics Plotting Pl tti Interactivity te act ty RealReal-Time Manipulation Image-Realism (Photorealistic rendering) Imagel ( h l d ) RealReal-Time Rendering Scientific Visualization History Motivated b h d M ti t d by hardware evolution and the availability of l ti d th il bilit f new devices 1950's : First military applications of graphics Whirlwind, built in early 50's at MIT, cost $4.5 million and could , y , $ perform 40,000 additions/second. 1960's: Popularization of the storage tube by Tektronix directdirect-view storage-tube(DVST) display terminal storageDVST $12,000 - $15,000 no refreshing is needed high resolution w/o flicker no partial erasing, no color mode History 1963 Sketchpad interactive drawing system by Ivan Sutherland(MIT) introduction of interactive computer graphics data structures for storing symbol hierarchies, interaction technique - keyboard and light-p g light-pen Douglas Engelbart invents the mouse Steve Coons - Surface patch technique p q Sketchpad in 1963. Note use of a CRT monitor, light pen f l h and function-key panel. History Mid 1960s : Industry starts to use interactive computer systems but primary batch mode and too much cost 1970's : Turnkey systems and raster displays images 1977 - Apple II Early 1980s : Introduction of PC (Macintosh (Macintosh, IBM PC) Mid 1980's : Emergence of graphics standards OOP paradigm UI such as Smalltalk80, Macintosh UI Smalltalk80 Workstations are more common PerformancePerformance-price ratio takes off History Luxo Jr. (1986) is the first three-dimensional Jr threecomputer animated film to be nominated for an Academy Award Late 1980's : Evolution of advanced GUI's and visualization environments History 1990's Low price, high performance Increasing demand for higher quality graphics GUI and other graphics intensive applications. applications 1995: Toy Story (Pixar and Disney), the first full length fully computer-generated 3D animation computerSince then : Toy Story (1995), A Bug's Life (1998) and Toy Story 2 (1999), and ... (1999) Late 90's: interactive environments, scientific and medical visualization, artistic rendering, image based rendering, etc. History 2000 s 2000's PC, Natural interface using speech, gestures and facial expressions Real time photorealistic rendering on PC Ubiquitous computing Moved from texture-mapped rendering to textureprogrammable pixel shading in pursuit of cinematic realism History : shaded image Since mid-1970's : the development midmotivation has been photo-realism or TV photoimage like a graphics image PhotoPhoto-realism depends on how we calculate lightlight-object interaction Local/Global reflection models Groud shading (1971) Phong local reflection model(1975) :most popular ray tracing (1980) - specular interaction radiosity (1984) - diff di it diffuse interaction i t ti Future of Computer Graphics What is Wh t i CG? is a wrong question i ti Where it can be found? is better CAD/CAM - 90% of cars are done using CG DTP - newspaper and magazine p p g GUI - do you use Windows...? Film effects - very attractive, but not important Games - i.e., $$$$ Video editing - Local TV studios, TV news, studios news Virtual reality- CAD/CAM, visualization realityand many many more How we draw, edit and save draw a picture Read Chap. 15 Graphics File Formats Image-File Configurations ImageColorColor-Reduction Methods FileFile-Compression Techniques ImageImage-File Configurations Raw data (or Raw raster file) Uncompressed raster-graphics file raster- Header of image file Information about the structure of the file File size, depth, compression method, color range, background color, etc. , For compressed files, tables for decoding and display ColorColor-Reduction Methods ColorColor-reduction Reduce the number of colors used in the display of an image p y g Replaces one discrete set of colors with a smaller set Uniform Color Reduction Popularity Color Reduction p y Select the k most frequently occurring colors in the image file MedianMedian-Cut Color Reduction Subdivide the color space for the image file into k subregions FileFile-Compression Techniques Lossless compression vs. Lossy compression RunRun-Length Encoding Store each sequence of repeated values as the single file value along with the number of repetitions {20, 20, 20, 20, 99, 68, 31, 40, 40, 40, 40, 40, 40, 40, 40, ...} {4, 20, -3, 99, 68, 31, 8, 40, ...} FileFile-Compression Techniques LZW Encoding Replace the patterns with codes Substitutional algorithm or dictionary-based algorithm dictionary{128, 96, 200, 30, 10, 128, 96 50 240 200 30 10 } {128 96 200 30 10 128 96, 50, 240, 200, 30, 10, ...} {c1, c2, c1, c3, c2, ...} or {c1, c2, c1, 50, 240, c2, ...} Other Pattern-Recognition Compression Methods Pattern- FileFile-Compression Techniques Huffman E H ff Encoding di Assign the shortest code to the most frequently occurring value, and the longest code to the least value occurring value FileFile-Compression Techniques Arithmetic Encoding Frequency count is used to obtain numerical codes Boundary values for the subintervals are used to encode and decode the sequences within the file File Value A B C Total Frequency Count 16 24 40 80 File Fraction 0.20 0.30 0.50 1.00 Unit-Interval Range 0.00 - 0.20 0.20 - 0.50 0.50 - 1.00 Sequence AA AB AC ... Unit-Interval Range 0.00 0.04 0 00 - 0 04 0.04 - 0.10 0.10 - 0.20 Sequence ... CA CB CC Unit-Interval Range 0.50 - 0.60 0.60 - 0.75 0 5 0.75 - 1.00 00 FileFile-Compression Techniques Discrete Cosine Transform Encoding {215, 209, 211, 207, 192, 148, 88, 63} {471.29, 143.81, -67.76, 16.33, 7.42, -4.73, 5.49, 0.05} Decoding D di # of Terms 4 5 8 Inverse Discrete Cosine Transform Vales 212.63 215.26 215.00 211.85 209.23 209.00 211.53 208.91 211.00 207.42 210.04 207.00 188.43 191.06 192.00 147.65 145.02 148.00 95.47 92.84 88.00 58.02 60.64 63.00 BitBit-Mapped vs. Object-Oriented Graphics ObjectPainting programs bitbit-mapped representation e.g., MacPaint g, Drawing programs object- i t d object-oriented representation bj t t ti e.g., AutoCAD BitBit-Mapped Graphics Paint Mode BitBit-mapped memory - represent graphical images and patterns by assigning a block of memory for the direct storage of the intensity patterns Objectiveness of a line polygon or brush stroke is lost line, polygon, Limitations pixel democracy - all pixels are created equal once they are set once, in a bit-mapped image slow modification bitno support of images requiring precision or numerical dimensioning device dependency ObjectObject-Oriented Graphics Draw Mode Mathematical representation of lines, rectangles, ovals, Bezier curves, and so on. Objectiveness is maintained Difficulties Objects designed may have a hierarchical structure Easily editable more diffi lt to use difficult t no support of painting tools Image File Formats g Pixel-Mapped PixelGIF (Graphics Interchange Format) the CompuServe Information Service and F&R Block Company copyrighted bitmap format uses compression can store only 256-color images, any size 2569.9 9 9 megabyte for 1943x1702 24-bit RGB color image 24- PNG (Portable Network Graphics) a royalty-free GIF and LZW (maybe also TIFF) replacement royaltyUpto 48 bits/pixel superior lossless compression 6.5 megabyte for 1943x1702 24-bit RGB color image 24http://www.libpng.org/pub/png/ h // lib / b/ / Image File Formats Pixel-Mapped PixelTIFF (Tag-based Image File Format) (TagAldus Corp. and Microsoft to support digital scanner manufacturers and desktop publishing systems to describe and store raster image data TIFF is a popular format for high color depth images, along with JPEG and PNG runrun-length encoding with compression (also LZW) independent of OS, processors, compilers, a d filing systems depe de o p ocesso s, co p e s, and g sys e s become a standard for image storage and communication Image File Formats Pixel-Mapped PixelJPEG (Joint Photographic Experts Group) international compression standard (1992) high compression rate can be acquired by removing the following redundancy in an image: spatial (between neighboring pixels), pixels) spectral (between color planes), temporal (between adjacent frames in a sequence) p ( j q ) highly lossy compression (in general, 5:1 and 15:1) But, objectionable blocking artifacts may occur. poor lossless compression efficiency (less than 3) lossy compression method is limited to input images with maximum bit depth of 8bits/pixel. lossless support 2 to 16 bits/pixel. no support for true-color true- JPEG artifacts TIFF JPEG Image File Formats Pixel-Mapped Pixel- pp JPEG 2000 new international compression standard (2002.1) roughly 20% on average higher compression efficiency than JPEG new functionalities: integrated lossy/lossless compression region-ofregion-of-interest(ROI) encoding MultiMulti-resolution capability Progressive transmission by pixel and resolution accuracy p g progressive decoding g etc. JPEG 2000 Applications Consumer applications such as multimedia devices (e.g., (e g digital cameras, personal digital assistants, 3G mobile phones, phones color facsimile, printers, scanners etc) facsimile printers Client/server communication (e.g., the internet, Image database, Video streaming, video server, etc.) Military/surveillance (e.g., HD satellite images, Motion detect o , et o distribution and storage, etc..) detection, network d st but o a d sto age, etc ) Medical imagery (PACS) Storage of motion sequences (e.g., digital cinema, HD digital Camcorder). Remote sensing, digital libraries/archives, and EEcommerce. Image File Formats Pixel-Mapped PixelEPSF: Encapsulated PostScript File Format Adobe Systems Incorporated importing and exporting PostScript language files g y grayscale or color usually ASCII No compression can be mix of raster and geometric data Image File Formats Pixel-Mapped (Comparison) PixelBITS PER PIXEL JPEG TIFF GIF EPSF 24 8,24 1,4,8 1,2,4,8,24 1 2 4 8 24 FILE SIZE small medium medium huge COMMENTS lossy, good for archives lossy, g y good no good for colorful images good for printing Image File Formats Object-Oriented ObjectStore a description of how to draw the image CAD Fil Formats File F t DXF/AutoCAD AutoCAD de facto industry standard drawing exchange files IGES (Initial Graphics Exchange Specifications) ANSI standard used by W/S, minicomputer, and mainframes based CAD DirectX Graphics vs. OpenGL DirectX Graphics Microsoft Mi ft Microsoft Windows DirectX is better optimized for hardware 3D acceleration on the Windows platform Latest version : Direct3D 10 Object Oriented Programming friendly j g g y COM and .NET based OpenGL SGI MultiMulti-platform : An implementation is available on most modern OS Latest version : OpenGL 2.1 21 Not Object Oriented (Includes and Libraries) OpenGL 2 vs Direct3D 9/10 vs. OpenGL 2 Operating S t O ti System Support API Specification API Mechanism Source Implementation Available Windows, , MacOS, BeOS, *nix, others OpenGL Specification includes and libraries Yes Direct3D 9 Windows (9 Wi d (9x, 2000,xp) SDK Documentation COM Direct3D 10 Windows Vista SDK Documentation OS Integrated (WDDM Driver) No No OpenGL 2 vs. Di t3D 9/10 O GL Direct3D Ope G OpenGL 2 FixedFixed-Function Shaders Programmable Shaders Parametric Curve Primitives Parametric Surface Primitives Matrix Coordinate System Yes Yes Yes Yes Row major order LeftLeft-handed Direct3D 9 ect3 Yes Yes Yes Yes Column major order RightRighthanded Direct3D 10 ect3 0 No Yes Yes Yes Column major order RightRighthanded OpenGL 2 vs. Di t3D 9/10 O GL Direct3D OpenGL 2 Familiar to traditional C programmers Industrial standards Rigid specification Late adoption of new technologies Incompatibility between extensions of vendors Direct3D Can manage hardware resources directly di l Early adoption of new technologies and hardwares Strongly platform-dependent platform(Windows only) Hard to learn API and program an application Pros Cons Next Topics N tT i We have finished Chap 1 & 2. Next topic is how to find pixels corresponding to graphic primitives. ...
View Full Document

Ask a homework question - tutors are online