[osg-users] Maximizing rendering throughput
Robert Milharcic
robert.milharcic at ib-caddy.si
Fri Oct 23 04:36:47 PDT 2015
On 22.10.2015 18:36, Sebastian Messerschmidt wrote:
> Hi,
>
> I have a couple of elements in the scene which data variance is set to DYNAMIC to change them thread safe.
> This will effectively kill performance as cull and draw are no longer executed in parallel. So if I'd set those elements to STATIC, where is the safe place to update them?
> For instance I have some osg::Text which has to be changed every frame. Is it safe to change it in between the update and renderingTraversals?
> Also, what about updateOperation? Is considered to modify drawables from there?
>
> Cheers
> Sebastian
Hi Sebastian,
First of all, I didn't know that cull and draw traversal can execute in parallel on a single scene. I always thought that cull and draw can only execute sequential (serial) in all available threading models. Anyway, what I know for sure is that update and draw traversal can indeed execute in parallel within some threading models, and that is the reason why we need DYNAMIC variance, to tell drawing thread it must process dynamic elements first, and then immediately allow execution of the update traversal in a main thread while STATIC elements are still being rendered in a draw thread. I also suspect that next frame cannot start before all the static+dynamic elements are rendered. If I'm correct on this one, then few DYNAMIC elements should not affect frame rate at all, because there is plenty of time to do the processing while STATIC elements are still being rendered.
You might also want to have a look at osgBullet project where calculations are done in its own thread and then the results are synchronised with a scene graph in an update traversal through a triple buffering mechanism.
I also did a benchmark recently that shows what is the effect of different threading models on a geometry intensive scene. If someone is interested in results let me know...
Best Regards,
Robert Milharcic
More information about the osg-users
mailing list