Intel® Embree Ray Tracing Kernels
Discussion forum on the open source ray tracing kernels for fast photo-realistic rendering on Intel® CPUs.
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Integration questions


Hi All

1) I'm passing my data to rays as following (pseudocode)

struct MyRay : public RTCRay {

 MyData * data;


It works fine but how to do same with ispc where ray is "varying"?

2) For ispc I've built object files for rtcore_ispc.ispc and myfile.ispc that contains only one export function with rtcInit(). For all others (creating scene, set callbacks, cast rays) I use same C++ code as without ispc. Is it correct?


0 Kudos
1 Reply

1) ISPC does not support classes, thus you cannot derive from the Embree ray this way. However, what you can do is just create a new ISPC struct that contains the Embree ray as first argument (e.g. struct ExtendedRay { RTCRay ray; MyData* data; }) and do proper casting.

2) If I understand correct your questions targets on using the C++ and ISPC version of Embree in the same program? This is supported, the only thing to be carefull is to set RTC_INTERSECT1/4/8/16 flags in case one creates the scene on the C++ side and wants to call the rtcIntersect function in ISPC later on that scene.