Re: [osg-users] multiple views + instancing

2017-11-15 Thread Robert Osfield
Hi David,

You could write a custom subclass of osg::Geometry and override the
drawImplementation an do the cull and dispatch of the primitives and
instance count for each time the geometry is drawn, but do so in a
thread safe way such as my computing all the dynamic data on the fly.

The alternative would be to have two osg::Geometry, once for each view
and have a NodeMask for each osg::Geometry and have use a
Camera::CullTraversalMask for each view to select the appropriate one
for each context.


Robert.

On 15 November 2017 at 19:06, David Heitbrink  wrote:
> Right now I having problems setting unique uniforms and num instances on a 
> per view basis (camera).
>
> Right now I am using hardware instancing, with a scene with 1000's of 
> relatively complex objects, but only a handful of actual models. I was able 
> to encode index's to textures + position and rotation transforms into a 
> single texture buffer.
>
> To do the viewport culling for this I added "proxy" nodes, which are just 
> osg::group nodes, with a compute bound + cull call backs. The cull call back, 
> calls back to a class tracking which instances are visible in which view. 
> Each view has a group attach to it between the camera and the main scene. In 
> said group, the texture buffer object is attached here.
>
> The instanced models are further down in the scene graph. I in a draw 
> callback from camera, I update each models uniform for its offset into the 
> texture buffer, its instance count, plus texture buffer (transforms + some 
> options for the fragment shader).  All of this works great until I have 
> multiple cameras.
>
>  Basically I cannot figure out a good way of modifying the instance count + 
> offset uniform so I get unique values for each camera. Does anyone have some 
> advice for this?
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=72391#72391
>
>
>
>
>
> ___
> 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] multiple views + instancing

2017-11-15 Thread David Heitbrink
I am using osg 3.4.0. I am in a position where I could switch to a newer build.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72392#72392





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


[osg-users] multiple views + instancing

2017-11-15 Thread David Heitbrink
Right now I having problems setting unique uniforms and num instances on a per 
view basis (camera). 

Right now I am using hardware instancing, with a scene with 1000's of 
relatively complex objects, but only a handful of actual models. I was able to 
encode index's to textures + position and rotation transforms into a single 
texture buffer.

To do the viewport culling for this I added "proxy" nodes, which are just 
osg::group nodes, with a compute bound + cull call backs. The cull call back, 
calls back to a class tracking which instances are visible in which view. Each 
view has a group attach to it between the camera and the main scene. In said 
group, the texture buffer object is attached here.

The instanced models are further down in the scene graph. I in a draw callback 
from camera, I update each models uniform for its offset into the texture 
buffer, its instance count, plus texture buffer (transforms + some options for 
the fragment shader).  All of this works great until I have multiple cameras.

 Basically I cannot figure out a good way of modifying the instance count + 
offset uniform so I get unique values for each camera. Does anyone have some 
advice for this?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72391#72391





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


Re: [osg-users] Multiple views

2012-04-05 Thread Andrey Ibe
Hi,
i'm not really an experienced user, i have issues of my own, but i have a 
couple of suggestions for you:

check the osgCompositeViewer example and its source code - there you can find a 
way to open several views in one window as well as open several windows, as you 
please.
for having several cameras with different offset move at the same time, use 
osg::view's method addSlave. actually, you do not have to specify any offset, 
if you want the cameras to behave exactly the same.
an example of creating a slave camera (with an ABSOLURE_RF reference frame 
though) is in osgHud example. What you need is RELATIVE_RF, which is default.

hope this helps.

Cheers,
Andrey

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46820#46820





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


Re: [osg-users] Multiple views

2012-04-05 Thread Robert Osfield
Hi Sagar,

Have a look at the osgcompositeviewer for example of how to manage
multiple views, all views can share the same scene graph so can do
this for.  As for sync'ing the Camera's view matrices and
CameraManipulators you'll need to do this manually yourself in the
frame loop after the update and event traversals, but before the
rendering traversals.  The frame loop would look something like:

