Added usage of osgUtil::Optimizer to tessellate input geometry
This commit is contained in:
parent
a54dc34752
commit
c77a7ecae9
@ -16,7 +16,7 @@
|
|||||||
#include <osg/StateSet>
|
#include <osg/StateSet>
|
||||||
#include <osg/Program>
|
#include <osg/Program>
|
||||||
#include <osg/Shader>
|
#include <osg/Shader>
|
||||||
|
#include <osgUtil/Optimizer>
|
||||||
|
|
||||||
void configureShaders( osg::StateSet* stateSet )
|
void configureShaders( osg::StateSet* stateSet )
|
||||||
{
|
{
|
||||||
@ -73,6 +73,10 @@ int main( int argc, char** argv )
|
|||||||
osg::notify( osg::FATAL ) << "Unable to load model from command line." << std::endl;
|
osg::notify( osg::FATAL ) << "Unable to load model from command line." << std::endl;
|
||||||
return( 1 );
|
return( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
osgUtil::Optimizer optimizer;
|
||||||
|
optimizer.optimize(root.get(), osgUtil::Optimizer::ALL_OPTIMIZATIONS | osgUtil::Optimizer::TESSELLATE_GEOMETRY);
|
||||||
|
|
||||||
configureShaders( root->getOrCreateStateSet() );
|
configureShaders( root->getOrCreateStateSet() );
|
||||||
|
|
||||||
const int width( 800 ), height( 450 );
|
const int width( 800 ), height( 450 );
|
||||||
|
Loading…
Reference in New Issue
Block a user