OpenGL flickering under transparency


#1

Hi all,

I have just started a new application using Juce and so far I am loving it. My only trouble is this: when I use the OpenGLComponent under a semi-transparent window, it flickers like crazy.
I think it is not synchronized with the paint function of the transparent component.
Any idea is very appreciated.

Thanks.


#2

Yeah, welcome to Microsoft’s crappy windows compositing. Nothing we can do about it except wait for Vista…


#3

I see. Still, I was thinking in using the OpenGlComponent to draw to a buffer that is not visible, copy the pixels to an Image object and use this to paint my main screen´s component. Just as a patch until we get Vista. Trouble for me is that I am new to OpenGl and can´t figure out how to copy the buffer to the Image.

Thanks for replying.


#4

[quote=“roberto”]I see. Still, I was thinking in using the OpenGlComponent to draw to a buffer that is not visible, copy the pixels to an Image object and use this to paint my main screen´s component. Just as a patch until we get Vista. Trouble for me is that I am new to OpenGl and can´t figure out how to copy the buffer to the Image.
[/quote]

You can use PBuffers or the newer FrameBuffer Object extension to do that, but be careful : transfering data from video memory back to main memory is much slower than the other way.
With newest PCI express opengl boards it will probal faster but on most systems it will be very slow.


#5

If your transparent window is completely inside the OpenGL area (e.g. a HUD) you can always do it with a camera facing billboard in the OpenGL scene.

Otherwise, if it is a floating window, just forget the transparency :slight_smile:


#6