{"id":18928903,"url":"https://github.com/smercer10/raydiance","last_synced_at":"2026-05-18T04:37:23.628Z","repository":{"id":224058997,"uuid":"761916423","full_name":"smercer10/raydiance","owner":"smercer10","description":"Path tracer that renders a JSON scene description.","archived":false,"fork":false,"pushed_at":"2024-07-27T12:40:58.000Z","size":114,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-28T13:02:24.937Z","etag":null,"topics":["cpp","json","ray-tracing"],"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/smercer10.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}},"created_at":"2024-02-22T18:19:03.000Z","updated_at":"2024-07-27T12:41:01.000Z","dependencies_parsed_at":"2024-02-27T21:29:34.826Z","dependency_job_id":"c341682d-9d31-4b24-808b-85c73a1b51bd","html_url":"https://github.com/smercer10/raydiance","commit_stats":null,"previous_names":["smercer10/raydiance"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smercer10%2Fraydiance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smercer10%2Fraydiance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smercer10%2Fraydiance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smercer10%2Fraydiance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smercer10","download_url":"https://codeload.github.com/smercer10/raydiance/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223676743,"owners_count":17184317,"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":["cpp","json","ray-tracing"],"created_at":"2024-11-08T11:28:39.823Z","updated_at":"2025-09-20T08:06:16.175Z","avatar_url":"https://github.com/smercer10.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# raydiance\n\nraydiance generates a path-traced PPM render from a JSON scene description.\n\n[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/smercer10/raydiance/blob/main/LICENSE)\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/smercer10/raydiance/ci.yml?label=CI)](https://github.com/smercer10/raydiance/actions/workflows/ci.yml)\n\n## Current Features\n\n- Configurable camera\n- Fixed lighting\n- Spherical objects\n- Lambertian, metal and dielectric materials\n- Anti-aliasing\n- Depth of field\n\n## Usage\n\n```bash\nraydiance -s \u003cpath to scene config file\u003e [-o \u003coutput image name\u003e]\n```\n\nA path to a scene configuration file is required, but the output image name is optional and defaults to `img`.\nNotably, the image name does not require a file extension, as the `ppm` extension is automatically appended during\nruntime.\n\n## Example\n\n### PPM Render (Converted to JPEG)\n\n![img-28-02-2024-21-54-04.jpeg](example%2Fimg-28-02-2024-21-54-04.jpeg)\n\n### JSON Scene Description\n\n```json\n{\n  \"lookFrom\": {\n    \"x\": -5.5,\n    \"y\": 2.5,\n    \"z\": 9.5\n  },\n  \"lookAt\": {\n    \"x\": -4.0,\n    \"y\": 1.0,\n    \"z\": 0.0\n  },\n  \"samplesPerPixel\": 500,\n  \"maxDepth\": 50,\n  \"imgWidth\": 1200,\n  \"defocusAngle\": 1.2,\n  \"focusDistance\": 8.0,\n  \"fieldOfView\": 60.0,\n  \"spheres\": [\n    {\n      \"centre\": {\n        \"x\": 0.0,\n        \"y\": -1000.0,\n        \"z\": -1.0\n      },\n      \"radius\": 1000.0,\n      \"material\": {\n        \"type\": \"lambertian\",\n        \"colour\": {\n          \"r\": 0.2,\n          \"g\": 0.5,\n          \"b\": 0.0\n        }\n      }\n    },\n    {\n      \"centre\": {\n        \"x\": -4,\n        \"y\": 2.0,\n        \"z\": -0.5\n      },\n      \"radius\": 2.0,\n      \"material\": {\n        \"type\": \"lambertian\",\n        \"colour\": {\n          \"r\": 0.2,\n          \"g\": 0.2,\n          \"b\": 0.8\n        }\n      }\n    },\n    {\n      \"centre\": {\n        \"x\": -8.0,\n        \"y\": 1.5,\n        \"z\": 0.0\n      },\n      \"radius\": 1.5,\n      \"material\": {\n        \"type\": \"dielectric\",\n        \"refIdx\": 1.5\n      }\n    },\n    {\n      \"centre\": {\n        \"x\": -8.0,\n        \"y\": 1.5,\n        \"z\": 0.0\n      },\n      \"radius\": -1.5,\n      \"material\": {\n        \"type\": \"dielectric\",\n        \"refIdx\": 1.5\n      }\n    },\n    {\n      \"centre\": {\n        \"x\": -3.0,\n        \"y\": 1.25,\n        \"z\": 5.0\n      },\n      \"radius\": 1.25,\n      \"material\": {\n        \"type\": \"metal\",\n        \"colour\": {\n          \"r\": 0.7,\n          \"g\": 0.1,\n          \"b\": 0.1\n        },\n        \"fuzz\": 0.2\n      }\n    },\n    {\n      \"centre\": {\n        \"x\": -6.0,\n        \"y\": 0.75,\n        \"z\": 4.0\n      },\n      \"radius\": 0.75,\n      \"material\": {\n        \"type\": \"metal\",\n        \"colour\": {\n          \"r\": 0.7,\n          \"g\": 0.6,\n          \"b\": 0.5\n        },\n        \"fuzz\": 0.0\n      }\n    }\n  ]\n}\n```\n\n## Configuration Options\n\n- `aspectRatio`: The aspect ratio of the output image. It expects a double and the default value is `16.0 / 9.0`.\n- `lookFrom`: The position of the camera.\n  It is an object with `x`, `y`, and `z` properties.\n  Each property expects a double and the default values are `x: 0.0`, `y: 0.0`, `z: 0.0`.\n- `lookAt`: The point the camera is looking at.\n  It is an object with `x`, `y`, and `z` properties.\n  Each property expects a double and the default values are `x: 0.0`, `y: 0.0`, `z: 1.0`.\n- `cameraUp`: The up vector for the camera.\n  It is an object with `x`, `y`, and `z` properties.\n  Each property expects a double and the default values are `x: 0.0`, `y: 1.0`, `z: 0.0`.\n- `samplesPerPixel`: The number of ray samples per pixel. It expects an integer and the default value is `10`.\n- `maxDepth`: The maximum number of bounces for a ray. It expects an integer and the default value is `10`.\n- `imgWidth`: The pixel width of the output image. It expects an integer and the default value is `400`.\n- `defocusAngle`: The defocus angle for the camera (higher value = greater bokeh).\n  It expects a double and the default value is `0.0`.\n- `focusDistance`: The focus distance for the camera. It expects a double and the default value is `1.0`.\n- `fieldOfView`: The field of view for the camera. It expects a double and the default value is `45.0`.\n- `spheres`: An array of sphere objects in the scene. Each sphere object has the following properties:\n    - `centre`: The centre of the sphere.\n      It is an object with `x`, `y`, and `z` properties.\n      Each property expects a double and there are no default values.\n    - `radius`: The radius of the sphere. It expects a double and there are no default values.\n    - `material`: The material of the sphere.\n      It is an object with a `type` property, which is a string that can\n      be `\"lambertian\"`, `\"metal\"`, or `\"dielectric\"`.\n      Depending on the `type`, it may also have other properties\n      like `colour` (an object with `r`, `g`, and `b` properties, each a double) and `refIdx` or `fuzz` (both doubles).\n      There are no default values for the `material` object.\n\n## Build Locally\n\n### Prerequisites\n\n- C++17 compiler (tested with GCC and Clang)\n- CMake 3.14+\n- Clang-Format (optional)\n- Clang-Tidy (optional)\n\n### Steps\n\n1. Clone the project:\n\n```bash\n  git clone https://github.com/smercer10/raydiance.git\n```\n\n2. Navigate to the project directory:\n\n```bash\n  cd raydiance\n```\n\n3. Generate the build files:\n\n```bash\n  cmake -S . -B build\n```\n\n4. Build the project:\n\n```bash\n  cmake --build build\n```\n\n## Running Tests\n\nThe project utilises the GoogleTest framework with CTest.\n\nTo execute the testcases, run the following command from the project root:\n\n```bash\n  cmake --build build --target test\n```\n\n## Contributing\n\nContributions are always welcome!\n\nSee [open issues](https://github.com/smercer10/raydiance/issues) for ways to get started.\n\n## Acknowledgements\n\nThe core ray tracing logic is based on the brilliant [Ray Tracing in One Weekend Book Series](https://raytracing.github.io).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmercer10%2Fraydiance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmercer10%2Fraydiance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmercer10%2Fraydiance/lists"}