[osg-users] VBO Bug with 3.6.1 and Normal Arrays

Robert Osfield robert.osfield at gmail.com
Thu Jun 14 00:25:06 PDT 2018

Hi Daniel,

On Wed, 13 Jun 2018 at 23:29, Daniel Emminizer, Code 5773
<dan.emminizer at nrl.navy.mil> wrote:
> I don't know enough about the inner workings to know if this is a dumb idea -- but could you perhaps detect the problem during cull (VBO attachment is NULL but array exists and is non-empty), then call addVertexBufferObjectIfRequired() on the geometry between the cull and the draw phases?  Given my brief exposure to Renderer.cpp, I think that is easier to say than do...

Cull can be multi-threaded so calling addVertexufferObjectIfRequired()
could cause a race condition.

> Just got your new email -- right, the VBO=0 occurs because the array never gets a VBO from array->setVertexBufferObject().  Because of this, VertexArrayState::setArray() gets 0 when it calls getOrCreateGLBufferObject().

Yes, the osg::Array in question never has a osg::VertexBufferObject so
you can't create GLBufferObject for it.

One possibility would be to have the GLObjectsVsitor run single
threaded and do the check, but this won't catch geometry that is
created on the fly.

Perhaps another approach would be to just warn the user that the
Binding hasn't been set prior to the Geometry::set*Array() call, or do
a belt and braces of treat an BIND_UNDEFINED binding as a
BIND_PER_VERTEX to force a VertexBufferObject to be assign
automatically even though it might not be needed.  This might waste a
byte or two but would probably be safe.


More information about the osg-users mailing list