Jump to content
  • Advertisement
Sign in to follow this  

how to traverse bvh on gpgpu (for ray tracing)?

This topic is 2095 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


the basic traversal is no different than on CPU, modern GPUs are flexible enough to handle it.

then you need to optimize it, two important points for performance are

-data coherence

-thread coherence



means you organize data in a way that leads to as much cache hits as possible e.g

-you can group ray queries by position and orientation to access similar data during traversal

-specialize data in regard to specific aspects e.g. special tree for shadow raycast, special tree for ambient occlusion casts, special trees depending on the ray direction (with clustered backface culling of triangles)




-as you write code for a single thread (on opencl/cuda), those still run in groups of 32 or 64, if threads take different branches, it will lead to a lot of threads that don't work and reduce performance. so your optimization job is to reduce thread divergence as far as possible.


those two points are independent of the hierarchy you use, so I'd suggest to also read that paper: http://www.eng.utah.edu/~cs7940/papers09/Timo_GPU_rt_HPG09.pdf

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!