You are viewing the course site for a past offering of this course. The current offering may be found here.
Lecture 2: Digital Drawing (56)
irina694

Why do we traverse the triangle block-by-block instead of sampling the entire image in parallel?

egbenedict

Is the special-purpose hardware on GPUs designed for the same "3 Line" Tests from the previous slides? I imagine there must be some more efficient ways with less computation required to decide the interior of a given triangle. I can think of some other approaches, but don't think they are necessarily faster (summing the 3 sub-triangle areas to compare with total triangle area, finding # vertices of convex hull, summing the angles created between each pair of triangle vertices with the vertex in question in between).

Staffmcallisterdavid

@irina694 Great question! It's possible that for high resolution displays, we do not have enough hardware resources to sample the entire image in parallel at once.

This technique lets us save computation by including or excluding blocks of pixels without checking each one. We can perform this task in parallel just like we could perform each pixel in parallel.

Staffmcallisterdavid

@egbenedict It seems like there are different ways to implement this in hardware. This paper goes over a few approaches.

ShrihanSolo

By skipping sample testing work, does this mean we only sample the outer edges of the block, and if entirely in, we mark the entire block in? (and vice versa)

stexus

What does it mean for a triangle to cover many samples? I'm a little confused on how tiled traversal leads to more point-in-triangle tests when it seems from the diagram we still only test all the points once, just in parallel.

Staffmcallisterdavid

Hi @stexus,

A display is a grid of pixels and we need to figure out what to display at each of these pixels, so we can split this grid up into smaller tiles of pixels. If a triangle is big, it will fully cover certain tiles and other tiles will be fully outside the triangle.

If you see that all the edges of a tile are out of a triangle, you know the whole tile is out of the triangle. In this case, you can save computation by skipping the interior pixel samples.

armaangoel78

It's fascinating to me that there's actually specialized hardware for this kind of thing. I had previously thought that GPUs were just big parallel matrix multiplication machines, but it seems like they are designed a lot more specifically for graphics applications than I imagined (which actually does make sense). Its interesting then that GPUs are still so useful for things like crypto mining and AI, and I wonder how much efficiency is wasted when applying a GPU to tasks like this / how different an Nvidia AI GPU is versus a gaming one.

You must be enrolled in the course to comment