Evan O'Toole wrote:
You also will probably want to depth-sort the geometry, and make sure it's drawn later than any opaque geometry (so the blending will work properly):

stateSet->setRenderBinDetails(1, "DepthSortedBin");



The objects I'm drawing will need to be dynamically changed from opaque to 
transparent at the user's request.  For now, I'm just trying to figure out how 
to get the transparency to work, but can the setRenderBinDetails function be 
called later, or can it only be called as I'm creating the geometry?

I'm pretty sure it's a state like anything else, so you should be able to change it on the fly. At the same time, you most likely could just leave it in the transparent bin and be fine. You'll only get artifacts if two different objects start interpenetrating.

One more tip. If you're going to be changing these dynamically, make sure you mark them dynamic:

  geometry->setDataVariance(osg::Object::DYNAMIC);

Also, when you make any changes, you'll have to let OSG know to recompile the display list:

  geometry->dirtyDisplayList();

If you're making a /lot/ of changes (say, once per frame), you might want to disable display lists altogether (you won't need to make the above call, then):

  geometry->setUseDisplayList(false);

--"J"
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to