Welcome to Computer Graphics Williams College CS371: Computer Graphics Fall 2012 Information and Policies

September 8, 2012 Instructor Lecture Lab Office Hours Prerequisites Textbooks

Web page

Prof. Morgan McGuire TCL 206 MWF 12:00 pm - 12:50 pm TCL 216 Thu 1:00pm - 4:00 pm see website CS136 and CS237 McGuire, The Graphics Codex, Casual Effects (iOS App), 2012 Shirley et al., Fundamentals of Computer Graphics, 3rd Edition, A K Peters 2009 http://graphics.cs.williams.edu/courses/cs371

Contents 1 Introduction

3

2 Motivation

4

3 New and Experimental this Semester 3.1 Your Vision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 The Graphics Codex . . . . . . . . . . . . . . . . . . . . . . . . .

5 5 5

4 Grades

7

5 Schedule

8

6 Resources

8

7 Honor Code

10

1

The theme of this course is the process of framing and answering computational questions in domains outside computer science, with realistic image synthesis as a motivating application. The course brings together elements of many disciplines: • Art motivation - representational images, composition • Physics models - ray optics, quantum mechanics • Math framework - topology, geometry, measure theory, calculus, linear algebra • Computer science algorithms and optimization - approximation algorithms, analysis, real-time systems, numerical methods, hardware architecture

• Software engineering practice The keystone of the course is a deep dive into photorealistic image synthesis: • Perceptually significant phenomena • A mathematical model of light transport • The photon mapping generalization of ray and path tracing algorithms ...emphasizing great contributions from graphics to all computer science: • Spatial data structures • Importance sampling for Monte Carlo methods We actively study the craft of research and development: • Presenting technical material • Architecture-aware optimization • Reading technical documents • Scalable software development – – – –

Managing workflow on solo and team projects Data-centric design Compilers, profilers, documentation, revision control, large libraries Programming massively parallel processors

There are nine, cumulative projects of varying levels of challenge. You will choose your own topic and team for two of these. The course begins with theory and shifts towards implementation. Expect to read more at the beginning of the semester and program more at the end. See the schedule to judge workflow for each week. Expect an average of 12 hours a week of work, including scheduled class time. 2

1

Introduction

Computer Graphics is the science of enabling visual communication through computation. It is used in film, video games, medical imaging, engineering, and machine vision. The field of computer graphics plays a significant role within computer science. Many general computer science algorithms were first developed within the graphics community, such as kd-trees and bounding volume hierarchies. This is one of the few areas of computer science that emphasizes geometry and multidimensional, continuous mathematics (vs. discrete math and logic), so it applies well to many real-world problems beyond graphics itself. The Association for Computing Machinery (ACM) SIGGRAPH conference draws 20,000 to 50,000 Figure 1: Rendered 3D scientists, engineers, and artists every year image by Zhelem Andrey and is “regarded as the premier technol- http://forums.cgsociety.org/ ogy conference in the world.”1 Graphics showthread.php?f=121&t=375437 is of course pervasive in everyday life, from streaming video and user interfaces to 3D video games and films. CS371 deeply explores the core computer graphics problem of efficiently rendering images of realistic 3D scenes. The course emphasizes a holistic approach in which you’ll take nine projects from mathematical theory through software development to presentation of experimental results. The projects are cumulative and many are collaborative. The course begins with emphasis on thought experiments and derivation in lecture, shifts understanding and implement specific algorithms that have stood the test of time, and then resolves with emphasis on a final project of your own design.

1 http://www.siggraph.org/about/acm-siggraph-overview

3

2

Motivation

CS371 uses graphics as motivation for computational and engineering topics that generalize to areas beyond 3D rendering. The core algorithms and skills that I want you take away from the course are: 1. Spatial data structures 2. (Parallel) Monte Carlo methods 3. Scalable software design 4. Efficient, team software development 5. Identifying computational problems outside computer science These are essential for graphics, and valuable for any area of computer science. I think the most important of these in the long term is developing your ability to identify and solve computational problems in domains outside computer science. Think of this as teaching you to fish instead of giving you a fish. Working from ill-specified problems that arise outside CS is probably what you’re going to face after you graduate, whether you go into industry or academia, and whether or not your major is computer science. I also believe that looking at problems and working with people beyond your Figure 2: Paintball video game fiown background is the biggest way for you nal project by Mitch Brooks ’07 to have an impact on the world, since most and Mark van Mechelen ’07. people are not computer scientists and the most important problems do not arise from computer science. Many other courses–such as networking, data structures, architecture, compilers, and operating systems–develop your ability to solve problems that arise within computer science and computers themselves. In contrast, graphics is about working with problems that arise in physics and art. The challenge here is not just solving a computer science problem but also framing the problem in computer science terms in the first place. When you learn to do that, you can apply it anywhere–for example, to biology, medicine, geoscience, nuclear engineering, or finance.

