Table of Contents

Interface IShaderAPI

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll

API for configuring and loading GLSL Shaders

public interface IShaderAPI
Extension Methods

Methods

GetProgram(int)

Returns the loaded shader for use in rendering

IShaderProgram GetProgram(int renderPass)

Parameters

renderPass int

Returns

IShaderProgram

GetProgramByName(string)

Returns the loaded shader for use in rendering

IShaderProgram GetProgramByName(string name)

Parameters

name string

Returns

IShaderProgram

IsGLSLVersionSupported(string)

Returns true if given GLSL Version is available on this machine

bool IsGLSLVersionSupported(string minVersion)

Parameters

minVersion string

Returns

bool

NewShader(EnumShaderType)

Returns an empty instance of an IShader for you to configure as vertex, fragment or geometry shader

IShader NewShader(EnumShaderType shaderType)

Parameters

shaderType EnumShaderType

Returns

IShader

NewShaderProgram()

Returns an empty instance of an IShaderProgram for you to configure. Once configured, call RegisterShaderProgram

IShaderProgram NewShaderProgram()

Returns

IShaderProgram

RegisterFileShaderProgram(string, IShaderProgram)

Registers a configured IShaderProgram. The name must correspond to the .vsh and .fsh filenames (without ending). Returns a program number to be used in UseShaderProgram()

int RegisterFileShaderProgram(string name, IShaderProgram program)

Parameters

name string
program IShaderProgram

Returns

int

RegisterMemoryShaderProgram(string, IShaderProgram)

Registers a configured IShaderProgram. Will not load anything from the shaders folder. Returns a program number to be used in UseShaderProgram()

int RegisterMemoryShaderProgram(string name, IShaderProgram program)

Parameters

name string
program IShaderProgram

Returns

int

ReloadShaders()

Discards all currently compiled shaders and recompiles them. Returns true if all shaders compiled without errors.

bool ReloadShaders()

Returns

bool