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 documentation for the raytracing API #6747

Open
wants to merge 9 commits into
base: trunk
Choose a base branch
from
17 changes: 15 additions & 2 deletions etc/ray_tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ intersection.

*The API to commit a candidate intersection is not yet implemented but would be possible to be user implemented.

Undefined behavior*:
- Calling `rayQueryGetCommittedIntersection` or `rayQueryGetCandidateIntersection` when `rayQueryProceed` has not been
called on this ray query since it was initialized (or if the ray query has not been previously initialized).
- Calling `rayQueryGetCommittedIntersection` when `rayQueryProceed`'s latest return on this ray query is considered
`Candidate`.
- Calling `rayQueryGetCandidateIntersection` when `rayQueryProceed`'s latest return on this ray query is considered
`Committed`.
- Calling `rayQueryProceed` when `rayQueryInitialize` has not previously been called on this ray query

*this is only known undefined behaviour.
Vecvec marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section deliberately does not mention undefined behavior from #6752


Structure definitions:
````wgsl
struct RayDesc {
Expand Down Expand Up @@ -104,8 +115,10 @@ struct RayIntersection {
then this is the triangle index)
- `barycentrics`: two of the barycentric coordinates, the third can be calculated (only useful if this is a triangle).
- `front_face`: whether the hit face is the front (only useful if this is a triangle).
- `object_to_world`: matrix for converting from object-space to world-space
- `world_to_object`: matrix for converting from world-space to object-space
- `object_to_world`: matrix for converting from object-space to world-space*
- `world_to_object`: matrix for converting from world-space to object-space*

*These matrices need to be transposed currently otherwise they will not work properly.

Constant definitions:

Expand Down
Loading