]> git.mxchange.org Git - simgear.git/commitdiff
Render sky with depth test off.
authortimoore <timoore>
Wed, 10 Dec 2008 22:37:52 +0000 (22:37 +0000)
committertimoore <timoore>
Wed, 10 Dec 2008 22:37:52 +0000 (22:37 +0000)
Also, don't set BACKGROUND_BIT for cloud layers.

simgear/scene/sky/sky.cxx

index b1f921268729d4f7e72154efc09ab83bce291012..2aee1a2edbdbcb3dd0cfa35908c0c558253ba759 100644 (file)
 #  include <simgear_config.h>
 #endif
 
-#include <simgear/math/sg_random.h>
-#include <simgear/scene/util/RenderConstants.hxx>
-
 #include "sky.hxx"
 #include "cloudfield.hxx"
 #include "newcloud.hxx"
 
+#include <simgear/math/sg_random.h>
+#include <simgear/scene/util/RenderConstants.hxx>
+
+#include <osg/StateSet>
+#include <osg/Depth>
+
 // 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;