[osg-users] OSG 2.1.10 crash in osgText / osgdb_freetyped

Robert Osfield robert.osfield at gmail.com
Sat Sep 15 09:45:57 PDT 2007


On 9/15/07, beelzebob999-osg at yahoo.com <beelzebob999-osg at yahoo.com> wrote:
> What kind of performance penalty is there for adding
> the dynamic flag to text, if, say, you're dealing with
> 10's of thousands of text objects?

If you aren't updating the text you should set the data variance to
STATIC, and set it to DYNAMIC when its being updated.

The only time that setting the data variance to DYNAMIC will make a
difference to performance is when you are using DrawThreadPerContext
or CullThreadPerCameraDrawThreadPerContext threading models, in
SingleThreaded and CullDrawThreadPerContext it won't make any
difference.

The reason for the difference is that DrawThreadPerContext and
CullThreadPerCameraDrawThreadPerContext threading models allow the
next frames update & cull to begin whilst the draw traversal is
underway, but... and this is the critical part, the draw traversals
holds back the next frame until varying Drawables and StateSets have
been dispatched.  The only way the draw traversal knows whether
anything varies is that its DataVariance is set to DYNAMIC, so its
important to set this other wise you'll be modifying data that is also
been read at the same time - which is what causes crashes.
Performance wise the less DYNAMIC data that needs to be dispatched the
earlier the next frame came commense.  If the last objects to be drawn
is DYNAMIC then effectively you hold the next frame back for till the
entire previous frame is dispatched, and you end up with
SingleThreaded/CullDrawTheradPerContext performance levels.  So its no
really the number of dynamic objects, rather how late they are
dispatched in the frame.

Robert.



More information about the osg-users mailing list