Fail to compile the Hydrax054 with 1.81 due to "uwatercolor"

leafkw01

15-04-2013 18:37:09

OGRE EXCEPTION(2:InvalidParametersException): Parameter called uWaterColor does not exist. in GpuProgramParameters::_findNamedConstantDefinition at U:\SDKS\Ogre\OgreMain\src\OgreGpuProgramParams.cpp (line 1451)

Please help me to solve it or give me some hints. I have no ideas to solve it. Do I need to modified something in MaterialManager.cpp or something in Hydrax?

I initial Hydrax by the code
mSceneMgr->setSkyBox(true, "Sky/ClubTropicana", 5000, false);

mHydrax = new Hydrax::Hydrax(mSceneMgr, mCamera, mWindow->getViewport(0));


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


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

// Create water
mHydrax->create();


Any help will be so appreciated. Thx a lot.

leafkw01

30-04-2013 10:20:59


#include "lab2b.h"
using namespace Ogre;


//-------------------------------------------------------------------------------------
lab2bApp::lab2bApp(void)
://mDistTypeMode(0),
mTerrainGlobals(0),
mTerrainGroup(0),
mTerrainsImported(false)
//mInfoLabel(0)
{
mHydrax=0;
}
//-------------------------------------------------------------------------------------
lab2bApp::~lab2bApp(void)
{
//destroyScene();
}

void lab2bApp::destroyScene(void)
{
OGRE_DELETE mTerrainGroup;
OGRE_DELETE mTerrainGlobals;
}


void lab2bApp::createTerrainScene(void)
{
mCamera->setNearClipDistance(0.1f);
mCamera->setFarClipDistance(50000.f);
mCamera->setPosition(31.3f,20.6f,152.4f);
mCamera->lookAt(Vector3(150.f,0.f,150.f));

Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup("Hydrax");
mHydrax = new Hydrax::Hydrax(mSceneMgr, mCamera, mWindow->getViewport(0));
// adapted from http://www.ogre3d.org/tikiwiki/Creating+Overlays+via+Code&structure=Cookbook

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


mHydrax->setModule(static_cast<Hydrax::Module::Module*>(mModule));


mHydrax->loadCfg("HydraxDemo.hdx");

// Create water
mHydrax->create();


Ogre::ColourValue fadeColour(0.9, 0.9, 0.9);
//mSceneMgr->setFog(Ogre::FOG_LINEAR, fadeColour, 0.0, 10, 1200);
mWindow->getViewport(0)->setBackgroundColour(fadeColour);

Ogre::Plane plane;
plane.d = 100;
plane.normal = Ogre::Vector3::NEGATIVE_UNIT_Y;


mSceneMgr->setSkyPlane(true, plane, "Examples/CloudySky", 500, 20, true, 0.5, 150, 150);

}






void lab2bApp::createScene(void)
{
createTerrainScene();

}


bool
lab2bApp::frameRenderingQueued(const Ogre::FrameEvent& evt)
{
bool ret = BaseApplication::frameRenderingQueued(evt);
mHydrax->update(evt.timeSinceLastFrame);

return ret;
}


I solved the problem by the code above.
i can sea the sea surface but it is running very slow, say 3-15 fps.
Dose any one can helpppppp?