From ada7f622d719c961015b148acfc1274e51f52cdc Mon Sep 17 00:00:00 2001 From: timoore Date: Tue, 30 Dec 2008 21:09:46 +0000 Subject: [PATCH] Change the order of the main cameras from NESTED_RENDER to POST_RENDER This seems to be accepted OSG usage for slave cameras. It's possible that this order is important for rendering instruments that use RTT textures on systems without frame buffer object support. I'm thinking that the resulting bugs may be implicated in the "black rectangle" problem. --- src/Main/CameraGroup.cxx | 4 ++-- src/Scenery/redout.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Main/CameraGroup.cxx b/src/Main/CameraGroup.cxx index 9e848978d..06dab8efa 100644 --- a/src/Main/CameraGroup.cxx +++ b/src/Main/CameraGroup.cxx @@ -147,7 +147,7 @@ CameraInfo* CameraGroup::addCamera(unsigned flags, Camera* camera, installCullVisitor(farCamera); info->farCamera = farCamera; info->farSlaveIndex = _viewer->getNumSlaves() - 1; - farCamera->setRenderOrder(Camera::NESTED_RENDER, info->farSlaveIndex); + farCamera->setRenderOrder(Camera::POST_RENDER, info->farSlaveIndex); camera->setCullMask(camera->getCullMask() & ~simgear::BACKGROUND_BIT); camera->setClearMask(GL_DEPTH_BUFFER_BIT); } @@ -155,7 +155,7 @@ CameraInfo* CameraGroup::addCamera(unsigned flags, Camera* camera, installCullVisitor(camera); info->camera = camera; info->slaveIndex = _viewer->getNumSlaves() - 1; - camera->setRenderOrder(Camera::NESTED_RENDER, info->slaveIndex); + camera->setRenderOrder(Camera::POST_RENDER, info->slaveIndex); _cameras.push_back(info); return info; } diff --git a/src/Scenery/redout.cxx b/src/Scenery/redout.cxx index b6ff2dc4d..1555a3305 100644 --- a/src/Scenery/redout.cxx +++ b/src/Scenery/redout.cxx @@ -101,7 +101,7 @@ osg::Node* FGCreateRedoutNode() camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); camera->setProjectionMatrix(osg::Matrix::ortho2D(-1, 1, -1, 1)); camera->setViewMatrix(osg::Matrix::identity()); - camera->setRenderOrder(osg::Camera::POST_RENDER, 10); + camera->setRenderOrder(osg::Camera::POST_RENDER, 99); camera->setClearMask(0); camera->setAllowEventFocus(false); camera->setCullingActive(false);