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


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
2 Replies

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

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