{"id":21452942,"url":"https://github.com/arindas/quartz","last_synced_at":"2025-07-27T12:34:07.806Z","repository":{"id":122070240,"uuid":"355193359","full_name":"arindas/quartz","owner":"arindas","description":"A minimal ray tracing engine.","archived":false,"fork":false,"pushed_at":"2022-02-26T18:23:46.000Z","size":28142,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-23T12:32:31.906Z","etag":null,"topics":["non-recursive","parallel","ray-tracing-engine","shared-memory-parallel"],"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/arindas.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":"2021-04-06T13:11:46.000Z","updated_at":"2022-06-15T06:44:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"1bedc8d7-6896-4d76-8d7a-1b642d91cf9b","html_url":"https://github.com/arindas/quartz","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arindas%2Fquartz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arindas%2Fquartz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arindas%2Fquartz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arindas%2Fquartz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arindas","download_url":"https://codeload.github.com/arindas/quartz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243965356,"owners_count":20375912,"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":["non-recursive","parallel","ray-tracing-engine","shared-memory-parallel"],"created_at":"2024-11-23T04:33:16.924Z","updated_at":"2025-03-17T02:45:50.043Z","avatar_url":"https://github.com/arindas.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quartz\n\nA shared memory parallelism based ray tracing engine.\n\n![antialiased sphere 1080p](./assets/metal_and_lambertian_materials_non_recursive_1080p.png)\n\n## Building:\n\n```\ngit clone git@github.com:arindas/quartz.git\ncd quartz/\nmkdir build \u0026\u0026 cd build\ncmake .. \u0026\u0026 make\n```\n\nThis produces a binary `quartz` at `quartz/build/quartz`.\n\n## Usage:\n\nRight now, quartz writes `.ppm` images to the standard output. Hence, users\nare requested to redirect it's output to a file:\n\n```\n./quartz \u003e output_image.ppm\n```\n\nMost image viewers can view `.ppm` files natively. However, for conveniently\nsharing the images, ppm images can be converted to other formats using\nImageMagick's convert tool on Linux. For instance, to convert to png:\n\n```\nconvert output_image.ppm output_image.png\n```\n\nLater, `quartz` will have native support for multiple formats.\n\n## Configuration:\n\n`quartz` at it's core is a header only library. All scene configuration is specified\nin `quartz/main.cc`, it being the only c++ source file in this repository.\n\nImage size is configured as:\n```cpp\n...\nquartz::image_size size = quartz::get_image_size(16.0 / 9.0, // aspect ratio\n                                                 225);       // image height\n...\n```\n\nObjects can be added to the scene as follows:\n```cpp\n...\nquartz::scene world;\nworld.add(std::make_shared\u003cquartz::sphere\u003e(\n    quartz::point3(0, 0, -1), 0.5));\nworld.add(std::make_shared\u003cquartz::sphere\u003e(\n    quartz::point3(0, -100.5, -1), 100));\n...\n```\nRight now, only spheres are supported. Support for multiple 3D objects will be added later.\n\n`quartz` supports antialiasing. The number of samples per pixel is specified at the time\nof invoking `quartz::renderer::render()`:\n\n```cpp\n...\nquartz::renderer renderer_(size, world);\n\nint samples_per_pixel = 100;\nrenderer_.render(tracer, cam, samples_per_pixel);\n...\n```\n\nCamera properties are configured as follows:\n```\n...\nquartz::point3 lookfrom(3, 3, 2);\nquartz::point3 lookat(0, 0, -1);\nquartz::vec3\u003cdouble\u003e vup(0, 1, 0);\nauto dist_to_focus = (lookfrom - lookat).length();\nauto aperture = 2.0;\n\nquartz::camera cam(lookfrom, lookat, vup, 20, aspect_ratio, aperture, dist_to_focus);\n...\n```\n\n`quartz` renders images to an in-memory buffer (`quartz::image_sink`) first. The contents\nof this buffer are later serialized by different implementations of `quartz::image_writer`.\nThe only `quartz::image_writer` implementation right now is `quartz::ppm_image_writer`.\n\n## TODO\n\n- [x] Add support for different materials\n- [x] Parallelize the render loop\n- [x] Add support for camera\n- [ ] Add support for different image formats.\n- [ ] Add support for multiple 3D hittables.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farindas%2Fquartz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farindas%2Fquartz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farindas%2Fquartz/lists"}