Re: [osg-users] Dual screen support on Linux using TwinView

2008-11-29 Thread Michael
Hi Robert

Thanks a lot for your help. This will do exactly what I need.

Cheers
Michael


On Wed, Nov 26, 2008 at 7:58 PM, Robert Osfield [EMAIL PROTECTED]wrote:

 Hi Michael,

 On Wed, Nov 26, 2008 at 12:57 AM, Michael [EMAIL PROTECTED]
 wrote:
  Thanks for the clarrification. After reading through the OpenSceneGraph
 API
  docs we definitely require two views. So to summarise
 
  2 monitors (projectors)
  1 View on each monitor
  1 XScreen, and therefore 1 context (if possible).

 Yep this would be a sensible set up.  With setting up the single
 context you may need to set the Traits::overrideRedirect to true to
 prevent the window manage resizing the window to just once physical
 screen.  Then create the graphics context, then when you set the each
 View's master Camera you just assign the same created graphics context
 so that both Cameras share things single window.

 The osgcompositeview has code that shares a single context between
 multiple views so have a look at it.

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dual screen support on Linux using TwinView

2008-11-26 Thread Robert Osfield
Hi Michael,

On Wed, Nov 26, 2008 at 12:57 AM, Michael [EMAIL PROTECTED] wrote:
 Thanks for the clarrification. After reading through the OpenSceneGraph API
 docs we definitely require two views. So to summarise

 2 monitors (projectors)
 1 View on each monitor
 1 XScreen, and therefore 1 context (if possible).

Yep this would be a sensible set up.  With setting up the single
context you may need to set the Traits::overrideRedirect to true to
prevent the window manage resizing the window to just once physical
screen.  Then create the graphics context, then when you set the each
View's master Camera you just assign the same created graphics context
so that both Cameras share things single window.

The osgcompositeview has code that shares a single context between
multiple views so have a look at it.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dual screen support on Linux using TwinView

2008-11-25 Thread Michael
Hi Robert

Thanks for the clarrification. After reading through the OpenSceneGraph API
docs we definitely require two views. So to summarise

2 monitors (projectors)
1 View on each monitor
1 XScreen, and therefore 1 context (if possible).

Sorry for not giving all this information up front but I have only written
about 1/3 of the codebase, so I have to go fishing through the code. I
appreciate the help!

Thanks
Michael



On Fri, Nov 21, 2008 at 8:10 PM, Robert Osfield [EMAIL PROTECTED]wrote:

 HI Michael,

 Does you two views move together, i.e. they look different
 directions but as the viewpoint moves around both projector outputs
 should update relative to this?  If this is the case they you have one
 View but with two slave Cameras each with a project and view offset
 from the View's master Camera.

 If two projector outputs are wholly independent w.r.t viewpoint, and
 require same camera controls such as seprate CameraManipulator then
 you do have a case which is logically two different views.

 Robert.

 On Thu, Nov 20, 2008 at 11:52 PM, Michael [EMAIL PROTECTED]
 wrote:
  Hey Robert
 
  We have 2 separate logical views (I guess). Essentially we have 2
 projectors
  that can each be placed at any location and orientation in the room and
 they
  project onto objects in the room. This is not a tiled display, and we are
  not worried about overlap. We are also doing some render to texture
  operations which is why we have different views. Each monitor output is
  driving a single projector. So, we have 2 projectors and a couple of RTT
  cameras.
 
  The projectors have their own projection and view matrices, but share the
  same scene graph data for drawing. One of the projectors does shadow
 removal
  for the other one, so we need to control the render order. So, we need
 each
  monitor output to drive one of our views for the projector, using the 1
  graphics context.
 
  I appreciate the help (and patience!)
 
  Cheers
  Michael
 
 
  On Thu, Nov 20, 2008 at 7:38 PM, Robert Osfield 
 [EMAIL PROTECTED]
  wrote:
 
  Hi Michael,
 
  On Thu, Nov 20, 2008 at 12:09 AM, Michael 
 [EMAIL PROTECTED]
  wrote:
   This fails on the second display because OSG can't connect to screen
   0:1,
   because there is only 1 xscreen. Clearly I am doing this wrong, but
 I'm
   not
   sure of the correct way.
 
  If you have only only X screen then you'll only be able to open up a
  window on that one... so you'll need to use the screenNum set to 0 fro
  both contexts, or
 
   Something like this?
   1. Create a single GraphicsContext on screen 0, with width=2048 (both
   displays)
   2. Create my views, and somehow tell each one to only render on half
 of
   the
   context?
 
  If you a grabbing the whole of both displays I would create a single
  graphics context that goes across both physical displays.  Otherwise
  you'll need to create two graphics contexts on the same X11 screenNum
  but with the second window starting at a xpos of 1024.
 
  Now what to do about the views depends upon you actual needs.  Do you
  have two separate logical views of doing you have  single view that is
  just made up of two cameras (like looking out of two adjacent
  real-world windows that share the same view).  If you have only single
  view, then do the two halves of it but up against each other or do
  they overlap?
 
  Could you have a bash at explain what you are specifically trying to
  achieve as the advice to give is different for all the different
  cases.
 
  Robert.
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dual screen support on Linux using TwinView

