2D SVG rasterizer
in OpenGL, C++
#1 Lines Rasterizing
In this task I implemented the function of rasterizing lines, which:
#Handles non-integer vertex coordinates.
#Handles lines of any slope.
#Performs work proportional to the length of the line.
#Includes Bresenham's algorithm and Xiaolin Wu's line algorithm.
[Image below: Line antialiasing implementation with Xiaolin Wu's algorithm]
In this project, I implemented a simple software rasterizer that draws points, lines, triangles, and bitmap images.
#1-4 Other implementations
Other implementations include:
#Modeling and Viewing Transforms.
#Anti-Aliasing Images with Bilinear, Trilinear filters and Mipmaps.
#Circle and Ellipse rasterizing.
#Alpha Compositing.
[Image below: Image drawn with functions implementation]
#1-3 Super-sampling
In this task, I extended my rasterizer to anti-alias triangle edges via supersampling in screen-space coordinates, which:
#Gives much smoother edges.
#Includes different supersampling rate in the viewer
[Image below: Increasing the supersampling rate]
#1-2 Drawing Triangles
In this task I implemented rasterize_triangle which:
#Samples triangle coverage using the Point-in-triangle test.
#Respects the triangle "edge rules" to avoid "double counting".
#Uses an algorithm that is more work efficient than simply testing all samples on screen.
[Image below: Dragon drawing composed of triangles]