Course overview. Due to the Covid-19 shutdowns, this course will be completely "remote" for Spring 2020.
This course is a second course in 3D computer graphics, a continuation of Math 155A, covering the mathematical foundations of computer graphics and "modern" OpenGL programming. Topics covered include: Bézier curves, B-spline curves, shader programming, radiosity, ray tracing, kinematics and animation. The course grade will be equally based on exams/homeworks/quizes and on programming assignments. Because of the need to encourage interaction and engagement, the course grade will also be partly based on "participation" or "engagement".

Online textbook and other materials:

Textbook: 3D-Computer Graphics: A Mathematical Introduction with OpenGL, by S. Buss (your instructor). Math 155B will cover the second half of the textbook, starting with chapter 7 of the textbook and also including Chapter 3. The second edition to the textbook incorporates Modern OpenGL and other updates. Downloadable PDF copies will available to you at the link above. SO YOU SHOULD NOT PURCHASE THE TEXTBOOK.

Course prerequisites. Math 155A or CSE 167 are the primary prerequisites. Since the campus computer labs are likely to be closed for the quarter, it will be help to have a computer with a C++ compiler that can compile and run OpenGL programs: this should be OK on any Windows 10 (or 7) system, any Linux system, and most Macintosh's. Alternatively, you can develop C++ and OpenGL programs using remote login to UCSD's CloudLabs. The first week's assignment will address this requirement.

Class time/location:
   Zoom Meetings, Tuesday & Thursday 12:30-1:50pm.
   Section meetings with TA Jon Pham. On Zoom, time TBD.
   Office hours via zoom, and piazza discussion.

Class schedule as a google calendar: HTML link.

Instructor: Professor Sam Buss
   Office: N/A
   Phone: 442-2877 (personal cell phone, area code 858)
   Office hours: Default office hours (see the calendar above for changes),
      Via Zoom: To be announced.
      Please message on piazza or email for personal meetings.

Teaching Assistant:

   Jonathan Pham.
      Office hours: Default office hours (see the calendar above for changes),
         TO BE ANNOUNCED. Please see the calendar above.

