49
CS 174A – Winter 2015 Introduction to Computer Graphics Professor Demetri Terzopoulos TAs: Franklin (Jingyi) Fang, Garett Ridge Professor Demetri Terzopoulos TAs: Franklin (Jingyi) Fang, Garett Ridge Computer Graphics The Art and Science of creating imagery by computer The Art and Science of creating imagery by computer Mathematics Biomechanics Engineering Optics Art Physics Artificial Intelligence Vision

CS 174A Lecture01 Introduction

Embed Size (px)

DESCRIPTION

CS174A Design Intro Lecture

Citation preview

Page 1: CS 174A Lecture01 Introduction

CS 174A – Winter 2015Introduction to Computer Graphics

Professor Demetri Terzopoulos

TAs: Franklin (Jingyi) Fang, Garett Ridge

Professor Demetri Terzopoulos

TAs: Franklin (Jingyi) Fang, Garett Ridge

Computer Graphics

The Art and Science of creating imagery by computerThe Art and Science of creating imagery by computer

Mathematics

Biomechanics

Engineering

Optics

Art

Physics

Artificial Intelligence

Vision

Page 2: CS 174A Lecture01 Introduction

Applications of CG

Entertainment

• Films

• Computer Games

• Virtual reality

Scientific visualization

• Medical visualization

• Flight simulation

• Architecture

Education

Entertainment

• Films

• Computer Games

• Virtual reality

Scientific visualization

• Medical visualization

• Flight simulation

• Architecture

Education

History

• 2000 B.C.

– orthographic projection

• 1400s

– Perspective: Italian Renaissance

• 1600s

– coordinate systems: Descartes– optics: Huygens– calculus, physics, optics: Newton

• 2000 B.C.

– orthographic projection

• 1400s

– Perspective: Italian Renaissance

• 1600s

– coordinate systems: Descartes– optics: Huygens– calculus, physics, optics: Newton

Page 3: CS 174A Lecture01 Introduction

History

• 1897 oscilloscope: Braun

• 1950-1970

– computers with vector displays

• 1966

– first true raster display

• 1993

– 1200x1200, 500k triangles/sec, 36-bit color, stereo, texture mapping… all at 60Hz

• 1995

– feature-length CG films

• Today…still rapidly evolving

• 1897 oscilloscope: Braun

• 1950-1970

– computers with vector displays

• 1966

– first true raster display

• 1993

– 1200x1200, 500k triangles/sec, 36-bit color, stereo, texture mapping… all at 60Hz

• 1995

– feature-length CG films

• Today…still rapidly evolving

Genesis of Computer Graphics and Interactive Techniques

A PhD project at MIT in the early 1960s

• Ivan E. Sutherland, 1963

– “Sketchpad, a man-machine graphical communication system”

A PhD project at MIT in the early 1960s

• Ivan E. Sutherland, 1963

– “Sketchpad, a man-machine graphical communication system”

Page 4: CS 174A Lecture01 Introduction

Quiz

http://www.accad.ohio-state.edu/~waynec/history/timeline.html

1. When was the term Computer Graphics first stated?

William Fetter of Boeing coins the term "computer graphics" for his human factors cockpit drawings 1960.

2. When was the Graphical User Interface developed?

GUI developed by Xerox (Alan Kay) 1969

3. When was Tron released?

Disney contracts Abel, III, MAGI and DE to create computer graphics for the movie Tron released in 1981.

Quiz

4. Which is the first animated movie to employ CG?

“The Great Mouse Detective” (1986) was the first animated film to be aided by CG.

5. When was the game “Doom” released?

1993

6. Which is the best selling game of all time?

http://en.wikipedia.org/wiki/List_of_best-selling_video_games Tetris (135M copies), Wii Sports (82M), Minecraft (54M), Super Mario Bros. (40M), Mario Kart Wii (35M),Grand Theft Auto V (34M), …

Page 5: CS 174A Lecture01 Introduction

Quiz

7. Which is the newest CG animated movie?

?? (trick question)

8. Which is bigger in terms of gross revenue, the game industry or the (Hollywood) movie industry?

The game industry

9. Which is your favorite animated movie?

The First Computer Game?

Pong, Atari, 1972Spacewars, PDP–1, MIT, 1961

Page 6: CS 174A Lecture01 Introduction

Metal Gear Solid 4

Games

Focus on interactivityFocus on interactivity

Page 7: CS 174A Lecture01 Introduction

Movies

To reality and beyond !To reality and beyond !

Movies

Special effectsSpecial effects

Page 8: CS 174A Lecture01 Introduction

Movies

Digital Compositing

Page 9: CS 174A Lecture01 Introduction

