Set BACKGROUND_BIT as camera node mask.
This prevents the dreaded black rectangle from appearing on systems that don't have OpenGL frame buffer object support.
This commit is contained in:
parent
ada7f622d7
commit
74031287b4
1 changed files with 3 additions and 0 deletions
|
@ -37,6 +37,7 @@
|
|||
#include <osg/StateSet>
|
||||
#include <osgDB/FileNameUtils>
|
||||
|
||||
#include <simgear/scene/util/RenderConstants.hxx>
|
||||
#include <simgear/screen/extensions.hxx>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
|
||||
|
@ -53,6 +54,8 @@ FGODGauge::FGODGauge() :
|
|||
|
||||
void FGODGauge::allocRT () {
|
||||
camera = new osg::Camera;
|
||||
// Only the far camera should trigger this texture to be rendered.
|
||||
camera->setNodeMask(simgear::BACKGROUND_BIT);
|
||||
camera->setProjectionMatrix(osg::Matrix::ortho2D(-256.0, 256.0, -256.0,
|
||||
256.0));
|
||||
camera->setViewport(0, 0, textureWH, textureWH);
|
||||
|
|
Loading…
Reference in a new issue