Homework Assignments (Most answers will be available via gradescope answer key.)
   Homework #1. Gamma Correction and sRGB.
      Turnin via GradeScope (
   Homework #2. Vertex and Fragment Shaders.
      Turnin via GradeScope (
   Homework #3. Bezier Curves (first assignment).
      Turnin via GradeScope (
   Homework #4. Bezier Curves (second assignment).
      Turnin via GradeScope (
   Homework #5. Overhauser curves, Bezier patches, rational curves' derivatives.
      Turnin via GradeScope (
   Homework #6. NURBS.
      Turnin via GradeScope (
   Homework #7. NURBS, Geometry Shader, Basic Ray Tracing.
      Turnin via GradeScope (
   Homework #8. Yaw-Pitch-Roll, Quaternions and Slerp-ing.
      Turnin via GradeScope (

Programming Assignments Programming projects are personal projects. You may consult with other students, interact with other students. But you should not directly copy code. It is OK to see small pieces of another student's code, but you should not just cut-and-paste it into your own program. You should instead understand it, then take a short break, and type it in on your own. For example, if a student shows you how to call glTexParameter(), you might then look up the online documentation, understand how their code works, then set their code aside, and type your own code using the online documentation (not using the other student's code directly!). All substantial assistance must be acknowledged at the time you turn in your programming project.
   Project 0: Getting (Re)-started and GammaCorrectTest. Due April 3, 9:00pm. (Time extension available if needed.)
      Hand in on gradescope, a single PDF file.
   Project 1: Vertex and Fragment Shaders. Due April 14, 9:00pm.
      Hand in on gradescope, a single PDF file. Plus upload source code.
   Project 2: Color Dithering and Fragment Shaders. Due April 24, 9:00pm.
      Hand in on gradescope, a single PDF file. Plus upload source code.
   Project 3: Triangular Bumps with a Geometry Shader. Due May 7, 9:00pm.
      Hand in on gradescope, a single PDF file. Plus upload source code.
   Project 4: Getting Started with Ray Tracing. Due May 15, 11:00pm.
      Hand in on google drive, plus fill out a google forms questionnaire.
   Project 5: Distributed Ray Tracing. Due May 25, 10:00pm.
      Hand in on google drive.
   Project 6: Final independent project. Due June 10.
      Hand in on google drive.

Prerecorded presentations, and recordings of the main class meetings will be available. Please note that by attending class, you are consenting to be recorded. Conversely, to respect your fellow students' privacy, please do not circulate or distribute or repost class recordings. All course materials are subject to copyright restrictions.

Midterm and final exam schedule: "Mini" Midterms on Thursdays of weeks 3, 5, 7, and 9.
    Mini-Midterm #1: Thursday, April 16, approximately 12:45-1:30. "cheat sheet". Study Problems.
    Mini-Midterm #2: Thursday, April 30, 45 minutes within 12:00-4:00. "cheat sheet". Study Problems.
    Mini-Midterm #3: Thursday, May 14, 45 minutes within 12:00-4:00. "cheat sheet" (same one as for Mini-midterm #2). Study Problems.
    Mini-Midterm #4: Thursday, May 28, 45 minutes---exact times TBA. Study Problems. There is no cheat sheet for mini-midterm 4.
    Final Exam: Monday, June 8, 2 hours. Within 11:30am-2:30pm. Partially cumulative. Additional Study Problems. Updated "cheat sheet" is available for download.

In class quizes:
   Dates and topics to be pre-announced in class and on piazza.
   These will be online quizes, lasting 15+ minutes.
   When available, quizes can be downloaded from: Quiz #1, Quiz #2, Quiz #3, Quiz #4, Quiz #5, Quiz #6, Quiz #7.

Academic Integrity: All assignments come with an academic integrity pledge. For quizes, midterms and the final, you must work on your own with no assistance or electronic resources, unless you receive alternate instructions. For homeworks and programming projects, you may consult fellow students, internet resources, the textbook, etc., but you must keep a record of and report all significant sources of help. E.g. any particularly helpful web page, any student who helped you in a substantial way, etc., must be reported at the same time as when you hand in the assignment.
One major item that is not permitted is accessing code from solutions turned in by students in prior years.

Computer Labs The APM basement computer labs are no longer available. Instead development must be done on your personal computer.
   Grading of programming projects will be one-on-one with TA Job Pham or Professor Buss in a Zoom session.
   We will work out a system for Mac users to transfer their files for re-compilation in Visual Studio on Windows.

Piazza. Please watch piazza for important course announcements. You are strongly encouraged to post questions (and answer questions as well). An example of what you might post is a screenshot of your program's output, asking about what the problem might be. However, do not post code from your programming assignment!
If you are taking the course, but not yet officially enrolled, please email Professor Buss for an invitation to the piazza course page.

Grading: The grading policy and percentages may change. We will discuss this more in our class Zoom meetings.
Tentatively: the course grade will be based 40% on programming assignments, 40% on homeworks, short quizes, midterms and the final, and (NEW) 20% on "Engagement". There will be four midterms, each about half the length of a typical midterm. The final will count the same as two midterms. You may drop your lowest midterm score, or half of the final exam score. The homework assignments and quizes will be together 8% of the grade. There will be approximately 8 quizes or maybe more, exact number to be determined. You may drop the lowest 1 quiz if there are 5 or fewer, and the lower 2 quizes if there are more than 5, lowest three quizes if there are more than 9. Quiz topics will be pre-announced; they will take approximately 15 minutes to complete.

"Engagment" means actively interacting with and participating in the course, interacting with other students, assisting and getting assistance from other students, possibly doing independent readings that contribute to the course. Examples of engagement might include: (a) Attending Zoom lectures in real time and contributing questions and answers and discussion. (b) Watching prerecorded videos before the lecture, and posting comments or questions to piazza for class discussion.(c) Watching recorded class meetings and posting comments or questions to piazza. (d) Contributing to piazza discussions; answering questions on piazza, asking questions on piazza. (e) Working with other students in a way that fosters learning; for example, giving advice on homework or programming projects. (Must be disclosed!) (f) Or even doing some independent studying on a topic related to the course, and making a short presentation or writeup for your fellow students. You do NOT need to do all of these things! But you should do some of them consistently throughout the course. You should do it in a way that is visible to your professor, your TA, and other students in the course.
The point of engagement to counteract the potentially isolating effects of the shutdown and the remote learning. In the end, I hope everyone gets full credit for the engagement portion of the course.

Other resources

The upgraded course textbook web page has some introductory sample OpenGL programs (some of them are still under development). I highly recommend them as a way to see examples of how Modern OpenGL is used.

Another excellent source for learning how to use OpenGL is the web pages by Joey De Vries at These provide both an introduction to OpenGL and discussion of more sophisticated language features. Another web site with nice tutorials is Many other tutorials and resources can be found at Last, but not least, the Khronos Group leads the development of OpenGL; if you do browser searches for topics in OpenGL, you are likely to find their web pages giving the most official version of the documentation.

If you are programming at home, you have free use of Visual Studio for use as a UCSD student. In addition, you probably need to install the OpenGL header files and .lib library files, GLFW and GLEW. To obtain these for Windows either see the next paragraph, or download the header files GL/glew.h, GLFW/glfw3.h and the binary static libraries glew3.lib, glew32s.lib, glew32.lib. These are then needed to be installed in your system directory (logging in as an administrator) in the default system include directory for headers and the default system directory for static libraries. You can search for GL/gl.h or GL/glu.h opengl32.lib or glu32.lib to find these system folders. These header and static library files can be obtained online from GLFW and GLEW distribution sites, at and
For other systems, source files and makefiles are available for download to compile yourself.
More info for installing Visual Studio on Windows: The zip file has all the needed files and the instructions given to ACMS to install GLEW and GLFW for the computer lab last year. Similar instructions should work for most Windows 7 or 10 machines.
For Macs, students have been using Xcode. Your professor lacks experience in this, but quite a few students in 155A succeeded. If you are installing Xcode and GLFW and GLEW on a Mac, please post to piazza what you did, how easily it worked, and what websites you used. (This will count towards "Engagement Points".)