Table of Contents

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 : IShaderDataProvider

Inheritance

Implements

Inherited Members

Fields

CommonTextureSuffixes

Common texture input names and their corresponding file suffixes.

public static readonly Dictionary<string, string> CommonTextureSuffixes

Field Value

Dictionary<string, string>

TextureMappings

Hardcoded texture channel mappings for known shader types.

public static readonly Dictionary<string, Dictionary<string, (ChannelMapping Channel, string Name)[]>> TextureMappings

Field 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").

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.

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.