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

Integration questions

Igor_Igor
Beginner
252 Views

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?

Thanks

0 Kudos
1 Reply
SvenW_Intel
Moderator
252 Views

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.

0 Kudos
Reply