{"id":28570993,"url":"https://github.com/brooklyn-dev/ray-tracing","last_synced_at":"2026-05-19T07:32:30.217Z","repository":{"id":296729994,"uuid":"994185807","full_name":"Brooklyn-Dev/ray-tracing","owner":"Brooklyn-Dev","description":"A GPU-accelerated, physically-based path tracer built with C++ and OpenGL - from scratch.","archived":false,"fork":false,"pushed_at":"2025-06-30T17:26:14.000Z","size":8471,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-30T18:31:19.069Z","etag":null,"topics":["cpp","cpp17","glad","glfw3","glm","glsl","graphics","opengl","path-tracing","pbr","ray-tracing","raytracer","raytracing","real-time-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/Brooklyn-Dev.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-06-01T12:04:46.000Z","updated_at":"2025-06-30T17:24:18.000Z","dependencies_parsed_at":"2025-06-17T22:27:28.007Z","dependency_job_id":"eb17ad34-be75-4233-b383-d6c97f825745","html_url":"https://github.com/Brooklyn-Dev/ray-tracing","commit_stats":null,"previous_names":["brooklyn-dev/ray-tracing"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Brooklyn-Dev/ray-tracing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brooklyn-Dev%2Fray-tracing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brooklyn-Dev%2Fray-tracing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brooklyn-Dev%2Fray-tracing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brooklyn-Dev%2Fray-tracing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Brooklyn-Dev","download_url":"https://codeload.github.com/Brooklyn-Dev/ray-tracing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Brooklyn-Dev%2Fray-tracing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278909716,"owners_count":26066887,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cpp","cpp17","glad","glfw3","glm","glsl","graphics","opengl","path-tracing","pbr","ray-tracing","raytracer","raytracing","real-time-rendering"],"created_at":"2025-06-10T18:14:53.776Z","updated_at":"2025-10-08T07:40:10.471Z","avatar_url":"https://github.com/Brooklyn-Dev.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# GPU Path Tracer in C++ and OpenGL\n\n![License](https://img.shields.io/badge/license-MIT-green)\n![GitHub release](https://img.shields.io/github/v/release/Brooklyn-Dev/ray-tracing)\n![GitHub issues](https://img.shields.io/github/issues/Brooklyn-Dev/ray-tracing)\n![C++](https://img.shields.io/badge/C%2B%2B-17%2B-blue?style=flat\u0026logo=c%2B%2B\u0026logoColor=white)\n![OpenGL](https://img.shields.io/badge/OpenGL-4.4%2B-5777A6?style=flat\u0026logo=opengl\u0026logoColor=white)\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd style=\"vertical-align: top; max-width: 550px;\"\u003e\nA GPU-accelerated, physically-based path tracer built with C++ and OpenGL — from scratch.\n\u003cbr\u003e\u003cbr\u003e\nThis was a project I made over two weeks. I've always thought ray tracers look cool and wanted to try creating one from scratch.\n\u003c/td\u003e\n\u003ctd\u003e\n    \u003ca href=\"https://shipwrecked.hackclub.com/?t=ghrm\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://hc-cdn.hel1.your-objectstorage.com/s/v3/739361f1d440b17fc9e2f74e49fc185d86cbec14_badge.png\" alt=\"Shipwrecked badge\" style=\"max-width: 250px;\"\u003e\n    \u003c/a\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cimg src=\"docs/image.png\" width=\"800\" alt=\"Full view of program, showcasing UI\"/\u003e\n\n## Features\n\n-   Physically Based Rendering - Realistic lighting and reflections with energy-conserving materials\n-   Progressive Rendering - Image quality improves over time with live, frame-by-frame refinement\n-   Anti-Aliasing - Smooth edges using subpixel jitter and sample accumulation\n-   HDR Environment Maps - Skybox lighting with exposure (EV) control\n-   Procedural Sun - Adjustable directional light simulating sunlight\n-   Scene Management - Load and edit scenes via JSON files\n-   Interactive UI - Responsive ImGui interface with dockable panels and image export\n\n## Technical Features\n\n-   GPU Path Tracing - Using OpenGL and GLSL\n-   Material System - Diffuse, specular (glossy/mirror), emissive, smoothness and procedural checker flag\n-   Cosine-Weighted Hemisphere Sampling - Physically accurate diffuse light distribution\n-   Russian Roulette Termination - Unbiased path termination for efficient global illumination\n-   sRGB Gamma Correction - Converts linear output to perceptual colour space\n-   Geometry Primitives - Spheres, infinite planes, and quads\n\n## Gallery\n\n\u003cimg src=\"docs/gallery0.png\" width=\"800\" alt=\"'Infinite' reflections of a rough dielectric sphere inside a Cornell Box with all walls as mirrors\"/\u003e\n\u003cimg src=\"docs/gallery1.png\" width=\"800\" alt=\"Cornell Box with 3 shiny 'metallic' spheres\"/\u003e\n\u003cimg src=\"docs/gallery2.png\" width=\"800\" alt=\"Cornell Box with 2 perfect mirror spheres, showing infinite reflections\"/\u003e\n\u003cimg src=\"docs/gallery3.png\" width=\"800\" alt=\"5 Spheres with increasing smoothness, outdoor environment map\"/\u003e\n\u003cimg src=\"docs/gallery4.png\" width=\"800\" alt=\"5 Spheres with decreasing specular probability, outdoor environment map\"/\u003e\n\n## Installation\n\n### Building from Source\n\nTo build this project from source, you will need the following prerequisites:\n\n-   C++ 17+ Compiler (e.g., GCC, Clang, MSVC)\n-   CMake 3.16+\n-   OpenGL 4.4+ drivers and development libraries (usually part of your graphics card driver installation)\n\n#### Dependencies:\n\n-   You do **not** need to install any dependencies in order to build the project :D\n-   GLAD and single header files (nlohmann/json, stb) are included in `external/` folder\n-   Other dependencies are managed as git submodules:\n    -   GLFW\n    -   GLM\n    -   ImGui\n    -   ImGuiFileDialog\n\n### Build Process\n\nTested on Windows 11 with MSVC. Untested, but should also build on Linux with GCC or Clang.\n\n```bash\ngit clone https://github.com/Brooklyn-Dev/ray-tracing.git\ncd ray-tracing\n\n# Initialise and update all git submodules recursively\ngit submodule update --init --recursive\n\n# Create build directory and run CMake\nmkdir build \u0026\u0026 cd build\ncmake -DCMAKE_BUILD_TYPE=Release ..\n\n# Build the project\ncmake --build . --config Release\n\n# Run the executable\ncd bin/Release\nray-tracing.exe\n```\n\n### Installing Pre-built Releases\n\n1. Download the latest release from the [Releases](https://github.com/Brooklyn-Dev/ray-tracing/releases) page\n2. Extract the archive to your desired location\n3. Run the executable\n\n## Usage\n\n-   File Menu - Load scenes and export renders\n-   Camera\n    -   Movement (relative) - Arrow keys\n    -   Up/Down - Space / LCtrl\n    -   Rotate - LMB + Drag\n-   ImGui Windows\n    -   Viewport - Displays the render output\n    -   Settings - Adjust gamma, bounces, samples, skybox, sun, camera, etc.\n\n## Potential Future Improvements\n\n-   Bounding Volume Hierarchy (BVH)\n-   Refraction and transmission materials\n-   Real-time scene editor\n-   Mesh loading (OBJ, glTF)\n-   Image-based textures\n-   Depth of field\n-   Support for more geometry types (cubes, torus, etc.)\n-   Basic video render with animated camera path\n\n## Credits\n\n-   Environment maps by [Poly Haven](https://polyhaven.com/hdris) (CC0)\n-   Inspired by Sebastian Lague's [ray tracing devlog](https://www.youtube.com/watch?v=Qz0KTGYJtUk)\n-   Inspired by NamePointer's [ray tracing devlog](https://www.youtube.com/watch?v=A61S_2swwAc)\n-   [Ray Tracing in One Weekend](https://raytracing.github.io/)\n-   The Cherno's [Ray Tracing series](https://www.youtube.com/playlist?list=PLlrATfBNZ98edc5GshdBtREv5asFW3yXl)\n\n## Like this project?\n\nIf you find this project interesting or useful, consider giving it a star ⭐️!\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrooklyn-dev%2Fray-tracing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrooklyn-dev%2Fray-tracing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrooklyn-dev%2Fray-tracing/lists"}