4

3

New and Experimental this Semester

My goal is to create an exclusive and supportive educational environment, but do so in a way that interfaces with and prepares you for the world outside Williams. That means using real development workflow, real data sets, and real papers. For Fall 2012, I streamlined the projects and added experimental elements to the course. This is intended to give more careful study of the most important topics and help space out your workload during the semester.

3.1

Your Vision

This course has always been about enabling students to implement their own visions. The entire course builds the technical and workflow tools to enable you to create a significant final project of your own design. However, based on student feedback from previous offerings, this year I’m bringing your vision to the forefront from the first day on, and adding new material to inspire the human aspects that drive our study. I’ve reserved time in class to screen the short films that I used to show as an optional part of lab. These will expose you to visual communication outside of what you may have experienced on TV and in mainstream movies. They are intended as inspiration for directions to pursue in your own work. The first project asks you to articulate your own vision for what you want to achieve with computer graphics this semester. Each project then contains a creative section in which you’ll use the software that you wrote to explore that vision. You can also change your vision at any time or experiment with different ideas for particular assignments. I’ll tailor some of the lecture content and film selections to your choices, and help you design midterm and final projects based on your vision. To accommodate the new emphasis on creative and artistic vision, I’ve reduced the requirements of the labs about 15% and reduced the amount of lecture material for which you’ll be responsible. You aren’t missing any technical material–this year the reading actually contains more information than has been presented previously in this course, but it is now structured in a way that focuses on the big ideas and clearly separates the optional and required elements.

3.2

The Graphics Codex

To embrace technology for visual communication, I wrote an iPad app called The Graphics Codex that serves as one of our two textbooks for the course. It contains both a web of cross-linked reference material and linear textbookstyle chapters. I’m actively updating the app throughout the semester with new content and features. I’ve also connected the course web page, syllabus, and code documentation and the app through hyperlinks so that you can quickly move between them. Most new textbooks sell for $60 to $120; I’d like to democratize education by making high-quality textbooks available electronically for about $15 and take advantage of the new medium to enhance the classroom experience.

5

This is the first class in which I’m trying it. Most of the reading in the beginning of the course will be from The Graphics Codex, although I’ve given the numbers of similar chapters in Shirley’s traditional textbook as well on the syllabus in case reading on the app really isn’t working out well for you. To read the app, you of course need an iPad. You can borrow an iPad for the semester from Jim Lillie in the OIT Equipment Loan Center (ELC) on Monday, September 10th. The ELC is in the small annex building next to Dodd. If you own an iPad 2 or 3, please use your own device to ensure that enough are available from OIT for everyone (they just bought a limited number for this course, but enrollments exceeded expectations). Technically, you can use The Graphics Codex on an iPod touch or iPhone, but I don’t recommend it and haven’t optimized the layout for smaller devices in the current version. The app itself and how to use it in the classroom are both a big experiment. I’m depending on you to actively try new ways of using it in lecture and lab, and to suggest ways to improve it throughout the semester. If this works well I’ll repeat it in the future and make the books for other courses available for tablets as well. If not, I’ll try something different next time.

6

4

Grades

You’ll receive extensive written and oral feedback on your work in this course. I recommend that you pay attention to that instead of the numeric grades. If you respond to the qualitative feedback your grades will naturally be high. I will evaluate your participation in the course, individual work, and group work when assigning a final grade. Participation means actively engaging with other students and the material. You can demonstrate this in many ways. The most prominent is asking and answering questions in lecture and on the [email protected] mailing list. Of course, you can’t participate if you aren’t present, so you need to attend all labs and lectures and be there on time. Note that the course honor code policy specifically encourages much more collaboration between students than you may have experienced in previous courses. Participation counts for 15% of your final grade. There are nine projects in the course. These combine mathematics, software design, programming, team management, and presentation of results and software artifacts. Each project includes information about how I will evaluate it. In general, I am more interested in your process than the end result, because as you improve your development process the results will naturally fall into place by the end of the course. So, focus on working in an efficient and principled manner, and don’t be overly concerned with whether your program does everything that you (or I) wanted it to. To support this approach, I will give you an extensive evaluation of each project, covering everything from theory to small programming tips. I will group the evaluation into four categories, each with a quantitative and qualitative evaluation: • Mathematical correctness • Adherence to the specification • Program quality (design, documentation, software overview in the result) • Report quality (experiment design, answers to questions, presentation) When I compute the project component of your final grade for the course, I will drop the lowest project grade (except for the final project!), weigh the others by the number of school days that you had to work on them, and then normalize the weights. Most group projects contain an individual component as part of the “checkpoint”. This ensures that everyone has mastered the key ideas. For the group portion of your grade, you’re being assessed on two things: your mastery of the theory, and your ability to effectively develop software in a team. Except in cases of severe negligence on the part of a team member, everyone in the group will receive the same grade for the group component of the project.

