27 #include "../WGETextureHud.h"
28 #include "../WGEGeodeUtils.h"
30 #include "WGEOffscreenTexturePass.h"
56 osg::Vec3( 1.0, 0.0, 0.0 ),
57 osg::Vec3( 0.0, 1.0, 0.0 ) );
62 this->addChild( geode );
65 osg::StateSet* state = this->getOrCreateStateSet();
66 state->setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF );
67 state->setMode( GL_LIGHTING, osg::StateAttribute::PROTECTED );
68 state->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
69 state->setMode( GL_BLEND, osg::StateAttribute::PROTECTED );
70 state->setMode( GL_BLEND, osg::StateAttribute::OFF );
73 this->setReferenceFrame( osg::Transform::ABSOLUTE_RF );
74 this->setProjectionMatrixAsOrtho2D( 0.0, 1.0, 0.0, 1.0 );
75 this->setViewMatrix( osg::Matrixd::identity() );
79 m_texMat->setMatrix( osg::Matrixd::identity() );
80 state->setTextureAttributeAndModes( 0,
m_texMat, osg::StateAttribute::ON );
89 unsigned int screenWidth =
m_pass->getViewport()->width();
90 unsigned int screenHeight =
m_pass->getViewport()->height();
92 texMat->setMatrix( osg::Matrixd::scale( static_cast< float >( screenWidth ) / static_cast< float >(
m_pass->
getTextureWidth() ),