Time for action - switching between different threading models

OSG provides a very convenient interface for choosing a threading model. Different threading models can be used in different circumstances, and have different efficiencies. In this example, we are going to show the difference between three common threading models when running a scene with a huge number of quad geometries, in three rendering windows of an osgViewer::CompositeViewer, synchronously.

  1. Include the necessary headers:
    #include <osg/Group>
    #include <osgDB/ReadFile>
    #include <osgViewer/ViewerEventHandlers>
    #include <osgViewer/CompositeViewer>
  2. The quads can be generated with the osg::createTexturedQuadGeometry() function. Their positions are decided simply by a random number generator. ...

Get OpenSceneGraph 3.0 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.