Happy new years everyone! Hope everyone had a great holidays!

I just wanted to update this thread and bump it as I am now doing some further 
tweaking on getting things running optimally. 

I narrowed down some things, and I now have ONLY the hands being rendered in 
release mode.  I get around 45 fps.. which is ok, but I would like to see it 
higher.  Unless I am vastly overestimating the capability of this it should be 
able to render the hands up close to 60 fps on release mode.

I've tested running only the API without rendering the hands and the frame rate 
stays a solid 58-60 fps.  The moment I add the hands to the scene and they move 
around the FR drops to around 45.  So I know the sensor data is not the source 
of the delay.  

I tried a traversal class that runs through the hand model.  (Hand model is an 
FBX class with baked in texture and rigging exported from 3DS max) hoping to do 
all the work on the GPU:

 
Code:

class VBO_Updater : public osg::NodeVisitor
{

public:
        VBO_Updater()
                : NodeVisitor(NodeVisitor::TRAVERSE_ALL_CHILDREN)
        {}
        ~VBO_Updater(){}
        virtual void apply(osg::Node &node)
        {
                traverse(node);
        }

        virtual void apply(osg::Geode &geode)
        {
                unsigned int numGeoms = geode.getNumDrawables();

                for (unsigned int i = 0; i < numGeoms; i++)
                {
                        osg::ref_ptr<osg::Geometry> curGeom = 
geode.getDrawable(i)->asGeometry();

                        if (curGeom)
                        {
                                curGeom->setUseDisplayList(false);
                                curGeom->setUseVertexBufferObjects(true);
                                osg::ref_ptr<VertexBufferObject> df = 
curGeom->getOrCreateVertexBufferObject();
                                df->setUsage(GL_STREAM_DRAW);
                                osg::ref_ptr<osg::StateSet> stateset = 
curGeom->getOrCreateStateSet();
                                stateset->setAttributeAndModes(new 
osg::CullFace());
                        }
                }

        }

private:

};




But this didn't seem to do anything for the frame rate.  I assume that the fbx 
model is still not being skinned on the GPU.  How do I make sure that the GPU 
is doing the hard work and not the CPU?

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62226#62226





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to