Skip to content

Class MeshProcessing

Namespace: Apogee.Content
Assembly: Apogee.Content.dll

Mesh clean-up and the vertex attributes glTF lets a file leave out.

public static class MeshProcessing

Inheritance

object ← MeshProcessing

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods

GenerateTangents(Vertex[], uint[])

Computes tangents from the UVs, as a normal map needs when the file has none: per-triangle tangents are summed per vertex, made perpendicular to the normal, and given the handedness of the UV mapping.

public static void GenerateTangents(Vertex[] vertices, uint[] indices)

Parameters

vertices Vertex[]

indices uint[]

Optimize(Vertex[], uint[])

Merges identical vertices and reorders both buffers for the GPU's vertex cache and memory fetch. Keeps exactly the same triangles.

public static (Vertex[] Vertices, uint[] Indices) Optimize(Vertex[] vertices, uint[] indices)

Parameters

vertices Vertex[]

indices uint[]

Returns

(Vertex[] Vertices, uint[] Indices)

WithFlatNormals(Vertex[], uint[])

Gives each triangle its own three vertices with the face normal: what glTF says a mesh without normals looks like. Positions, UVs and tangents are copied along.

public static (Vertex[] Vertices, uint[] Indices) WithFlatNormals(Vertex[] vertices, uint[] indices)

Parameters

vertices Vertex[]

indices uint[]

Returns

(Vertex[] Vertices, uint[] Indices)