{"id":20636815,"url":"https://github.com/mattiamtzlr/ray-tracing","last_synced_at":"2026-05-26T13:37:39.176Z","repository":{"id":158840188,"uuid":"628589778","full_name":"mattiamtzlr/Ray-Tracing","owner":"mattiamtzlr","description":"Simple ray tracer (pathtracer) in Java, following Peter Shirley's \"Ray-Tracing in One Weekend\" series.","archived":false,"fork":false,"pushed_at":"2024-05-01T21:53:05.000Z","size":64097,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-17T08:12:18.536Z","etag":null,"topics":["image-generation","java","project","raytracing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattiamtzlr.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":"2023-04-16T12:34:16.000Z","updated_at":"2024-05-01T21:53:09.000Z","dependencies_parsed_at":"2023-05-02T13:40:25.930Z","dependency_job_id":"3b1f7c55-f582-46e9-8dbf-6b9eefae3d8a","html_url":"https://github.com/mattiamtzlr/Ray-Tracing","commit_stats":null,"previous_names":["mattiamtzlr/ray-tracing"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattiamtzlr%2FRay-Tracing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattiamtzlr%2FRay-Tracing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattiamtzlr%2FRay-Tracing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattiamtzlr%2FRay-Tracing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattiamtzlr","download_url":"https://codeload.github.com/mattiamtzlr/Ray-Tracing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242656036,"owners_count":20164431,"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":["image-generation","java","project","raytracing"],"created_at":"2024-11-16T15:12:13.733Z","updated_at":"2026-05-26T13:37:39.111Z","avatar_url":"https://github.com/mattiamtzlr.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ray Tracing in Java\n\nSimple ray tracer (pathtracer) coded in Java following [Peter Shirley's \"Ray Tracing in One Weekend\" Series](https://raytracing.github.io/).  \nShirley originally coded his version in C++ which I don't know at all, so I used Java for my version. I did most of the transpiling on my own but also used _ChatGPT_ by _OpenAI_ to help sometimes.\n\n_I originally coded everything in Python, but that was too slow, which is why I ported everything to Java after chapter 8.4.  \nThe python script requires `tqdm` to be installed. Install it using `pip install tqdm`._\n\nI saved some images of the progress of the ray tracer in the `/images` directory. The name of the image corresponds to the chapter, after which I generated that image.  \n\nAt the time of writing this (18.05.2023), I have finished the first book in the series (see `/images/chapter_1_13.png` for the result) and will be continuing with at least the second book and maybe even with the third one.  \nSadly the ray tracer is again really slow when rendering with high-quality settings. In low-quality and with a small image size it runs quite fast, though.  \n\n__Update:__ As of today (15.07.2023), I have finished the second book in the series (see `/images/chapter_2_10.png` for the result). I will probably not continue with the third book as it involves a lot of high-level math, that I don't understand.\nHowever I will try to implement more features, first of all the ability to render triangles, which will enable me to render any mesh I want.\n\n## Notes / Remarks\nSome notes and remarks to different chapters, changes or concepts.\n\n### Coordinate System\nAs the position of the viewpoint and everything that needs to be rendered has to be hardocoded, it is important to understand how the coordinate system used works.\nTo help understand see the image below:  \n\n![coordinate system](./coord_system.png)\n\nThe example on the right shows a sphere (red) at the coordinates (2, 1, 1).  \nTo capture this sphere from, the front the viewpoint needs to be \"in front\" of the sphere, meaning its z-coordinate needs to be bigger. Thus, its coordinates are (2, 1, 5).  \nThe point that the camera looks at from the viewpoint is \"behind\" the sphere at (2, 1, 0) (on the x/y-plane).\n\n### Image for Chapter 2.3\nIt appears as if nothing much has changed between this image and the ones for the to previous chapters, however thanks to the implementation of Bounding Volume Hierarchies the rendering was done about 4 times faster, even with more spheres than before.\n\n### High Resolution images\nSome high resolution pictures can be found in the `/images/HighRes` directory. These were generated in 4K resolution (3840 x 2160 pixels) with around 500 samples per pixel. These take pretty long to render on my machine, but they hardly have any noise at all which does make it quite worth the wait.  \nFeel free to use these pictures as wallpapers etc.  \n#### Properties and render times\nImage 1: 500 samples per pixel / about 40 minutes  \nImage 2: 350 samples per pixel / about 40 minutes  \nImage 3: 250 samples per pixel / about 1 hour  \nImage 4: 300 samples per pixel / about 5 hours (!)  \nImage 5: 400 samples per pixel / about 2 hours (not the best result)\n\n### Instance Rotations in `Hittable.java`\nIn the original book, Shirley only programs the instance rotation around the y-axis. I wanted to add rotation around the other axes as well, which is why I added the `RotateX` and `RotateZ` classes as well.  \nAn example of all these rotations can be found at `/images/chapter_2_08.2_2.png`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattiamtzlr%2Fray-tracing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattiamtzlr%2Fray-tracing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattiamtzlr%2Fray-tracing/lists"}