fsleyes.gl.gl21.glsh_funcs

This module contains functions which are used by GLSH instances for rendering Image overlays which contain fibre orientation distribution (FOD) spherical harmonic (SH) coefficients, in an OpenGL 2.1 compatible manner. The functions defined in this module are intended to be called by GLSH instances.

For each voxel, a sphere is drawn, with the position of each vertex on the sphere adjusted by the SH coefficients (radii). For one draw call, the radii for all voxels and vertices is calculated, and stored in a texture.

Different vertex/fragment shaders are used depending upon the current settings of the SHOpts instance associated with the GLSH. If the VectorOpts.colourImage property is set, the glsh_volume_vert.glsl andf glvolume_frag.glsl shaders are used. In this case, the FODs are each voxel are coloured according to the values in the colourImage. Otherwise, the glsh_vert.glsl and glsh_frag.glsl shaders are used. In this case, the vertices of each FOD are coloured according to their orientation, or to their radius.

fsleyes.gl.gl21.glsh_funcs.destroy(self)

Destroys the shader program

fsleyes.gl.gl21.glsh_funcs.compileShaders(self)

Creates a GLSLShader, and attaches it to this GLSH instance as an attribute called shader.

fsleyes.gl.gl21.glsh_funcs.updateShaderState(self)

Updates the state of the vertex and fragment shaders.

fsleyes.gl.gl21.glsh_funcs.preDraw(self, xform=None, bbox=None)

Called by GLSH.preDraw(). Loads the shader program, and updates some shader attributes.

fsleyes.gl.gl21.glsh_funcs.draw2D(self, zpos, axes, xform=None, bbox=None)

Called by GLSH.draw2D(). Draws the scene.

fsleyes.gl.gl21.glsh_funcs.draw3D(self, xform=None, bbox=None)
fsleyes.gl.gl21.glsh_funcs.postDraw(self, xform=None, bbox=None)

Called by GLSH.draw(). Cleans up the shader program and GL state.