<div dir="ltr">I'm updating my vertices at runtime. I've found a few posts that discuss this:<div><br></div><div>(a couple are:)</div><div><a href="http://forum.openscenegraph.org/viewtopic.php?t=14826">http://forum.openscenegraph.org/viewtopic.php?t=14826</a><br></div><div><a href="http://forum.openscenegraph.org/viewtopic.php?t=15782">http://forum.openscenegraph.org/viewtopic.php?t=15782</a><br></div><div><br></div><div>Let me first mention that I've compiled OSG with GL3 support, so no display lists. That said, I'm still calling:</div><div><br></div><div><div> pointsGeom->setUseDisplayList(false); </div><div> pointsGeom->setUseVertexBufferObjects(true); </div></div><div><br></div><div>Here is a snippet of my call to update the vertices (v_ = vertices, c_ = colors, n_ = normals, da_ = DrawArrays, g_ = Geometry):</div><div><br></div><div><div> for (int i = 0; i < numVertices; i++) {</div><div> // Verticies</div><div> v_.at(i)[0] = 500.f * (0.0f + (3.0f * float(rand() % 1000) / 1000.f) - 1.5f);</div><div> v_.at(i)[1] = 500.f * (0.0f + (4.0f * float(rand() % 1000) / 1000.f) - 2.f);</div><div> v_.at(i)[2] = 500.f * (1.5f + (0.1f * float(rand() % 1000) / 1000.f) - 0.05f);</div><div><br></div><div> // Colors</div><div> c_.at(i)[0] = 1.f;</div><div> c_.at(i)[1] = 1.f;</div><div> c_.at(i)[2] = 1.f;</div><div> c_.at(i)[3] = 1.f;</div><div><br></div><div> // Normals</div><div> n_.at(i)[0] = 0.f;</div><div> n_.at(i)[1] = 1.f;</div><div> n_.at(i)[2] = 0.f;</div><div> }</div><div><br></div><div> v_.dirty();</div><div> c_.dirty();</div><div> n_.dirty();</div><div><br></div><div> da_.setCount(numVertices);</div><div> da_.dirty();</div><div><br></div><div><b> // *** The dirty() calls above are supposed to tell OSG to update the VBO's. For</b></div><div><b> // some reason this isn't happening. We are going to force it here. Not sure of the</b></div><div><b> // performance implications but hopefully this is temporary.</b></div><div><b> g_.setVertexArray(&v_);</b></div><div><b> g_.setColorArray(&c_);</b></div><div><b> g_.setNormalArray(&n_);</b></div><div><br></div><div> g_.dirtyBound();</div></div><div><br></div><div>The update just doesn't happen unless I call the
<b style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">setVertexArray</b>,
<b style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">setColorArray</b>,
<b style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">setNormalArray</b> methods which doesn't match what the previous posts about this topic.</div><div><br></div><div>Is this because of GL3 or something else?</div><div><br></div><div>Thanks,</div><div>Brad</div></div>