OpenGL layer

The glumpy.gloo layer is the heart of glumpy and is responsible for talking to the GPU throught buffers, textures and programs. This is done quite transparently thanks to the numpy interface (and the GPU data object which is a subclassed numpy array).

  • gloo-quad.py

    This example displays a simple yellow quad.

  • gloo-cube.py

    This example shows a rotating, colored & outlined cube. It uses transformation matrices to translate, rotate and finally project the cube on the window framebuffer.

    Note

    Note that there are easier ways to do the same using transforms.

  • gloo-texture-1D.py

    This example shows how to upload and display a 1-dimensional texture.

  • gloo-texture-2D.py

    This example shows how to upload and display a 2-dimensional texture.

  • gloo-image.py

    This examples shows how to display an image, without control of the aspect ratio though.

    Warning

    This example does not enforce image aspect ratio when window size is changed.

  • gloo-console.py

    This examples show how to use the on-screen console that should never fails.

    Note

    The console is fairly limited and must be used for debugging purposes only.

  • gloo-terminal.py

    This examples show a more complete terminal that is able to scroll and to display an extended set of characters (just scroll to see them). It is very fast and can be used for quick’n’dirty input/output.

    Note

    The terminal uses a dedicated technique to ensure rendering speed. For better text output, one must used a glyph collection.

  • gloo-atlas.py

    This example shows how to use a texture atlas object that allow to store different texture into a single one.

  • gloo-framebuffer.py

    This examples shows how to used the framebuffer. The scene is first rendered into a texture using ut-of bound color values (10) and the resulting texture is displayed on screen and correct the color value such as to display a gray quad.

  • gloo-cloud.py

    This example shows a rotating 3d scatter plots made of a million antialiased points. It should run smoothly on any recent hardware.

  • gloo-antialias.py

    This example illustrates stroke, filled and outline antialiased shaders that are used in a number of different places throughout glumpy.

  • gloo-arrows.py

    This is an example of what can be done using dedicated shaders. In this example, each arrow is a point but is draw as an antialiased arrow in the fragment shader using signed distance field.

    Note

    You can read more on these techniques in this article of the Journal of Graphics Techniques (which is also a good source of knowledge).

  • gloo-marker.py

    This example show various antialiased markers made using signed-distance functions.

  • gloo-magnify.py

    This examples displays a 2D scatter plot and is zoomed dynamically around the mouse pointer thanks to the shaders.

  • gloo-rain.py

    This example simulates rain drops using growing and fading circles and shows how to update a vertex buffer.

  • gloo-trail.py

    This example shows mouse trails using growing and fadind discs. It illustrate how to use mouse interactions to update a vertex buffer.

  • gloo-picking.py

    This example show how to perform object picking using colors. When pick mode is active (mouse press), each object is rendered using a unique color and the color under the mouse is used to compute the object id.

  • gloo-trace.py

    This example displays several signals that slowly fade out. The trick is to not clear the framebuffer and to draw a quasi transparent quad over the whole scene, making older signals to slowly vanish.