[osg-users] Help needed with cleaning colour arrays when VBOs in use.

Robert Osfield robert.osfield at gmail.com
Fri Nov 13 06:06:26 PST 2009

Hi Roger,

Looking at the quoted code my guess is that you aren't used svn/trunk,
in which case... I would recommend trying out svn/trunk as the VBO
support is close to total rewrite and should be now both more
flexible, scalable and robust.

Let me know how you get on.


On Fri, Nov 13, 2009 at 1:55 PM, Roger James
<roger at beardandsandals.co.uk> wrote:
> Hi,
> I have a little problem with dirtying and cleaning colour arrays when VBOs
> are in use.
> I found that I needed to dirty a color array to get the colour data in the
> associated vertex buffer object updated. I currently do this by calling
> osg::Vec4Array::dirty on the colour array. This appears to work as the
> application now showed the updated colours. However the performance took a
> hit.
> The dirty function in osg::Array is implemented like this
>         /** Dirty the primitive, which increments the modified count, to
> force buffer objects to update. */
>         inline void dirty() { ++_modifiedCount; if (_vbo.valid())
> _vbo->dirty(); }
> So I put a data breakpoint on _modifiedCount and found that whilst
> _modifiedCount was been imcremented by my calls to dirty it was never being
> decremented. A quick search through the osg code did not find anywhere where
> the value appeared to be decremented. So it seems my data is being sent to
> the GPU every frame. Can anyone help me on how I should implement this to
> avoid this happening.
> Roger
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list