Hi, Colin,
Are you trying to draw a scene on top of another scene, but
want no background for the scene on top so that you can still
see the content of the scene in the back? I haven't followed up
on the recent development of OSG (still using a version from
2006 with Producer), but in my code that does this, I set the
clear mask of the RenderStage of the SceneView for the camera
on top to GL_DEPTH_BUFFER_BIT only by calling
OsgUtil::RenderStage::setClearMask(GL_DEPTH_BUFFER_BIT). This
way if you draw the scene in the back first, and then when the
scene in the front gets drawn, it only clears the depth buffer
but not the color buffer, so the first scene remains, and only
objects from the second scene are drawn on top it, not a whole
rectangular background. I think it translates to the OpenGL
call glClear() in the end. Maybe now there's a different way to
do it in osg. I wonder if the osgHud example shows something.
Perhaps doing a search on GL_DEPTH_BUFFER_BIT in the osg source
code will reveal some examples.
Best Regards,
Yefei
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Colin Cochran
Sent: Thursday, May 06, 2010 7:22 PM
To: [email protected]
Subject: [osg-users] Transparent Camera Clear Color isn't Working for Me
Hi,
I am attempting to do something very 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?
Thank you!
Cheers,
Colin
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27645#27645
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org