2008-11-21 Thread Robert Osfield
HI Michael,

Does you two views move together, i.e. they look different
directions but as the viewpoint moves around both projector outputs
should update relative to this?  If this is the case they you have one
View but with two slave Cameras each with a project and view offset
from the View's master Camera.

If two projector outputs are wholly independent w.r.t viewpoint, and
require same camera controls such as seprate CameraManipulator then
you do have a case which is logically two different views.

Robert.

On Thu, Nov 20, 2008 at 11:52 PM, Michael [EMAIL PROTECTED] wrote:
 Hey Robert

 We have 2 separate logical views (I guess). Essentially we have 2 projectors
 that can each be placed at any location and orientation in the room and they
 project onto objects in the room. This is not a tiled display, and we are
 not worried about overlap. We are also doing some render to texture
 operations which is why we have different views. Each monitor output is
 driving a single projector. So, we have 2 projectors and a couple of RTT
 cameras.

 The projectors have their own projection and view matrices, but share the
 same scene graph data for drawing. One of the projectors does shadow removal
 for the other one, so we need to control the render order. So, we need each
 monitor output to drive one of our views for the projector, using the 1
 graphics context.

 I appreciate the help (and patience!)

 Cheers
 Michael


 On Thu, Nov 20, 2008 at 7:38 PM, Robert Osfield [EMAIL PROTECTED]
 wrote:

 Hi Michael,

 On Thu, Nov 20, 2008 at 12:09 AM, Michael [EMAIL PROTECTED]
 wrote:
  This fails on the second display because OSG can't connect to screen
  0:1,
  because there is only 1 xscreen. Clearly I am doing this wrong, but I'm
  not
  sure of the correct way.

 If you have only only X screen then you'll only be able to open up a
 window on that one... so you'll need to use the screenNum set to 0 fro
 both contexts, or

  Something like this?
  1. Create a single GraphicsContext on screen 0, with width=2048 (both
  displays)
  2. Create my views, and somehow tell each one to only render on half of
  the
  context?

 If you a grabbing the whole of both displays I would create a single
 graphics context that goes across both physical displays.  Otherwise
 you'll need to create two graphics contexts on the same X11 screenNum
 but with the second window starting at a xpos of 1024.

 Now what to do about the views depends upon you actual needs.  Do you
 have two separate logical views of doing you have  single view that is
 just made up of two cameras (like looking out of two adjacent
 real-world windows that share the same view).  If you have only single
 view, then do the two halves of it but up against each other or do
 they overlap?

 Could you have a bash at explain what you are specifically trying to
 achieve as the advice to give is different for all the different
 cases.

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dual screen support on Linux using TwinView

2008-11-20 Thread Robert Osfield
Hi Michael,

On Thu, Nov 20, 2008 at 12:09 AM, Michael [EMAIL PROTECTED] wrote:
 This fails on the second display because OSG can't connect to screen 0:1,
 because there is only 1 xscreen. Clearly I am doing this wrong, but I'm not
 sure of the correct way.

If you have only only X screen then you'll only be able to open up a
window on that one... so you'll need to use the screenNum set to 0 fro
both contexts, or

 Something like this?
 1. Create a single GraphicsContext on screen 0, with width=2048 (both
 displays)
 2. Create my views, and somehow tell each one to only render on half of the
 context?

