Friday, May 4, 2012

Embree as an Intersection Library

Today I switched the intersection code to use Embree's BVH intersection system. I was tired of constantly not knowing whether it was my spatial acceleration structure not working, or my path tracing not working. I felt that using an external intersection system temporarily as a reference would be beneficial.

I looked at several choices in addition to Embree, such as Caustic Graphics' OpenRL and some open source projects on Google Code. OpenRL's designed more as a framework than a library, with a heavy and verbose OpenGL style API and 'raytracing shaders'. I decided that OpenRL wasn't worth the trouble, and checked out Embree's code. It was exceptionally well laid out, and honestly one of the best pure 'libraries' in the games/graphics scene (a lot of libraries want to take over every aspect of your code).

tl;dr, if you're looking for an easy to integrate and performant triangle - ray intersection library, look no further than Embree.

Note: Embree needs to be initalized before its intersection modules (rtcore/common) can be used! Initialize Embree by calling embree::TaskScheduler::init().

No comments:

Post a Comment