ema2159
tinyrenderer_rs
Rust

tinyrenderer implementation using Rust

Last updated Jan 23, 2026
56
Stars
3
Forks
0
Issues
0
Stars/day
Attention Score
7
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 0 image

Lesson 1

Implement Bressenham's line algorithm. Then, use it to draw the wireframe model of a mesh.

Branch: Lesson1

Preview: Lesson 1 image

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 2 image

Lesson 3

Implement Z-buffer algorithm for back-face culling. Then, apply textures to the mesh.

Branch: Lesson3

Preview: Lesson 3 image

Lesson 4

Implement perspective projection.

Branch: Lesson4

Preview: Lesson 4 image

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 5 image

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 6 image

Lesson 7

Implement hard shadow computation through shadow mapping.

Branch: Lesson7

Preview: Lesson 7 image

Lesson 8

Implement screen space ambient occlusion.

Branch: Lesson8

Preview: Lesson 8 image Lesson 8 image

Technical difficulties: linear interpolation with perspective deformations

Implement perspective correction for perspective deformations during linear interpolation.

Branch: perspcorrection

Preview: Lesson 8 image

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท ema2159/tinyrenderer_rs ยท Updated daily from GitHub