Re: [osg-users] How can we make 'osg' thread and 'ui' thread send messages to each other?

2019-07-01 Thread Robert Osfield
Hi Mirro,

On Mon, 1 Jul 2019 at 03:42, Mirro Xu  wrote:

> How to solve the problem with UI Thread conflict
>

You don't say anything about your application, how you use the OSG, what
you mean be UI, what API's you are using, what platform you are using, what
OSG version you are using, your threading model.  You say practically
nothing other than that you have some thread messaging issue which is about
as an open ended a question as you could ask.

We can't help you till we understand specifically what you are doing on you
system, what you are aiming to achieve and what problems you have.

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


Re: [osg-users] Removing objects with shared GL state from scene graph

2019-07-01 Thread Robert Osfield
Hi Chris,

I have spent the day merging submissions, I have a bit more to do, then
I'll see if I can recreate the bug with your latest test program, if I
don't get to it today, I'll have a bash tomorrow before I head away for a
family break.  What versions of the OSG have you tested with this test
program?  What versions of the OSG should I expect to see problems?

Cheers,
Robert.

On Mon, 1 Jul 2019 at 03:02, Chris Djali  wrote:

> Hi,
>
> Hopefully this example illustrates the underlying problem with
> osgText::Text::releaseGLObjects without the multiple viewer schenanigans in
> my previous example:
>
>
> Code:
>
> #include 
> #include 
> #include 
> #include 
>
>
>
> int main()
> {
> osgViewer::Viewer viewer;
> // Single-threaded mode so we don't need to worry about things still
> being used by the draw traversal
> viewer.setThreadingModel(osgViewer::ViewerBase::SingleThreaded);
>
> // Use an auto transform so the text actually faces the screen
> osg::ref_ptr scene = new osg::AutoTransform();
> scene->setAutoRotateMode(osg::AutoTransform::ROTATE_TO_SCREEN);
> viewer.setSceneData(scene);
>
> // Add two text nodes sharing the same font
> osg::ref_ptr font =
> osgText::readRefFontFile("trebuc.ttf");
>
> osg::ref_ptr text1 = new osgText::Text();
> text1->setFont(font);
> text1->setText("text1");
> scene->addChild(text1);
>
> osg::ref_ptr text2 = new osgText::Text();
> text2->setFont(font);
> text2->setText("text2");
> scene->addChild(text2);
>
> // Display one or more frames
> viewer.setCameraManipulator(new osgGA::TrackballManipulator());
> for (int i = 0; i < 100; ++i)
> viewer.frame();
>
> // Remove a text node
> scene->removeChild(text1);
>
> // Pick which path depending on whether we prefer leaks or rebuilding
> things we're still using and potential errors
> if (true)
> {
> text1->releaseGLObjects();
> // text2 must now compile its program again -
> osg::Program::compileGLObjects is called the next frame.
> // Also, the glyph texture (which text2 still needs) is added to
> the pending orphaned texture list.
> // I'm not sure how OSG would normally delete orphaned textures,
> so I can't trigger that, but I imagine OSG doesn't keep them all around
> forever.
> }
> else
> {
> // text2 can still use its program and the glyph texture, but
> text1's objects leak.
> }
>
> text1 = nullptr;
>
> return viewer.run();
> }
>
>
>
>
> All that happens here is we create a viewer, add two text nodes with the
> same font, and 100 frames later, remove one of them again. The text node
> that remains has to recompile its shader program (a very minor but
> unnecessary performance hit) and its glyph texture ends up in the orphaned
> texture list (which I'm pretty sure means it could be deleted at any time).
>
> If I knew how OSG typically cleans up orphaned textures, I could add extra
> steps to this and make it actually produce OpenGL errors when the texture
> is deleted, but as-is it just hangs around in the orphaned list
> indefinitely.
>
> Cheers,
> Chris
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=76345#76345
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Removing objects with shared GL state from scene graph

2019-07-01 Thread Chris Djali
Hi,

I've only tested that example against the 3.6 branch (as of commit 4b6d9287, 
which was the latest yesterday), and while it doesn't actually crash or show 
errors, putting tracepoints in shows that the shader program is recompiled and 
the glyph texture is added to the orphaned list once the text node is removed 
after a hundred frames.

It should break more visibly if you add something to flush the orphaned texture 
list.

Cheers,
Chris

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76350#76350





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


[osg-users] Please test OpenSceneGraph-3.6 branch in prep for 3.6.4-rc4

2019-07-01 Thread Robert Osfield
Hi All,

Today I jumped back on doing OSG support work, reviewing a merging a number
of submissions.  I am going to go for the 3.6.4 release this month but need
the community to help testing the OpenSceneGraph-3.6 branch and the
3.6.4-rc's made from this as we converge towards the final 3.6.4 stable
release.

I have been testing under Kubuntu 18.04 today with a NVidia 2060 system, we
really need feedback on Windows and OSX to know whether we are in a good
place to tag the 3.6.4.

I'll be taking a family holiday from Wednesday for a week so want to get
the 3.6.4-rc4 tagged tomorrow so that it can be testing in the community
while I'm away, so we don't loose any time required to properly test the
release prior to tagging the final stable release.

Please reply here on success or failure so I know how well we are
converting to a stable release and what me need to resolve.

Cheers,
Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org