[osg-users] ViewerBase::frame() method slow after changing the color of a geometry

Robert Osfield robert.osfield at gmail.com
Fri Jul 21 05:57:33 PDT 2017

Hi Gianni,

On 21 July 2017 at 11:32, Gianni Ambrosio <g.ambrosio+osg at gmail.com> wrote:

> I tried what Lionel suggested but in fact the geometry generation is much
> more slow now.
> Anyway, since I suspected that "dirtyDisplayList()" is the cause of the
> delay, I tried to remove that line but without it I cannot see the new
> color.
> Now, is "dirtyDisplayList()" really required for what I need or is there a
> different call should I use just to see the triangle with the updated color?

If you use display lists and you modify the osg::Geometry you need to call
dirtyDislplayList() to force OSG to recompile.

What you need to do is to break your dataset into smaller chunks, 10,000
vertices per osg::Geometry is a reasonable level of granularity.  Using
VertexBufferObjects rather than DisplayLists is also something you should
do.  Finally optimize the dataset so you don't have some many vertices by
making sure the triangle share vertices where possible - you'll need to use
osg::DrawElementsUInt/UShort to use indices.

Doing these above steps will resolve most of the problems you have been
presenting recently.  If want to handle big datasets these are the steps
you absolutely need to do.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170721/822f465a/attachment.htm>

More information about the osg-users mailing list