Re: [osg-users] Single scene, multiple viewers : problem with texture

2012-01-06 Thread Robert Osfield
Hi Aurelien,

Sorry for the slow reply, no trying to catch up on my email backlog...

osgViewer::CompositeViewer is designed for applications that have
multiple Views and your usage model fits this perfectly.  The only
thing to be careful of is when you are adding and removing View's from
the CompositeViewer you should do is calling stopThreading() on the
viewer prior to adding or removing views, then call startThreading()
afterwards.  If you are running SingleThreaded or
CullDrawThreadPerContext you won't need to worry about stop and
starting threads.

Robert.

On 29 November 2011 15:55, Aurelien Albert aurelien.alb...@alyotech.fr wrote:
 Hi Robert,

 In my application, there is a main viewer to edit the scene, and the user 
 can open/close secondary viewer windows.

 These secondary viewer windows are not limited in number (sure, there is 
 hardware limits...) and the camera is independant from the other viewers (to 
 see different point of view).

 So when user open a new secondary viewer window, I create a new viewer 
 instance, a new camera, and the context is shared with the main window.

 When user close a secondary window, I delete the associated viewer to release 
 some resources.

 The secondary windows can also be resized, so the viewport is also 
 independant.

 Each viewer (main and secondary) are embeded in a Qt widget.

 Is there any way to do this with a composite viewer ?

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





 ___
 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] Single scene, multiple viewers : problem with texture

2011-11-29 Thread Aurelien Albert
Hi,

Can you explain what you mean by dynamically linking the node ?

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





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


Re: [osg-users] Single scene, multiple viewers : problem with texture

2011-11-29 Thread Aurelien Albert
I found the solution :

Using the osgUtil::Optimizer::TextureVisitor to set all textures to 
UnrefImageAfterApply = false

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





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


Re: [osg-users] Single scene, multiple viewers : problem with texture

2011-11-29 Thread Robert Osfield
HI Aurelien,

You should use multiple View's within a single CompositeViewer for
doing this rather than multiple viewers.

Robert.

On 28 November 2011 16:15, Aurelien Albert aurelien.alb...@alyotech.fr wrote:
 Hi,

 I've got a problem when viewing the same scene from two different viewers :

 - Viewer A with Camera A
 - Viewer B with Camera B

 I load a node with :


 Code:
 osg::ref_ptrosg::Node pNode = osgDB::readNodeFile(...);



 Then I do :


 Code:
 p_viewerA-setCamera(p_cameraA);
 p_viewerA-setSceneData(pNode);

 p_viewerB-setCamera(p_cameraB);
 p_viewerB-setSceneData(pNode);




 Everything works fine, but when viewer B is deleted, pNode's textures are no 
 more rendered in viewer A (geometry is still rendered correctly).

 Is there anything special to do to share data between two viewer ?

 Thank you!

 Cheers,
 Aurelien

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





 ___
 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] Single scene, multiple viewers : problem with texture

2011-11-29 Thread Aurelien Albert
Hi Robert,

In my application, there is a main viewer to edit the scene, and the user can 
open/close secondary viewer windows.

These secondary viewer windows are not limited in number (sure, there is 
hardware limits...) and the camera is independant from the other viewers (to 
see different point of view).

So when user open a new secondary viewer window, I create a new viewer 
instance, a new camera, and the context is shared with the main window.

When user close a secondary window, I delete the associated viewer to release 
some resources.

The secondary windows can also be resized, so the viewport is also independant.

Each viewer (main and secondary) are embeded in a Qt widget.

Is there any way to do this with a composite viewer ?

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





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


[osg-users] Single scene, multiple viewers : problem with texture

2011-11-28 Thread Aurelien Albert
Hi,

I've got a problem when viewing the same scene from two different viewers :

- Viewer A with Camera A
- Viewer B with Camera B

I load a node with : 


Code:
osg::ref_ptrosg::Node pNode = osgDB::readNodeFile(...);



Then I do :


Code:
p_viewerA-setCamera(p_cameraA);
p_viewerA-setSceneData(pNode);

p_viewerB-setCamera(p_cameraB);
p_viewerB-setSceneData(pNode);




Everything works fine, but when viewer B is deleted, pNode's textures are no 
more rendered in viewer A (geometry is still rendered correctly).

Is there anything special to do to share data between two viewer ?

Thank you!

Cheers,
Aurelien

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





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


Re: [osg-users] Single scene, multiple viewers : problem with texture

2011-11-28 Thread David Glenn

Aurelien wrote:
 Hi,
 
 I've got a problem when viewing the same scene from two different viewers :
 
 - Viewer A with Camera A
 - Viewer B with Camera B
 
 I load a node with : 
 
 
 Code:
 osg::ref_ptrosg::Node pNode = osgDB::readNodeFile(...);
 
 
 
 Then I do :
 
 
 Code:
 p_viewerA-setCamera(p_cameraA);
 p_viewerA-setSceneData(pNode);
 
 p_viewerB-setCamera(p_cameraB);
 p_viewerB-setSceneData(pNode);
 
 
 
 
 Everything works fine, but when viewer B is deleted, pNode's textures are no 
 more rendered in viewer A (geometry is still rendered correctly).
 
 Is there anything special to do to share data between two viewer ?
 
 Thank you!
 
 Cheers,
 Aurelien


Well, I would look at it differently (like using slave cameras), but in this 
case, have you tried dynamically linking the node?

D Glenn


David Glenn
---
D Glenn 3D Computer Graphics amp; Media Systems.
www.dglenn.com

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





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