{"id":15722323,"url":"https://github.com/stackotter/relativistic-renderer","last_synced_at":"2025-05-12T20:52:24.517Z","repository":{"id":224537963,"uuid":"762014306","full_name":"stackotter/relativistic-renderer","owner":"stackotter","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-26T13:16:23.000Z","size":7089,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T03:28:13.003Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"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/stackotter.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-22T23:06:26.000Z","updated_at":"2025-03-30T00:37:07.000Z","dependencies_parsed_at":"2024-02-26T14:42:33.114Z","dependency_job_id":null,"html_url":"https://github.com/stackotter/relativistic-renderer","commit_stats":null,"previous_names":["stackotter/relativistic-renderer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackotter%2Frelativistic-renderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackotter%2Frelativistic-renderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackotter%2Frelativistic-renderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackotter%2Frelativistic-renderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackotter","download_url":"https://codeload.github.com/stackotter/relativistic-renderer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253821609,"owners_count":21969738,"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":[],"created_at":"2024-10-03T22:06:42.406Z","updated_at":"2025-05-12T20:52:24.458Z","avatar_url":"https://github.com/stackotter.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Blackhole Playground\n\nFor the 2024 Swift Student Challenge I created a raytracer which incorporates general relativity\nto be able to render blackholes (in realtime). The playground also includes a 2d version of the\nraytracer which produces in interactive diagram showing the paths of light rays emitted from a\nlight source in the presence of a black hole.\n\nThe aim is to help students who are learning about General Relativity to visualize problems and\ngain an intuition for what's going on behind the maths. It also just looks pretty cool.\n\nThe raytracing is done by numerically integrating a second order differential equation derived\nfrom Schwarzschild's solution to the Einstein Field Equations for the specific case of a single\nnon-rotating spherical mass in an otherwise empty universe. In reality blackholes almost always\nhave significant angular momentum, and I'd be interested in investigating how much a blackhole's\nrotation affects how it looks.\n\nThe playground features an onboarding flow that runs everytime the you reopen the app, since it\nis a playground. But if turned into an actual app I'd of course clean up the onboarding flow and\nmake it only run once.\n\nPlease note that much of the app was crammed pretty close to the deadline so there's definitely\nmore that I could clean up.\n\n![A screenshot of the blackhole renderer's 3d view](screenshot.png)\n\n## Notable inaccuracies\n\n- Doesn't consider the velocity of the observer (which may or may not affect the produced images,\n  I'd need to investigate how significant the difference would be)\n- Doesn't simulate phenoma that affect the frequency of light, such as the relativistic doppler shift\n  effect.\n- The accretion disk is only vaguely physically based (the gradient colouring is based on \n  blackbody radiation). To make it more realistic without introducing a janky looking static\n  texture, a fluid simulation of some sort would likely be required (which I may try my hand\n  at some day...)\n- And probably more!\n\n## Starmap credits\n\n\u003e NASA/Goddard Space Flight Center Scientific Visualization Studio. Gaia DR2: ESA/Gaia/DPAC.\n\u003e Constellation figures based on those developed for the IAU by Alan MacRobert of Sky and\n\u003e Telescope magazine (Roger Sinnott and Rick Fienberg).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackotter%2Frelativistic-renderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackotter%2Frelativistic-renderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackotter%2Frelativistic-renderer/lists"}