VertexElement Struct
Namespace: Stride.GraphicsAssembly: Stride.Graphics.dll
A description of a single element for the input-assembler stage. This structure is related to
[DataContract]
[DataSerializer(typeof(VertexElement.Serializer))]
public struct VertexElement : IEquatable<VertexElement>
Remarks
Because
Name | Description | |
---|---|---|
Constructors | ||
VertexElement(String, PixelFormat) | Initializes a new instance of the VertexElement struct. |
|
VertexElement(String, Int32, PixelFormat, Int32) | Initializes a new instance of the VertexElement struct. |
|
Fields | ||
AppendAligned | Returns a value that can be used for the offset parameter of an InputElement to indicate that the element should be aligned directly after the previous element, including any packing if neccessary. |
|
Properties | ||
AlignedByteOffset | Optional. Offset (in bytes) between each element. Use D3D11_APPEND_ALIGNED_ELEMENT for convenience to define the current element directly after the previous one, including any packing if necessary. |
|
Format | The data type of the element data. See SharpDX.DXGI.Format. |
|
SemanticAsText | The HLSL semantic associated with this element in a shader input-signature. |
|
SemanticIndex | The semantic index for the element. A semantic index modifies a semantic, with an integer index number. A semantic index is only needed in a case where there is more than one element with the same semantic. For example, a 4x4 matrix would have four components each with the semantic name
, however each of the four component would have different semantic indices (0, 1, 2, and 3). |
|
SemanticName | The HLSL semantic associated with this element in a shader input-signature. |
|
Methods | ||
BiTangent(PixelFormat, Int32) | Declares a VertexElement with the semantic "BITANGENT". |
|
BiTangent(Int32, PixelFormat, Int32) | Declares a VertexElement with the semantic "BITANGENT". |
|
BiTangent<T>(Int32, Int32) | Declares a VertexElement with the semantic "BITANGENT". |
|
Color(PixelFormat, Int32) | Declares a VertexElement with the semantic "COLOR". |
|
Color(Int32, PixelFormat, Int32) | Declares a VertexElement with the semantic "COLOR". |
|
Color<T>(Int32, Int32) | Declares a VertexElement with the semantic "COLOR". |
|
ConvertTypeToFormat<T>() | ||
Equals(VertexElement) | ||
Equals(Object) | ||
GetHashCode() | ||
Normal(PixelFormat, Int32) | Declares a VertexElement with the semantic "NORMAL". |
|
Normal(Int32, PixelFormat, Int32) | Declares a VertexElement with the semantic "NORMAL". |
|
Normal<T>(Int32, Int32) | Declares a VertexElement with the semantic "NORMAL". |
|
Position(PixelFormat, Int32) | Declares a VertexElement with the semantic "POSITION". |
|
Position(Int32, PixelFormat, Int32) | Declares a VertexElement with the semantic "POSITION". |
|
Position<T>(Int32, Int32) | Declares a VertexElement with the semantic "POSITION". |
|
PositionTransformed(PixelFormat, Int32) | Declares a VertexElement with the semantic "SV_POSITION". |
|
PositionTransformed(Int32, PixelFormat, Int32) | Declares a VertexElement with the semantic "SV_POSITION". |
|
PositionTransformed<T>(Int32, Int32) | Declares a VertexElement with the semantic "SV_POSITION". |
|
Tangent(PixelFormat, Int32) | Declares a VertexElement with the semantic "TANGENT". |
|
Tangent(Int32, PixelFormat, Int32) | Declares a VertexElement with the semantic "TANGENT". |
|
Tangent<T>(Int32, Int32) | Declares a VertexElement with the semantic "TANGENT". |
|
TextureCoordinate(PixelFormat, Int32) | Declares a VertexElement with the semantic "TEXCOORD". |
|
TextureCoordinate(Int32, PixelFormat, Int32) | Declares a VertexElement with the semantic "TEXCOORD". |
|
TextureCoordinate<T>(Int32, Int32) | Declares a VertexElement with the semantic "TEXCOORD". |
|
ToString() | ||
Operators | ||
Equality(VertexElement, VertexElement) | ||
Inequality(VertexElement, VertexElement) |
Constructors
VertexElement(String, PixelFormat)
Initializes a new instance of the VertexElement struct.
public VertexElement(string semanticName, PixelFormat format)
Parameters
Type | Name | Description |
---|---|---|
System.String | semanticName | Name of the semantic. |
PixelFormat | format | The format. |
Remarks
If the semantic name contains a postfix number, this number will be used as a semantic index.
VertexElement(String, Int32, PixelFormat, Int32)
Initializes a new instance of the VertexElement struct.
public VertexElement(string semanticName, int semanticIndex, PixelFormat format, int alignedByteOffset = -1)
Parameters
Type | Name | Description |
---|---|---|
System.String | semanticName | Name of the semantic. |
System.Int32 | semanticIndex | Index of the semantic. |
PixelFormat | format | The format. |
System.Int32 | alignedByteOffset | The aligned byte offset. |
Fields
AppendAligned
Returns a value that can be used for the offset parameter of an InputElement to indicate that the element should be aligned directly after the previous element, including any packing if neccessary.
public const int AppendAligned = -1
Field Value
Type | Description |
---|---|
System.Int32 | A value used to align input elements. |
Properties
AlignedByteOffset
Optional. Offset (in bytes) between each element. Use D3D11_APPEND_ALIGNED_ELEMENT for convenience to define the current element directly after the previous one, including any packing if necessary.
public readonly int AlignedByteOffset { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Format
The data type of the element data. See SharpDX.DXGI.Format.
public readonly PixelFormat Format { get; }
Property Value
Type | Description |
---|---|
PixelFormat |
SemanticAsText
The HLSL semantic associated with this element in a shader input-signature.
public readonly string SemanticAsText { get; }
Property Value
Type | Description |
---|---|
System.String |
SemanticIndex
The semantic index for the element. A semantic index modifies a semantic, with an integer index number. A semantic index is only needed in a case where there is more than one element with the same semantic. For example, a 4x4 matrix would have four components each with the semantic name
matrix
, however each of the four component would have different semantic indices (0, 1, 2, and 3).
public readonly int SemanticIndex { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
SemanticName
The HLSL semantic associated with this element in a shader input-signature.
public readonly string SemanticName { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
BiTangent(PixelFormat, Int32)
Declares a VertexElement with the semantic "BITANGENT".
public static VertexElement BiTangent(PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
BiTangent(Int32, PixelFormat, Int32)
Declares a VertexElement with the semantic "BITANGENT".
public static VertexElement BiTangent(int semanticIndex, PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
BiTangent<T>(Int32, Int32)
Declares a VertexElement with the semantic "BITANGENT".
public static VertexElement BiTangent<T>(int semanticIndex = 0, int offsetInBytes = -1)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Type Parameters
Name | Description |
---|---|
T | Type of the BiTangent semantic. |
Color(PixelFormat, Int32)
Declares a VertexElement with the semantic "COLOR".
public static VertexElement Color(PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Color(Int32, PixelFormat, Int32)
Declares a VertexElement with the semantic "COLOR".
public static VertexElement Color(int semanticIndex, PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Color<T>(Int32, Int32)
Declares a VertexElement with the semantic "COLOR".
public static VertexElement Color<T>(int semanticIndex = 0, int offsetInBytes = -1)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Type Parameters
Name | Description |
---|---|
T | Type of the Color semantic. |
ConvertTypeToFormat<T>()
public static PixelFormat ConvertTypeToFormat<T>()
where T : struct
Returns
Type | Description |
---|---|
PixelFormat |
Type Parameters
Name | Description |
---|---|
T |
Equals(VertexElement)
public bool Equals(VertexElement other)
Parameters
Type | Name | Description |
---|---|---|
VertexElement | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
Normal(PixelFormat, Int32)
Declares a VertexElement with the semantic "NORMAL".
public static VertexElement Normal(PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Normal(Int32, PixelFormat, Int32)
Declares a VertexElement with the semantic "NORMAL".
public static VertexElement Normal(int semanticIndex, PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Normal<T>(Int32, Int32)
Declares a VertexElement with the semantic "NORMAL".
public static VertexElement Normal<T>(int semanticIndex = 0, int offsetInBytes = -1)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Type Parameters
Name | Description |
---|---|
T | Type of the Normal semantic. |
Position(PixelFormat, Int32)
Declares a VertexElement with the semantic "POSITION".
public static VertexElement Position(PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Position(Int32, PixelFormat, Int32)
Declares a VertexElement with the semantic "POSITION".
public static VertexElement Position(int semanticIndex, PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Position<T>(Int32, Int32)
Declares a VertexElement with the semantic "POSITION".
public static VertexElement Position<T>(int semanticIndex = 0, int offsetInBytes = -1)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Type Parameters
Name | Description |
---|---|
T | Type of the Position semantic. |
PositionTransformed(PixelFormat, Int32)
Declares a VertexElement with the semantic "SV_POSITION".
public static VertexElement PositionTransformed(PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
PositionTransformed(Int32, PixelFormat, Int32)
Declares a VertexElement with the semantic "SV_POSITION".
public static VertexElement PositionTransformed(int semanticIndex, PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
PositionTransformed<T>(Int32, Int32)
Declares a VertexElement with the semantic "SV_POSITION".
public static VertexElement PositionTransformed<T>(int semanticIndex = 0, int offsetInBytes = -1)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Type Parameters
Name | Description |
---|---|
T | Type of the PositionTransformed semantic. |
Tangent(PixelFormat, Int32)
Declares a VertexElement with the semantic "TANGENT".
public static VertexElement Tangent(PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Tangent(Int32, PixelFormat, Int32)
Declares a VertexElement with the semantic "TANGENT".
public static VertexElement Tangent(int semanticIndex, PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Tangent<T>(Int32, Int32)
Declares a VertexElement with the semantic "TANGENT".
public static VertexElement Tangent<T>(int semanticIndex = 0, int offsetInBytes = -1)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Type Parameters
Name | Description |
---|---|
T | Type of the Tangent semantic. |
TextureCoordinate(PixelFormat, Int32)
Declares a VertexElement with the semantic "TEXCOORD".
public static VertexElement TextureCoordinate(PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
TextureCoordinate(Int32, PixelFormat, Int32)
Declares a VertexElement with the semantic "TEXCOORD".
public static VertexElement TextureCoordinate(int semanticIndex, PixelFormat format, int offsetInBytes = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
PixelFormat | format | Format of this element. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
TextureCoordinate<T>(Int32, Int32)
Declares a VertexElement with the semantic "TEXCOORD".
public static VertexElement TextureCoordinate<T>(int semanticIndex = 0, int offsetInBytes = -1)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | semanticIndex | The semantic index. |
System.Int32 | offsetInBytes | The offset in bytes of this element. Use AppendAligned to compute automatically the offset from previous elements. |
Returns
Type | Description |
---|---|
VertexElement | A new instance of VertexElement that represents this semantic. |
Type Parameters
Name | Description |
---|---|
T | Type of the TextureCoordinate semantic. |
ToString()
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
Operators
Equality(VertexElement, VertexElement)
public static bool operator ==(VertexElement left, VertexElement right)
Parameters
Type | Name | Description |
---|---|---|
VertexElement | left | |
VertexElement | right |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(VertexElement, VertexElement)
public static bool operator !=(VertexElement left, VertexElement right)
Parameters
Type | Name | Description |
---|---|---|
VertexElement | left | |
VertexElement | right |
Returns
Type | Description |
---|---|
System.Boolean |