cs 148: introduction to computer graphics and imaging · cs 148: introduction to computer graphics...

57
CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm 1/26 Creative Expression (CE) WAYS course (only if taken for a Letter Grade)

Upload: others

Post on 14-Jun-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

CS 148: Introduction to Computer Graphics and Imaging

Ron Fedkiwcs148.stanford.edu

Tuesday and Thursday12 noon to 1:20pm

1/26

Creative Expression (CE) WAYS course(only if taken for a Letter Grade)

Page 2: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Graphics is Pervasive• Computer graphics is all around us!• No one prefers a *text only* interface when

interacting with a computer, cell phone, DVD player, ATM, or car– Note that the text is also visualized via graphics

based fonts

• Thus, learning at least a little bit about graphics is highly useful for all computer scientists…

2/26

Page 3: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

What can I do with graphics?

• At the very least:– improve your presentation and communication

skills (making demos, visualizations, etc. for your other work)

• That is, make better use of everyday tools:– e.g. cell phone (user interface, camera, 2D image

processing)

3/26PLAY: Google Glass Video

Page 4: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Smartphones (& Cameras)

• Sales of smartphones outweigh sales of cameras by a factor of 3•Most smartphones have cameras• 5 billion mobile phones are in use worldwide• 4.4 billion camera phones and 1.2 billion smartphones

•World population is 7 billion

4/26

Page 5: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

User Interfaces

Ivan Sutherland, Sketchpad, Light-pen,

vector display

Console Controller

Apple iPad

5/26

Page 6: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

2D Image Processing

6/26

Page 7: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Digital Media Technologies– Digital photography– Inkjet and laser printers– Digital video and HDTV– Electronic books– Graphics on the web:• Photos (flickr)• Videos (youtube)

Apple Laserwriter

Sony Video Camera

7/26

Page 8: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

What can I do with graphics?• Scientists/Engineers need graphics too• Visualization of various phenomena,

computer aided design, virtual prototyping, simulation, etc.

8/26

Page 9: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Scientific Visualization

The Virtual HumanKarl-Heinz Hoehne

Outside-InThe Geometry Center

9/26

Page 10: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Computer-Aided Design

Sketchup ProEngineer

10/26

Page 11: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Visual Simulation and Training• Apollo spacecraft• Flight simulators• Driving simulators• Surgical simulation

Davinci surgical robotIntuitive Surgical

Driving simulatorToyota Higashifuji Technical Center

11/26

Page 12: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

What can I do with graphics?• Check off a box on the bucket list: – learn more about the video games that lured

many to computers/CS in the first place

12/26

AR/VR too…

Page 13: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Video Games

Spore Crysis

Braid 13/26

Page 14: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Graphics Hardware

NVIDIA Fermi NVIDIA OptiX

14/26

Page 15: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Virtual (and Augmented) Reality

Ivan Sutherland: Head-mounted displays, with

mechanical tracker

Oculus Rift

15/26

Page 16: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

What can I do with graphics?

• Of course, Hollywood Visual Effects…• One often cannot film various real-world

situations required in order to tell a story– The situation may be too dangerous, impractical,

expensive, or rare– Or the situation doesn’t exist in reality, only in an

alternative reality

16/26PLAY: Maelstrom Video

Page 17: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

VFX: Liquids

Battleship

Terminator 2

The Day After Tomorrow17/26

Page 18: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

VFX: Gases

Harry Potter and the Order of the Phoenix

Star Wars Episode III

Terminator 3

18/26

Page 19: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

VFX: Solids

• Destruction: fracture, explosions, etc. Super 8

2012 19/26

Page 20: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

VFX: CG Creatures

Yoda, Star Wars Episode II

Sméagol/Gollum, The Lord of the Rings

20/26

Page 21: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

VFX: Digital Doubles

The Curious Case of Benjamin Button

21/26

Page 22: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Motion Capture Technology

Motion capture of Olympic swimmer Dana Vollmer by

Manhattan Mocap(technology transition)

Facial capture in Avatar

22/26

Page 23: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

What can I do with graphics?• Animated Films too…• Instead of adding computer generated

elements to real world film footage, create a whole new digital world – often with its own set of rules

