0

I'm trying to create a display with a complex OpenGL image and some spinboxes on the image. Using http://doc.qt.digia.com/qq/qq26-openglcanvas.html I'm able to have a two layers object (inheriting from QGraphicsScene) with a simple OpenGL image as background and the controls on foreground.

So, now I'm trying to display my true OpenGL image as background. This image is created by:

  1. A quad mapped on a structure,
  2. Some small 2D objects represented by 2D textures with alpha channel and specific shaders, drawn on the quad (upper z value)
  3. Some polylines.

With this image I have some strange behavior. The 2D textured objects are drawn with a white background. Some experiments seem to indicate that, in the drawing of this complex OpenGL image the alpha channel is disabled.

I tried different configurations for the QGLWidget used as viewport of the QGraphicsView but without result.

So I need help to be able to create this OpenGL image with the right transparency effects.

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • You probably need to enable the alpha channel with `QGL::AlphaChannel` when creating the OpenGL context: `QGLFormat f; f.setAlpha(true); QGLFormat::setDefaultFormat(f);` – Andreas Haferburg Jun 22 '13 at 15:50
  • I have already tried to setup alpha channel. But this changes nothing. It was one of my first tries with also creating the QGlWidget in RGBA format. –  Jun 23 '13 at 17:27

0 Answers0