[osg-users] Android: Survive Context Loss without complete reinitialization

Robert Osfield robert.osfield at gmail.com
Tue Jul 23 02:03:20 PDT 2019

Hi Martin,

On Mon, 22 Jul 2019 at 19:33, Martin Siggel <martinsiggel+osg at gmail.com>
> I am using OSG 3.6.4-rc3.

That's from back in January so it would be worth updating to 3.6.4-rc8.

I've done a diff between rc3 and rc8 and overall there are quite a few
fixes, I couldn't see a change that would affect things for you with

> The only built-in shaders I am using right now are the osgText shaders:

These are automatically bound, when no other shaders are added to a text

> When I don't add shaders to a geometry node, other built-in shaders seem
to get active as well. I guess these are the ones from

Those shaders are related to the shader pipeline that is only part of
master, they don't exist in 3.6.  If you are aren't creating your own
shaders do they come with your data?  Or are you using osgUtil::ShaderGen?

> When I e.g. use osgText, the text will appear after starting the
application. When I go to the android main screen and then go back to the
app, the text nodes will become black rectangles. Somehow, osg seems to
reference still the "old" objects from the context before.

> Still, from the log I can verify, that shaders are compiled again after
resuming to the app.

What hardware/software Android platform are you testing with?

> I could provide a "minimal" example if anyone is interested.

I don't personally have a Android dev environment setup, so I can't test.
I was hoping that other Android users would chip in here, unfortunately the
forum has been a bit unreliable of late so perhaps this is contributing.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20190723/bbcd5ab4/attachment.html>

More information about the osg-users mailing list