Computer Graphics - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/CG07/Lectures/CG_1Gsys_S07.pdf ·...

36
Computer Graphics 1. Graphics Systems National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor Textbook: Hearn and Baker, Computer Graphics, 3rd Ed., Prentice Hall Ref: E.Angel, Interactive Computer Graphics, 4 th Ed., Addison Wesley

Transcript of Computer Graphics - caig.cs.nctu.edu.twcaig.cs.nctu.edu.tw/course/CG07/Lectures/CG_1Gsys_S07.pdf ·...

Computer Graphics

1. Graphics Systems

National Chiao Tung Univ, TaiwanBy: I-Chen Lin, Assistant Professor

Textbook: Hearn and Baker, Computer Graphics, 3rd Ed., Prentice HallRef: E.Angel, Interactive Computer Graphics, 4th Ed., Addison Wesley

Computer GraphicsComputer graphics deals with all aspects of creating images with a computer.

Hardware

Software

Applications

ExampleWhere did this image come from?

What hardware/software did we need to produce it?

Preliminary AnswerApplication: The object is an artist’s rendition of the sun for an animation to be shown in a domed environment (planetarium)

Software: Maya for modeling and rendering but Maya is built on top of OpenGL

Hardware: PC with graphics card for modeling and rendering

Basic Graphics System

Output device

Input devices

Image formed in FB

Computer Graphics: 1950-1960Computer graphics goes back to the earliest days of computing

Strip chartsPen plottersSimple displays using A/D converters to go from computer to calligraphic CRT

Cost of refresh for CRT too high Computers slow, expensive, unreliable

Computer Graphics: 1960-1970Wireframe graphics

Draw only lines

SketchpadDisplay ProcessorsStorage tube

wireframe representation of sun object

SketchpadIvan Sutherland’s PhD thesis at MIT

Recognized the potential of man-machine interaction.

Sutherland also created many of the now common algorithms for computer graphics

Ivan Sutherland,

Turing Award winner, 1988The console of the TX-2, Sketchpad Project

Computer Graphics: 1970-1980Raster Graphics

Image produced as an array (the raster) of picture elements (pixels) in the frame buffer

Allows us to go from lines and wire frame images to filled polygons

Computer Graphics: 1980-1990Realism comes to computer graphics

smooth shading environmentmapping

bump mapping

Computer Graphics: 1980-1990Special purpose hardware

Silicon Graphics geometry engineVLSI implementation of graphics pipeline

Industry-based standardsPHIGS

Programmer's Hierarchical Interactive Graphics System RenderMan

Networked graphics: X Window SystemHuman-Computer Interface (HCI)

Computer Graphics: 1990-2000OpenGL API

Completely computer-generated feature-length movies (Toy Story) are successful.

New hardware capabilitiesTexture mappingBlendingStencil buffers, …

Computer Graphics: 2000-Photorealism

Graphics cards for PCs dominate marketNvidia, ATI, 3DLabsGPU (Graphics processing unit)

Game boxes and game players determine direction of market

Computer graphics routine in movie industry: Maya, Lightwave

Programmable pipelines

Light & ImageObjectsViewerLight source(s)

Attributes that govern how light interacts with the materials in the scene

Note the independence of the objects, the viewer, and the light source(s)

LightLight is the part of the electromagnetic spectrum that causes a reaction in our visual systems

Generally these are wavelengths in the range of about 350-750 nm (nanometers)

Three-Color TheoryHuman visual system has two types of sensors

Rods: monochromatic, night visionCones

Color sensitiveThree types of conesOnly three values (the tristimulus

values) are sent to the brain

Need only match these three valuesNeed only three primary colors

Additive and Subtractive ColorAdditive color

Form a color by adding amounts of three primaries

CRTs, projection systems, positive film

Primaries: Red (R), Green (G), Blue (B)

Subtractive colorForm a color by filtering white light with:

Cyan (C), Magenta (M), and Yellow (Y) filtersPrinting, Negative film

RGB & CMYK color modelK = min (C, M, Y)

C = C – K

M = M – K

Y = Y - K⎥⎥⎥

⎢⎢⎢

⎡−

⎥⎥⎥

⎢⎢⎢

⎡=

⎥⎥⎥

⎢⎢⎢

BGR

YMC

111

Cyan = min (1, max(0, C - U(K))

Magenta = min (1, max(0, M - U(K))

Yellow = min (1, max(0,Y - U(K))

Black = min (1, max(0, BK(K))

Basic 3D Graphics

What’s 3D?

How about these pictures?

What’s 3D?Is this correct?

Vanish point

Perspective projectionTaking photographing as an example.

Synthetic Camera Model

center of projection

image plane

projector

p

projection of p

Perspective projection (cont.)Projection

Perspective projection (cont.)Let pupils as the pinhole and a screen as the film.

Generating perspective viewsFrom the continuous world to a digital one.Representing by surfaces?

Represented by primitivesCurves and surfaces are inefficient to render directly.

Represented by primitives (cont.)We use primitives such as polygons instead.

Represented by primitivesPolygons

Represented by primitives

Digital Michelangelo Project, Stanford University

Represented by primitives (cont.)A triangle is usually the most basic primitive. Polygons -> triangles.

Projection of trianglesA

CB

D

A’

C’B’

D’

Projection planefocus

VisibilityIf we draw triangles directly, our screen will be a “mess”.Remove hidden surfaces.

A realistic 3D viewDelicate 3D models.Perspective.Hidden surface removal.Shading (lighting & reflection).Shadow.Detailed textures and normals

B. Martin, U. UtahPixar corp.

How to synthesize a view?How to represent a object?

How to make the scene “move”?

How to display a 3D scene on screen?

How to efficiently simulate lighting effects?