Regarding this line in Mogre Basic Tutorial 3:
mSceneMgr.SetSkyBox(true, "Examples/SpaceSkyBox")
Everything worked fine until I added that code. Then running the program would only display a black screen and display this error:
SEHExeption was unhandled by user code
External component has thrown an exception. (This was mogre.dll)
Setting the first parameter to false returns to normal (displaying the terrain).
Ogre.log displays this:
19:47:05: OGRE EXCEPTION(2:InvalidParametersException): Sky box material 'Examples/SpaceSkyBox' not found. in SceneManager::setSkyBox at ..\..\ogre\OgreMain\src\OgreSceneManager.cpp (line 1714)
But I have the material script, and skybox.zip. I tried extracting the zip file...no joy.
I've tried adding this first in Main, then CreateScene, and then at the beginning to ChooseSceneManager to no avail:
var resourceGroupMgr = new ResourceGroupManager();
resourceGroupMgr.InitialiseAllResourceGroups();
mSceneMgr.SetSkyBox(true, "Examples/SpaceSkyBox")
-
- Gnoblar
- Posts: 3
- Joined: Fri Jul 26, 2013 7:39 pm
- Kojack
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Re: mSceneMgr.SetSkyBox(true, "Examples/SpaceSkyBox")
You shouldn't create a resourcegroupmanager manually, ogre's root creates one.Gamewriter wrote:I've tried adding this first in Main, then CreateScene, and then at the beginning to ChooseSceneManager to no avail:
var resourceGroupMgr = new ResourceGroupManager();
resourceGroupMgr.InitialiseAllResourceGroups();
InitialiseAllResourceGroups should only be called after all paths have been added.
How is your code adding resource paths? Is it using a resource.cfg loader or just manually adding paths in code?
-
- Gnoblar
- Posts: 3
- Joined: Fri Jul 26, 2013 7:39 pm
Re: mSceneMgr.SetSkyBox(true, "Examples/SpaceSkyBox")
There is a resources.cfg file which contains this:
# Resource locations to be added to the 'boostrap' path
# This also contains the minimum you need to use the Ogre example framework
[Bootstrap]
Zip=../../Media/packs/OgreCore.zip
# Resource locations to be added to the default path
[General]
FileSystem=../../Media
FileSystem=../../Media/fonts
FileSystem=../../Media/materials/programs
FileSystem=../../Media/materials/scripts
FileSystem=../../Media/materials/textures
FileSystem=../../Media/models
Zip=../../Media/packs/cubemap.zip
Zip=../../Media/packs/skybox.zip
# Resource locations to be added to the 'boostrap' path
# This also contains the minimum you need to use the Ogre example framework
[Bootstrap]
Zip=../../Media/packs/OgreCore.zip
# Resource locations to be added to the default path
[General]
FileSystem=../../Media
FileSystem=../../Media/fonts
FileSystem=../../Media/materials/programs
FileSystem=../../Media/materials/scripts
FileSystem=../../Media/materials/textures
FileSystem=../../Media/models
Zip=../../Media/packs/cubemap.zip
Zip=../../Media/packs/skybox.zip
- Kojack
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Re: mSceneMgr.SetSkyBox(true, "Examples/SpaceSkyBox")
Are you then doing something like this in your code?
(This is C++, the Mogre version will be similar)
Ogre doesn't understand the resources.cfg file, you need to provide the code yourself to load it.
(This is C++, the Mogre version will be similar)
Code: Select all
Ogre::ConfigFile cf;
cf.load("resources.cfg");
// Go through all sections & settings in the file
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
Ogre::String secName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
for (Ogre::ConfigFile::SettingsMultiMap::iterator i = settings->begin(); i != settings->end(); ++i)
{
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(i->second, i->first, secName,false,i->second.find("zip")!=std::string::npos);
}
}
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
-
- Gnoblar
- Posts: 3
- Joined: Fri Jul 26, 2013 7:39 pm
Re: mSceneMgr.SetSkyBox(true, "Examples/SpaceSkyBox")
No, nothing like that. I'm just using the Mogre Wiki Tutorial Framework and the code at http://www.ogre3d.org/tikiwiki/tiki-ind ... Tutorial+3
My only reference to any cfg file is this line:
mSceneMgr.SetWorldGeometry("terrain.cfg");
I assume that this line in Main is supposed to set everything up:
new Tutorial().Go();
My only reference to any cfg file is this line:
mSceneMgr.SetWorldGeometry("terrain.cfg");
I assume that this line in Main is supposed to set everything up:
new Tutorial().Go();