Due to the bad performance (high CPU usage) in my Qt3DOffscreenRenderer, which uses the Qt3D framework, I implemented a new offscreen renderer using only/mostly OpenGL.
Unfortunately, I can't get the object drawn on top of the background image to be transparent. I enabled blending and set glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
.
The result is the following:
What you can't see is that the Qt logo's pixels' alpha is 0.5.
For reference, this is the image without transparency:
I simply want the Qt logo to be a bit transparent, like so:
I managed to create this image using this example and modifing it to use the blend function mentioned above and an alpha value of 0.5 in the shader.
How can I achieve this for the offscreen renderer? I experimented with a lot of parameters but had no luck.
cAlphaBits
– Spektreint gl_init(HWND Handle);
function how to set pixelformat. However the GL implementation of yours can refuse it and chose closest format to what you set up ... I usually got an ordered que of formats (decreasing quality) and chose the first that is accepted like this: What is the proper OpenGL initialisation on Intel HD 3000? just add /set the stuff inpfd
you need ... – SpektreGL_DST_ALPHA nor GL_ONE_MINUS_DST_ALPHA
– Spektre