viewer.realize();
while (!viewer.done())
{
viewer.advance();

viewer.eventTraversal();
viewer.updateTraversal();

// sync the views's Camera and CameraManipulators

viewer.renderingTraversals();
}


Robert.

On 20 March 2012 18:29, Sagar Rajput hcu.sa...@gmail.com wrote:
 Hi,
     Friends !
    It's My first post in this forum . I have some problems in creating 
 different views of scene .My total problem is:
 I need to create 3 different views of scene .2 views should be rendered on 
 one window and other one should be on another window.When I move one window 
 scene using mouse  the corresponding effect also should be visible in other 
 window .

 Can someone help me plz ?

 Thank you!

 Cheers,
 Sagar

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=46456#46456





 ___
 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] Multiple views

2012-04-04 Thread Sagar Rajput
Hi,
 Friends !
It's My first post in this forum . I have some problems in creating 
different views of scene .My total problem is:
I need to create 3 different views of scene .2 views should be rendered on one 
window and other one should be on another window.When I move one window scene 
using mouse  the corresponding effect also should be visible in other window .
 
Can someone help me plz ? 

Thank you!

Cheers,
Sagar

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46456#46456





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


[osg-users] Multiple views with different frame rate

2011-02-23 Thread Lars Erling
Hi,

Has there been any new implementation to support multiple views with a 
different frame rate? Our need is to update one small view with 48Hz, and two 
other larger views with 1Hz...

Thank you!

Cheers,
Lars

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=37021#37021





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


Re: [osg-users] Multiple views with different frame rate

2011-02-23 Thread Robert Osfield
Hi Lars,

On Wed, Feb 23, 2011 at 2:08 PM, Lars Erling
lars.erling.thor...@kongsberg.com wrote:
 Has there been any new implementation to support multiple views with a 
 different frame rate? Our need is to update one small view with 48Hz, and two 
 other larger views with 1Hz...

There hasn't been any work to the core OpenSceneGraph to support views
with different frame rates.

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


Re: [osg-users] multiple views on separate Qt widgets

2009-03-03 Thread Robert Osfield
Hi Richard,

My best guess would be that you haven't attached the Camera's to the
appropriate graphics context properly, there isn't any difference in
the way that 2.6 and 2.8 handle window inheritance so I'm surprised
you see a difference, perhaps something else in the mix has changed.
I'm not a QT expert so I have to defer to others for the specifics.

Robert.

On Mon, Mar 2, 2009 at 11:45 PM, Richard Baron Penman
richardbp+...@gmail.com wrote:
 hi,

 the 2.6 screenshot shows the expected functionality (the right panel is a
 top down view).
 The problem is in 2.8 my composite views are rendered on the desktop instead
 of within the window. Can you think of a reason for this?
 I suspected the problem is how I create the view in the SceneOSG::addView()
 function.

 Richard


 On Mon, Mar 2, 2009 at 8:41 PM, Robert Osfield robert.osfi...@gmail.com
 wrote:

 HI Richard,

 The right window looks odd, is this correct?  Is this way one should
 expect if everything is working or is this an example of the problem?

 Robert.

 On Sun, Mar 1, 2009 at 11:54 PM, Richard Baron Penman osgfo...@tevs.eu
 wrote:
  Sure, here is a screenshot with 2.6 where the composite views are
  contained within the window.
  Richard
 
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=7715#7715
 
 
 
 
  ___
  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] multiple views on separate Qt widgets

2009-03-02 Thread Richard Baron Penman
hi,

the 2.6 screenshot shows the expected functionality (the right panel is a
top down view).
The problem is in 2.8 my composite views are rendered on the desktop instead
of within the window. Can you think of a reason for this?
I suspected the problem is how I create the view in the SceneOSG::addView()
function.

Richard


