Hydrax strange behaviour

Cr3a70r

13-01-2013 12:32:45

Hello all!
Im using Caelum + Hydrax +OgreTerrain
I finally got to work the Hydrax(there was no watersurface and evevryframe update hydrax didnt help)
There is 2 problems:
1. When i update hydrax every frame it slows down the application
2. I get to see water insanely speed up changing its surface, like every 0.1 second (Screenshots will upload a little bit later, im making a function to take it)

// Create Hydrax object
m_pHydrax = new Hydrax::Hydrax(m_pSceneMgr, m_pCamera, OgreFramework::getSingletonPtr()->m_pRenderWnd->getViewport(0));

// Create our projected grid module
Hydrax::Module::ProjectedGrid *mModule = new Hydrax::Module::ProjectedGrid(// Hydrax parent pointer
m_pHydrax,
// Noise module
new Hydrax::Noise::Perlin(/*Generic one*/),
// Base plane
Ogre::Plane(Ogre::Vector3(0,1,0), Ogre::Vector3(0,10,0)),
// Normal mode
Hydrax::MaterialManager::NM_VERTEX,
// Projected grid options
Hydrax::Module::ProjectedGrid::Options(/*264 /*Generic one*/));

// Set our module
m_pHydrax->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.
m_pHydrax->loadCfg("HydraxActual.hdx");

// Create water
m_pHydrax->create();

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

Cr3a70r

13-01-2013 12:41:00

Screenshots are here: http://imageshack.us/g/694/screenshot0113201316362.jpg/
Im very sorry if the politics of the forum are against the links to a different sites, but i really cant upload screenshots here

Cr3a70r

13-01-2013 12:43:13

Btw, my configurations of Hydrax:

#Hydrax cfg file.

#Hydrax version field
HydraxVersion=0.5.4

#Main options field
<vector3>Position=-500x1x-500
<float>PlanesError=10.5
#Shader mode: 0=HLSL, 1=CG, 2=GLSL
<int>ShaderMode=1
<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=3.75
<bool>PG_ChoppyWaves=true
<int>PG_Complexity=264
<float>PG_Elevation=50
<bool>PG_ForceRecalculateGeometry=false
<bool>PG_Smooth=false
<float>PG_Strength=35

#Noise options
Noise=Perlin

<int>Perlin_Octaves=8
<float>Perlin_Scale=0.085
<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

Cr3a70r

13-01-2013 17:42:22

Seems no one is going to help me ?...

WhiteZero

11-04-2013 18:47:52

If it is anything like when I was using NxOgre with the Advanced Ogre Framework, I couldn't update using timeSinceLastFrame as everything would go at lightning speeds. Instead I had to put a different value to replace timeScienceLastFrame.

i.e. in my constructor try and make:
m_MoveSpeed = 0.03; (I tweaked this value to get it to the speed I was happy with)

then update with this value (I guess you can put the value straight into the parameters)

mHydrax->update(m_MoveSpeed);

Then, on the Ogre start up sequence (where you pick between OpenGL or DirectX) I added:
VSync: Yes
VSync Interval: 2 (this limits the application to 30FPS, 60FPS was okay but still updated a little too fast).

Without this my physics simulations were going stupidly fast. I hope this is a solution for Hydrax too