Jason Daly wrote:
> 
> 
> You're halfway there.   You also need to enable blending:
> 
> osg::StateSet *stateSet = geometry->getOrCreateStateSet();
> stateSet->setMode(GL_BLEND, osg::StateAttribute::ON);


Thanks, J!  This really helps out!


Jason Daly 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?


Jason Daly wrote:
> 
> This should work, but I also noticed that you're using an indexed color 
> list.  This is a sure-fire way to low frame rates.  You've also declared 
> the index array wrong (it should just be UIntArray *colorIndexArray), 
> but that's not important.  Keep away from indexed lists.  They're only 
> present for backward compatibility.  No modern graphics card works well 
> using indexed lists.


Thanks again for these pointers.  Like I said in my first post, I am pretty new 
to scene graphs and just copy/pasted from a tutorial to get started.  I feel 
more comfortable the more I work with them, and am actually having a bit of fun.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15325#15325





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

Reply via email to