On Mon, Mar 2, 2009 at 8:41 PM, Robert Osfield robert.osfi...@gmail.comwrote:

 HI Richard,

 The right window looks odd, is this correct?  Is this way one should
 expect if everything is working or is this an example of the problem?

 Robert.

 On Sun, Mar 1, 2009 at 11:54 PM, Richard Baron Penman osgfo...@tevs.eu
 wrote:
  Sure, here is a screenshot with 2.6 where the composite views are
 contained within the window.
  Richard
 
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=7715#7715
 
 
 
 
  ___
  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] multiple views on separate Qt widgets

2009-03-01 Thread Richard Baron Penman
Sure, here is a screenshot with 2.6 where the composite views are contained 
within the window.
Richard

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=7715#7715



attachment: screenshot_2.6.JPG___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple views on separate Qt widgets

2009-02-27 Thread Robert Osfield
Hi Richard,

Could you explain what we should be expecting.  For instance a
screenshot of what it originally looked like would be useful.

Robert.

On Fri, Feb 27, 2009 at 1:58 AM, Richard Baron Penman osgfo...@tevs.eu wrote:
 hello,

 When I upgraded from 2.4 to 2.6 the CompositeViewer example in my previous 
 post broke so that the model rendered outside the window on the desktop.
 A screenshot and the original code are attached.

 I suspect I was doing something illegal in the SceneOSG::addView() method but 
 got away with it in the previous version. If you are experienced with the 
 Viewer class could you take a look?

 thanks,
 Richard

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=7565#7565




 ___
 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] multiple views on separate Qt widgets

2009-02-26 Thread Richard Baron Penman
whoops, got the versions wrong - I upgraded from 2.6 to 2.8.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=7570#7570





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


Re: [osg-users] multiple views on separate Qt widgets

2008-12-01 Thread Richard Baron Penman
hi Robert,

I've tried both methods used in the example and got both working for a
single view, but not for multiple.
The problem seems to be with having separate timeout loops calling
composite_viewer-frame(). Is there an alternative way to render a view?

Richard


On Mon, Dec 1, 2008 at 10:00 PM, Robert Osfield [EMAIL PROTECTED]wrote:

 Hi Richard,

 You don't mention how you are actually implementing the link between
 OSG and QT, are you using GraphicsWindowEmbedded or using the window
 inheritance of osgViewer.  The GraphicsWindowEmbedded route is very
 restricted as it's simplicity hides all the
 makeCurrent/releaseContext/swapBuffer functionality that a fully
 threaded/multi-context viewer requires.

 Robert.

 On Mon, Dec 1, 2008 at 1:09 AM, Richard Baron Penman
 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  hello,
 
  I am trying to provide multiple views of an OpenSceneGraph scene within a
 Qt
  window.
  I can get this working for a single view, or multiple views in the same
  widget like in the osgviewerQT composite example. But I'm struggling to
 get
  multiple views on separate widgets working.
 
  I know many variations of this question have been asked:
 
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg08512.html
 
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg04883.html
 
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg05487.html
 
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg16623.html
  etc
 
  But I am still not clear how to render each view. The examples use
  composite_viewer-frame() in the paint event but for me this only renders
 a
  single view and leaves the rest blank.
  Is there an alternative way to render multiple views at the same time?
 
  Richard
 
  ___
  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] multiple views on separate Qt widgets

2008-12-01 Thread Robert Osfield
Hi Richard,

The osgViewer:::CompositeViewer/Viewer architecture is designed to
support one frame loop driving all the windows associated with that
viewer, not multiple places trying to dispatch frame().   So you use a
single timer.  Or use multiple viewers.

Robert.