23/26PLAY: Maelstrom Video

Page 24: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Animated Films

Toy Story 3 Monsters, Inc.

24/26

Page 25: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Graphics at Stanford

25/26

Page 26: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Overview of the Graphics Track

1. CS 148 (core class)A. Using the computer to draw pictures

B. Theoretical background (math/physics) for the technical aspects of drawing pictures

C. Coding: You will write code but will not submit any code. Instead, you will give live demos of working code

26/26

Creative Expression (CE) WAYS course

Page 27: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Overview of the Graphics Track

A. Core Courses CS 148, 248, 348B

B. Special Topics: CS 448

C. Math (e.g. CS205L), Geometry (e.g. CS348A)

D. Computer Vision, Image Processing, Robotics, Mobile Devices, Machine Learning, etc.

27/26

Page 28: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Graphics Faculty

28/26

Leo GuibasGeometry/ML

Pat HanrahanRendering/Viz

Ron FedkiwPhysics/ML

Maneesh AgrawalaHCI/Media

Doug JamesSimulation/Interactivity

More recently:

Kayvon FatahalianSystems/ Scalability

Karen LiuAnimation/Robotics

Page 29: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

CS148 (more details…)

29/26

Page 30: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Final Project

Scanline Render: Portal, Valve Corporation

Raytraced Render: San Miguel Scene, PBRT

Math and Optics 30/26

Page 31: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Lectures & HWTUESDAY THURSDAY HOMEWORK

Introduction Light and Color HW 1: set up environment

Scanline Rendering 1 Scanline Rendering 2 HW 2: openGL

Geometric Modeling 1 Geometric Modeling 2 HW 3: geometric modeling

Optics Shading HW 4: lighting & shading

Texture Mapping 1 Texture Mapping 2 HW5: texturing

Ray Tracing Sampling HW 6: sampling

Reflection and Transmission Acceleration Structures HW 7: acceleration structures

Global Illumination Photon Mapping HW 8: photon mapping

Advanced Rendering Image Brainstorming

Thanksgiving Recess Thanksgiving Recess

Final Project Discussion Final Project Discussion

Final Exam: TBA Final Project Due

31/26

Page 32: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Assignments & Grading50% final project, 32% homework, 18% “engagement”

• The weekly graded homeworks are designed as building blocks towards the final project, which is a single ray traced image– We will first learn to do some things using openGL in real time for more efficient scene

design– Then we will move on to the ray tracer and work towards the final scene

• You may have a partner for both the homeworks and the images – you may change partners as often as you wish throughout the quarter

• Homework is assigned Tuesday and due the following Monday from 3-7pm• Grading is done via live demos with the CAs

– The CAs will/may ask you various questions– Make sure you can answer questions about all parts of the code, regardless of which

parts you or your partner may have done individually• Grading is based on a 0-4 point grading scale

– If your homework grades are not going well, do not be surprised if your final image grade is lower than you expect

– Working with *feedback* is very important in computer graphics!

32/26

Page 33: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Class Engagement 18%• Admittedly, it is entirely possible to learn any highly technical subject matter at home,

without attending class or even going to college for that matter. However, as a general education WAYS class, CS148 aims to increase those additional things learned (even often about the technology itself) through social interactions. In fact, one should be interacting quite a bit with others when trying to create compelling imagery as there is an artistic component - this will be salient for the class final project/image.

• As such, we aim to increase one’s “engagement” in this course by allowing the use of a partner, having in-person grading sessions, and by promoting class attendance and discussion. In particular, there will be a number of in class exercises that are meant to encourage following along in lecture, thinking about the material as it’s presented, and discussions with others both inside and outside of class. To encourage these interactions, these “engagement” exercises will amount to 18% of the final grade.

• Optionally, if you have to miss some classes for whatever reason, we will aim to address your WAYS liberal arts “engagement” experience with an alternative writing assignment meant to promote both brainstorming and thinking about and/or summarizing the course material. We refer to these as LONG FORM alternatives to the SHORT FORMengagement exercises carried out in class. Generally speaking, a LONG FORM writing assignment should be about 500-1000 words in length (which is 1-2 reasonably typed pages).

