On 7 May 2010 01:22, Colin Cochran <[email protected]> wrote:

> Hi,
>
> I am attempting to do something very simple:
>

Unfortunately it isn't that simple


>
> I want to set the background color of my scene completely transparent.
> Posts and example code instruct to set the clear of the color of the Camera
> to RGBA = [0, 0, 0, 0], thusly:
>
> Code:
>
> osg::Camera* c = viewer->getCamera();
> c->setClearColor(osg::Vec4(0., 0., 0., 0.));
>
> However the above code just sets the background color of the scene to pure
> black.
>
> Is there something i'm missing, configuration wise, with the viewer
> traits?--
>

It is working; your image is transparent.
Save it to a png or another format which supports an alpha channel.

Just making the background colour transparent doesn't enable window
transparency.
There's no cross platform way of doing that.

It can be hacked up in XP but perform sucks;
only Vista & Win 7 & Linux(with the right window manager) support proper
desktop window compositing.

If you want to target Vista/7; this is helpful info:

http://www.opengl.org/pipeline/article/vol003_7/

And for XP this forum discussion's got the info:

http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=194443

Dunno about linux though.

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

Reply via email to