using skyDome in tutorials

anear

08-03-2007 12:30:03

I'm trying to use skyDome in a tutorial.

In createScene() in the tutorial, I added

mSceneMgr->setSkyDome( true, "Examples/CloudySky", 5, 8 );


In tutorialSimple.h I added ResourceGroupMangager::getSingleton...

void chooseSceneManager(void)
{
mSceneMgr = mRoot->createSceneManager(ST_GENERIC, "NxOgre");
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
}



and in the resources.cfg file, I pasted paths from Ogre's resources.cfg. now my NxOgre resouces.cfg is:

# Resource locations to be added to the 'boostrap' path
# This also contains the minimum you need to use the Ogre example framework
[Bootstrap]
FileSystem=../Media/overlays/
Zip=C:/ogrenew/Animism/Media/packs/OgreCore.zip

# Resource locations to be added to the default path
[General]
FileSystem=../Media/
FileSystem=../Media/images/
FileSystem=../Media/materials/
FileSystem=../Media/meshes/
FileSystem=../Media/particles/
FileSystem=../Media/315/
FileSystem=C:/ogrenew/Animism/Media
FileSystem=C:/ogrenew/Animism/Media/fonts
FileSystem=C:/ogrenew/Animism/Media/materials/programs
FileSystem=C:/ogrenew/Animism/Media/materials/scripts
FileSystem=C:/ogrenew/Animism/Media/materials/textures
FileSystem=C:/ogrenew/Animism/Media/models
FileSystem=C:/ogrenew/Animism/Media/overlays
FileSystem=C:/ogrenew/Animism/Media/particle
FileSystem=C:/ogrenew/Animism/Media/gui
FileSystem=C:/ogrenew/Animism/Media/DeferredShadingMedia
Zip=C:/ogrenew/Animism/Media/packs/cubemap.zip
Zip=C:/ogrenew/Animism/Media/packs/cubemapsJS.zip
Zip=C:/ogrenew/Animism/Media/packs/dragon.zip
Zip=C:/ogrenew/Animism/Media/packs/fresneldemo.zip
Zip=C:/ogrenew/Animism/Media/packs/ogretestmap.zip
Zip=C:/ogrenew/Animism/Media/packs/skybox.zip


When I run the program, the screen blinked and the program terminated. I got the following error in Ogre.log file:

-----------------------------------
Details:
-----------------------------------
Error #: 6
Function: ResourceManager::add
Description: Resource with the name Core/NodeMaterial already exists..
File: ..\src\OgreResourceManager.cpp
Line: 89
Stack unwinding: <<beginning of stack>>
12:05:36: Unregistering ResourceManager for type BspLevel
12:05:36: *-*-* OGRE Shutdown
12:05:36: Unregistering ResourceManager for type Compositor
12:05:36: Unregistering ResourceManager for type Font
12:05:36: Unregistering ResourceManager for type Skeleton
12:05:36: Unregistering ResourceManager for type Mesh
12:05:36: Unregistering ResourceManager for type HighLevelGpuProgram
12:05:36: Unloading library .\Plugin_CgProgramManager
12:05:36: Unloading library .\Plugin_OctreeSceneManager
12:05:36: Unloading library .\Plugin_BSPSceneManager
12:05:36: Unloading library .\Plugin_ParticleFX
12:05:36: *** Stopping Win32GL Subsystem ***
12:05:36: Unloading library .\RenderSystem_GL
12:05:37: Render Target 'Catching falling oranges' Average FPS: 0 Best FPS: 0 Worst FPS: 999
12:05:37: D3D9 : Shutting down cleanly.
12:05:37: Unregistering ResourceManager for type Texture
12:05:37: Unregistering ResourceManager for type GpuProgram
12:05:37: D3D9 : Direct3D9 Rendering Subsystem destroyed.
12:05:37: Unloading library .\RenderSystem_Direct3D9
12:05:37: Unregistering ResourceManager for type Material
12:05:37: Unloading library OgrePlatform.dll


It seems that I have two of the same files that are trying to load the same things with the same name. Shall I delete something in the resources.cfg?

Thanks

betajaen

08-03-2007 12:41:16

I would. NxOgre doesn't have a material Core/NodeMaterial. - Unless it's one of those materials in OgreCore.zip, which NxOgre uses a copy of.

anear

08-03-2007 13:16:54

Thanks for reply. Now I change the NxOgre resources.cfg as the following, and the program runs.


# Resource locations to be added to the 'boostrap' path
# This also contains the minimum you need to use the Ogre example framework
[Bootstrap]
FileSystem=../Media/overlays/

# Resource locations to be added to the default path
[General]
FileSystem=../Media/
FileSystem=../Media/images/
FileSystem=../Media/materials/
FileSystem=../Media/meshes/
FileSystem=../Media/particles/
FileSystem=../Media/315/
FileSystem=C:/ogrenew/Animism/Media/materials/scripts
FileSystem=C:/ogrenew/Animism/Media/materials/textures


But in my scene the sky is still dark grey (the tutorials default sky). Any idea what is wrong?

anear

08-03-2007 13:32:39

Fixed. The default sky distance 5000 was too far.

Change it to this fix the problem.

mSceneMgr->setSkyDome( true, "Examples/CloudySky", 5, 8, 200, false);

betajaen

08-03-2007 13:48:30

You can turn off or adjust the fog levels as well.