Announcements

  • Please set your Partner preferences for the Final Project and to get a repo.

  • The schedule for the Final project is out. You will work on this until the end of the semester. Please think about ideas and partners this week and start getting an outline of your code in place.

  • Friday office hours have moved to 3pm-4pm to accommodate faculty meeting schedules. On days without faculty meetings, I may be available earlier on Friday too. Check in on Slack.

  • Current Week Notes

Course Info

All times on this page are US EST (UTC-5 From Nov 1)

Instructor: Prof. Andrew Danner

Class: MWF 10:40am-11:30am, hosted on Zoom

Office hours: Check in on the #office-hours channel in Slack to start a meeting.

  • Wednesday: 1:30pm-2:30pm

  • Wednesday Evening: 9:00pm-10:00pm. Priority is given to students in Pacific and East Asian time zones.

  • Friday: 3:00-4:00pm

A

Mon. 1:15-2:45pm

start on Zoom, move to Slack

B

Mon. 3:00-4:30pm

start on Zoom, move to Slack

Piazza: CS40 Q&A forum

Resources

There is no required textbook for this course.

Refer to the Remote Tools page for a summary of general remote work tools

Tutorials:

References:

Quick Checks:

Other References: Most of these use C/C++ as the language, but the general API is the same. Additionally, the OpenGL Shading Language (GLSL) is very similar for web versions (#version 300 es) and desktop versions (#version 410). They may be helpful if you are interested in exploring more of OpenGL.

Course Goals

By the end of the course, you will have developed the following knowledge and skills:

  • You will learn how to write programmable shaders to manipulate vector geometry and render 3D scenes into a 2D image buffer.

  • You will learn alternative pixel based rendering methods such as ray tracing that bypass the vector geometry processing pipeline.

  • You will learn how graphics hardware leverages the Single Instruction Multiple Data (SIMD) architecture to accelerate the processing of millions of vectors in parallel. Additionally, you will better understand cases in which the SIMD architecture is/is not beneficial.

  • Through CUDA, you will learn how GPU hardware can be used to solve problems related to and distinct from computer graphics.

  • You will improve your software engineering skills by learning more advanced coding features, using multiple third party packages, and practicing visual debugging techniques.

  • You will learn to apply multiple course concepts to a final project of your own design.

Student Responsibilities

CS40 requires you to understand several linear algebra and geometric concepts and apply them to an advanced codebase in a highly specialized parallel computing environment. WebGL, Three.js, and CUDA are large software APIs and we will not be exploring them in great depth in a twelve week course. To succeed in this course, you should consistently do the following:

  • Attend class and lab sessions. The primary introduction to course material is through class instruction. Attending class is essential for understanding the subject. Lab sessions provide additional time to get hands on practice with the course material. Lab attendance is mandatory.

  • Participate actively in the learning process. The best way to learn this material is through constant effort. Run the demos and make small changes in a sandboxed environment before make larger changes or implementing new features in lab.

  • Start the lab assignments early. CS40 is coding course that relies on a number of specialty third party libraries. It is extremely difficult to understand, write, and test solutions at the last minute. It may be impossible to work on some labs remotely over ssh. I understand that it is not always possible to put serious time into an assignment early. However, even 30-60 minutes will be helpful, to ensure that you understand what the problems ask of you and to help you start thinking about where sticking points will be early.

  • Consult the documentation. In class examples or starting points for lab assignments will often have sample uses, but Three.js and WebGL functions often have numerous options or flags that may be helpful. Consulting the documentation for these libraries should be part of your course learning.

  • Seek help early and often. Because course material builds on previous material, it is essential to your success in this class that you keep up with the course material. If you feel you are falling behind or having trouble grasping a concept, please come to office hours. Ask questions, and review other questions on Piazza. You should also feel free to email me to set up an appointment if you cannot attend normal office hours.

Course Description

Welcome to CS40: Computer Graphics! This course focuses on the creation and manipulation of 3D geometric models and the rendering of these models on a two dimensional screen. We will examine modeling from both a pixel-based view and a more geometric vector-based approach. Core topics include geometric primitives, 2D and 3D matrix transformations, projective geometry, and object modelling. We’ll examine the traditional rendering pipeline and will explore advanced techniques for scene manipulation using programmable shaders. Intermediate topics include texture mapping, lighting, and shadows. We will be using the modern OpenGL programming approach which uses programmable vertex and fragment shaders throughout the course. Advanced topics may include GPGPU computing using CUDA, particle systems, noise, and additional programmable shaders.

Schedule

WEEK DAY ANNOUNCEMENTS TOPIC & READING NOTES/LABS     
1

Sep 07

 

Introduction
Set up all the things
OpenGL overview

notes
lab 1: Image Processing

Sep 09

 

Sep 11

 
2

Sep 14

Drop/add ends

Rendering pipeline
Shader Variables
Basic Animation

notes
lab 2

Sep 16

 

Sep 18

 
3

Sep 21

 

Vector/Matrix Prelims
Moving to 3D
Immersive Linear Algebra
Coordinate Systems

notes
lab 3

Sep 23

 

Sep 25

 
4

Sep 28

 

Projection Transforms
Camera and View Matrices

notes
lab 4

Sep 30

 

Oct 02

Quiz 1

5

Oct 05

 

Perspective Matrix
Blinn-Phong Lighting

notes
lab 5

Oct 07

 

Oct 09

 
6

Oct 12

 

Lighting, Normals
Intro to Ray Tracing/Ray Marching

notes
No Lab

Oct 14

 

Oct 16

 
7

Oct 19

 

Raymarching

notes
Midterm Project

Oct 21

 

Oct 23

 
8

Oct 26

 

Perlin Noise

notes
Midterm Project

Oct 28

 

Oct 30

 
9

Nov 02

 

Particle Systems

notes
Midterm Project

Nov 04

 

Nov 06

CR/NC/W Deadline

10

Nov 09

 

Normal Mapping
Tangent Space

notes
Final Project

Nov 11

 

Nov 13

 
11

Nov 16

 

Computational Geometry
Voronoi Cells
Cellular Noise

notes
Final Project

Nov 18

 

Nov 20

 
 

Nov 23

Thanksgiving

Nov 25

Nov 27

12

Nov 30

 

Advanced Shading Methods


notes
Final Project

Dec 02

 

Dec 04

 
 

Dec 08

Final Exams Start

Dec 15

Final Exams End

Grading Policies

Grades will be weighted as follows:

40%

Lab assignments

15%

Quizzes

15%

Midterm Project

25%

Final Project

5%

Class Participation

Quizzes

There will be two to three graded quizzes on course content throughout the course. You will have a time window in which to take the quiz to accomodate your schedule and time zone.

Lab Policy

Lab assignments are submitted electronically using git, and are typically due by 7am EST on Monday mornings. You may submit your assignment multiple times, but only the final submission will be graded.

Some labs will be individual assignments to ensure that everyone knows the basics of the course material. Later, we will transition to partnered lab assignments to allow you to work on more complex problems.

Late Policy

Lab assignments will typically be assigned Monday afternoon before lab and will be due the following Monday morning (EST). You must submit your assignments electronically by pushing to your assigned git repository. You may push your assignment multiple times, and a history of previous submissions will be saved. You are encouraged to push your work regularly.

To help with cases of minor illness, or other short-term time limitations, each student may use up to two late days per lab assignment, up to a total sum of five days for the semester, no questions asked. To use your extra time, you must email me after you have completed the lab and pushed to your repository. You do not need to inform anyone ahead of time. When you use late days, you should still expect to work on the newly-released lab during the following lab section meeting. Lab time will not be used to answer questions about the previous lab. Your late days will be counted at the granularity of full days and will be tracked on a per-student (NOT per-partnership) basis. That is, if you turn in an assignment five minutes after the deadline, it counts as using one day. For partnered labs, using a late day counts towards the late days for each partner. In the rare cases in which only one partner has unused late days, that partner’s late days may be used, barring a consistent pattern of abuse.

If you feel that you need an extension on an assignment or that you are unable to attend class for two or more meetings due to a medical condition (e.g., extended illness, concussion, hospitalization) or other emergency, you must contact the dean’s office and your instructor. I will coordinate with the deans to determine and provide the appropriate accommodations. Note that for illnesses, the College’s medical excuse policy states that you must be seen and diagnosed by the Worth Health Center if you would like them to contact your class dean with corroborating medical information.

Academic Integrity

Academic honesty is required in all your work. Under no circumstances may you hand in work done with (or by) someone else under your own name. Your code should never be shared with anyone; you may not examine or use code belonging to someone else, nor may you let anyone else look at or make a copy of your code. This includes, but is not limited to, obtaining solutions from students who previously took the course or code that can be found online. You may not share solutions after the due date of the assignment.

Discussing ideas and approaches to problems with others on a general level is fine (in fact, we encourage you to discuss general strategies with each other), but you should never read anyone else’s code or let anyone else read your code. All code you submit must be your own with the following permissible exceptions: code distributed in class, and code found in the course text book. In these cases, you should always include detailed comments that indicates on which parts of the assignment you received help, and what your sources were.

Failure to abide by these rules constitutes academic dishonesty and will lead to a hearing of the College Judiciary Committee. According to the Faculty Handbook: "Because plagiarism is considered to be so serious a transgression, it is the opinion of the faculty that for the first offense, failure in the course and, as appropriate, suspension for a semester or deprivation of the degree in that year is suitable; for a second offense, the penalty should normally be expulsion."

The spirit of this policy applies to all course work, including code, homework solutions (e.g., proofs, analysis, written reports), quizzes, and exams. Please contact me if you have any questions about what is permissible in this course.

Academic Accommodations

If you believe you need accommodations for a disability or a chronic medical condition, please contact Student Disability Services via e-mail at studentdisabilityservices at swarthmore.edu to arrange an appointment to discuss your needs. As appropriate, the office will issue students with documented disabilities or medical conditions a formal Accommodations Letter. Since accommodations require early planning and are not retroactive, please contact Student Disability Services as soon as possible. For details about the accommodations process, visit the Student Disability Services website.

To receive an accommodation for a course activity, you must have an Accommodation Letter from the Office of Student Disability Services and you need to meet with us to work out the details of your accommodation at least two weeks prior to the activity.

You are also welcome to contact us privately to discuss your academic needs. However, all disability-related accommodations must be arranged, in advance, through Student Disability Services.

Piazza Guidelines

We’ll be using Piazza, an online Q&A forum for class discussion, help with labs, clarifications, and announcements that pertain to all sections of CS40. You should have received an email invitation to join CS40 on Piazza. If you didn’t, please let me know.

Piazza is meant for questions outside of regular meeting times such as office hours, class, and lab. Please do not hesitate to ask and answer questions on Piazza, but keep in mind the following guidelines:

  1. Piazza should be used for longer form questions outside of class, lab, office hours. Please do not use email to exchange with code or ask detailed questions about the assignments.

  2. If there is a personal issue that relates only to you and not the course content, email is acceptable.

  3. We encourage non-anonymous posts, but you may post anonymously.

  4. Do NOT post long blocks of code on Piazza - if you can distill the problem to 1-2 lines of code and an error message, that’s fine, but try to avoid giving out key components of your work.

  5. When answering a question, try to give some guiding help but do not post code fixes or explicit solutions to the problem.

  6. Posting on Piazza counts toward your participation grade, both asking and answering!

Links that are related to the course may be posted here. If you have suggestions for links, let me know.