[Interest] Draw a qimage with transparency on a QOpenGLPaintDevice

maitai maitai at virtual-winds.org
Sun May 1 13:45:35 CEST 2022


I have some heavy rendering that I would like to speed up using openGL. 
For the time being using only QPainter regular method but later some 
native openGL code.

So instead of painting on a QImage, I am painting on a 
QOpenGLPaintDevice. All is fine except one point: When the painter draws 
a QImage containing alpha, these alpha pixels appear black. 
CompositionMode is QPainter::CompositionMode_SourceOver and QImage 
format for the source is QImage::Format_ARGB32_Premultiplied. Same code 
painting in a QImage works fine.

I have tried to glEnable(GL_BLEND) and glEnable(GL_DEPTH_TEST) and some 
others but that didn't fix the issue.

Any idea of what needs to be done ?

Many thanks in advance

Philippe Lelong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20220501/4f4bea9b/attachment.htm>

More information about the Interest mailing list