<div dir="ltr">Hah! Daniel, that was it. Darnit! <div><br></div><div>BTW, I used to work at Code 5580. WAY back in the day.</div><div><br></div><div>Thanks!</div><div><br></div><div>Robert, sorry, I meant to mention version 3.6.0.</div><div><br></div><div>Cheers,</div><div>Brad</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 1, 2018 at 7:39 AM, Daniel Emminizer, Code 5773 <span dir="ltr"><<a href="mailto:dan.emminizer@nrl.navy.mil" target="_blank">dan.emminizer@nrl.navy.mil</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div class="m_6135567244000718600WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Brad,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Check to make sure your Geometry has setDataVariance(osg::Object::<wbr>DYNAMIC). That solved the problem for most of our similar cases.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">- Dan<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> osg-users [mailto:<a href="mailto:osg-users-bounces@lists.openscenegraph.org" target="_blank">osg-users-bounces@<wbr>lists.openscenegraph.org</a>]
<b>On Behalf Of </b>Brad Colbert<br>
<b>Sent:</b> Friday, June 01, 2018 10:20 AM<br>
<b>To:</b> <a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.<wbr>openscenegraph.org</a><br>
<b>Subject:</b> [osg-users] Updating VBO's during runtime<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">I'm updating my vertices at runtime. I've found a few posts that discuss this:<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">(a couple are:)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://forum.openscenegraph.org/viewtopic.php?t=14826" target="_blank">http://forum.openscenegraph.<wbr>org/viewtopic.php?t=14826</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://forum.openscenegraph.org/viewtopic.php?t=15782" target="_blank">http://forum.openscenegraph.<wbr>org/viewtopic.php?t=15782</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Let me first mention that I've compiled OSG with GL3 support, so no display lists. That said, I'm still calling:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"> pointsGeom->setUseDisplayList(<wbr>false); <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> pointsGeom-><wbr>setUseVertexBufferObjects(<wbr>true); <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Here is a snippet of my call to update the vertices (v_ = vertices, c_ = colors, n_ = normals, da_ = DrawArrays, g_ = Geometry):<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal"> for (int i = 0; i < numVertices; i++) {<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> // Verticies<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> v_.at(i)[0] = 500.f * (0.0f + (3.0f * float(rand() % 1000) / 1000.f) - 1.5f);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> v_.at(i)[1] = 500.f * (0.0f + (4.0f * float(rand() % 1000) / 1000.f) - 2.f);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> v_.at(i)[2] = 500.f * (1.5f + (0.1f * float(rand() % 1000) / 1000.f) - 0.05f);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> // Colors<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> c_.at(i)[0] = 1.f;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> c_.at(i)[1] = 1.f;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> c_.at(i)[2] = 1.f;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> c_.at(i)[3] = 1.f;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> // Normals<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> n_.at(i)[0] = 0.f;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> n_.at(i)[1] = 1.f;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> n_.at(i)[2] = 0.f;<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> }<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> v_.dirty();<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> c_.dirty();<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> n_.dirty();<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> da_.setCount(numVertices);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> da_.dirty();<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><b> // *** The dirty() calls above are supposed to tell OSG to update the VBO's. For</b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><b> // some reason this isn't happening. We are going to force it here. Not sure of the</b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><b> // performance implications but hopefully this is temporary.</b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><b> g_.setVertexArray(&v_);</b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><b> g_.setColorArray(&c_);</b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><b> g_.setNormalArray(&n_);</b><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> g_.dirtyBound();<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">The update just doesn't happen unless I call the <b><span style="font-family:"Arial","sans-serif";color:#222222;background:white">setVertexArray</span></b>,
<b><span style="font-family:"Arial","sans-serif";color:#222222;background:white">setColorArray</span></b>,
<b><span style="font-family:"Arial","sans-serif";color:#222222;background:white">setNormalArray</span></b> methods which doesn't match what the previous posts about this topic.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Is this because of GL3 or something else?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Brad<u></u><u></u></p>
</div>
</div>
</div></div></div>
</div>
</div>
<br>______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
<br></blockquote></div><br></div>