{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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: [email protected] [email protected] snu ac kr Office: 302-322 302Phone: 880-6757 880- Teaching assistant: ([email protected]) 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 Imag...
View Full Document

{[ snackBarMessage ]}