[osg-users] Using Geometry with packed vertex arrays

Ravi Mathur ravidavi at utexas.edu
Fri Mar 24 21:39:42 PDT 2017

Hi all,

I have an array of floats that contains packed vertex data, provided by an external API, that I want to render. The data represents [position,normal,texcoord] for each vertex. The array layout is: 


Currently, I copy this array into separate osg Arrays (Vec3Array positions, Vec3Array normals, Vec2Array texCoords), then use the appropriate set*Array() in Geometry. This works just fine, but I'm wondering whether I really NEED to copy the source data. 

Is it possible to directly send the original float array and specify strides and offsets for the position/normal/tex data? In straight OpenGL I could send the float array as a VBO and call glVertexAttribPointer to specify the strides and offsets. I've looked in the osg examples and src, but don't see this being done anywhere. Whenever VBOs are used, the position/normal/texCoord data are specified as separate arrays.

Has anyone tackled the problem of passing a packed array as a VBO?


Read this topic online here:

More information about the osg-users mailing list