[osg-users] convert std::vector to osg::BufferObject

Mary-Ann Zorra rebebaba2 at gmail.com
Tue Oct 4 07:34:36 PDT 2016


Hi guys,

I have some problems with passing an std::vector to my shader as a uniform, and I was wondering, if anyone has some idea, how to do this. So my issue is that an std::vector of a custom defined data type have to get bound to the shader. I have an osg::UniformBufferObject and I would like to fill it with addBufferData(myVector). The problem is, that this method expects an osg BufferObject, and I can not figure it out, how I could convert my custom vector. I thought it should be possible, to create an osg::Array with any (custom) data type. But it seems, that you can only use  the from osg predefined objects. So is there maybe an other way, to convert a vector to a BufferObject or am I doing something wrong? :/

Thank you!

Cheers,
Mary

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








More information about the osg-users mailing list