precise triangle rendering (rasterisation)

Started by
-1 comments, last by fir 10 years, 7 months ago

The usual triangle rasterization algorythm (this is per pixel hand rasterization routine) identyfies top vertice then goes down on left edge and right edge and draws horizontal scanlines between the points

Probably the basic approach when you just calculate the dx for left edge step down , dx for right edge step down, is so called not sub pixel accurate approach - will it just plot all pixel the triangle touches ?

(I got flu and a bit lost with that, becouse of rounding etc

if I will get for example x=100.2 to x = 145.7 horizontal scanline

I probably casted it to 100 145 - is it already pixel accurate ? (They say that

" For real-time applications, any point inside the pixel (i.e. the lower right corner) may be used rather than the center. The only side-effect of this is that the entire screen is shifted down/right by exactly 0.5 pixels. "

( this definition of pixel accurate - according to

http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/wwh-sub-pixel-accuracy-r661

- here pixel not accurate is defined as "drawing al pixel touches"

and pixel accurate "drawing only the pixel which centres are in the figure"

)

If this is already pixel accurate how someone would wrote an pixel non accurate version , by casting x=100.2 x = 145.7 to 100 146 ?

I got lost slightly

the second question - If i want to do pixel accurate with blending edges (that is not only pixel accurate but pixel accurate with blending edges) do I just need to get x fraction point and use it ? - I am asking becouse tfiangles ale 2d figures and I am not sure if such reduced algorithm

which just blends the horizontal scanline edges (not considering vertical fractions except maybe obvious top triangle point and down traingle point) will be correct)

could someone ansewr? tnx

This topic is closed to new replies.

Advertisement