mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-01-10 09:58:22 -05:00
Support getting hit vertex positions (#7183)
This commit is contained in:
@@ -50,6 +50,8 @@ Naming is mostly taken from vulkan.
|
||||
```wgsl
|
||||
// - Initializes the `ray_query` to check where (if anywhere) the ray defined by `ray_desc` hits in `acceleration_structure
|
||||
rayQueryInitialize(rq: ptr<function, ray_query>, acceleration_structure: acceleration_structure, ray_desc: RayDesc)
|
||||
// Overload.
|
||||
rayQueryInitialize(rq: ptr<function, ray_query<vertex_return>>, acceleration_structure: acceleration_structure<vertex_return>, ray_desc: RayDesc)
|
||||
|
||||
// - Traces the ray in the initialized ray_query (partially) through the scene.
|
||||
// - Returns true if a triangle that was hit by the ray was in a `Blas` that is not marked as opaque.
|
||||
@@ -63,6 +65,8 @@ rayQueryInitialize(rq: ptr<function, ray_query>, acceleration_structure: acceler
|
||||
// - Calling this function multiple times will cause the ray traversal to continue if it was interrupted by a `Candidate`
|
||||
// intersection.
|
||||
rayQueryProceed(rq: ptr<function, ray_query>) -> bool
|
||||
// Overload.
|
||||
rayQueryProceed(rq: ptr<function, ray_query<vertex_return>>) -> bool
|
||||
|
||||
// - Generates a hit from procedural geometry at a particular distance.
|
||||
rayQueryGenerateIntersection(hit_t: f32)
|
||||
@@ -75,9 +79,19 @@ rayQueryTerminate()
|
||||
|
||||
// - Returns intersection details about a hit considered `Committed`.
|
||||
rayQueryGetCommittedIntersection(rq: ptr<function, ray_query>) -> RayIntersection
|
||||
// Overload.
|
||||
rayQueryGetCommittedIntersection(rq: ptr<function, ray_query<vertex_return>>) -> RayIntersection
|
||||
|
||||
// - Returns intersection details about a hit considered `Candidate`.
|
||||
rayQueryGetCandidateIntersection(rq: ptr<function, ray_query>) -> RayIntersection
|
||||
// Overload.
|
||||
rayQueryGetCandidateIntersection(rq: ptr<function, ray_query<vertex_return>>) -> RayIntersection
|
||||
|
||||
// - Returns the vertices of the hit triangle considered `Committed`.
|
||||
getCommittedHitVertexPositions(rq: ptr<function, ray_query<vertex_return>>) -> array<vec3<f32>, 3>
|
||||
|
||||
// - Returns the vertices of the hit triangle considered `Candidate`.
|
||||
getCandidateHitVertexPositions(rq: ptr<function, ray_query<vertex_return>>) -> array<vec3<f32>, 3>
|
||||
```
|
||||
|
||||
> [!CAUTION]
|
||||
@@ -89,6 +103,11 @@ rayQueryGetCandidateIntersection(rq: ptr<function, ray_query>) -> RayIntersectio
|
||||
> `Candidate`.
|
||||
> - Calling `rayQueryGetCandidateIntersection` when `rayQueryProceed`'s latest return on this ray query is considered
|
||||
> `Committed`.
|
||||
> - Calling `getCommittedHitVertexPositions` when `rayQueryProceed`'s latest return on this ray query is considered
|
||||
> `Candidate`.
|
||||
> - Calling `getCandidateHitVertexPositions` when `rayQueryProceed`'s latest return on this ray query is considered
|
||||
> `Committed`.
|
||||
> - Calling `get*HitVertexPositions` when the last `rayQueryProceed` did not hit a triangle
|
||||
> - Calling `rayQueryProceed` when `rayQueryInitialize` has not previously been called on this ray query
|
||||
> - Calling `rayQueryGenerateIntersection` on a query with last intersection kind not being
|
||||
> `RAY_QUERY_INTERSECTION_AABB`,
|
||||
|
||||
Reference in New Issue
Block a user