Digital compositing

Digital Compositing

Page 10: CS 174A Lecture01 Introduction

Cartoons

Computer-Aided Design

Precision modeling

Engineering visualization

Precision modeling

Engineering visualization

Page 11: CS 174A Lecture01 Introduction

Modeling Clay

Computer-Aided Design

It’s not just about visualization

• Simulation is also useful

It’s not just about visualization

• Simulation is also useful

Page 12: CS 174A Lecture01 Introduction

Molecular Biology

Visualization: Scientific

Environmental Physics

Visualization: Medical

Page 13: CS 174A Lecture01 Introduction

Visualization: Architectural

http://www.diamondschmitt.com/

Visualization: Info Smith and Fiore

Page 14: CS 174A Lecture01 Introduction

Graphical User Interfaces

Steven Schkolne

Art

Steven Schkolne

Page 15: CS 174A Lecture01 Introduction

Digital Art

Genetically evolvedGenetically evolvedCarl Sims

Digital Art

The Top-Grossing Film of All Time^2nd

“Titanic”

By Jason Salavon

Page 16: CS 174A Lecture01 Introduction

What is an Image / Video?

• Array of pixels (one or more numbers)

• A video is a time sequence of images

• How they are formed:

– Objects in the world (static or dynamic)

– Illumination (light sources)

– Imaging device (eye, camera)

• We want to synthesize images/videos

• Array of pixels (one or more numbers)

• A video is a time sequence of images

• How they are formed:

– Objects in the world (static or dynamic)

– Illumination (light sources)

– Imaging device (eye, camera)

• We want to synthesize images/videos

Illumination

Camera

Objects

Basic Elements

Modeling

Animation

Rendering

Interaction

Modeling

Animation

Rendering

Interaction

Page 17: CS 174A Lecture01 Introduction

Basic Elements

• Modeling

– How do we model (mathematically represent) objects?– How do we construct models of specific objects?

• Animation

– How do we represent the motions of objects?– How do we give animators control of this motion?

• Rendering

– How do we simulate the real-world behavior of light?– How do we simulate the formation of images?

• Interaction

– How do we enable humans and computers to interact?– How do we design human-computer interfaces?

• Modeling

– How do we model (mathematically represent) objects?– How do we construct models of specific objects?

• Animation

– How do we represent the motions of objects?– How do we give animators control of this motion?

• Rendering

– How do we simulate the real-world behavior of light?– How do we simulate the formation of images?

• Interaction

– How do we enable humans and computers to interact?– How do we design human-computer interfaces?

Modeling

Primitives

• 3D points

• 3D lines and curves

• surfaces (BREPs): polygons, patches

• volumetric representations

• image-based representations

Attributes

• Color, texture maps

• Lighting properties

Geometric transformations

Primitives

• 3D points

• 3D lines and curves

• surfaces (BREPs): polygons, patches

• volumetric representations

• image-based representations

Attributes

• Color, texture maps

• Lighting properties

Geometric transformations

Page 18: CS 174A Lecture01 Introduction

Rendering

Visibility

Simulating light propagation

• Reflection

• Asborption

• Scattering

• Emission

• Interference

Visibility

Simulating light propagation

• Reflection

• Asborption

• Scattering

• Emission

• Interference

Animation

Keyframe animation

Motion capture

Procedural animation

• Physics-based animation

• Behavioral animation

Keyframe animation

Motion capture

Procedural animation

• Physics-based animation

• Behavioral animation

Page 19: CS 174A Lecture01 Introduction

Interaction

Input/Output Devices

Tools

• Modeling, rendering, and animation

Input/Output Devices

Tools

• Modeling, rendering, and animation

Elements of CG

The graphics pipelineThe graphics pipeline

Modeling Animation Rendering

Page 20: CS 174A Lecture01 Introduction

Surface patches NURBS

Polygon meshes

Point clouds

Texture maps

Parametric curves

Modeling

Representing objects geometrically on a computer

Representing objects geometrically on a computer

Modeling

Alternative representationsAlternative representations

Blobs

Voxels

Subdivision surfaces

Page 21: CS 174A Lecture01 Introduction

Modeling

Altering geometric modelsAltering geometric models

Affine transform

Ying, Kristjansson, Biermann, Zorin

Scanning Shapes

Digital Michaelangelo Project

Page 22: CS 174A Lecture01 Introduction

Plant Modeling

Plant Modeling

Page 23: CS 174A Lecture01 Introduction

Rendering

Key elementsKey elementsGeometric Shape

Illumination

& ReflectanceCamera

Pixels

Camera Model

Page 24: CS 174A Lecture01 Introduction

Rendering

Draw visible surfaces onto displayDraw visible surfaces onto display

