Hi Xavi
I have some problems. In my environment 1 unit is 1 meter, currently; for example my in-game camera is 1.8m (180cm) above the terrain and so on.
Here is what I'm done:
Code: Select all
Ogre::Real length = 700, width = 420; // Extents of the water plan: 700m x 420m
// Set water mesh options
mHydrax->setMeshOptions( new Hydrax::Mesh::SimpleGridOptions(
Hydrax::Size(length, width), // Mesh size
512) ); // Grid complexity
mHydrax->setModule( new Hydrax::Module::Perlin(mHydrax,
Hydrax::Module::Perlin::Options(
Hydrax::TEX_QUA_512, sqrt(length*width)/12, 0.1, 1, 1, 0.6, 5.0)) );
// Set rtt textures quality
mHydrax->setRttOptions(
Hydrax::RttOptions(Hydrax::TEX_QUA_512, // Reflection tex quality
Hydrax::TEX_QUA_512, // Refraction tex quality
Hydrax::TEX_QUA_512)); // Depth tex quality
// Set components that we want to have
mHydrax->setComponents(
static_cast<Hydrax::HydraxComponent>(Hydrax::HYDRAX_COMPONENT_SUN |
Hydrax::HYDRAX_COMPONENT_FOAM |
Hydrax::HYDRAX_COMPONENT_DEPTH |
Hydrax::HYDRAX_COMPONENT_SMOOTH |
Hydrax::HYDRAX_COMPONENT_CAUSTICS));
// Set shader mode
mHydrax->setShaderMode(Hydrax::MaterialManager::SM_HLSL);
// Create water
mHydrax->create();
mHydrax->setStrength(0.3); // 30cm
mHydrax->setPosition(waterPlanPos);
mHydrax->setPlanesError(0.375);
mHydrax->setSunPosition(sun.Pos);
mHydrax->setSunColor(sunColor);
mHydrax->setNormalDistortion(0.025);
mHydrax->setDepthLimit(1.5); // Just 1.5m
mHydrax->setDepthColor(Ogre::Vector3(0.06,0.33,0.5));
mHydrax->setSmoothPower(5);
mHydrax->setGlobalTransparency(0.2);
mHydrax->setFullReflectionDistance(12000);
and screen shots:
As you see there are no 'foam' and 'coastics'. In addition 'depth' is not correct; although it's obvious at the shores, but here are shots when depth is disabled by
Code: Select all
// Hydrax::HYDRAX_COMPONENT_DEPTH |
Btw in the Hydrax demo everything is ok.
This is the log:
Code: Select all
....
16:31:18: Initialising resource group Hydrax
16:31:18: Parsing scripts for resource group Hydrax
16:31:18: Finished parsing scripts for resource group Hydrax
....
16:31:26: [Hydrax] Hydrax object created.
16:31:26: [Hydrax] Module set.
16:31:26: [Hydrax] Creating module.
16:31:26: [Hydrax] Creating PerlinModule module.
16:31:26: [Hydrax] Creating hydrax texture manager, Textures size: 512
16:31:26: WARNING: Texture instance 'HydraxHeightMap' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
16:31:26: WARNING: Texture instance 'HydraxNormalMap' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
16:31:26: [Hydrax] Hydrax texture manager created.
16:31:27: [Hydrax] PerlinModule created.
16:31:27: [Hydrax] Module created.
16:31:27: [Hydrax] Creating materials,
16:31:27: [Hydrax] Creating water material...
16:31:28: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Reflection in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: Error loading texture Reflection. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Reflection in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Refraction in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: Error loading texture Refraction. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Refraction in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Depth in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: Error loading texture Depth. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Depth in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: Texture: Fresnel.bmp: Loading 1 faces(PF_L8,256x1x1) with 8 generated mipmaps from Image. Internal format is PF_L8,256x1x1.
16:31:28: Texture: Foam.png: Loading 1 faces(PF_R8G8B8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
16:31:28: [Hydrax] Water material created.
16:31:28: [Hydrax] Creating depth material...
16:31:28: Texture: Caustics_0.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_1.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_2.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_3.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_4.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_5.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_6.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_7.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_8.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_9.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_10.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_11.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_12.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_13.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_14.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_15.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_16.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_17.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_18.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_19.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_20.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_21.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_22.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_23.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_24.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_25.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_26.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_27.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_28.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_29.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_30.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: Texture: Caustics_31.bmp: Loading 1 faces(PF_R8G8B8,128x128x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
16:31:28: [Hydrax] Depth material created.
16:31:28: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Reflection in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: Error loading texture Reflection. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Reflection in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Refraction in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: Error loading texture Refraction. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Refraction in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Depth in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: Error loading texture Depth. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Depth in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource HydraxReflectionMap in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: Error loading texture HydraxReflectionMap. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource HydraxReflectionMap in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource HydraxRefractionMap in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: Error loading texture HydraxRefractionMap. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource HydraxRefractionMap in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource HydraxDepthMap in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: Error loading texture HydraxDepthMap. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource HydraxDepthMap in resource group Hydrax or any other group. in ResourceGroupManager::openResource at ..\src\OgreResourceGroupManager.cpp (line 603)
16:31:28: [Hydrax] Materials created.
16:31:28: [Hydrax] Creating water mesh.
16:31:28: WARNING: Mesh instance 'HydraxMesh' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
16:31:28: [Hydrax] Water mesh created
16:31:28: [Hydrax] Creating RTListeners.
16:31:28: Creating viewport on target 'rtt/725567360', rendering from camera 'InGame Camera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
16:31:28: Creating viewport on target 'rtt/725567840', rendering from camera 'InGame Camera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
16:31:28: Creating viewport on target 'rtt/725574304', rendering from camera 'InGame Camera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
16:31:28: WARNING: Texture instance 'HydraxReflectionMap' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
16:31:28: WARNING: Texture instance 'HydraxRefractionMap' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
16:31:28: WARNING: Texture instance 'HydraxDepthMap' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
16:31:28: [Hydrax] RTListeners created
16:31:28: [Hydrax] Registring device restored listener
16:31:28: [Hydrax] Device restored listener registred
16:33:28: Unregistering ResourceManager for type BspLevel
16:33:28: *-*-* OGRE Shutdown
....
Thanks.