Hydrax gray scene???

Hydra

24-06-2009 19:50:42

Hi fellows

I'm integrating Hydrax with Caelum. I followed the recomendations of this link http://www.ogre3d.org/addonforums/viewtopic.php?f=20&t=8458.
The program works fine, excepting for a detail. The mesh of island and palmiers are gray.
I'm inserting an image for you to know:


I adopted Hydrax in the RttManager.cpp

void RttManager::CReflectionListener::CReflectionQueueListener::renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation)
{
if (mRttManager->_isRenderQueueInList(mRttManager->mDisableReflectionCustomNearCliplPlaneRenderQueues, static_cast<Ogre::RenderQueueGroupID>(queueGroupId)) && mActive || ( queueGroupId == ( Ogre::RENDER_QUEUE_SKIES_EARLY + 2 ) ) && mActive )
{
mRttManager->mHydrax->getCamera()->disableCustomNearClipPlane();
Ogre::Root::getSingleton().getRenderSystem()->_setProjectionMatrix(mRttManager->mHydrax->getCamera()->getProjectionMatrixRS());
}
}

void RttManager::CReflectionListener::CReflectionQueueListener::renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation)
{
if (mRttManager->_isRenderQueueInList(mRttManager->mDisableReflectionCustomNearCliplPlaneRenderQueues, static_cast<Ogre::RenderQueueGroupID>(queueGroupId)) && mActive || ( queueGroupId == ( Ogre::RENDER_QUEUE_SKIES_EARLY + 2 ) ) && mActive )
{
mRttManager->mHydrax->getCamera()->enableCustomNearClipPlane(mRttManager->mPlanes[RTT_REFLECTION]);
Ogre::Root::getSingleton().getRenderSystem()->_setProjectionMatrix(mRttManager->mHydrax->getCamera()->getProjectionMatrixRS());
}
}


Like you see, the code is fine. And in the main.cpp of Hydrax I insert the frame listener of Caelum below of the Frame Listener of Hydrax:

mRoot->addFrameListener(new ExampleHydraxDemoListener(mWindow, mCamera, mSceneMgr));
mRoot->addFrameListener(_caelumSystem);


And this code is inserted in frameStarted on the frame listener of Hydrax:

_caelumSystem->getSun()->getSceneNode()->getPosition();
Caelum::LongReal julian_day = _caelumSystem->getUniversalClock()->getJulianDay();
Ogre::ColourValue water_color = _caelumSystem->getSunLightColour( julian_day, _caelumSystem->getSunDirection( julian_day ) );
mHydrax->setWaterColor( Ogre::Vector3( water_color.r, water_color.g, water_color.b ) );


So guys, what I'm doing wrong? Any help is very appreciated

Thanks for all

Xavyiy

24-06-2009 21:06:07

Just disable Caelum's fog ;)

--------------------------------
I suggest you to use:
mHydrax->getRttManager()->setDisableReflectionCustomNearCliplPlaneRenderQueues (const std::vector< Ogre::RenderQueueGroupID > &DisableReflectionCustomNearCliplPlaneRenderQueues) And pass as a parameter a std::vector<Ogre::RenderQueueGroupID> which contains Ogre::RENDER_QUEUE_SKIES_EARLY + 2, like this:
std::vector<Ogre::RenderQueueGroupID> caelumskyqueue;
caelumskyqueue.push_back(static_cast<Ogre::RenderQueueGroupID>(Ogre::RENDER_QUEUE_SKIES_EARLY + 2));
mHydrax->getRttManager()->setDisableReflectionCustomNearCliplPlaneRenderQueues (caelumskyqueue);

Instead of modify Hydrax/RttManager.cpp

Hydra

25-06-2009 22:32:57

Thanks Xavity, solves the problem.