[osg-users] detected OpenGL error 'out of memory' at After Renderer::compile

82 views
Skip to first unread message

Andrew Nie

unread,
Sep 5, 2013, 8:59:10 AM9/5/13
to osg-...@lists.openscenegraph.org
Hi,
I load several model files and encountered the following warning:
"detected OpenGL error 'out of memory' at After Renderer::compile". Here is my code:

int main()
{

osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer();

osg::ref_ptr<osg::Group> root = new osg::Group();

osg::ref_ptr<osg::Node> node1 = osgDB::readNodeFile("E:\\Scene\\Background.ive");
osg::ref_ptr<osg::Node> node2 = osgDB::readNodeFile("E:\\Scene\\N_0.ive");//
osg::ref_ptr<osg::Node> node3 = osgDB::readNodeFile("E:\\Scene\\Q_0.ive");//
osg::ref_ptr<osg::Node> node4 = osgDB::readNodeFile("E:\\Scene\\TH_0.ive");//


osg::ref_ptr<osg::MatrixTransform> mt = new osg::MatrixTransform();

mt->setMatrix(osg::Matrix::rotate(osg::PI_2,osg::Vec3d(1.0,0.0,0.0)));
mt->addChild(node1);
mt->addChild(node2);
mt->addChild(node3);
mt->addChild(node4);


//
root->addChild(mt);

//
osgUtil::Optimizer optimizer ;
optimizer.optimize(root.get()) ;

osg::ref_ptr<osgGA::TrackballManipulator> tb = new osgGA::TrackballManipulator();
tb->setTrackballSize(0.9);
viewer->setCameraManipulator(tb);
viewer->setSceneData(root.get());

viewer->realize();

viewer->run();

return 0 ;
}

The four ive files (Background.ive,N_0.ive,Q_0.ive,TH_0.ive) are 400M,260M,211M,410M
respectively. I found that,if I only load the first two files, the warning did't appear, but if load one more file of the other two, the warning show up.
Has anyone encountered such a problem?Any advice and suggestion will be appreciated...


...

Thank you!

Cheers,
Andrew

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





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Robert Osfield

unread,
Sep 12, 2013, 11:03:33 AM9/12/13
to OpenSceneGraph Users
Hi Andrew,

If you have too much data for OpenGL to handle it will report an error.  What you have to do is work out how to work with small models or create the models in such a way that they don't have such a large OpenGL footprint.

You say nothing about what your models contain, or what type of application behavior you want when managing these models, given this there really isn't much we can advice, it's simply too open ended.

Robert.

Cary, Karl A.

unread,
Sep 12, 2013, 12:42:07 PM9/12/13
to OpenSceneGraph Users

We have had this issue as well and simply converting our textures to dds fixed everything. We can now load 100x what we could before in terms of number of models. I would look at that type of option first.

Reply all
Reply to author
Forward
0 new messages