[osg-users] Bug with applying global default attributes?

26 views
Skip to first unread message

OpenSceneGraph Users

unread,
Jan 29, 2020, 1:22:31 PM1/29/20
to osg-...@lists.openscenegraph.org

I have been testing with trunk and have only come across one problem so
far (this might not be a new issue).

I have a simple viewer set up with two nodes.  The first is loaded from
an osgb.  Internally it sets the glBlendFunci(0, GL_MAX) via
osg::BlendFunci.

The second node also sets glBlendFunci(0, GL_MAX).  This is a geode with
a geometry node under it.  I am setting the blend attributes on the
geometry state set.

At runtime the attribute on node two is set correctly but then
immediately changed again by State::ApplyGlobalDefaultAttribute to
GL_FUNC_ADD.  The blend equation is also stepped on in a similar way.  I
am using apitrace to see the GL calls.

GL_FUNC_ADD is not part of either node that I can see.  However, this
problem does not occur with, for example, axes.osgt used as node one.

I could use some advice on tracking down where this default value is
coming from, and why it is overriding a specific node attribute like this.

Thanks,

Rob


_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

OpenSceneGraph Users

unread,
Jan 30, 2020, 3:09:39 AM1/30/20
to OpenSceneGraph Users
Hi Rob,

Have you tried the 3.6 branch?  Is the issue a regression?

Could you provide a test model and screenshot of the results your are getting vs expecting if possible.  

Cheers,
Robert.

Rob Spearman

unread,
Feb 2, 2020, 12:22:22 PM2/2/20
to OpenSceneGraph Users
I can confirm the bug also exists on 3.6.5-rc3 branch.  I don't know if it pre-existed that.

I have too many dependencies to be able to share a model.  Simplistic models do not seem to exhibit the same behavior.

I'll keep trying to debug.  When is applyGlobalDefaultAttribute supposed to be called?  What sets these defaults?

In building rc3 I found some other issues:

There is a regression on rc3 where the install lib prefix is not set to 64.  This is on CentOS 8 with cmake 3.11.4.  I had to set LIB_POSTFIX=64 on the cmake command line to install to the normal /usr/lib64.

There is also a pre-existing oddity in the sdl examples cmake, where SDLMAIN_LIBRARY is not found.  Shouldn't this be requiring SDL_LIBRARY instead?

Thanks,
Rob

Rob Spearman

unread,
Feb 2, 2020, 3:53:28 PM2/2/20
to OpenSceneGraph Users

I have determined that the problem is exercised if the first node sets the blend for FBO 1:

stateset->setAttribute(new osg::Enablei(GL_BLEND, 1));
osg::BlendEquationi* blendEq = new osg::BlendEquationi(1,
                                 osg::BlendEquation::RGBA_MAX);
osg::BlendFunci* blendFunc = new osg::BlendFunci(1,
                             osg::BlendFunci::ONE, osg::BlendFunci::ONE);
stateset->setAttributeAndModes(blendEq, osg::StateAttribute::ON);
stateset->setAttributeAndModes(blendFunc, osg::StateAttribute::ON);


Removing this prevents the FBO 0 blending problem on the second node.

Rob
Reply all
Reply to author
Forward
0 new messages