Hi Robert,
> Hi Tugkan,
> 
> The osgdistortion example works a bit like what you are describing,
> could you try this to see what performance it's getting.
> 
osgdistortion's threading model is set to SingleThreaded in the code. I
changed it to DrawThreadPerContext and now I can see that draw starts
after cull, i.e. they do not run parallel.

> As for general notes about threading, if you are working on the same
> graphics context as you are then all the draw dispatch and the draw
> GPU can only be done by a single graphics thread so there is little
> opportunity to make it more parallel without using another graphics
> card/graphics context and interleaving of frames.
> 
Sure. I do not expect that two cameras render in parallel onto a single
window, but cull and draw of a certain camera should run parallel.
Indeed they do so normally with the exact same scene and application. It
breaks only if the second camera (the slave) has PRE_RENDER render order.


tugkan

> As for why the second camera is very expensive on draw dispatch, this
> suggest to me that it's blocking either due to the OpenGL fifo being
> full or that it contains a GL read back operation of some kind.
> 
> Robert.
> 
> On Wed, Jan 13, 2010 at 11:34 AM, Tugkan Calapoglu <[email protected]> wrote:
>> Hi All,
>>
>> I am using a slave view for rendering the scene to a texture. Initially
>>  I tried with a camera node, however, this did not work well due to a
>> problem in LiSPSM shadows and I was suggested to use RTT slave views.
>>
>> My setup is as follows: There is a single main view and I attach a slave
>> view to it. This slave view is attached with addSlave( slave , false );
>>  so that it does *not* automatically use the master scene.
>>
>> I attach a texture to the slave view and make my scene child of this
>> view. I attach a screen aligned quad to the main view. This quad
>> visualizes the RTT texture from the slave view.
>>
>> Now I have a threading problem which can be seen on the snapshot I
>> attached. There are two issues:
>> 1- The main view (cam1) has a very large draw time even though it only
>> renders the screen aligned quad. I double checked to see whether it also
>> renders the actual scene but this is not the case.
>>
>> 2- Slave view does not run cull and draw in parallel. Cull and draw do
>> run in parallel if they are not rendered with the slave view. Moreover,
>> if I change the render order of the slave camera from PRE_RENDER to
>> POST_RENDER it is ok.
>>
>> I could simply use POST_RENDER but I am afraid it introduces an extra
>> one frame latency. If I render the screen aligned quad first and the
>> scene later than what I see on the quad is the texture from previous
>> frame (right?).
>>
>> Any ideas?
>>
>> cheers,
>> tugkan
>>
>>
>>
>>
>> _______________________________________________
>> 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
> 


-- 
Tugkan Calapoglu

-------------------------------------
VIRES Simulationstechnologie GmbH
Oberaustrasse 34
83026 Rosenheim
Germany
phone    +49.8031.463641
fax      +49.8031.463645
email    [email protected]
internet www.vires.com
-------------------------------------
Sitz der Gesellschaft: Rosenheim
Handelsregister Traunstein  HRB 10410
Geschaeftsfuehrer: Marius Dupuis
                   Wunibald Karl
-------------------------------------
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to