Computer Graphics
Introduction
What Question Does It Ask?
Computer graphics studies how to render an image from a scene described by geometry, materials, lights and a camera. It is the inverse of computer vision: vision recovers the scene from an image, graphics produces the image from the scene.
At a glance
geometry and light simulation
scene: models, lights, camera
image or animation
realism, frame rate
high: linear algebra, geometry
none
Introduction
A Short History
Sutherland's Sketchpad shows drawing on screen with a light pen; interactive graphics begins.
Phong publishes his reflection model and shading method; shiny surfaces look real.
Whitted's ray tracing unifies reflection, refraction and shadows in one method.
Kajiya publishes the rendering equation: the basis of physically based rendering.
Toy Story becomes the first fully computer-generated feature film.
Hardware ray tracing reaches consumer GPUs; real-time ray tracing begins.
The Course
Core Concepts
Writing translation, rotation and scaling as 4×4 matrices.
The chain of transforms from object space to screen space.
Representing surfaces with vertices and triangles.
Finding the pixels a triangle covers.
Visibility by keeping the nearest surface per pixel.
Ambient, diffuse and specular: Phong, Blinn-Phong.
Wrapping an image or pattern on a surface; UV coordinates.
Shooting rays from the camera and tracing light paths backward.
The Course
A Typical Workflow
The Course
What Does the Course Cover?
- Raster images, colour and gamma
- Vectors, matrices and 2D/3D transformations
- Viewing: camera, projection, view volume
- Triangle meshes and surface representation
- Rasterization and visibility with the z-buffer
- Shading: Phong and Blinn-Phong
- Texture mapping, UV coordinates and mipmaps
- The graphics pipeline and GPU shaders
- Ray tracing and acceleration structures (BVH)
- Curves and surfaces: Bezier, B-splines
- The rendering equation and Monte Carlo path tracing
- Animation: keyframes, skeletons, physics simulation
Skills you will gain
A typical semester; the order and coverage vary between universities.
Try It
Shading a Sphere with Light
Every frame, a game engine computes how bright each pixel is from the surface normal and the light direction. Move the light with the sliders, switch the shading method, and click the sphere to see how one pixel is computed.
Context
Prerequisites
Courses worth knowing before this one, and why they are needed.
| Course | Why it is needed |
|---|---|
| Linear Algebra | transformation matrices, projection |
| Programming with C | APIs such as OpenGL and Vulkan are used from C/C++ |
| Analytic geometry | vectors, planes, line-plane intersection: the language of ray tracing |
Context
Are You Ready for This Course?
Ask yourself; for every "no", the right-hand column shows where to start.
| Ask yourself | If not, start with |
|---|---|
| Can you rotate and translate a point with a 4x4 matrix? | Linear Algebra |
| Can you find the point where a ray hits a plane? | Line and plane equations from analytic geometry |
| Can you write a C or C++ program that uses arrays and structs? | An intro C course, then a short introduction to C++ |
| Can you explain why a GPU runs thousands of threads in parallel? | GPU Programming and Parallel Computing |
Context
Neighbouring Courses
Overlap
Overlapping Courses
| Relation | Course | Shared ground |
|---|---|---|
| builds on | This course builds on Linear Algebra | transformation matrices, projection |
| shares methods | Shares methods with Generative Models | image and scene synthesis |
| shares methods | Shares methods with Computer Vision | camera model; graphics renders scenes, vision recovers them |
| shares methods | Shares methods with GPU Programming and Parallel Computing | graphics pipeline, shaders |
Differences
Where It Differs (1/2)
| Criterion | Computer Graphics | Computer Vision | Image Processing |
|---|---|---|---|
| Core question | How is a realistic image produced from the description of a scene? | How does a computer understand what is in an image or a video? | How is an image enhanced, transformed and divided into regions? |
| Approach | geometry and light simulation | extracting meaning from images | pixel-level transformations |
| Input | scene: models, lights, camera | image or video | image |
| Output | image or animation | label, box, depth, 3D structure | processed image or regions |
| Success measure | realism, frame rate | accuracy, mAP, IoU | visual quality, PSNR |
| Math load | high: linear algebra, geometry | high: geometry, linear algebra | medium: convolution, Fourier |
| Data needs | none | many labeled images | little; learning not required |
- Computer Vision: Computer vision tries to recover the scene from an image; computer graphics produces the image from the scene.
- Image Processing: Image processing transforms an existing image; computer graphics builds the image from geometry and light.
Differences
Where It Differs (2/2)
| Criterion | Computer Graphics | Generative Models | GPU & Parallel Computing |
|---|---|---|---|
| Core question | How is a realistic image produced from the description of a scene? | How does a model generate new samples that look like real data? | How do thousands of cores share the same computation? |
| Approach | geometry and light simulation | learning the data distribution | data-parallel computation |
| Input | scene: models, lights, camera | huge, mostly unlabeled data | parallelizable algorithm |
| Output | image or animation | new samples: images, text, audio | accelerated program |
| Success measure | realism, frame rate | realism and diversity (FID etc.) | speedup, memory bandwidth |
| Math load | high: linear algebra, geometry | high | low-medium |
| Data needs | none | very large | none |
- Generative Models: Generative models synthesize images learned from data; computer graphics computes them from physics and geometry.
- GPU & Parallel Computing: GPU programming focuses on general parallel computing; computer graphics uses the GPU as a tool for rendering.
Practice
Applications
Real-time graphics at tens of frames per second.
Physically based rendering taking minutes per frame.
Seeing a design before it is built.
Flight and driving simulators.
Low-latency images for two eyes.
Medical volume data, flow and weather models.
Practice
Risks and Ethics
Realistic rendering makes it easy to produce a convincing photo or video of an event that never happened.
Fast flashing patterns can trigger seizures; in 1997 a Pokemon episode sent hundreds of children in Japan to hospital.
High latency or a low frame rate causes dizziness and nausea in VR; timing is as much a safety issue as the image.
Architectural and scientific visualization approximate light and materials; a beautiful image can justify a wrong decision.
In depth: Explainable AI and AI Ethics.
Practice
Tools and Datasets
Tools and libraries
Classic test scenes
Practice
Common Misconceptions
| Common belief | In fact |
|---|---|
| Computer graphics is just making games. | Film, architecture, medicine, simulation and scientific visualization are graphics too. |
| Ray tracing is a new invention. | The method dates from 1980; what is new is hardware that runs it in real time. |
| Graphics and computer vision are the same. | Each is the inverse of the other; they share the camera model but go opposite ways. |
| More triangles are enough for realism. | Light, shadow and material often matter more than geometric detail. |
Next Steps
After This Course
Courses that build on or extend this one
Related careers
Next Steps
Further Reading
- Marschner and Shirley, Fundamentals of Computer Graphics, 4th ed., CRC Press, 2016.
- Hughes, van Dam, McGuire et al., Computer Graphics: Principles and Practice, 3rd ed., Addison-Wesley, 2013.
- Akenine-Möller, Haines, Hoffman et al., Real-Time Rendering, 4th ed., CRC Press, 2018.
- Pharr, Jakob and Humphreys, Physically Based Rendering, 4th ed., MIT Press, 2023.