Camera (eye position)

Camera (view direction)

Image Plane

Clipping Scan Conversion

Reflectance Modeling

Page 25: CS 174A Lecture01 Introduction

Complex Reflectance

Subsurface Scattering

Translucency and varied levels of light penetration can be created using subsurface scattering effectsTranslucency and varied levels of light penetration can be created using subsurface scattering effects

Page 26: CS 174A Lecture01 Introduction

Texture

Multilevel texture synthesisMultilevel texture synthesis

Non-Photorealistic Rendering

Aaron Hertzmann

Page 27: CS 174A Lecture01 Introduction

Rendering: Information

Animation

Keyframe animationKeyframe animation

Keyframing

Page 28: CS 174A Lecture01 Introduction

Animation

Pixar: “Luxo Jr.” (1986)Pixar: “Luxo Jr.” (1986)

Animation

Motion captureMotion capture

Page 29: CS 174A Lecture01 Introduction

Animating Golem in LOTR

Animation

The Animatrix –“Final Flight of the Osiris”

The Animatrix –“Final Flight of the Osiris”

Page 30: CS 174A Lecture01 Introduction

Animation

Example: “Geri’s Game” - PixarExample: “Geri’s Game” - Pixar

Cloth Simulation

Page 31: CS 174A Lecture01 Introduction

Animation

Physics-based animationPhysics-based animation

Dynamics

Fluid Simulation

Modeling

• Incompressibility

• Viscocity

Navier-Stokes Equations

Level Sets

Modeling

• Incompressibility

• Viscocity

Navier-Stokes Equations

Level Sets

0

1( ) ( )

: fluid velocity field

: gravity

p: pressure

: viscosity

: density

v pt

v

u

uu u u g

u

g

Page 32: CS 174A Lecture01 Introduction

Smoke Simulation

Assumptions

• No viscosity

Rendering

• Photon maps

• Multiple scattering

Assumptions

• No viscosity

Rendering

• Photon maps

• Multiple scattering0

1( )

: smoke velocity field

: external forces

p: pressure

: density

pt

u

uu u f

u

f

Animation

Behavioral animationBehavioral animationEthology

Page 33: CS 174A Lecture01 Introduction

Reality is *Very* Complex

Reality is *Very* Complex

Page 34: CS 174A Lecture01 Introduction

Great! But what are we going to do?

Learn the mathematical basics of graphics

Apply them in 3 programming assignments

Show that you know them in 2 exams

Learn the mathematical basics of graphics

Apply them in 3 programming assignments

Show that you know them in 2 exams

Summary of the Syllabus

Math

Rendering

Modeling

Animation

(Interaction)

(Hardware)

Math

Rendering

Modeling

Animation

(Interaction)

(Hardware)

Page 35: CS 174A Lecture01 Introduction

Math

Linear (vector/matrix) algebra

Coordinate systems

Geometry

• Points, lines, planes

Affine transformations

Projection transformations

More geometry

• Curves, surfaces

Linear (vector/matrix) algebra

Coordinate systems

Geometry

• Points, lines, planes

Affine transformations

Projection transformations

More geometry

• Curves, surfaces

Comments From Previous Courses

• Lots of (dry) math!

• A lot of material

• Fast pace

• A lot of programming

• Tough third project

• Challenging final exam

• Great animation shows at the start of each lecture!

• Lots of (dry) math!

• A lot of material

• Fast pace

• A lot of programming

• Tough third project

• Challenging final exam

• Great animation shows at the start of each lecture!

Page 36: CS 174A Lecture01 Introduction

Advice

• Attend lectures and discussion sessions!

– You will perform better on this course if you do (trust me)

– The lecture slides are your “bible” for the exams

• Start the assignments EARLY!!

– Get HELP from us with the assignments EARLY!

• Do NOT do more on the assignments than you are required, unless you are done with the required part of the assignment

– You will NOT get more points for additional work

• Refresh your knowledge of linear algebra and geometry, and keep up with the math

• Attend lectures and discussion sessions!

– You will perform better on this course if you do (trust me)

– The lecture slides are your “bible” for the exams

• Start the assignments EARLY!!

– Get HELP from us with the assignments EARLY!

• Do NOT do more on the assignments than you are required, unless you are done with the required part of the assignment

– You will NOT get more points for additional work

• Refresh your knowledge of linear algebra and geometry, and keep up with the math

• Manage your course load

• No plagiarism (of course)

• Do individual work

• Your code must work on HSSEAS systems

• Please send e-mails to us from your UCLA accounts only

• Manage your course load

• No plagiarism (of course)

• Do individual work

• Your code must work on HSSEAS systems

