2025 April 7,

CS 311: Computer Graphics

Carleton College, Spring 2025, Joshua R. Davis, , CMC 324, x4095

Introduction

This course is an introduction to computer graphics. We focus on the two main algorithms for three-dimensional graphics: triangle rasterization and ray tracing. These algorithms produce almost all of the 3D imagery seen in computer-generated films, video games, etc. The course proceeds in three stages:

  1. We begin with a minimal programming interface that lets us make a window and set the colors of its pixels. Atop this primitive foundation we implement 2D triangle rasterization, interpolation, fragment and vertex shaders, and meshes. Then we transition to 3D and add depth buffering, projections, clipping, etc. In other words, we implement our own 3D graphics engine like (the core of) OpenGL, Vulkan, Direct3D, or Metal.
  2. We re-write our graphics engine to use the graphics processing unit (GPU). We learn how to run the triangle rasterization algorithm through Vulkan. We add features such as scene graphs and Phong lighting.
  3. Returning to the same minimal programming interface as in the first part of the course, we develop as much ray tracing as time allows. Definitely we implement shadows and mirror reflection with various scene objects. Possibly we implement transmission, constructive solid geometry, and meshes with hierarchical bounding volumes.

Graphics is a big field, so there is much that we don't cover: other 3D algorithms, most 2D algorithms, image processing, etc. Also, we spend as little time as possible on artwork. We are not making a polished film or game. Rather, we are making a technological foundation, upon which someone could build a film or game.

The prerequisite for this course is CS 208: Intro to Computer Systems. There are three reasons. First, students must have substantial programming experience, so that they can handle this course's projects. Second, students need to know the C programming language, which we use almost always. Third, students need to have some understanding of how memory is laid out in the computer, so that they can communicate with Vulkan.

We frequently use vectors and matrices — but only the basics of them. So, instead of requiring a linear algebra prerequisite, I provide tutorials. Talk to me if you are concerned about your background. I am happy to help you learn the necessary skills. :)

Your Work

You should expect to work hard and learn a lot. The College's accreditation says that a 6-credit course is 150 hours of work. That's about 15 hours per week or 5 hours per class meeting. Those 5 hours break down into about 1 hour for class itself and 4 hours for homework, reading, studying, etc. If you find yourself spending less time and struggling, then talk to me. If you find yourself spending much more time, then talk to me.

Participation

Our class meets in Leighton 305 CMC 328 during period 2A (MonWed 9:50-11:00, Fri 9:40-10:40). You are expected to attend every class meeting promptly, take notes, participate in discussion and group work, and ask and answer questions. You can make up for a deficiency in class participation by talking with me in office hours.

Laptops, phones, photos, and recordings are prohibited (except by special arrangement). Why? This course's material can't be typed easily on a keyboard. Using a laptop or phone measurably distracts the students around you. Photographing a chalkboard is not as educational as taking notes. I want our class to be a safe space, where students don't feel that they're on stage.

It is important that our course be welcoming to all students, regardless of their identities, backgrounds, and experiences. We all sometimes say and do things that make life worse for others, and we should all strive not to. Please let me know if the class feels hostile to you, because of something that I or someone else has done.

Three Projects

The first project (software triangle rasterization) takes about four weeks. In each class meeting, we learn a new concept or algorithm, which you implement in code before the next meeting. At the end of the project, I grade it by testing certain milestones and inspecting the code. Also, our grader grades your code a bit along the way, to make sure that you stay on track.

The second project (hardware triangle rasterization) is similar but only about two weeks long. It uses some of the code from the first project. It is possible that some students will have to use the CS lab machines in Olin 304 for this project.

The third project (ray tracing) is similar but takes about three weeks. It uses some code from the first project and some concepts introduced during the second project.

In all projects, late work is eligible for full credit, if it's submitted by the time it's graded. However, it is crucial that you keep up with the work as much as possible, because each day's code builds on the previous day's code. Therefore, as soon as you miss a deadline, e-mail me to tell me so. Then we can formulate a plan to get you back on track.

