rtcIntersect4/8/16(3)

✨ rtcIntersect4/8/16 ✨

okay bestie, welcome to the Embree Ray Tracing Kernels 4 manual, page rtcIntersect4/8/16 πŸ’… this one's all about yeeting a whole packet of rays at your scene and catching the closest hits. no cap, it's iconic.


πŸŽ€ NAME πŸŽ€

rtcIntersect4/8/16 β€” finds the closest hits for a ray packet πŸ¦‹


🌸 SYNOPSIS 🌸

#include <embree4/rtcore.h>

void rtcIntersect4(
  const int* valid,
  RTCScene scene,
  struct RTCRayHit4* rayhit,
  struct RTCIntersectArguments* args = NULL
);

void rtcIntersect8(
  const int* valid,
  RTCScene scene,
  struct RTCRayHit8* rayhit,
  struct RTCIntersectArguments* args = NULL
);

void rtcIntersect16(
  const int* valid,
  RTCScene scene,
  struct RTCRayHit16* rayhit,
  struct RTCIntersectArguments* args = NULL
);

🫢 DESCRIPTION 🫢

so the rtcIntersect4/8/16 functions find the closest hits for a ray packet of size 4, 8, or 16 (that's your rayhit argument) against the scene (the scene argument). the ray/hit input carries a ray packet and a hit packet, like a little duo πŸŽ€ and the optional arguments struct (the args argument) is how you pass extra stuff for advanced features. for all the deets and a full walkthrough of how to set up and trace rays, go read the section on rtcIntersect1 β€” it's the main character, fr fr.

you must hand over a ray valid mask (the valid argument) which stores one 32-bit integer per ray in the packet β€” -1 means valid and 0 means invalid. only active rays get processed, and the hit data of inactive rays is left completely untouched. respect the boundaries, periodt. πŸ™ˆ

alignment check, because the vibes must be aligned literally:

  • for rtcIntersect4 the ray packet must be aligned to 16 bytes
  • for rtcIntersect8 the alignment must be 32 bytes
  • for rtcIntersect16 the alignment must be 64 bytes
⚠️ heads up bestie β€” rtcIntersect4, rtcIntersect8 and rtcIntersect16 may change the ray packet size and the ray order when they call back into filter functions or user geometry callbacks. it's giving chaos but it's fine. under some conditions the application can assume packets stay intakt, and you can figure out whether that's your situation by querying the RTC_DEVICE_PROPERTY_NATIVE_RAY4_SUPPORTED, RTC_DEVICE_PROPERTY_NATIVE_RAY8_SUPPORTED, RTC_DEVICE_PROPERTY_NATIVE_RAY16_SUPPORTED properties through the rtcGetDeviceProperty function. more info lives in rtcGetDeviceProperty β€” go look, iykyk. πŸ’œ

⭐ EXIT STATUS ⭐

for performance reasons this function does not do any error checks, so it will not set any error flags on failure. no safety net, just speed. slay but make it risky πŸ’€


🌈 SEE ALSO 🌈

  • rtcIntersect1
  • rtcOccluded4/8/16
  • rtcInitIntersectArguments

and that's the whole page bestie!! this was rtcIntersect4/8/16 from the Embree Ray Tracing Kernels 4 manual. go forth and intersect, you absolute icon πŸ‘‘πŸ’–βœ¨

πŸ“¦ where this page comes from