Disabling certain render queues

tsmithtree

16-07-2009 22:54:04

I'm creating objects in RENDER_QUEUE_OVERLAY, but they show up in Hydrax's rtt. Can someone tell me how to fix this? I tried modifying RttManager.cpp, but I can't make Hydrax stop rendering it without it disappearing altogether. My own render queue listeners have no way of telling that Hydrax is calling them, so they can't stop Hydrax from rendering overlay objects. And using Overlay::add3D is terribly buggy, and it still reflects in the water. Help?

EDIT: I figured it out. The trick is to use a bunch of special case render queues. Go to RttManager.cpp, and add the following to the end of all the pre-render target functions:

Ogre::SceneManager* sceneMgr = mRttManager->mHydrax->getSceneManager();
sceneMgr->clearSpecialCaseRenderQueues();
sceneMgr->addSpecialCaseRenderQueue(Ogre::RENDER_QUEUE_OVERLAY);
sceneMgr->setSpecialCaseRenderQueueMode(Ogre::SceneManager::SCRQM_EXCLUDE);


Then add this to the end of the post-render target functions:

Ogre::SceneManager* sceneMgr = mRttManager->mHydrax->getSceneManager();
sceneMgr->clearSpecialCaseRenderQueues();


It'd be really nice if Hydrax did this by default, since I don't think most people want stuff in their overlays being reflected on the water. I suppose I could make a patch, or maybe there is a better way of accomplishing this?