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

Example for tracing ray packets #356

Closed
AntMaster7 opened this issue Jan 2, 2022 · 2 comments
Closed

Example for tracing ray packets #356

AntMaster7 opened this issue Jan 2, 2022 · 2 comments

Comments

@AntMaster7
Copy link

AntMaster7 commented Jan 2, 2022

The documentation at Ray Queries says

See tutorial Triangle Geometry for a complete example of how to trace single rays and ray packets.

Unfortunately, the Triangle Geometry example does not contain an example of how to query ray packets, nor any other tutorial (at least I didn't find one). Can someone provide me with a simple example of to do a query with ray packets?

Not actually part of the issue, but are they even beneficial for non coherent rays?

@svenwoop
Copy link
Contributor

svenwoop commented Jan 3, 2022

Indeed the triangle geometry tutorial has an ISPC version, which essentially uses ray packets. To use ray packets you just setup the RTCRayHit4 structure and use rtcIntersect4. An example of how to setup these structures is in tutorials/verify/rtcore_helpers.h (look for rtcIntersect4 call). The input buffers have to be properly aligned (e.g. 16 byte alignment for rtcIntersect4 call).

You will only get a benefit for coherent rays (e.g. primary rays). Do not expect a performance benefit for incoherent rays when using ray packets.

@AntMaster7
Copy link
Author

Thank you so much!

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