Code Monkey home page Code Monkey logo

cudabvh's Introduction

CudaBVH

This is an implementation of LBVH on CUDA following the detailed explanation offered by Tero Karras from Nvidia https://devblogs.nvidia.com/parallelforall/thinking-parallel-part-iii-tree-construction-gpu/. This implemenation of LBVH is fully parrallel both in construction and collision pairs finding. The program is divided into two parts. The first part is tree construction and the second part is tree traversal. For tree construction, the workflow is the following.

  1. Convert AABBs to morton codes (in the implementation AABBs are BBoxs). The first implementation used 32 bit uint to represent hash codes of AABBs while this version improved the hash code using 64 bit uint.
  2. Sort converted morton codes using Radix sort. This implemenation utilizes the radix sort from CUB package, which is a package of algorithms implemented to fully harness the power of our GPU.
  3. Create tree hierarchy. Create all leaf nodes first and then create all internal nodes in parallel. The detailed explanation can be found from the link above. Tero explained the algorithm pretty well. If you want to know more about his algorithm, you can go to his paper which can be found in the link above.
  4. Assign BBox to each internal node. This process uses the power of atomic operation in CUDA.

The second step is tree traversal.

Detailed implementation details can be found in my code and in Tero's paper.

Finally, thanks to Yulong Guo for his help in patiently giving me advices about CUDA (I had no previous knowledge of CUDA programming before this project) and testing my code after my first implementation. He also helped me find many errors and bugs of my implementation.

cudabvh's People

Contributors

aeoleader avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.