rtcSetSce...rFunction(3)
π NAME π
rtcSetSceneProgressMonitorFunction β bestie, this one registers a callback so you can stalk your build progress like it's your crush's story views π
β¨ SYNOPSIS β¨
#include <embree4/rtcore.h>
typedef bool (*RTCProgressMonitorFunction)(
void* ptr,
double n
);
void rtcSetSceneProgressMonitorFunction(
RTCScene scene,
RTCProgressMonitorFunction progress,
void* userPtr
);
π¦ DESCRIPTION π¦
okay so Embree has this whole progress monitor callback situation going on, and it's genuinely so useful. it lets you get pinged about how far along your hierarchy build operations are, and it also lets you straight up cancel a build mid-flight. main character energy tbh π
So rtcSetSceneProgressMonitorFunction is the function that registers a progress monitor callback (that's the progress argument) along with a payload for it (the userPtr argument), and you attach it to whichever scene you want (the scene argument). slay.
Here's the tea tho: only ONE callback function per scene. that's it. one. so if you call this again, the new invocation just overwrites the callback you set before β no stacking, no layering, no collecting them like pokΓ©mon. and if you pass NULL as the function pointer? that disables the registered callback entirely. bye bestie π
Once it's registered, Embree will hit up your callback function multiple times while it's doing hierarchy build operations on the scene. Every time it calls, it passes:
- the payload you set at registration time (the
userPtrargument), and - a
doublesitting in the range[0, 1]that estimates how far along the operation is (thenargument).
β οΈ heads up: that callback function might get called from multiple threads concurrently. yes fr fr. plan accordingly, no cap.
Now for the return value, because this is where it gets spicy πΆοΈ:
- when you return
truefrom the callback, Embree keeps the build operation going like normal, no drama π - when you return
false, Embree cancels the build operation and throws theRTC_ERROR_CANCELLEDerror code at you π
and good news β issuing multiple cancel requests for the same build operation is totally allowed. spam that cancel button if it feels right, bestie.
π EXIT STATUS π
if something goes wrong, an error code gets set, and you can go query it with rtcGetDeviceError. it's giving "check your messages" energy π±
πΈ SEE ALSO πΈ
- [
rtcNewScene]
and that's the whole vibe!! this page came straight out of the Embree Ray Tracing Kernels 4 manual, and yeah β rtcSetSce...rFunction(3) is the abbreviated little title it rocks up with. go forth and monitor your progress, queen πβ¨π«Ά
π¦ 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