Added debug State::print(std::ostream&) method and extra debug messages in ShaderComposer and ShaderAttribute.

Added better shader composition testing in the osgshadercomposition example.
This commit is contained in:
Robert Osfield
2010-07-10 17:14:59 +00:00
parent d45cb5f7a1
commit 64b26ebeb5
6 changed files with 257 additions and 23 deletions

View File

@@ -62,12 +62,6 @@ osg::Node* createSceneGraph(osg::ArgumentParser& arguments)
sa->addUniform(new osg::Uniform("baseTexture",0));
#if 1
osg::ShaderAttribute* sa_dummy = new osg::ShaderAttribute;
sa_dummy->setType(osg::StateAttribute::Type(10001));
stateset->setAttribute(sa_dummy);
#endif
}
// inherit the ShaderComponents entirely from above
@@ -92,7 +86,6 @@ osg::Node* createSceneGraph(osg::ArgumentParser& arguments)
osg::StateSet* stateset = pat->getOrCreateStateSet();
stateset->setMode(GL_BLEND, osg::StateAttribute::ON);
#if 1
osg::ShaderAttribute* sa = new osg::ShaderAttribute;
sa->setType(osg::StateAttribute::Type(10001));
stateset->setAttribute(sa);
@@ -103,7 +96,6 @@ osg::Node* createSceneGraph(osg::ArgumentParser& arguments)
sa->addShader(fragment_shader);
}
#endif
group->addChild(pat);
}
@@ -162,8 +154,6 @@ osg::Node* createSceneGraph(osg::ArgumentParser& arguments)
group->addChild(pat);
group->addChild(pat);
}
return group;
@@ -175,15 +165,11 @@ int main( int argc, char **argv )
osgViewer::Viewer viewer(arguments);
OSG_NOTICE<<"********** Constructing scene graph ************ "<<std::endl<<std::endl;
osg::ref_ptr<osg::Node> scenegraph = createSceneGraph(arguments);
if (!scenegraph) return 1;
viewer.setSceneData(scenegraph.get());
OSG_NOTICE<<std::endl<<"********** Finished constructing scene graph ************ "<<std::endl<<std::endl;
viewer.realize();
// enable shader composition