-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Glenn Waldron wrote: > 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.)
Bind a transparent texture to the geometry; when you set the new texture, that will be replaced. Be sure to change the RenderBin if needed. Tim -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iD8DBQFHVd3qeDhWHdXrDRURAu9fAJ9kBliqcBN980/9s8LxTUsz/nXVngCeOEoO LMiZ5f2FKLAL/g5oo7mk7yc= =Rb2U -----END PGP SIGNATURE----- _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

