Previous | Next --- Slide 43 of 62
Back to Lecture Thumbnails
wilsonlee

Is there anything special about the diamond shape of the "active" area inside the pixel? Can we, for instance, define it as the largest possible circle inside the pixel and still get good results?

kadl

I think an important criteria for picking the shape is performance. Considering that we need to do an line/polygon intersection test against the selected shape for a large number of pixels it needs to be fairly fast. Also it needs to be an intersection test that the GPU can compute efficiently, and linear calculations are much easier than quadratic. NVIDIA seems to have the patent on the on the diamond rule based culling : https://patents.google.com/patent/US7307628B1/en

tfilippi

At first glance, it looks as if the red line actually passes through a couple more diamonds which don't have their pixels lit up (second and fourth columns). When Kayvon reminded us during the lecture that lines have no thickness, I pretended the red line was extremely thin, and then I could see/imagine the line was not hitting or passing through those diamonds after all.

tbell

@wilsonlee (I don't think @mentions actually work here... whatever) I wonder if it is relevant that the diamond shape occupies exactly half of the area of each pixel, whereas inscribing a circle would not have this property, which might tend to make lines look thicker than a single pixel. You could, of course, shrink the circles to make them have exactly half the area of a pixel, but this would introduce the possibility of an unlucky (or adversarially placed) line that activates no pixels at all. Off the top of my head, it seems that the diamond shape guarantees both continuity of lines (no missed pixels) and no extra "corner" pixels (e.g. a pixel with two active neighbors on adjacent sides). In this sense it seems somehow "optimal". Though, I have no idea how one would arrive at the diamond shape as the ideal choice given these desiderata.

adampahlavan

I wonder if there exists some other kind of shape that has an efficient algorithm like the one described in lecture that uses another shape besides this diamond... can it be done with just the entire square?

yxu72

Is it always the case that the rendered result of a line in this semantics can only have duplicate pixels in one direction (either x or y but never both)? If yes I think there is much space for optimization because if we draw the line, the "next" pixel is always limited to only 2 possible cases.

jballouz

Do people use a circle inscribed inside the square also ? seems like the computation of checking if a point is inside a circle is easier than that of a diamond (which has 4 lines so 4 checks) ?