Lecture 1: The Graphics Pipeline
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.
- What is a space? Left/right perspective example
- Where do we store geometry of scene?
- “World” coordinates
- Types of Data
- Simple kinds of figures/geometry
- Triangle meshes
- What is a picture?
- pixels, “picture elements”
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
--> screen coordinates
rasterization: which pixels are inside triangle?
fragment shader: what color is each pixel?
testing and blending: which pixels are visible?
- 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)
- Compute bounding box
- Draw box and vertices
- Compute barycentric
- Check is-interior?
- Interpolate colors