VertexElementFormat Enumeration

Defines vertex element formats.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Syntax

public enum VertexElementFormat

Members

  Member name Description
Single Single-component, 32-bit floating-point, expanded to (float, 0, 0, 1).
Vector2 Two-component, 32-bit floating-point, expanded to (float, Float32 value, 0, 1).
Vector3 Three-component, 32-bit floating point, expanded to (float, float, float, 1).
Vector4 Four-component, 32-bit floating point, expanded to (float, float, float, float).
HalfVector2 Two-component, 16-bit floating point expanded to (value, value, value, value). This type is valid for vertex shader version 2.0 or higher.
HalfVector4 Four-component, 16-bit floating-point expanded to (value, value, value, value). This type is valid for vertex shader version 2.0 or higher.
Color Four-component, packed, unsigned byte, mapped to 0 to 1 range. Input is in Int32 format (ARGB) expanded to (R, G, B, A).
NormalizedShort2 Normalized, two-component, signed short, expanded to (first short/32767.0, second short/32767.0, 0, 1). This type is valid for vertex shader version 2.0 or higher.
NormalizedShort4 Normalized, four-component, signed short, expanded to (first short/32767.0, second short/32767.0, third short/32767.0, fourth short/32767.0). This type is valid for vertex shader version 2.0 or higher.
Short2 Two-component, signed short expanded to (value, value, 0, 1).
Short4 Four-component, signed short expanded to (value, value, value, value).
Byte4 Four-component, unsigned byte.

Remarks

A mapping of each Direct3D 9 format name to the VertexElementFormat equivalent is listed in the following table.

  Direct3D 9 Vertex Format VertexElementFormat equivalent
Floating Point
Float32 D3DDECLTYPE_FLOAT1 Single
D3DDECLTYPE_FLOAT2 Vector2
D3DDECLTYPE_FLOAT3 Vector3
D3DDECLTYPE_FLOAT4 Vector4
Float16 D3DDECLTYPE_FLOAT16_2 HalfVector2
D3DDECLTYPE_FLOAT16_4 HalfVector4
Unsigned Normalized
64 bpp D3DDECLTYPE_USHORT4N Rgba64
32 bpp D3DDECLTYPE_D3DCOLOR Color
D3DDECLTYPE_UBYTE4N Rgba32
D3DDECLTYPE_USHORT2N Rg32
Signed Normalized
  D3DDECLTYPE_SHORT2N NormalizedShort2
D3DDECLTYPE_SHORT4N NormalizedShort4
D3DDECLTYPE_DEC3N Normalized101010
Signed Integer
  D3DDECLTYPE_SHORT2 Short2
D3DDECLTYPE_SHORT4 Short4
Unsigned Integer
  D3DDECLTYPE_UBYTE4 Byte4
D3DDECLTYPE_UDEC3 UInt101010

See Also

Reference

VertexElement.VertexElementFormat Property
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Xbox 360, Windows 7, Windows Vista, Windows XP