rtcOccluded1(3)

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

πŸ’… rtcOccluded1 πŸ’…

okay so bestie, welcome to rtcOccluded1, page 3 of the Embree Ray Tracing Kernels 3 manual. she's short, she's fast, she's iconic. let's get into it πŸ¦‹


✨ NAME ✨

rtcOccluded1 β€” finds any hit for a single ray 🌈


✨ SYNOPSIS ✨

#include <embree3/rtcore.h>

void rtcOccluded1(
  RTCScene scene,
  struct RTCIntersectContext* context,
  struct RTCRay* ray
);

✨ DESCRIPTION ✨

so like, rtcOccluded1 takes one single ray (that's the ray argument, bestie) and checks whether there's any hit at all with the scene (that's the scene argument, obviously πŸ’…).

before you call her, you GOTTA set up your ray, no skipping steps:

  • the ray origin β€” that's the org ray member πŸ‘‘
  • the ray direction β€” the dir ray member 🎯
  • the ray segment β€” the tnear and tfar ray members βœ‚οΈ
  • and the ray flags β€” set those to 0, that's the flags ray member 🚩

if your scene has motion blur geometries, you also have to initialize the ray time β€” that's the time ray member β€” to a value in the range [0, 1] ⏰

and if ray masks were enabled at compile time, then yeah, the ray mask (the mask ray member) has to be initialized too 😌

also the ray segment must be in the range [0, ∞] β€” so ranges that start behind the ray origin are not valid, but ranges can totally reach out to infinity, she's flexible like that ✨

if you want the full ray layout tea, go check out Section [RTCRay] 🫢

when no intersection is found, the ray data is not updated β€” she leaves it alone, no notes. but the moment a hit is found, the tfar component of the ray gets set to -inf πŸ’€ that's the whole point, that's the signal.

okay and here's the part where we keep it real: the implementation makes no guarantees that primitives whose hit distance is exactly at (or very close to) tnear or tfar are hit or missed. it's giving "boundary, we don't know her." 😭 so:

  • if you want to exclude intersections at tnear, just pass a slightly enlarged tnear
  • if you want to include intersections at tfar, pass a slightly enlarged tfar

and PLEASE remember: the ray must be aligned to 16 bytes. no cap. πŸ”₯


✨ EXIT STATUS ✨

for performance reasons this function does no error checks at all β€” so on failure it will not set any error flags. she's too busy being fast for that πŸ™ˆ


✨ SEE ALSO ✨

  • [rtcOccluded1]
  • [RTCRay]

okay that's the whole page, you ate it, you understood it, periodt πŸ’– this was rtcOccluded1(3) from the Embree Ray Tracing Kernels 3 manual, and yes she really does put her own name in the footer again because she's the main character πŸ‘‘βœ¨ bye bestie πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from