RTCRayN(3)
π RTCRayN β ray packet of runtime size π
okay so bestie, welcome to RTCRayN, straight outta the Embree Ray Tracing Kernels 4 manual, section 3. this is the β¨runtime-sized ray packetβ¨ of your dreams. let's get into it π¦
πΈ NAME πΈ
RTCRayN β a ray packet whose size is, like, runtime. she doesn't know how many rays she's carrying until the moment arrives. main character energy fr π
β¨ SYNOPSIS β¨
#include <embree4/rtcore_ray.h>
struct RTCRayN;
float& RTCRayN_org_x(RTCRayN* ray, unsigned int N, unsigned int i);
float& RTCRayN_org_y(RTCRayN* ray, unsigned int N, unsigned int i);
float& RTCRayN_org_z(RTCRayN* ray, unsigned int N, unsigned int i);
float& RTCRayN_tnear(RTCRayN* ray, unsigned int N, unsigned int i);
float& RTCRayN_dir_x(RTCRayN* ray, unsigned int N, unsigned int i);
float& RTCRayN_dir_y(RTCRayN* ray, unsigned int N, unsigned int i);
float& RTCRayN_dir_z(RTCRayN* ray, unsigned int N, unsigned int i);
float& RTCRayN_time (RTCRayN* ray, unsigned int N, unsigned int i);
float& RTCRayN_tfar (RTCRayN* ray, unsigned int N, unsigned int i);
unsigned int& RTCRayN_mask (RTCRayN* ray, unsigned int N, unsigned int i);
unsigned int& RTCRayN_id (RTCRayN* ray, unsigned int N, unsigned int i);
unsigned int& RTCRayN_flags(RTCRayN* ray, unsigned int N, unsigned int i);
like look at her. twelve little helper functions, all serving looks π
π« DESCRIPTION π«
so here's the tea, bestie β: sometimes you don't know the ray packet size until the program is actually running. the classic example β when Embree hands you a ray packet inside the RTCFilterFuncN callback function β and at that point, compile-time knowledge said "not today." that's when Embree reaches for the RTCRayN type. it's the runtime-size packet. she's flexible. she's adaptable. she's giving versatile πββοΈ
β οΈ okay important: these ray packets can only have sizes of1,4,8, or16. no other packet size will be used. not 2, not 3, not 7, not your little weird custom number. those four and that's it. periodt π
so you've got two ways to play this, and both are valid:
- implement a different special code path for each of those possible packet sizes, and cast the ray to the appropriate ray packet type π
- implement one general code path that uses the
RTCRayN_XXXhelper functions to access the ray packet components π
and about those helper functions β here's the vibe check on how they work. each one takes:
- a pointer to the ray packet β that's the
rayargument π«Ά - the packet size β that's the
Nargument π - and it returns a reference to a component (like, say, the x-component of the origin πΈ) of the
i-th ray of the packet β that's theiargument π―
so you hand her the packet, the size, and the index, and she hands you back a reference to exactly the piece you asked for. iconic. no cap π
π EXIT STATUS π
...bestie. there is nothing here. this section is empty. it's giving silence. moving on β¨
π¦ SEE ALSO π¦
[RTCHitN]β go say hi, they're cousins π
and that's the whole page, gorgeous π go forth and index your runtime-sized rays responsibly.
RTCRayN(3) β from the Embree Ray Tracing Kernels 4 manual, section 3. no date on this one bestie, she's timeless like that. mwah π πβ¨π
π¦ where this page comes from
- alpine 3.24: embree-doc 4.4.1-r0 Β· Apache-2.0
- arch rolling: embree 4.4.1-1 Β· Apache-2.0
- fedora 43: embree 4.4.1-1.fc43 Β· Apache-2.0
- fedora 44: embree 4.4.1-1.fc44 Β· Apache-2.0
- nixpkgs unstable: embree 4.4.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms