Previous | Next --- Slide 42 of 65
Back to Lecture Thumbnails
kayvonf

Question: Why do you think I asked the class: "Is there a right answer to question of what pixels should be colored?" What might I have meant by that?

dsaksena

I believe there exists no perfect answer rather only limitations. The right answer would be to have infinite resolution and the color the right pixels. Which is impractical and not even digital. Fact is even with GPU diamond technique you can argue there remain areas where line exists and we didn't color it.

Thus like any engineering problem we must accept a practical solution where it achieves the effect where viewer perceives a line (from a distance) and we are extremely efficient in producing this solution. (Balance accuracy and speed)

Professor Kayvon is referring to multiple practical answers possible here which can all be argued for.

BryceSummers

@dsaksena What are the "right" pixels? If a line what rasterized as shown in this diagram on an infinite resolution screen, then would any pixels indeed be shaded, and could a line be perceived on such as screen afterwards?

dsaksena

Hey Bryce, that is my point, if we go in such an ideal manner it would be impractical, by right pixels I mean the infinite infinitesimal pixels which overlap with the red line are lit up (considering the thickness)

Its kind of like wishing to be in continuous space rather than a digital one.

Khryl

To draw a line with thickness $d$, I think we can imagine a line $AB$ with $0$ thickness that lies in the center of the line we want to draw.
We then move line $AB$ $0.5d$ along its one normal $\overrightarrow{n}$ (perpendicular to $AB$) to get line $A_1B_1$ and move line $AB$ $0.5d$ along $-\overrightarrow{n}$ to get line $A_2B_2$.
Now we have rectangular $A_1A_2B_2B_1$. We can then use incremental line rasterization to draw each edge of the rectangular.
As we have the bound now, it's relatively easy to fill the rectangular using scan-line filling or seed flood filling. Higher resolution will result in smoother bound and thus smoother line.