1
0
Fork 0

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:
timoore 2008-12-30 23:36:51 +00:00 committed by Tim Moore
parent ada7f622d7
commit 74031287b4

View file

@ -37,6 +37,7 @@
#include <osg/StateSet> #include <osg/StateSet>
#include <osgDB/FileNameUtils> #include <osgDB/FileNameUtils>
#include <simgear/scene/util/RenderConstants.hxx>
#include <simgear/screen/extensions.hxx> #include <simgear/screen/extensions.hxx>
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>
@ -53,6 +54,8 @@ FGODGauge::FGODGauge() :
void FGODGauge::allocRT () { void FGODGauge::allocRT () {
camera = new osg::Camera; 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, camera->setProjectionMatrix(osg::Matrix::ortho2D(-256.0, 256.0, -256.0,
256.0)); 256.0));
camera->setViewport(0, 0, textureWH, textureWH); camera->setViewport(0, 0, textureWH, textureWH);