Hi Robert,

On Tue, Nov 5, 2013 at 2:04 PM, Robert Osfield <[email protected]> wrote:
>
> HI Daniel,
>
> When running in DrawThreadPerContext and 
> CullThreadPerCamreaDrawThreadPerContext threading models the dynamic leaves 
> of the scene graphs are rendered whilst the next fame sits of a barrier so 
> doesn't run in parallel with them, once all the dynamic leaves are dispatched 
> to OpenGL the barrier is joined releasing the main thread to start the next 
> frame, then the remain static leaves are dispatched in a parallel with the 
> main thread.
>
> The leaves of the scene graph are the Drawables and StateSet's, the internal 
> nodes of the scene graph never actually make it into the rendering back-end 
> data structures that the cull visitor populates and the draw thread reads 
> from, so the internal nodes of the scene graph are fine to modify as soon as 
> the cull traversal has completed.

Is it mean that it is not necessary to set data variance to dynamic
for nodes like osg::Group (and classes derived from it)? For example,
what is the best practices to add a group (of course its children
also) to our graph during runtime (is it okay to add/remove child to
graph after returning from viewer.frame() ). Moreover, how can we
understand whether the cull traversal has completed or not?

>
> The nodes of the scene graphs must still be only modified single threaded, so 
> you can't have one thread reading and another thread writing to the scene 
> graph.  If you want to have background thread modify the scene graph then 
> you'll need to do what the DatabasePager does and maintain a separate scene 
> graph in the background thread and then merge with the main thread once all 
> the work on it has been done.
>
> Robert.
>
>
> On 5 November 2013 11:23, Daniel Schmid <[email protected]> wrote:
>>
>> Hi all
>>
>>
>>
>> I searched the forum already but didn’t find anything that pointed me 
>> further. My question is the following: When is the correct moment of 
>> removing/modifying objects from the scenegraph? In my multithreaded context, 
>> cull and draw run parallel, and in my understanding (and according to code) 
>> event/update also run parallel to the draw thread. And I cannot put all my 
>> objects as data variance dynamic only because I want to be able to remove 
>> them.
>>
>> How does Database pager resolve this problem? LOD and PagedLOD are not 
>> DYNAMIC, but still he is able to add/remove nodes savely. Are there other 
>> ways/moments to do this?
>>
>>
>>
>> Regards
>>
>> Daniel
>>
>>
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to