Lecture 1: The Graphics Pipeline
Overview
Motivation: Draw shapes/geometry to 2D screen.
The Graphics Pipeline is the process by which we convert a description of a 3D scene into a 2D image that can be viewed.
This involves both transformations between spaces and conversions from one type of data to another.
- Spaces
- What is a space? Left/right perspective example
- Where do we store geometry of scene?
- “World” coordinates
- Types of Data
- “Primitives”
- Simple kinds of figures/geometry
- Triangle meshes
- What is a picture?
- pixels, “picture elements”
- “Primitives”
We need a way to transform from world to pixel.
General Graphics Pipeline
vertex array: what are the vertices
- input specification
vertex shader: move to camera’s perspective
object space -->
screen coordinates
rasterization: which pixels are inside triangle?
fragment shader: what color is each pixel?
testing and blending: which pixels are visible?
Software Rasterizer
- Read in triangles
- Convert triangls to windows coordinates
- Rasterize each triangle
- (use barycentric coordinates to test in-triangle AND interpolat colors)
- Write interpolated color values per pixel (using a z-buffer test to resolve depth)
Labs
Lab 1
- Compute bounding box
- Draw box and vertices
Lab 2
- Compute barycentric
- Check is-interior?
- Interpolate colors