(stands for software rendering pipeline)
Highly inspired by OpenGL API and made only for learning purposes, this is my first serious project in C (still WIP at the moment) and my first project in the field of computer graphics. The only dependency is stb_image
. You probably do not want to use this in production code!
This is a rendering pipeline written fully in software that uses only the CPU for computation. It features:
- Fully programmable vertex and fragment shaders
- A small math library with vector and matrix structures to use in shader programming
- Texture mapping
- Shader uniforms
- Affine attribute interpolation
Read the documentation for master
branch here, or build the documentation yourself (see Building section)
git clone https://www.github.com/fahlerile/srp
mkdir srp/build
cd srp/build
cmake .. -D CMAKE_BUILD_TYPE=Release
make
cd bin
You can also build the examples with -D BUILD_EXAMPLES=1
and the documentation with -D BUILD_DOCS=1
arguments passed to cmake
. Building the documentation requires having dot
binary in PATH
.
- https://github.com/rswinkle/PortableGL
- https://github.com/NotCamelCase/SoftLit
- https://github.com/nikolausrauch/software-rasterizer
- https://github.com/niepp/srpbr
And a lot more... Here I mentioned only those projects on which I looked at as a reference while making this one. If you need more similar projects, see this and this.
- General Computer Graphics concepts:
- Triangle rasteization:
- Perspective-correct interpolation:
And many, many more, all of which I will not find anymore...
- Add interpolation with perspective correction
- Fix rasterization rules (see the gaps between triangles in
03_spinning_textured_cube
example) - Implement other primitives (lines, points, lines/triangles strip/adjacency etc.)
- Implement interpolation for types other than
double
(shouldn't it just bedouble
andfloat
?) - Add multisampling
- Advanced texture techniques:
- (Bi)linear filtering
- Mipmapping
- Anisotropic filtering
- Transparent textures?
- Are
vec
andmat
functions inlined by the compiler? Should they be? Aremat
orvec
ever passed by-value? - Use a profiler to find bottlenecks in frequently-used functions
- Draw primitives in parallel (OpenMP)
This is a section specially for my portfolio, so feel free to skip it. Well, I learned:
- Some C programming techniques and library design
- Importance of having a plan, an end goal:
- This project started as something completely different from what it is now
- Basic Git workflow
- The importance of atomic (if it is possible) commits and meaningful commit names
- Premature optimization and optimization without measuring really is the root of all evil
- Importance of readable code and comments where they are needed