[osg-users] How to setup multi channel

Robert Osfield robert.osfield at gmail.com
Wed Jan 13 11:43:16 PST 2016

Hi Daniel,

These days most decent graphics cards can push multiple displays at a
solid 60Hz so rather than 20 computers for 5x4 display wall you could
have 5 computers pushing 4 displays each or a similar arrangement.
You could look to mix and matching osgcluster style approach with a
viewer with multiple slave Camera's to achieve this.

When using slave Camera's you provide a matrix to multiple the view
and projection matrices via the View::addSlave(camera,
projectionOffsetMatrix, viewOffsetMatrix), you'll find this defined in

Using addSlave when implementing a cluster rather than just setting
the master Camera is generally better as it means that the master can
dispatch the same updates to the master Camera to all slaves and the
individual slaves that apply this to their Viewer.getCamera() while
the individual Slave camera offsets at set up once at start up.

The settings to use with addSlave will depend on the master Camera's
projection matrix set up - is it set to have a field of view of a
single display or for the whole display region?  Also on whether the
display are all in the same plane or not - in the same plane you
simply need to modify the projection matrix offset, but if you have a
cylindrical display then you just modify the view matrix.


On 13 January 2016 at 17:01, Dan Liu <139250065 at qq.com> wrote:
>  Dear Robert:
>     Thank you very much!
>     I have studied osgwindow. If I have 20 computer, each computer has 1
> monitor. And my screen wall is 4 rows, 5 columns. Should I setup
> osg::GraphicsContext::Traits if I run viewer in full screen mode? For
> example, a screen's row_no=2 and column_no=2(index begin from 0), it should
> display x range from 50% to 75% and y range from 40% to 60%, and scale
> aspect ratio to 5/4=1.2.
>     I don't know how to change matrix in below line:
> viewer.addSlave(camera.get(), osg::Matrixd::translate(1.0,0.0,0.0),
> osg::Matrixd());
>     And scale function does not work:
> viewer.getCamera()->getProjectionMatrix() *= osg::Matrix::scale(1.2, 1.0,
> 1.0) has no effect, x scale is not changed. But
> viewer.getCamera()->getProjectionMatrix() *= osg::Matrix::scale(1.2, 1.2,
> 1.2) can works, the earth becomes bigger in both x, y, z dimension.
> With best regards
> Daniel
> ------------------ Original ------------------
> From:  "Robert Osfield";<robert.osfield at gmail.com>;
> Date:  Wed, Jan 13, 2016 05:29 PM
> To:  "OpenSceneGraph Users"<osg-users at lists.openscenegraph.org>;
> Subject:  Re: [osg-users] How to setup multi channel
> Hi Daniel,
> The OSG is designed for handling multi-channel system and provides the
> support via the osgVIewer support for master + slave Camera.
> The osgwindow example is probably the most straight forward
> implementation to look at - this creates two windows and assign these
> to two slave osg::Camera, which are both assigned to a single
> osgViewer::Viewer (subclass from osgViewer::View which subclasses from
> osg::View) which provides the master Camera.
> The overall view is controlled by the master Camera attached to the
> View(er) which provides the main view and projection matrices.  The
> slave Camera's that are assigned to the View(er) have offset matrices
> that multiplied by the master's view and projection matrices to give
> the final view and projection matrices that the Slave camera will use.
> Other examples of the slave camera in action can be seen in the
> osgViewer::ViewConfig implementations found in the
> src/osgViewer/config directory.  The neatest way to implement what you
> need would be to implement your own custom osgViewer::ViewConfig that
> sets up the appropriate Slave Camera you need, then when you want to
> set up your viewer for this display system you simply pass in this
> ViewConfig and have it configure the View(er) as required.
> Robert.
> On 13 January 2016 at 03:50, Dan Liu <139250065 at qq.com> wrote:
>> Dear all:
>>     Hello! I'm using OSG to develop an application which run as screen
>> wall(M rows, N columns). I studied the osgcluster example. But still don't
>> know how to split master screen into MXN sub screens, and scale the screen
>> according to the screen wall's real resolution.
>> With best regards
>> Daniel
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list