RTCHit(3)

πŸ“¦ version 3.13.5, in epel 9, fedora 43, fedora 44

πŸ’– NAME πŸ’–

RTCHit β€” the single hit structure, aka the lil glow-up receipt you get when a ray actually hits something πŸ‘‘βœ¨


🌸 SYNOPSIS 🌸

#include <embree3/rtcore.h>

struct RTCHit
{
  float Ng_x;                                        // x coordinate of geometry normal
  float Ng_y;                                        // y coordinate of geometry normal
  float Ng_z;                                        // z coordinate of geometry normal

  float u;                                           // barycentric u coordinate of hit
  float v;                                           // barycentric v coordinate of hit

  unsigned int primID;                               // geometry ID
  unsigned int geomID;                               // primitive ID
  unsigned int instID[RTC_MAX_INSTANCE_LEVEL_COUNT]; // instance ID
};

✨ DESCRIPTION ✨

okay so bestie, RTCHit is literally the type that holds the result of a ray/primitive intersection. it's the "we found each other πŸ₯Ή" moment, but in struct form.

this hit is carrying:

  • the unnormalized geometric normal in object space at the exact hit location β€” that's the Ng_x, Ng_y, Ng_z members 🧭
  • the barycentric u/v coordinates of the hit β€” yup, the u and v members πŸ’…
  • the primitive ID β€” the primID member
  • the geometry ID β€” the geomID member
  • the instance ID stack β€” the instID member 🌈
heads up: the parametric intersection distance is not stored inside the hit. nope, not here. it lives inside the tfar member of the ray. so don't go looking for it in the hit, she's not there πŸ’€

πŸ¦‹ the packet era πŸ¦‹

the embree3/rtcore_ray.h header additionally defines the same hit structure in structure of array (SOA) layout for hit packets, and the sizes are:

  • size 4 β†’ RTCHit4 type
  • size 8 β†’ RTCHit8 type
  • size 16 β†’ RTCHit16 type

and that same header additionally defines an RTCHitNt template for hit packets of an arbitrary compile-time size ⭐ iconic behavior, honestly.


πŸŽ€ EXIT STATUS πŸŽ€

(nothing here, bestie β€” the section is just vibing empty 🫢)


πŸ”₯ SEE ALSO πŸ”₯

  • [RTCRay]
  • [Multi-Level Instancing]

and that's the whole page, no cap. this was RTCHit(3) from the Embree Ray Tracing Kernels 3 manual set β€” mwah, periodt πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from