{"id":15031699,"url":"https://github.com/ema2159/tinyrenderer_rs","last_synced_at":"2025-07-23T12:35:12.097Z","repository":{"id":63782893,"uuid":"569443147","full_name":"ema2159/tinyrenderer_rs","owner":"ema2159","description":"tinyrenderer implementation using Rust","archived":false,"fork":false,"pushed_at":"2023-04-22T18:56:36.000Z","size":17212,"stargazers_count":55,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T00:29:47.036Z","etag":null,"topics":["3d","3d-graphics","3d-models","computer-graphics","didactic","graphics","learning","opengl","renderer","rendering","rendering-pipeline","rust","rust-lang","rustlang","tinyrenderer","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ema2159.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-22T20:54:51.000Z","updated_at":"2025-02-24T21:27:39.000Z","dependencies_parsed_at":"2025-02-16T03:42:18.804Z","dependency_job_id":null,"html_url":"https://github.com/ema2159/tinyrenderer_rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ema2159/tinyrenderer_rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ema2159%2Ftinyrenderer_rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ema2159%2Ftinyrenderer_rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ema2159%2Ftinyrenderer_rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ema2159%2Ftinyrenderer_rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ema2159","download_url":"https://codeload.github.com/ema2159/tinyrenderer_rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ema2159%2Ftinyrenderer_rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266680334,"owners_count":23967792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","3d-graphics","3d-models","computer-graphics","didactic","graphics","learning","opengl","renderer","rendering","rendering-pipeline","rust","rust-lang","rustlang","tinyrenderer","tutorial"],"created_at":"2024-09-24T20:16:21.289Z","updated_at":"2025-07-23T12:35:12.048Z","avatar_url":"https://github.com/ema2159.png","language":"Rust","readme":"# tinyrenderer_rs\nThis repo consists of a Rust implementation of the [tinyrenderer](https://github.com/ssloy/tinyrenderer) walkthrough by professor Dmitry V. Sokolov. For a tinyraytracer Rust implementation, check the [tinyraytracer_rs](https://github.com/ema2159/tinyraytracer_rs) repo.\n\n## Dependencies:\n- image 0.24.5: Image loading and manipulation\n- piston_window 1.127.0: Window to display rendered frames\n- obj-rs 0.6: To retrieve information from .obj files\n- nalgebra 0.31.4: For vector and matrix calculations\n\n## Usage\nTo run, just clone any of the branches and do:\n\n```\ncargo run --release \u003cassets directory\u003e\n```\nwhere `\u003cassets directory\u003e` is the directory in which the corresponding assets of the model are. For example, to run *Lesson 7* you must do:\n\n```\ncargo run --release assets/diablo3_pose\n```\nAt the moment, if you want to use other models/textures, you would have to modify the respective assets names in main.\n\n\n\n## Lessons\n\n### Lesson 0\nWrite to an image buffer and render it in a window.\n\n**Branch:** [Lesson_0](https://github.com/ema2159/tinyrenderer_rs/tree/Lesson_0)\n\n**Preview:**\n![Lesson 0 image](./imgs/lesson0.png)\n### Lesson 1\nImplement Bressenham's line algorithm. Then, use it to draw the wireframe model of a mesh.\n\n**Branch:** [Lesson_1](https://github.com/ema2159/tinyrenderer_rs/tree/Lesson_1)\n\n**Preview:**\n![Lesson 1 image](./imgs/lesson1.png)\n\n### Lesson 2\nImplement 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.\n\n**Branch:** [Lesson_2](https://github.com/ema2159/tinyrenderer_rs/tree/Lesson_2)\n\n**Preview:**\n![Lesson 2 image](./imgs/lesson2.png)\n\n### Lesson 3\nImplement Z-buffer algorithm for back-face culling. Then, apply textures to the mesh.\n\n**Branch:** [Lesson_3](https://github.com/ema2159/tinyrenderer_rs/tree/Lesson_3)\n\n**Preview:**\n![Lesson 3 image](./imgs/lesson3.png)\n\n### Lesson 4\nImplement perspective projection.\n\n**Branch:** [Lesson_4](https://github.com/ema2159/tinyrenderer_rs/tree/Lesson_4)\n\n**Preview:**\n![Lesson 4 image](./imgs/lesson4.png)\n\n### Lesson 5\nImplement Gouraud shading. Then, implement model view, projection, and viewport transformation matrices. Lastly, apply several transformations to the model through matrices transformation chaining.\n\n**Branch:** [Lesson_5](https://github.com/ema2159/tinyrenderer_rs/tree/Lesson_5)\n\n**Preview:**\n![Lesson 5 image](./imgs/lesson5.png)\n\n### Lesson 6/6bis\nStructure 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).\n\n**Branches:** [Lesson_6](https://github.com/ema2159/tinyrenderer_rs/tree/Lesson_6) [Lesson_6bis](https://github.com/ema2159/tinyrenderer_rs/tree/Lesson_6bis)\n\n**Preview:**\n![Lesson 6 image](./imgs/lesson6.png)\n\n### Lesson 7\nImplement hard shadow computation through shadow mapping.\n\n**Branch:** [Lesson_7](https://github.com/ema2159/tinyrenderer_rs/tree/Lesson_7)\n\n**Preview:**\n![Lesson 7 image](./imgs/lesson7.png)\n\n### Lesson 8\nImplement screen space ambient occlusion.\n\n**Branch:** [Lesson_8](https://github.com/ema2159/tinyrenderer_rs/tree/Lesson_8)\n\n**Preview:**\n![Lesson 8 image](./imgs/lesson8_1.png)\n![Lesson 8 image](./imgs/lesson8_2.png)\n\n### Technical difficulties: linear interpolation with perspective deformations\nImplement perspective correction for perspective deformations during linear interpolation.\n\n**Branch:** [persp_correction](https://github.com/ema2159/tinyrenderer_rs/tree/persp_correction)\n\n**Preview:**\n![Lesson 8 image](./imgs/persp_corr.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fema2159%2Ftinyrenderer_rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fema2159%2Ftinyrenderer_rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fema2159%2Ftinyrenderer_rs/lists"}