{"id":29091259,"url":"https://github.com/michalciechan/virtualcamera","last_synced_at":"2025-06-28T06:06:30.432Z","repository":{"id":301052431,"uuid":"966750985","full_name":"michalciechan/VirtualCamera","owner":"michalciechan","description":"A simple 3D software renderer written in C++","archived":false,"fork":false,"pushed_at":"2025-06-24T22:35:24.000Z","size":258,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T23:30:42.714Z","etag":null,"topics":["cpp20","graphics","software-renderer"],"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/michalciechan.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,"zenodo":null}},"created_at":"2025-04-15T11:59:06.000Z","updated_at":"2025-06-24T23:09:22.000Z","dependencies_parsed_at":"2025-06-24T23:41:02.906Z","dependency_job_id":null,"html_url":"https://github.com/michalciechan/VirtualCamera","commit_stats":null,"previous_names":["michalciechan/virtualcamera"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michalciechan/VirtualCamera","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalciechan%2FVirtualCamera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalciechan%2FVirtualCamera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalciechan%2FVirtualCamera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalciechan%2FVirtualCamera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michalciechan","download_url":"https://codeload.github.com/michalciechan/VirtualCamera/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michalciechan%2FVirtualCamera/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262382742,"owners_count":23302297,"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":["cpp20","graphics","software-renderer"],"created_at":"2025-06-28T06:06:29.484Z","updated_at":"2025-06-28T06:06:30.418Z","avatar_url":"https://github.com/michalciechan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Virtual Camera\n\nA simple 3D software renderer written in C++.\n\n![Animation of camera rotating around gold and plastic spheres](docs/two_spheres_animation.avifs)\n\n## Key Features\n\n- Software rasterization pipeline written in C++ 20.\n- Camera control with full 3D translation, rotation, and zoom.\n- Scene defined using triangle-based B-rep models.\n- Reverse z-buffer and back-face culling for visibility determination.\n- Phong reflection model with material support.\n\n## Description\n\nVirtual Camera is a software rasterizer I developed during my Computer Graphics\ncourse in Warsaw University of Technology. It is my attempt to implement a modern\ncomputer graphics pipeline without the use of external 3D graphics APIs such as\nOpenGL, Vulkan, DirectX, or Metal.\n\nIt features a camera which can be manipulated within a predefined scene.\nThe scene consists of two spheres (approximated by subdividing icosahedrons)\nassigned gold and red plastic materials, although any B-rep models defined\nby triangular faces could be rendered. Earlier versions included\npyramids and cubes.\n\nThe renderer transforms the 3D geometry into 2D screen space using homogeneous\ncoordinates and matrix-based transformations, including translation, rotation,\nperspective projection.\n\nFor visibility determination, it uses a reverse z-buffer to resolve depth and\ncorrectly handle occlusion between objects. Back-face culling is also implemented\nto skip rendering faces not visible to the camera, improving performance.\n\n![Two spheres occluding each other](docs/occlusion_culling.png)\n*Spheres occluding each other*\n\nLocal illumination is computed using the Phong reflection model. Each object in the\nscene has an associated material that defines how it reflects light, resulting\nin visually distinct shading based on material properties.\n\n![Two spheres with different local lighting depending on material](docs/phong_lighting.png)\n*Spheres with different local lighting depending on material*\n\n## Getting Started\n\n### Prerequisites\n\n- C++ 20 compiler\n- CMake 3.27 or newer\n- Git\n- Ninja\n\n### Installation\n\nThis repository stores third-party libraries in Git submodules, which means\ncloning it requires some special care.\n\nPerform recursive cloning using\n\n```sh\ngit clone --recurse-submodules https://github.com/michalciechan/VirtualCamera\n```\n\n### Building\n\nFirst generate build configuration using CMake, assuming your current directory\nis inside the project's root.\n\n```sh\ncmake -S . -B build --preset default\n```\n\nBuilding the project is done with the following command.\n\n```sh\ncmake --build build --target VirtualCamera --preset debug\n```\n\nOr, for an optimized executable.\n\n```sh\ncmake --build build --target VirtualCamera --preset release\n```\n\n### Usage\n\nThe compiled executable can be run as is.\n\n```sh\n./VirtualCamera.exe\n```\n\nOnce running, you can interact with the camera and light using the following\nkeys:\n\n- `W`, `A`, `S`, `D`, Ctrl, Space - move the camera.\n- Arrow keys, `Q`, `E` - rotate the camera.\n- `+`, `-` - zoom in and out.\n- Numpad `4`, `6` - move the light.\n\n## Known issues and limitations\n\n- No dynamic model loading – the scene is hardcoded in the source; models\ncannot currently be imported from external files.\n- No global illumination – only local lighting is supported via the Phong model.\nObjects do not cast shadows on each other, and effects like indirect lighting\nor ambient occlusion are not present.\n- No texture mapping – surfaces are shaded purely based on material properties,\nwithout support for image-based textures.\n\n## License\n\nThis project is distributed under the MIT license. See `LICENSE` for more information.\n\n## Authors\n\nMichał Ciechan - [https://github.com/michalciechan](https://github.com/michalciechan)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichalciechan%2Fvirtualcamera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichalciechan%2Fvirtualcamera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichalciechan%2Fvirtualcamera/lists"}