G4: Rasterization Flashcards
What is the first step in the rasterization pipeline?
Begins with the 3D model representing the world
What is the purpose of the projection step in the rasterization pipeline?
Go into camera space, x, y, and z are now relevant to the image plane of the camera
What does clipping determine in the rasterization pipeline?
Determines what is visible in the camera’s world of view, crops the rest out, creating the clip space
What is screen space in the context of rasterization?
Represents pixel positions or sample points
What information does a fragment contain in screen space?
Information about the surface that is visible, color, and other properties
What is the purpose of interpolation and sampling in the rasterization pipeline?
Computes the final value going into the FrameBuffer
What is a line considered in computer graphics?
One of the simplest primitives
What is the diamond rule in rasterizing a line?
Pixel is on if line passes through ‘diamond’
What is the Digital Differential Analyzer (DDA) used for?
A better method for rasterizing lines
Why are triangles special in computer graphics?
- Can decompose any polygon into triangles
- All triangles are convex
- All triangles are flat in 3D
- Simpler rasterization and interpolation algorithms
What is inside-outside testing?
Checking if a fragment is covered by a triangle
What is the common convention for handling edge cases in triangle rasterization?
Top-left rule
What is the efficiency strategy for computing inside tests for triangles?
Compute triangle bounding box first and do inside test only for points in bounding box
What are barycentric coordinates used for?
Determining colors that should go into a particular fragment
How do you compute the area of a triangle using vertices in homogeneous coordinates?
Area(v0, v1, v2) proportional to volume(v0, v1, v2)
Triple product gives: volume(v0, v1, v2) = (v0 x v1) . v2
Then note that:
□ v0 x v1 = (y0 - y1, x1 - x0, x0y1 - x1y0)
□ v0 x v1 = (a, b, c) from line equation v0 -> v1 (recall)
□ So, for a point p (x, y) inside triangle, area is (v0 x v1) . p = ax + by + c
Can reuse line equation from inside test!
What is the painter’s algorithm?
Sort triangles from farthest to nearest and rasterize in that order
What is the Z-buffer algorithm used for?
Store z value for each fragment produced from rasterizing a primitive
What does the depth test in Z-buffering do?
Only writes color and z if z < current z
What is the initial z value in the FrameBuffer for Z-buffering?
-infinity for all pixels