Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does RTC_RAY_QUERY_FLAG_INVOKE_ARGUMENT_FILTER not apply to user-defined geometries? #478

Open
Tradias opened this issue Mar 14, 2024 · 2 comments

Comments

@Tradias
Copy link

Tradias commented Mar 14, 2024

Given a user-defined geometry (RTC_GEOMETRY_TYPE_USER) added to a scene with RTC_SCENE_FLAG_FILTER_FUNCTION_IN_ARGUMENTS then the following code:

RTCIntersectArguments args
// ...
args.filter = some_filter;
args.flags = RTC_RAY_QUERY_FLAG_INVOKE_ARGUMENT_FILTER;
rtcIntersect1(scene, &rayhit, &args);

never invokes some_filter even though the documentation says that:

The callback is only invoked for geometries that enable the callback using the rtcSetGeometryEnableFilterFunctionFromArguments call, or enabled for all geometries when the RTC_RAY_QUERY_FLAG_INVOKE_ARGUMENT_FILTER ray query flag is set.

Even enabling rtcSetGeometryEnableFilterFunctionFromArguments has no effect.

This issue describes a workaround #441 but it would be nice to either change the documentation or change the behavior.

embree version 4.3.0

@svenwoop
Copy link
Collaborator

You are right, filter functions are newer called for user defined geometries automatically. You either have to add some rtcInvokeIntersectFilterFromGeometry call to invoke the filter function stored inside the geometry by hand, or pass the function set inside the RTCIntersectArguments manually through the context and call it.

@Tradias
Copy link
Author

Tradias commented Mar 18, 2024

I am doing doing the latter, but it took me a while to figure out because the documentation confused me and does not mention the latter approach to my knowledge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants