Intel® Embree Ray Tracing Kernels
Discussion forum on the open source ray tracing kernels for fast photo-realistic rendering on Intel® CPU(s)

interrupt Intersect1 function

BartekZgo
Beginner
1,330 Views

Hi guys,

I have two questions. Normally Intersect1 function gives me a result very quickly. But I have some heavy geometry (layer with millions of leafs). When a ray hits that layer, it takes up to 30s to get the result from Intersect1 function. In my scene, there are 8000 instances of that tree and about 8 millions of polygons in total. Is it normal to get result in 30s (no GPU used)?

Second question, is it possible to interrupt the execution of Intersect1 function. Luxcore is multithread application, so many threads are calling Intersect function. Let say that I want to interrupt the render. So it wold be perfect for me, to have possibility to call some function, or set some flag, that wold interrupt the Inersect1 function. It could simple return  RTC_INVALID_GEOMETRY_ID.

0 Kudos
4 Replies
SvenW_Intel
Moderator
1,267 Views

No, it is not normal for rtcIntersect1 to take 30s. Could you please check if the rays you pass to Embree do not contain inf/nan for org/dir components? This can easily happen in a pathtracer and could cause a full tree traversal. If you enable EMBREE_IGNORE_INVALID_RAYS in cmake these problematic rays will be not get traversed, which might also be a solution to fix this issue.

There is no way to terminate traversal, but as traversal typically is very fast I also see no reason for this. Thus if first issue is fixed you probably do not need this anyway.

0 Kudos
BartekZgo
Beginner
1,239 Views

Hi. I'm sorry for delay. I've been on holidays. I've checked the issue and you are right! There was NaN in ray direction. I have added a check before calling rtcIntersect1 function.

Thanks for help!

0 Kudos
lalith-mcw
Novice
792 Views

@SvenW_Intel  Why `rtcIntersectV()` wrapper is not defined in the `c++` version and available only with `isph` which internally uses `rtcIntersect8/16` based on the alignment of the float value. Will `c++` version perform better if wrapper is used ?

 

https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/rtcIntersectNM-RTCRayHitN/m-p/1161656/highlight/true#M772


0 Kudos
FlorianR_Intel
Employee
774 Views

Hi,

 

ISPC's programming model is quite different to C++. In C++ land, you have to manage your ray packets (e.g. ray8 or ray16) manually whereas ISPC has an implicit ray package corresponding to the underlying SIMD width.

 

Which mode of rendering (ray1, ray4, ray8, ray16) will be faster depends on a lot of parameters so please experiment with the different ray packet sizes. However for simple "primary hit" use-cases, ray packets are expected to perform better.

 

Compare, for example, the FPS in the C++ and ISPC versions of the tutorials. This gives you an idea of the speedup you can expect in simple applications.

 

Cheers,

Embree Team

0 Kudos
Reply