public sealed class QueriedFieldThe hardware tracer's answers, written first and device-free — doc 19 § L6's referee for RayQueryField.rvn.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
One class answering exactly what the shader answers, the arrangement every dispatch comparison here leans on: where the kernel opens a ray query against the two-level structure, this asks the TriangleBvh built from the same triangles — the traversal already held hit-for-hit against brute force — so a device disagreement is the device's, not the fixture's.
An acceleration structure holds surfaces, not distances, and the honest answers follow from that. The trace and the shadow are queries and exact. The point questions are not askable: SampleField answers "nothing is near" — the same Nothing NoDistanceField answers, a step any march may safely take — and GradientField answers the up vector, which is NoDistanceField's answer too. A hit's true surface normal is the committed triangle's, reachable from the primitive index the query already returns plus the very vertex buffer the structure was built from; that read is owed, named in the package README, and this class is where its reference will land.
Fields and properties (1)
public const float NothingWhat the point questions answer — further than any march goes, by value the library's NoDistanceField.Nothing.
Methods (6)
public QueriedField(TriangleBvh bvh)Wraps the hierarchy the queries walk.
public static float SampleField(Vector3 world)The signed distance at a world position — "nothing is near", always.
public static Vector3 GradientField(Vector3 world)The distance gradient at a world position — the up vector, always.
public QueriedHit TraceField(Vector3 origin, Vector3 direction, float maxDistance)The trace, answered with a query: the nearest triangle within the budget.
public float ShadowField(Vector3 origin, Vector3 toLight, float lightDistance, float bias)How much of a light reaches a point: one or zero, from one query.
public static float OcclusionField(Vector3 position, Vector3 normal)How enclosed a point is — fully open, always: enclosure is a distance question.
Used by (2)
- AccelerationStructureDeviceTestsVixen.Graphics.Golden.Tests
- QueriedFieldTestsVixen.Rendering.RayTracing.Tests