[osg-users] Supporting multiple frame rates

Brad Huber bradh at procerus.com
Thu Apr 28 09:52:21 PDT 2011

Robert, Farshid,

Thanks for the ideas.

Given what you've said, would it make more sense to pursue using two
contexts?  Perhaps the main scene would render to an invisible "off screen"
context and then the visible context would copy the frame buffer from the
invisible context and render the video frames on top of that.  I imagine
there would be some difficulty in having additional threading complexity to
deal with.


-----Original Message-----
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Robert
Sent: Thursday, April 28, 2011 9:59 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Supporting multiple frame rates

Hi Brad,

I'm afraid decoupling the rendering of two parts of graphics window so that
they can run at their own frame rate won't be a straight forward task, and
well off the standard viewer path used by the vast majority of the
community.  You are infact the first I recall wanting to do exactly this
combination of video at 30fps and man scene at it's own frame rate.

Thoughts off the top of my head:

    You only need to do something special when 3D scene takes longer than
30ms and would cause
    frame rate to drop below the min 30fps, so the follow suggestions are
for when frame rate would
    drop below 30.

    Could you render the video to the front buffer and just overlay the
background 3D scene?  This
    would enable you to remove the need for a swap buffers call at the end
of the render of teh video texture.

    Another approach would be to render the 3D scene into a texture and then
compose each frame
    from the 3D scene texture and the video texture and do the swap buffers
at video texture frame rate.

    In both cases you the 3D scene is taking too long to render, and since
you are using a single
    graphics context there isn't a natural way to split up and decouple the
rendering completely,
    so to be able to put out frames at 30fps you'll need to break the render
of the 3D scene into
    segments each of which can fit into with the time available when
rendering at 30fps.

    Splitting the scene won't be trivial, the easist method would be
something like depth partitioning,
    and render different partition in depth and balance the depth range for
each so that the load is
    as well balanced as you can get it.

That's my best suggestions so far...  Far from trivial to set up, very much
on the bleeding edge!


On Thu, Apr 28, 2011 at 4:39 PM, Brad Huber <bradh at procerus.com> wrote:
> Hello,
> We currently have an OSG based application which renders at 30-60+ fps 
> on our development hardware with discrete gpus.  Unfortunately we have 
> to be able to  deploy on a wide range of hardware including stuff that 
> is significantly less capable (Intel GPUs, etc).  On some of these 
> slower platforms we are seeing framerates that are 10-15 fps.  This is 
> actually ok for us with one exception, live video.
> We show live video in the scene graph (for now strictly in the HUD).  
> We have a requirement to make the video render at native speed (~30 
> fps).  I am looking for a way to make the HUD/video render at 30 fps 
> and let the rest of the scene graph render at a floating rate (whatever
the machine can handle).
> How might this be accomplished?  Since this is a HUD, obviously it 
> must ultimately render to the same graphics context, however it 
> doesn’t really need to respect the depth buffer, etc of the rest of 
> the scene (it should always render on top).
> PS Should I be thinking about render to texture?
> Related threads I came across:
> http://forum.openscenegraph.org/viewtopic.php?t=7858
> http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org
> /2008-January/006000.html
> http://forum.openscenegraph.org/viewtopic.php?t=7117
> Thanks
> -Brad
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
> org
osg-users mailing list
osg-users at lists.openscenegraph.org

More information about the osg-users mailing list