{"id":13670536,"url":"https://github.com/zauonlok/renderer","last_synced_at":"2025-10-18T06:06:18.366Z","repository":{"id":41065251,"uuid":"85579630","full_name":"zauonlok/renderer","owner":"zauonlok","description":"A shader-based software renderer written from scratch in C89","archived":false,"fork":false,"pushed_at":"2021-03-06T07:55:05.000Z","size":134661,"stargazers_count":2569,"open_issues_count":1,"forks_count":282,"subscribers_count":63,"default_branch":"master","last_synced_at":"2025-04-07T21:12:56.575Z","etag":null,"topics":["3d","3d-graphics","c","cross-platform","from-scratch","graphics","graphics-programming","ibl","pbr","rendering","shaders","software-rendering"],"latest_commit_sha":null,"homepage":"https://zauonlok.github.io/renderer/","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/zauonlok.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}},"created_at":"2017-03-20T13:25:08.000Z","updated_at":"2025-04-07T12:45:44.000Z","dependencies_parsed_at":"2022-07-11T03:18:32.064Z","dependency_job_id":null,"html_url":"https://github.com/zauonlok/renderer","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zauonlok%2Frenderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zauonlok%2Frenderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zauonlok%2Frenderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zauonlok%2Frenderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zauonlok","download_url":"https://codeload.github.com/zauonlok/renderer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374408,"owners_count":22060610,"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","3d-graphics","c","cross-platform","from-scratch","graphics","graphics-programming","ibl","pbr","rendering","shaders","software-rendering"],"created_at":"2024-08-02T09:00:44.651Z","updated_at":"2025-10-18T06:06:13.322Z","avatar_url":"https://github.com/zauonlok.png","language":"C","funding_links":[],"categories":["ComputerGraphics \u0026\u0026 Shadingv","C"],"sub_categories":["Google Analytics"],"readme":"# Software Renderer ![](https://github.com/zauonlok/renderer/workflows/Windows/badge.svg) ![](https://github.com/zauonlok/renderer/workflows/macOS/badge.svg) ![](https://github.com/zauonlok/renderer/workflows/Linux/badge.svg)\n\n\u003cimg src=\"assets/helmet/screenshot2.png\" width=\"410\"\u003e \u003cimg src=\"assets/helmet/screenshot3.png\" width=\"410\"\u003e\n\u003cimg src=\"assets/drone/screenshot1.gif\" width=\"410\"\u003e \u003cimg src=\"assets/drone/screenshot2.gif\" width=\"410\"\u003e\n\nThis is a shader-based software renderer written from scratch in C89 with\nminimal dependencies, available for Windows, macOS, and Linux.\n\n## Features\n\n* Cross platform\n* Minimal dependencies\n* Shader based\n* Homogeneous clipping\n* Back-face culling\n* Perspective correct interpolation\n* Depth testing\n* Alpha testing\n* Alpha blending\n* Cubemapped skybox\n* Skeletal animation\n* Tangent space normal mapping\n* Shadow mapping\n* ACES tone mapping\n* Blinn–Phong reflection model\n* Physically based rendering (PBR)\n* Metallic-roughness workflow\n* Specular-glossiness workflow\n* Image-based lighting (IBL)\n* Orbital camera controls\n* PBR material inspector\n\n## Download\n\nPre-built binaries for Windows, macOS, and Linux are available for download\nfrom the [Releases page](https://github.com/zauonlok/renderer/releases).\n\n## Build\n\nTo build the software renderer from source, a C89 compiler and development\nfiles for your window system are required.\n\n### Windows\n\nInstall [Visual Studio](https://visualstudio.microsoft.com/downloads/)\nwith C++ support and run `build_win32.bat`.\n\n### macOS\n\nInstall Command Line Tools for Xcode with the command below and\nrun `build_macos.sh`.\n\n```\nxcode-select --install\n```\n\n### Linux\n\nInstall GCC and Xlib with the following commands and run `build_linux.sh`.\n\n#### Ubuntu / Debian\n\n```\nsudo apt install gcc libx11-dev\n```\n\n#### Fedora / RHEL\n\n```\nsudo dnf install gcc libX11-devel\n```\n\n#### openSUSE / SUSE\n\n```\nsudo zypper install gcc libX11-devel\n```\n\n### Bonus\n\nA `CMakeLists.txt` file is provided for generating project files using\n[CMake](https://cmake.org/) (see examples below).\n\n#### Visual Studio\n\n```\nmkdir build\ncd build\ncmake -G \"Visual Studio 16 2019\" ..\nstart Renderer.sln\n```\n\n#### Xcode\n\n```\nmkdir build\ncd build\ncmake -G Xcode ..\nopen Renderer.xcodeproj\n```\n\n#### Makefile\n\n```\nmkdir build\ncd build\ncmake -G \"Unix Makefiles\" -D CMAKE_BUILD_TYPE=Release ..\nmake\n```\n\n## Usage\n\n### Launch\n\nIf the software renderer is launched without arguments, one of the available\nscenes will be chosen randomly. To display a specific scene (see below),\nadditional arguments should be supplied. The command line syntax is:\n\n```\nViewer [test_name [scene_name]]\n```\n\n### Controls\n\n* Orbit: left mouse button\n* Pan: right mouse button\n* Zoom: mouse wheel\n* Rotate lighting: \u003ckbd\u003eA\u003c/kbd\u003e \u003ckbd\u003eD\u003c/kbd\u003e \u003ckbd\u003eS\u003c/kbd\u003e \u003ckbd\u003eW\u003c/kbd\u003e\n* Reset everything: \u003ckbd\u003eSpace\u003c/kbd\u003e\n\n### Inspector\n\nFor PBR scenes, a material inspector that is very similar to the layers view\nof [Marmoset Viewer](https://marmoset.co/viewer/) is provided. Double click\nto bring it up.\n\n## Screenshots\n\n| Scene                                                                                   | Command                   |\n| --------------------------------------------------------------------------------------- | ------------------------- |\n| [\u003cimg src=\"assets/azura/screenshot.png\" width=\"600\"\u003e](assets/azura/README.md)           | `Viewer blinn azura`      |\n| [\u003cimg src=\"assets/centaur/screenshot.png\" width=\"600\"\u003e](assets/centaur/README.md)       | `Viewer blinn centaur`    |\n| [\u003cimg src=\"assets/craftsman/screenshot2.gif\" width=\"600\"\u003e](assets/craftsman/README.md)  | `Viewer blinn craftsman`  |\n| [\u003cimg src=\"assets/elfgirl/screenshot2.png\" width=\"600\"\u003e](assets/elfgirl/README.md)      | `Viewer blinn elfgirl`    |\n| [\u003cimg src=\"assets/kgirl/screenshot.gif\" width=\"600\"\u003e](assets/kgirl/README.md)           | `Viewer blinn kgirl`      |\n| [\u003cimg src=\"assets/lighthouse/screenshot.png\" width=\"600\"\u003e](assets/lighthouse/README.md) | `Viewer blinn lighthouse` |\n| [\u003cimg src=\"assets/mccree/screenshot.png\" width=\"600\"\u003e](assets/mccree/README.md)         | `Viewer blinn mccree`     |\n| [\u003cimg src=\"assets/nier2b/screenshot.png\" width=\"600\"\u003e](assets/nier2b/README.md)         | `Viewer blinn nier2b`     |\n| [\u003cimg src=\"assets/phoenix/screenshot.gif\" width=\"600\"\u003e](assets/phoenix/README.md)       | `Viewer blinn phoenix`    |\n| [\u003cimg src=\"assets/vivi/screenshot.png\" width=\"600\"\u003e](assets/vivi/README.md)             | `Viewer blinn vivi`       |\n| [\u003cimg src=\"assets/whip/screenshot.gif\" width=\"600\"\u003e](assets/whip/README.md)             | `Viewer blinn whip`       |\n| [\u003cimg src=\"assets/witch/screenshot.png\" width=\"600\"\u003e](assets/witch/README.md)           | `Viewer blinn witch`      |\n| [\u003cimg src=\"assets/assassin/screenshot.gif\" width=\"600\"\u003e](assets/assassin/README.md)     | `Viewer pbr assassin`     |\n| [\u003cimg src=\"assets/buster/screenshot1.gif\" width=\"600\"\u003e](assets/buster/README.md)        | `Viewer pbr buster`       |\n| [\u003cimg src=\"assets/crab/screenshot.gif\" width=\"600\"\u003e](assets/crab/README.md)             | `Viewer pbr crab`         |\n| [\u003cimg src=\"assets/dieselpunk/screenshot.png\" width=\"600\"\u003e](assets/dieselpunk/README.md) | `Viewer pbr dieselpunk`   |\n| [\u003cimg src=\"assets/drone/screenshot1.gif\" width=\"600\"\u003e](assets/drone/README.md)          | `Viewer pbr drone`        |\n| [\u003cimg src=\"assets/helmet/screenshot1.png\" width=\"600\"\u003e](assets/helmet/README.md)        | `Viewer pbr helmet`       |\n| [\u003cimg src=\"assets/horse/screenshot.gif\" width=\"600\"\u003e](assets/horse/README.md)           | `Viewer pbr horse`        |\n| [\u003cimg src=\"assets/junkrat/screenshot.gif\" width=\"600\"\u003e](assets/junkrat/README.md)       | `Viewer pbr junkrat`      |\n| [\u003cimg src=\"assets/ornitier/screenshot.png\" width=\"600\"\u003e](assets/ornitier/README.md)     | `Viewer pbr ornitier`     |\n| [\u003cimg src=\"assets/ponycar/screenshot2.png\" width=\"600\"\u003e](assets/ponycar/README.md)      | `Viewer pbr ponycar`      |\n| [\u003cimg src=\"assets/robot/screenshot.png\" width=\"600\"\u003e](assets/robot/README.md)           | `Viewer pbr robot`        |\n| [\u003cimg src=\"assets/spruit/screenshot1.png\" width=\"600\"\u003e](assets/spruit/README.md)        | `Viewer pbr sphere`       |\n| [\u003cimg src=\"assets/workshop/screenshot2.png\" width=\"600\"\u003e](assets/workshop/README.md)    | `Viewer pbr spheres`      |\n\n## References\n\n### Rendering pipeline\n\n* [Tiny Renderer](https://github.com/ssloy/tinyrenderer)\n* [OpenGL ES 2.0 Specification](https://www.khronos.org/registry/OpenGL/specs/es/2.0/es_full_spec_2.0.pdf)\n\n### Physically based rendering\n\n* [glTF 2.0 Sample Viewer](https://github.com/KhronosGroup/glTF-Sample-Viewer)\n* [SIGGRAPH 2013 Shading Course](https://blog.selfshadow.com/publications/s2013-shading-course/)\n* [Physically Based Rendering in Filament](https://google.github.io/filament/Filament.html)\n\n### File formats\n\n* [Truevision TGA](http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf)\n* [Radiance HDR](https://www.graphics.cornell.edu/~bjw/rgbe.html)\n* [Wavefront OBJ](http://www.cs.utah.edu/~boulos/cs3505/obj_spec.pdf)\n* [Khronos glTF](https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md)\n\n### Miscellaneous\n\n* [Homogeneous clipping](http://fabiensanglard.net/polygon_codec/)\n* [Barycentric coordinates](http://blackpawn.com/texts/pointinpoly/)\n* [Perspective correct interpolation](https://www.comp.nus.edu.sg/~lowkl/publications/lowk_persp_interp_techrep.pdf)\n* [Skeletal animation](https://people.rennes.inria.fr/Ludovic.Hoyet/teaching/IMO/05_IMO2016_Skinning.pdf)\n* [Tangent space normal mapping](http://www.terathon.com/code/tangent.html)\n* [Ambient occlusion](http://mentalraytips.blogspot.com/2008/11/joy-of-little-ambience.html)\n* [ACES tone mapping](https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/)\n* [Orbital camera controls](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/OrbitControls.js)\n* [Xlib programming guide](https://web.archive.org/web/20071018025425/http://users.actcom.co.il/~choo/lupg/tutorials/xlib-programming/xlib-programming.html)\n* [Type-safe dynamic array](https://github.com/nothings/stb/blob/master/stretchy_buffer.h)\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzauonlok%2Frenderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzauonlok%2Frenderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzauonlok%2Frenderer/lists"}