58
Computer Graphics An Introduction Taku Komura

Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

  • Upload
    others

  • View
    3

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Computer Graphics

An Introduction

Taku Komura

Page 2: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

What’s this course all about?

19/09/11 Lecture 1

We will cover…

Graphics programming and algorithms

Graphics data structures

Applied geometry, modelling and rendering

How to use OpenGL

Not covering : how to use software like Maya, 3D Studio Max, etc.

Page 3: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Other Important things● You need to know about math● We will use basic linear algebra

○ Dot product, cross product, matrix calculations

○ Basic calculus, solving linear systems

Please don’t take the course if you don’t likemath

Page 4: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Outline for Today●Classic streams of computer graphics●Application areas of computer graphics●About SIGGRAPH●Overview of the course

○Topics in Graphics Pipeline, etc

Page 5: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Classic streams of computer graphics

● 2D/3D modeling (aircraft, car manufacturing)● Interactive applications (computer games, design)● Realistic rendering (Lots of work at University of Utah)● Computer art (many people)

Page 6: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

2D/3D Modeling

Designing curved surfaces was important for car and aircraft manufacturers in the old days•Such modeling requires a lot of mathematics•Lots of mathematicians join the graphics research community nowadays too

Page 7: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Interactive applications

•Sketchpad (1963, Ivan Sutherland)•Head mount display (1968, IvanSutherland)•Tennis game (1958), Space war (1962)

Page 8: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Realistic Rendering (University of Utah)

● Gouraud shading (Gouraud, 1971)● Phong shading (Phong, 1975)● Phong illumination model (Phong 1973)

Page 9: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Realistic Rendering (University of Utah)

•Bump mapping (1978)–Jim Blinn•Subdivision surface(Catmull, Clark 1978)

Page 10: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Computer Art (1960-)

Page 12: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Outline for Today●Classic streams of computer graphics●Application areas of computer graphics●About SIGGRAPH●Overview of the course

○Topics in Graphics Pipeline, etc

Page 13: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

The Application Areas of Computer Graphics

Computer AnimationComputer GamesVirtual RealityScientific VisualizationHuman Computer Interactions

Page 14: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Computer Graphics is about animation (films)

Lecture 1

Major driving force now

Page 15: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

What are the Challenges? ● Realistic Lighting and Reflections:

○ Need to make the lighting condition appear like real

○ Need to make objects reflect the light realistically

● Physical simulations:○ Fluids (liquid, fire), rigid bodies

● Realistic movements of the faces, bodies, etc.○ Need to make the imaginary characters

appear as if they are really in the environment

Page 16: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Realistic Lighting and Reflections:● Need to make the lighting condition appear like

real● Need to make objects reflect the light

realistically (modeling the reflection model)

Page 17: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Physical Simulation

●Cloth http://www.youtube.com/watch?v=NoazGEnzsRA

Page 18: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Physical Simulation

●Water http://www.youtube.com/watch?v=feBfMf2J8uQ

Page 19: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Physical Simulation●Rigid objects, destruction, explosions● http://www.youtube.com/watch?

v=bDFniqj07FQ

Page 20: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Computer Games

Lecture 1

Page 21: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

What are the Challenges? ●Everything altogether must run in real-time (30 frames per second)●Rendering (drawing the scene)●character control (player characters + non player

characters)●Physical simulation (object collision, deformations) ●user input

Page 22: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Character Control●Controlling the non-player character

intelligently●For player character, selecting an action based

on the user input -> smooth transition

Page 23: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Virtual Reality, Medical Imaging is another driving force

Lecture 1

Page 24: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Computer Aided Design, 3D modelling

Lecture 1

Page 25: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

3D modelling

Modelling a cup by Maya

http://vimeo.com/5423236

Page 26: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Scientific Visualisation

Lecture 1

To view below and above our visual range

Page 27: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

What are the challenges?

●Converting the numbers into something that is easy to understand

●Making use of human's visual perception

Page 28: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Volume rendering

Page 29: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Human Computer Interactions

●Sketch-based interfaces●Story telling, puppetry ●puzzles

Teddy http://www.youtube.com/watch?v=e2H35SlLmUA

Page 30: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Outline for Today●Classic streams of computer graphics●Application areas of computer graphics●About SIGGRAPH●Overview of the course

○Topics in Graphics Pipeline, etc

Page 31: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

SIGGRAPH (Special Interest Group on GRAPHics and Interactive Techniques)

○The biggest computer graphics conference in the world that started in 1974

○Now about 20,000 attendees every year○Most important techniques have been presented

at the SIGGRAPH Technical Paper programme○Getting a paper into SIGGRAPH is very

