Re: [osg-users] release and flush GL Objects?

2007-10-01 Thread Rafa Gaitan
Hi Robert

On 9/17/07, Robert Osfield [EMAIL PROTECTED] wrote:

 HI Rafa,

 On 9/17/07, Rafa Gaitan [EMAIL PROTECTED] wrote:
  Node doesn't have a releaseAllGLObjects, and trying with
  releaseGLObjects, doesn't work as I expect. Maybe I'm using
  a bad approach to the problem! :(.

 Sorry,

   viewer-releaseGLObjects();



This, doesn't work :(.

Is the call I was thinking of.

  releaseAllGLObjects method is only inside SceneView class
  which is not easily accessible in the osgViewer::Viewer.

 viewer.getSceneData()-releaseGLObjects(); // or getCamera()...
 viewer.getCamera()-getGraphicsContext()-getState()-reset();
 osg::flushAllDeletedGLObjects(0);



Yes, This works better, Thank You!, there is some issues with
PagedLOD nodes, so I need to debug more and see how to solve
them.

Thanks!
Rafa.



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




-- 
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] release and flush GL Objects?

2007-09-19 Thread Schmidt, Richard, SDGE1
Another problem is, that nodes which are currently not connected to the
sceneview/camera won't release their GL objects. 

Richard

On 9/17/07, Rafa Gaitan [EMAIL PROTECTED] wrote:
  viewer.getSceneData()-releaseGLObjects(); // or getCamera()...
 
 viewer.getCamera()-getGraphicsContext()-getState()-reset();
  osg::flushAllDeletedGLObjects(0);


 Yes, This works better, Thank You!, there is some issues with
 PagedLOD nodes, so I need to debug more and see how to solve
 them.

It might well be the database pager has objects still held into its
internal lists but not just merged.

Once you get to the bottom of it we could possibly wrap up all that is
required in a clean up method in
osgViewer::Viewer/CompositeViewer/GraphicsWindowEmbedded.

BTW, could you try removing the original GraphicsWindowEmbedded and
replace it with new one as this is effectively you are doing -
changing the graphics context from underneath the viewer.

Robert.

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


Re: [osg-users] release and flush GL Objects?

2007-09-19 Thread Robert Osfield
On 9/19/07, Schmidt, Richard, SDGE1 [EMAIL PROTECTED] wrote:
 Another problem is, that nodes which are currently not connected to the
 sceneview/camera won't release their GL objects.

Well there isn't much the core OSG can do about this.  If you go
detect objects from the Viewer and it non longer knows anything about
it then its doesn't have any chance to clean things up for you.
You'll need to manually handle this yourself.

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


[osg-users] release and flush GL Objects?

2007-09-17 Thread Rafa Gaitan
Hi Robert,

We are using the osgViewer::Viewer to integrate our app with
Java using jogl to create a GL context and
GraphicsWindowEmbedded class. In the past using the
SimpleViewer we had the call releaseAllGLObjects(),
which internally calls to sceneView-releaseAllGLObjects()
and some more stuff.

Is there any similar call inside osgViewer::Viewer?, with jogl
there is an special Panel that use internally pbuffers to create
the context, but when we resize the component the context is
lost, so calling releaseGLObjects did the trick for us, but now
I don't find a good way to get the same things working.

I tried with viewer-getCamera()-releaseGLObjects(); but doesn't
work. Maybe adding a releaseAllGLObjects method in View, or
in Viewer is a good place. thoughts?

Rafa.


-- 
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] release and flush GL Objects?

2007-09-17 Thread Robert Osfield
Hi Rafa,

I'm not 100% sure it will work but try:

 viewer-getSceneData()-releaseAllGLObjects();

Robert.

On 9/17/07, Rafa Gaitan [EMAIL PROTECTED] wrote:
 Hi Robert,

 We are using the osgViewer::Viewer to integrate our app with
 Java using jogl to create a GL context and
 GraphicsWindowEmbedded class. In the past using the
 SimpleViewer we had the call releaseAllGLObjects(),
 which internally calls to sceneView-releaseAllGLObjects()
 and some more stuff.

 Is there any similar call inside osgViewer::Viewer?, with jogl
 there is an special Panel that use internally pbuffers to create
 the context, but when we resize the component the context is
 lost, so calling releaseGLObjects did the trick for us, but now
 I don't find a good way to get the same things working.

 I tried with viewer-getCamera()-releaseGLObjects(); but
 doesn't
 work. Maybe adding a releaseAllGLObjects method in View, or
 in Viewer is a good place. thoughts?

 Rafa.


 --
 Rafael Gaitán Linares
 Instituto de Automática e Informática Industrial   http://www.ai2.upv.es
 Ciudad Politécnica de la Innovación
 Universidad Politécnica de Valencia
 ___
 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] release and flush GL Objects?

