I follow lessons from https://github.com/ssloy/tinyrenderer to understand the way OpenGL or another graphic API works.
I developed a small rasterizer by implementing the 3d graphics pipeline on CPU. My goals are learning the details of the steps on the pipeline and finding out the magic on the GPU side.
The project contains:
- Drawing lines and triangles (Bresenham’s Line Drawing Algorithm)
- Interpolation (Barycentric Coordinate System)
- Model loader (tiny-obj-loader)
- Texture sampler
- Vertex shader
- Fragment shader
- Depth test
- 3D transformations (model, view, perspective projection)
- Tangent space normal mapping
- OpenGL viewer (only texture rendering)
The project is developed using C programming language and cglm library for most of the calculations. The viewer of the project is a very simple OpenGL application which renders a texture to a quad.
Samples from Rendered Images:
rm -rf <build_folder>
mkdir <build_folder>
cmake -G "Visual Studio 17" -S . -B <build_folder>
cmake --build <build_folder>
[1] https://github.com/ssloy/tinyrenderer