[osg-users] Force OSG for GLES 2.0 to reenable vertex attributes before drawing geometry
Robert Osfield
robert.osfield at gmail.com
Fri Jun 14 00:55:02 PDT 2019
Hi Plamen,
There is no explicit mechanism for forcing extra
glEnableVertexAttribArray calls as they shouldn't be required. What
you describe sounds like a bug in the driver or the OSG.
Which version of the OSG are you using? What hardware target are you using?
What happens when you don't use osg::ShapeDrawable? For instance just
use a normal osg::Geometry. FYI, osg::ShapeDrawable was never meant
for widespread usage back when it was originally written, it's was
simply written to provide a quick a dirty means of visualizing
primitive shapes for debug purposes - this is going back to 2002 :-)
Robert.
On Fri, 14 Jun 2019 at 05:57, Plamen Terziev <plspace at abv.bg> wrote:
>
> Hi,
>
> 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!
>
> Cheers,
> Plamen
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=76274#76274
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
More information about the osg-users
mailing list