Over the last few working days I have commissioned to write a class to help build texture atlas, this work is all open source so we can all benefit from it :-)
What you'll find it two class added to osgUtil::Optimizer:
osgUtil::Optimizer::TextureAtlasBuilder - a class for doing the building texture atlas' from a set of source images or texture
osgUtil::Optimizer::TextureAtlasVisitor - a class for traversing an existing scene collecting suitable textures, pass them to the TextureAtlasBuilder, and
then modifying the texcoords of the associated drawables to keep everything in sync.
To enable the osgUtil::Optimizer::TextureAtlasVisitor pass in the usual Optimizer usage add TEXTURE_ATLAS_BUILDER to the OSG_OPTIMIZER env var, or
options mask i.e.
export OSG_OPTIMIZER="DEFAULT TEXTURE_ATLAS_BUILDER"
osgconv mymodel.fmt optimized.ive
Or if you want to try and merge as much nodes and geometry add MERGE_GEODES too.
export export OSG_OPTIMIZER="DEFAULT TEXTURE_ATLAS_BUILDER MERGE_GEODES"
osgconv mymodel.fmt optimized.ive
For large open flight models I'm getting a speed up of around 6%. Milage will vary from model to model so you may fair better or worse, please let me know how you get on.
Consider this code alpha too, so look out for any artifacts that it introduces.
Cheers,
Robert.
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
