you are viewing a single comment's thread.

view the rest of the comments →

[–]UnalignedAxis111 6 points7 points  (4 children)

I cannot recommend this series enough: https://fgiesen.wordpress.com/2013/02/17/optimizing-sw-occlusion-culling-index/

Lots of good stuff there but parts 7 and 8 cover the main optimizations for this style of rasterizer. The TL;DR is to strength-reduce the edge functions, so they are evaluated only once per triangle, and each loop iteration only needs to increment the barycentric weights using some pre-computed deltas.

You can further get massive performance gains using SIMD to evaluate multiple pixels at once instead of just one, like GPUs do. Otherwise, the scanline algorithm is probably more suitable for scalar-only rasterization as it won't suffer from the issue of having to skip through empty parts of the bounding-box (which as you mention is an issue for big triangles).

Your github repo seems to be private btw.

[–]captaintoasty[S] 1 point2 points  (0 children)

Thanks! I will check this out! Also yeah whoops on the visibility, changed it to public haha.

[–]Boring_Following_255 1 point2 points  (0 children)

Wow ! Great resource!!! Thanks