Fundamental of Computer Graphics
This article contains my personal notes when self-studying Fundamental of Computer Graphics by Peter Shirley and Steve Marschner.
Chapter 1: Introduction
Nothing important really.
Chapter 2: Miscellaneous Math
Math stuff (can be safely skipped if you are confident about your math).
Chapter 3: Raster Images
- Two artifacts (artificially introduced flaws) of raster images: 1. clipping when pixels brighter than max value are clipped to the max representable value; 2. quantization/banding when the need to round pixel values to the nearest representable value introduces visible jumps in intensity or color.
- The nonlinearity of display
Displayed intensity = (max intensity) · (input pixel value a) ^ gamma (where 0 ≤ a ≤ 1)
- Alpha Compositing
Alpha: pixel coverage, which tells the fraction of the pixel covered by the foreground layer.
c = alpha · c_f + (1 - alpha) · c_b (where c_f is the foreground color and c_b is the background color)
RGBA image: image with an additional alpha channel.
Chapter 4: Ray Tracing
- Rendering: input a set of objects, output an array of pixels
object-order rendering vs pixel-order rendering
- Parallel Projection vs Perspective Projection
Parallel projection: ray.o ← e + uu + vv, ray.d ← -w
Perspective projection: ray.o ← e, ray.d ← -dw + uu + vv
- Ray-Object Intersection
Ray-Sphere Intersection: (e + td - c) · (e + td - c) - R² = 0
Ray-Triangle Intersection: e + td = a + beta (b - a) + gamma (c - a) where beta + gamma ≤ 1. Use Cramer’s rule to solve this.
- Shading: should consider shadows & mirror reflection!