Class VBIB
Namespace: ValveResourceFormat.Blocks
Assembly: ValveResourceFormat.dll
"VBIB" block.
public class VBIB : BlockInheritance
Derived
Inherited Members
Block.Type, Block.Offset, Block.Size, Block.Resource, Block.Read(BinaryReader), Block.ToString(), Block.WriteText(IndentedTextWriter), Block.Serialize(Stream)
Extension Methods
ResourceDataExtensions.AsKeyValueCollection(Block)
Constructors
VBIB()
Initializes a new instance of the class.
public VBIB()VBIB(Resource, KVObject)
Initializes a new instance of the class from a resource and KV data.
public VBIB(Resource resource, KVObject data)Parameters
resource Resource
data KVObject
Properties
IndexBuffers
Gets the list of index buffers.
public List<VBIB.OnDiskBufferData> IndexBuffers { get; }Property Value
Type
Gets the block type.
public override BlockType Type { get; }Property Value
VertexBuffers
Gets the list of vertex buffers.
public List<VBIB.OnDiskBufferData> VertexBuffers { get; }Property Value
Methods
Concatenate(IReadOnlyList<OnDiskBufferData>)
Concatenates vertex buffers into one, in the order given. Every buffer must share the layout of the first, which reports.
public static VBIB.OnDiskBufferData Concatenate(IReadOnlyList<VBIB.OnDiskBufferData> buffers)Parameters
buffers IReadOnlyList<VBIB.OnDiskBufferData>
Returns
GetBlendIndicesArray(OnDiskBufferData, RenderInputLayoutField, int[]?)
Extracts blend indices from a vertex buffer, optionally remapping them using the provided table.
public static ushort[] GetBlendIndicesArray(VBIB.OnDiskBufferData vertexBuffer, VBIB.RenderInputLayoutField attribute, int[]? remapTable = null)Parameters
vertexBuffer VBIB.OnDiskBufferData
attribute VBIB.RenderInputLayoutField
remapTable int[]?
Returns
ushort[]
GetBlendWeightsArray(OnDiskBufferData, RenderInputLayoutField)
Extracts blend weights from a vertex buffer.
public static Vector4[] GetBlendWeightsArray(VBIB.OnDiskBufferData vertexBuffer, VBIB.RenderInputLayoutField attribute)Parameters
vertexBuffer VBIB.OnDiskBufferData
attribute VBIB.RenderInputLayoutField
Returns
Vector4[]
GetFormatInfo(RenderInputLayoutField)
Gets the element size and count for a given render input layout field format.
public static (int ElementSize, int ElementCount) GetFormatInfo(VBIB.RenderInputLayoutField attribute)Parameters
attribute VBIB.RenderInputLayoutField
Returns
(int ElementSize, int ElementCount)
GetFormatInfo(DXGI_FORMAT, string?)
Gets the element size and count for a given vertex attribute format.
public static (int ElementSize, int ElementCount) GetFormatInfo(DXGI_FORMAT format, string? attributeName = null)Parameters
format DXGI_FORMAT
Vertex attribute format.
attributeName string?
Optional attribute name included in the error when the format is unsupported.
Returns
(int ElementSize, int ElementCount)
GetNormalTangentArray(OnDiskBufferData, RenderInputLayoutField)
Extracts normal and tangent data from a vertex buffer. Tangent array will be empty if normals are not compressed.
public static (Vector3[] Normals, Vector4[] Tangents) GetNormalTangentArray(VBIB.OnDiskBufferData vertexBuffer, VBIB.RenderInputLayoutField attribute)Parameters
vertexBuffer VBIB.OnDiskBufferData
attribute VBIB.RenderInputLayoutField
Returns
(Vector3[] Normals, Vector4[] Tangents)
GetScalarAttributeArray(OnDiskBufferData, RenderInputLayoutField)
Extracts scalar (single float) attribute data from a vertex buffer.
public static float[] GetScalarAttributeArray(VBIB.OnDiskBufferData vertexBuffer, VBIB.RenderInputLayoutField attribute)Parameters
vertexBuffer VBIB.OnDiskBufferData
attribute VBIB.RenderInputLayoutField
Returns
float[]
GetVector2AttributeArray(OnDiskBufferData, RenderInputLayoutField)
Extracts 2D vector attribute data from a vertex buffer.
public static Vector2[] GetVector2AttributeArray(VBIB.OnDiskBufferData vertexBuffer, VBIB.RenderInputLayoutField attribute)Parameters
vertexBuffer VBIB.OnDiskBufferData
attribute VBIB.RenderInputLayoutField
Returns
Vector2[]
GetVector3AttributeArray(OnDiskBufferData, RenderInputLayoutField)
Extracts 3D vector attribute data from a vertex buffer.
public static Vector3[] GetVector3AttributeArray(VBIB.OnDiskBufferData vertexBuffer, VBIB.RenderInputLayoutField attribute)Parameters
vertexBuffer VBIB.OnDiskBufferData
attribute VBIB.RenderInputLayoutField
Returns
Vector3[]
GetVector4AttributeArray(OnDiskBufferData, RenderInputLayoutField)
Extracts 4D vector attribute data from a vertex buffer.
public static Vector4[] GetVector4AttributeArray(VBIB.OnDiskBufferData vertexBuffer, VBIB.RenderInputLayoutField attribute)Parameters
vertexBuffer VBIB.OnDiskBufferData
attribute VBIB.RenderInputLayoutField
Returns
Vector4[]
HasSameLayout(OnDiskBufferData, OnDiskBufferData)
Determines whether two vertex buffers hold the same attributes at the same offsets, which is what makes their vertices interchangeable.
public static bool HasSameLayout(VBIB.OnDiskBufferData a, VBIB.OnDiskBufferData b)Parameters
Returns
Read(BinaryReader)
Reads the block data from a binary reader.
public override void Read(BinaryReader reader)Parameters
reader BinaryReader
The binary reader to read from.
Serialize(Stream)
Writes the binary representation of the object to Stream.
public override void Serialize(Stream stream)Parameters
stream Stream
Stream.
WriteText(IndentedTextWriter)
Writes the correct text dump of the object to .
public override void WriteText(IndentedTextWriter writer)Parameters
writer IndentedTextWriter
Remarks
Outputs information about vertex and index buffers including their attributes and formats.

