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
GetProgramByName(string)
Returns the loaded shader for use in rendering
IShaderProgram GetProgramByName(string name)
Parameters
name
string
Returns
IsGLSLVersionSupported(string)
Returns true if given GLSL Version is available on this machine
bool IsGLSLVersionSupported(string minVersion)
Parameters
minVersion
string
Returns
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
NewShaderProgram()
Returns an empty instance of an IShaderProgram for you to configure. Once configured, call RegisterShaderProgram
IShaderProgram NewShaderProgram()
Returns
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
stringprogram
IShaderProgram
Returns
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
stringprogram
IShaderProgram
Returns
ReloadShaders()
Discards all currently compiled shaders and recompiles them. Returns true if all shaders compiled without errors.
bool ReloadShaders()