Some Bug

Sergio

21-05-2009 19:22:49

Hi.
I have some problems with Hydrax. My water doesn't have depth, it's always deep blue and there are some troubles near the edges of the terrain to. The same thing is in the Demo but I can't see those troubles in Hydrax Editor. Please help, because for me it would take a week to find answer( . Sorry for my english.

XpLoDWilD

24-05-2009 13:07:34

Can you post your initialization code ?

Sergio

24-05-2009 22:04:54

99% of code is from Demo. But this bug is in the demo to.
virtual void createScene()
{
mSceneMgr->setWorldGeometry("terrain.cfg");

// Set default ambient light
mSceneMgr->setAmbientLight(ColourValue(1, 1, 1));

// Create the SkyBox
mSceneMgr->setSkyBox(true, "Sky/ClubTropicana", 99999*3, true);

// Light
Ogre::Light *mLight = mSceneMgr->createLight("Light0");
mLight->setPosition(0,10000,0);
mLight->setDiffuseColour(1, 1, 1);
mLight->setSpecularColour(1, 0.9, 0.6);

// Create Hydrax object
pHydrax = new Hydrax::Hydrax(mSceneMgr, mCamera, mWindow->getViewport(0));

// Create our projected grid module
Hydrax::Module::ProjectedGrid *mModule
= new Hydrax::Module::ProjectedGrid(// Hydrax parent pointer
pHydrax,
// Noise module
new Hydrax::Noise::Perlin(/*Generic one*/),
// Base plane
Ogre::Plane(Ogre::Vector3(0,1,0), Ogre::Vector3(0,5,0)),
// Normal mode
Hydrax::MaterialManager::NM_VERTEX,
// Projected grid options
Hydrax::Module::ProjectedGrid::Options(/*264 /*Generic one*/));

// Set our module
pHydrax->setModule(static_cast<Hydrax::Module::Module*>(mModule));

pHydrax->loadCfg("Hydrax.cfg");

// Create water
pHydrax->create();

pHydrax->getMaterialManager()->addDepthTechnique(
static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().getByName("Island"))
->createTechnique());
}

//-----------------------------------------------------------------------------------------------------
class MyFrameListener : public ExampleFrameListener
{
public:
bool frameStarted(const FrameEvent& evt)
{
bool ret = ExampleFrameListener::frameStarted(evt);
// Update Hydrax
pHydrax->update(evt.timeSinceLastFrame);
return ret;
}
};

Xavyiy

25-05-2009 00:04:23

Seems that the config file is not loaded as expected(maybe Hydrax.cfg is not in Hydrax resource group?).
Can you post your log?