c++ - Qt OpenGL - Translucent objects show content from behind window -


i'm using qt5 , opengl integration, , running problem when try draw translucent objects. when object translucent, whatever visible behind opengl window shown within screen area of object, instead of object being blended whatever in colour buffer. have started watching youtube videos through translucent objects, whatever shows through live.

translucency

interestingly, see-through object gets seems occur @ half opacity - full opacity renders solid, while 0 opacity renders nothing @ (and whatever in background of 3d scene remains there). rendering translucent objects last not fix issue.

i have noticed happens when enable mipmaps on textures - distance point on object increases, pixel concerned becomes more translucent , displays whatever behind opengl window. issue occurs both on windows , osx machines.

is known issue? there workaround? google hasn't proven helpful.

hah, that's funny one. can't tell going on, because takes effort make windows transparent; in windows have select framebuffer format alpha channel , call dwnenableblurbehindwindow achieve effect. , far know qt doesn't this.

but if here few hints:

  • make sure clear framebuffer alpha=1
  • when rendering translucent objects keep destination alpha value 1, i.e. don't use blending modes , functions modify destination alpha value, or force 1.

there's little use alpha channel on main window framebuffer, except implementing window translucency effects. unless need should choose either pixel format without alpha channel window framebuffer, or keep pixels alpha values @ full opacity.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -