Skip to content

bytecode77/fastpix3d

Repository files navigation

FastPix3D

Software Rasterizer

FastPix3D is a high-performance software rasterizer written in C++.

With features akin to modern 3D engines - such as depth shadows, anisotropic mip mapping, cubemaps, and more - this project stands distinctly superior to other software rasterizers.

Performance

The block-based half-space algorithm is aggressively optimized using AVX2 and multithreading. Pixel shading is performed on 8 pixels at once using SIMD intrinsics.

C++ template parameters are used to implement branchless render states that would otherwise impose branches in the tight inner loops. As a result, render states add zero overhead.

Screenshots

Features

Cool stuff you rarely see in software renderers — all in one place.

Depth shadows with PCF & cubemapping

FastPix3D renders depth maps from point light sources. PCF (percentage closer filtering) produces soft shadows.

With cubemap shadow map projection, it is possible to implement true indoor shadows with full 360° coverage. This feature requires peak performance rasterization to be feasible.

Anisotropic mip mapping & Texture filtering

Anisotropic mip mapping significantly reduces aliasing, at negligible performance cost. Bilinear texture filtering, combined with high frame rates, provides smooth and artifact-free visuals.

Full list of features

  • Depth shadows
    • Point lights
    • Cubemap (6 shadow maps, full 360°)
    • PCF (percentage closer filtering)
  • Textures
    • Anisotropic mip mapping
    • Bilinear filtering
    • Sphere mapping
    • Blend modes (alpha, multiply, add)
    • Per-pixel transparency key
  • Vertex lighting with specular highlights
  • Fog
  • Wireframe
  • Bitmap fonts
  • Primitive generator (cube, sphere, cylinder, torus, etc.)
  • Render to texture

Performance optimizations

  • Block-based half-space algorithm
    • Rendering 8 pixels at once using AVX2
    • Multithreading
    • Rasterization is almost fully branchless
  • Branchless render states by leveraging C++ template parameters
  • Perspective correction and mip mapping performed only once per 8x8 pixel block
  • Optimizations from the architectural level down to micro-optimizations

Downloads

All examples as compiled executables:

FastPix3D 4.1.0.zip

About

Software Rasterizer (C++)

Topics

Resources

License

MIT and 2 other licenses found

Licenses found

MIT
LICENSE.md
MIT
LICENSE-OBJ-Loader.md
MIT
LICENSE-cgltf.md

Stars

Watchers

Forks

Packages

No packages published