[osg-users] OSGNode VBO Control

Robert Osfield robert.osfield at gmail.com
Tue Oct 27 07:54:45 PDT 2015


Hi Ignitus,

I can't help feel that you are diving into low level stuff way you've
established that it's required.

The OSG can manage update's to VBO's for you, it doesn't current support
updating parts of osg::Array, potentially you can implement this yourself
with a custom draw callback or custom Drawable, but personally I'd
recommend not attempting anything like this early in your project.

My recommendation would be to implement what you need just using standard
OSG components and once you have what you want rendered onscreen then do
performance profiling (with an optimized build) on the target platforms to
see whether you have the performance you are after.  If you have the
performance you need, job done, not need to waste any more time.  If you
don't have the performance you need then start looking at what the
bottleneck is.  Only once you've established what the bottleneck is should
you start considering looking at re-organizing your scene graph. Using
custom custom VBO management would the amongst the last things I'd try.

Robert.

On 27 October 2015 at 14:40, Ignitus Boyone <IgnitusBoyone at gmail.com> wrote:

> Hi,
>
> I'm starting to work my way through the source for Geometry and Drawable,
> but more experienced minds might be able to point me in the right
> directions sooner.
>
> I'm working on a AR HUD and because a later point in the project might
> require the  loading of complex models to represent avatars or vehicles
> inside the AR space we have chosen to use OSG as a starting point. The
> current UI is currently relatively primitive and basically consist entirely
> of billboards of varying textures with minor text glyphs to indicate
> various properties.
>
> I've implemented most of the billboards in a single VBO based Geometry
> node.  Because the target hardware is lacking I wanted to play with partial
> updates to the VBO contents based on our current draw performance.  First
> pass I simply created a post function for manually controlling where in the
> draw thread buffer transfers occur, but it has become apparent to me from
> profiling that this might only be marking the VBO as dirty and the actual
> upload occurring during the next draw frame.
>
>
>
> Code:
>         void OSGVboMarker::post()
>    {
>                 if (m_frontVBO.isInitialized && m_bDirtyBit)
>                 {
>                         m_swapLock.lock();
>                         int count = m_frontVBO.vertices->size();
>                         m_pGeometry->setVertexArray( m_frontVBO.vertices );
>
>                         m_pGeometry->setNormalArray(m_frontVBO.normal,
> osg::Array::BIND_OVERALL);
>                         m_pGeometry->setColorArray(m_frontVBO.color,
> osg::Array::BIND_OVERALL);
>
>
> m_pGeometry->setTexCoordArray(0,m_frontVBO.texCoords,
> osg::Array::BIND_PER_VERTEX);
>
>                         m_pGeometry->setVertexAttribArray(5,
> m_frontVBO.centers, osg::Array::BIND_PER_VERTEX);
>                         m_pGeometry->setVertexAttribArray(6,
> m_frontVBO.scaleValues, osg::Array::BIND_PER_VERTEX);
>
>                         m_pDrawArrays->setCount(count);
>                         m_pDrawArrays->set(osg::PrimitiveSet::QUADS, 0,
> count);
>
>
>
>
> So, I have two questions related to the above.
>
> 1. When do modified VBO nodes push memory to the card.
> 2. Is it possible to manually control this operation and possibly do sub
> buffer updates.
> ...
>
> Thank you!
>
> Cheers,
> Ignitus
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65456#65456
>
>
>
>
>
> _______________________________________________
> 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/20151027/359211f7/attachment-0003.htm>


More information about the osg-users mailing list