Gazebo logo

OpenGL Support

Gazebo uses OpenGL to render images for both user feedback (ObserverCam model) and simulated cameras (e.g., MonoCam, StereoHead, SonyVID30 models). This document describes OpenGL concepts with which users should be familiar, and lists some limitations of particular OpenGL driver implementations.

Offscreen rendering and the renderMethod attribute
With version 0.5, Gazebo has moved to an off-screen rendering model; i.e., camera images are rendered to memory rather than the screen. This approach has a number of significant advantages:

Unfortunately, hardware/driver support for (accelerated) offscreen rendering currently seems to be very patchy, with at least four different methods available:

  1. XLIB : Render to an unmapped X window. This is just a sneaky way of using the standard on-screen rendering pipeline (to a hidden window).
    • Pros: hardware accelerated
    • Cons: only works on some X11 implementations (e.g. works on OS X, but not on Linux/Xorg).
  2. SGIX : Use the SGIX pbuffer extension (which was designed specifically for this purpose).
    • Pros: hardware accelerated
    • Cons: only available on some chipsets (works on NVidia; not sure about ATI).
  3. GLX : Use the GLX pixmap extension (write to offscreen pixmap).
    • Pros: standard API.
    • Cons: no hardware acceleration.
  4. GLXP : Use the GLX pbuffer API in GLX 1.3.
    • Pros: standard API
    • Cons: not supported on some drivers?

Since different platforms support different solutions, Gazebo implements methods 1, 2 and 3, selectable via the renderMethod attribute in the camera models. Users can also select the AUTO method, which automatically cycles though the methods to find one that works.

Hardware compatability list
Due to the off-screen rendering issues described above, Gazebo is not compatable with certain hardware/software combinations. Known working (and not working) combinations are listed below.

Please let us know of any non-working combinations.

Performance tips
Gazebo can be very CPU intensive, with almost all of the cycles going into rendering or collision detection. Here are some tips for making rendering faster:

Camera frustrums and clip planes
Gazebo uses the standard OpenGL perspective projection (pin-hole camera). The field-of-view for such cameras is defined by four attributes:

The easiest way to understand these attributes is through the notion of a frustrum (depicted below).


Camera frustrum

The frustrum defines the viewable volume in three dimensions, with the near and far clip attributes bounding the depth of the volume (i.e., the camera will only see points whose depth lies between the near and far clip values).

Clip values also have a second function: the ratio nearClip/farClip controls the effective resolution of the Z-buffer used by OpenGL for hidden surface removal. See the OpenGL documentation for details, but suffice to say setting the near clip to zero and the far clip to infinity is a bad idea. Lowering this ratio will lead to better quality rendering.

Last updated 12 September 2005 21:38:45