Surface opacity

Hi there,

I’m using OS X and Cocoa to create a viewport that has a transparent background. This is achieved by setting the NSOpenGLCPSurfaceOpacity parameter of a Cocoa NSOpenGLContext instance to 0.

The effect is that my gl drawing is nicely performed over the top of my desktop i.e. I can see right through the viewport and have my gl objects drawn on top - this is exactly what I want.

Unfortunately, performance is miserable on my old 500mhz G3. However if I set the opaqueness back to 1 then performance is great on my 500mhz G3.

I thus conclude that something interesting happens with OS X/OpenGL when a transparent background is being used.

Any thoughts on this anyone? Is there a better way to capure what is underneath my viewport and use that as a background image or something? I read somewhere that textures can be used to achieve this effect so any sample code would be highly appreciated.

Thanks for any help.

-C

I good guess is that this is not possible to do with hardware acceleration on so when you enable the transparency you only get software rendering.

Mikael

Originally posted by mikael_aronsson:
[b]I good guess is that this is not possible to do with hardware acceleration on so when you enable the transparency you only get software rendering.

Mikael[/b]

Interesting - thanks… I wonder if there’s a method of validating whether h/w rendering occurs or not… there’s a tool named OpenGL profiler provided with the OS X developer tools so I’ll take a deeper look.

Interestingly all is well on my Dual 1Ghz G4 - but that could be due to the fact that it is a Dual 1Ghz G4…

Any other techniques that I could employ here i.e. a pointer to some nice gl code that renders a background = to the desktop underneath the viewport… (or is this outside the realm of gl and more to do with the underlying OS?).

Cheers,
-C