If you a grabbing the whole of both displays I would create a single
graphics context that goes across both physical displays.  Otherwise
you'll need to create two graphics contexts on the same X11 screenNum
but with the second window starting at a xpos of 1024.

Now what to do about the views depends upon you actual needs.  Do you
have two separate logical views of doing you have  single view that is
just made up of two cameras (like looking out of two adjacent
real-world windows that share the same view).  If you have only single
view, then do the two halves of it but up against each other or do
they overlap?

Could you have a bash at explain what you are specifically trying to
achieve as the advice to give is different for all the different
cases.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dual screen support on Linux using TwinView

2008-11-20 Thread Michael
Hey Robert

We have 2 separate logical views (I guess). Essentially we have 2 projectors
that can each be placed at any location and orientation in the room and they
project onto objects in the room. This is not a tiled display, and we are
not worried about overlap. We are also doing some render to texture
operations which is why we have different views. Each monitor output is
driving a single projector. So, we have 2 projectors and a couple of RTT
cameras.

The projectors have their own projection and view matrices, but share the
same scene graph data for drawing. One of the projectors does shadow removal
for the other one, so we need to control the render order. So, we need each
monitor output to drive one of our views for the projector, using the 1
graphics context.

I appreciate the help (and patience!)

Cheers
Michael


On Thu, Nov 20, 2008 at 7:38 PM, Robert Osfield [EMAIL PROTECTED]wrote:

 Hi Michael,

 On Thu, Nov 20, 2008 at 12:09 AM, Michael [EMAIL PROTECTED]
 wrote:
  This fails on the second display because OSG can't connect to screen 0:1,
  because there is only 1 xscreen. Clearly I am doing this wrong, but I'm
 not
  sure of the correct way.

 If you have only only X screen then you'll only be able to open up a
 window on that one... so you'll need to use the screenNum set to 0 fro
 both contexts, or

  Something like this?
  1. Create a single GraphicsContext on screen 0, with width=2048 (both
  displays)
  2. Create my views, and somehow tell each one to only render on half of
 the
  context?

 If you a grabbing the whole of both displays I would create a single
 graphics context that goes across both physical displays.  Otherwise
 you'll need to create two graphics contexts on the same X11 screenNum
 but with the second window starting at a xpos of 1024.

 Now what to do about the views depends upon you actual needs.  Do you
 have two separate logical views of doing you have  single view that is
 just made up of two cameras (like looking out of two adjacent
 real-world windows that share the same view).  If you have only single
 view, then do the two halves of it but up against each other or do
 they overlap?

 Could you have a bash at explain what you are specifically trying to
 achieve as the advice to give is different for all the different
 cases.

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dual screen support on Linux using TwinView

2008-11-19 Thread Michael
Hey Robert

Thanks for the reply. So I've been doing some testing and I'm not sure
exactly how I set this up. Here is some more info on my setup:

xorg.conf:

Section Device
Identifier Device0
Driver nvidia
VendorName NVIDIA Corporation
BoardName  GeForce 8600 GT
Option TwinView 1
Option NoLogo true
Option TwinViewXineramaInfoOrder DFP, CRT
Option TwinViewOrientation DFP LeftOf CRT
Option metamodes DFP: 1024x768 +0+0, CRT: 1024x768 +1920+0
EndSection


So, I have two monitors setup using TwinView. Therefore there is a single X
screen with a resolution of 2048x768.

Now, what I would like is essentially 2 full screen windows, one on each
monitor. How do I do this with OpenSceneGraph? Below is the basic code I am
trying:

// our composite viewer
ref_ptrosgViewer::CompositeViewer viewer = new osgViewer::CompositeViewer;
ref_ptrosg::GraphicsContext::Traits traits = new
osg::GraphicsContext::Traits;

// scenegraph root
ref_ptrNode node = new Node();

// do this twice, once for each screen
for (int i=0;i2;i++)
{
// the first view will be on screen 0, the second on screen 1
traits-screenNum = i;
traits-x = 0;
traits-y = 0;
traits-width = 1024;
traits-height = 768;
traits-windowDecoration = false;
traits-doubleBuffer = true;
traits-overrideRedirect = true;

// create the graphics context
osg::ref_ptrosg::GraphicsContext gc =
osg::GraphicsContext::createGraphicsContext(traits.get());

// add the view to our composite viewer
osgViewer::View* v = new osgViewer::View;
v-setSceneData(node);
v-getCamera()-setGraphicsContext(gc.get());

viewer-addView(v);
}

