• Advertisement
Sign in to follow this  

2D Triangle rasterization algorithm

Recommended Posts

Hello,

I’m writing research paper on software rasterization algorithms and at one point I gave example of triangle rasterization algorithm.

The algorithm is really basic. If the triangle is flat top or flat bottom it’s possible to determine the minimum and the maximum x values for each scan line using the equation of line for the edges. Then for each scan line fill the pixels between minimum x and maximum x values.
If the triangle is of other kind it’s possible to split it to flat top and flat bottom triangles (finding the fourth vertex) and draw it using the previous algorithm.

I need to cite a reference for this algorithm. I saw it in some book in the ‘90s and I can’t just write it without a reference. The problem is that I can’t remember where I saw it.
I already tried to look at “Computer Graphics: Principles and Practice” but the only similar algorithm there is the polygon rasterization algorithm, which is over engineered for this kind of problem, same with "Computer Graphics: C Version".
I also tried to look at “Black Art of 3D Game Programming”, which have similar algorithm but the algorithm that I saw was in another book and slightly different.

Anyone know a book with this kind of algorithm?
Any help is appreciated.

Thanks.

Share this post


Link to post
Share on other sites
Advertisement

Michael Abrash's Graphics Programming Black Book might be another reference, but polygons too IIRC.

Note that rendering polygons is much more efficient than triangles due to less edges to setup - if there is enough planar stuff around.

 

Later there was a SIMD approach which does a bounding rect per triangle and then evaluating 3 side of edge tests in parallel per pixel. I remember a guy named Nicolas Capens who wrote an article about this, might be another good reference.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Now

  • Advertisement
  • Similar Content

    • By pat thompson
      Environment concept exploring what the underwater worlds of Pandora in Avatar 2 might look like. Fan art illustrated in Photoshop.
    • By pat thompson
      Just some Game of Thrones fan art! Had to draw a picture of the Night King after Season 7, mostly just to see the poor dude smile for once! I mean he's got a new ride, things going well in his career as evil incarnate, why so serious? Also, thought I'd see if I could illustrate the ice armor, as written by GRRM, but also merge the book version of the Others with the TV show version.  Illustrated in Photoshop.
    • By pat thompson
      Character designs and assets from the Mattel / Collision Studios game "Monster High: Ghouls and Jewels" (popular kids franchise). For this dress-up game, I was tasked with creation of various body parts (heads, torsos, skin colors, etc.), clothing, shoes, hair styles, makeup styles, accessories, etc. for a variety of characters (both male and female). Concepted initially in Photoshop, and then finalized in Illustrator.
    • By pat thompson
      Sexy Rexy! Illustration for the AGS slot game "Jurassic Jackpots". This dinosaur was painted in Photoshop, and animated in After Effects. He's surprisingly articulated, with the face being separated into various pieces for full animation freedom. He can open and close his jaws, roar, wiggle his tongue, scrunch his brows, use his cheek and eye muscles to blink, flair his nostrils, wag his tail, breath, etc. This image was used in the topscreen of the cabinet, game symbols, glass art, and the animations used to attract the customers from across the casino floor.
    • By pat thompson
      Character concept of the Huli Jing fox spirit of Chinese mythology. They are known as beautiful tricksters, sometimes in the shape of a fox, at times a young maid, at times something in-between. They are known to be benevolent at times and malevolent at others - a cross between a foxy fairy and a succubus. They possess powerful sorcery, and feed off of the essence of the men they seduce. Illustrated in Photoshop.
  • Advertisement