Sunday, May 22, 2011

OpenGL Insights: Call for Authors

Christophe Riccio and I are starting an exciting new book project. Please join us:

It is with great enthusiasm that we invite you to contribute to OpenGL Insights, a book containing original articles on OpenGL, OpenGL ES, and WebGL techniques by the OpenGL community and for the OpenGL community: from game programmers to web developers to researchers. OpenGL Insights will be published by A K Peters, Ltd. / CRC Press in time for SIGGRAPH 2012.

Monday, May 16, 2011

Book Update

We have some exciting book-related updates. For starters, we made a small website for our book,, and posted several samples:
We also found our book on the cover the latest CRC Press catalog. Exciting! Finally, we wrote a short book-related article in our company's newsletter.

Things are wrapping up nicely and I suspect the manuscript will be off to the printer any day now.

Sunday, May 8, 2011

Reflections on Teaching GPU Programming and Architecture

I just finished teaching CIS 565: GPU Programming and Architecture, a graduate-level course on programming GPUs using mostly GLSL and CUDA, at the University of Pennsylvania. Being my first time teaching, I gained a lot of valuable insights, which I will share here. These ideas are on teaching computer science in general, not necessarily about the GPU.

For eye candy, I sprinkled screenshots of our student projects throughout this post.

1. Exams have a hidden agenda.

At least my exams. On the surface, exams are used to evaluate students, and ultimately assign grades. Historical, this course never had exams. Given its pragmatic, hands-on material, grades were primarily based on coding assignments and a final project.

Screen Space Fluid Rendering - Leftheris Kaleas
This year I added a final - not because I wanted to evaluate students on their ability to think about the GPU under pressure, but because I wanted them to study for the final. It is a valuable exercise to go over material a second time, especially after we've had hands-on experience, to gain new insights. For example, the performance implications of register pressure will seem trivial once the student has some coding experience, but may have been foreign when first introduced. Likewise, going back and looking at GLSL after learning CUDA, will lead to a deeper understanding of GLSL.

In general, one reason people go to grad school is to gain a deeper understanding of topics they already have some exposure to. Studying for a final has the same effect on a more local scale.

So if I am only interested in students studying for a final, but not so much in how they do, what did I do? Two things. First, I made the final only worth 10% of the semester grade. That is not enough to ruin someone's grade if they perform poorly, but it can be the difference between an A and a B. The second technique I use is a bit more interesting...

2. Crowdsourcing the final is fun.

To help students study, I requested they make a ten question exam (and answer it!) with questions of different types, e.g., short answer, coding, etc., and of different difficulties, e.g., easy, medium, hard, and challenge. I made this "take-home" portion of their final worth 10%. It is a good studying technique to get in the instructor's head and think about what they are going to ask. I also joked that I might take all of their exams in the time they take my final.

After I handed out the final, I told the class that their exams were so good and hard that I wouldn't be able to take them while they took my final. In fact, I didn't even make their final - they did. Every single question on their final was from one of their exams. The class got a big kick out of it.

When looking through the student-made exams, I was simply amazed at the collective breadth and depth of knowledge of the class. It was also interesting to see different students with different specialties - each exam covered diverse topics, but some where biased towards GPU architecture, while others were heavy on GPU compute, while others favored rendering. Overall, the quality of their questions were quite good. Some of the exams were really hard too - harder than I made the final.

Am I nervous that a student taking this course in the future will read this post or hear from previous students how the final is made? Maybe the entire class will self-organize and send their exams to each other before the final. If a student reviewed every exam, they would know every question that will be on the final. Is that cheating? I don't know, but students rigorously studying for a final sounds like a great problem to have. After all, the main point of my final is to have them revisit the material.

Mobile Depth of Field as Post-Processing using
OpenGL ES 2.0 - Han Li and Qing Sun