summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ada7f62)
This prevents the dreaded black rectangle from appearing on systems
that don't have OpenGL frame buffer object support.
#include <osg/StateSet>
#include <osgDB/FileNameUtils>
#include <osg/StateSet>
#include <osgDB/FileNameUtils>
+#include <simgear/scene/util/RenderConstants.hxx>
#include <simgear/screen/extensions.hxx>
#include <simgear/debug/logstream.hxx>
#include <simgear/screen/extensions.hxx>
#include <simgear/debug/logstream.hxx>
void FGODGauge::allocRT () {
camera = new osg::Camera;
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);
camera->setProjectionMatrix(osg::Matrix::ortho2D(-256.0, 256.0, -256.0,
256.0));
camera->setViewport(0, 0, textureWH, textureWH);