d2d.rendering.shaderprogram



class ShaderProgram: d2d.core.iverifiable.IVerifiable;
Class for combining shaders to a bindable ShaderProgram.

this();


static ShaderProgram fromVertexFragmentFiles(string vertex, string fragment);
Will directly load the content from vertex and fragment and will create and return a ShaderProgram.

void attach(Shader shader);
Attaches a new shader to the program.

Will call
shader.compile()
if necessary.

void link();
Creates the program and binds it.

void bind();
Binds
this
for usage.

int registerUniform(string uniform);
Regsiters a uniform variable in the shader for later setting.

void set(string uniform, int value);


void set(string uniform, float value);


void set(string uniform, vec2 value);


void set(string uniform, vec3 value);


void set(string uniform, vec4 value);


void set(string uniform, mat2 value);


void set(string uniform, mat3 value);


void set(string uniform, mat4 value);


void opIndexAssign(T)(T value, string uniform);


uint id();


@property bool valid();


static ShaderProgram defaultShader;
Regular texture shader.


Page generated by Ddoc.