rtcOccluded1(3)
β¨ rtcOccluded1 β¨
okay bestie, welcome to rtcOccluded1 from the Embree Ray Tracing Kernels 4 manual, section 3. it's giving "do I hit literally anything?" energy and honestly? iconic. π
π NAME π
rtcOccluded1 β finds any hit for a single ray
like. ANY hit. one ray. that's the whole gig. no cap. π¦
πΈ SYNOPSIS πΈ
#include <embree4/rtcore.h>
void rtcOccluded1(
RTCScene scene,
struct RTCRay* ray,
struct RTCOccludedArguments* args = NULL
);
yes the args thing defaults to NULL, she's optional, she's low maintenance. π«Ά
π DESCRIPTION π
so what does rtcOccluded1 actually do? it checks, for a single ray (that's your ray argument, bestie), whether there is any hit with the scene (that's your scene argument, obviously πβοΈ). and that optional args struct you can pass in? that's for the advanced use cases, so go read the section on [rtcInitOccludedArguments] if you want the tea on that. β
now, to actually trace a ray, you gotta initialize a whole lil checklist. no skipping steps, this is not a vibe check you can fail:
- the ray origin β the
orgray member - the ray direction β the
dirray member - the ray segment β the
tnearandtfarray members - the ray mask β the
maskray member - and you must set the ray flags to
0β theflagsray member
the ray time (that's the time ray member) has to be initialized to a value in the range [0, 1]. and the ray segment has to be in the range [0, β] β so ranges that start behind the ray origin are simply not valid, sorry babe, not happening π β but the ranges can reach all the way out to infinity, which is kinda slay of them. if you want the full ray layout description, go see Section [RTCRay]. π
now here's the important part, and I need you to focus:
when no intersection is found, the ray data is not updated. like, at all. untouched. but when a hit was found, thetfarcomponent of the ray gets set to-inf. π
and ngl, the implementation makes no guarantees that primitives whose hit distance is exactly at (or very close to) tnear or tfar are hit or missed. that's just the boundary drama we live with. so if you want to exclude intersections at tnear, just pass a slightly enlarged tnear. and if you want to include intersections at tfar, pass a slightly enlarged tfar. tiny little nudge, huge little difference. β¨
oh and one more thing β the ray must be aligned to 16 bytes. non-negotiable, bestie. that's the rule. π
π EXIT STATUS π
for performance reasons, this function does not do any error checks. like, zero. so on failure it will not set any error flags. she simply does not snitch. π€
π SEE ALSO π
go read these too, they're all part of the same friend group:
- [rtcIntersect1]
- [rtcOccluded4/8/16]
- [RTCRay]
- [rtcInitOccludedArguments]
and that's the whole page, bestie!! this was rtcOccluded1(3) straight out of the Embree Ray Tracing Kernels 4 manual β go forth and occlude, you absolute main character. πβ¨π
π¦ where this page comes from
- ubuntu stonking: libembree-dev 4.4.1+dfsg-2ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms