Render sky with depth test off.
Also, don't set BACKGROUND_BIT for cloud layers.
This commit is contained in:
@@ -25,13 +25,16 @@
|
|||||||
# include <simgear_config.h>
|
# include <simgear_config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <simgear/math/sg_random.h>
|
|
||||||
#include <simgear/scene/util/RenderConstants.hxx>
|
|
||||||
|
|
||||||
#include "sky.hxx"
|
#include "sky.hxx"
|
||||||
#include "cloudfield.hxx"
|
#include "cloudfield.hxx"
|
||||||
#include "newcloud.hxx"
|
#include "newcloud.hxx"
|
||||||
|
|
||||||
|
#include <simgear/math/sg_random.h>
|
||||||
|
#include <simgear/scene/util/RenderConstants.hxx>
|
||||||
|
|
||||||
|
#include <osg/StateSet>
|
||||||
|
#include <osg/Depth>
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
SGSky::SGSky( void ) {
|
SGSky::SGSky( void ) {
|
||||||
effective_visibility = visibility = 10000.0;
|
effective_visibility = visibility = 10000.0;
|
||||||
@@ -50,8 +53,12 @@ SGSky::SGSky( void ) {
|
|||||||
|
|
||||||
pre_root = new osg::Group;
|
pre_root = new osg::Group;
|
||||||
pre_root->setNodeMask(simgear::BACKGROUND_BIT);
|
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 = new osg::Group;
|
||||||
cloud_root->setNodeMask(simgear::BACKGROUND_BIT | simgear::MODEL_BIT);
|
cloud_root->setNodeMask(simgear::MODEL_BIT);
|
||||||
|
|
||||||
pre_selector = new osg::Switch;
|
pre_selector = new osg::Switch;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user