Re: [osg-users] Transparency Bin Default Behavior
Jason Daly wrote on 2011-11-08: > On 11/08/2011 04:51 PM, Buckley, Bob CTR MDA/DES wrote: > I got the per state solution. But, I'm looking for fixing the > transparency bin. > > Should be on that bin rather than wasting resources on > identifying and setting on all the applicable states - transparent > colors and textures. > > > Hmm. You can set a StateSet on a RenderBin, but I'm not entirely sure > if that would accomplish your goal or not. > > It's also a bit of a pain to get to the RenderBin objects from the > Viewer, but I think it's possible: > > viewer.getRenderer().getSceneView(0).getRenderStage().getRenderBinList( > ). >find(osg::StateSet::TRANSPARENT_BIN); > The Renderer has two SceneViews for double-buffering, so you'd have to > do this on both. > > Hopefully someone will correct me if this is totally wrong :-) I haven't tested this, but you can try modifying the StateSet on the prototype that the transparent bin is created from: RenderBin::getRenderBinPrototype("DepthSortedBin")->getStateSet()->... That assumes all DepthSortedBins should have depth writes disabled, though. Hope this helps, -- Bryan Thrall Principal Software Engineer FlightSafety International bryan.thr...@flightsafety.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Transparency Bin Default Behavior
On 11/08/2011 04:51 PM, Buckley, Bob CTR MDA/DES wrote: Hey, Jason. Was just down in your neck of the woods, kinda – flying @ Sebring. I got the per state solution. But, I’m looking for fixing the transparency bin. Should be on that bin rather than wasting resources on identifying and setting on all the applicable states – transparent colors and textures. Hmm. You can set a StateSet on a RenderBin, but I'm not entirely sure if that would accomplish your goal or not. It's also a bit of a pain to get to the RenderBin objects from the Viewer, but I think it's possible: viewer.getRenderer().getSceneView(0).getRenderStage().getRenderBinList(). find(osg::StateSet::TRANSPARENT_BIN); The Renderer has two SceneViews for double-buffering, so you'd have to do this on both. Hopefully someone will correct me if this is totally wrong :-) --"J" ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Transparency Bin Default Behavior
Hey, Jason. Was just down in your neck of the woods, kinda - flying @ Sebring. I got the per state solution. But, I'm looking for fixing the transparency bin. Should be on that bin rather than wasting resources on identifying and setting on all the applicable states - transparent colors and textures. Bob From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Jason Daly Sent: Tuesday, November 08, 2011 2:33 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Transparency Bin Default Behavior On 11/08/2011 04:26 PM, Buckley, Bob CTR MDA/DES wrote: I just found that the transparency bin does not disable z writes by default. Is there a way to do this via the existing API? Pre-traversal callback? Mode? Attribute? I've been looking thru the archives and see only one reference. Indeed cites it as the solution. Hi, Bob, Something like this should work... depthAttr = new osg::Depth(); depthAttr->setWriteMask(false); stateSet->setAttributeAndModes(depthAttr, osg::StateAttribute::ON); --"J" ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Transparency Bin Default Behavior
On 11/08/2011 04:26 PM, Buckley, Bob CTR MDA/DES wrote: I just found that the transparency bin does not disable z writes by default. Is there a way to do this via the existing API? Pre-traversal callback? Mode? Attribute? I’ve been looking thru the archives and see only one reference. Indeed cites it as the solution. Hi, Bob, Something like this should work... depthAttr = new osg::Depth(); depthAttr->setWriteMask(false); stateSet->setAttributeAndModes(depthAttr, osg::StateAttribute::ON); --"J" ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Transparency Bin Default Behavior
I just found that the transparency bin does not disable z writes by default. Is there a way to do this via the existing API? Pre-traversal callback? Mode? Attribute? I've been looking thru the archives and see only one reference. Indeed cites it as the solution. Thanks Bob Buckley Raytheon ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org