idnemo
29-04-2009 05:12:17
When I move my camera above the water plane,I can't see any water effect.But when the camera under the water,it can get the effect of being under water.
I search some solution,some answers said must disable the shadow.But Disable which Object's shadow?The camera's?
It's so confused.Here is my code,I just copy the Demo1's code to my application.I can see the water by running demo1.
Please help me out.Very appreciate.
// Hydrax initialization code ---------------------------------------------
// ------------------------------------------------------------------------
// 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, Hydrax 0.4 allows save/load config files.
mHydrax->loadCfg("HydraxDemo.hdx");
// Create water
mHydrax->create();
// Hydrax initialization code end -----------------------------------------
// ------------------------------------------------------------------------
// Load island
mSceneMgr->setWorldGeometry("Island.cfg");
mHydrax->getMaterialManager()->addDepthTechnique(
static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().getByName("Island"))
->createTechnique());
I search some solution,some answers said must disable the shadow.But Disable which Object's shadow?The camera's?
It's so confused.Here is my code,I just copy the Demo1's code to my application.I can see the water by running demo1.
Please help me out.Very appreciate.
// Hydrax initialization code ---------------------------------------------
// ------------------------------------------------------------------------
// 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, Hydrax 0.4 allows save/load config files.
mHydrax->loadCfg("HydraxDemo.hdx");
// Create water
mHydrax->create();
// Hydrax initialization code end -----------------------------------------
// ------------------------------------------------------------------------
// Load island
mSceneMgr->setWorldGeometry("Island.cfg");
mHydrax->getMaterialManager()->addDepthTechnique(
static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().getByName("Island"))
->createTechnique());