[osg-users] Adding an alpha channel to a texture?
Glenn Waldron
gwaldron at gmail.com
Tue Dec 4 19:40:39 PST 2007
Thanks to everyone for the responses. I ended up going with Roger's
suggestion to set the internal texture format to RGBA. Works great!
-gw
On Dec 4, 2007 7:35 PM, Roger James <roger at beardandsandals.co.uk> wrote:
> Set the texture format to RGBA and when you bind a RGB image a default
> alpha channel will be added.
>
>
> ------------------------------
>
> *From:* osg-users-bounces at lists.openscenegraph.org [mailto:
> osg-users-bounces at lists.openscenegraph.org] *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
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071204/57794d21/attachment.html
More information about the osg-users
mailing list