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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backface culling for curves #456

Open
njroussel opened this issue Aug 22, 2023 · 1 comment
Open

Backface culling for curves #456

njroussel opened this issue Aug 22, 2023 · 1 comment

Comments

@njroussel
Copy link

njroussel commented Aug 22, 2023

Hi 馃憢

Thanks for the great work!
I've been trying to get Embree to match with some other library and it requires me to use backface culling on the curve primitive.

As far as I can tell, the CMake option EMBREE_BACKFACE_CULLING_CURVES is only applicable to RTC_GEOMETRY_TYPE_ROUND_LINEAR_CURVE geometry type. Am I correct?
I think this should be clarified in the documentation if it is the case.

I've sprinkled the necessary #if !defined (EMBREE_BACKFACE_CULLING_CURVES) in my fork wherever needed to support the RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE type.
Would you be willing to consider a PR only for this geometry type? I personally don't need to fix all different curve types.

@svenwoop
Copy link
Contributor

svenwoop commented Sep 1, 2023

This change will not properly ignore backfacing hits. You just ignore the far intersection with the intersection of a segment of the curve, but if you intersect a bend curve on a shallow angle, you may also exit the curve on the near intersection. Reason is that such segments are itself still curved, this the cone bounding might indicate that the hit will be a near hit, but in the end the curvature. E.g. if the ray is entering the curve, and then traveling almost parallel to the exit plane. In that case the decision if the exit is near or far is an unstable decision and the approach will not work.
The right way of doing this is checking the geometry normal Ng and ignoring hits based on this. I will add this to our todo list, maybe next release will also support backface culling of round curve types.

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