New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

things behind the window shows up in transparent object with solid background #124

Open
avilleret opened this Issue Nov 14, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@avilleret
Contributor

avilleret commented Nov 14, 2016

I just realize there is one big caveat in #119 when you draw something transparent in a window with alpha channel and solid background.
Everything behind the window will appear through object transparency.
I see the same result in this small test program :
test-program.tar.gz (adapted from: https://github.com/datenwolf/codesamples/blob/master/samples/OpenGL/x11argb_opengl/x11argb_opengl.c)

Here is a patcher that demonstrates the issue :
test-transparent_background-bug.zip

I don't think this is a bug but a side-effect of window with alpha channel.
So I'm sure we need to make a window without alpha channel by default to avoid that. (but maybe I'm wrong)

@umlaeute

This comment has been minimized.

Show comment
Hide comment
@umlaeute

umlaeute Nov 14, 2016

Owner

do you mean the effect shown in the attachment?
(this has a background color of 1 1 1 1, and two additional squares behind the cube
transparent.

(at least firefox doesn't render the transparency, so you might need to look at the image gimp or the like...)

Owner

umlaeute commented Nov 14, 2016

do you mean the effect shown in the attachment?
(this has a background color of 1 1 1 1, and two additional squares behind the cube
transparent.

(at least firefox doesn't render the transparency, so you might need to look at the image gimp or the like...)

@avilleret

This comment has been minimized.

Show comment
Hide comment
@avilleret

avilleret Nov 15, 2016

Contributor

not exactly.
I mean that :
image
.
We can see the terminal output in the red cube which is annoying since the background is solid blue.
We may find an alpha mode that works but at least the default one will break backward compatibility.

If I put a square behind the cube, I can still see the terminal behind the window :
image

Contributor

avilleret commented Nov 15, 2016

not exactly.
I mean that :
image
.
We can see the terminal output in the red cube which is annoying since the background is solid blue.
We may find an alpha mode that works but at least the default one will break backward compatibility.

If I put a square behind the cube, I can still see the terminal behind the window :
image

@umlaeute

This comment has been minimized.

Show comment
Hide comment
@umlaeute

umlaeute Nov 15, 2016

Owner

while i don't see that (i didn'tsee the transparent glxwindow, but this is related to the used compositor; normally i'm using xfce4 with the compositor disabled; if i switch the compositor on, i have the same effect).

anyhow, i think that the png i uploaded above, exhibits this very problem (background being non-transparent; but whereever it is hidden by the semi-opaque cube, it becomes transparent)

Owner

umlaeute commented Nov 15, 2016

while i don't see that (i didn'tsee the transparent glxwindow, but this is related to the used compositor; normally i'm using xfce4 with the compositor disabled; if i switch the compositor on, i have the same effect).

anyhow, i think that the png i uploaded above, exhibits this very problem (background being non-transparent; but whereever it is hidden by the semi-opaque cube, it becomes transparent)

@avilleret

This comment has been minimized.

Show comment
Hide comment
@avilleret

avilleret Nov 18, 2016

Contributor

according to : http://stackoverflow.com/questions/35245809/qt-opengl-translucent-objects-show-content-from-behind-window this is related to the blending function.
But I can't find a blending mode to reproduce the behavior of a non transparent window with a transparent one.
So we need to make transparent window an option.

Contributor

avilleret commented Nov 18, 2016

according to : http://stackoverflow.com/questions/35245809/qt-opengl-translucent-objects-show-content-from-behind-window this is related to the blending function.
But I can't find a blending mode to reproduce the behavior of a non transparent window with a transparent one.
So we need to make transparent window an option.

@avilleret

This comment has been minimized.

Show comment
Hide comment
@avilleret

avilleret Nov 28, 2016

Contributor

according to datenwolf's answer we need to implement separable blend function to solve this.
To do so, we need glBlendFunci which was introduce with OpenGL 4.0.
I will try to have a look into that later.

Contributor

avilleret commented Nov 28, 2016

according to datenwolf's answer we need to implement separable blend function to solve this.
To do so, we need glBlendFunci which was introduce with OpenGL 4.0.
I will try to have a look into that later.

@umlaeute umlaeute added the bug label Nov 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment