helios.backends.fury.tools.Uniform

class helios.backends.fury.tools.Uniform(name, uniform_type, value)[source]

Bases: object

This creates a uniform shader variable

It’s responsible to store the value of a given uniform variable and call the related vtk_program

Parameters
  • name (str) – name of the uniform variable

  • uniform_type (str) –

    Uniform variable type which will be used inside the shader. Any of this are valid: 1fv, 1iv, 2f, 2fv, 2i, 3f, 3fv,

    3uc, 4f, 4fv, 4uc, GroupUpdateTime, Matrix, Matrix3x3, Matrix4x4, Matrix4x4v, f, i value: float or ndarray

  • value (type(uniform_type)) – should be a value which represent’s the shader uniform variable. For example, if uniform_type is ‘f’ then value should be a float; if uniform_type is ‘3f’ then value should be a 1x3 array.

Methods

execute_program

Given a shader program, this method will update the value with the associated uniform variable in a draw call

execute_program(program)[source]

Given a shader program, this method will update the value with the associated uniform variable in a draw call

Parameters

program (vtkmodules.vtkRenderingOpenGL2.vtkShaderProgram) – A shader program which will be used to update the uniform