[osg-users] Please test SVN version of OpenSceneGraph

Robert Osfield robert.osfield at gmail.com
Mon Oct 1 07:37:51 PDT 2007


Hi Alberto,

On 10/1/07, Robert Osfield <robert.osfield at gmail.com> wrote:
> The fact you are using a .obj is just a symptom and not a cause.  The
> issue most likely stems from modifying state at the same time that its
> being read from at the same time.

I've added the line

    _stateset->setDataVariance(osg::Object::DYNAMIC);

To the src/osgGA/StateSetManipulator.cpp and the problem with toggling
texture mode goes away for me.  Could you please try the attached
file.

This isn't a good solution though... as it will case the whole frame
to wait to complete and not allow any overlapping of update/cull and
draw so all the performance benefits of DrawThreadPerContext would be
gone.

The only other way to fix this would be to hold the update back till
the draw is completed, this would enable one just to pay the
performance penalty when you actually change the state rather than on
every frame.  Unfortunately there is no easy hook in osgViewer to do
this right now.

Robert.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StateSetManipulator.cpp
Type: text/x-c++src
Size: 6497 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071001/23fafa02/attachment-0003.cpp>


More information about the osg-users mailing list