Caustics won't show up

Arilon

07-07-2011 20:53:16

Hi,

I tried to set up Hydrax like it is in the demo. Everything works fine, except the caustic.

Here is my code:


//set ambilight and skybox
ogreSceneManager->setAmbientLight(Ogre::ColourValue(1, 1, 1));
ogreSceneManager->setSkyBox(true, "Sky/ClubTropicana", 99999*3, true);

//create camera
ogreCamera = ogreSceneManager->createCamera("MainCam");

//add viewport for camera
ogreViewport = ogreRenderWindow->addViewport(ogreCamera);

//set init values for Camera
ogreCamera->setPosition(TDAppSettings::getInstance()->getSettings().cameraPos);
ogreCamera->setOrientation(TDAppSettings::getInstance()->getSettings().cameraOrientation);
ogreCamera->setFarClipDistance(99999*6);

//create sun light and set location, color
Ogre::Light *mLight = ogreSceneManager->createLight("Light0");
mLight->setPosition(Ogre::Vector3(0,10000,0));
mLight->setDiffuseColour(1, 1, 1);
mLight->setSpecularColour(Ogre::Vector3(1, 0.9f, 0.6f).x, Ogre::Vector3(1, 0.9f, 0.6f).y, Ogre::Vector3(1, 0.9f, 0.6f).z);



//-------------- BEGINN WATER ------------------
//create hydrax pointer object
m_water = new Hydrax::Hydrax(ogreSceneManager, ogreCamera, ogreRenderWindow->getViewport(0));
//create pointer module (hydrax pointer, noise module, base plane, normal mode, projected grid option)
Hydrax::Module::ProjectedGrid *module = new Hydrax::Module::ProjectedGrid(m_water, new Hydrax::Noise::Real(), Ogre::Plane(Ogre::Vector3(0,1,0), Ogre::Vector3(0,0,0)), Hydrax::MaterialManager::NM_VERTEX, Hydrax::Module::ProjectedGrid::Options());
// Add some waves
static_cast<Hydrax::Noise::Real*>(module->getNoise())->addWave(
Ogre::Vector2(1.f,0.f),
0.3f,
10.f);
static_cast<Hydrax::Noise::Real*>(module->getNoise())->addWave(
Ogre::Vector2(0.85f,0.15f),
0.15f,
8.f);
static_cast<Hydrax::Noise::Real*>(module->getNoise())->addWave(
Ogre::Vector2(0.95f,0.1f),
0.1f,
7.f);

m_water->setModule(static_cast<Hydrax::Module::Module*>(module));
//load params of water
m_water->loadCfg("HydraxDemo.hdx");
//create water
m_water->create();
//-------------- END WATER ------------------


ogreSceneManager->setWorldGeometry("Island.cfg");

m_water->getMaterialManager()->addDepthTechnique(static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().getByName("Island"))->createTechnique());




In the Framelistener I have a m_hydrax->update(...). That works, because I can see foams. The terrain "Island" is shown too and the material too.
Has anybody a suggestion why there are no caustics? Thx for answers.

H0THEAD

12-07-2011 06:00:38

Show config file please.

Arilon

12-07-2011 21:37:02

the ogre.cfg:
Render System=OpenGL Rendering Subsystem

[OpenGL Rendering Subsystem]
FSAA=0
Full Screen=No
RTT Preferred Mode=FBO
Video Mode=1024 x 768



the plugin file:
# Defines plugins to load

# Define plugin folder
PluginFolder=./plugins

# Define plugins
Plugin=RenderSystem_GL
Plugin=Plugin_ParticleFX
Plugin=Plugin_BSPSceneManager
Plugin=Plugin_OctreeSceneManager
Plugin=Plugin_CgProgramManager



the recource cfg:
# Resource locations to be added to the 'boostrap' path
# This also contains the minimum you need to use the Ogre example framework
[Bootstrap]
Zip=media/packs/OgreCore.zip

