From 104dc1170bd6de4208e34aafaf31922b5f5f01ef Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Thu, 18 Sep 2014 00:16:09 +0200 Subject: [PATCH] Use black clear color only at high altitudes. Black clear color can cause visual glitches on low altitudes, but a black space is much nicer, so just switch at 300.000 ft. --- src/Viewer/renderer.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Viewer/renderer.cxx b/src/Viewer/renderer.cxx index 811b0225a..15de4785b 100644 --- a/src/Viewer/renderer.cxx +++ b/src/Viewer/renderer.cxx @@ -1615,7 +1615,14 @@ FGRenderer::update( ) { current__view->set_dirty(); osg::Camera *camera = viewer->getCamera(); - camera->setClearColor(osg::Vec4(0, 0, 0, 0)); + + osg::Vec4 clear_color = _altitude_ft->getDoubleValue() < 300000 + ? toOsg(l->adj_fog_color()) + // skydome ends at ~328000 ft and would produce a + // strange looking grey space -> black looks much + // better :-) + : osg::Vec4(0, 0, 0, 1); + camera->setClearColor(clear_color); updateSky();