[osg-users] Limit in size of VBOs?

Robert Osfield robert.osfield at gmail.com
Wed Sep 6 01:55:31 PDT 2017


Hi Antoine,

There isn't much we can pinpoint from the information provided.  It could
be a driver bug, it could be a straight out of memory issue.

What OSG version are you using?  What OS/hardware/drivers/build tools are
you using?

Have you tried other OS/hadwardware/driver combinations?

Robert.

On 6 September 2017 at 09:49, Antoine Rennuit <antoinerennuit at hotmail.com>
wrote:

> Dear OSG forum,
>
> I am currently switching from using display lists to using VBOs.
>
> I display 2 different meshes with it:
>
>          one is a usual mesh with ~1000 triangles
>
>          the other one is very dense ~10M vertices (from a room scan)
>
>
>
> The usual mesh displays fine with the VBOs, but when adding the dense mesh
> I have a crash in the rendering, here is my calls stack:
>
> [img]https://drive.google.com/open?id=0B4i1g-UqIF8yZFk4TlRrblVrUVk[/img]
>
> As you can see, it is really at the rendering stage that the problem
> happens, not when setting up the VBO.
>
> Here is my code
>
>
> Code:
>
> osg::ref_ptr<osg::Geode> SetupMesh(const Eigen::Vector3Array& vertices,
> IntegerArray const& triangles, const Eigen::Vector3Array& normals, const
> osg::Vec4f& color, Node* node)
> {
>     osg::ref_ptr<osg::Geode> geode = new osg::Geode();
>     assert(geode);
>     osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry();
>     assert(geometry);
>     osg::ref_ptr<osg::Vec3Array> vertices_osg = new osg::Vec3Array();
>     assert(vertices_osg);
>     osg::ref_ptr<osg::Vec3Array> normals_osg = new osg::Vec3Array();
>     assert(normals_osg);
>     osg::ref_ptr<osg::DrawElementsUInt> triangles_osg = new
> osg::DrawElementsUInt(osg::PrimitiveSet::TRIANGLES, 0);
>     assert(triangles_osg);
>     osg::ref_ptr<osg::Vec4Array> colors = new osg::Vec4Array();
>     assert(colors);
>
>     osg::ref_ptr<NodeReference> userData = new NodeReference(node);
>     geometry->setUserData(userData);
>
>     // VBO.
> //    geometry->setUseDisplayList(false);
>     geometry->setUseVertexBufferObjects(true);
>
>     // Setup.
>     geode->addDrawable(geometry);
>     geometry->setVertexArray(vertices_osg);
>     geometry->setNormalArray(normals_osg);
>     geometry->addPrimitiveSet(triangles_osg);
>     geometry->setColorArray(colors);
>
>     // Vertices.
>     vertices_osg->reserve(vertices.size());
>     for (int i = 0; i < vertices.size(); ++i)
>         vertices_osg->push_back(EigenToOsgVector3(vertices[i]));
>
>     // Normals.
>     normals_osg->setBinding(osg::Array::BIND_PER_VERTEX);
>
>     normals_osg->reserve(normals.size());
>     for (int i = 0; i < normals.size(); ++i)
>         normals_osg->push_back(EigenToOsgVector3(normals[i]));
>
>     // Triangles.
>     triangles_osg->reserve(triangles.size());
>     for (int i = 0; i < triangles.size(); ++i)
>         triangles_osg->push_back(triangles[i]);
>
>     // Colors.
>     colors->setBinding(osg::Array::BIND_OVERALL);
>
>     colors->push_back(color);
>
>     return geode;
> }
>
>
>
>
> Any idea of what's going on?
>
> Thanks,
>
> Antoine[/code]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71638#71638
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170906/27fe95f0/attachment.htm>


More information about the osg-users mailing list