Re: [osg-users] limit Camera display framerate

2007-06-04 Thread Mathias Froehlich

Hi Robert,

On Friday 01 June 2007 18:05, Robert Osfield wrote:
 On 6/1/07, Emmanuel Roche [EMAIL PROTECTED] wrote:
  okay, and in this case, is it possible / tested to have multiple viewers
  on the same OpenGL Context ?...

 You can multiple views that share the same graphics context, but
 you'll need to use a single CompositeViewer for it to ensure that the
 threads are sycronized.

 You also need to realistic, frame rate is governed by the swap buffers
 of a window, when you do swap buffers all cameras drawing to that
 window have to redrawn, you can't selectively say I just want swap
 buffers on one cameras viewport on that window.

Well, I can see an application of a frame rate limit for specific contexts.

I would like to make mpeg movies from a running simulation with an existing 
viewer with one or more windows.
The idea is to attach an additional pbuffer slave camera with a post render 
callback that converts the resulting image to yuv and writes it into a pipe 
to an external encoder program. Using an additional camera will ensure that 
you are free to resize the window that is displayed and that you do not rely 
on other windows not being on top of the opengl window.
Obviously it is a waste of cpu/gpu power if this is done with 60 hz. Rendering 
with 30 hz - that is omitting every second frame - for that kind of slave 
camera would be good.

   Greetings

Mathias


-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] limit Camera display framerate

2007-06-04 Thread Robert Osfield

Hi Mathias,

If you used a FBO to capture the image then you could possible just
embed the video recording camera into the viewer, and then use the
node mask to switch it off when you don't need it.

Alternatively, if you want a fixed frame rate that is decoupled from
the main viewer then you might be forced to runa separate viewer with
its own thread running its frame loop.  You'll need a separate copy of
the scene graph for this though.  Actually this might even be best
done a separate application that you can run in the background and
just get it to watch the main apps view matrices and settings.

As part of the core OSG's viewer library there is a limit on how much
flexibility we can provide without ending up with a really convoluted
API and implementation.

Robert.

On 6/4/07, Mathias Froehlich [EMAIL PROTECTED] wrote:


Hi Robert,

On Friday 01 June 2007 18:05, Robert Osfield wrote:
 On 6/1/07, Emmanuel Roche [EMAIL PROTECTED] wrote:
  okay, and in this case, is it possible / tested to have multiple viewers
  on the same OpenGL Context ?...

 You can multiple views that share the same graphics context, but
 you'll need to use a single CompositeViewer for it to ensure that the
 threads are sycronized.

 You also need to realistic, frame rate is governed by the swap buffers
 of a window, when you do swap buffers all cameras drawing to that
 window have to redrawn, you can't selectively say I just want swap
 buffers on one cameras viewport on that window.

Well, I can see an application of a frame rate limit for specific contexts.

I would like to make mpeg movies from a running simulation with an existing
viewer with one or more windows.
The idea is to attach an additional pbuffer slave camera with a post render
callback that converts the resulting image to yuv and writes it into a pipe
to an external encoder program. Using an additional camera will ensure that
you are free to resize the window that is displayed and that you do not rely
on other windows not being on top of the opengl window.
Obviously it is a waste of cpu/gpu power if this is done with 60 hz. Rendering
with 30 hz - that is omitting every second frame - for that kind of slave
camera would be good.

   Greetings

Mathias


--
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
--
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] limit Camera display framerate

2007-06-04 Thread Mathias Froehlich

Hi Robert,

On Monday 04 June 2007 10:33, Robert Osfield wrote:
 As part of the core OSG's viewer library there is a limit on how much
 flexibility we can provide without ending up with a really convoluted
 API and implementation.
Sure.

Is there any callback in the camera that can disable rendering in that case?
Something like a callback that can omit every second frame or a quick way to 
disable such a camera completely every second frame together with an 
apropriate update callback for example?

Are the node masks of these 'toplevel cameras' honoured, so that I just switch 
off that camera by a 0 node mask every other frame?

Greetings

   Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] limit Camera display framerate

2007-06-04 Thread Robert Osfield

HI Mathias,

On 6/4/07, Mathias Froehlich [EMAIL PROTECTED] wrote:

Is there any callback in the camera that can disable rendering in that case?
Something like a callback that can omit every second frame or a quick way to
disable such a camera completely every second frame together with an
apropriate update callback for example?

