Skip to content

Commit

Permalink
Added a polygon scanline rendering algorithm.
Browse files Browse the repository at this point in the history
It's a lot faster than barycentric interpolation, as it only needs to
compute the depth once - and can then use basic interpolation to render
lines.
The obstruction filter can now rapidly check if a polygon is in front of
any visible points, using a simple comparison operation.
Even though it might check more points, it iterates through polygons
instead of points, and large polygons fail fast.

Additional improvements include using a simple depth check (avoid
calculating rays which might be error-prone), and allowing future
improvements like comparing polygons with each other.

Memory usage should also be a lot more stable.

It also improves speed of rendering of meshes into PNG images.
  • Loading branch information
zlogic committed May 24, 2024
1 parent 7995a2a commit afaf0a4
Show file tree
Hide file tree
Showing 2 changed files with 282 additions and 387 deletions.
Loading

0 comments on commit afaf0a4

Please sign in to comment.