• Please send e-mails to us from your UCLA accounts only

Important Issues to Remember

Page 37: CS 174A Lecture01 Introduction

A Basic Graphics System

Input devices

Output devices

Computing & rendering system

Input devices

Output devices

Computing & rendering system

Input Devices

Keyboard

Mouse

Light Pen

Game controller

Tablet

Data glove

Other sensors

Keyboard

Mouse

Light Pen

Game controller

Tablet

Data glove

Other sensors

Page 38: CS 174A Lecture01 Introduction

Output Devices

Display

• CRT, Plasma, LCD, Micromirror

Printer

• 2D and 3D Printers

Plotter

Display

• CRT, Plasma, LCD, Micromirror

Printer

• 2D and 3D Printers

Plotter

Standard Display Devices

PlasmaLCD

(Liquid Crystal Display)

CRT(Cathode Ray Tube)

Page 39: CS 174A Lecture01 Introduction

Exotic Display Devices

AutostereoscopicAutostereoscopic

ImmersiveImmersive

HolographicHolographic

Head-MountedHead-Mounted

VolumetricVolumetric

CRT Raster Graphics

Virtual raster device

• Grid of m x n phosphors

Real raster device

Virtual raster device

• Grid of m x n phosphors

Real raster device

Page 40: CS 174A Lecture01 Introduction

Analog Video Signal Format

Displaying Intensities

Gamma CorrectionGamma Correction

Page 41: CS 174A Lecture01 Introduction

Basic Analog Display Architecture

Pixels:

• Bitmap: 1bit/pixel

• Grey scale: 8 bits/pixel

• Color map: 8 bits/pixel, indirect

• True color: 24 bits/pixel

• True color + Alpha Channel: 32 bits/pixel

Pixels:

• Bitmap: 1bit/pixel

• Grey scale: 8 bits/pixel

• Color map: 8 bits/pixel, indirect

• True color: 24 bits/pixel

• True color + Alpha Channel: 32 bits/pixel

Images – Monochrome

How many intensities are enough?

Black and White (Bitmaps) Grayscale

How many intensities are enough?

Black and White (Bitmaps) Grayscale

Page 42: CS 174A Lecture01 Introduction

Color

Common format RGB (3x8 = 24 bits per pixel)Common format RGB (3x8 = 24 bits per pixel)

Rendering System

Software

• Interface

• Primitives

• Techniques

Hardware

• Graphics Pipeline

Software

• Interface

• Primitives

• Techniques

Hardware

• Graphics Pipeline

Page 43: CS 174A Lecture01 Introduction

The Graphics Pipeline

Why a pipeline?

• Well defined stages

• Parallelism

• Software and Hardware

Radeon X800 by ATI

• 16 parallel rendering pipelines

• Floating point architecture

• Millions of triangles per second

Why a pipeline?

• Well defined stages

• Parallelism

• Software and Hardware

Radeon X800 by ATI

• 16 parallel rendering pipelines

• Floating point architecture

• Millions of triangles per second

Radeon 9700 by ATI

Graphics Pipeline

Modeling

Illumination

Viewing (Projection)

Clipping

Visibility

Rasterization

Modeling

Illumination

Viewing (Projection)

Clipping

Visibility

Rasterization

Page 44: CS 174A Lecture01 Introduction

Modeling

Geometric Primitives

• Points

• Lines

• Planes

• Polygons

• Parametric surfaces

• Implicit surfaces

• Etc.

Geometric Primitives

• Points

• Lines

• Planes

• Polygons

• Parametric surfaces

• Implicit surfaces

• Etc.

Modeling Transformations

AssemblyAssembly

Page 45: CS 174A Lecture01 Introduction

Viewing

Orthographic PerspectiveOrthographic Perspective

Clipping

Remove what is not visibleRemove what is not visible

Page 46: CS 174A Lecture01 Introduction

Visibility

Resolve occlusions (efficiently)Resolve occlusions (efficiently)

Illumination

Compute normals and color at vertices

Per vertex operations

Compute normals and color at vertices

Per vertex operations

Page 47: CS 174A Lecture01 Introduction

Shading

Rasterization

Convert to colored pixelsConvert to colored pixels

Page 48: CS 174A Lecture01 Introduction

Per Pixel / Fragment Operations

Hardware features

• Vertex shaders

• Fragment shaders

Hardware features

• Vertex shaders

• Fragment shaders

Texture Mapping

Page 49: CS 174A Lecture01 Introduction

Other Issues

Shadows

Participating media

Subsurface scattering

Motion blur

Camera models

Etc.

Shadows

Participating media

Subsurface scattering

Motion blur

Camera models

Etc.

Final Result