Are the node masks of these 'toplevel cameras' honoured, so that I just switch
off that camera by a 0 node mask every other frame?


The update callbacks on a camera won't be called (I think :-) if the
NodeMask is 0 so it wouldn't be suitable to doing the toggling.

You could do the toggling the main loop though, i.e.

 while (!viewer.done())
 {
 camera1-setNodeMask(~camera1-setNodeMask());
 viewer.frame();

 }



Robert.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] limit Camera display framerate

2007-06-04 Thread Mathias Froehlich

Hi Robert,

On Monday 04 June 2007 11:09, Robert Osfield wrote:
 The update callbacks on a camera won't be called (I think :-) if the
 NodeMask is 0 so it wouldn't be suitable to doing the toggling.

 You could do the toggling the main loop though, i.e.
Ok, I think I just need to play with that a bit ...

Thanks!

 Greetings

  Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] limit Camera display framerate

2007-06-01 Thread Robert Osfield

Hi Many,

You wouldn't limit the framerate of an osg::Camera, but you might
limit the frame rate of a Viewer.  The way to do this right now is to
change the frame loop such the frame dispatch happens are a controlled
time. i.e.

 while (!viewer.done())
 {
 myWaitTillNextFrameShoudlBegin();
  viewer.frame();
 }

Robert.

On 6/1/07, Emmanuel Roche [EMAIL PROTECTED] wrote:

Hello there,

has someone already try to limit the framerate for a given osg::Camera ?

In fact, just starting to use OSG 1.9, I would like to build a window with
multiple Camera on the same openGl context, but with different refresh
rate... is this possible ? and what would be the better starting point ? an
osgCompositeViewer or and ordinary osgViewer is enough ?

thanks for your help !

Manu.


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


Re: [osg-users] limit Camera display framerate

2007-06-01 Thread Emmanuel Roche

okay, and in this case, is it possible / tested to have multiple viewers on
the same OpenGL Context ?...



2007/6/1, Robert Osfield [EMAIL PROTECTED]:


Hi Many,

You wouldn't limit the framerate of an osg::Camera, but you might
limit the frame rate of a Viewer.  The way to do this right now is to
change the frame loop such the frame dispatch happens are a controlled
time. i.e.

  while (!viewer.done())
  {
  myWaitTillNextFrameShoudlBegin();
   viewer.frame();
  }

Robert.

On 6/1/07, Emmanuel Roche [EMAIL PROTECTED] wrote:
 Hello there,

 has someone already try to limit the framerate for a given osg::Camera ?

 In fact, just starting to use OSG 1.9, I would like to build a window
with
 multiple Camera on the same openGl context, but with different refresh
 rate... is this possible ? and what would be the better starting point ?
an
 osgCompositeViewer or and ordinary osgViewer is enough ?

 thanks for your help !

 Manu.


 ___
 osg-users mailing list
 osg-users@openscenegraph.net
 http://openscenegraph.net/mailman/listinfo/osg-users
 http://www.openscenegraph.org/

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Re: [osg-users] limit Camera display framerate

2007-06-01 Thread Emmanuel Roche

Yes I see what you mean, but until now I've managed to use a context this
wait with multiple osgUtil::SceneViews : you just need to be sure that those
sceneviews don't overlap, then you may have a main view with a normal
frame rate and auxiliary views changed only once per second for example...

To be honest, I don't think this is a good solution in fact :-) It would be
a lot more appropriate (I guess ?) to use a render to texture system to
build small textures updated at the needed rate and apply those textures on
small quads... But I must admit I haven't take the time to look at this
updated solution yet :-)

Manu.

2007/6/1, Robert Osfield [EMAIL PROTECTED]:


On 6/1/07, Emmanuel Roche [EMAIL PROTECTED] wrote:
 okay, and in this case, is it possible / tested to have multiple viewers
on
 the same OpenGL Context ?...

You can multiple views that share the same graphics context, but
you'll need to use a single CompositeViewer for it to ensure that the
threads are sycronized.

You also need to realistic, frame rate is governed by the swap buffers
of a window, when you do swap buffers all cameras drawing to that
window have to redrawn, you can't selectively say I just want swap
buffers on one cameras viewport on that window.

Robert.
___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

___
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/