[osg-users] Force OSG for GLES 2.0 to reenable vertex attributes before drawing geometry

Plamen Terziev plspace at abv.bg
Tue Jun 11 04:57:45 PDT 2019


I've built OSG for Android with GLES 2.0 support. I've created very simple scene where I render a sphere using ShapeDrawable.

In the first frame I can see that OSG calls glEnableVertexAttribArray() and sets the data using glVertexAttribPointer(). After that it calls glDrawElements() and the sphere renders fine.

However at the end of the frame the app calls glDisableVertexAttribArray() (I am using Qt for OSG integration and Qt changes the vertex arrays). That's why the next frame no geometry draws because OSG does not call again glEnableVertexAttribArray() and glVertexAttribPointer() but only glDrawElements().

I'd like to force OSG to call on each frame glEnableVertexAttribArray() and glVertexAttribPointer() before calling glDrawElements() because the vertex arrays state has changed between the frames and needs to provide again the correct data.

How I can do this?

Thank you!


Read this topic online here:

More information about the osg-users mailing list