Class BasicShaderDataProvider
Namespace: ValveResourceFormat.IO
Assembly: ValveResourceFormat.dll
Provides hardcoded shader data mappings for common shaders as a fallback when shader files are unavailable.
public class BasicShaderDataProvider : IShaderDataProviderInheritance
object ← BasicShaderDataProvider
Implements
Fields
CommonTextureSuffixes
Common texture input names and their corresponding file suffixes.
public static readonly Dictionary<string, string> CommonTextureSuffixesField Value
Dictionary<string, string>
TextureMappings
Hardcoded texture channel mappings for known shader types.
public static readonly Dictionary<string, Dictionary<string, (ChannelMapping Channel, string Name)[]>> TextureMappingsField Value
Dictionary<string, Dictionary<string, (ChannelMapping Channel, string Name)[]>>
Methods
ConvertTextureToInput(string)
Converts a shader texture parameter name to an input texture name.
public static string ConvertTextureToInput(string textureType)Parameters
textureType string
The shader texture parameter name (e.g., "g_tColor").
Returns
string
The input texture name (e.g., "TextureColor").
GetBlendState(Material, IReadOnlyDictionary<string, long>?)
Gets the blend state of a material for the default dynamic combo.
public RsBlendStateDesc GetBlendState(Material material, IReadOnlyDictionary<string, long>? combos = null)Parameters
material Material
The material.
combos IReadOnlyDictionary<string, long>?
Integer parameters overriding those of the material, as F_ features or S_ and D_ combos.
Returns
Remarks
Guesses the blend state from material flags and a few known shaders.
GetInputsForTexture(string, Material)
Gets hardcoded texture inputs. If no mappings are found it will be a single guessed RGBA input.
public IEnumerable<(ChannelMapping Channel, string Name)> GetInputsForTexture(string textureType, Material material)Parameters
textureType string
The type of texture to query.
material Material
The material containing the texture.
Returns
IEnumerable<(ChannelMapping Channel, string Name)>
A collection of channel mappings and their corresponding input names.
GetIntAttributes(Material, IReadOnlyDictionary<string, long>?)
Gets the integer attributes of a material combined with those of its shader, the material taking precedence.
public IReadOnlyDictionary<string, long> GetIntAttributes(Material material, IReadOnlyDictionary<string, long>? combos = null)Parameters
material Material
The material.
combos IReadOnlyDictionary<string, long>?
Overrides for the integer parameters of the material.
Returns
IReadOnlyDictionary<string, long>
Remarks
Adds the attributes that material flags and a few known shaders would compile to.
GetSuffixForInputTexture(string, Material)
Gets the file suffix for a given input texture name.
public string? GetSuffixForInputTexture(string inputName, Material material)Parameters
inputName string
The name of the input texture.
material Material
The material containing the texture.
Returns
string?
The suffix string for the input texture, or null if not found.
Remarks
Provides a filename suffix based on common texture type conventions.

