<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>I don't know about the double frame but the default for
geometries (drawables in fact) is to use OpenGL display lists
(depending on the OSG compilation).</p>
<p>OpenGL display lists creation takes time. The dirtyDisplayList
method forces OSG to re-create the OpenGL display list.<br>
</p>
<p><br>
</p>
<p>The solution is to force the geometry to use vertex arrays:</p>
<p>geometry->setUseDisplayLists(false);<br>
</p>
<p>On 21/07/2017 11:11, Gianni Ambrosio wrote:<br>
</p>
<blockquote cite="mid:1500628304.m2f.71295@forum.openscenegraph.org"
type="cite">
<pre wrap="">Hi All,
I build a huge geometry (27 milion vertices, 9 milion triangles) as follows:
osg::Geometry* geometry = new osg::Geometry;
geometry->setDataVariance(osg::Object::DYNAMIC);
geometry->setVertexArray(buildVertices(count));
geometry->setColorArray(buildColors(count), osg::Array::BIND_PER_VERTEX);
geometry->addPrimitiveSet(buildElements(count));
On mouse event, after getting an intersection with the graphics, I do:
osg::Geometry* geom = dynamic_cast<osg::Geometry*>(intersection.drawable.get());
osg::Vec4Array& color = dynamic_cast<osg::Vec4Array&>(*geom->getColorArray());
color[intersection.indexList[0]] = selectedColor;
color[intersection.indexList[1]] = selectedColor;
color[intersection.indexList[2]] = selectedColor;
geom->dirtyDisplayList();
color.dirty();
The problem is that after these lines there is a delay of at least one second before seeing the triangle with the updated color on my 3D viewer.
Debugging OSG code I found that "ViewerBase::frame()" is called twice before seeing the new color. Moreover the first time "frame()" is called "renderingTraversals()" takes a lot.
I will debug the OSG code deeper but is there a way to prevent the delay I see in my application?
You can find the full example in attachment.
Thanks for your help,
Gianni
------------------
Read this topic online here:
<a class="moz-txt-link-freetext" href="http://forum.openscenegraph.org/viewtopic.php?p=71295#71295">http://forum.openscenegraph.org/viewtopic.php?p=71295#71295</a>
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
osg-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>
</pre>
</blockquote>
<br>
</body>
</html>