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
Implements
Inherited Members
Fields
CommonTextureSuffixes
Common texture input names and their corresponding file suffixes.
public static readonly Dictionary<string, string> CommonTextureSuffixesField Value
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
textureTypestring-
The shader texture parameter name (e.g., "g_tColor").
Returns
- string
-
The input texture name (e.g., "TextureColor").
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
textureTypestring-
The type of texture to query.
materialMaterial-
The material containing the texture.
Returns
- IEnumerable<(ChannelMapping Channel, string Name)>
-
A collection of channel mappings and their corresponding input names.
GetSuffixForInputTexture(string, Material)
Gets the file suffix for a given input texture name.
public string GetSuffixForInputTexture(string inputName, Material material)Parameters
inputNamestring-
The name of the input texture.
materialMaterial-
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.