Underwater Objects invisible - HydraxDepthReflectionMap?

Anthea

12-12-2014 09:45:03

Hey there,

I have been struggeling for days now to make Hydrax working. Nevertheless I am stuck now with the "HydraxDepthReflectionMap" error. This errors seems to be a known issue but none of the other solutions worked for me.
If I got this working I promise to write a tutorial for newcomers in Hydrax and Ogre 1.9. :roll:

Here is my setup: Ogre 1.9 64 bit, Hydrax Community Version (compiled for 64 bit)

The error: Objects under the water surface are not visible / rendered, same goes for Objects above the surface looked at from below. As seen in the image only the reflection is visible but not the object itself. I tried it with normal Entities and Terrain.



It's possible related to this error output:
Error loading texture HydraxDepthReflectionMap. Texture layer will be blank. Loa
ding the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFo
undException): Cannot locate resource HydraxDepthReflectionMap in resource group
Hydrax or any other group. in ResourceGroupManager::openResource at ..\..\..\..
\OgreMain\src\OgreResourceGroupManager.cpp (line 756)


My code:

// Create Hydrax object
mHydrax = new Hydrax::Hydrax(mSceneMgr, cam, 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*/));

// 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();

// Set Hydrax sun position and colour
mHydrax->setSunPosition(Ogre::Vector3(5000,10000,0));
mHydrax->setSunColor(Ogre::Vector3(1, 0.9, 0.6));

// Hydrax initialization code end -----------------------------------------
// ------------------------------------------------------------------------

// Load island
/*mHydrax->getMaterialManager()->addDepthTechnique(
static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().getByName("Island"))
->createTechnique());*/


HDX file:

#Hydrax cfg file.

#Hydrax version field
HydraxVersion=0.5.4

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

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

#Sun parameters
<vector3>SunPosition=0x10000x0
<float>SunStrength=1.75
<float>SunArea=150
<vector3>SunColor=1x0.9x0.6

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

#Depth parameters
<float>DepthLimit=90

#Smooth transitions parameters
<float>SmoothPower=5

#Caustics parameters
<float>CausticsScale=135
<float>CausticsPower=10.5
<float>CausticsEnd=0.8

#God rays parameters
<vector3>GodRaysExposure=0.76x2.46x2.29
<float>GodRaysIntensity=0.015
<float>GodRaysSpeed=5
<int>GodRaysNumberOfRays=100
<float>GodRaysRaysSize=0.03
<bool>GodRaysIntersections=false

#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=2.9
<bool>PG_ChoppyWaves=true
<int>PG_Complexity=264
<float>PG_Elevation=50
<bool>PG_ForceRecalculateGeometry=false
<bool>PG_Smooth=false
<float>PG_Strength=25

#Noise options
Noise=Perlin

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


In this post it's mentioned that you need to add the depth technique to your terrain. I am not sure how to do this. Any ideas?

Some related Posts:
viewtopic.php?f=20&t=29763
viewtopic.php?f=20&t=13137
viewtopic.php?f=20&t=11042