Set the texture format to RGBA and when you bind a RGB image a default alpha
channel will be added.

 

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Glenn
Waldron
Sent: 04 December 2007 20:21
To: OpenSceneGraph Users
Subject: [osg-users] Adding an alpha channel to a texture?

 

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 

 

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to