Table of Contents

Class MaterialLoader

Namespace
ValveResourceFormat.Renderer
Assembly
Renderer.dll

Loads and caches materials and textures from Source 2 resources.

public class MaterialLoader

Inheritance

Inherited Members

Constructors

MaterialLoader(RendererContext)

public MaterialLoader(RendererContext rendererContext)

Parameters

rendererContext RendererContext

Fields

ReservedTextures

public static readonly HashSet<string> ReservedTextures

Field Value

HashSet<string>

Properties

MaterialCount

public int MaterialCount { get; }

Property Value

int

MaxTextureMaxAnisotropy

public static float MaxTextureMaxAnisotropy { get; set; }

Property Value

float

Methods

GetDefaultMask()

public RenderTexture GetDefaultMask()

Returns

RenderTexture

GetDefaultNormal()

public RenderTexture GetDefaultNormal()

Returns

RenderTexture

GetErrorTexture()

public RenderTexture GetErrorTexture()

Returns

RenderTexture

GetImageExportFormat(bool)

public static (SizedInternalFormat SizedInternalFormat, PixelFormat PixelFormat, PixelType PixelType) GetImageExportFormat(bool hdr)

Parameters

hdr bool

Returns

(SizedInternalFormat SizedInternalFormat, PixelFormat PixelFormat, PixelType PixelType)

GetMaterial(string?, Dictionary<string, byte>?)

public RenderMaterial GetMaterial(string? name, Dictionary<string, byte>? shaderArguments)

Parameters

name string?
shaderArguments Dictionary<string, byte>?

Returns

RenderMaterial

GetTexture(string, bool, bool)

public RenderTexture GetTexture(string name, bool srgbRead = false, bool anisotropicFiltering = false)

Parameters

name string
srgbRead bool
anisotropicFiltering bool

Returns

RenderTexture

LoadBitmapTexture(SKBitmap)

public static RenderTexture LoadBitmapTexture(SKBitmap bitmap)

Parameters

bitmap SKBitmap

Returns

RenderTexture

LoadMaterial(Resource?, Dictionary<string, byte>?)

public RenderMaterial LoadMaterial(Resource? resource, Dictionary<string, byte>? shaderArguments = null)

Parameters

resource Resource?
shaderArguments Dictionary<string, byte>?

Returns

RenderMaterial

LoadTexture(Resource, bool, bool)

public RenderTexture LoadTexture(Resource textureResource, bool srgbRead = false, bool isViewerRequest = false)

Parameters

textureResource Resource
srgbRead bool
isViewerRequest bool

Returns

RenderTexture