Hi Jeremy, I've just done a review and impressed by the speed up and the sense of providing a cache, it certainly a sensible thing to introduce. Implementation wise I think we'd need to go about things a little differently, although I can't say that I've spent the time to come up with an exact plan for this yet...
Elements of cache system we'd need would be: Thread safe, allowing multiple thread to create and use geometry Handle local modication of geometry, i.e. cached objects need to be const, so how would we enforce this? Is it enough to document that it's const, and just ask users to clone the geometry and modify the clone if they want to do this. Handle future subclassing from Style, and do the sort based on all the key elements of Style. We'd also need to cache geometry for Text that doesn't have a Style. Ability to flush the cache, and make sure that all GL objects in it are handled correctly we need contexts and deleted or added. I have probably missed other aspects for what we'd need for a cache. Thoughts? Robert. On Wed, May 11, 2011 at 6:36 PM, Jeremy Moles <[email protected]> wrote: > Hey Robert. > > This isn't so much a formal submission as it is just an idea for you to > look over. I've added a very simple caching implementation to Text3D, > which is showing speedups in my tests of about 5x-8x, but only when > using Styling like shell geometry or bevelling. Otherwise, the speed is > the same. In fact, I didn't even include a cache implementation for > non-styled text, as I believe an entirely different function in > GlyphGeometry is called in those cases. > > I've included both a diff (for quick perusal) and the full > GlyphGeometry.cpp file. > > However, the real thing to do will be to finish TextNode, and this is > something I'm working on myself. I think the API can be setup such that > I will also be able to convert osgPango to use TextNode as well, and > this could let people quickly change from the more lightweight > FreeType/OSG backend to the full-blown, complex layout Pango engine in > an easy and uniform manner. > > > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
