:orphan:



.. _sphx_glr_gallery_gloo:

Gloo
====

More example scripts are available in the VisPy repository's
`example scripts directory <https://github.com/vispy/vispy/tree/main/examples>`_.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Draw a new array of random image pixels on every draw cycle.">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_animate_images_thumb.gif
     :alt: Show an Image

     :ref:`sphx_glr_gallery_gloo_animate_images.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/animate_images

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use a timer to trigger updating an image.">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_animate_images_slice_thumb.gif
     :alt: Animate an Image

     :ref:`sphx_glr_gallery_gloo_animate_images_slice.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/animate_images_slice

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example demonstrating showing a quad using a Texture2D and VertexBuffer and a timer to control ...">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_animate_shape_thumb.gif
     :alt: Animate a Shape

     :ref:`sphx_glr_gallery_gloo_animate_shape.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/animate_shape

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Show a rotating colored cube">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_colored_cube_thumb.png
     :alt: Show a rotating colored cube

     :ref:`sphx_glr_gallery_gloo_colored_cube.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/colored_cube

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Draw many colored cubes using instanced rendering">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_colored_cube_instanced_thumb.png
     :alt: Draw many colored cubes using instanced rendering

     :ref:`sphx_glr_gallery_gloo_colored_cube_instanced.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/colored_cube_instanced

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Create a new drawing using triangle_strip">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_colored_quad_thumb.png
     :alt: Show color quad Image

     :ref:`sphx_glr_gallery_gloo_colored_quad.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/colored_quad

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how multiple line-pieces can be drawn using one call, by discarding s...">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_display_lines_thumb.gif
     :alt: Draw a bunch of lines

     :ref:`sphx_glr_gallery_gloo_display_lines.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/display_lines

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple example plotting 2D points.">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_display_points_thumb.png
     :alt: Draw 2D points

     :ref:`sphx_glr_gallery_gloo_display_points.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/display_points

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple example demonstrating showing a quad using a gloo Program.">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_display_shape_thumb.png
     :alt: Draw a Quad

     :ref:`sphx_glr_gallery_gloo_display_shape.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/display_shape

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Illustrate how to plot a 2D function (an image) y=f(x,y) on the GPU.">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_gpuimage_thumb.gif
     :alt: Animate a 2D function

     :ref:`sphx_glr_gallery_gloo_gpuimage.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/gpuimage

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Minimal example demonstrating the use of frame buffer objects (FBO). This example blurs the out...">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_hello_fbo_thumb.png
     :alt: Use FrameBuffers

     :ref:`sphx_glr_gallery_gloo_hello_fbo.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/hello_fbo

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Show a rotating cube with lighting">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_lighted_cube_thumb.png
     :alt: Show a rotating cube with lighting

     :ref:`sphx_glr_gallery_gloo_lighted_cube.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/lighted_cube

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="We create two textures. One that shows a red, green and blue band in the horizontal direction a...">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_multi_texture_thumb.png
     :alt: Use multiple textures

     :ref:`sphx_glr_gallery_gloo_multi_texture.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/multi_texture

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Show a rotating cube with an outline">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_outlined_cube_thumb.png
     :alt: Show a rotating cube with an outline

     :ref:`sphx_glr_gallery_gloo_outlined_cube.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/outlined_cube

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Show post-processing using a FrameBuffer">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_post_processing_thumb.gif
     :alt: Show post-processing using a FrameBuffer

     :ref:`sphx_glr_gallery_gloo_post_processing.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/post_processing

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to display 3D objects.">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_rotate_cube_thumb.gif
     :alt: Draw 3D rotating Cube

     :ref:`sphx_glr_gallery_gloo_rotate_cube.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/rotate_cube

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use a Timer to animate a quad">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_rotating_quad_thumb.gif
     :alt: Rotating Quad

     :ref:`sphx_glr_gallery_gloo_rotating_quad.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/rotating_quad

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example demonstrating spatial filtering using spatial-filters fragment shader.">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_spatial_filters_thumb.png
     :alt: Spatial Filtering

     :ref:`sphx_glr_gallery_gloo_spatial_filters.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/spatial_filters

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simplest Possible Script">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_start_thumb.png
     :alt: Simplest Possible Script

     :ref:`sphx_glr_gallery_gloo_start.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/start

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simplest Shader Program">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_start_shaders_thumb.png
     :alt: Simplest Shader Program

     :ref:`sphx_glr_gallery_gloo_start_shaders.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/start_shaders

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Generates a gradient texture with high dynamic range and renders it with a fragment shader that...">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_texture_precision_thumb.png
     :alt: Example using texture internalformat for higher precision

     :ref:`sphx_glr_gallery_gloo_texture_precision.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/texture_precision

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Show a rotating textured cube">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_textured_cube_thumb.png
     :alt: Show a rotating textured cube

     :ref:`sphx_glr_gallery_gloo_textured_cube.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/textured_cube

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Show a textured quad">

.. only:: html

 .. figure:: /gallery/gloo/images/thumb/sphx_glr_textured_quad_thumb.png
     :alt: Show a textured quad

     :ref:`sphx_glr_gallery_gloo_textured_quad.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/textured_quad
.. raw:: html

    <div class="sphx-glr-clear"></div>



.. _sphx_glr_gallery_gloo_gl:

The low-level GL module
=======================

Vispy has a low-level `gl` module which wraps `GL` calls almost to a 1-to-1 ratio. While this is intended mostly for internal use, it is possible to use this to construct programs.



.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Drawing a rotated 3D cube">

.. only:: html

 .. figure:: /gallery/gloo/gl/images/thumb/sphx_glr_cube_thumb.png
     :alt: Drawing a rotated 3D cube

     :ref:`sphx_glr_gallery_gloo_gl_cube.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/gl/cube

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="(adapted from the &quot;OpenGL ES 2.0 Programming Guide&quot;) This example demonstrates a series of expl...">

.. only:: html

 .. figure:: /gallery/gloo/gl/images/thumb/sphx_glr_fireworks_thumb.png
     :alt: Example demonstrating simulation of fireworks using point sprites

     :ref:`sphx_glr_gallery_gloo_gl_fireworks.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/gl/fireworks

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Drawing a simple quad">

.. only:: html

 .. figure:: /gallery/gloo/gl/images/thumb/sphx_glr_quad_thumb.png
     :alt: Drawing a simple quad

     :ref:`sphx_glr_gallery_gloo_gl_quad.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/gl/quad

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example is a modification of examples/tutorial/gl/quad.py which uses instanced rendering t...">

.. only:: html

 .. figure:: /gallery/gloo/gl/images/thumb/sphx_glr_quad_instanced_thumb.png
     :alt: Displaying quads using Instanced rendering

     :ref:`sphx_glr_gallery_gloo_gl_quad_instanced.py`

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /gallery/gloo/gl/quad_instanced
.. raw:: html

    <div class="sphx-glr-clear"></div>



.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-gallery


  .. container:: sphx-glr-download sphx-glr-download-python

    :download:`Download all examples in Python source code: gloo_python.zip </gallery/gloo/gloo_python.zip>`



  .. container:: sphx-glr-download sphx-glr-download-jupyter

    :download:`Download all examples in Jupyter notebooks: gloo_jupyter.zip </gallery/gloo/gloo_jupyter.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
