tinyrenderer implementation using Rust
Last updated Jan 23, 2026
56
Stars
3
Forks
0
Issues
0
Stars/day
Attention Score
7
Topics
Language breakdown
No language data available.
โธ Files
click to expand
README
tinyrenderer_rs
This repo consists of a Rust implementation of the tinyrenderer walkthrough by professor Dmitry V. Sokolov. For a tinyraytracer Rust implementation, check the tinyraytracerrs repo.Dependencies:
- image 0.24.5: Image loading and manipulation
- piston_window 1.127.0: Window to display rendered frames
- obj-rs 0.6: To retrieve information from .obj files
- nalgebra 0.31.4: For vector and matrix calculations
Usage
To run, just clone any of the branches and do:cargo run --release <assets directory>
where <assets directory> is the directory in which the corresponding assets of the model are. For example, to run Lesson 7 you must do:
cargo run --release assets/diablo3_pose
At the moment, if you want to use other models/textures, you would have to modify the respective assets names in main.
Lessons
Lesson 0
Write to an image buffer and render it in a window.Branch: Lesson0
Preview:
Lesson 1
Implement Bressenham's line algorithm. Then, use it to draw the wireframe model of a mesh.Branch: Lesson1
Preview: 
Lesson 2
Implement triangle filling using both line sweeping algorithm and barycentric coordinates algorithm. Then implement a basic directional lighting model, computing the lighting of each triangle face using its normals.Branch: Lesson2
Preview: 
Lesson 3
Implement Z-buffer algorithm for back-face culling. Then, apply textures to the mesh.Branch: Lesson3
Preview: 
Lesson 4
Implement perspective projection.Branch: Lesson4
Preview: 
Lesson 5
Implement Gouraud shading. Then, implement model view, projection, and viewport transformation matrices. Lastly, apply several transformations to the model through matrices transformation chaining.Branch: Lesson5
Preview: 
Lesson 6/6bis
Structure code into shaders form. Then, implement texture-based normal mapping for the model, using both global coordinate system normal mapping and Darboux frame normal mapping. Lastly, improve lighting by composing the lighting of the model using ambient, diffuse, and specular lighting (Phong shading).Branches: Lesson6 Lesson6bis
Preview: 
Lesson 7
Implement hard shadow computation through shadow mapping.Branch: Lesson7
Preview: 
Lesson 8
Implement screen space ambient occlusion.Branch: Lesson8
Preview:

Technical difficulties: linear interpolation with perspective deformations
Implement perspective correction for perspective deformations during linear interpolation.Branch: perspcorrection
Preview: 
๐ More in this category