compvis
22-09-2009 05:03:15
hi,
I use Hydrax 0.5.1 and SkyX 0.1. My app runs normally but image is not expected
My terrain ground is black color and there is a line between sky and sea ....
Anybody help me
Thanks,
Gemberkoekje
22-09-2009 06:54:45
Firstly, you might add some code what you are doing, and where you think you might have gone wrong.
Secondly, the grass in the front, does it have alpha? Cause it looks to me as if the water isn't drawn because this grass is sticking out... I'm not entirely sure without any code though.
If you want a lame way of solving it, I guess you could always set your background color to blue-ish, at least it'd be less noticable
Xavyiy
22-09-2009 17:17:07
Can you post your Hydrax and SkyX initializing related code and your camera far clip distance value?
compvis
23-09-2009 04:49:14
Sorry, i use Hydrax 0.5.0 & SkyX 0.1
Can you post your Hydrax and SkyX initializing related code and your camera far clip distance value? 
Hydrax Initialization:
m_Sea = new Hydrax::Hydrax(m_Scene,m_Cam,m_Render->getViewport(0));
if (!m_Sea)
{
return E_OCEAN;
}
Hydrax::Module::ProjectedGrid* module = new Hydrax::Module::ProjectedGrid(
m_Sea,
new Hydrax::Noise::Perlin,
Plane(K_VECTOR(0,1,0),K_VECTOR(0,0,0)),
Hydrax::MaterialManager::NM_VERTEX,
Hydrax::Module::ProjectedGrid::Options()
);
m_Sea->setModule(static_cast<Hydrax::Module::Module*>(module));
std::vector<Ogre::RenderQueueGroupID> caelumskyqueue;
caelumskyqueue.push_back(static_cast<Ogre::RenderQueueGroupID>(Ogre::RENDER_QUEUE_SKIES_EARLY + 2));
m_Sea->getRttManager()->setDisableReflectionCustomNearCliplPlaneRenderQueues (caelumskyqueue);
m_Sea->loadCfg("HydraxDemo.hdx");
m_Sea->create();
m_Scene->setWorldGeometry("Island.cfg");
m_Sea->getMaterialManager()->addDepthTechnique(
static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().getByName("Island"))
->createTechnique());
And code for SkyX
m_Sky2 = new SkyX::SkyX(m_Scene,m_Cam);
m_Sky2->create();
m_Sky2->getGPUManager()->addGroundPass(
static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().
getByName("Terrain"))->getTechnique(0)->createPass(), 5000, Ogre::SBT_TRANSPARENT_COLOUR);
m_Sky2->getCloudsManager()->add(SkyX::CloudLayer::Options(/* Default options */));
If i use with Caelum plugin, all things normally ...
BTW: With Hydrax 0.5.0 and Caelum. If i crate a scene at startup then the sun normally reflects on ground But my game have two scenes that need to switch, when i re-create the scene (Hydrax 0.5.0 and Caelum - not at startup ) then ground becomes black color. Below is a code to destroy scene:
//Caelum
if (m_SkySystem)
{
m_SkySystem->shutdown(true);
m_SkySystem = 0;
}
//Hydrax
if (m_Sea)
{
m_Sea->remove();
m_Sea = 0;
}
//Remove terrain
m_Scene->clearScene();
I'm having exactly the same problem - it looks like a dark water plane is bleeding through at the very shallow areas around the terrain, and the same line against the sky. I'm using H0.4 under Linux w/OpenGL.
If I increase the plane error it removes the dark shallow water problem but creates nasty errors around the floating objects. I'm using ETM terrain.
I'm using these settings:
mpHydrax->setRttOptions(Hydrax::RttOptions(Hydrax::TEX_QUA_1024, Hydrax::TEX_QUA_1024, Hydrax::TEX_QUA_1024)); // Set RTT textures quality
mpHydrax->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 components
Hydrax::Module::ProjectedGrid* module = new Hydrax::Module::ProjectedGrid(mpHydrax, new Hydrax::Noise::Perlin(), Ogre::Plane(Ogre::Vector3(0, 1, 0), Ogre::Vector3(0, 0, 0)), Hydrax::Module::ProjectedGrid::Options(256, 20.0, 0.5, true)); // Create our projected grid module
mpHydrax->setModule(static_cast<Hydrax::Module::Module*>(module)); // Set our module
mpHydrax->setShaderMode(Hydrax::MaterialManager::SM_CG); // Set our shader mode to CG
mpHydrax->create(); // Create water
// Adjust some options
mpHydrax->setPosition(Ogre::Vector3(0, -5.0, 0));
mpHydrax->setDepthLimit(10);
mpHydrax->setSunPosition(Ogre::Vector3(0, 1000, -9000));
mpHydrax->setSunColor(Ogre::Vector3(1, 0.9, 0.6) / 5);
mpHydrax->setDepthColor(Ogre::Vector3(0.04, 0.135, 0.185));
mpHydrax->setSmoothPower(2000);
mpHydrax->setPolygonMode(0);
Ogre::MaterialPtr matPtr = Ogre::MaterialManager::getSingleton().getByName("ETTerrainMaterial");
mpHydrax->getMaterialManager()->addDepthTechnique(matPtr, 0);
It looks like the reflection plane is rising further up the beach than the transparent plane - which is why you can see the reflective dark water on the shallowest parts - is this possible? If so, how can I fix this without it mucking up and tearing the plane around the floating objects?
So the dark reflection plane popping out near the shallow water can be fixed with the planeerror variable -> 10.0 worked for me.
The tearing this causes around floating objects can be fixed by upgrading to Hydrax 0.5
The line along the sky is also fixed by upgrading to Hydrax 0.5