Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
18 Views

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?

Thanks

0 Kudos
1 Reply
Highlighted
Moderator
18 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