I'm trying to render a scene to a QGLFramebufferObject and use it as a texture on my 3D-object. Everything displays fine when I use old fixed graphics pipeline without shaders, but when I try to do this on a shader-based application, I get only a blank screen.

Does anyone know what could be the cause of this?

This is what obviously causes the blank screen:

Qt Code:
  1. QPainter painter(buffer);
  2. scene.render(&painter);
  3. painter.end();
To copy to clipboard, switch view to plain text mode 

Do I need to reset something related to drawing or what?