• SCPD students will do the SHORT FORM assignments, or a similarly constructed alternative. 33/26

Page 34: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Class Engagement 18%• Nothing today (Lecture 1)

• 1 point each (1%) for the 15 lectures from Lecture 2 to Lecture 16 inclusive

• 1-3 points (1-3%) for submitting an image for Lecture 18– Start looking for good images now…

• Lectures 17, 19, and 20 are optional

34/26Some ideas for lecture 18 motivational images…

Page 35: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

35/26

Page 36: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

36/26

Page 37: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

37/26

Page 38: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

38/26

Page 39: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

39/26

Page 40: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

How To Approach This Course

40/26

• This is essentially a project based course• Your goal is to explore digital image creation via various

computer graphics techniques• The course is supposed to be fun!• It’s not supposed to be a programming or math course, except that

programming and math are necessary enabling technologies• The instructor and CAs are your guides• Lectures are meant to lead you in the right direction --- just

to get your started• They are not meant to tell you everything• You should utilize the reference reading materials• You should utilize the CAs, your classmates, online resources, and your

imagination…

• WARNING: There are limited options to explore creativity and artistry in CS courses; exploit this one… J

Page 41: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Don’t do this…

41/26

Page 42: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Reasons to take this class…

42/26

• Creativity• this class counts as a CE, creative expression, WAYS course• this class encourages and rewards creativity above all else; albeit, technical skills are taught and

required• very few other classes in CS encourage and reward creativity; this is one of your only options• academic and industry research requires creativity, so it’s good to develop• by mixing visual artistry and computer science, one hopes to learn how to better use their

creativity in their everyday technical approaches • Machine Learning

• CNNs are built off the human visual system and follow the nonlinear projection space used by one’s eyes

• Computer Vision is one of the main application areas for machine learning, and this class discusses light, geometry, materials, cameras, etc. in a way that adds more insight to computer vision

• GANs and similar ideas were developed intuitively by thinking about human vision and photographs (material covered in this class)

• Graphics is full of procedural methods for texture, geometry, etc. which are all good candidates for machine learning (good research topics)

• Computer Graphics• Introductory course for the sequence…

Page 43: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

NEW THIS YEAR(on a trial basis…)

43/26

Page 44: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

“Stress-Relief” Points

44/26

8 free points (as in 8% of the grade) applied as follows:

Homework • Any HW score less than the 4 point maximum is assigned (at most) 1 point in order to raise it• That is, a 0 raises to a 1, a 1 raises to a 2, a 2 raises to a 3, and a 3 raises to a 4• No extra points are allowed, so a 4 is NOT raised to a 5• Essentially, if you can get 3 out of 4 points on every HW, you get a perfect HW score• We stress, each HW score is raised by 1 point only, and extra points from perfect 4 point HWs cannot be

rolled over into other lower scoring HW assignments• Rationale: Every HW assignment is useful for your final project in some way, so we want you to try on all

of them. But, we would like more of a focus on the final projects.

Engagement• Every time you score a 4 on a HW assignment, the bonus point is rolled into engagement instead, with

the rationale that working diligently on programming assignments (hopefully with your partner and the CAs) should also count as a form of immersion

• This means that one could earn from 1 to 8 points towards engagement by completing that number ofHWs with a perfect score of 4 out of 4

• Each such point allows you to skip SHORT/LONG form for one of the 15 required lectures• or alternatively, points may be applied to the 3 point motivational image

• Your engagement score will be clamped at 18 points (so, there is no rollover into projects)

(“Chill” Points)

Page 45: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

Some Images from Prior Years…

45/26

Page 46: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

46/26

Page 47: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

47/26

Page 48: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

48/26

Page 49: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

49/26

Page 50: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

50/26

Page 51: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

51/26

Page 52: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

52/26

Page 53: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

53/26

Page 54: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

54/26

Page 55: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

55/26

Page 56: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

A 348B image…

56/26

Page 57: CS 148: Introduction to Computer Graphics and Imaging · CS 148: Introduction to Computer Graphics and Imaging Ron Fedkiw cs148.stanford.edu Tuesday and Thursday 12 noon to 1:20pm

57/26