7

Figure 3: Fluid simulation final project by Charles Cao ’09 and Kefei Lei ’10

5

Schedule

The course schedule, including project deadlines and topics is on the course website at http://graphics.cs.williams.edu/courses/cs371/f12/schedule.html. The deadlines are firm. You can plan your other courses and extra curricular activities around them. Note that projects have varying difficulty levels that are marked on the schedule and plan accordingly. The reading assignments and lecture topics will shift slightly throughout the semester in response to your feedback. There are no extensions to project deadlines in CS371. If you know that you will be absent at a deadline, submit your work early. If you are ill or have an emergency, send me e-mail as soon as possible so that I know what is going on. I will not grant an extension but I factor the extenuating circumstances into your final grade. (If you completely miss a project, then that will just be the low project grade that is dropped anyway, so you have a safety net.) Sporting events, holidays, and field trips for other courses are not extenuating circumstances. Please plan around them to honor your academic responsibilities.

6

Resources

Your primary resources are your own class notes; the app, textbook, and other assigned reading materials; and the documentation for the tools and libraries

8

we use. Refer to the online schedule for citations of the reading materials and the textbook that you should purchase. On OS X, you can obtain information for most command line tools using the man program or by supplying the --help option. The G3D library that we use is open source. The source code is part of the documentation. Use the debugger, grep, find and the SourceForge code search to find how things are implemented and to locate example code. G3D also comes with several sample programs. When you can’t find the answer to your questions in your primary sources, or don’t understand the answers you found, you have several options: • E-mail [email protected]. Anyone can answer; I might as well. I like to see discussions between students on the mailing list because that benefits everyone and shows that you’re learning how to work together. The benefit of the mailing list is that there is a record and it is asychronous. • Ask another student in person. • Post to the G3D user’s forum [email protected] (library usage questions only). The question may still be answered by me or another member of the class, but this way all G3D users will get the benefit. • Come to office hours. • Ask in lecture or lab. • Schedule an appointment with me—just e-mail me a few times that you’re available and I’ll pick one. • E-mail me at [email protected] if you are concerned that e-mailing cs371 would give too much information to other students. I may carboncopy cs371 on the response if I think it was a common question. One advantage of the Subversion revision control system used in CS371 is that I can see any code that you have committed. So, even outside of regular school hours I may be able to look at your code and advise you about how to fix problems over e-mail. I can often respond to student e-mails quickly, especially if they contain straightforward questions. Of course, I can’t promise quick responses to e-mail. I probably keep different hours and am online less than you. So I may not be able to reply for some time if I’m away from the Internet or working on a different project. Please do not send me messages by Facebook, Twitter, SMS, Steam, Google Talk, instant messenger, or other electronic formats. Depending on the format, they either aren’t reliable, aren’t private, or I don’t pay attention to them.

9

Figure 4: Racing game in the visual style of a graphic novel by Aaron Schwartz ’09 and Kyle Whitson ’09.

7

Honor Code

Submitted work (i.e., projects) must contain only: code written solely by you and your assigned partners, code written by yourself or other CS371 students this semester for previous assignments, and code from the G3D library. For the final and midterm projects you may use external libraries with prior approval from me by e-mail. Code from previous assignments must be clearly credited both where it is used and in your index.html file. It may be used only with permission of the students involved. Note that you are encouraged to work from other students’ sources. You are strongly encouraged to discuss design, debugging, and mathematics related to projects (except where they are the specific questions in a project specification) with other students. Note that using previously submitted work and discussing projects is a more liberal policy than the default CS department policy for programming projects. Coursework in this class reflects your maturity and is modeled on professional research and development: we tackle hard problems, and do so together. Recall that in accordance with the CS department policies, looking at any other computer user’s files without permission is unacceptable, regardless of whether those files are protected on the file system. Remember that the policies for this course are in addition to the policies of the Computer Science department and the College as a whole. Ask me if you are unsure of the correct conduct in a specific case. In the event that you accidentally violate the honor code or observe someone else violating the honor code, discuss it immediately with me and the department chair to avoid misunderstanding.

10