37
Introduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

  • Upload
    others

  • View
    47

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

Introduction to Computer

Graphics

Prof. George Wolberg

Dept. of Computer Science

City College of New York

Page 2: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

2Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Course Description

• Intense introduction to computer graphics.

• Intended for advanced undergraduate and

graduate students.

•Topics include:

- OpenGL API, GLSL shading language

- Geometric transformations

- 3D viewing

- Geometric modeling, curves and surfaces

- Shading, texture mapping, compositing

Page 3: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

3Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Syllabus

Week

1

2-4

5-6

7

8

9

10

11-12

13-14

Topic

Introduction, history, vector/raster graphics

OpenGL, GLSL, Qt

Geometry, 2D/3D transformations

Texture mapping

Projections, perspective

3D viewing

Midterm

Shading

Curves and surfaces

Page 4: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

4Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Required Text

Edward Angel and Dave Shreiner, Interactive

Computer Graphics: A Top-Down Approach With

Shader-Based OpenGL, 6th Edition, Addison-Wesley,

2012.

Page 5: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

5Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Supplementary Texts

• Supplementary Texts:

- Graham Sellers, Richard Wright, and Nicholas Haemel,

OpenGL SuperBible, 6th Edition, Addison-Wesley, 2014.

- Kouichi Matsuda and Rodger Lea, WebGL Programming

Guide, Addison-Wesley, 2013.

- Mike Bailey and Steve Cunningham,

Graphics Shaders, 2nd Edition, CRC Press, 2012.

- Dave Shreiner, Mason Woo, Jackie Nieder, and Tom Davis,

OpenGL Programming Guide, 8th Edition, Addison-Wesley,

2013.• The definitive OpenGL programming reference

Page 6: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

6Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Grading

•The final grade is computed as follows:

- Midterm exam: 25%

- Final exam: 25%

- Homework programming assignments: 50%

•Substantial programming assignments are

due every three weeks.

•Proficiency in C/C++ is expected.

•Prereqs: CSc 221

Page 7: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

7Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Contact Information

•Prof. Wolberg

- Email: [email protected]

•Teaching Assistant (TA): Siavash Zokai

- Email: [email protected]

•See class web page for all class info such

as office hours, homework and source code:

www-cs.ccny.cuny.edu/~wolberg/cs472

Page 8: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

8Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Objectives

•Broad introduction to Computer Graphics

- Software

- Hardware

- Applications

•Top-down approach

•Shader-Based

•Programs in C/C++ will be assigned to

reinforce understanding of the material

Page 9: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

9Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Prerequisites

•Good programming skills in C (or C++)

•Basic data structures

•Geometry

•Simple linear algebra

Page 10: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

10Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

OpenGL Resources

• Can run OpenGL on any system

- Desktop OpenGL on Windows, Mac, Linux

- OpenGL ES on mobile platforms: iOS, Android

• Get Qt from www.qt.io/download-open-source

- Graphical user interface toolkit for all platforms

- Adds sliders, pushbuttons, advanced widgets to GUI

• www.opengl.org

- Standards documents and sample code

• www.opengl-tutorial.org

- Informative tutorials on basic and intermediate topics

• www.khronos.org

Page 11: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

11Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Outline: Part 1

•Part 1: Introduction

- What is Computer Graphics?

- Applications Areas

- History

- Image formation

- Basic Architecture

Page 12: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

12Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Outline: Part 2

•Part 2: Modern OpenGL (shader-based)

- Architecture

- Qt for advanced GUIs

- Simple programs in two and three dimensions

- Basic shaders and GLSL

- Interaction

Page 13: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

13Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Outline: Part 3

•Part 3: Texture Mapping

- Buffers

- Shader Applications

- Compositing and Transparency

Page 14: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

14Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Outline: Part 4

•Part 4: Three-Dimensional Graphics

- Geometry

- Transformations

- Homogeneous Coordinates

- Viewing

- Lighting and Shading

Page 15: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

15Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Outline: Part 5

•Part 5: Curves and Surfaces

- Bezier Curves

- Hermite Curves

- B-Splines

- Cubic Splines

- Coons Patches

Page 16: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

What is Computer Graphics?

Prof. George Wolberg

Dept. of Computer Science

City College or New York

Page 17: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

17Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Objectives

• In this lecture, we explore what computer graphics

is about and survey some application areas

