|
|
用了hydrax这个插件,但是当摄像机在水面上时看不到水,摄像机移到水面下时,却有在水下的效果。
以下是使用代码,照着hydrax的例子用的,运行这个例子能看见水,但是自己的就是不行。OGRE社区问过了,说是禁用阴影,我用ogre时间不长,不知道要禁用哪个的阴影。求高人解答下。
////创建Hydrax对象
mHydrax = new Hydrax::Hydrax(mSceneMgr,mCamera,mViewport);
//创建网格单元
mModule = new Hydrax::Module: rojectedGrid(// 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*/));
// 设置我们的单元
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, Hydrax 0.4 allows save/load config files.
mHydrax->loadCfg("HydraxDemo.hdx");
// Create water
mHydrax->create();
|
|