Some questions about SimpleGrid

raygeee

15-02-2009 19:19:41

Hi,
I wrapped this great plugin to work with managed code (MHydrax 0.4a) and got most of it working but now I have some questions:

1. Is it normal that a SimpleGrid doesn't allow looking underwater? ProjectedGrid works fine but when I'm using SimpleGrid I can't see through the water, no caustics, no ground, no transparency... But if I move the camera underwater I can see the caustics, the ground, the sky, godrays... Refraction doesn't work too, which is kinda obvious. So the trees' relection looks a little bit strange when ending in the middle of the water.

2. How do you set up Hydrax with any Module NOT using a configuration file? I wasn't able to do that. All the ways I tried (setting different parameters) caused a crash when creating the Module inside Hydrax::create(). Working with unmanaged and managed code makes it very hard to find a bug or misusage because I always get the same AccessViolationException.

3. Is it possible to use more than one SimpleGrid?

Thanks and keep up the good work. Waiting for 0.5 ;-)

Xavyiy

17-02-2009 12:03:29

Hi!

1-All modules allows all hydrax features. You can just download the editor and open a .hdx file with simple grid to see(Or just switch to simple grid in water options window).
2-Something like this is the right way to set-up hydrax without using hydrax config files:
// Set our shader mode
mHydrax->setShaderMode(Hydrax::MaterialManager::SM_HLSL);

// Set components
mHydrax->setComponents(
static_cast<Hydrax::HydraxComponent>(Hydrax::HYDRAX_COMPONENT_SUN |
Hydrax::HYDRAX_COMPONENT_FOAM |
Hydrax::HYDRAX_COMPONENT_DEPTH |
Hydrax::HYDRAX_COMPONENT_SMOOTH |
Hydrax::HYDRAX_COMPONENT_CAUSTICS |
Hydrax::HYDRAX_COMPONENT_UNDERWATER |
Hydrax::HYDRAX_COMPONENT_UNDERWATER_REFLECTIONS |
Hydrax::HYDRAX_COMPONENT_UNDERWATER_GODRAYS));

// Set our module (Initial module)
mHydrax->setModule(static_cast<Hydrax::Module::Module*>(ProjectedGridGeometryModuleVertex));
// Create water
mHydrax->create();

// Adjust some options
mHydrax->setPosition(Ogre::Vector3(1500,100,1500)); // Just for simple grid (Projected grid doesn't use it)
mHydrax->setPlanesError(10.5);
mHydrax->setDepthLimit(90);
mHydrax->setSunPosition(mSunPosition[mCurrentSkyBox]);
mHydrax->setSunColor(mSunColor[mCurrentSkyBox]);
mHydrax->setNormalDistortion(0.075);
mHydrax->setWaterColor(Ogre::Vector3(0.139765,0.359464,0.425373));
mHydrax->setSmoothPower(5);
mHydrax->setCausticsScale(135);
mHydrax->setCausticsEnd(0.8);
mHydrax->setCausticsPower(10.5);
mHydrax->setFullReflectionDistance(99999997952);
mHydrax->setGlobalTransparency(0);


3-No.. at the moment only one Hydrax instance is allowed(Wich means only a module at the same time).

Xavi

raygeee

01-04-2009 12:25:03

Just a quick note if someone stumbles over this thread:
Issues 1 and 2 were related to my wrapper and solved now. Hydrax itself works great :)