Re: [osg-users] Transparency issues with intersecting objects and shapedrawables.
Hi Jesper, Based on some suggestions I saw previously on the board, I'm using a method with two Geodes sharing a child Drawable and a parent Transform. Code: transform_node-addChild(geode1); transform_node-addChild(geode2); geode1-addDrawable(drawable); geode2-addDrawable(drawable); //Added drawable in order geode-geode2. This must match the cullface order - //first rendered should have frontface culled, second backface culled. geode1-getOrCreateStateSet()-setAttributeAndModes(new osg::CullFace(osg::CullFace::FRONT)); geode2-getOrCreateStateSet()-setAttributeAndModes(new osg::CullFace(osg::CullFace::BACK)); This solved the funky-looking transparency at least. Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=33597#33597 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Transparency Issues
Hi Todd, I can't say why your are having problems with transparency in 2.8.1 vs 2.4, as depth sorted/transparent bin hasn't changed between these versions. Perhaps a subtle difference in the loader has caused the difference, or perhaps there is something undefined in your data that the two versions behavior differently with.It's a bit of a case of hunting for a needle in a hay stack so you'll need to try and isolate the different possibilities. Try converting your data to .osg and see if the two different versions behave differently with this, even bettern convert the .ive to .osg using 2.4, then do the same with 2.8.1 and then have a look at the differences, if they are effectively the same then go have a look .osg file to make sure that the objects that you think are transparent are correctly assigned, and also check to see if all the geometries have vertex, normal and colour arrays as required by the state setup in your scene graph. Robert. On Fri, Jun 5, 2009 at 1:28 PM, Todd J. Furlongt...@inv3rsion.com wrote: I'm not sure if this is related to the transparency problem thread, so I thought I'd start a new one. We have an osgUtil::SceneView - based application that uses VR Juggler for rendering on a visualization cluster. Our previous version was built with OSG 2.4, and now we are using OSG 2.8.1. We also have a set of IVE files created in OSG 2.4. Transparent objects (non-textured) were placed in the transparent bin on conversion to IVE, and those objects render fine the OSG 2.4 version of our application. In the OSG 2.8.1 version of the application, we are getting mixed results: Sometimes transparency is OK, but other times the transparent objects appear opaque. Sometimes, different nodes of the cluster will render geometry opaque while others render it transparent. Is this related to depth sorting? What has changed between OSG versions that might cause this? And can I correct it easily to get transparent objects working again? Thanks, Todd ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Transparency Issues
Robert, Thank you for the suggestions. I didn't see a big difference in the OSG files, but I did find the cause: operator error. In the script that runs the 2.8-1 application, we were enabling two-sided lighting. So, now my question is: how do I fix transparency when two-sided lighting is enabled for a scene? I think we're lucky in that the models we have that require two-sided lighting aren't the same ones that have transparent objects. But it would be nice to understand the phenomenon. -Todd Robert Osfield wrote: Hi Todd, I can't say why your are having problems with transparency in 2.8.1 vs 2.4, as depth sorted/transparent bin hasn't changed between these versions. Perhaps a subtle difference in the loader has caused the difference, or perhaps there is something undefined in your data that the two versions behavior differently with.It's a bit of a case of hunting for a needle in a hay stack so you'll need to try and isolate the different possibilities. Try converting your data to .osg and see if the two different versions behave differently with this, even bettern convert the .ive to .osg using 2.4, then do the same with 2.8.1 and then have a look at the differences, if they are effectively the same then go have a look .osg file to make sure that the objects that you think are transparent are correctly assigned, and also check to see if all the geometries have vertex, normal and colour arrays as required by the state setup in your scene graph. Robert. On Fri, Jun 5, 2009 at 1:28 PM, Todd J. Furlongt...@inv3rsion.com wrote: I'm not sure if this is related to the transparency problem thread, so I thought I'd start a new one. We have an osgUtil::SceneView - based application that uses VR Juggler for rendering on a visualization cluster. Our previous version was built with OSG 2.4, and now we are using OSG 2.8.1. We also have a set of IVE files created in OSG 2.4. Transparent objects (non-textured) were placed in the transparent bin on conversion to IVE, and those objects render fine the OSG 2.4 version of our application. In the OSG 2.8.1 version of the application, we are getting mixed results: Sometimes transparency is OK, but other times the transparent objects appear opaque. Sometimes, different nodes of the cluster will render geometry opaque while others render it transparent. Is this related to depth sorting? What has changed between OSG versions that might cause this? And can I correct it easily to get transparent objects working again? Thanks, Todd ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Transparency Issues
Todd -- two-sided lighting and alpha blending are two completely separate and orthogonal OpenGL state items. They work together. One does not disable the other. (Note that if you're rendering, say, a tri strip that is transparent, and it wraps around so that a single strip shows both back and front faces, you'll need to deal with this somehow so that it is properly depth-sorted. Multiparenting and face culling with render bins is one option. But this would be an issue regardless of OSG version.) Does your 2.4 app break similarly if you enable two-sided lighting? Can you write a small/simple standalone reproducer code that exhibits this behavior? Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com +1 303 859 9466 -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Todd J. Furlong Sent: Friday, June 05, 2009 2:38 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Transparency Issues Robert, Thank you for the suggestions. I didn't see a big difference in the OSG files, but I did find the cause: operator error. In the script that runs the 2.8-1 application, we were enabling two-sided lighting. So, now my question is: how do I fix transparency when two-sided lighting is enabled for a scene? I think we're lucky in that the models we have that require two-sided lighting aren't the same ones that have transparent objects. But it would be nice to understand the phenomenon. -Todd Robert Osfield wrote: Hi Todd, I can't say why your are having problems with transparency in 2.8.1 vs 2.4, as depth sorted/transparent bin hasn't changed between these versions. Perhaps a subtle difference in the loader has caused the difference, or perhaps there is something undefined in your data that the two versions behavior differently with.It's a bit of a case of hunting for a needle in a hay stack so you'll need to try and isolate the different possibilities. Try converting your data to .osg and see if the two different versions behave differently with this, even bettern convert the .ive to .osg using 2.4, then do the same with 2.8.1 and then have a look at the differences, if they are effectively the same then go have a look .osg file to make sure that the objects that you think are transparent are correctly assigned, and also check to see if all the geometries have vertex, normal and colour arrays as required by the state setup in your scene graph. Robert. On Fri, Jun 5, 2009 at 1:28 PM, Todd J. Furlongt...@inv3rsion.com wrote: I'm not sure if this is related to the transparency problem thread, so I thought I'd start a new one. We have an osgUtil::SceneView - based application that uses VR Juggler for rendering on a visualization cluster. Our previous version was built with OSG 2.4, and now we are using OSG 2.8.1. We also have a set of IVE files created in OSG 2.4. Transparent objects (non-textured) were placed in the transparent bin on conversion to IVE, and those objects render fine the OSG 2.4 version of our application. In the OSG 2.8.1 version of the application, we are getting mixed results: Sometimes transparency is OK, but other times the transparent objects appear opaque. Sometimes, different nodes of the cluster will render geometry opaque while others render it transparent. Is this related to depth sorting? What has changed between OSG versions that might cause this? And can I correct it easily to get transparent objects working again? Thanks, Todd ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph .org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph. org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org