Hi Peter,

To use VBO's you just need to do
geometry->setUseVertexBufferObject(true) and the internal
implementation will do the rest for you.  The only thing you need to
do is make sure that your geometry is set you so it uses OpenGL faster
paths, so no per primitive colours/normals and no use of the
deprecated vertex indicies arrays that osg::Geometry support for
backwards compatibility.

It is possible to manage VBO's by assigning them to the
osg::Array/osg::PrimitiveSet directly, but this is advanced usage that
you probably won't need to worry about.

Robert.

On Tue, Jun 15, 2010 at 7:39 PM, Peter Wrobrl <particlepe...@gmx.de> wrote:
> Hi, I have several questions regarding osg and the usage of VBOs.
>
> 1.) How do I ensure usage of vertex buffer object ? When I set osg::Geometry 
> setUseVertexBufferObject to true does this allways create a VBO from the 
> structure I passed to osg::Geometry ? E.G. In the OSG Quick Start Guide by 
> Paul Martz we create a Quad, with four Verts, four Colors and one Normal. 
> Setting osg::Geometry setUseVertexBufferObject to true, would this create 
> convert the data to four Verts/Colors/Normals ?
>
> 2.) A Textured Cube has 8 Vertices and at least 12 UVs. How to create this 
> geometry as VBO ? The right Way would be to duplicate Vertices, to have as 
> many as UVs, but how do I create this structure and put this into a geometry 
> ? Same approach as above from the Quick Start guide ?
>
> 3.) Lets say I have a geometry like a human, with multiple UV Shells ( UV 
> islands, the usual approach to texture a human ), e.g. Head, Chest, Arms, 
> Legs. How and where do I specifiy these arrays and do I need a geometry per 
> array ? I guess I cannot set multiple Vertex/Normal/UV Arrays into one 
> geometry, so should I stich all those arrays and pass it as one ? But this 
> would mean that I cannot use Triangle Strips, wouldn't it ?
>
> 4.) What is the Usage of osg::VertexBufferObject ? Its not a Drawable, and 
> osg::Geometry has no setVertexBufferObject method. It can be set into a 
> osg::Array, where the size of each element is constraint to enums. If I 
> understood VBOs right I can define any Data of any size as one Array element, 
> e.g. Vertex, Normal, and UV which would be 8 floats. There is no option for 8 
> floats, so isn't this a limitation ?
>
> Thanks for any help and advice
>
> Cheers, ParticlePeter
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=28969#28969
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to