I have encountered weird behavior while using SkyNode in an application that needs to create and remove a viewer dynamically. The first time that I open a viewer and use a MapNode with a SkyNode everything works as expected, but the second time the atmosphere effect doesn't seem to work, I have a huge ball behind the MapNode and I get 'Warning: detected OpenGL error 'invalid value' at after RenderBin::draw(..)'
I am using OpenSceneGraph 3.4.1 and osgEarth 2.8.0
Here is a code sample that demonstrates the problem:
int main(int argc, char** argv)
osg::ref_ptr<osg::Group> root = new osg::Group;
osg::ref_ptr<osgEarth::MapNode> mapNode = new osgEarth::MapNode;
osg::ref_ptr<osgEarth::Util::SkyNode> skyNode = osgEarth::Util::SkyNode::create(mapNode.get());