A simple and tiny software triangle rasterizer written with C/C++ and Intel's ISPC. I haven't done any major optimizations, it's a toy project just to learn about 3d graphics and ISPC.
The triangle rasterizer is heavily inspired by Fabian "ryg" Giesen's Blog Triangle rasterization in practice and Optimizing the basic rasterizer . Thanks Fabian, you're amazing!
The program renders an image on the CPU, which then gets displayed on a screen with OpenGL.
Depends on GLFW and GLAD for platform-specific code and OpenGL.
The "driver" code is in main.cpp and the actual rendering is in renderer.ispc
- Triangle rasterization with SIMD
- Loading OBJ files with fast_obj
- Vertex attribute interpolation (depth and normals)
- Simple shading based on IQ's Outdoors Lighting Article
- Display fullscreen texture with OpenGL
- Download and install the ISPC Compiler
- In x64 VS Developer Console, run
python build.py
- The resulting executable is
main.exe
Note: I consider this project more-or-less finished. I don't think I'll actually do things from this list, but who knows. I will happily merge any pull requests though.
- Proper triangle clipping
- Better depth encoding
- UVs
- Textures
- Materials
- Command line arguments
- Loading other model file formats