Discussion:
[osg-users] Drawable - recent commit causing problems
Glenn Waldron
2018-08-30 12:17:36 UTC
Permalink
Hi Robert,
I pulled the latest OpenSceneGraph-3.6 branch and this change is causing
rendering artifacts in osgEarth:

https://github.com/openscenegraph/OpenSceneGraph/commit/3808b298d1c5076daeb9d7644dc40b5038fb349c

I use Drawables that share the same StateSet. When the Drawable destructor
calls releaseGLObjects() directly, that shared StateSet also gets its
releaseGLObjects() function called and this causes ill effects on
still-active Drawables.

Other Node types don't do this (call releaseGLObjects from the DTOR) so I'm
wondering whether this was intentional, or whether this is exposing
something I'm doing wrong on my end.

Glenn Waldron / osgEarth
Robert Osfield
2018-08-30 15:37:05 UTC
Permalink
Hi Glenn,

Ahhhh, Fix one problem create another...

The Drawable::releaseGLObjects() was added to the destrcutor fix a bug
with VertexArrayState not being cleaned up. Calling the
StateSet::releaseGLObjects() should be safe if it's not shared, but it
would be inappropriate to call it when shared, or at least
inappropriate when done in the context of the destrucutor.

Next week I'll return to the OSG for a bit so will have a look at it then.

Cheers,
Robert.
Post by Glenn Waldron
Hi Robert,
https://github.com/openscenegraph/OpenSceneGraph/commit/3808b298d1c5076daeb9d7644dc40b5038fb349c
I use Drawables that share the same StateSet. When the Drawable destructor calls releaseGLObjects() directly, that shared StateSet also gets its releaseGLObjects() function called and this causes ill effects on still-active Drawables.
Other Node types don't do this (call releaseGLObjects from the DTOR) so I'm wondering whether this was intentional, or whether this is exposing something I'm doing wrong on my end.
Glenn Waldron / osgEarth
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Robert Osfield
2018-09-03 09:35:14 UTC
Permalink
H Glenn,

I don't have a test for the issue you've seen so have to implement
what I think could resolve the issue and get this checked into OSG
master, 3.6 and 3.6-TexStorage:

https://github.com/openscenegraph/OpenSceneGraph/commit/bcba3928e6be5d284b1611a0472fe5e24d184f67

I simply added a detach of the StateSet from the Drawable/Geometry in
the destructor prior to the call to releaseGLObjects().

Could you test it out and let me know if it resolves the issue.

Cheers,
Robert.
Glenn Waldron
2018-09-03 17:36:23 UTC
Permalink
Robert,
Indeed, that was exactly my workaround while you looked into the issue. So
I'd say that will work. Thanks.

Glenn Waldron
Post by Robert Osfield
H Glenn,
I don't have a test for the issue you've seen so have to implement
what I think could resolve the issue and get this checked into OSG
https://github.com/openscenegraph/OpenSceneGraph/commit/bcba3928e6be5d284b1611a0472fe5e24d184f67
I simply added a detach of the StateSet from the Drawable/Geometry in
the destructor prior to the call to releaseGLObjects().
Could you test it out and let me know if it resolves the issue.
Cheers,
Robert.
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Loading...