Jump to content
  • Advertisement
Sign in to follow this  

precise triangle rendering (rasterisation)

This topic is 2128 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!