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
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:
And this code is inserted in frameStarted on the frame listener of Hydrax:
So guys, what I'm doing wrong? Any help is very appreciated
Thanks for all
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