Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
forked frommadmann91/bvh

A modern C++ BVH construction and traversal library

License

NotificationsYou must be signed in to change notification settings

audulus/bvh

 
 

Repository files navigation

Build Status

Note: This is the 2nd version of this library. Check thev1 branch for the older, first versionof this library.

This library is a small, standalone library for BVH construction and traversal. It is licensedunder the MIT license.

Example rendering generated by a path tracer using this library(Scene by Blend Swap user MaTTeSr, availablehere,distributed under CC-BY 3.0)

Performance

Here is a comparison of this library with other alternatives(Embree,Fast-BVH, andnanort):

Performance comparison with Embree, nanort, and Fast-BVH

Features

Here is a list of features supported by this library (changes fromv1 are indicated with [NEW]):

  • [NEW] C++20 interface usingstd::span instead of raw pointers,
  • Low-level API with direct access to various builders,
  • [NEW] High-levelDefaultBuilder API which selects the best builder depending on the desiredBVH quality level.
  • High-quality, single-threaded sweeping SAH builder,
  • Fast, medium-quality, single-threaded binned SAH builder inspired by"On Fast Construction of SAH-based Bounding Volume Hierarchies", by I. Wald,
  • Fast, high-quality, multithreaded mini-tree BVH builder inspired by"Rapid Bounding Volume Hierarchy Generation using Mini Trees", by P. Ganestam et al.,
  • Reinsertion optimizer based on "Parallel Reinsertion for Bounding Volume HierarchyOptimization", by D. Meister and J. Bittner,
  • Fast and robust traversal algorithm using "Robust BVH Ray Traversal", by T. Ize.
  • Fast ray-triangle intersection algorithm based on"Fast, Minimum Storage Ray/Triangle Intersection", by T. Möller and B. Trumbore,
  • [NEW] Surface area traversal order heuristic for shadow rays based on"SATO: Surface Area Traversal Order for Shadow Ray Tracing", by J. Nah and D. Manocha,
  • Fast ray-sphere intersection routine,
  • [NEW] Serialization/deserialization interface,
  • [NEW] Variable amount of dimensions (e.g. 2D, 3D, 4D BVHs are supported) and different scalar types(e.g.float ordouble),
  • [NEW] Only depends on the standard library (parallelization uses a custom thread pool based onstd::thread),
  • [NEW] C API for the high-level parts of the library is available.

Building

This library is header-only, and can be added as a CMake subproject by cloning or adding as thisrepository as submodule, for instance in<your-project>/contrib/bvh, and then adding this to<your-project>/CMakeLists.txt:

add_subdirectory(contrib/bvh)target_link_library(my_project PUBLIC bvh)

If you want to build the examples, use:

mkdir buildcd buildcmake .. -DCMAKE_BUILD_TYPE=<Debug|Release> -DENABLE_TESTING=ONcmake --build .

C API

The library can be used via a small set of high-level C bindings. These bindings are not enabled bydefault, but can be built by configuring CMake with-DBVH_BUILD_C_API=ON. Additionally, if theintent is to use the library in a pure C environment which does not have the C++ standard library asa dependency, it might be a good idea to statically the C++ standard library. That can be done byadding the flag-DBVH_STATIC_LINK_STDLIB_C_API=ON to the CMake command line.

Usage

The library contains several examples that are kept up-to-date with the API:

About

A modern C++ BVH construction and traversal library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++80.7%
  • C16.5%
  • CMake2.8%

[8]ページ先頭

©2009-2025 Movatter.jp