Added support for automatic creation of global StateAttributes to osg::State,
these global attributes are created by cloning any attributes which are applied during rendering, the clone in a shallow copy, which will set up default valus for that attribute. This should prevent attribute bleed from one stateset to the next when the global StateSet doesn't contain an attribute used within the scene graph.
This commit is contained in:
@@ -82,6 +82,14 @@ void StateSet::setGlobalDefaults()
|
||||
|
||||
setRendingBinToInherit();
|
||||
|
||||
|
||||
setAttributeAndModes(new AlphaFunc,StateAttribute::OFF);
|
||||
setAttributeAndModes(new Transparency,StateAttribute::OFF);
|
||||
|
||||
Material *material = new Material;
|
||||
material->setColorMode(Material::AMBIENT_AND_DIFFUSE);
|
||||
setAttributeAndModes(material,StateAttribute::ON);
|
||||
/*
|
||||
setMode(GL_LIGHTING,StateAttribute::OFF);
|
||||
setMode(GL_FOG,StateAttribute::OFF);
|
||||
setMode(GL_POINT_SMOOTH,StateAttribute::OFF);
|
||||
@@ -103,8 +111,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