Shader

A description object for a shader program or program unit.

Constructors

this
this()
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Public Imports

tida.color
public import tida.color, tida.vector;
tida.vector
public import tida.color, tida.vector;

Members

Functions

attach
Shader!type attach(T shader)

Binds a shader to the program.

bindAttribLocation
void bindAttribLocation(uint index, string name)

Associates a generic vertex attribute index with a named attribute variable

bindSource
Shader!type bindSource(string source)

Binds the shader source directly to the shader itself into memory by compiling it.

destroy
void destroy()

Destroys the structure of a shader or program.

disableVertex
void disableVertex(string name)

Enable or disable a generic vertex attribute array

disableVertex
void disableVertex(uint id)

Enable or disable a generic vertex attribute array

enableVertex
void enableVertex(string name)

Enable or disable a generic vertex attribute array

enableVertex
void enableVertex(uint id)

Enable or disable a generic vertex attribute array

fromFile
Shader!type fromFile(string path)

Binds the source code to the shader directly from the specified file.

getAttribLocation
int getAttribLocation(string name)

Returns the location of an attribute variable

getUniformLocation
uint getUniformLocation(string name)

Return uniform identificator (location)

lengthUniforms
uint lengthUniforms()

Returns the number of variable uniforms in the program.

link
Shader!type link()

Links two compiled shaders into a program.

setUniform
void setUniform(string name, Color!ubyte color)

Sets the color of a 4D vector type uniform.

setUniform
void setUniform(string name, float value)

Sends a float value to the uniform.

setUniform
void setUniform(string name, float[4][4] value)

Passes a 4-by-4 variable matrix to the uniform.

setUniform
void setUniform(string name, float[3][3] value)

Passes a 3-by-3 variable matrix to the uniform.

setUniformMat
void setUniformMat(string name, float* matPTR)
using
void using()

Uses a shader program.

Manifest constants

Type
enum Type;
Undocumented in source.

Properties

id
uint id [@property getter]

Shader identificator

Meta