Fixes to osgprerender and osgshadow scene for new cull and draw implemention

without use of ref counting.

New StatsEventHandler for osgprerender demo to add keyboard control of stats
output.
This commit is contained in:
Robert Osfield
2003-01-30 00:34:35 +00:00
parent 6439a719aa
commit 8422040e97
8 changed files with 73 additions and 22 deletions

View File

@@ -49,11 +49,13 @@ class MyCullCallback : public osg::NodeCallback
MyCullCallback(osg::Node* subgraph,osg::Texture2D* texture):
_subgraph(subgraph),
_texture(texture) {}
_texture(texture),
_localState(new osg::StateSet) {}
MyCullCallback(osg::Node* subgraph,osg::Image* image):
_subgraph(subgraph),
_image(image) {}
_image(image),
_localState(new osg::StateSet) {}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
@@ -79,7 +81,7 @@ class MyCullCallback : public osg::NodeCallback
osg::ref_ptr<osg::Node> _subgraph;
osg::ref_ptr<osg::Texture2D> _texture;
osg::ref_ptr<osg::Image> _image;
osg::ref_ptr<osg::StateSet> _localState;
};
@@ -138,9 +140,7 @@ void MyCullCallback::doPreRender(osg::Node&, osgUtil::CullVisitor& cv)
cv.pushModelViewMatrix(matrix);
osg::ref_ptr<osg::StateSet> dummyState = new osg::StateSet;
cv.pushStateSet(dummyState.get());
cv.pushStateSet(_localState.get());
{
@@ -185,7 +185,7 @@ void MyCullCallback::doPreRender(osg::Node&, osgUtil::CullVisitor& cv)
new_viewport->setViewport(center_x-width/2,center_y-height/2,width,height);
rtts->setViewport(new_viewport);
dummyState->setAttribute(new_viewport);
_localState->setAttribute(new_viewport);
// and the render to texture stage to the current stages
// dependancy list.