{"id":13698672,"url":"https://github.com/skywind3000/mini3d","last_synced_at":"2025-05-15T04:00:31.096Z","repository":{"id":36139520,"uuid":"40443465","full_name":"skywind3000/mini3d","owner":"skywind3000","description":"3D Software Renderer in 700 Lines !!","archived":false,"fork":false,"pushed_at":"2024-09-23T16:16:14.000Z","size":420,"stargazers_count":2268,"open_issues_count":5,"forks_count":506,"subscribers_count":99,"default_branch":"master","last_synced_at":"2025-04-11T14:19:36.359Z","etag":null,"topics":["3d","c","game-engine","graphics","opengl","picture","pixels","rasterizer","renderer","software-renderer","software-rendering"],"latest_commit_sha":null,"homepage":"","language":"C","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/skywind3000.png","metadata":{"files":{"readme":"README.en.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":"2015-08-09T16:50:34.000Z","updated_at":"2025-04-10T01:27:27.000Z","dependencies_parsed_at":"2022-08-08T13:30:22.941Z","dependency_job_id":"e3505299-bc9d-4ed7-a43c-fd888e5b12e1","html_url":"https://github.com/skywind3000/mini3d","commit_stats":{"total_commits":42,"total_committers":5,"mean_commits":8.4,"dds":"0.40476190476190477","last_synced_commit":"d9c9874aa27840481f62f963a8dee7c8f5321c3d"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fmini3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fmini3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fmini3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skywind3000%2Fmini3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skywind3000","download_url":"https://codeload.github.com/skywind3000/mini3d/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270640,"owners_count":22042858,"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":["3d","c","game-engine","graphics","opengl","picture","pixels","rasterizer","renderer","software-renderer","software-rendering"],"created_at":"2024-08-02T19:00:51.734Z","updated_at":"2025-05-15T04:00:31.038Z","avatar_url":"https://github.com/skywind3000.png","language":"C","readme":"# mini3d\r\n\r\n3D software rendering tutorial, without any performance optimization, mainly explains how to write a fixed pipeline software renderer. Although the main code is only 700 lines, it is small but complete.\r\n\r\n## Features\r\n\r\n* Single File: The source code consists of only one file, mini3d.c, which implements all the functionality. It is easy to read and understand.\r\n* Independent Compilation: There is no third-party library dependency and no complex project directory.\r\n* Model Standard: Uses the standard D3D coordinate model, left-handed system with WORLD/VIEW/PROJECTION matrices.\r\n* Clipping Implementation: Implements simple CVV (Canonical View Volume) clipping.\r\n* Texture Support: Supports textures up to a maximum of 1024 x 1024.\r\n* Depth Buffering: Uses a depth buffer to determine the order of image rendering.\r\n* Perspective Texture Mapping: Implements perspective texture mapping and perspective color filling.\r\n* Edge Calculation: Accurately calculates polygon edge coverage.\r\n* Simplified Implementation: The rendering engine consists of only 700 lines of code, with clear modules and a prominent main structure.\r\n* Detailed Comments: The primary code is well-documented with detailed comments.\r\n\r\n## Compile\r\n\r\n* mingw: \r\n\t\tgcc -O3 mini3d.c -o mini3d.exe -lgdi32\r\n* msvc:\r\n\t\tcl -O2 -nologo mini3d.c \r\n* Compiled version:\r\n[https://github.com/skywind3000/mini3d/releases](https://github.com/skywind3000/mini3d/releases)\r\n\r\n## Demonstration\r\n\r\nTexture Mapping：RENDER_STATE_TEXTURE\r\n![](https://raw.githubusercontent.com/skywind3000/mini3d/master/images/mini_1.png)\r\n\r\nColor Filling：RENDER_STATE_COLOR\r\n![](https://raw.githubusercontent.com/skywind3000/mini3d/master/images/mini_0.png)\r\n\r\nWireframe Rendering：RENDER_STATE_WIREFRAME\r\n![](https://raw.githubusercontent.com/skywind3000/mini3d/master/images/mini_2.png)\r\n\r\nAdded Lighting and Bicubic Interpolation (screenshot of lighting effect added by a friend to Mini3D)\r\n![](https://raw.githubusercontent.com/skywind3000/mini3d/master/images/mini_3.png)\r\n\r\n## Basic TO-DO:\r\n\r\n* Add backface culling\r\n* Implement simple lighting\r\n* Provide more rendering modes\r\n* Implement texture sampling with bicubic interpolation\r\n\r\n## Advanced TO-DO:\r\n\r\n* Derive and prove all geometric knowledge used in the program\r\n* Optimize vertex computation performance\r\n* Optimize draw_scanline performance\r\n* Load textures from BMP/TGA files\r\n* Load BSP scenes and implement roaming.\r\n\r\n## Explanation of principles\r\n\r\n- [Wei Yixiao: How do OpenGL and DirectX determine the position of pixels only based on vertices?](https://skywind.me/blog/archives/2594)\r\n- [Wei Yixiao: How does the computer access the graphics card at a low level?](https://skywind.me/blog/archives/1774)\r\n\r\n## Related Projects\r\n\r\n- [RenderHelp](https://github.com/skywind3000/RenderHelp)：Another implementation of a streamlined software renderer with support for programmable rendering pipelines, for more details see https://skywind.me/blog/archives/2589\r\n\r\n## Welcome to donate:\r\n\r\n![](https://raw.githubusercontent.com/skywind3000/mini3d/master/images/donation.png)\r\n\r\nYour donation is the greatest recognition for this tutorial. You are welcome to use Alipay to scan the QR code above to make a donation. The donated funds will be used to improve the tutorial documentation and illustrations, as well as to help me write more interesting tutorials.\r\n\r\n\r\n\r\n## Welcome to follow us:\r\n\r\nblog: https://skywind.me/blog\r\n\r\nzhihu: https://www.zhihu.com/people/skywind3000 \r\n","funding_links":[],"categories":["ComputerGraphics \u0026\u0026 Shadingv","C"],"sub_categories":["Google Analytics"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskywind3000%2Fmini3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskywind3000%2Fmini3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskywind3000%2Fmini3d/lists"}