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 ⚠️ the rtcOccluded-type functions terminate traversal when a hit got committed. and since filter functions can only set the tfar distance of the ray for a committed hit, the occlusion filter cannot influence the tfar value of subsequent traversal, because that traversal directly ends. dead. done. no more. For that reason rtcOccluded and occlusion filters cannot get used to gather the next n-hits β€” so if that's what you're trying to do, you need rtcIntersect and 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