This fails on the second display because OSG can't connect to screen 0:1,
because there is only 1 xscreen. Clearly I am doing this wrong, but I'm not
sure of the correct way. Something like this?

1. Create a single GraphicsContext on screen 0, with width=2048 (both
displays)
2. Create my views, and somehow tell each one to only render on half of the
context?

Any help with this would be greatly appreciated.

Cheers
Michael


On Tue, Nov 18, 2008 at 7:37 PM, Robert Osfield [EMAIL PROTECTED]wrote:

 Hi Michael,

 The OSG does support two displays attached to a single graphics card,
 and will work either with X set up with a separate X screen per
 physical display or a single screen spanning both displays.  For best
 performance it's best to set up a single X screen across both displays
 as this will just require the OSG to open up a single graphics
 context, which is a far more efficient use of the GPU than opening up
 two graphics contexts that content for time and space on the GPU.

 Depending upon how you set up the window manager you may find that you
 windows are resized automatically to just come up on a single display,
 if this happens it's because the window manager is overriding the
 window sizes that you ask for when create your graphics context and
 the way to solve it is to set the
 GaphicsContext::Traits::overrideRedirect to true when creating your
 graphics contexts.

 Robert.

 On Tue, Nov 18, 2008 at 3:06 AM, Michael [EMAIL PROTECTED]
 wrote:
  Hi
 
  I am developing a program using OpenSceneGraph as the renderer. This
 program
  needs support for dual screens; I am using composite viewer to setup
  different views into the scenegraph, with each view appearing on a
 separate
  screen (the outputs will be driving projectors).
 
  My X configuration is setup using TwinView; so as far as X is concerned
  there is only one screen. Can OpenSceneGraph do what I need to do with
 this
  configuration (ie get screen info from xinerama) or do I need to
 configure X
  so that each monitor is on a different Xscreen? I'd rather not
 reconfigure X
  if possible.
 
  Cheers
  Michael Marner
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dual screen support on Linux using TwinView

2008-11-19 Thread Benoit Gagnon
I believe you simply have to offset the X and Y locations of your graphic
contexts and leave the screen identifier to 0. The width and height should
be 1024x768 for both contextes.

