From e0507e9095641165ecc4c36a0f6137cbf7589cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Garc=C3=ADa=20Li=C3=B1=C3=A1n?= Date: Tue, 23 Apr 2019 03:39:30 +0200 Subject: [PATCH] Fixed the aircraft showing on top of the splash screen when relocating/resetting --- src/Viewer/CameraGroup_compositor.cxx | 10 ++++++++-- src/Viewer/splash.cxx | 5 ++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Viewer/CameraGroup_compositor.cxx b/src/Viewer/CameraGroup_compositor.cxx index ea4990a83..e4319076c 100644 --- a/src/Viewer/CameraGroup_compositor.cxx +++ b/src/Viewer/CameraGroup_compositor.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -130,7 +131,8 @@ relativeProjection(const osg::Matrix& P0, const osg::Matrix& R, const osg::Vec2d namespace flightgear { -using namespace simgear::compositor; +using namespace simgear; +using namespace compositor; class CameraGroupListener : public SGPropertyChangeListener { public: @@ -687,10 +689,14 @@ void CameraGroup::buildCamera(SGPropertyNode* cameraNode) fgGetString("/sim/rendering/default-compositor", "Compositor/default"); std::string compositor_path = cameraNode->getStringValue("compositor", default_compositor.c_str()); + osg::ref_ptr options = + SGReaderWriterOptions::fromPath(globals->get_fg_root().local8BitStr()); + options->setPropertyNode(globals->get_props()); Compositor *compositor = Compositor::create(_viewer, window->gc, viewport, - compositor_path); + compositor_path, + options); if (compositor) { info->compositor = compositor; } else { diff --git a/src/Viewer/splash.cxx b/src/Viewer/splash.cxx index a587dab3d..7064ef539 100644 --- a/src/Viewer/splash.cxx +++ b/src/Viewer/splash.cxx @@ -221,16 +221,15 @@ void SplashScreen::createNodes() _splashQuadCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); _splashQuadCamera->setViewMatrix(osg::Matrix::identity()); _splashQuadCamera->setProjectionMatrixAsOrtho2D(0.0, 1.0, 0.0, 1.0); - _splashQuadCamera->setClearMask( 0 ); _splashQuadCamera->setAllowEventFocus(false); _splashQuadCamera->setCullingActive(false); - _splashQuadCamera->setRenderOrder(osg::Camera::NESTED_RENDER, 20000); + _splashQuadCamera->setRenderOrder(osg::Camera::NESTED_RENDER); stateSet = _splashQuadCamera->getOrCreateStateSet(); stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); stateSet->setAttribute(new osg::BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA), osg::StateAttribute::ON); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); - stateSet->setRenderBinDetails(1, "RenderBin"); + stateSet->setRenderBinDetails(1000, "RenderBin"); stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); geometry = osg::createTexturedQuadGeometry(osg::Vec3(0.0, 0.0, 0.0),