Shader
Methods
cleanup
Delete the GL shader object, if any.
compile
Compile the shader source into the GL shader object.
Returns
| Type | Description |
|---|---|
| boolean | True when the shader compiled. |
extend
Method used to decorate a given object (publicAPI+model) with vtkShader characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IShaderInitialValues | No | (default: {}) |
getContext
Get the WebGL context used to compile this shader.
getError
Get the last error message.
getHandle
Get the underlying GL shader object, or 0 when it has not been created.
getShaderType
Get the type of this shader.
getSource
Get the GLSL source of this shader.
newInstance
Method used to create a new instance of vtkShader.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IShaderInitialValues | No | for pre-setting some of its content |
setContext
Set the WebGL context used to compile this shader.
| Argument | Type | Required | Description |
|---|---|---|---|
context | Yes | The WebGL context. |
setError
Set the error message.
| Argument | Type | Required | Description |
|---|---|---|---|
error | Yes | The error message. |
setHandle
Set the underlying GL shader object.
| Argument | Type | Required | Description |
|---|---|---|---|
handle | Yes | The GL shader object. |
setShaderType
Set the type of this shader.
| Argument | Type | Required | Description |
|---|---|---|---|
shaderType | Yes | The shader type. |
setSource
Set the GLSL source of this shader.
| Argument | Type | Required | Description |
|---|---|---|---|
source | Yes | The GLSL source. |