[osg-users] Adding an alpha channel to a texture?
Glenn Waldron
gwaldron at gmail.com
Tue Dec 4 12:20:50 PST 2007
I want to set up a geometry such that when I apply a texture, it renders,
but when no texture is applied it is invisible. I created the geometry with
color (1,1,1,0) and I'm using the TexEnv::GL_REPLACE mode. This works
perfectly on 4-channel RGBA textures (because texture alpha replaces
fragment alpha), but on a 3-channel RGB texture the GL_REPLACE mode uses the
fragment's alpha color (which makes sense) and thus the geometry remains
invisible.
Is there either a) an easy way to add an alpha channel to an existing
osg::Image, or b) a better way to solve this problem? (I know I can use node
masks etc., but I would prefer to do it simply by setting or removing the
texture attribute.)
Thanks in advance! -gw
--
Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : 703-652-4791
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071204/050c73ff/attachment.htm
More information about the osg-users
mailing list