On Mon, Dec 1, 2008 at 11:16 AM, Richard Baron Penman
[EMAIL PROTECTED] wrote:
 hi Robert,

 I've tried both methods used in the example and got both working for a
 single view, but not for multiple.
 The problem seems to be with having separate timeout loops calling
 composite_viewer-frame(). Is there an alternative way to render a view?

 Richard


 On Mon, Dec 1, 2008 at 10:00 PM, Robert Osfield [EMAIL PROTECTED]
 wrote:

 Hi Richard,

 You don't mention how you are actually implementing the link between
 OSG and QT, are you using GraphicsWindowEmbedded or using the window
 inheritance of osgViewer.  The GraphicsWindowEmbedded route is very
 restricted as it's simplicity hides all the
 makeCurrent/releaseContext/swapBuffer functionality that a fully
 threaded/multi-context viewer requires.

 Robert.

 On Mon, Dec 1, 2008 at 1:09 AM, Richard Baron Penman
 [EMAIL PROTECTED] wrote:
  hello,
 
  I am trying to provide multiple views of an OpenSceneGraph scene within
  a Qt
  window.
  I can get this working for a single view, or multiple views in the same
  widget like in the osgviewerQT composite example. But I'm struggling to
  get
  multiple views on separate widgets working.
 
  I know many variations of this question have been asked:
 
  http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg08512.html
 
  http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg04883.html
 
  http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg05487.html
 
  http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg16623.html
  etc
 
  But I am still not clear how to render each view. The examples use
  composite_viewer-frame() in the paint event but for me this only
  renders a
  single view and leaves the rest blank.
  Is there an alternative way to render multiple views at the same time?
 
  Richard
 
  ___
  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] multiple views on separate Qt widgets

2008-12-01 Thread Robert Osfield
Hi Richard,

You don't mention how you are actually implementing the link between
OSG and QT, are you using GraphicsWindowEmbedded or using the window
inheritance of osgViewer.  The GraphicsWindowEmbedded route is very
restricted as it's simplicity hides all the
makeCurrent/releaseContext/swapBuffer functionality that a fully
threaded/multi-context viewer requires.

Robert.

On Mon, Dec 1, 2008 at 1:09 AM, Richard Baron Penman
[EMAIL PROTECTED] wrote:
 hello,

 I am trying to provide multiple views of an OpenSceneGraph scene within a Qt
 window.
 I can get this working for a single view, or multiple views in the same
 widget like in the osgviewerQT composite example. But I'm struggling to get
 multiple views on separate widgets working.

 I know many variations of this question have been asked:
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg08512.html
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg04883.html
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg05487.html
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg16623.html
 etc

 But I am still not clear how to render each view. The examples use
 composite_viewer-frame() in the paint event but for me this only renders a
 single view and leaves the rest blank.
 Is there an alternative way to render multiple views at the same time?

 Richard

 ___
 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] multiple views on separate Qt widgets

2008-12-01 Thread Richard Baron Penman
The examples I've seen put frame() in their paint event and don't render
without it there. Is there an example available that implements the
architecture you describe?

 Or use multiple viewers.
that would be the simplest way. Can viewers share the same node group
memory?

Richard