On Wed, Nov 19, 2008 at 7:09 PM, Michael [EMAIL PROTECTED]wrote:

 Hey Robert

 Thanks for the reply. So I've been doing some testing and I'm not sure
 exactly how I set this up. Here is some more info on my setup:

 xorg.conf:

 Section Device
 Identifier Device0
 Driver nvidia
 VendorName NVIDIA Corporation
 BoardName  GeForce 8600 GT
 Option TwinView 1
 Option NoLogo true
 Option TwinViewXineramaInfoOrder DFP, CRT
 Option TwinViewOrientation DFP LeftOf CRT
 Option metamodes DFP: 1024x768 +0+0, CRT: 1024x768 +1920+0
 EndSection


 So, I have two monitors setup using TwinView. Therefore there is a single X
 screen with a resolution of 2048x768.

 Now, what I would like is essentially 2 full screen windows, one on each
 monitor. How do I do this with OpenSceneGraph? Below is the basic code I am
 trying:

 // our composite viewer
 ref_ptrosgViewer::CompositeViewer viewer = new
 osgViewer::CompositeViewer;
 ref_ptrosg::GraphicsContext::Traits traits = new
 osg::GraphicsContext::Traits;

 // scenegraph root
 ref_ptrNode node = new Node();

 // do this twice, once for each screen
 for (int i=0;i2;i++)
 {
 // the first view will be on screen 0, the second on screen 1
 traits-screenNum = i;
 traits-x = 0;
 traits-y = 0;
 traits-width = 1024;
 traits-height = 768;
 traits-windowDecoration = false;
 traits-doubleBuffer = true;
 traits-overrideRedirect = true;

 // create the graphics context
 osg::ref_ptrosg::GraphicsContext gc =
 osg::GraphicsContext::createGraphicsContext(traits.get());

 // add the view to our composite viewer
 osgViewer::View* v = new osgViewer::View;
 v-setSceneData(node);
 v-getCamera()-setGraphicsContext(gc.get());

 viewer-addView(v);
 }

 This fails on the second display because OSG can't connect to screen 0:1,
 because there is only 1 xscreen. Clearly I am doing this wrong, but I'm not
 sure of the correct way. Something like this?

 1. Create a single GraphicsContext on screen 0, with width=2048 (both
 displays)
 2. Create my views, and somehow tell each one to only render on half of the
 context?

 Any help with this would be greatly appreciated.

 Cheers
 Michael



 On Tue, Nov 18, 2008 at 7:37 PM, Robert Osfield [EMAIL PROTECTED]wrote:

 Hi Michael,

 The OSG does support two displays attached to a single graphics card,
 and will work either with X set up with a separate X screen per
 physical display or a single screen spanning both displays.  For best
 performance it's best to set up a single X screen across both displays
 as this will just require the OSG to open up a single graphics
 context, which is a far more efficient use of the GPU than opening up
 two graphics contexts that content for time and space on the GPU.

 Depending upon how you set up the window manager you may find that you
 windows are resized automatically to just come up on a single display,
 if this happens it's because the window manager is overriding the
 window sizes that you ask for when create your graphics context and
 the way to solve it is to set the
 GaphicsContext::Traits::overrideRedirect to true when creating your
 graphics contexts.

 Robert.

 On Tue, Nov 18, 2008 at 3:06 AM, Michael [EMAIL PROTECTED]
 wrote:
  Hi
 
  I am developing a program using OpenSceneGraph as the renderer. This
 program
  needs support for dual screens; I am using composite viewer to setup
  different views into the scenegraph, with each view appearing on a
 separate
  screen (the outputs will be driving projectors).
 
  My X configuration is setup using TwinView; so as far as X is concerned
  there is only one screen. Can OpenSceneGraph do what I need to do with
 this
  configuration (ie get screen info from xinerama) or do I need to
 configure X
  so that each monitor is on a different Xscreen? I'd rather not
 reconfigure X
  if possible.
 
  Cheers
  Michael Marner
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Dual screen support on Linux using TwinView

2008-11-18 Thread Robert Osfield
Hi Michael,

The OSG does support two displays attached to a single graphics card,
and will work either with X set up with a separate X screen per
physical display or a single screen spanning both displays.  For best
performance it's best to set up a single X screen across both displays
as this will just require the OSG to open up a single graphics
context, which is a far more efficient use of the GPU than opening up
two graphics contexts that content for time and space on the GPU.

Depending upon how you set up the window manager you may find that you
windows are resized automatically to just come up on a single display,
if this happens it's because the window manager is overriding the
window sizes that you ask for when create your graphics context and
the way to solve it is to set the
GaphicsContext::Traits::overrideRedirect to true when creating your
graphics contexts.

Robert.

On Tue, Nov 18, 2008 at 3:06 AM, Michael [EMAIL PROTECTED] wrote:
 Hi

 I am developing a program using OpenSceneGraph as the renderer. This program
 needs support for dual screens; I am using composite viewer to setup
 different views into the scenegraph, with each view appearing on a separate
 screen (the outputs will be driving projectors).

 My X configuration is setup using TwinView; so as far as X is concerned
 there is only one screen. Can OpenSceneGraph do what I need to do with this
 configuration (ie get screen info from xinerama) or do I need to configure X
 so that each monitor is on a different Xscreen? I'd rather not reconfigure X
 if possible.

 Cheers
 Michael Marner

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Dual screen support on Linux using TwinView

2008-11-17 Thread Michael
Hi

I am developing a program using OpenSceneGraph as the renderer. This program
needs support for dual screens; I am using composite viewer to setup
different views into the scenegraph, with each view appearing on a separate
screen (the outputs will be driving projectors).

My X configuration is setup using TwinView; so as far as X is concerned
there is only one screen. Can OpenSceneGraph do what I need to do with this
configuration (ie get screen info from xinerama) or do I need to configure X
so that each monitor is on a different Xscreen? I'd rather not reconfigure X
if possible.

Cheers
Michael Marner
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org