In all projects, you are encouraged to bounce ideas off your fellow students. However, the work that you submit must be your own work (done equitably with your assigned partner, if any). You may not copy someone else's work or allow them to copy yours — in person, over the Internet, etc. Using AIs is a kind of copying, so do not use AIs. Presenting someone else's work as your own is an act of academic dishonesty. The College requires me to report you if I suspect that you have not upheld its Academic Integrity standards.

In all projects, please do not publicly post your finished code. Although I change this course every time I teach it, I can't change everything, and I don't want unscrupulous future students to copy any of your work.

Two Exams

Exam A is given sometime during the first project — maybe during the fourth week. Exam B is similar but given later in the term — maybe during the third project?

Each exam might be written (in class) or oral (a fifteen-minute interview in my office). I haven't decided yet. The main goal of the exams is to test your understanding of the projects. For example, I might ask you to explain your code.

Grading

For better or worse, we are required to measure your learning using grades. Your numerical course grade is made from these elements: participation (5%), first project (25%), second project (20%), third project (20%), Exam A (15%), and Exam B (15%).

Numerical grades are converted to letter grades only at the end of the term. There are no predetermined percentages (90%, 80%, 70%, etc.) required for specific grades (A, B, C, etc.), because I cannot write assignments and exams that are so precisely tuned. Instead, I assign letter grades by comparing students' scores to the course goals. For example:

Resources: Help Yourself

If the preceding section is bad news, then these next few sections are good news. You are supported with multiple ways to learn the material. :)

Here are the three projects that make up the bulk of the course. The instructions are pretty detailed.

Here are exams from three earlier terms, with solutions and quartiles (75th, 50th, and 25th percentiles). Keep in mind that the topics vary slightly from term to term.

Here are some other resources produced by me specifically for this course.

Here are some external resources. There is no official textbook.

Resources: Your Partner

For the first week of the course, you are required to submit individual project work. You are encouraged to work in the same room with other students and bounce ideas off them, but the work that you submit for grading must be your own.

After the first week of the course, I assign partners. (You have the opportunity to express some preferences. You may also opt out entirely and work alone.) You keep your partner for the remainder of the first project, unless the partnership turns out to be dysfunctional. You and your partner develop a single code base, with both of your names on it, and submit a single copy for grading. Again you are encouraged to bounce ideas off other groups, but the work that you submit must be done by your partnership.

When we start the second project, you are assigned a new partner based on another poll of your preferences. There might also be some individual work.

When we start the third project, you are again assigned a new partner, and there might be individual work.

Resources: Other

I hold office hours several times per week, in my office, which is CMC 324. See below for times. No appointment is needed; just drop in! If you cannot attend office hours, then consult my weekly schedule and e-mail me, listing several times at which we could meet.

We have a course staff member, Nathaniel (e-mail: lin), who took this course when it was last offered. He provides preliminary grading of your code. You can also make an appointment with him for individual help sessions, during these times: Tuesday 3:00-5:00, Thursday 3:00-5:00, and Saturday 12:00-3:30. E-mail to set up an appointment one day (or more) in advance.

For help with linear algebra and other math, you can also visit the Math Skills Center on the second floor of CMC. For help with C programming (but not graphics content), you might try the CS lab assistants on the third floor of Olin.

It is reasonable to consult books or the Internet for help with math, C, or Vulkan details. For help with graphics material, I prefer that you don't consult the general Internet; please use me, your classmates, or the resources listed on this web site instead.

If a health condition or other personal matter affects your participation in class, homework, exams, etc., then please let me know as soon as possible. Depending on the situation, we might want to confer with Accessibility Resources, Assistive Technology, Student Health and Counseling, or Sexual Misconduct Prevention and Response. When you ask me to help, I do my best to help. :)