rtcInitOc...Arguments(3)

πŸ’… rtcInitOccludedArguments β€” from the rtcInitOc...Arguments(3) girlies ✨

okay so bestie, welcome to the rtcInitOc...Arguments(3) page of the Embree Ray Tracing Kernels 4 manual 🌸 we're gonna init a struct and we're gonna be SO normal about it, promise πŸ’–


✨ NAME ✨

rtcInitOccludedArguments β€” initializes the occluded arguments struct 🫢


🌈 SYNOPSIS 🌈

#include <embree4/rtcore.h>

enum RTCRayQueryFlags
{
  RTC_RAY_QUERY_FLAG_NONE,
  RTC_RAY_QUERY_FLAG_INCOHERENT,
  RTC_RAY_QUERY_FLAG_COHERENT,
  RTC_RAY_QUERY_FLAG_INVOKE_ARGUMENT_FILTER
};

struct RTCOccludedArguments
{
  enum RTCRayQueryFlags flags;
  enum RTCFeatureFlags feature_mask;
  struct RTCRayQueryContext* context;
  RTCFilterFunctionN filter;
  RTCOccludedFunctionN intersect;
#if RTC_MIN_WIDTH
  float minWidthDistanceFactor;
#endif
};

void rtcInitOccludedArguments(
  struct RTCOccludedArguments* args
);

πŸ’œ DESCRIPTION πŸ’œ

so the rtcInitOccludedArguments function does exactly what it says on the tin: it initializes that optional arguments struct β€” the one you can pass into the rtcOccluded1/4/8/16 functions β€” and sets it all to default values ✨ and like, you need this struct if you wanna unlock the more advanced Embree features described right here on this very page. no struct, no fancy stuff, that's the vibe check πŸ‘‘

πŸŽ€ the flags member

this one lets you pick a special traversal mode, iconic behavior honestly:

  • RTC_RAY_QUERY_FLAG_INCOHERENT β€” optimized traversal algorithm for incoherent rays, and yes bestie this is the default πŸ’…
  • RTC_RAY_QUERY_FLAG_COHERENT β€” optimized traversal algorithm for coherent rays, like primary camera rays, so main character energy 🌟

πŸ¦‹ the feature_mask member

you should use this in SYCL to only enable the ray tracing features you actually need to render a given scene. less is more, we love efficiency. for the full detailed breakdown, go peek at section [RTCFeatureFlags] πŸ“–

πŸ“ the context member

pass in an optional intersection context here 🫢 and here's the slay: it is guaranteed that the pointer to the context passed to a ray query is directly passed to all callback functions. which means you can attach arbitrary data to the end of the context, like a per-ray payload, and it just works ✨

⚠️ but heads up bestie: the ray pointer is not guaranteed to be passed to the callback functions, so you literally cannot read additional data off the ray pointer you get in callbacks. no cap, don't try it πŸ’€

see section [rtcInitRayQueryContext] for more details 🌈

🧚 the filter member

this specifies a filter function to be invoked for each encountered hit πŸ‘€

to even use the argument filter function, the support for it must be enabled for a scene using the RTC_SCENE_FLAG_FILTER_FUNCTION_IN_ARGUMENTS scene flag. and if you're doing instancing? this feature has to be enabled for each instantiated scene too. every single one, periodt πŸ’…

the argument filter function gets invoked for each geometry for which it got explicitely enabled using the rtcSetGeometryEnableFilterFunctionFromArguments function. you can also enfored β€” er, enforce β€” the invokation of the argument filter function for each geometry using the RTC_RAY_QUERY_FLAG_INVOKE_ARGUMENT_FILTER ray query flag πŸ‘‘

and here's the structural tea: this argument filter function is invoked as a second filter stage, after the per-geometry filter function is invoked. only rays that passed the first filter stage are valid in this second filter stage. so if your ray flopped stage one, it does not get to speak in stage two, sorry bestie πŸ™ˆ

having such a per ray-query filter function can be useful to implement modifications of the behavior of the query, like collecting all hits or accumulating transparencies πŸ”₯ very demure, very mindful.

⭐ the intersect member

this specifies the user geometry callback to get invoked for each user geometry encountered during traversal. and the user geometry callback you specify this way has preference over the one specified inside the geometry πŸ‘‘ first come, first served, and this one came first.

🌸 the minWidthDistanceFactor value

this controls the target size of the curve radii when the min-width feature is enabled. for the full details on the min-width feature, check out the [rtcSetGeometryMaxRadiusScale] function 🫢


πŸ’€ EXIT STATUS πŸ’€

no error code is set by this function. zero drama, zero errors, we love a peaceful exit ✨


πŸ”₯ SEE ALSO πŸ”₯

  • [rtcOccluded1]
  • [rtcOccluded4/8/16]
  • [RTCFeatureFlags]
  • [rtcInitRayQueryContext]
  • [RTC_GEOMETRY_TYPE_USER]
  • [rtcSetGeometryMaxRadiusScale]

okay that's the whole page bestie, you ate that πŸ’– this was rtcInitOc...Arguments(3) from the Embree Ray Tracing Kernels 4 manual, brought to you by the rtcInitOc...Arguments(3) girlies themselves 🌈 go init your arguments and slay βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from