← All projects
Project record1 mention
Originally shared on Hacker News

Software triangle rasterizer in Rust

A software triangle rasterizer written in Rust using std::simd, benchmarked at ~3.2 Gpixels/s fill rate on a decade-old laptop for solid color triangles with depth testing. It compiles for SSE2, NEON, AVX2, or AVX512 via compiler parameters, uses generics to support multiple vector widths in the same binary (16-wide vectors, 10-20% faster than 8-wide), and follows Fabian Giesen's software rasterizer blog series as a baseline. It is intended for visibility buffer style rendering (storing integer triangle IDs in the color buffer) and software occlusion culling with a depth buffer.

Last shared
01 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. Software triangle rasterizer in Rust

    A software triangle rasterizer written in Rust using std::simd, benchmarked at ~3.2 Gpixels/s fill rate on a decade-old laptop for solid color triangles with depth testing. It compiles for SSE2, NEON, AVX2, or AVX512 via compiler parameters, uses generics to support multiple vector widths in the same binary (16-wide vectors, 10-20% faster than 8-wide), and follows Fabian Giesen's software rasterizer blog series as a baseline. It is intended for visibility buffer style rendering (storing integer triangle IDs in the color buffer) and software occlusion culling with a depth buffer.

    Posted by @exDM69 · Original source ↗

    Source text · @exDM69 · · Source ↗

    I started writing a software triangle rasterizer. Not sure exactly why, but I just felt like doing it.