VertexBuffer struct updated
This commit is contained in:
parent
9d3a77912a
commit
2f1929b659
1 changed files with 15 additions and 2 deletions
|
|
@ -61,6 +61,11 @@ public unsafe partial struct VertexBuffer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public float* TexCoords;
|
public float* TexCoords;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Vertex normal (XYZ - 3 components per vertex) (shader-location = 2)
|
||||||
|
/// </summary>
|
||||||
|
public float* Normals;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
|
/// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -79,9 +84,9 @@ public unsafe partial struct VertexBuffer
|
||||||
public uint VaoId;
|
public uint VaoId;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// OpenGL Vertex Buffer Objects id (4 types of vertex data)
|
/// OpenGL Vertex Buffer Objects id (5 types of vertex data)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public fixed uint VboId[4];
|
public fixed uint VboId[5];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Access <see cref="Vertices"/>
|
/// Access <see cref="Vertices"/>
|
||||||
|
|
@ -99,6 +104,14 @@ public unsafe partial struct VertexBuffer
|
||||||
return new(TexCoords, ElementCount * sizeof(float) / sizeof(T));
|
return new(TexCoords, ElementCount * sizeof(float) / sizeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Access <see cref="Normals"/>
|
||||||
|
/// </summary>
|
||||||
|
public readonly Span<T> NormalsAs<T>() where T : unmanaged
|
||||||
|
{
|
||||||
|
return new(Normals, ElementCount * sizeof(float) / sizeof(T));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Access <see cref="Colors"/>
|
/// Access <see cref="Colors"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue