[solved] no water surface (hydrax 0.5.1, ogre 1.7.1)

rebeccap

02-11-2010 21:21:38

Hi,

For some reason I can't get the water surface to render. I am getting a "wavy" underwater effect and I can see the sun, but no water surface.

I have compiled Hydrax under ogre 1.7.1 and am using Visual Studio 2010.

Here's my createScene function:

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

// Scene shadows
mSceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_TEXTURE_ADDITIVE);

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

//Sky
mSceneMgr->setSkyBox(true, "Sky/ClubTropicana", 5000, false);

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

// Create our projected grid module
Hydrax::Module::ProjectedGrid *mModule = new Hydrax::Module::ProjectedGrid(// Hydrax parent pointer
mHydrax,
// 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(/*264 /*Generic one*/));

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

// Load all parameters from config file
// Remarks: The config file must be in Hydrax resource group.
// All parameters can be set/updated directly by code(Like previous versions),
// but due to the high number of customizable parameters, since 0.4 version, Hydrax allows save/load config files.
mHydrax->loadCfg("HydraxDemo.hdx");

// Create water
mHydrax->create();

// Set Hydrax sun position and colour
mHydrax->setSunPosition(Ogre::Vector3(0,10000,0));
mHydrax->setSunColor(Ogre::Vector3(1, 0.9, 0.6));

//Boat (or Ninja)
Ogre::Entity* boatEntity = mSceneMgr->createEntity("Ninja", "ninja.mesh");
Ogre::SceneNode* boatNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("BoatNode");
boatNode->attachObject(boatEntity);
boatNode->setPosition(Ogre::Vector3(0, 30, 0));


I've been struggling with this for days, but can't find any solution. Any thoughts would be really appreciated!

Xavyiy

02-11-2010 22:59:17

Does the precompiled demo works for you?

rebeccap

02-11-2010 23:43:50

Yeah the precompiled demo works.

I've found the issue... Been searching for probably around 20 hours and it turns out I forgot sth simple (it usually is sth simple that bites u in the *** isnt it...).

Basically I forgot to call update on the Hydrax pointer after each frame.

I implemented the frameStarted() function with the following code:
mHydrax->update(e.timeSinceLastFrame);

P.S. Amazing work Xavyiy!

P.P.S. Any word on Hydrax 0.6?

noferat

01-01-2011 18:21:40

Can you post here Hydrax.dll and Hydrax.lib for ogre 1.7.1 and Visual Studio 2010?
Thanks.

CodeKrash

09-01-2011 00:45:03

i'm in the process of compiling ogre 171, then hydrax 051, ill post here if i can

baum1024

27-04-2011 18:53:56

https://rapidshare.com/files/459466512/hydrax.rar