VertexFormat
Description
- Derived from
-
VertexFormatBase abstract
Default implementation of the IVertexFormat interface.
Public / Constructors
Build
Returns a builder that can be used to construct a IVertexFormat from a sequence of IVertexComponents.
- See also
-
VertexFormat.Color
VertexFormat.Coordinates
VertexFormat.Float
VertexFormat.FloatDelta
VertexFormat.HeightmapCoordinates
VertexFormat.HeightmapCoordinatesHigh
VertexFormat.HeightmapCoordinatesLow
VertexFormat.Material
VertexFormat.MaterialId
VertexFormat.MaterialWeight
VertexFormat.Placeholder
Color
Returns a IVertexComponent for a single vertex element that reads color values from the vertex array of the given semantic in, converts them to linear sRGB color values and passes them to IVertexElementWriterBase.WriteVertexElementFloat.
Color value are read from the given vertex array (see semantic in) using either:
-
IVertexArray.GetL, if tuple type is TupleType.Long.
Color tuples are expected to be in linear sRGB color space (see Colors). -
IVertexArray.GetI, otherwise.
Color tuples are expected to be in compressed sRGB color space (see Colors.Decode_A8R8G8B8).
The linear sRGB color values in the range [0..1] are passed to the vertex writer in the following order: red as x
, green as y
, blue as z
. The linear alpha value is passed to w
.
Coordinates
Returns a IVertexComponent for a single vertex element that reads unsigned integer coordinates of type TupleType.Int from the vertex array of the given semantic in, applies a coordinate precision fix plus normalization and passes the resulting values to IVertexElementWriterBase.WriteVertexElementFloat.
Coordinate values are read from the vertex array using the IVertexArray.GetI method, clamped to the range [0..maximum], combined with the given mask in using bitwise AND
and normalized to [0..1] by dividing them by maximum in. The resulting values are passed to IVertexElementWriterBase.WriteVertexElementFloat
Float
Returns a IVertexComponent for a single vertex element which reads TupleType.Float values from the vertex array of the given semantic in and passes them to IVertexElementWriterBase.WriteVertexElementFloat.
FloatDelta
Returns a IVertexComponent for a single vertex element which reads TupleType.Double values from the vertex array of the given semantic in, computes the float-deltas and passes them to IVertexElementWriterBase.WriteVertexElementFloat.
The float-delta of a TupleType.Double value is defined as follows:
delta = (float) (value - (float) value)
HeightmapCoordinates
Convenience method that calls Coordinates.
Semantic: Semantic.HeightmapCoords
Maximum: HeightmapsUtil.MaxCoord
Bitmask: ~0
.
HeightmapCoordinatesHigh
Convenience method that calls Coordinates.
Semantic: Semantic.HeightmapCoords
Maximum: HeightmapsUtil.MaxCoord
Bitmask: ~0x7FFF
.
- See also
HeightmapCoordinatesLow
Convenience method that calls Coordinates.
Semantic: Semantic.HeightmapCoords
Maximum: HeightmapsUtil.MaxCoord
Bitmask: 0x7FFF
.
Material
Returns a IVertexComponent for a single vertex element that reads material tokens from the Semantic.Material vertex array and passes the material weights for the given materials (see MaterialToken.WeightFor) to IVertexElementWriterBase.WriteVertexElementInt.
- See also
MaterialId
Returns a IVertexComponent for a single vertex element that reads material tokens from the Semantic.Material vertex array and passes the material IDs (see MaterialToken.MaterialAt) to IVertexElementWriterBase.WriteVertexElementInt.
- See also
MaterialWeight
Returns a IVertexComponent for a single vertex element that reads material tokens from the Semantic.Material vertex array and passes the material weights (see MaterialToken.WeightAt) to IVertexElementWriterBase.WriteVertexElementInt.
- See also