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

Add possibility to handle multiple intersections #1

Open
Sheol27 opened this issue Jun 10, 2024 · 1 comment
Open

Add possibility to handle multiple intersections #1

Sheol27 opened this issue Jun 10, 2024 · 1 comment

Comments

@Sheol27
Copy link

Sheol27 commented Jun 10, 2024

Hi! Right now there is the function intersect_1, but as the name says it returns only the first intersection. It would be awesome if we could have all the intersections of the ray, like it happens in the python library. Is it possible to add this feature ?

@psytrx
Copy link
Owner

psytrx commented Jun 10, 2024

Hi!

If I remember correctly, embree only supports intersections for packets of size 2^n, up to 16 at most. For these sizes it should be straightforward to implement.

For finding all intersections, we'd have to repeatedly call intersect_16 (while increasing tnear) until the result set is empty.
I can see this being a feature, but am currently unable to look into the details.
Some thoughts: We should be able to do this in parallel. This may turn out as a challenge though, since we're handling raw pointers under the hood. Also, an upper bound may be known by the developer - this could improve performance if we're choosing a sensible approach (don't allocate unnecessarily large packets, etc).

Can you provider a link to the Python library your are referring to?

As noted, I'm currently unable to look into it in the short term, but open to suggestions or PRs!

@psytrx psytrx closed this as completed Jun 10, 2024
@psytrx psytrx reopened this Jun 10, 2024
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