1/18
Learn about the basics of rasterisation!
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
object based 1
loop over all objects and vertices to transform them to pixels
object-based 2
works well with pipelined architectures but needs large amounts of memory
object-based 3
struggles to model interactions between objects like reflections, these need to be approximated or fudged
image based 1
loop over all pixels to determine what objects affect their value
image based 2
common for global illumination models
result of each fragment belonging to one primitive
there can be many fragments per pixel. some of them will occlude others so we need to decide which determines the pixel colour (z buffer)
dda
digital differential analyser
when do we use the modified dda algorithm?
where |m| > 1
what do we do in the modified dda algorithm?
swap x and y - advance vertically one pixel at a time, calculate the change in x and round to the nearest pixel
motivation for Bresenham’s algorithm
dda is efficient but requires floating point addition, bresenham uses only integer operations
what two assumptions do we make with bresenham’s
pixel centers are halfway between integers, 0 <= m <= 1
given 0 <= m <= 1, what pixels do we need to consider
exactly to the right of the current pixel, and the pixel above that
removing bresenham floating point arithmetic step 1
change our increment to delta y
removing bresenham floating point arithmetic step 2
multiply by 2 to avoid comparing to 0.5
removing bresenham floating point arithmetic step 3
compare to 0 instead of 1
removing bresenham floating point arithmetic step 4
update d and y when d >= 0
odd even test
counts number of crossings of polygon edges - points with an even number are inside
when is odd even test not ideal?
self-intersecting polygons
winding number test
how many times a point is encircled, or, if following the edges from point p, how many full turns are needed. increase for anti-clockwise, decrease for clockwise. a point is considered inside if the winding number is non zero