X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fod_gauge.cxx;h=e5eed1efc22da9eeddef0d7193ac3ac12316bde8;hb=73fbc05a6b6af52825c792902d7738f9cad7ec2f;hp=ce66472598cc134de12f3d4fa7e24167ea53becc;hpb=800dd73551b53dc2f048902845276657cc0fcbbb;p=flightgear.git diff --git a/src/Instrumentation/od_gauge.cxx b/src/Instrumentation/od_gauge.cxx index ce6647259..e5eed1efc 100644 --- a/src/Instrumentation/od_gauge.cxx +++ b/src/Instrumentation/od_gauge.cxx @@ -37,6 +37,7 @@ #include #include +#include #include #include @@ -53,14 +54,15 @@ FGODGauge::FGODGauge() : void FGODGauge::allocRT () { camera = new osg::Camera; - camera->setProjectionMatrix(osg::Matrix::ortho2D(-256.0, 256.0, -256.0, - 256.0)); + // Only the far camera should trigger this texture to be rendered. + camera->setNodeMask(simgear::BACKGROUND_BIT); + camera->setProjectionMatrix(osg::Matrix::ortho2D(-textureWH/2.0, textureWH/2.0, -textureWH/2.0, textureWH/2.0)); camera->setViewport(0, 0, textureWH, textureWH); camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); camera->setRenderOrder(osg::Camera::PRE_RENDER); camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); camera->setClearColor(osg::Vec4(0.0f, 0.0f, 0.0f , 0.0f)); - camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); + camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT, osg::Camera::FRAME_BUFFER); osg::StateSet* stateSet = camera->getOrCreateStateSet(); stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); stateSet->setMode(GL_CULL_FACE, osg::StateAttribute::OFF);