Added setAttributeAndModes(new Depth,StateAttribute::ON);
to the StateSet::setGlobalDefault() so that the correct default for the glDepthFunc etc are set up for scene graphs, and allows override of these value which risk of inheriting state on to the rest of the scene graph. This has allowed the hangglide demo to be simplified since it now doesn't need to set the global Depth instance itself.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <osg/FrontFace>
|
||||
#include <osg/PolygonMode>
|
||||
#include <osg/Transparency>
|
||||
#include <osg/Depth>
|
||||
|
||||
using namespace osg;
|
||||
|
||||
@@ -56,6 +57,8 @@ void StateSet::setGlobalDefaults()
|
||||
|
||||
setAttributeAndModes(new PolygonMode,StateAttribute::OFF);
|
||||
setAttributeAndModes(new Transparency,StateAttribute::OFF);
|
||||
|
||||
setAttributeAndModes(new Depth,StateAttribute::ON);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user