Shader

Class storing the programID, VS ID, FS ID and ShaderUniform locations for a given Shader program

Constructors

this
this(string name, string vertex, string fragment, bool preloaded = false)

Creates a Shader Program from the name, and either the vertex and fragment shader strings, or their file names

Members

Functions

bindAmbientLight
void bindAmbientLight(AmbientLight light)

Bind an ambient light

bindDirectionalLight
void bindDirectionalLight(DirectionalLight light)

Bind a directional light

bindDirectionalLight
void bindDirectionalLight(DirectionalLight light, mat4f transform)

Bind a directional light after a modifying transform

bindMaterial
void bindMaterial(Material material)

Binds diffuse, normal, and specular textures to the shader

bindPointLight
void bindPointLight(PointLight light)

Bind a point light

bindPointLight
void bindPointLight(PointLight light, mat4f transform)

Bind a point light after a modifying transform

bindUI
void bindUI(UserInterface ui)

Binds a UI's texture

bindUniform1f
void bindUniform1f(uint uniform, const float value)

Pass through for glUniform1f

bindUniform1ui
void bindUniform1ui(uint uniform, const uint value)

Pass through for glUniform2f

bindUniform2f
void bindUniform2f(uint uniform, const vec2f value)

Pass through for glUniform2f

bindUniform3f
void bindUniform3f(uint uniform, const vec3f value)

Pass through for glUniform 3f Passes to the shader in XYZ order

bindUniformMatrix4fv
void bindUniformMatrix4fv(uint uniform, mat4f matrix)

pass through for glUniformMatrix4fv

bindUniformMatrix4fvArray
void bindUniformMatrix4fvArray(uint uniform, mat4f[] matrices)

Bind an array of mat4s.

compile
void compile(string vertexBody, string fragmentBody)

Compiles a Vertex and Fragment shader into a Shader Program

setEyePosition
void setEyePosition(vec3f pos)

Sets the eye position for lighting calculations

shutdown
void shutdown()

Clean up the shader

Meta