raymccooney
08-08-2009 17:15:44
Hi guys,
I have a strange problem, maybe someone of you knows what the problem might be:
In my Scene I have a Hydrax surface, which works perfectly in Visual Studio C++ 2008 in Debug and Release mode by pressing F5. However, If I launch the release application by doubleclicking on the .exe file in the explorer, my skybox is not visible until I move the camera for the first time. Funny thing is that it works in Debug mode, so I guess that it is some kind of optimization problem.
Has anybody ever had such a strange problem?
NB: The starting position of my camera is underwater.
NB2: I can move the mouse (change the camera's lookAt) but it still doesn't work until I move the camera's position, from then on it works perfectly.
Here are two screenshots:
Running in Release or Debug mode from VC++ or running debug mode from explorer:
Running Release mode from explorer:
Relevant Code:
I have a strange problem, maybe someone of you knows what the problem might be:
In my Scene I have a Hydrax surface, which works perfectly in Visual Studio C++ 2008 in Debug and Release mode by pressing F5. However, If I launch the release application by doubleclicking on the .exe file in the explorer, my skybox is not visible until I move the camera for the first time. Funny thing is that it works in Debug mode, so I guess that it is some kind of optimization problem.
Has anybody ever had such a strange problem?
NB: The starting position of my camera is underwater.
NB2: I can move the mouse (change the camera's lookAt) but it still doesn't work until I move the camera's position, from then on it works perfectly.
Here are two screenshots:
Running in Release or Debug mode from VC++ or running debug mode from explorer:
Running Release mode from explorer:
Relevant Code:
// Setup scene
mSceneMgr->setSkyBox(true, "Sky/EarlyMorning", 10000.0f);
mCamera->setPosition(0.0f, 0.0f, 0.0f);
mCamera->lookAt(0.0f, 0.0f, -3000.0f);
Ogre::Vector3 mSunPosition = Ogre::Vector3(-1000.0f, 500.0f, -2000.0f);
Ogre::Vector3 mSunColor = Ogre::Vector3(1,0.6,0.4);
// Light
Ogre::Light *mLight = mSceneMgr->createLight("Sun");
mLight->setPosition(mSunPosition);
mLight->setDiffuseColour(1, 1, 1);
mLight->setSpecularColour(mSunColor.x, mSunColor.y, mSunColor.z);
// hydrax
// Create Hydrax object
hydrax = new Hydrax::Hydrax(mSceneMgr, mCamera, mWindow->getViewport(0));
// Create our projected grid module
Hydrax::Module::ProjectedGrid *mModule = new Hydrax::Module::ProjectedGrid(// Hydrax parent pointer
hydrax,
// 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
hydrax->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.
hydrax->loadCfg("Demo.hdx");
// Create water
hydrax->create();
hydrax->setSunPosition(mSunPosition);
hydrax->setSunColor(mSunColor);
------------------------------------------------------------------------------------
// update
bool GameEngine::frameStarted(const FrameEvent& evt) {
hydrax->update(evt.timeSinceLastFrame);
}