Announcements

Course Info

Instructor: Prof. Andrew Danner

Class: MWF 9:30am-10:20am Sci 105

Lab A: M 1:05-2:35pm Martin 327

Lab B: M 2:45-4:15pm Martin 327

Office hours: W 10:30am-12:00pm, R 1:30-2:40pm Martin 306

Edstem: CS40 Q&A forum

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.

Resources

There is no required textbook for this course.

Tutorials:

References:

Quick Checks for Online WebGL demos:

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. OpenGL, Qt, and CUDA are large software APIs and we will not be exploring them in great depth in a one semester 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 making larger changes or implementing new features in lab.

  • Start the lab assignments early. CS40 is a 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 Qt and OpenGL 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 EdStem. You should also feel free to email me to set up an appointment if you cannot attend normal office hours.

Schedule

WEEK DAY ANNOUNCEMENTS TOPIC & READING LABS
1

Sep 03

 

Course Introduction

No lab


Notes

Sep 05

 
2

Sep 08

 

OpenGL

  • OpenGL
  • Rendering Pipeline
  • Intro to Shaders/GLSL

Lab 1: Image Processing

Sep 10

 

Sep 12

 
3

Sep 15

Drop/Add Ends

Linear Algebra tools

  • Vector/Matrix prelims
  • Coordinate Systems

Lab 2: 2D Shape Rendering

Sep 17

 

Sep 19

 
4

Sep 22

 

Moving to 3D

  • Homogenous coordinates

Lab 3

Sep 24

 

Sep 26

 
5

Sep 29

 

Projection Transforms

  • Camera classes
  • LookAt matrix

Lab 4

Oct 01

 

Oct 03

 
6

Oct 06

 

Lighting

  • Surface normals
  • Phong Lighting

Midterm Project: Raymarcher

Oct 08

 

Oct 10

 
 

Oct 13

Fall Break

Oct 15

Oct 17

7

Oct 20

 

Intro to CUDA

  • GPU Memory
  • Kernels

Midterm Project continued

Oct 22

 

Oct 24

 
8

Oct 27

 

More CUDA

  • Synchronization
  • Parallel Patterns

Lab 5

Oct 29

 

Oct 31

 
9

Nov 03

 

Noise

  • Perlin Noise
  • Fractal Brownian Motion

Final Projects Begin

Nov 05

 

Nov 07

Last Day to Declare CR/NC

10

Nov 10

 

Particle Systems

Lab 6

Nov 12

 

Nov 14

 
11

Nov 17

 

Advanced Shading Methods

Lab 7

Nov 19

 

Nov 21

 
12

Nov 24

 

Acceleration Structures

Lab 8

Nov 26

 

Nov 28

Thanksgiving

13

Dec 01

 

TBD

Lab 9

Dec 03

 

Dec 05

 
14

Dec 08

 

Wrapup

Final Project Demos

Dec 10

 

Dec 14

Final Exams Start

 

Dec 20

Final Exams End

Grading Policies

Grades will be weighted as follows:

Table 1. Grading

40%

Lab assignments

15%

Quizzes

15%

Midterm Project

25%

Final Project

5%

Class Participation

Quizzes

There will be short in-class quizzes roughly every two weeks to check progress throughout the semester. Please bring something to write with on quiz days (and probably other days too).

Lab Policy

Lab assignments are submitted electronically using git, and are typically due by 7am {tzone} 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 Sunday night. 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 me 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.

Edstem Guidelines

We’ll be using Edstem, an online Q&A forum for class discussion, help with labs, clarifications, and announcements that pertain to all sections of CS40. You should be automatically enrolled in CS40 on Edstem. If you don’t have access, please let me know.

Edstem 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 Edstem, but keep in mind the following guidelines:

  1. Edstem 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 Edstem - 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 Edstem 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.