How to have Caustics effect

laoning

25-06-2013 16:49:04

I'm using Ogitor to build terrian and hydrax for water.The hdx file seems no wrong like this but I got not Caustics effect.
Looking for help and thank you in advance.

Config file
#Hydrax cfg file.

#Hydrax version field
HydraxVersion=0.5.1

#Main options field
<vector3>Position=100x-10x100
<float>PlanesError=1
#Shader mode: 0=HLSL, 1=CG, 2=GLSL
<int>ShaderMode=0
<float>FullReflectionDistance=1e+011
<float>GlobalTransparency=1
<float>NormalDistortion=0.075
<vector3>WaterColor=0.139765x0.359464x0.425373

#Components field
Components=Sun|Foam|Depth|Smooth|Caustics|Underwater|UnderwaterReflections

#Sun parameters
<vector3>SunPosition=2997.92x7460.89x-16863.8
<float>SunStrength=1.75
<float>SunArea=746.089
<vector3>SunColor=1x1x1

#Foam parameters
<float>FoamMaxDistance=7.5e+007
<float>FoamScale=0.0075
<float>FoamStart=0
<float>FoamTransparency=1

#Depth parameters
<float>DepthLimit=9.98

#Smooth transitions parameters
<float>SmoothPower=2

#Caustics parameters
<float>CausticsScale=16
<float>CausticsPower=9
<float>CausticsEnd=0.95

#Rtt quality field(0x0 = Auto)
<size>Rtt_Quality_Reflection=0x0
<size>Rtt_Quality_Refraction=0x0
<size>Rtt_Quality_Depth=0x0
<size>Rtt_Quality_URDepth=0x0
<size>Rtt_Quality_GPUNormalMap=0x0

#Module options
Module=ProjectedGridVertex

<float>PG_ChoopyStrength=1
<bool>PG_ChoppyWaves=true
<int>PG_Complexity=100
<float>PG_Elevation=5
<bool>PG_ForceRecalculateGeometry=true
<bool>PG_Smooth=true
<float>PG_Strength=0

#Noise options
Noise=Perlin

<int>Perlin_Octaves=8
<float>Perlin_Scale=0.185
<float>Perlin_Falloff=0.49
<float>Perlin_Animspeed=1.2
<float>Perlin_Timemulti=1.27
<float>Perlin_GPU_Strength=2
<vector3>Perlin_GPU_LODParameters=0.5x50x150000



And code

Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup("Hydrax");
mHydrax = new Hydrax::Hydrax(mSceneMgr,mActiveCamera, 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_RTT ,
// Projected grid options
Hydrax::Module::ProjectedGrid::Options(/*264 /*Generic one*/));


mHydrax->setModule(static_cast<Hydrax::Module::Module*>(mModule));


mHydrax->loadCfg("Hydrax.hdx");
// Create water
mHydrax->create();
Ogre::TerrainGroup::TerrainIterator ti = mLoader->getTerrainGroup()->getTerrainIterator();
while(ti.hasMoreElements())
{
Ogre::Terrain* t = ti.getNext()->instance;
Ogre::MaterialPtr ptr = t->getMaterial();
mHydrax->getMaterialManager()->addDepthTechnique(ptr->createTechnique());
}