<div dir="ltr"><div><div><div><div>Hi Ignitus,<br><br></div>I can't help feel that you are diving into low level stuff way you've established that it's required.<br><br></div>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.<br><br></div>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.<br><br></div>Robert.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 27 October 2015 at 14:40, Ignitus Boyone <span dir="ltr"><<a href="mailto:IgnitusBoyone@gmail.com" target="_blank">IgnitusBoyone@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
<br>
<br>
Code:<br>
void OSGVboMarker::post()<br>
{<br>
if (m_frontVBO.isInitialized && m_bDirtyBit)<br>
{<br>
m_swapLock.lock();<br>
int count = m_frontVBO.vertices->size();<br>
m_pGeometry->setVertexArray( m_frontVBO.vertices );<br>
<br>
m_pGeometry->setNormalArray(m_frontVBO.normal, osg::Array::BIND_OVERALL);<br>
m_pGeometry->setColorArray(m_frontVBO.color, osg::Array::BIND_OVERALL);<br>
<br>
m_pGeometry->setTexCoordArray(0,m_frontVBO.texCoords, osg::Array::BIND_PER_VERTEX);<br>
<br>
m_pGeometry->setVertexAttribArray(5, m_frontVBO.centers, osg::Array::BIND_PER_VERTEX);<br>
m_pGeometry->setVertexAttribArray(6, m_frontVBO.scaleValues, osg::Array::BIND_PER_VERTEX);<br>
<br>
m_pDrawArrays->setCount(count);<br>
m_pDrawArrays->set(osg::PrimitiveSet::QUADS, 0, count);<br>
<br>
<br>
<br>
<br>
So, I have two questions related to the above.<br>
<br>
1. When do modified VBO nodes push memory to the card.<br>
2. Is it possible to manually control this operation and possibly do sub buffer updates.<br>
...<br>
<br>
Thank you!<br>
<br>
Cheers,<br>
Ignitus<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=65456#65456" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=65456#65456</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br></div>