Class Material
Namespace: ValveResourceFormat.ResourceTypes
Assembly: ValveResourceFormat.dll
Represents a material resource containing shader parameters and texture references.
public class Material : KeyValuesOrNTROInheritance
object ← Block ← KeyValuesOrNTRO ← Material
Inherited Members
KeyValuesOrNTRO.Type, KeyValuesOrNTRO.Data, KeyValuesOrNTRO.Read(BinaryReader), KeyValuesOrNTRO.Serialize(Stream), KeyValuesOrNTRO.WriteText(IndentedTextWriter), Block.Type, Block.Offset, Block.Size, Block.Resource, Block.Read(BinaryReader), Block.ToString(), Block.WriteText(IndentedTextWriter), Block.Serialize(Stream)
Extension Methods
ResourceDataExtensions.AsKeyValueCollection(Block)
Properties
DynamicExpressions
Gets the evaluated dynamic expressions for dynamic scalar and texture parameters.
public Dictionary<string, string> DynamicExpressions { get; }Property Value
FloatAttributes
Gets the floating-point material attributes.
public Dictionary<string, float> FloatAttributes { get; }Property Value
FloatParams
Gets the floating-point shader parameters.
public Dictionary<string, float> FloatParams { get; }Property Value
InputSignature
Gets the vertex shader input signature defining vertex attributes.
public Material.VsInputSignature InputSignature { get; }Property Value
IntAttributes
Gets the integer material attributes.
public Dictionary<string, long> IntAttributes { get; }Property Value
IntParams
Gets the integer shader parameters.
public Dictionary<string, long> IntParams { get; }Property Value
Name
Gets or sets the material name.
public string Name { get; set; }Property Value
ShaderName
Gets or sets the shader name used by this material.
public string ShaderName { get; set; }Property Value
StringAttributes
Gets the string material attributes.
public Dictionary<string, string> StringAttributes { get; }Property Value
TextureParams
Gets the texture shader parameters.
public Dictionary<string, string> TextureParams { get; }Property Value
VectorAttributes
Gets the vector material attributes.
public Dictionary<string, Vector4> VectorAttributes { get; }Property Value
VectorParams
Gets the vector shader parameters.
public Dictionary<string, Vector4> VectorParams { get; }Property Value
Methods
FindD3DInputSignatureElement(VsInputSignature, string, int)
Finds an input signature element by Direct3D semantic name and index.
public static Material.InputSignatureElement FindD3DInputSignatureElement(Material.VsInputSignature insg, string d3dName, int d3dIndex)Parameters
insg Material.VsInputSignature
The input signature to search.
d3dName string
The Direct3D semantic name.
d3dIndex int
The Direct3D semantic index.
Returns
Material.InputSignatureElement
The matching element, or default if not found.
GetShaderArguments()
Gets the shader arguments from integer parameters starting with "F_".
public Dictionary<string, byte> GetShaderArguments()Returns
Dictionary of shader argument names and values.
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.

