108. opengl.shader — OpenGL shader programs

Python OpenGL framework for pyFormex

This module is responsible for loading the shader programs and its data onto the graphics system.

  1. 2013 Benedict Verhegghe and the pyFormex project.

108.1. Classes defined in module opengl.shader

class opengl.shader.Shader(canvas, vshader=None, fshader=None, attributes=None, uniforms=None)[source]

An OpenGL shader consisting of a vertex and a fragment shader pair.

Class attributes:

  • _vertexshader : the vertex shader source. By default, a basic shader supporting vertex positions and vertex colors is defined

  • _fragmentshader : the fragment shader source. By default, a basic shader supporting fragment colors is defined.

  • attributes: the shaders’ vertex attributes.

  • uniforms: the shaders’ uniforms.

108.2. Functions defined in module opengl.shader

opengl.shader.defaultShaders()[source]

Determine the default shader programs