Hydrax is not infinite in Ogre 1.9

compvis

04-03-2015 02:22:41

Hi,

I have problems with combining Hydrax, SkyX in Ogre 1.9.

- The Hydrax is not infinite, and it alway moves when camera moves
- The SkyX automatically scales when camera moves
- The Skyx doesn't reflect on the Hydrax's serface.
The code implements is:

///CAMERA SETTINGS
m_camera->setNearClipDistance(0.1f)
m_camera->setFarClipDistance(99999);
///SKY
m_sky_controller = OGRE_NEW GS_SkyController();
m_sky = OGRE_NEW SkyX::SkyX(Scene::getSingletonPtr()->getSM(),m_sky_controller);

m_sky->create();

SetDefaults(); //Init sky params

m_sky->getVCloudsManager()->getVClouds()->setDistanceFallingParams(Ogre::Vector2(2, -1));

RootObj::getSingletonPtr()->getRootObj()->addFrameListener(m_sky);
RenderObj::getSingletonPtr()->getRenderObj()->addListener(m_sky);

///HYDRAX
mSea = OGRE_NEW new Hydrax::Hydrax(Scene::getSingletonPtr()->getSM(),Scene::getSingletonPtr()->getCamera(),Scene::getSingletonPtr()->getViewport());

mSeaModule = new Hydrax::Module::ProjectedGrid(
mSea,
// Noise module
new Hydrax::Noise::Perlin(/*Generic one*/),
// Base plane
Ogre::Plane(Ogre::Vector3(0,1,0), Ogre::Vector3(0,0,0)),
// Normal mode
Hydrax::MaterialManager::NM_VERTEX,
// Projected grid options
Hydrax::Module::ProjectedGrid::Options(64));

mSea->setModule(static_cast<Hydrax::Module::Module*>(mSeaModule));
mSea->loadCfg(ConfigFile);
mSea->create();

//Update Sky and Hydrax in frameStarted
mSea->update(timePassed);
m_Sky->update(timePassed);

Pic1: Hydrax is not infinite, moves when camera moves

Pics2,3: SkyX scales and doesn't reflect on Hydrax

Max98

06-03-2015 18:44:58

Can you try making a camera just for SkyX and one just for Hydrax? And ofcouse one for the player which is the default one.

compvis

08-03-2015 00:44:40

Thanks, i got it works

Max98

09-03-2015 19:07:56

Thanks, i got it works
Great! How did you get it working? Using the camera thing as I said or?