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

RTCFilterFunctionNArguments and RTCIntersectFunctionNArguments memory layout

manoula
Beginner
584 Views

Hi, I have a question concerning RTCFilterFunctionNArguments and RTCIntersectFunctionNArguments

For RTCRayHitN*, I can get rayn or hitn using 

RTCRayN* RTCRayHitN_RayN(RTCRayHitN* rayhit, unsigned int N) { return (RTCRayN*)&((float*)rayhit)[0*N]; }
RTCHitN* RTCRayHitN_HitN(RTCRayHitN* rayhit, unsigned int N) { return (RTCHitN*)&((float*)rayhit)[12*N]; }
 
Will it give me the same result if I apply (RTCHitN*)&((float*)ray)[12*N]  to RTCRayN* in RTCFilterFunctionNArguments?

 

struct RTCFilterFunctionNArguments
{
  int* valid;
  void* geometryUserPtr;
  const struct RTCIntersectContext* context;
  struct RTCRayN* ray;
  struct RTCHitN* hit;
  unsigned int N;
};

 

struct RTCIntersectFunctionNArguments
{
  int* valid;
  void* geometryUserPtr;
  unsigned int primID;
  struct RTCIntersectContext* context;
  struct RTCRayHitN* rayhit;
  unsigned int N;
  unsigned int geomID;
};

 

0 Kudos
2 Replies
SvenW_Intel
Moderator
556 Views

No, you have to use the provided hit pointer provided in the RTCFilterFunctionNArguments.

0 Kudos
manoula
Beginner
544 Views
0 Kudos
Reply