[osg-users] Loading problem, OpenVR integration

Robert Osfield robert.osfield at gmail.com
Thu Nov 3 01:10:10 PDT 2016

Hi Lorenzo,

The performance constraints on immersive stereo display systems are
pretty well the tightest in graphics, even small glitchs can be lead
to unpleasant experience.  Couple this with rendering more than twice
as much data (two eyes and distortion correction passes) means that
you don't have much wiggle room to make sure things run sweetly. Good
VR isn't easy so you'll need to be patient with learning the issues
and how to resolve them, as a dev new to the area you've jumped in the
deep end :-)

Is the scene static or is your application adding new scene graph
objects through the lifetime of the application?

It's only new objects that you need to compile to make sure that the
graphics objects are created and ready to download to the GPU?

The other issue might be that the graphic objects have are all
compiled already but not download to the GPU.  Also if the GPU memory
is full the driver has to start moving graphics objects in/out of GPU
memory on the fly which can cause big frame drops.

What specifically you need to do to resolve the problem depends
entirely where the actual bottleneck is, we can't answer this without
knowing more about what is happening your scene graph, how much
headroom you have on the GPU to handle the extra memory usage,
bandwidth and compute work.


On 2 November 2016 at 17:00, Lorenzo Valente <oneiros.valente at gmail.com> wrote:
> Hi,
> I'm working on a Virtual Reality project that involves the rendering of a OSG scene in an Oculus Rift CV1 device using the OpenVR library. All these technologies are pretty new to me so everything is as exciting as frustrating :)
> My code is based on the Chris Denham "osgopenvrviewer" project (you can find it on Github)
> So, my starting point is a osgViewer::View that contains my immersive scene. I managed to render it in the headset display by doing this:
> Code:
> osg::ref_ptr<OpenVRViewer> vrViewer = new OpenVRViewer(myView, myDevice, myRealizeOperation);
> osg::ref_ptr<osg::Node> sceneData = myView->getSceneData();
> vrViewer->addChild(sceneData);
> myView->setSceneData(vrViewer);
> So far so good, the render quality and the stereo effect are perfect.
> The problems start when I move my head to look around in the scene: it looks like the objects outside my first view frustum are not ready when the application starts, so I get serious frame drops when I see these objects for the first time. These frame drops are particulary annoying in the headset, where a frame drop freezes the view for a fraction of second multiple times, causing a very ugly effect.
> This happens only the first time I look around: after a first "scan" of the scene, everything works smoothly and nice.
> The system I'm working on started as a simple desktop application with a single view/camera and I couldn't reproduce these problems in the no-VR version. I can look around very fast using a gamepad without losing any frame.
> So, I guess the problem is in the OpenVR integration.
> Is there anyone who already had this kind of issues? Do you have an idea on how to manage pre-loading of the entire scene before the realtime simulation starts?
> Thank you!
> Cheers,
> Lorenzo
> P.S. I see that many people solved this problem using osgViewer::Renderer->setCompileOnNextDraw(true) but I think it is not enough in my case. I have two RTT slave cameras for VR rendering (left eye and right eye) and I saw that the "setSceneData" method internally calls "setCompileOnNextDraw" on every slave camera in the viewer.
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69205#69205
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list