Is there a way to achieve transparency in a specified region of the screen other than using overlay planes. I am looking for an alternative due to the rumored spotty hardware support for overlays. Any help suggestions would be greatly appreciated.
maybe using the alpha test and proper texure values/color values?
what are you going to do?
Sorry to be so vague. I am rendering 3D models over an animated 2D background and I need to be able so specify a tranparency value for a region of the screen (as opposed to transparency tied to either the individual models or backgrounds).
hardware support for overlays is indeed spotty (e.g. Radeons have none at all).
3d models on 2d backgrounds… so what’s keeping you from doing normal alpha blending?
-render to the alpha buffer where you wish to have transparency and enable blending and us glBlendFuncSeparate(GL_ZERO,GL_ONE,GL_ONE,GL_ZERO);this copies just the alpha part of the incoming geometry to the framebuffer and leaves the rgb values untouched. of course you need GL 1.4 headers and a decent video card for top performance
-alternantively cou can render clear alpha to 0.0, render you 2d stuff and then black geometry with proper alpha and use glBlendEquation(GL_ADD); to update just the alpha channel
-when rendering the 3d models enable blending and us glBlendFunc(GL_DST_ALPHA,GL_ONE_MINUS_DST_ALPHA);
-pay attention to backfaces!
[This message has been edited by ScottManDeath (edited 12-02-2003).]
There’s also glColorMask, which could be useful here (e.g. with args false,false,false,true).
(why do I have images of kids playing duck duck goose running through my head?)
why to do it simple, when there is also a complicated solution