• Create Account

Need scary sound effects or creepy audio loops for your next horror-themed game? Check out Highscore Vol.3 - The Horror Edition in our marketplace. 50 sounds and 10 loops for only \$9.99!

precise triangle rendering (rasterisation)

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

No replies to this topic

#1fir  Members   -  Reputation: 268

Like
0Likes
Like

Posted 19 September 2013 - 01:01 AM

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

- 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

Edited by fir, 19 September 2013 - 01:08 AM.