# Resource locations to be added to the default path
[General]
FileSystem=media
FileSystem=media/materials/programs
FileSystem=media/materials/scripts
FileSystem=media/materials/textures
FileSystem=media/models
Zip=media/packs/SkyBoxes.zip

[Hydrax]
FileSystem=media/Hydrax



and the island cfg:
#number of times the detail texture will tile in a terrain tile
DetailTile=3

# Heightmap source
PageSource=Heightmap

# Heightmap-source specific settings
#Heightmap.image=Island.png
Heightmap.image=Bay.png

# How large is a page of tiles (in vertices)? Must be (2^n)+1
PageSize=513

# How large is each tile? Must be (2^n)+1 and be smaller than PageSize
TileSize=17

# The maximum error allowed when determining which LOD to use
MaxPixelError=3

# The size of a terrain page, in world units
PageWorldX=10000
PageWorldZ=8000
# Maximum height of the terrain
MaxHeight=1000

# Upper LOD limit
MaxMipMapLevel=1

VertexNormals=yes
#VertexColors=yes
#UseTriStrips=yes

# Use vertex program to morph LODs, if available
#VertexProgramMorph=yes

# The proportional distance range at which the LOD morph starts to take effect
# This is as a proportion of the distance between the current LODs effective range,
# and the effective range of the next lower LOD
#LODMorphStart=0.2

# This following section is for if you want to provide your own terrain shading routine
# Note that since you define your textures within the material this makes the
# WorldTexture and DetailTexture settings redundant

# The name of the vertex program parameter you wish to bind the morph LOD factor to
# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
# to the same position as the next lower LOD
# USE THIS IF YOU USE HIGH-LEVEL VERTEX PROGRAMS WITH LOD MORPHING
#MorphLODFactorParamName=morphFactor

# The index of the vertex program parameter you wish to bind the morph LOD factor to
# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
# to the same position as the next lower LOD
# USE THIS IF YOU USE ASSEMBLER VERTEX PROGRAMS WITH LOD MORPHING
#MorphLODFactorParamIndex=4

# The name of the material you will define to shade the terrain
CustomMaterialName=Island


and at last the Hydrax.hdx file
#Hydrax cfg file.

#Hydrax version field
HydraxVersion=0.5.4

#Main options field
<vector3>Position=0x50x0
<float>PlanesError=10.5
#Shader mode: 0=HLSL, 1=CG, 2=GLSL
<int>ShaderMode=1
<float>FullReflectionDistance=1e+011
<float>GlobalTransparency=0.2
<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+006
<float>FoamScale=0.0001
<float>FoamStart=0
<float>FoamTransparency=1

#Depth parameters
<float>DepthLimit=100
<float>DistLimit=500

#Smooth transitions parameters
<float>SmoothPower=5

#Caustics parameters
<float>CausticsScale=135
<float>CausticsPower=55
<float>CausticsEnd=0.4

#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=0.375
<bool>PG_ChoppyWaves=true
<int>PG_Complexity=264
<float>PG_Elevation=5
<bool>PG_ForceRecalculateGeometry=false
<bool>PG_Smooth=true
<float>PG_Strength=3.5

#Noise options
Noise=Real

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



I hope i posted all configuration files which are necessary. Thanks for helping.

H0THEAD

13-07-2011 07:42:46

<float>FoamStart=0 this param must be below zero, e.g <float>FoamStart=-0.5
It`s a "bug ?" in 0.5.4 vers.

Arilon

13-07-2011 10:09:42

Thx, but that did solve another problem, that I did not have real foam. Now I have it ;). The caustics I am concerning too are the ones between water and island. When I turn off the shader hsls, gsls and cg in the island.material I have a red island (obvious, because there are no shader selected) but the caustics show up.

H0THEAD

13-07-2011 11:46:09

try to increase caustic end from 0.4 to 10.0

Arilon

13-07-2011 17:21:35

i thx that worked too, but I also mixed up the renderer init. Thank you for the help.