{"id":15690117,"url":"https://github.com/tentone/gotracer","last_synced_at":"2025-05-07T23:22:57.658Z","repository":{"id":97242573,"uuid":"162848865","full_name":"tentone/gotracer","owner":"tentone","description":"Multi-threaded software raytracer written in golang.","archived":false,"fork":false,"pushed_at":"2025-03-12T09:40:01.000Z","size":1469,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T15:11:32.093Z","etag":null,"topics":["golang","pixelgl","raytracing"],"latest_commit_sha":null,"homepage":"","language":"Go","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/tentone.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":"2018-12-22T23:19:20.000Z","updated_at":"2025-03-12T09:40:05.000Z","dependencies_parsed_at":"2024-06-21T14:24:55.255Z","dependency_job_id":"008278e8-e576-44a8-9bf3-3de0d80aba94","html_url":"https://github.com/tentone/gotracer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tentone%2Fgotracer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tentone%2Fgotracer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tentone%2Fgotracer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tentone%2Fgotracer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tentone","download_url":"https://codeload.github.com/tentone/gotracer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252969055,"owners_count":21833403,"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":["golang","pixelgl","raytracing"],"created_at":"2024-10-03T18:07:35.991Z","updated_at":"2025-05-07T23:22:57.638Z","avatar_url":"https://github.com/tentone.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoTracer\n - Software Raytracer written in golang.\n - Images can be previewed directly on the window as they are rendered.\n - Interaction can be done using keys from the keyboard, to control the camera.\n\n\n\n## Screenshots\n![alt tag](https://raw.githubusercontent.com/tentone/gotracer/master/readme/a.png)![alt tag](https://raw.githubusercontent.com/tentone/gotracer/master/readme/b.png)![alt tag](https://raw.githubusercontent.com/tentone/gotracer/master/readme/c.png)![alt tag](https://raw.githubusercontent.com/tentone/gotracer/master/readme/d.png)\n\n\n\n## Performance\n\n - To improve performance multi-threading was added to the renderer.\n - Data had to be reordered for go to actually scale properly with multiple threads.\n - Calling multiple goroutines that use that same data cause them to lock on each other to access data and the performance gains are minimal.\n - Tests were performed with 154 objects in the render scene.\n - Tests performed on a Core i5 6500 (4 Core) with DDR3 memory w/ 4 threads.\n - Tested base performance number for a single thread.\n - Tested splitting the work by multiple goroutines each routine processes one portion of the output.\n - Tested explicit object copies for each thread was able to reduce time further by skipping the synchronization points added by the go race condition detector.\n\n| Mode               | Resolution | Time p/ frame | Speedup |\n| ------------------ | ---------- | ------------- | ------- |\n| Single-thread      | 320x240    | ~430ms        | 1x      |\n| Single-thread      | 640x480    | ~1750ms       | 1x      |\n| GoRoutine          | 320x240    | ~220ms        | 1.95x   |\n| GoRoutine          | 640x480    | ~650ms        | 2.69x   |\n| Explicit Data Copy | 320x240    | ~120ms        | 3.58x   |\n| Explicit Data Copy | 640x480    | ~620ms        | 3.64x   |\n| go:norace          | 320x240    | ~160ms        | 2.54x   |\n| go:norace          | 640x480    | ~650ms        | 2.69x   |\n\n - Performed new tests on new Go 1.12.8, also tested the go:norace flag, will have to repeat on a CPU with more cores.\n - Using the //go:norace code annotation to skip the data race condition analysis.\n - Test platform was a Core i7 3537u (2 Core HT) running Go 1.12.8 w/ 4 threads, in the CPU it was easy to double the performance without the implicit sync points being a problem.\n\n| Mode               | Resolution | Time p/ frame |\n| ------------------ | ---------- | ------------- |\n| Single-thread      | 320x240    | ~590ms        |\n| Single-thread      | 640x480    | ~2250ms       |\n| GoRoutine          | 320x240    | ~295ms        |\n| GoRoutine          | 640x480    | ~1100ms       |\n| Explicit Data Copy | 320x240    | ~280ms        |\n| Explicit Data Copy | 640x480    | ~1200ms       |\n| go:norace          | 320x240    | ~285ms        |\n| go:norace          | 640x480    | ~1090ms       |\n\n\n\n## Features\n - Geometries (Sphere, Box, Triangles).\n - Materials (Dieletrics, Lambert, Metal, Normal).\n - Camera defocus.\n - Filtering\n    - Antialiased image from ray jittering.\n    - Temporal accomulation from single ray raytraced images.\n - File loaders (.obj)\n\n\n\n## Build\n - Install golang development tools\n - If youre running on Windows install the GCC compiler\n    - http://win-builds.org/doku.php.\n    - Add the winbuils/bin folder to the path.\n    - Alternatively you can use MSYS2\n       - https://github.com/gopxl/pixel/wiki/Building-Pixel-on-Windows\n - Run go get and go build.\n - Run the executable\n\n\n\n\n## Libraries\n - PixelGL\n    - Used to create windows, output image and get key inputs\n    - https://godoc.org/github.com/gopxl/pixel/pixelgl\n    - https://github.com/gopxl/pixel/wiki/Creating-a-Window\n    - https://godoc.org/github.com/gopxl/pixel/#PictureData\n\n\n\n\n## References\n - Raytracer in a Weekend (Peter Shirley)\n - An efficient and robust ray-box intersection algorithm (2003) (Amy Williams , Steve Barrus , R. Keith , Morley Peter Shirley)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftentone%2Fgotracer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftentone%2Fgotracer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftentone%2Fgotracer/lists"}