important for CG researchers

Lecture 1

Page 32: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

http://www.youtube.com/watch?v=JAFhkdGtHck

Page 34: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Overview of the Course● Graphics Pipeline (Today)

○ 3D transformations○ (Local lighting effects) Illumination, lighting,

shading, mirroring, shadowing○ Hidden surface removal○ Rasterization○ Ray tracing

● Global illumination ● Modelling, Curves and Surfaces

Lecture 1

Page 35: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Graphics Pipeline

●Graphics processes generally execute sequentially

●Pipelining the process means dividing it into stages

●Especially when rendering in real-time, different hardware resources are assigned for each stage

Lecture 1

Page 36: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Graphics Pipeline

●There are three stages ○Application Stage○Geometry Stage ○Rasterization Stage

19/09/11 Lecture 1

Page 37: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

An example thro’ the pipeline…

Lecture 1

The scene we are trying to represent:

Images courtesy of Picture Inc.

Page 38: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Application stage●Entirely done in software by the CPU●Read Data

○ the world geometry database,○ User’s input by mice, trackballs, trackers, or sensing

gloves●In response to the user’s input, the application

stage change the view or scene

19/09/11 Lecture 1

Page 39: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Preparing Shape Models(Lecture 2)

Lecture 1

Designed by polygons, parametric curves/surfaces, implicit surfaces and etc.

Defined in its own coordinate system

Page 40: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Geometry Stage

● Applying transformations to the object vertices (scaling, rotating, translating)

● View transformation (viewing from the camera)● Illumination and shading (for Gouraud shading)

Page 41: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Model Transformation (Lecture 3)

19/09/11 Lecture 1

● Objects put into the scene by applying translation, scaling and rotation

● Linear transformation called homogeneous transformation is used

● The location of all the vertices are updated by this transformation

Page 42: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Perspective Projection (Lecture 4)

19/09/11 Lecture 1

● We want to create a picture of the scene viewed from the camera

● We apply a perspective transformation to convert the 3D coordinates to 2D coordinates of the screen

● Objects far away appear smaller, closer objects appear bigger

Page 43: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Hidden Surface Removal (Lecture 7)

Lecture 1

● Objects occluded by other objects must not be drawn

Page 44: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Shading and Lighting (Lecture 6)

Lecture 1

● We need to decide the colour of each pixels taking into account the object’s colour, lighting condition and the camera position

Object

point light source

Page 45: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Shading : Constant Shading - Ambient

Lecture 1

● Objects colours by its own colour

Page 46: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Shading – Flat Shading

Lecture 1

● Objects coloured based on its own colour and the lighting condition

● One colour for one face

Page 47: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Gouraud shading, no specular highlights

19/09/11 Lecture 1

● Lighting calculation per vertex

Page 48: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Specular high lights added

Lecture 1

Page 49: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Rasterization (Lecture 5)●Converts the vertex information output

by the geometry pipeline into pixel information needed by the video display

●Aliasing: distortion artifacts produced when representing a high-resolution signal at a lower resolution.

●Anti-aliasing : technique to remove aliasing

● Illumination and shading (for Phong shading)

Lecture 1

Page 50: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Anti-aliasing

Lecture 1

Aliased polygons(jagged edges)

Anti-aliased polygons

Page 51: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Lecture 1

● How is anti-aliasing done? Each pixel is subdivided

(sub-sampled) in n regions, and each sub-pixel has a color;● Compute the average color value

Page 52: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Texture mapping (Lecture 8)

Lecture 1

Page 53: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Other effects: Bump mapping (Lecture 9)Reflections (Lecture 10),

shadows (Lecture 11)

Lecture 1

Page 54: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Other covered topics: Ray Tracing (Lecture 12)

Global Illumination (Lecture 13)

Lecture 1

Page 55: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Polynomial Curves, Surfaces(Lecture 14,15)

Page 56: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

OpenGL (Lecture 4 / Lab session)

○OpenGL is a standard computer graphics library for interactive computer graphics

○A TA will give an introductory session for OpenGL

Lecture 1

Page 57: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Course support resources

●Graphics course website●http://www.inf.ed.ac.

uk/teaching/courses/cg○ lecture material,○ recommended reading,○ Links to support material for lectures and projects,○ Practical description and resources

Lecture 1

Page 58: Computer Graphics Taku Komura - The University of Edinburgh · Classic streams of computer graphics ... of computer graphics 2D/3D modeling (aircraft, car manufacturing) Interactive

Summary●The course is about algorithms, not

applications○Lots of mathematics

●Graphics execution is a pipelined approach

●Basic definitions presented●Some support resources indicated

Lecture 1