rtcSetGeo...rFunction(3)
π NAME π
rtcSetGeometryOccludedFilterFunction β bestie, this one sets the occlusion filter for the geometry β¨
πΈ SYNOPSIS πΈ
#include <embree4/rtcore.h>
void rtcSetGeometryOccludedFilterFunction(
RTCGeometry geometry,
RTCFilterFunctionN filter
);
π¦ DESCRIPTION π¦
okay so. rtcSetGeometryOccludedFilterFunction registers an occlusion filter callback function (that's the filter argument) for the geometry you point at (that's the geometry argument). literally it just hands your lil function over to the geometry. slay π
one (1) callback per geometry, that's the rule β only a single callback function can be registered per geometry, and if you call this again it just overwrites whatever you set before. no stacking, no layering, no "but I wanted both" π. And if you pass NULL as the function pointer? that disables the registered callback function entirely. bye bye filter π
The registered occlusion filter function gets invoked for every hit encountered during the rtcOccluded-type ray queries, and it can accept or reject that hit. it's giving gatekeeper but in a useful way.
So what's it even for?? you can use it to define a silhouette for a primitive and reject hits that are outside the silhouette. iconic. for example, a tree leaf could be modeled with an alpha texture that decides whether hit points lie inside or outside the leaf π (yes, this is the alpha-texture-leaf pipeline, we love her).
if you want the full tea on what the filter callback function actually looks like and does, please see the description of the rtcSetGeometryIntersectFilterFunction β she's the blueprint, go read her.
β οΈ important caveat, pay attention bestie β οΈ thertcOccluded-type functions terminate traversal when a hit got committed. and since filter functions can only set thetfardistance of the ray for a committed hit, the occlusion filter cannot influence thetfarvalue of subsequent traversal, because that traversal directly ends. dead. done. no more. For that reasonrtcOccludedand occlusion filters cannot get used to gather the next n-hits β so if that's what you're trying to do, you needrtcIntersectand intersection filters instead. periodt. π
π EXIT STATUS π
On failure an error code is set that can be queried using rtcGetDeviceError. (so like, if it breaks, go ask rtcGetDeviceError what happened, she'll tell you π«Ά)
π SEE ALSO π
[rtcSetGeometryIntersectFilterFunction]
that's the whole page, no cap. this was rtcSetGeo...rFunction(3) from the Embree Ray Tracing Kernels 4 manual π go forth and filter those occluded hits, main character πβ¨π
π¦ 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