After thinking this through some more, it seems like if you are starting with 
existing geometry, then iterating over existing primitivesets and creating new 
primitivesets with one primitive per primitiveset (and then using 
BIND_PER_PRIMITIVE_SET) is the easiest solution with regards to code 
complexity.  

Using duplicate vertices seems the better option if you are creating your 
geometry from scratch and have control over that geometry creation.

For example, one of my requirements was to use the building extrusion geometry 
from osgEarth and to color those per-primitive.  I was able to write a fairly 
simple nodeVisitor that accomplishes this by splitting the primitivesets up so 
that I got one primitive per primitive set (and removing the original 
primitivesets).  

As a second example, I also had some code that was converting hdf files to osg 
files and ended up using the second method of using duplicate vertices because 
I was generating everything from scratch including the vertex array.

I realize I could do either of these examples either way, but if the efficiency 
is in the same ballpark I'll just use whichever is easier on a case by case 
basis.  There isn't a silver bullet for this problem.  

Thanks to all for the feedback and patience, it took me a while to wrestle with 
this but it definitely deepened my understanding of osg::Geometry in general.

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





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to