Paul
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Are you dynamically updating the text each frame? If so set the
DataVariance to DYNAMIC.
Robert.
Paul
Is a design constraint for when running in DrawThreadPerContext or
CullThreadPerCameraDrawThreadPerContext threading models as these
threading models use the DataVariance of StateSet and Drawable to
decide when it's safe to let the next frame advance. Lots has been
written on this topic on the mailing list over the past year and half.
If it you think it's a "flaw" then you just just stick to
SingleThreaded or CullDrawThreadPerContext threading models and forgo
the performance benefit that this "flaw" provides.
Robert.
> I create my Text in response to a keystroke, and add it to the scene.
> The next keystroke removes and deletes it. Each time I create it, the
> initial rendered text string does not change.
This is more of a workaround than an actual fix, but why are you
adding/removing/deleting the object in that case? Why not just add it
once, and then set its node mask to 0 when it should not be visible and
0xFFFFFFFF when it should be? Or add it under an osg::Switch and use
that when you need to control whether it's visible or not.
For that matter, even if the text string changed, I'd do it that way if
I needed a keypress to control visibility of the osgText::Text. No use
adding/removing things from the scene graph in that case, as the node
mask or osg::Switch will have the same result (rendering cost will be
virtually nil).
> BTW I noticed there were some nvidia problems in the archives; I do have
> an NVidia driver (my machine is a Toshiba Tecra M4, Geforge Go 6200
> (three years old), driver date 3/14/2005, version 7.1.4.1 <http://7.1.4.1> )
You might want to update your video card driver, I don't know if 7.1.4.1
is accurate but we're now in the 170.xx range, and in particular
threading issues related to the graphics driver were very frequent in
older releases (because they were not often tested in multithreaded
contexts, since apps that took advantage of multithreading were less
widespread than they are now).
It's just a shot in the dark of course, but it might help.
J-S
--
______________________________________________________
Jean-Sebastien Guay jean-seba...@cm-labs.com
http://www.cm-labs.com/
http://whitestar02.webhop.org/
With so few details about your viewer setup and scene graph usage the
best we can do is guess what you might have done wrong given other
common mistakes we see pop up - have the DataVariance recommendation.
Another thing you could try setting the threading model on the viewer
by calling
viewer.setThreadingMode(osgViewer::Viewer::SingleThreaded);
Again it's a long shot given we really don't know enough about the OSG
version you are using, which viewer library/classes and the fact
you're trying to control everything thing through swig wrappers.
Robert.
With so few details about your viewer setup and scene graph usage the
best we can do is guess what you might have done wrong given other
common mistakes we see pop up - have the DataVariance recommendation.
Another thing you could try setting the threading model on the viewer
by calling
viewer.setThreadingMode(osgViewer::Viewer::SingleThreaded);
Again it's a long shot given we really don't know enough about the OSG
version you are using, which viewer library/classes and the fact
you're trying to control everything thing through swig wrappers.
Robert.
I'm merely looking at this from a user perspective, in which an object
member can take on two values where one value (DYNAMIC) provides an
optimization that might not be of immediate interest to the average OSG
user, while the default setting (STATIC) causes OSG to exit with cerain
(ok, non-standard) threading models. And updating text values during
rendering does seem like a fairly straightforward operation that should
not result in too many surprises.
Would it be a solution to set the data variance to DYNAMIC as soon as
the text's value is set the second time?
Regards,
Paul
The default setting of DataVariance is UNSPECIFIED. There has been
lots written on this topic, please go look at the archives.
Robert,
Gordon
__________________________________________________________
Gordon Tomlinson
Product Manager 3D
Email : gtomlinson @ overwatch.textron.com
__________________________________________________________
(C):
(+1) 571-265-2612
(W):
(+1) 703-437-7651
"Self defence is not a
function of learning tricks
but is a function of how
quickly and intensely one
can arouse one's instinct
for survival"
- Master Tambo Tetsura
Gordon
__________________________________________________________
Gordon Tomlinson
Product Manager 3D
Email : gtomlinson @ overwatch.textron.com
__________________________________________________________
(C):
(+1) 571-265-2612
(W):
(+1) 703-437-7651
"Self defence is not a
function of learning tricks
but is a function of how
quickly and intensely one
can arouse one's instinct
for survival"
- Master Tambo Tetsura