SigmaStrain
27-08-2010 16:50:09
Hello all.
I'm having a problem when I run Hydrax as a part of an app that I created. The water is not rendered from top to bottom or bottom to top but when I get close to the surface of the water while under it I can see that the water is loaded there's just no textures.
Here is an example image:
Here is my code
The Create Scene Code is almost( missing some light declarations and such) identical to the demo's so I have no Idea why this is happening.
Also, as a side note, I am not using any shadows so there should be no problems with hydrax and stencil shadows.
EDIT: To fix this problem I replaced this line:
with this one:
I'm having a problem when I run Hydrax as a part of an app that I created. The water is not rendered from top to bottom or bottom to top but when I get close to the surface of the water while under it I can see that the water is loaded there's just no textures.
Here is an example image:
Here is my code
mSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox", 99*3, true);
// 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, since 0.4 version, Hydrax 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()); */
mRoot->addFrameListener(new ExampleHydraxDemoListener(mWindow, mCamera, mSceneMgr));
The Create Scene Code is almost( missing some light declarations and such) identical to the demo's so I have no Idea why this is happening.
Also, as a side note, I am not using any shadows so there should be no problems with hydrax and stencil shadows.
EDIT: To fix this problem I replaced this line:
// Base Plane
Ogre::Plane(Ogre::Vector3(0,1,0), Ogre::Vector3(0,0,0)),
with this one:
// Base Plane
Ogre::Plane(Ogre::Vector3::UNIT_Y, Ogre::Real(0.0f)),