On Mon, Dec 1, 2008 at 10:23 PM, Robert Osfield [EMAIL PROTECTED]wrote:

 Hi Richard,

 The osgViewer:::CompositeViewer/Viewer architecture is designed to
 support one frame loop driving all the windows associated with that
 viewer, not multiple places trying to dispatch frame().   So you use a
 single timer.  Or use multiple viewers.

 Robert.

 On Mon, Dec 1, 2008 at 11:16 AM, Richard Baron Penman
 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  hi Robert,
 
  I've tried both methods used in the example and got both working for a
  single view, but not for multiple.
  The problem seems to be with having separate timeout loops calling
  composite_viewer-frame(). Is there an alternative way to render a view?
 
  Richard
 
 
  On Mon, Dec 1, 2008 at 10:00 PM, Robert Osfield 
 [EMAIL PROTECTED]
  wrote:
 
  Hi Richard,
 
  You don't mention how you are actually implementing the link between
  OSG and QT, are you using GraphicsWindowEmbedded or using the window
  inheritance of osgViewer.  The GraphicsWindowEmbedded route is very
  restricted as it's simplicity hides all the
  makeCurrent/releaseContext/swapBuffer functionality that a fully
  threaded/multi-context viewer requires.
 
  Robert.
 
  On Mon, Dec 1, 2008 at 1:09 AM, Richard Baron Penman
  [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
   hello,
  
   I am trying to provide multiple views of an OpenSceneGraph scene
 within
   a Qt
   window.
   I can get this working for a single view, or multiple views in the
 same
   widget like in the osgviewerQT composite example. But I'm struggling
 to
   get
   multiple views on separate widgets working.
  
   I know many variations of this question have been asked:
  
  
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg08512.html
  
  
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg04883.html
  
  
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg05487.html
  
  
 http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg16623.html
   etc
  
   But I am still not clear how to render each view. The examples use
   composite_viewer-frame() in the paint event but for me this only
   renders a
   single view and leaves the rest blank.
   Is there an alternative way to render multiple views at the same time?
  
   Richard
  
   ___
   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

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


Re: [osg-users] multiple views on separate Qt widgets

2008-12-01 Thread Robert Osfield
HI Richard,

On Mon, Dec 1, 2008 at 11:48 AM, Richard Baron Penman
[EMAIL PROTECTED] wrote:
 The examples I've seen put frame() in their paint event and don't render
 without it there. Is there an example available that implements the
 architecture you describe?

Well all the examples except the ones like osgviewerQT have a main
loop that drives the rendering.  These are frame driven rather than
event driven.  Almost all vis-sim/games application should be frame
driven rather than event driven.  Only interactive applications should
use event driven, but even then frame driven can still be used and may
be preferred.

 Or use multiple viewers.
 that would be the simplest way. Can viewers share the same node group
 memory?

You can do it, but you need take care of the sync'ing the FrameStamp
between each traversal as otherwise the state of the scene graph can
get thrashed between different times.

You are getting well beyond what I have personally experimented with
though so I can't really help you along this journey.

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


Re: [osg-users] multiple views on separate Qt widgets

2008-12-01 Thread Jean-Sébastien Guay

Hello Richard,

I am trying to provide multiple views of an OpenSceneGraph scene within 
a Qt window.


[...]

But I am still not clear how to render each view. The examples use 
composite_viewer-frame() in the paint event but for me this only 
renders a single view and leaves the rest blank.

Is there an alternative way to render multiple views at the same time?


I've seen you're considering having separate viewers, but I would 
suggest you use a single CompositeViewer. That will make sure you get 
the benefits of OSG's threading of update, cull and draw traversals.


Just add views to your viewer, and have each view's camera have a 
GraphicsWindow whose inheritedWindowData is:


traits-inheritedWindowData = new WindowData(winId());

(using the definition of WindowData at the top of QOSGWidget.cpp)

I personally realize() the graphics contexts at creation, because the 
CompositeViewer has a few early-exit conditions where it will not 
execute some branch if *one* of its views' contexts is realized, so I 
just want to make sure the all are.


Make sure you assign the scene data to your new view, and make sure your 
camera's projection matrix is sane. We had a problem where the window 
was first created by QT with a 0 width, so the initial projection matrix 
was not valid, and then any attempt to change the projection matrix (in 
the resizeEvent) would still use the invalid matrix as its starting 
point, so we would not see anything in the view.


Also, another caveat, often when reparenting a QT widget, its HWND (on 
Windows) changes. At that point of course, we need to recreate the 
graphics context, since it's tied to the widget's HWND, otherwise it 
would try to draw to an invalid HWND and fail.


Other than that, you might have to experiment with threading (when to 
create the context, when to stopThreading and startThreading, etc.). We 
still don't have an optimal solution, as you can see in the thread 
CompositeViewer addView threading issue on Windows?.


Hope this helps,

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] multiple views on separate Qt widgets

2008-11-30 Thread Richard Baron Penman
hello,

I am trying to provide multiple views of an OpenSceneGraph scene within a Qt
window.
I can get this working for a single view, or multiple views in the same
widget like in the osgviewerQT composite example. But I'm struggling to get
multiple views on separate widgets working.

I know many variations of this question have been asked:
http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg08512.html
http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg04883.html
http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg05487.html
http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg16623.html
etc

But I am still not clear how to render each view. The examples use
composite_viewer-frame() in the paint event but for me this only renders a
single view and leaves the rest blank.
Is there an alternative way to render multiple views at the same time?

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