Vixen
02b45cc4
csharp
public static class SurfaceGeometry

Turning a MeshData into the vertices a GeometryBuffer holds.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The one place that goes from the shape a compiler produces — parallel arrays, some of them empty — to the interleaved SurfaceVertex the shading stages read. It is a pure function of the mesh, which is what lets every question about it be a test with no device in it.

⚠ A missing attribute is filled in rather than refused, and each one is filled in differently because each absence means something different. An empty array says the file did not have it — see MeshData on why that is not the same as an array of zeros — and a mesh with no tangents is the ordinary case rather than a broken one: MeshPrimitives produces none at all.

Methods (5)

  • public static int VertexCount(MeshData mesh)

    How many vertices packing a mesh produces.

  • public static void Pack(MeshData mesh, Span<SurfaceVertex> into)

    Writes a mesh's vertices into a span, interleaved.

  • public static SurfaceVertex[] Packed(MeshData mesh)

    A mesh's vertices, allocated.

  • public static Vector4 Perpendicular(Vector3 normal)

    Some unit vector at right angles to a unit vector, with a handedness of +1.

  • public static BoundingSphere BoundsOf(MeshData mesh)

    A mesh's bounding sphere, in its own space.

Used by (2)

  • GeometryResidencyVixen.Rendering
  • SurfaceGeometryTestsVixen.Rendering.Tests