Hydrax with terrain component

monah

13-05-2010 20:10:14

I use Hydrax with Caelum end terrain component. But I do not have the caustic effect.
[attachment=0]screen2.jpg[/attachment][attachment=1]screen1.jpg[/attachment]
What is my mistake? How to fix it? Thank.

SniperBinaire

25-05-2010 19:11:37

Quite simple !

You just have to add a "Depth Technique" to Hydrax Material Manager

So, once you've loaded hydrax, you just have to put

mHydrax->getMaterialManager()->addDepthTechnique(static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().getByName("Map"))->createTechnique());


Just change "mHydrax" with your Hydrax object and " Map " with the material name of your terrain ^^


PS: Personaly, SkyX fit better with Hydrax, and as for me best looking than Caellum, but it's your choice

Fr0stY

14-07-2010 01:20:21

Sorry for resurrecting this thread, but I have the same problem.

The textures that I'm using for the terrain are:
sand_1_diffusespecular.dds
sand_1_normalheight.dds

how do I attach a .material file to the terrain? what does the .material file need to have?

Sorry but I'm new to ogre : P

Thanks!

Fr0stY

14-07-2010 16:10:17

I solved my problem. Terrain creates the material internally, i didn't know that : ( here's the solution

TerrainGroup::TerrainIterator ti = mTerrain->getTerrainIterator();
while(ti.hasMoreElements())
{
Terrain* t = ti.getNext()->instance;
MaterialPtr ptr = t->getMaterial();
mHydrax->getMaterialManager()->addDepthTechnique(ptr->createTechnique());
}


just change mTerrain and mHydrax to your applications TerrainGroup var and Hydrax var.

hope this helps anyone with the same problem.

ps: you need to do this with all the objects that go inside the water.