2007-09-17 Thread Rafa Gaitan
Hi Robert,

On 9/17/07, Robert Osfield [EMAIL PROTECTED] wrote:

 Hi Rafa,

 I'm not 100% sure it will work but try:

 viewer-getSceneData()-releaseAllGLObjects();


Node doesn't have a releaseAllGLObjects, and trying with
releaseGLObjects, doesn't work as I expect. Maybe I'm using
a bad approach to the problem! :(.

releaseAllGLObjects method is only inside SceneView class
which is not easily accessible in the osgViewer::Viewer.

Thanks,
Rafa.

Robert.

 On 9/17/07, Rafa Gaitan [EMAIL PROTECTED] wrote:
  Hi Robert,
 
  We are using the osgViewer::Viewer to integrate our app with
  Java using jogl to create a GL context and
  GraphicsWindowEmbedded class. In the past using the
  SimpleViewer we had the call releaseAllGLObjects(),
  which internally calls to sceneView-releaseAllGLObjects()
  and some more stuff.
 
  Is there any similar call inside osgViewer::Viewer?, with jogl
  there is an special Panel that use internally pbuffers to create
  the context, but when we resize the component the context is
  lost, so calling releaseGLObjects did the trick for us, but now
  I don't find a good way to get the same things working.
 
  I tried with viewer-getCamera()-releaseGLObjects(); but
  doesn't
  work. Maybe adding a releaseAllGLObjects method in View, or
  in Viewer is a good place. thoughts?
 
  Rafa.
 
 
  --
  Rafael Gaitán Linares
  Instituto de Automática e Informática Industrial   http://www.ai2.upv.es
  Ciudad Politécnica de la Innovación
  Universidad Politécnica de Valencia
  ___
  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




-- 
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] release and flush GL Objects?

2007-09-17 Thread Robert Osfield
HI Rafa,

On 9/17/07, Rafa Gaitan [EMAIL PROTECTED] wrote:
 Node doesn't have a releaseAllGLObjects, and trying with
 releaseGLObjects, doesn't work as I expect. Maybe I'm using
 a bad approach to the problem! :(.

Sorry,

  viewer-releaseGLObjects();

Is the call I was thinking of.

 releaseAllGLObjects method is only inside SceneView class
 which is not easily accessible in the osgViewer::Viewer.

You get get the SceneView via the Renderer object which is attached
the Camera in 2.1.x.

However, you shouldn't need it.

All SceneView::releaseAllGLobjects() does is:

void SceneView::releaseAllGLObjects()
{
if (!_camera) return;

_camera-releaseGLObjects(_renderInfo.getState());

// we need to reset State as it keeps handles to Program objects.
if (_renderInfo.getState()) _renderInfo.getState()-reset();
}

And all SceneView::flushAllDeletedGLObjects() does is:

void SceneView::flushAllDeletedGLObjects()
{
_requiresFlush = false;

osg::flushAllDeletedGLObjects(getState()-getContextID());
}

So you could try:

viewer.getSceneData()-releaseGLObjects(); // or getCamera()...
viewer.getCamera()-getGraphicsContext()-getState()-reset();
osg::flushAllDeletedGLObjects(0);
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] release and flush GL Objects?

2007-09-17 Thread Robert Osfield
On 9/17/07, Rafa Gaitan [EMAIL PROTECTED] wrote:
  viewer.getSceneData()-releaseGLObjects(); // or getCamera()...
 
 viewer.getCamera()-getGraphicsContext()-getState()-reset();
  osg::flushAllDeletedGLObjects(0);


 Yes, This works better, Thank You!, there is some issues with
 PagedLOD nodes, so I need to debug more and see how to solve
 them.

It might well be the database pager has objects still held into its
internal lists but not just merged.

Once you get to the bottom of it we could possibly wrap up all that is
required in a clean up method in
osgViewer::Viewer/CompositeViewer/GraphicsWindowEmbedded.

BTW, could you try removing the original GraphicsWindowEmbedded and
replace it with new one as this is effectively you are doing -
changing the graphics context from underneath the viewer.

Robert.

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