{"id":18369151,"url":"https://github.com/angusgmorrison/rasterizer","last_synced_at":"2025-08-09T01:41:52.290Z","repository":{"id":99831069,"uuid":"575531264","full_name":"AngusGMorrison/rasterizer","owner":"AngusGMorrison","description":"A 3D rasterizer coded from scratch in C.","archived":false,"fork":false,"pushed_at":"2023-02-03T09:25:32.000Z","size":743,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T20:54:20.028Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AngusGMorrison.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-12-07T18:09:19.000Z","updated_at":"2025-02-03T17:49:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"ee43c396-ab4a-472f-8a6a-fd54ec59bae1","html_url":"https://github.com/AngusGMorrison/rasterizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngusGMorrison%2Frasterizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngusGMorrison%2Frasterizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngusGMorrison%2Frasterizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngusGMorrison%2Frasterizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AngusGMorrison","download_url":"https://codeload.github.com/AngusGMorrison/rasterizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281424,"owners_count":21077423,"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","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":[],"created_at":"2024-11-05T23:28:36.084Z","updated_at":"2025-04-10T19:39:48.783Z","avatar_url":"https://github.com/AngusGMorrison.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A ground-up 3D renderer in pure C\n\nBehold the limited power of a single CPU core performing an uncomfortable amount of\ncomputational geometry!\n\n![Animated gif of a 3D F22 fighter jet cycling through different render modes](assets/f22-small.gif \"F22 render modes\")\n\nThis exercise in the mathematical foundations of 3D rendering loads models from .obj files and\nrenders them with perspective-correct textures. It demonstrates:\n  * Linear algebra for perspective projection of models and textures\n  * Flat shading\n  * Back-face culling\n  * Ambient lighting\n  * An .obj file parser\n  * 8 rendering modes\n\nWhat did I learn? Why the GPU was invented.\n\n## Usage\nSimply drop your model and its PNG texture into the assets folder, update the asset paths in main.c,\ncompile and run. Low-poly models are recommended unless you have a really good CPU fan.\n\nRendering mode keybindings:\n  * 1: Vertex-only\n  * 2: Vertex wireframe\n  * 3: Wireframe only\n  * 4: Flat-shaded\n  * 5: Flat-shaded with wireframe\n  * 6: Textured\n  * 7: Textured with wireframe\n  * c: Toggle back-face culling\n\n## Future improvements\n* Camera control\n* Clipping of assets outside the rendering frustum\n* Inline triangle and fgace vertex getters with macros\n* Improved consistency in the function signatures of rendering methods\n* Specify assets to render via the command line\n* Further performance optimization\n\n## Acknowledgements\nThis project is based on [a course by Gustavo\nPezzi](https://pikuma.com/courses/learn-3d-computer-graphics-programming), with significant\nmodifications to the source code by me to improve performance, readability and maintainability. It\nis distributed under the same GNU General Public License as the original. Additional thanks go to\ngustavopezzi for [the dynamic array code](https://github.com/gustavopezzi/dynamicarray), and to\nelanthis for [the PNG decoder, upng](https://github.com/elanthis/upng). The F22 model and texture\nwere created by Artem Katrych.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangusgmorrison%2Frasterizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangusgmorrison%2Frasterizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangusgmorrison%2Frasterizer/lists"}