Skip to content

Tech. HighLevelModules

Cyrille Rossant edited this page Feb 26, 2014 · 1 revision

This page describes some rather independent modules that may be useful for future high-level interfaces. They are mostly unrelated to OpenGL and may even be used in other graphical libraries.

I think Vispy should eventually be a batteries-included library, containing many utilities to make it very easy to create beautiful, dynamic and interactive hardware-accelerated animations. Something a bit like d3js, but hardware-accelerated (for big data), and in Python (even though a web backend may come in the future).

Config

Most GL parameters can be accessed using the glGet command with a specific parameter. For example, to know the maximum texture size allowed by the GPU, one can write: size = gl.glGet(GL_MAX_TEXTURE_SIZE). This operation has some cost and it would be better to cache these values once they have been queried. The idea would thus to be able to write: size = vispy.config("max_texture_width") or size = vispy.config.max_texture_width

This requires to know what are the "static" value, their type, etc. These information can be found at https://www.khronos.org/opengles/sdk/docs/man3/xhtml/glGet.xml. The cache mechanism should be fast, of course.

Colors

The support for colors could be largely improved in matplotlib. I suggest we come up with:

  1. A simple and flexible system for defining colors, color maps, gradients, indexed colors...
  2. A library of nice and modern sets of colors

The default color map should be carefully chosen (i.e. not rgbcmy...). It should be quite easy to switch from one color map to the other. It should be easy to create new color maps (discrete, gradients, or indexed).

We should keep in mind the data structures required by PyOpenGL (often Nx3 or Nx4 floating-point NumPy arrays, but there are other data types possible). Also, in some applications we need indexed colors with textures (i.e. colors=0, 1, 2... with a given mapping i ==> color stored on the GPU as a texture, to save memory when there are millions of points).

We should create utility functions for the different color spaces (on CPU & GPU): RGB, HSV, HSL, Lab... with the possibility to map from any space to any other.

Animations

In the future, it will be possible to create dynamic animations easily (like d3js). These may be triggered by user actions.

  • Animation system: this sytems lets us specify an animation in the form of a mathematical formula or a differential equation. Then, a Python function or a GLSL function implementing this animation may be automatically generated. Animations may execute on the CPU or on the GPU. We also need a system to compose different animations, to trigger then following specific actions (based on the existing Vispy's event system).

  • Library of animations (easing, like in jQuery): linear, quadratic, cubic, exponential, sinusoidal, circular...

Clone this wiki locally