I am trying to use RTCIntersectContext::RTCFilterFunctionN with rtcIntersect1M with per-ray data. I see this in the docs:
callback functions may be invoked with an arbitrary packet size (of size 1, 4, 8, or 16) and different ordering as specified initially. For this reason, one may have to use the rayID component of the ray to identify the original ray, e.g. to access a per-ray payload.
But it isn't clear to me how RTCRay::id is supposed to be set. I tried initializing the ray stream with consecutive ids (0 to stream size) but the ids returned by RTCRayN_id contain many zeros, large out of range values. I'm probably missing something in the docs or tutorials but I can't figure out how it should work.
Let me know if you want to see any code.