Hi Wojtek,

This morning I awoke and had an idea about why the compile bit be
running currently with the update traversal, so I got up and reviewed
the code and your test example.  First up I can reproduce the problem
of the red then green flag on my linux box so when I/we do come up
with a solution I do have a chance of confirming the solution works at
my end.

The problem itself looks to be caused by the GLObjectOperation which
does runs GLObjectVisitor is something that is added to the
GraphicsContext's GraphicsThread prior to the RunOperaration which
will intigate the rendering of the cameras.  What this will mean is
that compile will always occur before the rendering of the cameras -
this is a good thing.  The compile will also happen right away after
the realize()/startThreading() and before any barriers/blocks have
been joined, now normally this is a good thing i.e. to get the compile
done before any serious rendering happens, but and this is this big
but, it will run concurrently with the first frames update/event
traversal in all non SingleThreaded models, and even concurrently to
the first frames cull traversal.   So... this is why we have the
problem.

The solution is either to add a block that prevents the first frame
from commencing till all the CompileOperations have been complete, or
to move the compile into the osgViewer::Renderer::draw()
implementation, so the compile is done after cull, but before the
first draw().  The first solution introduces greater internal
complexity, the second solution will mean the first frame will be very
slow.  I'm not clear on what route to take.  Doing a hack of the
second would probably the first thing to try.

Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to