support transparent background when using renderToFramebuffer

This commit is contained in:
wmayer 2016-07-24 22:24:58 +02:00
parent 3d95e9ac4b
commit 1f3c2ef2c8

View File

@ -1284,7 +1284,7 @@ void View3DInventorViewer::renderToFramebuffer(QGLFramebufferObject* fbo)
const QColor col = this->backgroundColor(); const QColor col = this->backgroundColor();
glViewport(0, 0, width, height); glViewport(0, 0, width, height);
glClearColor(col.redF(), col.greenF(), col.blueF(), 1.0f); glClearColor(col.redF(), col.greenF(), col.blueF(), col.alphaF());
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDepthRange(0.1,1.0); glDepthRange(0.1,1.0);