[osg-users] VBO Bug with 3.6.1 and Normal Arrays

Daniel Emminizer, Code 5773 dan.emminizer at nrl.navy.mil
Wed Jun 13 07:43:15 PDT 2018


Hi Robert,

Thanks for this change.  Unfortunately it does not look like it fixes my issue.

I'm building GL3 core profile mode against OpenSceneGraph-3.6.  I use the main.cpp and CMakeLists.txt from my 6/1/18 email.  I'm using NVidia card with NVS 510, driver 388.19, OpenGL version 3.3.0 (due to core profile flag).  It is Windows 10.

I still see the error:
Warning: detected OpenGL error `invalid operation` at after drawable.compileGLObjects() call in GLObjectsVisitor::apply(osg::Drawable& drawable)

I have no modifications to OSG.  I did a full rebuild from scratch on OSG.


> What I believe is the problem is that the the VertexArrayState object
> gets initialized by the realizer operation and uses the
> State::getUseVertexAttributeAliasing() that was current at the time of
> the realizer operation, then code then calls
> State::setUseVertexAttributeAliasing() afterwards to a different
> value, so the rest of the OSG assumes that is now the current value
> but the global VertexArrayState is still set up against the original
> value so is passing using GL vertex array settings that are
> inconsistent with the shaders.

This is the second email you've mentioned the realizer operation.  I do not understand what you're referring to; this is very likely my inexperience with the depth of OSG.  Do you mean the code that eventually calls and includes Geometry::drawVertexArraysImplementation()?

I do not see any code that calls State::setUseVertexAttributeAliasing() in osg/src/*/*, or in osg/include/*/*.  I don't call it in main.cpp either (and if I did, I would only call it at startup, not on each geometry creation).

Are we running the same main.cpp?  I'm attaching my original just in case.

Thanks,

 - Dan



> -----Original Message-----
> From: osg-users [mailto:osg-users-bounces at lists.openscenegraph.org] On
> Behalf Of Robert Osfield
> Sent: Wednesday, June 13, 2018 7:45 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] VBO Bug with 3.6.1 and Normal Arrays
> 
> Hi Dan et. al,
> 
> I have had another look into this issue, looked at Dan's workaround
> and used Dan's test example to see investigate what might be going on.
> I have checked in a fix:
> 
> 
> https://github.com/openscenegraph/OpenSceneGraph/commit/673292b995
> 115c6ca9a3cc82c26e05023f504774
> 
> This allows the test example to work correctly in all different
> combinations with the realizer operation on/off etc.
> 
> What I believe is the problem is that the the VertexArrayState object
> gets initialized by the realizer operation and uses the
> State::getUseVertexAttributeAliasing() that was current at the time of
> the realizer operation, then code then calls
> State::setUseVertexAttributeAliasing() afterwards to a different
> value, so the rest of the OSG assumes that is now the current value
> but the global VertexArrayState is still set up against the original
> value so is passing using GL vertex array settings that are
> inconsistent with the shaders.
> 
> The solution is simple reassign the VertexArrayState for each call to
> State::setUseVertexAttributeAliasing().
> 
> I have only tested with Dan's test program, there is chance that other
> usage cases might tease out the issue in a different way, fingers
> crossed the just solves all these issue.
> 
> Could users who've seen issues with the arrays being used correctly
> update to the head of the OpenSceneGraph-3.6 branch and let me know
> how you get on.
> 
> If this all works fine then we can start looking at a release of 3.6.2
> this month.
> 
> Cheers,
> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: main.cpp
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180613/02db445f/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180613/02db445f/attachment.txt>


More information about the osg-users mailing list