Public Types | |
enum | ShaderType { VERTEX, FRAGMENT } |
This enum is used for distinguishing between fragment and vertex shader. More... | |
enum | StateMatrix { MODELVIEW_PROJ, MODELVIEW, MODELVIEW_INV, MODELVIEW_INV_TRANS } |
This enum is used for defining active state matrices which are updated when a shaderobject is enabled. More... | |
Public Member Functions | |
ShaderObject (ShaderType t) | |
Creates an empty shader object with no cg shader assigned. | |
void | Bind () |
Binds the cg program (if one is assigned). | |
void | SetUniform1f (String name, float value) |
Sets a uniform float cg parameter. | |
void | SetUniform2f (String name, float value1, float value2) |
Sets a uniform float2 cg parameter. | |
void | SetUniform3f (String name, float value1, float value2, float value3) |
Sets a uniform float3 cg parameter. | |
void | SetUniform3f (String name, Math.Vector3f value) |
Sets a uniform float3 cg parameter. | |
void | SetUniform4f (String name, float value1, float value2, float value3, float value4) |
Sets a uniform float4 cg parameter. | |
void | SetUniformTexture (String name, int texId) |
Defines a texture object as uniform variable of a cg shader. | |
void | SetActiveStateMatrix (String name, StateMatrix type) |
Defines an active state matrix which will be updated whenever the shader object is enabled. | |
void | Dispose () |
Frees unmanaged ressources. | |
Properties | |
IntPtr | Program [get, set] |
Get or set the cg program for this shader object. | |
ShaderType | Type [get] |
Get the type (fragment or vertex) of the shader program. |
FlowVis.Rendering.ShaderObject.ShaderObject | ( | ShaderType | t | ) |
Creates an empty shader object with no cg shader assigned.
void FlowVis.Rendering.ShaderObject.Bind | ( | ) |
Binds the cg program (if one is assigned).
void FlowVis.Rendering.ShaderObject.SetUniform1f | ( | String | name, | |
float | value | |||
) |
Sets a uniform float cg parameter.
name | name of the parameter defined in the cg program | |
value | new value assigned to the parameter |
void FlowVis.Rendering.ShaderObject.SetUniform2f | ( | String | name, | |
float | value1, | |||
float | value2 | |||
) |
Sets a uniform float2 cg parameter.
name | name of the parameter defined in the cg program | |
value1 | x-coordinate of new value | |
value2 | y-coordinate of new value |
void FlowVis.Rendering.ShaderObject.SetUniform3f | ( | String | name, | |
float | value1, | |||
float | value2, | |||
float | value3 | |||
) |
Sets a uniform float3 cg parameter.
name | name of the parameter defined in the cg program | |
value1 | x-coordinate of new value | |
value2 | y-coordinate of new value | |
value3 | z-coordinate of new value |
void FlowVis.Rendering.ShaderObject.SetUniform3f | ( | String | name, | |
Math.Vector3f | value | |||
) |
Sets a uniform float3 cg parameter.
name | name of the parameter defined in the cg program | |
value | xyz-coordinates of new value |
void FlowVis.Rendering.ShaderObject.SetUniform4f | ( | String | name, | |
float | value1, | |||
float | value2, | |||
float | value3, | |||
float | value4 | |||
) |
Sets a uniform float4 cg parameter.
name | name of the parameter defined in the cg program | |
value1 | x-coordinate of new value | |
value2 | y-coordinate of new value | |
value3 | z-coordinate of new value | |
value4 | w-coordinate of new value |
void FlowVis.Rendering.ShaderObject.SetUniformTexture | ( | String | name, | |
int | texId | |||
) |
Defines a texture object as uniform variable of a cg shader.
name | name of the parameter defined in the cg program | |
texId | OpenGl texture handle |
void FlowVis.Rendering.ShaderObject.SetActiveStateMatrix | ( | String | name, | |
StateMatrix | type | |||
) |
Defines an active state matrix which will be updated whenever the shader object is enabled.
name | name of the parameter defined in the cg program | |
type | type of the matrix |
void FlowVis.Rendering.ShaderObject.Dispose | ( | ) |
Frees unmanaged ressources.
IntPtr FlowVis.Rendering.ShaderObject.Program [get, set] |
Get or set the cg program for this shader object.
ShaderType FlowVis.Rendering.ShaderObject.Type [get] |
Get the type (fragment or vertex) of the shader program.