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

Throwing an exception from within an IntersectFilterFunction

Sharpe__Brian
New Contributor I
1,132 Views

Hi Embree People

I'm currently working on a demand-loading system for our renderer.  
The main concept is...
- throw an exception when a missing resource (eg texture) is encountered by the shader
- catch the exception outside of the rtcIntersect() call
- load the resource
- continue with rendering.

Two issues/questions

1)
I'm finding that Embree is automatically catching my exception itself, and reporting it as an "unknown exception caught" error.

For now I'm going to ignore "unknown exception caught" errors as reported by Embree, mark a flag somewhere, and continue on.  But perhaps the Embree team might want to support user exceptions someday?  Perhaps we could throw an exception derived from some "UserExecption" class, in which Embree would not report an error, and rethrow.

2)
Given my idea to ignore "unknown exception caught" errors...
Is it generally "safe" to throw an exception from an IntersectFilterFunction?
What about an Intersect function?

thanks!

0 Kudos
1 Solution
Sharpe__Brian
New Contributor I
1,098 Views

I've decided to go with a different approach for demand loading.

Instead, I now load the resources on the inner loop (rather than throwing an exception and loading later), so we can cancel this question.

Thanks anyway.

View solution in original post

0 Kudos
1 Reply
Sharpe__Brian
New Contributor I
1,099 Views

I've decided to go with a different approach for demand loading.

Instead, I now load the resources on the inner loop (rather than throwing an exception and loading later), so we can cancel this question.

Thanks anyway.

0 Kudos
Reply