Skip to main content

UC San Diego computer graphics course

· 3 min read
beho

As part of learning how to make video games I took the UCSanDiegoX: Comptuer Graphics CSE167x course on edX.

The course covers the fundamentals of rendering 3D scenes. I gained some experience in:

  • how shapes, material and lighting can be modelled in OpenGL;
  • how simple transformations and camera views can be modelled using 4D matrices;
  • how shaders are written and the APIs for passing data to them;
  • modelling light and combining colours as vectors;
  • writing and debugging programs in C++ with make;
  • building a ray tracer from scratch.

Writing this list I can see that I've learned a lot through this course - mostly from hands-on work to complete the homework assignments. Each assignment took me from a level of being completely baffled to understanding a handful of techniques.

I found the lecture materials difficult to follow in isolation - I didn't have enough context in a given lesson to understand why we we learning something or what we were aiming for.

The online course itself looks like it needs to be refreshed. The code samples don't compile on modern linux and there are many unanswered comments in the discussion areas from 4-6 years ago. Looking at the slides I think I would have enjoyed this course in person in its current incarnation under Tzu-Mao Li.

Although I'm interested in 3D graphics, in practice I don't think I'm smart enough to work with them (at least at a low level). I get some intuition for linear algebra and vectors but I can't get my head around matrices. Switching between world space and object space in modelling was rough.

It's difficult to debug issues with pixel data because there's such a large volume of it. Often my bugs were due to small errors in floating point arithmetic. For example "shadow acne" where you sometimes accidentally cast a ray from slightly beneath the surface of an object causing it to get trapped.

Which is probably what's happening in this cool world. I love the accidental dithering effect; if you zoom in you can see many cute faces down the centre line!

a green image showing what looks like a sphere in front of a background, the sphere and background are covered in sporadic black marks - it looks like a photo of the sun

I found it helpful to debug the scene by rendering it differently - e.g. these rainbowed scenes are from trying to debug the calculation of normals by rendering the normal vector (x, y, z) coordinates as (r, g, b) colours.

a rainbow coloured room depicting a colection of spheres, spheroids and cuboids

a room filled with hundreds of spheres lined up in rows, each sphere is coloured pink on its left side and blue on its right side

I think I will stick to 2D graphics for now. The world of 2D games is extremely rich and I think I will have more fun focussing my attention there. I'm still glad that I did the course, I hope that the knowledge (and certificate) will be useful down the line.