{"id":19681086,"url":"https://github.com/potato3d/grid","last_synced_at":"2025-05-06T19:29:13.081Z","repository":{"id":152464576,"uuid":"338573256","full_name":"potato3d/grid","owner":"potato3d","description":"GPU-accelerated uniform grid construction for ray tracing","archived":false,"fork":false,"pushed_at":"2021-02-13T13:18:42.000Z","size":1815,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T02:11:43.779Z","etag":null,"topics":["cuda","glsl","gpu","grid","ray-tracing"],"latest_commit_sha":null,"homepage":"","language":"C","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/potato3d.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":"2021-02-13T12:46:55.000Z","updated_at":"2025-02-01T15:32:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"433a9514-1ed6-47ac-a624-35bb61cde41f","html_url":"https://github.com/potato3d/grid","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/potato3d%2Fgrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potato3d%2Fgrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potato3d%2Fgrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potato3d%2Fgrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/potato3d","download_url":"https://codeload.github.com/potato3d/grid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252752637,"owners_count":21798837,"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","glsl","gpu","grid","ray-tracing"],"created_at":"2024-11-11T18:06:55.136Z","updated_at":"2025-05-06T19:29:13.071Z","avatar_url":"https://github.com/potato3d.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grid\nGPU-Accelerated Uniform Grid Construction for Ray Tracing\n\nSource code for the article [GPU-Accelerated Uniform Grid Construction for Ray Tracing](http://www.dbd.puc-rio.br/depto_informatica/09_14_ivson.pdf)\n\nThis repository is a library that implements the uniform grid construction algorithm. Checkout the companion project [grid-rt](https://github.com/potato3d/grid-rt) for the GPU-based ray tracing application.\n\n# Description\n\nThe library includes two implementations of uniform grid construction\n* CPU: src/CpuGrid.*\n* GPU: src/GpuGrid.* + src/cuda + shaders\n\nThe GPU algorithm combines very fast scan and sorting procedures to classify scene primitives according to the spatial subdivision. Since the grid structure can be efficiently rebuilt each rendering frame, we can maintain performance with fully animated scenes containing unstructured movements.\n\nThe basic idea of the GPU algorithm is to first start a thread per triangle and write to memory, in parallel, which grid cells each triangle overlaps. We write a pair (triangleID, cellID). Then, we rearrange this list so that all triangles belonging to the same cell are contiguous in memory, saving a pair of values per cell (offset to scell start, number of triangles). We use scan and sort procedures to achieve this. Now the structure is ready for GPU-based ray tracing. \n\nPlease check the paper reference above for more implementation details.\n\nAt rendering time, we trace one ray per GPU thread using a 3D-DDA algorithm. We have two implementations for the ray tracing: GLSL-based and CUDA-based. At the time, the GLSL implementation was about 30% faster. Please check the companion project [grid-rt](https://github.com/potato3d/grid-rt) for the implementation of the GPU-based ray tracing application using this library.\n\n# Examples\n\nThese are some images generated with our algorithm for benchmark animated scenes:\n\n![scenes](https://github.com/potato3d/grid/blob/main/imgs/scenes.png \"Animated scenes\")\n\nThese are the results in performance, compared to state of the art:\n\n![speed](https://github.com/potato3d/grid/blob/main/imgs/speed.png \"Performance results\")\n\n# Build\n\nVisual Studio project files available in prj directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotato3d%2Fgrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotato3d%2Fgrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotato3d%2Fgrid/lists"}