Skip to content

Shader ​

Methods ​

cleanup ​

Delete the GL shader object, if any.

compile ​

Compile the shader source into the GL shader object.

Returns ​

TypeDescription
booleanTrue when the shader compiled.

extend ​

Method used to decorate a given object (publicAPI+model) with vtkShader characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIShaderInitialValuesNo(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.

ArgumentTypeRequiredDescription
initialValuesIShaderInitialValuesNofor pre-setting some of its content

setContext ​

Set the WebGL context used to compile this shader.

ArgumentTypeRequiredDescription
contextYesThe WebGL context.

setError ​

Set the error message.

ArgumentTypeRequiredDescription
errorYesThe error message.

setHandle ​

Set the underlying GL shader object.

ArgumentTypeRequiredDescription
handleYesThe GL shader object.

setShaderType ​

Set the type of this shader.

ArgumentTypeRequiredDescription
shaderTypeYesThe shader type.

setSource ​

Set the GLSL source of this shader.

ArgumentTypeRequiredDescription
sourceYesThe GLSL source.