{"id":23428366,"url":"https://github.com/visualgmq/rs-cpurenderer","last_synced_at":"2025-08-29T16:30:37.808Z","repository":{"id":156284435,"uuid":"558176589","full_name":"VisualGMQ/rs-cpurenderer","owner":"VisualGMQ","description":"a cpu/gpu soft renderer in rust","archived":false,"fork":false,"pushed_at":"2023-06-28T07:00:26.000Z","size":3387,"stargazers_count":59,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-26T14:38:25.508Z","etag":null,"topics":["graphics","rasterization","rasterizer","rendering","rust","soft-renderer","software-renderer"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VisualGMQ.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-10-27T03:10:26.000Z","updated_at":"2024-11-03T07:22:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"98813a1b-6eaa-43ee-94dc-bf098491ae0f","html_url":"https://github.com/VisualGMQ/rs-cpurenderer","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/VisualGMQ%2Frs-cpurenderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VisualGMQ%2Frs-cpurenderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VisualGMQ%2Frs-cpurenderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VisualGMQ%2Frs-cpurenderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VisualGMQ","download_url":"https://codeload.github.com/VisualGMQ/rs-cpurenderer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248626279,"owners_count":21135637,"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":["graphics","rasterization","rasterizer","rendering","rust","soft-renderer","software-renderer"],"created_at":"2024-12-23T07:12:14.621Z","updated_at":"2025-04-12T20:20:46.029Z","avatar_url":"https://github.com/VisualGMQ.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"使用纯Rust编写的3D软渲染器。\n\n[B站视频教程](https://www.bilibili.com/video/BV1Nv4y1p79o/?spm_id_from=333.999.0.0\u0026vd_source=cb60c670b9b482f512a7f10d235b9b30)\n\n## 目前的显示\n\n![snapshot](./snapshot/snapshot.gif)\n\n## 工程运行\n\n只有一个例子：`examples/sandbox.rs`，用\n\n```bash\ncargo run --example sandbox\n```\n\n运行。\n\n使用WSAD前后左右移动相机，使用Q上升相机，E下降相机。\n\n本工程由两种软渲染：纯粹为了在CPU上快速运行的CPU软渲染(`./src/cpu_renderer.rs`)，以及模拟GPU原理的GPU软渲染(`./src/gpu_renderer.rs`)。使用`features`可以指定运行某种：\n\n```bash\ncargo run --example sandbox --features cpu\ncargo run --example sandbox --features gpu\n```\n\n默认是CPU渲染。\n\n## 参考\n\n书籍：\n* 《3D游戏编程大师技巧》\n* 《Fundamentals of Computer Graphics》\n* 《线性代数及其应用》\n\n视频：\n* [【GAMES101-现代计算机图形学入门-闫令琪】](https://www.bilibili.com/video/BV1X7411F744/?share_source=copy_web\u0026vd_source=e1b8baee842192a0e6b2b7d9ef8e10ef)中关于光栅化的部分。\n\n齐次空间裁剪:\n* [clipping using homogeneous coordinates](https://citeseerx.ist.psu.edu/document?repid=rep1\u0026type=pdf\u0026doi=497a973878c87e357ff4741b394eb106eb510177)\n* [polygon codec/homogeneous clipping](https://fabiensanglard.net/polygon_codec/)\n\n投影矩阵推导：\n* [gl_perspective_matrix](http://www.songho.ca/opengl/gl_projectionmatrix.html)\n\n透视投影矫正：\n* [韦易笑大神的博客](https://www.skywind.me/blog/archives/1363)\n* [维基上关于仿射纹理变换和矫正部分](https://en.wikipedia.org/wiki/Texture_mapping#Affine_texture_mapping)\n* [Kavita Bala的文章](https://www.cs.cornell.edu/courses/cs4620/2015fa/lectures/PerspectiveCorrectZU.pdf)\n\n其他:\n* [OpenGL 和 DirectX 是如何在只知道顶点的情况下得出像素位置的](https://www.zhihu.com/question/48299522/answer/799333394)\n* [RenderHelp项目](https://github.com/skywind3000/RenderHelp)\n* [mini3d项目](https://github.com/skywind3000/mini3d)\n* [光栅化实现](https://www.scratchapixel.com/lessons/3d-basic-rendering/rasterization-practical-implementation/overview-rasterization-algorithm.html)\n* [图形学|shader|用一篇文章理解半透明渲染、透明度测试和混合、提前深度测试并彻底理清渲染顺序。](https://zhuanlan.zhihu.com/p/263566318)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisualgmq%2Frs-cpurenderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvisualgmq%2Frs-cpurenderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisualgmq%2Frs-cpurenderer/lists"}