• But we start with a historical introduction

Page 18: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

18Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Computer Graphics

•Computer graphics deals with all aspects

of creating images with a computer

- Hardware

- Software

- Applications

Page 19: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

19Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Related Fields

Image Processing

Scene

Description

Computer

Graphics

Computer

Vision

Image

Page 20: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

20Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Example

•Where did this image come from?

•What hardware/software did we need to produce it?

Page 21: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

21Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Preliminary Answer

•Application: 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 discrete graphics (GPU)

for modeling and rendering

Page 22: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

22Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Basic Graphics System

Input devicesOutput device

Image formed in frame buffer

Page 23: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

23Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

CRT

Can be used as a line-drawing device

(vector graphics) or to display contents of

frame buffer (raster graphics)

Page 24: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

24Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Computer Graphics: 1950-1960

•Computer graphics goes back to the

earliest days of computing

- Strip charts

- Pen plotters

- Simple displays using A/D converters to go

from computer to calligraphic CRT

•Cost of refresh for CRT too high

- Computers slow, expensive, unreliable

Page 25: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

25Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Computer Graphics: 1960-1970

•Wireframe graphics

- Draw only lines

•Sketchpad

•Display Processors

•Storage tube

wireframe representation

of sun object

Page 26: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

26Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Project Sketchpad

• Ivan Sutherland’s PhD thesis at MIT

- Recognized the potential of man-machine

interaction

- Loop• Display something

• User moves light pen

• Computer generates new display

- Sutherland also created many of the now

common algorithms for computer graphics

Page 27: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

27Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Display Processor

• Rather than have host computer try to refresh

display use a special purpose computer called

a display processor (DPU)

• Graphics stored in display list (display file) on

display processor

• Host compiles display list and sends to DPU

Page 28: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

28Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Direct View Storage Tube

•Created by Tektronix

- Did not require constant refresh

- Standard interface to computers• Allowed for standard software

• Plot3D in Fortran

- Relatively inexpensive• Opened door to use of computer graphics for CAD

community

Page 29: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

29Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Computer Graphics: 1970-1980

•Raster Graphics

•Beginning of graphics standards

- IFIPS• GKS: European effort

– Becomes ISO 2D standard

• Core: North American effort

– 3D but fails to become ISO standard

•Workstations and PCs

Page 30: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

30Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Raster Graphics

• Image produced as an array (the raster)

of picture elements (pixels) in the frame

buffer

Page 31: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

31Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Raster Graphics

•Allow us to go from lines and wireframes

to filled polygons

Page 32: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

32Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

PCs and Workstations

•Although we no longer make the

distinction between workstations and PCs,

historically they evolved from different

roots

- Early workstations characterized by• Networked connection: client-server model

• High-level of interactivity

- Early PCs included frame buffer as part of user

memory• Easy to change contents and create images

Page 33: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

33Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Computer Graphics: 1980-1990

Realism comes to computer graphics

smooth shading environment

mapping

bump mapping

Page 34: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

34Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Computer Graphics: 1980-1990

•Special purpose hardware

- Silicon Graphics geometry engine• VLSI implementation of graphics pipeline

• Industry-based standards

- PHIGS

- RenderMan

•Networked graphics: X Window System

•Human-Computer Interface (HCI)

Page 35: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

35Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Computer Graphics: 1990-2000

•OpenGL API

•Completely computer-generated feature-

length movies (Toy Story) are successful

•New hardware capabilities

- Texture mapping

- Blending

- Accumulation, stencil buffers

Page 36: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

36Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Computer Graphics: 2000-2010

•Photorealism

•Graphics cards for PCs dominate market

- Nvidia, ATI

•Game boxes and game players determine

direction of market

•Computer graphics routine in movie

industry: Maya, Lightwave

•Programmable pipelines

Page 37: Introduction to Computer Graphicswolberg/cs472/pdf/CSc472-01-Introduction.pdfIntroduction to Computer Graphics Prof. George Wolberg Dept. of Computer Science City College of New York

37Angel/Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

Computer Graphics: 2010-

• Xbox, Playstation

- Realistic rendering, animation

• Kinect sensor

- Gesture recognition

• Touchscreen interfaces

- Phones, tablets, Windows 10

• 3D scanning and printing

- Editing tools for rapid prototyping 3D models

• Virtual reality

- Oculus Rift, Samsung Gear VR, Google Cardboard