Difference between two initializations of Caelum

compvis

31-08-2009 10:09:43

hi,

I have a problem with initialization of Caelum. In use the code below to init my Sky system:

initSkySystem() function like:

Caelum::CaelumSystem::CaelumComponent componentMask;
componentMask = static_cast<Caelum::CaelumSystem::CaelumComponent> (
Caelum::CaelumSystem::CAELUM_COMPONENT_SUN |
Caelum::CaelumSystem::CAELUM_COMPONENT_MOON |
Caelum::CaelumSystem::CAELUM_COMPONENT_SKY_DOME |
//Caelum::CaelumSystem::CAELUM_COMPONENT_IMAGE_STARFIELD |
Caelum::CaelumSystem::CAELUM_COMPONENT_POINT_STARFIELD |
Caelum::CaelumSystem::CAELUM_COMPONENT_CLOUDS |
0);
componentMask = Caelum::CaelumSystem::CAELUM_COMPONENTS_DEFAULT;

m_SkySystem = new Caelum::CaelumSystem (Root::getSingletonPtr(), m_Scene, componentMask);

if (!m_SkySystem)
{
m_Log->logMessage("Klink® 3D Simulations: - Initializing Klink® Sky™ not successfully <?>");
m_Log->logMessage("------------------------------------------------------------------------------------------------------------------------------");
return E_SKY;
}

m_SkySystem->setManageSceneFog(false);
m_Scene->setFog(FOG_NONE);

m_SkySystem->getUniversalClock ()->setTimeScale(2);

m_SkySystem->getCloudSystem()->getLayer(0)->setCloudSpeed(Ogre::Vector2(0.0005, -0.0059));

m_SkySystem->notifyCameraChanged(m_Cam);


then i update the sky sytem in frameStarted() function. In createScenes() function, i call initialization function and my app runs OK with log of Caelum like:


Caelum: Initialising Caelum system...
16:14:42: Caelum: Plugin not installed; installing now.
16:14:42: Caelum plugin version 0.5.0 installed
16:14:42: Registering ResourceManager for type PropertyScript
16:14:42: Caelum: Creating caelum sub-components.
16:14:42: Texture: EarthClearSky2.png: Loading 1 faces(PF_A8R8G8B8,64x64x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x64x1.
16:14:42: Texture: AtmosphereDepth.png: Loading 1 faces(PF_R8G8B8,32x1x1) with hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,32x1x1.
16:14:42: Caelum: Creating CaelumSphericDome sphere mesh resource...
16:14:42: Caelum: generateSphericDome DONE
16:14:42: Texture: sun_disc.png: Loading 1 faces(PF_A8R8G8B8,128x128x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,128x128x1.
16:14:42: D3D9 : Loading 2D Texture, image name : 'moon_disc.dds' with 5 mip map levels
16:14:42: D3D9 : Loading 2D Texture, image name : 'noise1.dds' with 5 mip map levels
16:14:42: D3D9 : Loading 2D Texture, image name : 'noise2.dds' with 5 mip map levels
16:14:42: D3D9 : Loading 2D Texture, image name : 'noise4.dds' with 5 mip map levels
16:14:42: Caelum: DONE initializing


Then to change my scene to next level of game. I need to delete such sky system to re-create a new sky stem (at runtime) by calling the function above, so the sun of sky system didn't reflect on terrain and Hydrax. I have the log of Caelum after re-creating:


16:14:44: Caelum: Initialising Caelum system...
16:14:44: Caelum: Creating caelum sub-components.
16:14:44: Caelum: DONE initializing


Compare between two logs of Caelum's initialization then i think Caelum didn't re-load resources like in the first load in createScenes() function so this is a reason that makes the sun didn't reflect on terrain and Hydrax.

I have a question is how can i manually load Caelum's resources when Caelum doesn't re-load resources ?

Thanks