{"id":25872757,"url":"https://github.com/1180779/spheresraycasting","last_synced_at":"2025-03-02T08:22:24.943Z","repository":{"id":280189169,"uuid":"913992140","full_name":"1180779/SpheresRaycasting","owner":"1180779","description":"Raycasting of spheres","archived":false,"fork":false,"pushed_at":"2025-03-01T20:25:50.000Z","size":2108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T21:25:38.041Z","etag":null,"topics":["cuda","opengl"],"latest_commit_sha":null,"homepage":"","language":"C++","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/1180779.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"licenses/ImGui.txt","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":"2025-01-08T18:33:35.000Z","updated_at":"2025-03-01T20:25:54.000Z","dependencies_parsed_at":"2025-03-01T21:35:40.665Z","dependency_job_id":null,"html_url":"https://github.com/1180779/SpheresRaycasting","commit_stats":null,"previous_names":["1180779/spheresraycasting"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1180779%2FSpheresRaycasting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1180779%2FSpheresRaycasting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1180779%2FSpheresRaycasting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1180779%2FSpheresRaycasting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1180779","download_url":"https://codeload.github.com/1180779/SpheresRaycasting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241478251,"owners_count":19969254,"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":["cuda","opengl"],"created_at":"2025-03-02T08:22:23.824Z","updated_at":"2025-03-02T08:22:24.930Z","avatar_url":"https://github.com/1180779.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Spheres Raycasting\n\nSimple Spheres raycasting in CUDA (rendered with openGL). \n\n## Parameters\nSome parameters are avaliable to configure before starting the raycasting. They include\n- the number of spheres\n- `x, y, z` (for location) and radius values ranges\n- spheres material (choice from predefined list)\n- number of sources of lights\n- location and radius ranges for light sources\n- Phong reflection model parameters for lights (ranges)\n- camera resolution (which determins the number of cast rays)\n\nParameters can be loaded from file within the executable \nlocation ([check example config in repo](./SpheresRaycasting/config.txt))\n\n## After the start of casting\nAfter the start of casting user has fewer options at their disposal. \n\n- Ambient component of Phong reflection model can be changed (value `0 - 1`)\n\n- Animation mode can be set to rotate the lights around the center of the scene with time.\n\n- User can select to rotate the light sources or the spheres around the center of the scene.\n\n- Camera movement is not possible.\n\n\n## [How it works](https://en.wikipedia.org/wiki/Ray_casting#Concept)\n- Rays are cast from the camera position along the Z axis and intersection with spheres in the scene are checked. \nAfter failing to implement LVBH myself (to be fair I didn't try particulary hard) I have used [this github project](https://github.com/ToruNiina/lbvh).\n- Based on ray intersection with spheres [Phong reflection model](https://en.wikipedia.org/wiki/Phong_reflection_model) parameters and the pixel color are calculated\n- Color is written to openGL texture\n- Texture is render on the screen by openGL\n\n\n## Examples\n- matte material\n![](./samples/matte-1.jpg)\n![](./samples/matte-2.jpg)\n\n- glossy material\n![](./samples/glossy-1.jpg)\n\n- soft material\n![](./samples/soft-1.jpg)\n\n## Some sources\n- [Nvidia Developer Technical Blog](https://developer.nvidia.com/blog): Thinking in parallel\n\t- [Part1](https://developer.nvidia.com/blog/thinking-parallel-part-i-collision-detection-gpu/)\n\t- [Part2](https://developer.nvidia.com/blog/thinking-parallel-part-ii-tree-traversal-gpu/)\n\t- [Part3](https://developer.nvidia.com/blog/thinking-parallel-part-iii-tree-construction-gpu/)\n- [Phong reflection model](https://en.wikipedia.org/wiki/Phong_reflection_model)\n\n## Dependencies\nThe project uses\n- [GLFW](https://github.com/glfw/glfw) (managing windows)\n- [glad](https://github.com/Dav1dde/glad) (openGL loader (and more))\n- openGL\n- CUDA\n- [Dear imGui](https://github.com/ocornut/imgui) (controls)\n- [lbvh implementation](https://github.com/ToruNiina/lbvh) by [Toru Niina](https://github.com/ToruNiina)\n- [GML](https://github.com/g-truc/glm) (math)\n\n## Build\nBuild in Visual Studio 2022 with CUDA support. Installation steps can be found [here](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/).\n\nDependencies are placed in the [Libraries](./Libraries) subdirectory or are directly part of source files. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1180779%2Fspheresraycasting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1180779%2Fspheresraycasting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1180779%2Fspheresraycasting/lists"}