Hi Andreas, I'm surprised/disappointed that the cost is so high for 12,000 text drawables, but I haven't tested it recently with this number. The osgautotransform is capable of testing to perhaps I'll tweak it to see how things look.
As for a solution, each osgText::Text will have its own local data for its geometry so you can't share it. Perhaps a custom drawable would be a solution. You might be able to gear it up to just rendering digits, and as such it could have regular spacing etc, and take short cuts that a general purpose osgText::Text can't handle. The other alternative is to roll your sleeves up an optimizing osgText::Text::computeGlyphRepresentation(). Robert. On 8/13/06, Andreas Ekstrand <[EMAIL PROTECTED]> wrote:
In my current example there are about 12 000 text drawables. I know, it's a lot, but they represent vertex numbers within my polygons and are located next to each vertex. If my time measuring is correct, the combined time for all setText calls on these texts is about 4 seconds on my P4 3.4GHz. Re-using by calling the copy constructor on existing texts seems to take about the same time, so I figured it would be the computeGlyphRepresentation method that was the problem. However, I haven't measured in more detail, so I don't know what takes time within computeGlyphRepresentation. I haven't used osgText that much before and I was hoping for some ideas of how to clone these texts somehow, as there will be many identical 0s, 1s and 2s among them, but with different positions. Of course, one could use transforms, sharing the same geodes, each with one text drawable. But I guess 12 000 transforms don't come cheap either... /Andreas Robert Osfield wrote: > On 8/13/06, Andreas Ekstrand <[EMAIL PROTECTED]> wrote: > >> I'm afraid my question below passed unnoticed. I still wonder if there's >> any way I can speed up the creation of my large number of text >> drawables? Is there e.g. really a need for calling >> computeGlyphRepresentation from the Text copy constructor? > > > It didn't go unnoticed, but unanswered. I for one simply don't have > an answer. > > I've very suprised that creating text should be so slow. How many > text items are we talking about? > > Robert. > _______________________________________________ > osg-users mailing list > [email protected] > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
