{"id":16957875,"url":"https://github.com/ahamez/ray-tracer","last_synced_at":"2025-07-16T12:05:21.837Z","repository":{"id":45177066,"uuid":"320650101","full_name":"ahamez/ray-tracer","owner":"ahamez","description":"The Ray Tracer Challenge in Rust","archived":false,"fork":false,"pushed_at":"2022-07-18T17:11:18.000Z","size":36169,"stargazers_count":41,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T07:22:37.488Z","etag":null,"topics":["challenge","ray-tracer","rust"],"latest_commit_sha":null,"homepage":"https://pragprog.com/titles/jbtracer/the-ray-tracer-challenge","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahamez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-11T18:14:52.000Z","updated_at":"2024-12-24T15:41:49.000Z","dependencies_parsed_at":"2022-08-02T23:01:13.324Z","dependency_job_id":null,"html_url":"https://github.com/ahamez/ray-tracer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ahamez/ray-tracer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahamez%2Fray-tracer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahamez%2Fray-tracer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahamez%2Fray-tracer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahamez%2Fray-tracer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahamez","download_url":"https://codeload.github.com/ahamez/ray-tracer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahamez%2Fray-tracer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265508077,"owners_count":23779068,"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":["challenge","ray-tracer","rust"],"created_at":"2024-10-13T22:20:15.841Z","updated_at":"2025-07-16T12:05:21.794Z","avatar_url":"https://github.com/ahamez.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ray Tracer Challenge\n\nThis is an implementation in Rust of the book [The Ray Tracer Challenge](http://www.raytracerchallenge.com) . Go get it, it's one of the best book I read!\n\nMy main objective is to be fluent in Rust 🗣🦀. So, if some seasoned rustacean comes across this, don't hesitate to pinpoint the problems 😉!\n\n## Differences from the book and other points of interest\n* Parallelization with [rayon](https://github.com/rayon-rs/rayon) (I can't believe how easy it was!)\n* Matrices inversion are cached (which provides a significant speedup!)\n* Don't explicitly store the w component for tuples. Instead, it's up to the implementation of the Tuple trait to return the correct value (1.0 or 0.0)\n* Avoid creating a new vec for each call to a shape intersects() method using a kind of closure (it provides an interesting speedup as it prevents the dynamic allocation of many temporaries)\n* Use f64 everywhere\n* Naive anti-aliasing\n* Use enums rather than traits to describe polymorphic behaviors (shapes, lights, etc.)\n\n## Some samples\n\n![Cover](/samples/render/cover.png?raw=true \"Cover\")\n\n![Shadow Glamour Shot](/samples/render/shadow-glamour-shot.png?raw=true \"Shadow Glamour Shot\")\n\n![Github Skyline](/samples/render/ahamez-2020.png?raw=true \"Github Skyline\")\n\n![Plane](/samples/render/ch09_plane.png?raw=true \"Plane\")\n\n![Pattern](/samples/render/ch10_pattern.png?raw=true \"Pattern\")\n\n![Reflection](/samples/render/ch11_reflection.png?raw=true \"Reflection\")\n\n![Refraction](/samples/render/ch11_refraction.png?raw=true \"Refraction\")\n\n![Fresnel](/samples/render/ch11_fresnel.png?raw=true \"Fresnel\")\n\n![Reflect-Refract](/samples/render/ch11_reflect-refract.png?raw=true \"Reflect Refract\")\n\n![Cube](/samples/render/ch12_cube.png?raw=true \"Cube\")\n\n![Cylinder](/samples/render/ch13_cylinder.png?raw=true \"Cylinder\")\n\n![Cone](/samples/render/ch13_cone.png?raw=true \"Cone\")\n\n![Hexagon](/samples/render/ch14_hexagon.png?raw=true \"Hexagon\")\n\n![Triangle](/samples/render/ch15_triangle.png?raw=true \"Triangle\")\n\n![Lunar lander](/samples/render/lunar_lander.png?raw=true \"Lunar Lander\")\n\n![Armadillo](/samples/render/armadillo_small.png?raw=true \"Armadillo\")\n\n![Astronaut](/samples/render/astronaut.png?raw=true \"Astronaut\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahamez%2Fray-tracer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahamez%2Fray-tracer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahamez%2Fray-tracer/lists"}