[osg-users] Supporting multiple frame rates

Chris 'Xenon' Hanson xenon at alphapixel.com
Thu Apr 28 19:24:45 PDT 2011


On 4/28/2011 9:39 AM, Brad Huber wrote:
> 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?

  I would.

  This is a long shot, but what if you rendered the 3D scene to a texture using double
alternating texture buffers. While the 3D scene is rendering to the buffer, the HUD can
render the previous frame with the video on top of it to the actual screen. When the next
video frame is ready, if the next 3D scene hasn't finished rendering, just re-use the
previous frame's texture. When the 3D scene does finish rendering, set a flag to indicate
it should now be used by the HUD, and begin rendering the NEXT 3D frame.

  Share resources (a la wglShareLists) so that there isn't a copy overhead transferring
the rendered texture around.

  I've never tried it, but I think it could work, as long as your hardware can deal with
rendering a quick HUD in the midst of rendering the complex 3d background scene.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. Xenon at AlphaPixel.com http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting.
    "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen



More information about the osg-users mailing list