From b96c5c9e4bfd297f105402f28ea64e3865c68bbf Mon Sep 17 00:00:00 2001 From: timoore Date: Wed, 10 Dec 2008 22:37:52 +0000 Subject: [PATCH] Render sky with depth test off. Also, don't set BACKGROUND_BIT for cloud layers. --- simgear/scene/sky/sky.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/simgear/scene/sky/sky.cxx b/simgear/scene/sky/sky.cxx index b1f92126..2aee1a2e 100644 --- a/simgear/scene/sky/sky.cxx +++ b/simgear/scene/sky/sky.cxx @@ -25,13 +25,16 @@ # include #endif -#include -#include - #include "sky.hxx" #include "cloudfield.hxx" #include "newcloud.hxx" +#include +#include + +#include +#include + // Constructor SGSky::SGSky( void ) { effective_visibility = visibility = 10000.0; @@ -50,8 +53,12 @@ SGSky::SGSky( void ) { pre_root = new osg::Group; pre_root->setNodeMask(simgear::BACKGROUND_BIT); + osg::StateSet* preStateSet = new osg::StateSet; + preStateSet->setAttribute(new osg::Depth(osg::Depth::LESS, 0.0, 1.0, + false)); + pre_root->setStateSet(preStateSet); cloud_root = new osg::Group; - cloud_root->setNodeMask(simgear::BACKGROUND_BIT | simgear::MODEL_BIT); + cloud_root->setNodeMask(simgear::MODEL_BIT); pre_selector = new osg::Switch; -- 2.39.5