{"id":15047731,"url":"https://github.com/madmann91/bvh","last_synced_at":"2025-05-16T08:06:35.820Z","repository":{"id":42992241,"uuid":"234346912","full_name":"madmann91/bvh","owner":"madmann91","description":"A modern C++ BVH construction and traversal library","archived":false,"fork":false,"pushed_at":"2024-09-10T07:50:05.000Z","size":1098,"stargazers_count":937,"open_issues_count":4,"forks_count":89,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-10-30T00:33:01.942Z","etag":null,"topics":["bvh","c11","construction-algorithms","cpp20","header-only","raytracing","traversal-algorithms"],"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/madmann91.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.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":"2020-01-16T15:11:13.000Z","updated_at":"2024-10-29T16:41:41.000Z","dependencies_parsed_at":"2024-11-12T18:00:28.616Z","dependency_job_id":"35892b61-6799-4ac5-b4c5-68eb45ad580a","html_url":"https://github.com/madmann91/bvh","commit_stats":{"total_commits":398,"total_committers":8,"mean_commits":49.75,"dds":"0.14572864321608037","last_synced_commit":"82123acb035608b9c533bf95605bd1653b6673c7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madmann91%2Fbvh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madmann91%2Fbvh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madmann91%2Fbvh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madmann91%2Fbvh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madmann91","download_url":"https://codeload.github.com/madmann91/bvh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493378,"owners_count":22080126,"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":["bvh","c11","construction-algorithms","cpp20","header-only","raytracing","traversal-algorithms"],"created_at":"2024-09-24T21:03:46.774Z","updated_at":"2025-05-16T08:06:30.806Z","avatar_url":"https://github.com/madmann91.png","language":"C++","funding_links":[],"categories":["ComputerGraphics \u0026\u0026 Shadingv","Ray Tracing"],"sub_categories":["Google Analytics","BVH"],"readme":"# BVH Construction and Traversal Library\n\n![Build Status](https://github.com/madmann91/bvh/workflows/build-and-test/badge.svg)\n\n\u003e Note: This is the 2nd version of this library. Check the `v1` branch for the older, first version\n\u003e of this library.\n\nThis library is a small, standalone library for BVH construction and traversal. It is licensed\nunder the MIT license.\n\n![Example rendering generated by a path tracer using this library](render.jpg)\n(Scene by Blend Swap user MaTTeSr, available [here](https://www.blendswap.com/blend/18762),\ndistributed under CC-BY 3.0)\n\n## Performance\n\nHere is a comparison of this library with other alternatives\n([Embree](https://github.com/embree/embree),\n[Fast-BVH](https://github.com/brandonpelfrey/Fast-BVH), and\n[nanort](https://github.com/lighttransport/nanort)):\n\n![Performance comparison with Embree, nanort, and Fast-BVH](chart.png)\n\n## Features\n\nHere is a list of features supported by this library (changes from `v1` are indicated with [NEW]):\n\n- [NEW] C++20 interface using `std::span` instead of raw pointers,\n- Low-level API with direct access to various builders,\n- [NEW] High-level `DefaultBuilder` API which selects the best builder depending on the desired\n  BVH quality level.\n- High-quality, single-threaded sweeping SAH builder,\n- Fast, medium-quality, single-threaded binned SAH builder inspired by\n  \"On Fast Construction of SAH-based Bounding Volume Hierarchies\", by I. Wald,\n- Fast, high-quality, multithreaded mini-tree BVH builder inspired by\n  \"Rapid Bounding Volume Hierarchy Generation using Mini Trees\", by P. Ganestam et al.,\n- Reinsertion optimizer based on \"Parallel Reinsertion for Bounding Volume Hierarchy\n  Optimization\", by D. Meister and J. Bittner,\n- Fast and robust traversal algorithm using \"Robust BVH Ray Traversal\", by T. Ize.\n- Fast ray-triangle intersection algorithm based on\n  \"Fast, Minimum Storage Ray/Triangle Intersection\", by T. Möller and B. Trumbore,\n- [NEW] Surface area traversal order heuristic for shadow rays based on\n  \"SATO: Surface Area Traversal Order for Shadow Ray Tracing\", by J. Nah and D. Manocha,\n- Fast ray-sphere intersection routine,\n- [NEW] Serialization/deserialization interface,\n- [NEW] Variable amount of dimensions (e.g. 2D, 3D, 4D BVHs are supported) and different scalar types\n  (e.g. `float` or `double`),\n- [NEW] Only depends on the standard library (parallelization uses a custom thread pool based on\n  `std::thread`),\n- [NEW] C API for the high-level parts of the library is available.\n\n## Building\n\nThis library is header-only, and can be added as a CMake subproject by cloning or adding as this\nrepository as submodule, for instance in `\u003cyour-project\u003e/contrib/bvh`, and then adding this to\n`\u003cyour-project\u003e/CMakeLists.txt`:\n\n    add_subdirectory(contrib/bvh)\n    target_link_library(my_project PUBLIC bvh)\n\nIf you want to build the examples, use:\n\n    mkdir build\n    cd build\n    cmake .. -DCMAKE_BUILD_TYPE=\u003cDebug|Release\u003e -DENABLE_TESTING=ON\n    cmake --build .\n\n## C API\n\nThe library can be used via a small set of high-level C bindings. These bindings are not enabled by\ndefault, but can be built by configuring CMake with `-DBVH_BUILD_C_API=ON`. Additionally, if the\nintent is to use the library in a pure C environment which does not have the C++ standard library as\na dependency, it might be a good idea to statically the C++ standard library. That can be done by\nadding the flag `-DBVH_STATIC_LINK_STDLIB_C_API=ON` to the CMake command line.\n\n## Usage\n\nThe library contains several examples that are kept up-to-date with the API:\n\n- A [basic example](test/simple_example.cpp) that traces one ray on a scene made of a couple of triangles,\n- A [benchmarking utility](test/benchmark.cpp) that showcases what the library can do.\n- A [serialization test](test/serialize.cpp) that shows how to save and load a BVH from a file.\n- A [C API example](test/c_api_example.c) that shows how to use the C bindings to this library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadmann91%2Fbvh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadmann91%2Fbvh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadmann91%2Fbvh/lists"}