A software rendering pipeline that features:
- Pixel-perfect rasterization of all main primitive types (triangles, lines, points)
- Fully programmable vertex and fragment shaders (+uniforms)
- Sutherland-Hodgman triangle clipping & Liang-Barsky line clipping
- Perspective-correct, affine, and flat attribute interpolation
- Texture mapping
- Post-VS vertex caching
- A small math library to use in shader programming
- Image-based testing framework
The only dependency is stb_image.
If you want to use this library in your own project, you only need headers from include/srp directory.
Read the documentation for master branch here, or build the documentation yourself (see Building)
git clone https://www.github.com/kitrofimov/srp
mkdir srp/build
cd srp/build
cmake .. -D CMAKE_BUILD_TYPE=Release
make
cd binBUILD_EXAMPLES, BUILD_DOCS, and BUILD_TESTS options are also available (i.e. -D BUILD_EXAMPLES=1 passed to cmake). Building the documentation requires having dot binary in PATH; building the tests requires numpy and pillow Python modules. After building, the examples, docs, and tests will appear in build/examples, build/docs, and build/tests.
- https://github.com/rswinkle/PortableGL
- https://github.com/NotCamelCase/SoftLit
- https://github.com/nikolausrauch/software-rasterizer
- https://github.com/niepp/srpbr
- General Computer Graphics concepts:
- Triangle rasteization:
- Perspective-correct interpolation:
-
Add interpolation with perspective correction
-
Split the construction and rasterization of triangles in the pipeline
-
Fix rasterization rules
-
Get rid of dynamic memory allocation in the hot path (
mallocand VLA) -
Make CW/CCW vertex order configurable
-
Implement other primitives (lines, points, lines/triangles strip/adjacency etc.)
-
Project refactoring
-
Clipping
-
Debug stutters (e.g. draw cube in line mode, stutters every 1.5-2 seconds)
-
Add an example with
.objmodel loading -
Add wireframe rendering of triangles (polygon rendering mode)
-
Use
floats everywhere (instead ofdoubles) -
Check for bottlenecks & optimize
-
Update the documentation
-
Image-based testing framework
-
Flat interpolation, per-varying perspective / affine / flat setting
-
Implement single-threaded binning and tile system
-
Scale to multiple threads
-
Add multisampling
-
Advanced texture techniques:
- (Bi)linear filtering
- Mipmapping
- Anisotropic filtering
- Transparent textures?