I have integrated the Hydrax 0.5 and Caelum 0.4 in my project. Thanks for Xavyiy and Cdleonard's great work. And the topic HOW TO: Integrate Hydrax V0.4 with Caemum in Ogre forum also give me a great favor.
First some screen shot of my recenly work. All of them are rendered by OpenGL and CG. Some detail information can be found in my previous post.
Except for the problems metioned in forum topic, I also solved some new problems
1. I found PointStarFiled can not reflect on ocean surface. This problem can be solved by changing material StarPoint's atrribute cull_hardwar as none.
// Works with default culling:
2. I'm very pleased with the visual effect of Hydrax. However, using Hydrax has been a very large perfomance hit for us. I test the project grid with perlin noise. I found noise calculation is the bottleneck of the CPU. So I excute void Perlin::_calculeNoise() in another thread. The modification is very small, only take care about memory protection is enough.
3. The water doesn't follow the camera expecially when rotate the camera horizontally, see the screeshot as example.
The project grid's lagging can be solved by streching the projected water area. The project area is determinde by four conner point, so the code is changed as red color shows:
bool ProjectedGrid::_renderGeometry(const Ogre::Matrix4& m,const Ogre::Matrix4& _viewMat, const Ogre::Vector3& WorldPos)
t_corners0 = _calculeWorldPosition(Ogre::Vector2( 0.0f, 0.0f),m,_viewMat);
t_corners1 = _calculeWorldPosition(Ogre::Vector2(+1.0f, 0.0f),m,_viewMat);
t_corners2 = _calculeWorldPosition(Ogre::Vector2(-0.2f,+1.0f),m,_viewMat);
t_corners3 = _calculeWorldPosition(Ogre::Vector2(+1.2f,+1.0f),m,_viewMat);